@puckeditor/plugin-heading-analyzer 0.22.0-canary.ea2ac3c2 → 0.22.0-canary.ed7231bb

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/index.d.mts CHANGED
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
308
308
  name: string;
309
309
  id: string;
310
310
  value: Value;
311
- onChange: (value: Value) => void;
311
+ onChange: (value: Value, uiState?: Partial<UiState>) => void;
312
312
  readOnly?: boolean;
313
313
  }) => ReactElement;
314
314
  interface CustomField<Value extends any> extends BaseField {
package/dist/index.d.ts CHANGED
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
308
308
  name: string;
309
309
  id: string;
310
310
  value: Value;
311
- onChange: (value: Value) => void;
311
+ onChange: (value: Value, uiState?: Partial<UiState>) => void;
312
312
  readOnly?: boolean;
313
313
  }) => ReactElement;
314
314
  interface CustomField<Value extends any> extends BaseField {
package/dist/index.js CHANGED
@@ -296,7 +296,7 @@ var styles_module_default = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineLis
296
296
  // ../core/lib/get-class-name-factory.ts
297
297
  init_react_import();
298
298
  var import_classnames = __toESM(require_classnames());
299
- var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}, params = {}) => {
299
+ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
300
300
  if (typeof options === "string") {
301
301
  const descendant = options;
302
302
  const style = styles[`${rootClass}-${descendant}`];
@@ -310,7 +310,7 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
310
310
  for (let modifier in modifiers) {
311
311
  prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
312
312
  }
313
- const c = !params.excludeBase ? styles[rootClass] : "";
313
+ const c = styles[rootClass];
314
314
  return config.baseClass + (0, import_classnames.default)(__spreadValues({
315
315
  [c]: !!c
316
316
  }, prefixedModifiers));
@@ -715,6 +715,15 @@ var flattenNode = (node, config) => {
715
715
  });
716
716
  };
717
717
 
718
+ // ../core/lib/data/to-component.ts
719
+ init_react_import();
720
+ var toComponent = (item) => {
721
+ return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
722
+ props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
723
+ type: "root"
724
+ });
725
+ };
726
+
718
727
  // ../core/lib/data/walk-app-state.ts
719
728
  function walkAppState(state, config, mapContent = (content) => content, mapNodeOrSkip = (item) => item) {
720
729
  var _a;
@@ -778,7 +787,7 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
778
787
  id
779
788
  });
780
789
  processRelatedZones(item, id, path);
781
- const newItem = __spreadProps(__spreadValues({}, item), { props: newProps });
790
+ const newItem = __spreadProps(__spreadValues({}, mappedItem), { props: newProps });
782
791
  const thisZoneCompound = path[path.length - 1];
783
792
  const [parentId, zone] = thisZoneCompound ? thisZoneCompound.split(":") : [null, ""];
784
793
  newNodeIndex[id] = {
@@ -818,17 +827,14 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
818
827
  );
819
828
  newZones[zoneCompound] = newContent2;
820
829
  }, newZones);
