@lvce-editor/editor-worker 19.74.7 → 19.74.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorWorkerMain.js +22 -4
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -16179,10 +16179,28 @@ const getSelections2 = editorUid => {
|
|
|
16179
16179
|
return selections;
|
|
16180
16180
|
};
|
|
16181
16181
|
const setSelections2 = async (editorUid, selections) => {
|
|
16182
|
-
const
|
|
16183
|
-
|
|
16184
|
-
|
|
16185
|
-
|
|
16182
|
+
const requested = get$8(editorUid);
|
|
16183
|
+
if (!requested || requested.newState.lifecycle?.disposed) {
|
|
16184
|
+
return;
|
|
16185
|
+
}
|
|
16186
|
+
const requestedLifecycle = requested.newState.lifecycle;
|
|
16187
|
+
await enqueue(editorUid, async () => {
|
|
16188
|
+
const instance = get$8(editorUid);
|
|
16189
|
+
if (!instance || instance.newState.lifecycle?.disposed || instance.newState.lifecycle !== requestedLifecycle) {
|
|
16190
|
+
return;
|
|
16191
|
+
}
|
|
16192
|
+
const editor = instance.newState;
|
|
16193
|
+
const {
|
|
16194
|
+
lifecycle
|
|
16195
|
+
} = editor;
|
|
16196
|
+
const newEditor = setSelections$2(editor, selections);
|
|
16197
|
+
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
16198
|
+
const current = get$8(editorUid);
|
|
16199
|
+
if (!current || lifecycle?.disposed || current.newState.lifecycle !== lifecycle) {
|
|
16200
|
+
return;
|
|
16201
|
+
}
|
|
16202
|
+
set$a(editorUid, current.oldState, newEditorWithDerivedState);
|
|
16203
|
+
});
|
|
16186
16204
|
};
|
|
16187
16205
|
const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocus$1) => {
|
|
16188
16206
|
const editor = getEditor$1(editorUid);
|