merge: sync main branch

This commit is contained in:
IchliebedichZhu 2024-03-28 17:45:44 +00:00
commit 7da1a789ef
3 changed files with 9 additions and 7 deletions

View File

@ -67,7 +67,8 @@ function blurInput() {
}
}
function getValue(value: string) {
return value.replace(/\n|\r\n/g, '<br/>').replace(/ /g, '&nbsp;')
return value
// return value.replace(/\n|\r\n/g, '<br/>').replace(/ /g, '&nbsp;')
}
</script>

View File

@ -164,8 +164,7 @@ function updateRecord() {
}
function updateText(e?: Event) {
const value = e && e.target ? (e.target as HTMLElement).innerHTML : props.params.text.replace(/\n/g, '<br/>')
// const value = (e ? e.target.innerText : props.params.text).replace(/<br\/>/g, '\r\n').replace(/&nbsp;/g, ' ')
const value = e && e.target ? (e.target as HTMLElement).innerHTML : props.params.text//.replace(/\n/g, '<br/>')
if (value !== props.params.text) {
store.dispatch('updateWidgetData', {
uuid: props.params.uuid,
@ -242,7 +241,7 @@ defineExpose({
.edit-text {
outline: none;
word-break: break-word;
// white-space: pre;
white-space: pre-wrap;
margin: 0;
}
.effect-text {

View File

@ -79,13 +79,15 @@ function paste() {
*/
function undo(shiftKey: any) {
const historyStore = useHistoryStore()
console.log(store.getters.dHistoryParams);
if (shiftKey) {
if (!(historyStore.dHistoryParams.index === historyStore.dHistoryParams.length - 1)) {
historyStore.handleHistory("redo")
// store.dispatch('handleHistory', 'redo')
}
} else if (!(historyStore.dHistoryParams.index === -1 || (historyStore.dHistoryParams.index === 0 && historyStore.dHistoryParams.length === 10))) {
historyStore.handleHistory("undo")
// store.dispatch('handleHistory', 'undo')
} else if (historyStore.dHistoryParams.index !== -1) {
// this.handleHistory('undo')
store.dispatch('handleHistory', 'undo')
}
}