821
- const processedRoot = processItem(
822
- {
823
- type: "root",
824
- props: __spreadProps(__spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root), { id: "root" })
825
- },
826
- [],
827
- -1
828
- );
829
- const root = __spreadProps(__spreadValues({}, state.data.root), {
830
- props: processedRoot.props
830
+ let rootAsComponent = toComponent({
831
+ props: __spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root)
831
832
  });
833
+ if (state.data.root.readOnly) {
834
+ rootAsComponent.readOnly = state.data.root.readOnly;
835
+ }
836
+ const processedRoot = processItem(rootAsComponent, [], -1);
837
+ const root = __spreadValues(__spreadValues({}, state.data.root), processedRoot);
832
838
  return __spreadProps(__spreadValues({}, state), {
833
839
  data: {
834
840
  root,
@@ -871,53 +877,49 @@ var insert = (list, index, item) => {
871
877
  // ../core/lib/generate-id.ts
872
878
  init_react_import();
873
879
 
874
- // ../core/node_modules/uuid/dist/esm-node/index.js
880
+ // ../core/lib/uuid/index.ts
875
881
  init_react_import();
876
882
 
877
- // ../core/node_modules/uuid/dist/esm-node/rng.js
883
+ // ../core/lib/uuid/rng.ts
878
884
  init_react_import();
879
- var import_crypto = __toESM(require("crypto"));
880
- var rnds8Pool = new Uint8Array(256);
881
- var poolPtr = rnds8Pool.length;
885
+ var rnds8 = new Uint8Array(16);
882
886
  function rng() {
883
- if (poolPtr > rnds8Pool.length - 16) {
884
- import_crypto.default.randomFillSync(rnds8Pool);
885
- poolPtr = 0;
886
- }
887
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
887
+ return crypto.getRandomValues(rnds8);
888
888
  }
889
889
 
890
- // ../core/node_modules/uuid/dist/esm-node/stringify.js
890
+ // ../core/lib/uuid/stringify.ts
891
891
  init_react_import();
892
892
  var byteToHex = [];
893
893
  for (let i = 0; i < 256; ++i) {
894
894
  byteToHex.push((i + 256).toString(16).slice(1));
895
895
  }
896
896
  function unsafeStringify(arr, offset = 0) {
897
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
897
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
898
898
  }
899
899
 
900
- // ../core/node_modules/uuid/dist/esm-node/v4.js
901
- init_react_import();
902
-
903
- // ../core/node_modules/uuid/dist/esm-node/native.js
904
- init_react_import();
905
- var import_crypto2 = __toESM(require("crypto"));
906
- var native_default = {
907
- randomUUID: import_crypto2.default.randomUUID
908
- };
909
-
910
- // ../core/node_modules/uuid/dist/esm-node/v4.js
900
+ // ../core/lib/uuid/index.ts
911
901
  function v4(options, buf, offset) {
912
- if (native_default.randomUUID && !buf && !options) {
913
- return native_default.randomUUID();
902
+ if (!buf && !options && crypto.randomUUID) {
903
+ return crypto.randomUUID();
914
904
  }
905
+ return _v4(options, buf, offset);
906
+ }
907
+ function _v4(options, buf, offset) {
908
+ var _a, _b, _c;
915
909
  options = options || {};
916
- const rnds = options.random || (options.rng || rng)();
910
+ const rnds = (_c = (_b = options.random) != null ? _b : (_a = options.rng) == null ? void 0 : _a.call(options)) != null ? _c : rng();
911
+ if (rnds.length < 16) {
912
+ throw new Error("Random bytes length must be >= 16");
913
+ }
917
914
  rnds[6] = rnds[6] & 15 | 64;
918
915
  rnds[8] = rnds[8] & 63 | 128;
919
916
  if (buf) {
920
917
  offset = offset || 0;
918
+ if (offset < 0 || offset + 16 > buf.length) {
919
+ throw new RangeError(
920
+ `UUID byte range ${offset}:${offset + 15} is out of buffer bounds`
921
+ );
922
+ }
921
923
  for (let i = 0; i < 16; ++i) {
922
924
  buf[offset + i] = rnds[i];
923
925
  }
@@ -925,10 +927,10 @@ function v4(options, buf, offset) {
925
927
  }
926
928
  return unsafeStringify(rnds);
927
929
  }
928
- var v4_default = v4;
930
+ var uuid_default = v4;
929
931
 
930
932
  // ../core/lib/generate-id.ts
931
- var generateId = (type) => type ? `${type}-${v4_default()}` : v4_default();
933
+ var generateId = (type) => type ? `${type}-${uuid_default()}` : uuid_default();
932
934
 
933
935
  // ../core/lib/data/get-ids-for-parent.ts
934
936
  init_react_import();
@@ -1657,44 +1659,39 @@ var createHistorySlice = (set, get) => {
1657
1659
 
1658
1660
  // ../core/store/slices/nodes.ts
1659
1661
  init_react_import();
1660
- var createNodesSlice = (set, get) => ({
1661
- nodes: {},
1662
- registerNode: (id, node) => {
1663
- const s = get().nodes;
1664
- const emptyNode = {
1665
- id,
1666
- methods: {
1667
- sync: () => null,
1668
- hideOverlay: () => null,
1669
- showOverlay: () => null
1670
- },
1671
- element: null
1672
- };
1673
- const existingNode = s.nodes[id];
1674
- set({
1675
- nodes: __spreadProps(__spreadValues({}, s), {
1676
- nodes: __spreadProps(__spreadValues({}, s.nodes), {
1677
- [id]: __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, emptyNode), existingNode), node), {
1678
- id
1679
- })
1680
- })
1681
- })
1682
- });
1683
- },
1684
- unregisterNode: (id) => {
1685
- const s = get().nodes;
1686
- const existingNode = s.nodes[id];
1687
- if (existingNode) {
1688
- const newNodes = __spreadValues({}, s.nodes);
1689
- delete newNodes[id];
1690
- set({
1691
- nodes: __spreadProps(__spreadValues({}, s), {
1692
- nodes: newNodes
1693
- })
1662
+ var createNodesSlice = (_set, _get) => {
1663
+ const registry = /* @__PURE__ */ new Map();
1664
+ return {
1665
+ registerNode: (id, handle) => {
1666
+ registry.set(id, handle);
1667
+ },
1668
+ unregisterNode: (id) => {
1669
+ registry.delete(id);
1670
+ },
1671
+ syncNode: (id) => {
1672
+ var _a;
1673
+ if (!id) return;
1674
+ (_a = registry.get(id)) == null ? void 0 : _a.sync();
1675
+ },
1676
+ syncNodes: (ids) => {
1677
+ ids.forEach((id) => {
1678
+ var _a;
1679
+ if (!id) return;
1680
+ (_a = registry.get(id)) == null ? void 0 : _a.sync();
1694
1681
  });
1682
+ },
1683
+ setOverlayVisible: (id, visible) => {
1684
+ if (!id) return;
1685
+ const node = registry.get(id);
1686
+ if (!node) return;
1687
+ if (visible) {
1688
+ node.showOverlay();
1689
+ return;
1690
+ }
1691
+ node.hideOverlay();
1695
1692
  }
1696
- }
1697
- });
1693
+ };
1694
+ };
1698
1695
 
1699
1696
  // ../core/store/slices/permissions.ts
1700
1697
  init_react_import();
@@ -2270,17 +2267,6 @@ var createFieldsSlice = (_set, _get) => {
2270
2267
 
2271
2268
  // ../core/lib/resolve-component-data.ts
2272
2269
  init_react_import();
2273
-
2274
- // ../core/lib/data/to-component.ts
2275
- init_react_import();
2276
- var toComponent = (item) => {
2277
- return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
2278
- props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
2279
- type: "root"
2280
- });
2281
- };
2282
-
2283
- // ../core/lib/resolve-component-data.ts
2284
2270
  var cache = { lastChange: {} };
2285
2271
  var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null) {
2286
2272
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
@@ -2423,6 +2409,8 @@ var createAppStore = (initialAppStore) => create()(
2423
2409
  },
2424
2410
  status: "LOADING",
2425
2411
  iframe: {},
2412
+ _experimentalFullScreenCanvas: false,
2413
+ _experimentalVirtualization: false,
2426
2414
  metadata: {},
2427
2415
  fieldTransforms: {}
2428
2416
  }, initialAppStore), {
@@ -2558,7 +2546,8 @@ var createAppStore = (initialAppStore) => create()(
2558
2546
  state,
2559
2547
  config,
2560
2548
  (content) => content,
2561
- (childItem) => {
2549
+ (childItem, path) => {
2550
+ if (path.length > 1) return childItem;
2562
2551
  resolveComponentData2(childItem, "load").then((resolved) => {
2563
2552
  const { state: state2 } = get();
2564
2553
  const node = state2.indexes.nodes[resolved.node.props.id];
package/dist/index.mjs CHANGED
@@ -284,7 +284,7 @@ var styles_module_default = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineLis
284
284
  // ../core/lib/get-class-name-factory.ts
285
285
  init_react_import();
286
286
  var import_classnames = __toESM(require_classnames());
287
- var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}, params = {}) => {
287
+ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
288
288
  if (typeof options === "string") {
289
289
  const descendant = options;
290
290
  const style = styles[`${rootClass}-${descendant}`];
@@ -298,7 +298,7 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
298
298
  for (let modifier in modifiers) {
299
299
  prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
300
300
  }
301
- const c = !params.excludeBase ? styles[rootClass] : "";
301
+ const c = styles[rootClass];
302
302
  return config.baseClass + (0, import_classnames.default)(__spreadValues({
303
303
  [c]: !!c
304
304
  }, prefixedModifiers));
@@ -703,6 +703,15 @@ var flattenNode = (node, config) => {
703
703
  });
704
704
  };
705
705
 
706
+ // ../core/lib/data/to-component.ts
707
+ init_react_import();
708
+ var toComponent = (item) => {
709
+ return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
710
+ props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
711
+ type: "root"
712
+ });
713
+ };
714
+
706
715
  // ../core/lib/data/walk-app-state.ts
707
716
  function walkAppState(state, config, mapContent = (content) => content, mapNodeOrSkip = (item) => item) {
708
717
  var _a;
@@ -766,7 +775,7 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
766
775
  id
767
776
  });
768
777
  processRelatedZones(item, id, path);
769
- const newItem = __spreadProps(__spreadValues({}, item), { props: newProps });
778
+ const newItem = __spreadProps(__spreadValues({}, mappedItem), { props: newProps });
770
779
  const thisZoneCompound = path[path.length - 1];
771
780
  const [parentId, zone] = thisZoneCompound ? thisZoneCompound.split(":") : [null, ""];
772
781
  newNodeIndex[id] = {
@@ -806,17 +815,14 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
806
815
  );
807
816
  newZones[zoneCompound] = newContent2;
808
817
  }, newZones);
809
- const processedRoot = processItem(
810
- {
811
- type: "root",
812
- props: __spreadProps(__spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root), { id: "root" })
813
- },
814
- [],
815
- -1
816
- );
817
- const root = __spreadProps(__spreadValues({}, state.data.root), {
818
- props: processedRoot.props
818
+ let rootAsComponent = toComponent({
819
+ props: __spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root)
819
820
  });
821
+ if (state.data.root.readOnly) {
822
+ rootAsComponent.readOnly = state.data.root.readOnly;
823
+ }
824
+ const processedRoot = processItem(rootAsComponent, [], -1);
825
+ const root = __spreadValues(__spreadValues({}, state.data.root), processedRoot);
820
826
  return __spreadProps(__spreadValues({}, state), {
821
827
  data: {
822
828
  root,
@@ -859,53 +865,49 @@ var insert = (list, index, item) => {
859
865
  // ../core/lib/generate-id.ts
860
866
  init_react_import();
861
867
 
862
- // ../core/node_modules/uuid/dist/esm-node/index.js
868
+ // ../core/lib/uuid/index.ts
863
869
  init_react_import();
864
870
 
865
- // ../core/node_modules/uuid/dist/esm-node/rng.js
871
+ // ../core/lib/uuid/rng.ts
866
872
  init_react_import();
867
- import crypto from "crypto";
868
- var rnds8Pool = new Uint8Array(256);
869
- var poolPtr = rnds8Pool.length;
873
+ var rnds8 = new Uint8Array(16);
870
874
  function rng() {
871
- if (poolPtr > rnds8Pool.length - 16) {
872
- crypto.randomFillSync(rnds8Pool);
873
- poolPtr = 0;
874
- }
875
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
875
+ return crypto.getRandomValues(rnds8);
876
876
  }
877
877
 
878
- // ../core/node_modules/uuid/dist/esm-node/stringify.js
878
+ // ../core/lib/uuid/stringify.ts
879
879
  init_react_import();
880
880
  var byteToHex = [];
881
881
  for (let i = 0; i < 256; ++i) {
882
882
  byteToHex.push((i + 256).toString(16).slice(1));
883
883
  }
884
884
  function unsafeStringify(arr, offset = 0) {
885
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
885
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
886
886
  }
887
887
 
888
- // ../core/node_modules/uuid/dist/esm-node/v4.js
889
- init_react_import();
890
-
891
- // ../core/node_modules/uuid/dist/esm-node/native.js
892
- init_react_import();
893
- import crypto2 from "crypto";
894
- var native_default = {
895
- randomUUID: crypto2.randomUUID
896
- };
897
-
898
- // ../core/node_modules/uuid/dist/esm-node/v4.js
888
+ // ../core/lib/uuid/index.ts
899
889
  function v4(options, buf, offset) {
900
- if (native_default.randomUUID && !buf && !options) {
901
- return native_default.randomUUID();
890
+ if (!buf && !options && crypto.randomUUID) {
891
+ return crypto.randomUUID();
902
892
  }
893
+ return _v4(options, buf, offset);
894
+ }
895
+ function _v4(options, buf, offset) {
896
+ var _a, _b, _c;
903
897
  options = options || {};
904
- const rnds = options.random || (options.rng || rng)();
898
+ const rnds = (_c = (_b = options.random) != null ? _b : (_a = options.rng) == null ? void 0 : _a.call(options)) != null ? _c : rng();
899
+ if (rnds.length < 16) {
900
+ throw new Error("Random bytes length must be >= 16");
901
+ }
905
902
  rnds[6] = rnds[6] & 15 | 64;
906
903
  rnds[8] = rnds[8] & 63 | 128;
907
904
  if (buf) {
908
905
  offset = offset || 0;
906
+ if (offset < 0 || offset + 16 > buf.length) {
907
+ throw new RangeError(
908
+ `UUID byte range ${offset}:${offset + 15} is out of buffer bounds`
909
+ );
910
+ }
909
911
  for (let i = 0; i < 16; ++i) {
910
912
  buf[offset + i] = rnds[i];
911
913
  }
@@ -913,10 +915,10 @@ function v4(options, buf, offset) {
913
915
  }
914
916
  return unsafeStringify(rnds);
915
917
  }
916
- var v4_default = v4;
918
+ var uuid_default = v4;
917
919
 
918
920
  // ../core/lib/generate-id.ts
919
- var generateId = (type) => type ? `${type}-${v4_default()}` : v4_default();
921
+ var generateId = (type) => type ? `${type}-${uuid_default()}` : uuid_default();
920
922
 
921
923
  // ../core/lib/data/get-ids-for-parent.ts
922
924
  init_react_import();
@@ -1645,44 +1647,39 @@ var createHistorySlice = (set, get) => {
1645
1647
 
1646
1648
  // ../core/store/slices/nodes.ts
1647
1649
  init_react_import();
1648
- var createNodesSlice = (set, get) => ({
1649
- nodes: {},
1650
- registerNode: (id, node) => {
1651
- const s = get().nodes;
1652
- const emptyNode = {
1653
- id,
1654
- methods: {
1655
- sync: () => null,
1656
- hideOverlay: () => null,
1657
- showOverlay: () => null
1658
- },
1659
- element: null
1660
- };
1661
- const existingNode = s.nodes[id];
1662
- set({
1663
- nodes: __spreadProps(__spreadValues({}, s), {
1664
- nodes: __spreadProps(__spreadValues({}, s.nodes), {
1665
- [id]: __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, emptyNode), existingNode), node), {
1666
- id
1667
- })
1668
- })
1669
- })
1670
- });
1671
- },
1672
- unregisterNode: (id) => {
1673
- const s = get().nodes;
1674
- const existingNode = s.nodes[id];
1675
- if (existingNode) {
1676
- const newNodes = __spreadValues({}, s.nodes);
1677
- delete newNodes[id];
1678
- set({
1679
- nodes: __spreadProps(__spreadValues({}, s), {
1680
- nodes: newNodes
1681
- })
1650
+ var createNodesSlice = (_set, _get) => {
1651
+ const registry = /* @__PURE__ */ new Map();
1652
+ return {
1653
+ registerNode: (id, handle) => {
1654
+ registry.set(id, handle);
1655
+ },
1656
+ unregisterNode: (id) => {
1657
+ registry.delete(id);
1658
+ },
1659
+ syncNode: (id) => {
1660
+ var _a;
1661
+ if (!id) return;
1662
+ (_a = registry.get(id)) == null ? void 0 : _a.sync();
1663
+ },
1664
+ syncNodes: (ids) => {
1665
+ ids.forEach((id) => {
1666
+ var _a;
1667
+ if (!id) return;
1668
+ (_a = registry.get(id)) == null ? void 0 : _a.sync();
1682
1669
  });
1670
+ },
1671
+ setOverlayVisible: (id, visible) => {
1672
+ if (!id) return;
1673
+ const node = registry.get(id);
1674
+ if (!node) return;
1675
+ if (visible) {
1676
+ node.showOverlay();
1677
+ return;
1678
+ }
1679
+ node.hideOverlay();
1683
1680
  }
1684
- }
1685
- });
1681
+ };
1682
+ };
1686
1683
 
1687
1684
  // ../core/store/slices/permissions.ts
1688
1685
  init_react_import();
@@ -2258,17 +2255,6 @@ var createFieldsSlice = (_set, _get) => {
2258
2255
 
2259
2256
  // ../core/lib/resolve-component-data.ts
2260
2257
  init_react_import();
2261
-
2262
- // ../core/lib/data/to-component.ts
2263
- init_react_import();
2264
- var toComponent = (item) => {
2265
- return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
2266
- props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
2267
- type: "root"
2268
- });
2269
- };
2270
-
2271
- // ../core/lib/resolve-component-data.ts
2272
2258
  var cache = { lastChange: {} };
2273
2259
  var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null) {
2274
2260
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
@@ -2411,6 +2397,8 @@ var createAppStore = (initialAppStore) => create()(
2411
2397
  },
2412
2398
  status: "LOADING",
2413
2399
  iframe: {},
2400
+ _experimentalFullScreenCanvas: false,
2401
+ _experimentalVirtualization: false,
2414
2402
  metadata: {},
2415
2403
  fieldTransforms: {}
2416
2404
  }, initialAppStore), {
@@ -2546,7 +2534,8 @@ var createAppStore = (initialAppStore) => create()(
2546
2534
  state,
2547
2535
  config,
2548
2536
  (content) => content,
2549
- (childItem) => {
2537
+ (childItem, path) => {
2538
+ if (path.length > 1) return childItem;
2550
2539
  resolveComponentData2(childItem, "load").then((resolved) => {
2551
2540
  const { state: state2 } = get();
2552
2541
  const node = state2.indexes.nodes[resolved.node.props.id];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/plugin-heading-analyzer",
3
- "version": "0.22.0-canary.ea2ac3c2",
3
+ "version": "0.22.0-canary.ed7231bb",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "puckeditor/puck",
6
6
  "bugs": "https://github.com/puckeditor/puck/issues",
@@ -25,11 +25,11 @@
25
25
  "dist"
26
26
  ],
27
27
  "devDependencies": {
28
- "@puckeditor/core": "^0.22.0-canary.ea2ac3c2",
28
+ "@puckeditor/core": "^0.22.0-canary.ed7231bb",
29
29
  "@types/minimatch": "3.0.5",
30
30
  "@types/react": "^19.0.1",
31
31
  "@types/react-dom": "^19.0.2",
32
- "eslint": "^7.32.0",
32
+ "eslint": "^9.0.0",
33
33
  "eslint-config-custom": "*",
34
34
  "tsconfig": "*",
35
35
  "tsup": "^8.2.4",