@lvce-editor/editor-worker 19.29.5 → 19.29.6

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.
@@ -2115,17 +2115,17 @@ const applyWidgetChange = async (editor, widget, changes) => {
2115
2115
  ...newState
2116
2116
  };
2117
2117
  }
2118
- return widget;
2118
+ return editor;
2119
2119
  };
2120
2120
 
2121
2121
  const applyWidgetChanges = async (editor, changes) => {
2122
2122
  const widgets = editor.widgets || [];
2123
2123
  if (widgets.length === 0) {
2124
- return widgets;
2124
+ return editor;
2125
2125
  }
2126
2126
  let latestEditor = editor;
2127
2127
  for (const widget of widgets) {
2128
- latestEditor = await applyWidgetChange(editor, widget, changes);
2128
+ latestEditor = await applyWidgetChange(latestEditor, widget, changes);
2129
2129
  }
2130
2130
  return latestEditor;
2131
2131
  };
@@ -8898,6 +8898,7 @@ const createFn = (key, name, widgetId) => {
8898
8898
  const latestAfterInvoke = get$8(editor.uid).newState;
8899
8899
  const latestChildIndex = latestAfterInvoke.widgets.findIndex(isWidget);
8900
8900
  if (latestChildIndex === -1) {
8901
+ set$8(editor.uid, editor, latestAfterInvoke);
8901
8902
  return latestAfterInvoke;
8902
8903
  }
8903
8904
  const diff = await invoke(`${name}.diff2`, uid);
@@ -9972,6 +9973,7 @@ const create = () => {
9972
9973
  id: SourceAction$1,
9973
9974
  newState: {
9974
9975
  commands: [],
9976
+ editorUid: 0,
9975
9977
  focusedIndex: 0,
9976
9978
  height: 0,
9977
9979
  maxHeight: 0,
@@ -9983,6 +9985,7 @@ const create = () => {
9983
9985
  },
9984
9986
  oldState: {
9985
9987
  commands: [],
9988
+ editorUid: 0,
9986
9989
  focusedIndex: 0,
9987
9990
  height: 0,
9988
9991
  maxHeight: 0,
@@ -11173,10 +11176,13 @@ const render$8 = widget => {
11173
11176
  const commands = renderFull$3(widget.oldState, widget.newState);
11174
11177
  const wrappedCommands = [];
11175
11178
  const {
11179
+ editorUid,
11176
11180
  uid
11177
11181
  } = widget.newState;
11178
11182
  for (const command of commands) {
11179
- if (commandsToForward$2.includes(command[0])) {
11183
+ if (command[0] === SetFocusContext) {
11184
+ wrappedCommands.push([command[0], editorUid, ...command.slice(1)]);
11185
+ } else if (commandsToForward$2.includes(command[0])) {
11180
11186
  wrappedCommands.push(command);
11181
11187
  } else {
11182
11188
  wrappedCommands.push(['Viewlet.send', uid, ...command]);
@@ -11417,23 +11423,23 @@ const getKeyBindings = () => {
11417
11423
  key: Escape,
11418
11424
  when: FocusSourceActions
11419
11425
  }, {
11420
- command: 'EditorSourceActions.focusNext',
11426
+ command: 'EditorSourceAction.focusNext',
11421
11427
  key: DownArrow,
11422
11428
  when: FocusSourceActions
11423
11429
  }, {
11424
- command: 'EditorSourceActions.focusPrevious',
11430
+ command: 'EditorSourceAction.focusPrevious',
11425
11431
  key: UpArrow,
11426
11432
  when: FocusSourceActions
11427
11433
  }, {
11428
- command: 'EditorSourceActions.focusFirst',
11434
+ command: 'EditorSourceAction.focusFirst',
11429
11435
  key: Home,
11430
11436
  when: FocusSourceActions
11431
11437
  }, {
11432
- command: 'EditorSourceActions.focusLast',
11438
+ command: 'EditorSourceAction.focusLast',
11433
11439
  key: End,
11434
11440
  when: FocusSourceActions
11435
11441
  }, {
11436
- command: 'EditorSourceActions.selectCurrent',
11442
+ command: 'EditorSourceAction.selectCurrent',
11437
11443
  key: Enter,
11438
11444
  when: FocusSourceActions
11439
11445
  }, {
@@ -13837,6 +13843,7 @@ const commandMap = {
13837
13843
  'Editor.handleScrollBarVerticalPointerMove': wrapCommand(handleScrollBarVerticalPointerMove),
13838
13844
  'Editor.handleSettingsChanged': wrapCommand(handleSettingsChanged),
13839
13845
  'Editor.handleSingleClick': wrapCommand(handleSingleClick),
13846
+ 'Editor.handleSourceActionClick': selectItem,
13840
13847
  'Editor.handleTab': wrapCommand(handleTab),
13841
13848
  'Editor.handleTouchEnd': wrapCommand(handleTouchEnd),
13842
13849
  'Editor.handleTouchMove': wrapCommand(handleTouchMove),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.29.5",
3
+ "version": "19.29.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"