@lvce-editor/renderer-process 30.55.2 → 30.56.0

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.
@@ -8554,7 +8554,7 @@ const handleBlur$1 = event => {
8554
8554
  if (!target.isConnected) {
8555
8555
  return;
8556
8556
  }
8557
- if (target.ownerDocument.activeElement?.getAttribute('name') === simpleBrowserAddressName) {
8557
+ if (target.ownerDocument.hasFocus() && target.ownerDocument.activeElement?.getAttribute('name') === simpleBrowserAddressName) {
8558
8558
  return;
8559
8559
  }
8560
8560
  target.setSelectionRange(0, 0);
@@ -9891,7 +9891,7 @@ const setDom2 = (viewletId, dom) => {
9891
9891
  }
9892
9892
  });
9893
9893
  };
9894
- const setPatches = (uid, patches) => {
9894
+ const setTreePatches = (uid, patches) => {
9895
9895
  if (patches.length === 0) {
9896
9896
  return;
9897
9897
  }
@@ -9906,12 +9906,17 @@ const setPatches = (uid, patches) => {
9906
9906
  if (!$Viewlet) {
9907
9907
  throw new Error('element not found');
9908
9908
  }
9909
+ applyPatch($Viewlet, patches, {}, uid);
9910
+ applyLateFocusMaybe();
9911
+ };
9912
+ const setPatches = (uid, patches) => {
9913
+ // Legacy flat diffs encode a complete initial render as one Add patch.
9914
+ // Tree diffs use Add to append children to an existing root instead.
9909
9915
  if (patches.length === 1 && patches[0].type === 6) {
9910
9916
  setDom2(uid, patches[0].nodes);
9911
9917
  return;
9912
9918
  }
9913
- applyPatch($Viewlet, patches, {}, uid);
9914
- applyLateFocusMaybe();
9919
+ setTreePatches(uid, patches);
9915
9920
  };
9916
9921
  const waitForElement = selector => {
9917
9922
  const element = document.querySelector(selector);
@@ -10272,6 +10277,7 @@ const commandHandlers = {
10272
10277
  'Viewlet.setPatches': setPatches,
10273
10278
  'Viewlet.setProperty': setProperty,
10274
10279
  'Viewlet.setSelectionByName': setSelectionByName,
10280
+ 'Viewlet.setTreePatches': setTreePatches,
10275
10281
  'Viewlet.setUid': setUid,
10276
10282
  'Viewlet.setValueByName': setValueByName,
10277
10283
  'Viewlet.show': show
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "30.55.2",
3
+ "version": "30.56.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"