@measured/puck-plugin-heading-analyzer 0.21.0-canary.cf074bc6 → 0.21.0-canary.d5f934f0

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.mjs CHANGED
@@ -91,7 +91,7 @@ var require_classnames = __commonJS({
91
91
  init_react_import();
92
92
  (function() {
93
93
  "use strict";
94
- var hasOwn = {}.hasOwnProperty;
94
+ var hasOwn2 = {}.hasOwnProperty;
95
95
  function classNames() {
96
96
  var classes = "";
97
97
  for (var i = 0; i < arguments.length; i++) {
@@ -117,7 +117,7 @@ var require_classnames = __commonJS({
117
117
  }
118
118
  var classes = "";
119
119
  for (var key in arg) {
120
- if (hasOwn.call(arg, key) && arg[key]) {
120
+ if (hasOwn2.call(arg, key) && arg[key]) {
121
121
  classes = appendClass(classes, key);
122
122
  }
123
123
  }
@@ -206,11 +206,11 @@ var require_flat = __commonJS({
206
206
  }
207
207
  function isEmpty(val) {
208
208
  const type = Object.prototype.toString.call(val);
209
- const isArray = type === "[object Array]";
209
+ const isArray2 = type === "[object Array]";
210
210
  const isObject = type === "[object Object]";
211
211
  if (!val) {
212
212
  return true;
213
- } else if (isArray) {
213
+ } else if (isArray2) {
214
214
  return !val.length;
215
215
  } else if (isObject) {
216
216
  return !Object.keys(val).length;
@@ -260,42 +260,6 @@ var require_flat = __commonJS({
260
260
  }
261
261
  });
262
262
 
263
- // ../../node_modules/fast-deep-equal/index.js
264
- var require_fast_deep_equal = __commonJS({
265
- "../../node_modules/fast-deep-equal/index.js"(exports, module) {
266
- "use strict";
267
- init_react_import();
268
- module.exports = function equal(a, b) {
269
- if (a === b) return true;
270
- if (a && b && typeof a == "object" && typeof b == "object") {
271
- if (a.constructor !== b.constructor) return false;
272
- var length, i, keys;
273
- if (Array.isArray(a)) {
274
- length = a.length;
275
- if (length != b.length) return false;
276
- for (i = length; i-- !== 0; )
277
- if (!equal(a[i], b[i])) return false;
278
- return true;
279
- }
280
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
281
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
282
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
283
- keys = Object.keys(a);
284
- length = keys.length;
285
- if (length !== Object.keys(b).length) return false;
286
- for (i = length; i-- !== 0; )
287
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
288
- for (i = length; i-- !== 0; ) {
289
- var key = keys[i];
290
- if (!equal(a[key], b[key])) return false;
291
- }
292
- return true;
293
- }
294
- return a !== a && b !== b;
295
- };
296
- }
297
- });
298
-
299
263
  // index.ts
300
264
  init_react_import();
301
265
 
@@ -305,17 +269,17 @@ import { useEffect as useEffect5, useState } from "react";
305
269
 
306
270
  // css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
307
271
  init_react_import();
308
- var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_116v6_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_116v6_5", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_116v6_9", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_116v6_13" };
272
+ var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_yg0s7_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_yg0s7_6", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_yg0s7_10", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_yg0s7_14" };
309
273
 
310
274
  // src/HeadingAnalyzer.tsx
311
275
  import { createUsePuck } from "@measured/puck";
312
276
 
313
- // ../core/components/SidebarSection/index.tsx
277
+ // ../core/components/OutlineList/index.tsx
314
278
  init_react_import();
315
279
 
316
- // css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
280
+ // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
317
281
  init_react_import();
318
- var styles_module_default = { "SidebarSection": "_SidebarSection_8boj8_1", "SidebarSection-title": "_SidebarSection-title_8boj8_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_8boj8_20", "SidebarSection-content": "_SidebarSection-content_8boj8_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_8boj8_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_8boj8_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_8boj8_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_8boj8_41", "SidebarSection-heading": "_SidebarSection-heading_8boj8_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_8boj8_86" };
282
+ var styles_module_default = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
319
283
 
320
284
  // ../core/lib/get-class-name-factory.ts
321
285
  init_react_import();
@@ -344,29 +308,50 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
344
308
  };
345
309
  var get_class_name_factory_default = getClassNameFactory;
346
310
 
347
- // ../core/components/Heading/index.tsx
348
- init_react_import();
349
-
350
- // css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
351
- init_react_import();
352
- var styles_module_default2 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
353
-
354
- // ../core/components/Heading/index.tsx
311
+ // ../core/components/OutlineList/index.tsx
355
312
  import { jsx } from "react/jsx-runtime";
356
- var getClassName = get_class_name_factory_default("Heading", styles_module_default2);
357
- var Heading = ({ children, rank, size = "m" }) => {
358
- const Tag = rank ? `h${rank}` : "span";
313
+ var getClassName = get_class_name_factory_default("OutlineList", styles_module_default);
314
+ var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default);
315
+ var OutlineList = ({ children }) => {
316
+ return /* @__PURE__ */ jsx("ul", { className: getClassName(), children });
317
+ };
318
+ OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx("div", { className: getClassNameItem({ clickable: true }), children });
319
+ OutlineList.Item = ({
320
+ children,
321
+ onClick
322
+ }) => {
359
323
  return /* @__PURE__ */ jsx(
360
- Tag,
324
+ "li",
361
325
  {
362
- className: getClassName({
363
- [size]: true
364
- }),
326
+ className: getClassNameItem({ clickable: !!onClick }),
327
+ onClick,
365
328
  children
366
329
  }
367
330
  );
368
331
  };
369
332
 
333
+ // ../core/lib/scroll-into-view.ts
334
+ init_react_import();
335
+ var scrollIntoView = (el) => {
336
+ const oldStyle = __spreadValues({}, el.style);
337
+ el.style.scrollMargin = "256px";
338
+ if (el) {
339
+ el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
340
+ el.style.scrollMargin = oldStyle.scrollMargin || "";
341
+ }
342
+ };
343
+
344
+ // ../core/lib/get-frame.ts
345
+ init_react_import();
346
+ var getFrame = () => {
347
+ if (typeof window === "undefined") return;
348
+ let frameEl = document.querySelector("#preview-frame");
349
+ if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
350
+ return frameEl.contentDocument || document;
351
+ }
352
+ return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
353
+ };
354
+
370
355
  // ../../node_modules/lucide-react/dist/esm/lucide-react.js
371
356
  init_react_import();
372
357
 
@@ -454,15 +439,29 @@ var createLucideIcon = (iconName, iconNode) => {
454
439
  return Component;
455
440
  };
456
441
 
457
- // ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
442
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-1.js
458
443
  init_react_import();
459
- var ChevronRight = createLucideIcon("ChevronRight", [
460
- ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
444
+ var Heading1 = createLucideIcon("Heading1", [
445
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
446
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
447
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
448
+ ["path", { d: "m17 12 3-2v8", key: "1hhhft" }]
461
449
  ]);
462
450
 
463
- // ../core/lib/use-breadcrumbs.ts
451
+ // ../core/lib/index.ts
452
+ init_react_import();
453
+
454
+ // ../core/lib/filter.ts
455
+ init_react_import();
456
+
457
+ // ../core/lib/data/reorder.ts
458
+ init_react_import();
459
+
460
+ // ../core/lib/data/replace.ts
461
+ init_react_import();
462
+
463
+ // ../core/lib/use-reset-auto-zoom.ts
464
464
  init_react_import();
465
- import { useMemo } from "react";
466
465
 
467
466
  // ../core/store/index.ts
468
467
  init_react_import();
@@ -680,9 +679,28 @@ var stripSlots = (data, config) => {
680
679
 
681
680
  // ../core/lib/data/flatten-node.ts
682
681
  var { flatten: flatten2, unflatten } = import_flat.default;
682
+ function isEmptyArrayOrObject(val) {
683
+ if (Array.isArray(val)) {
684
+ return val.length === 0;
685
+ }
686
+ if (val != null && Object.prototype.toString.call(val) === "[object Object]") {
687
+ return Object.keys(val).length === 0;
688
+ }
689
+ return false;
690
+ }
691
+ function stripEmptyObjects(props) {
692
+ const result = {};
693
+ for (const key in props) {
694
+ if (!Object.prototype.hasOwnProperty.call(props, key)) continue;
695
+ const val = props[key];
696
+ if (isEmptyArrayOrObject(val)) continue;
697
+ result[key] = val;
698
+ }
699
+ return result;
700
+ }
683
701
  var flattenNode = (node, config) => {
684
702
  return __spreadProps(__spreadValues({}, node), {
685
- props: flatten2(stripSlots(node, config).props)
703
+ props: stripEmptyObjects(flatten2(stripSlots(node, config).props))
686
704
  });
687
705
  };
688
706
 
@@ -842,10 +860,10 @@ var insert = (list, index, item) => {
842
860
  // ../core/lib/generate-id.ts
843
861
  init_react_import();
844
862
 
845
- // ../../node_modules/uuid/dist/esm-node/index.js
863
+ // ../core/node_modules/uuid/dist/esm-node/index.js
846
864
  init_react_import();
847
865
 
848
- // ../../node_modules/uuid/dist/esm-node/rng.js
866
+ // ../core/node_modules/uuid/dist/esm-node/rng.js
849
867
  init_react_import();
850
868
  import crypto from "crypto";
851
869
  var rnds8Pool = new Uint8Array(256);
@@ -858,7 +876,7 @@ function rng() {
858
876
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
859
877
  }
860
878
 
861
- // ../../node_modules/uuid/dist/esm-node/stringify.js
879
+ // ../core/node_modules/uuid/dist/esm-node/stringify.js
862
880
  init_react_import();
863
881
  var byteToHex = [];
864
882
  for (let i = 0; i < 256; ++i) {
@@ -868,17 +886,17 @@ function unsafeStringify(arr, offset = 0) {
868
886
  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]];
869
887
  }
870
888
 
871
- // ../../node_modules/uuid/dist/esm-node/v4.js
889
+ // ../core/node_modules/uuid/dist/esm-node/v4.js
872
890
  init_react_import();
873
891
 
874
- // ../../node_modules/uuid/dist/esm-node/native.js
892
+ // ../core/node_modules/uuid/dist/esm-node/native.js
875
893
  init_react_import();
876
894
  import crypto2 from "crypto";
877
895
  var native_default = {
878
896
  randomUUID: crypto2.randomUUID
879
897
  };
880
898
 
881
- // ../../node_modules/uuid/dist/esm-node/v4.js
899
+ // ../core/node_modules/uuid/dist/esm-node/v4.js
882
900
  function v4(options, buf, offset) {
883
901
  if (native_default.randomUUID && !buf && !options) {
884
902
  return native_default.randomUUID();
@@ -1030,7 +1048,9 @@ var replaceAction = (state, action, appStore) => {
1030
1048
  });
1031
1049
  });
1032
1050
  });
1033
- const stateWithDeepSlotsRemoved = __spreadValues({}, state);
1051
+ const stateWithDeepSlotsRemoved = __spreadProps(__spreadValues({}, state), {
1052
+ ui: __spreadValues(__spreadValues({}, state.ui), action.ui)
1053
+ });
1034
1054
  Object.keys(state.indexes.zones).forEach((zoneCompound) => {
1035
1055
  const id = zoneCompound.split(":")[0];
1036
1056
  if (id === originalId) {
@@ -1432,7 +1452,8 @@ init_react_import();
1432
1452
  var defaultViewports = [
1433
1453
  { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
1434
1454
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
1435
- { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
1455
+ { width: 1280, height: "auto", icon: "Monitor", label: "Large" },
1456
+ { width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
1436
1457
  ];
1437
1458
 
1438
1459
  // ../../node_modules/zustand/esm/vanilla.mjs
@@ -1458,7 +1479,7 @@ var createStoreImpl = (createState) => {
1458
1479
  const initialState = state = createState(setState, getState, api);
1459
1480
  return api;
1460
1481
  };
1461
- var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
1482
+ var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
1462
1483
 
1463
1484
  // ../../node_modules/zustand/esm/react.mjs
1464
1485
  init_react_import();
@@ -1467,8 +1488,8 @@ var identity = (arg) => arg;
1467
1488
  function useStore(api, selector = identity) {
1468
1489
  const slice = React2.useSyncExternalStore(
1469
1490
  api.subscribe,
1470
- () => selector(api.getState()),
1471
- () => selector(api.getInitialState())
1491
+ React2.useCallback(() => selector(api.getState()), [api, selector]),
1492
+ React2.useCallback(() => selector(api.getInitialState()), [api, selector])
1472
1493
  );
1473
1494
  React2.useDebugValue(slice);
1474
1495
  return slice;
@@ -1479,13 +1500,13 @@ var createImpl = (createState) => {
1479
1500
  Object.assign(useBoundStore, api);
1480
1501
  return useBoundStore;
1481
1502
  };
1482
- var create = (createState) => createState ? createImpl(createState) : createImpl;
1503
+ var create = ((createState) => createState ? createImpl(createState) : createImpl);
1483
1504
 
1484
1505
  // ../../node_modules/zustand/esm/middleware.mjs
1485
1506
  init_react_import();
1486
1507
  var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
1487
1508
  const origSubscribe = api.subscribe;
1488
- api.subscribe = (selector, optListener, options) => {
1509
+ api.subscribe = ((selector, optListener, options) => {
1489
1510
  let listener = selector;
1490
1511
  if (optListener) {
1491
1512
  const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
@@ -1502,7 +1523,7 @@ var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
1502
1523
  }
1503
1524
  }
1504
1525
  return origSubscribe(listener);
1505
- };
1526
+ });
1506
1527
  const initialState = fn(set, get, api);
1507
1528
  return initialState;
1508
1529
  };
@@ -1542,9 +1563,9 @@ function debounce(func, timeout = 300) {
1542
1563
  var tidyState = (state) => {
1543
1564
  return __spreadProps(__spreadValues({}, state), {
1544
1565
  ui: __spreadProps(__spreadValues({}, state.ui), {
1545
- field: {
1566
+ field: __spreadProps(__spreadValues({}, state.ui.field), {
1546
1567
  focus: null
1547
- }
1568
+ })
1548
1569
  })
1549
1570
  });
1550
1571
  };
@@ -1686,42 +1707,462 @@ var flattenData = (state, config) => {
1686
1707
 
1687
1708
  // ../core/lib/get-changed.ts
1688
1709
  init_react_import();
1689
- var import_fast_deep_equal = __toESM(require_fast_deep_equal());
1710
+
1711
+ // ../../node_modules/fast-equals/dist/esm/index.mjs
1712
+ init_react_import();
1713
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
1714
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1715
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1716
+ function combineComparators(comparatorA, comparatorB) {
1717
+ return function isEqual(a, b, state) {
1718
+ return comparatorA(a, b, state) && comparatorB(a, b, state);
1719
+ };
1720
+ }
1721
+ function createIsCircular(areItemsEqual) {
1722
+ return function isCircular(a, b, state) {
1723
+ if (!a || !b || typeof a !== "object" || typeof b !== "object") {
1724
+ return areItemsEqual(a, b, state);
1725
+ }
1726
+ var cache2 = state.cache;
1727
+ var cachedA = cache2.get(a);
1728
+ var cachedB = cache2.get(b);
1729
+ if (cachedA && cachedB) {
1730
+ return cachedA === b && cachedB === a;
1731
+ }
1732
+ cache2.set(a, b);
1733
+ cache2.set(b, a);
1734
+ var result = areItemsEqual(a, b, state);
1735
+ cache2.delete(a);
1736
+ cache2.delete(b);
1737
+ return result;
1738
+ };
1739
+ }
1740
+ function getStrictProperties(object) {
1741
+ return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
1742
+ }
1743
+ var hasOwn = Object.hasOwn || (function(object, property) {
1744
+ return hasOwnProperty.call(object, property);
1745
+ });
1746
+ function sameValueZeroEqual(a, b) {
1747
+ return a === b || !a && !b && a !== a && b !== b;
1748
+ }
1749
+ var PREACT_VNODE = "__v";
1750
+ var PREACT_OWNER = "__o";
1751
+ var REACT_OWNER = "_owner";
1752
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1753
+ var keys = Object.keys;
1754
+ function areArraysEqual(a, b, state) {
1755
+ var index = a.length;
1756
+ if (b.length !== index) {
1757
+ return false;
1758
+ }
1759
+ while (index-- > 0) {
1760
+ if (!state.equals(a[index], b[index], index, index, a, b, state)) {
1761
+ return false;
1762
+ }
1763
+ }
1764
+ return true;
1765
+ }
1766
+ function areDatesEqual(a, b) {
1767
+ return sameValueZeroEqual(a.getTime(), b.getTime());
1768
+ }
1769
+ function areErrorsEqual(a, b) {
1770
+ return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
1771
+ }
1772
+ function areFunctionsEqual(a, b) {
1773
+ return a === b;
1774
+ }
1775
+ function areMapsEqual(a, b, state) {
1776
+ var size = a.size;
1777
+ if (size !== b.size) {
1778
+ return false;
1779
+ }
1780
+ if (!size) {
1781
+ return true;
1782
+ }
1783
+ var matchedIndices = new Array(size);
1784
+ var aIterable = a.entries();
1785
+ var aResult;
1786
+ var bResult;
1787
+ var index = 0;
1788
+ while (aResult = aIterable.next()) {
1789
+ if (aResult.done) {
1790
+ break;
1791
+ }
1792
+ var bIterable = b.entries();
1793
+ var hasMatch = false;
1794
+ var matchIndex = 0;
1795
+ while (bResult = bIterable.next()) {
1796
+ if (bResult.done) {
1797
+ break;
1798
+ }
1799
+ if (matchedIndices[matchIndex]) {
1800
+ matchIndex++;
1801
+ continue;
1802
+ }
1803
+ var aEntry = aResult.value;
1804
+ var bEntry = bResult.value;
1805
+ if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
1806
+ hasMatch = matchedIndices[matchIndex] = true;
1807
+ break;
1808
+ }
1809
+ matchIndex++;
1810
+ }
1811
+ if (!hasMatch) {
1812
+ return false;
1813
+ }
1814
+ index++;
1815
+ }
1816
+ return true;
1817
+ }
1818
+ var areNumbersEqual = sameValueZeroEqual;
1819
+ function areObjectsEqual(a, b, state) {
1820
+ var properties = keys(a);
1821
+ var index = properties.length;
1822
+ if (keys(b).length !== index) {
1823
+ return false;
1824
+ }
1825
+ while (index-- > 0) {
1826
+ if (!isPropertyEqual(a, b, state, properties[index])) {
1827
+ return false;
1828
+ }
1829
+ }
1830
+ return true;
1831
+ }
1832
+ function areObjectsEqualStrict(a, b, state) {
1833
+ var properties = getStrictProperties(a);
1834
+ var index = properties.length;
1835
+ if (getStrictProperties(b).length !== index) {
1836
+ return false;
1837
+ }
1838
+ var property;
1839
+ var descriptorA;
1840
+ var descriptorB;
1841
+ while (index-- > 0) {
1842
+ property = properties[index];
1843
+ if (!isPropertyEqual(a, b, state, property)) {
1844
+ return false;
1845
+ }
1846
+ descriptorA = getOwnPropertyDescriptor(a, property);
1847
+ descriptorB = getOwnPropertyDescriptor(b, property);
1848
+ if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
1849
+ return false;
1850
+ }
1851
+ }
1852
+ return true;
1853
+ }
1854
+ function arePrimitiveWrappersEqual(a, b) {
1855
+ return sameValueZeroEqual(a.valueOf(), b.valueOf());
1856
+ }
1857
+ function areRegExpsEqual(a, b) {
1858
+ return a.source === b.source && a.flags === b.flags;
1859
+ }
1860
+ function areSetsEqual(a, b, state) {
1861
+ var size = a.size;
1862
+ if (size !== b.size) {
1863
+ return false;
1864
+ }
1865
+ if (!size) {
1866
+ return true;
1867
+ }
1868
+ var matchedIndices = new Array(size);
1869
+ var aIterable = a.values();
1870
+ var aResult;
1871
+ var bResult;
1872
+ while (aResult = aIterable.next()) {
1873
+ if (aResult.done) {
1874
+ break;
1875
+ }
1876
+ var bIterable = b.values();
1877
+ var hasMatch = false;
1878
+ var matchIndex = 0;
1879
+ while (bResult = bIterable.next()) {
1880
+ if (bResult.done) {
1881
+ break;
1882
+ }
1883
+ if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
1884
+ hasMatch = matchedIndices[matchIndex] = true;
1885
+ break;
1886
+ }
1887
+ matchIndex++;
1888
+ }
1889
+ if (!hasMatch) {
1890
+ return false;
1891
+ }
1892
+ }
1893
+ return true;
1894
+ }
1895
+ function areTypedArraysEqual(a, b) {
1896
+ var index = a.length;
1897
+ if (b.length !== index) {
1898
+ return false;
1899
+ }
1900
+ while (index-- > 0) {
1901
+ if (a[index] !== b[index]) {
1902
+ return false;
1903
+ }
1904
+ }
1905
+ return true;
1906
+ }
1907
+ function areUrlsEqual(a, b) {
1908
+ return a.hostname === b.hostname && a.pathname === b.pathname && a.protocol === b.protocol && a.port === b.port && a.hash === b.hash && a.username === b.username && a.password === b.password;
1909
+ }
1910
+ function isPropertyEqual(a, b, state, property) {
1911
+ if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) {
1912
+ return true;
1913
+ }
1914
+ return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
1915
+ }
1916
+ var ARGUMENTS_TAG = "[object Arguments]";
1917
+ var BOOLEAN_TAG = "[object Boolean]";
1918
+ var DATE_TAG = "[object Date]";
1919
+ var ERROR_TAG = "[object Error]";
1920
+ var MAP_TAG = "[object Map]";
1921
+ var NUMBER_TAG = "[object Number]";
1922
+ var OBJECT_TAG = "[object Object]";
1923
+ var REG_EXP_TAG = "[object RegExp]";
1924
+ var SET_TAG = "[object Set]";
1925
+ var STRING_TAG = "[object String]";
1926
+ var URL_TAG = "[object URL]";
1927
+ var isArray = Array.isArray;
1928
+ var isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null;
1929
+ var assign = Object.assign;
1930
+ var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
1931
+ function createEqualityComparator(_a) {
1932
+ var areArraysEqual2 = _a.areArraysEqual, areDatesEqual2 = _a.areDatesEqual, areErrorsEqual2 = _a.areErrorsEqual, areFunctionsEqual2 = _a.areFunctionsEqual, areMapsEqual2 = _a.areMapsEqual, areNumbersEqual2 = _a.areNumbersEqual, areObjectsEqual2 = _a.areObjectsEqual, arePrimitiveWrappersEqual2 = _a.arePrimitiveWrappersEqual, areRegExpsEqual2 = _a.areRegExpsEqual, areSetsEqual2 = _a.areSetsEqual, areTypedArraysEqual2 = _a.areTypedArraysEqual, areUrlsEqual2 = _a.areUrlsEqual;
1933
+ return function comparator(a, b, state) {
1934
+ if (a === b) {
1935
+ return true;
1936
+ }
1937
+ if (a == null || b == null) {
1938
+ return false;
1939
+ }
1940
+ var type = typeof a;
1941
+ if (type !== typeof b) {
1942
+ return false;
1943
+ }
1944
+ if (type !== "object") {
1945
+ if (type === "number") {
1946
+ return areNumbersEqual2(a, b, state);
1947
+ }
1948
+ if (type === "function") {
1949
+ return areFunctionsEqual2(a, b, state);
1950
+ }
1951
+ return false;
1952
+ }
1953
+ var constructor = a.constructor;
1954
+ if (constructor !== b.constructor) {
1955
+ return false;
1956
+ }
1957
+ if (constructor === Object) {
1958
+ return areObjectsEqual2(a, b, state);
1959
+ }
1960
+ if (isArray(a)) {
1961
+ return areArraysEqual2(a, b, state);
1962
+ }
1963
+ if (isTypedArray != null && isTypedArray(a)) {
1964
+ return areTypedArraysEqual2(a, b, state);
1965
+ }
1966
+ if (constructor === Date) {
1967
+ return areDatesEqual2(a, b, state);
1968
+ }
1969
+ if (constructor === RegExp) {
1970
+ return areRegExpsEqual2(a, b, state);
1971
+ }
1972
+ if (constructor === Map) {
1973
+ return areMapsEqual2(a, b, state);
1974
+ }
1975
+ if (constructor === Set) {
1976
+ return areSetsEqual2(a, b, state);
1977
+ }
1978
+ var tag = getTag(a);
1979
+ if (tag === DATE_TAG) {
1980
+ return areDatesEqual2(a, b, state);
1981
+ }
1982
+ if (tag === REG_EXP_TAG) {
1983
+ return areRegExpsEqual2(a, b, state);
1984
+ }
1985
+ if (tag === MAP_TAG) {
1986
+ return areMapsEqual2(a, b, state);
1987
+ }
1988
+ if (tag === SET_TAG) {
1989
+ return areSetsEqual2(a, b, state);
1990
+ }
1991
+ if (tag === OBJECT_TAG) {
1992
+ return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
1993
+ }
1994
+ if (tag === URL_TAG) {
1995
+ return areUrlsEqual2(a, b, state);
1996
+ }
1997
+ if (tag === ERROR_TAG) {
1998
+ return areErrorsEqual2(a, b, state);
1999
+ }
2000
+ if (tag === ARGUMENTS_TAG) {
2001
+ return areObjectsEqual2(a, b, state);
2002
+ }
2003
+ if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
2004
+ return arePrimitiveWrappersEqual2(a, b, state);
2005
+ }
2006
+ return false;
2007
+ };
2008
+ }
2009
+ function createEqualityComparatorConfig(_a) {
2010
+ var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
2011
+ var config = {
2012
+ areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
2013
+ areDatesEqual,
2014
+ areErrorsEqual,
2015
+ areFunctionsEqual,
2016
+ areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
2017
+ areNumbersEqual,
2018
+ areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
2019
+ arePrimitiveWrappersEqual,
2020
+ areRegExpsEqual,
2021
+ areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
2022
+ areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
2023
+ areUrlsEqual
2024
+ };
2025
+ if (createCustomConfig) {
2026
+ config = assign({}, config, createCustomConfig(config));
2027
+ }
2028
+ if (circular) {
2029
+ var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
2030
+ var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
2031
+ var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
2032
+ var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
2033
+ config = assign({}, config, {
2034
+ areArraysEqual: areArraysEqual$1,
2035
+ areMapsEqual: areMapsEqual$1,
2036
+ areObjectsEqual: areObjectsEqual$1,
2037
+ areSetsEqual: areSetsEqual$1
2038
+ });
2039
+ }
2040
+ return config;
2041
+ }
2042
+ function createInternalEqualityComparator(compare) {
2043
+ return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
2044
+ return compare(a, b, state);
2045
+ };
2046
+ }
2047
+ function createIsEqual(_a) {
2048
+ var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
2049
+ if (createState) {
2050
+ return function isEqual(a, b) {
2051
+ var _a2 = createState(), _b = _a2.cache, cache2 = _b === void 0 ? circular ? /* @__PURE__ */ new WeakMap() : void 0 : _b, meta = _a2.meta;
2052
+ return comparator(a, b, {
2053
+ cache: cache2,
2054
+ equals,
2055
+ meta,
2056
+ strict
2057
+ });
2058
+ };
2059
+ }
2060
+ if (circular) {
2061
+ return function isEqual(a, b) {
2062
+ return comparator(a, b, {
2063
+ cache: /* @__PURE__ */ new WeakMap(),
2064
+ equals,
2065
+ meta: void 0,
2066
+ strict
2067
+ });
2068
+ };
2069
+ }
2070
+ var state = {
2071
+ cache: void 0,
2072
+ equals,
2073
+ meta: void 0,
2074
+ strict
2075
+ };
2076
+ return function isEqual(a, b) {
2077
+ return comparator(a, b, state);
2078
+ };
2079
+ }
2080
+ var deepEqual = createCustomEqual();
2081
+ var strictDeepEqual = createCustomEqual({ strict: true });
2082
+ var circularDeepEqual = createCustomEqual({ circular: true });
2083
+ var strictCircularDeepEqual = createCustomEqual({
2084
+ circular: true,
2085
+ strict: true
2086
+ });
2087
+ var shallowEqual = createCustomEqual({
2088
+ createInternalComparator: function() {
2089
+ return sameValueZeroEqual;
2090
+ }
2091
+ });
2092
+ var strictShallowEqual = createCustomEqual({
2093
+ strict: true,
2094
+ createInternalComparator: function() {
2095
+ return sameValueZeroEqual;
2096
+ }
2097
+ });
2098
+ var circularShallowEqual = createCustomEqual({
2099
+ circular: true,
2100
+ createInternalComparator: function() {
2101
+ return sameValueZeroEqual;
2102
+ }
2103
+ });
2104
+ var strictCircularShallowEqual = createCustomEqual({
2105
+ circular: true,
2106
+ createInternalComparator: function() {
2107
+ return sameValueZeroEqual;
2108
+ },
2109
+ strict: true
2110
+ });
2111
+ function createCustomEqual(options) {
2112
+ if (options === void 0) {
2113
+ options = {};
2114
+ }
2115
+ var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;
2116
+ var config = createEqualityComparatorConfig(options);
2117
+ var comparator = createEqualityComparator(config);
2118
+ var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
2119
+ return createIsEqual({ circular, comparator, createState, equals, strict });
2120
+ }
2121
+
2122
+ // ../core/lib/get-changed.ts
1690
2123
  var getChanged = (newItem, oldItem) => {
1691
2124
  return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
1692
2125
  const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
1693
2126
  const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
1694
2127
  return __spreadProps(__spreadValues({}, acc), {
1695
- [item]: !(0, import_fast_deep_equal.default)(oldItemProps[item], newItemProps[item])
2128
+ [item]: !deepEqual(oldItemProps[item], newItemProps[item])
1696
2129
  });
1697
2130
  }, {}) : {};
1698
2131
  };
1699
2132
 
1700
2133
  // ../core/store/slices/permissions.ts
1701
2134
  var createPermissionsSlice = (set, get) => {
1702
- const resolvePermissions = (..._0) => __async(void 0, [..._0], function* (params = {}, force) {
2135
+ const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
1703
2136
  const { state, permissions, config } = get();
1704
2137
  const { cache: cache2, globalPermissions } = permissions;
1705
- const resolveDataForItem = (item2, force2 = false) => __async(void 0, null, function* () {
1706
- var _a, _b, _c;
2138
+ const resolvePermissionsForItem = (item2, force2 = false) => __async(null, null, function* () {
2139
+ var _a, _b;
1707
2140
  const { config: config2, state: appState, setComponentLoading } = get();
2141
+ const itemCache = cache2[item2.props.id];
2142
+ const nodes = appState.indexes.nodes;
2143
+ const parentId = (_a = nodes[item2.props.id]) == null ? void 0 : _a.parentId;
2144
+ const parentNode = parentId ? nodes[parentId] : null;
2145
+ const parentData = (_b = parentNode == null ? void 0 : parentNode.data) != null ? _b : null;
1708
2146
  const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
1709
2147
  if (!componentConfig) {
1710
2148
  return;
1711
2149
  }
1712
2150
  const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig.permissions);
1713
2151
  if (componentConfig.resolvePermissions) {
1714
- const changed = getChanged(item2, (_a = cache2[item2.props.id]) == null ? void 0 : _a.lastData);
1715
- if (Object.values(changed).some((el) => el === true) || force2) {
2152
+ const changed = getChanged(item2, itemCache == null ? void 0 : itemCache.lastData);
2153
+ const propsChanged = Object.values(changed).some((el) => el === true);
2154
+ const parentChanged = (itemCache == null ? void 0 : itemCache.lastParentId) !== parentId;
2155
+ if (propsChanged || parentChanged || force2) {
1716
2156
  const clearTimeout2 = setComponentLoading(item2.props.id, true, 50);
1717
2157
  const resolvedPermissions = yield componentConfig.resolvePermissions(
1718
2158
  item2,
1719
2159
  {
1720
2160
  changed,
1721
- lastPermissions: ((_b = cache2[item2.props.id]) == null ? void 0 : _b.lastPermissions) || null,
2161
+ lastPermissions: (itemCache == null ? void 0 : itemCache.lastPermissions) || null,
1722
2162
  permissions: initialPermissions,
1723
2163
  appState: makeStatePublic(appState),
1724
- lastData: ((_c = cache2[item2.props.id]) == null ? void 0 : _c.lastData) || null
2164
+ lastData: (itemCache == null ? void 0 : itemCache.lastData) || null,
2165
+ parent: parentData
1725
2166
  }
1726
2167
  );
1727
2168
  const latest = get().permissions;
@@ -1729,6 +2170,7 @@ var createPermissionsSlice = (set, get) => {
1729
2170
  permissions: __spreadProps(__spreadValues({}, latest), {
1730
2171
  cache: __spreadProps(__spreadValues({}, latest.cache), {
1731
2172
  [item2.props.id]: {
2173
+ lastParentId: parentId,
1732
2174
  lastData: item2,
1733
2175
  lastPermissions: resolvedPermissions
1734
2176
  }
@@ -1742,9 +2184,9 @@ var createPermissionsSlice = (set, get) => {
1742
2184
  }
1743
2185
  }
1744
2186
  });
1745
- const resolveDataForRoot = (force2 = false) => {
2187
+ const resolvePermissionsForRoot = (force2 = false) => {
1746
2188
  const { state: appState } = get();
1747
- resolveDataForItem(
2189
+ resolvePermissionsForItem(
1748
2190
  // Shim the root data in by conforming to component data shape
1749
2191
  {
1750
2192
  type: "root",
@@ -1755,16 +2197,16 @@ var createPermissionsSlice = (set, get) => {
1755
2197
  };
1756
2198
  const { item, type, root } = params;
1757
2199
  if (item) {
1758
- yield resolveDataForItem(item, force);
2200
+ yield resolvePermissionsForItem(item, force);
1759
2201
  } else if (type) {
1760
- flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(void 0, null, function* () {
1761
- yield resolveDataForItem(item2, force);
2202
+ flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
2203
+ yield resolvePermissionsForItem(item2, force);
1762
2204
  }));
1763
2205
  } else if (root) {
1764
- resolveDataForRoot(force);
2206
+ resolvePermissionsForRoot(force);
1765
2207
  } else {
1766
- flattenData(state, config).map((item2) => __async(void 0, null, function* () {
1767
- yield resolveDataForItem(item2, force);
2208
+ flattenData(state, config).map((item2) => __async(null, null, function* () {
2209
+ yield resolvePermissionsForItem(item2, force);
1768
2210
  }));
1769
2211
  }
1770
2212
  });
@@ -1817,16 +2259,15 @@ var createFieldsSlice = (_set, _get) => {
1817
2259
 
1818
2260
  // ../core/lib/resolve-component-data.ts
1819
2261
  init_react_import();
1820
- var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
1821
2262
  var cache = { lastChange: {} };
1822
- var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
2263
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
1823
2264
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
1824
2265
  const resolvedItem = __spreadValues({}, item);
1825
2266
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
1826
2267
  const id = "id" in item.props ? item.props.id : "root";
1827
2268
  if (shouldRunResolver) {
1828
2269
  const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
1829
- if (trigger !== "force" && item && (0, import_fast_deep_equal2.default)(item, oldItem)) {
2270
+ if (trigger !== "force" && item && deepEqual(item, oldItem)) {
1830
2271
  return { node: resolved, didChange: false };
1831
2272
  }
1832
2273
  const changed = getChanged(item, oldItem);
@@ -1847,11 +2288,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1847
2288
  let itemWithResolvedChildren = yield mapFields(
1848
2289
  resolvedItem,
1849
2290
  {
1850
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
2291
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
1851
2292
  const content = value;
1852
2293
  return yield Promise.all(
1853
2294
  content.map(
1854
- (childItem) => __async(void 0, null, function* () {
2295
+ (childItem) => __async(null, null, function* () {
1855
2296
  return (yield resolveComponentData(
1856
2297
  childItem,
1857
2298
  config,
@@ -1876,7 +2317,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1876
2317
  };
1877
2318
  return {
1878
2319
  node: itemWithResolvedChildren,
1879
- didChange: !(0, import_fast_deep_equal2.default)(item, itemWithResolvedChildren)
2320
+ didChange: !deepEqual(item, itemWithResolvedChildren)
1880
2321
  };
1881
2322
  });
1882
2323
 
@@ -1917,7 +2358,8 @@ var defaultAppState = {
1917
2358
  options: [],
1918
2359
  controlsVisible: true
1919
2360
  },
1920
- field: { focus: null }
2361
+ field: { focus: null },
2362
+ plugin: { current: null }
1921
2363
  },
1922
2364
  indexes: {
1923
2365
  nodes: {},
@@ -1933,6 +2375,7 @@ var createAppStore = (initialAppStore) => create()(
1933
2375
  subscribeWithSelector((set, get) => {
1934
2376
  var _a, _b;
1935
2377
  return __spreadProps(__spreadValues({
2378
+ instanceId: generateId(),
1936
2379
  state: defaultAppState,
1937
2380
  config: { components: {} },
1938
2381
  componentState: {},
@@ -1953,6 +2396,11 @@ var createAppStore = (initialAppStore) => create()(
1953
2396
  history: createHistorySlice(set, get),
1954
2397
  nodes: createNodesSlice(set, get),
1955
2398
  permissions: createPermissionsSlice(set, get),
2399
+ getCurrentData: () => {
2400
+ var _a2;
2401
+ const s = get();
2402
+ return (_a2 = s.selectedItem) != null ? _a2 : s.state.data.root;
2403
+ },
1956
2404
  getComponentConfig: (type) => {
1957
2405
  var _a2;
1958
2406
  const { config, selectedItem } = get();
@@ -2041,7 +2489,7 @@ var createAppStore = (initialAppStore) => create()(
2041
2489
  const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
2042
2490
  return __spreadProps(__spreadValues({}, s), { state, selectedItem });
2043
2491
  }),
2044
- resolveComponentData: (componentData, trigger) => __async(void 0, null, function* () {
2492
+ resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
2045
2493
  const { config, metadata, setComponentLoading, permissions } = get();
2046
2494
  const timeouts = {};
2047
2495
  return yield resolveComponentData(
@@ -2052,7 +2500,7 @@ var createAppStore = (initialAppStore) => create()(
2052
2500
  const id = "id" in item.props ? item.props.id : "root";
2053
2501
  timeouts[id] = setComponentLoading(id, true, 50);
2054
2502
  },
2055
- (item) => __async(void 0, null, function* () {
2503
+ (item) => __async(null, null, function* () {
2056
2504
  const id = "id" in item.props ? item.props.id : "root";
2057
2505
  if ("type" in item) {
2058
2506
  yield permissions.refreshPermissions({ item });
@@ -2064,7 +2512,7 @@ var createAppStore = (initialAppStore) => create()(
2064
2512
  trigger
2065
2513
  );
2066
2514
  }),
2067
- resolveAndCommitData: () => __async(void 0, null, function* () {
2515
+ resolveAndCommitData: () => __async(null, null, function* () {
2068
2516
  const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
2069
2517
  walkAppState(
2070
2518
  state,
@@ -2103,203 +2551,14 @@ var createAppStore = (initialAppStore) => create()(
2103
2551
  })
2104
2552
  );
2105
2553
  var appStoreContext = createContext(createAppStore());
2106
- function useAppStore(selector) {
2107
- const context = useContext(appStoreContext);
2108
- return useStore(context, selector);
2109
- }
2110
- function useAppStoreApi() {
2111
- return useContext(appStoreContext);
2112
- }
2113
-
2114
- // ../core/lib/use-breadcrumbs.ts
2115
- var useBreadcrumbs = (renderCount) => {
2116
- const selectedId = useAppStore((s) => {
2117
- var _a;
2118
- return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
2119
- });
2120
- const config = useAppStore((s) => s.config);
2121
- const path = useAppStore((s) => {
2122
- var _a;
2123
- return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
2124
- });
2125
- const appStore = useAppStoreApi();
2126
- return useMemo(() => {
2127
- const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
2128
- var _a, _b, _c;
2129
- const [componentId] = zoneCompound.split(":");
2130
- if (componentId === "root") {
2131
- return {
2132
- label: "Page",
2133
- selector: null
2134
- };
2135
- }
2136
- const node = appStore.getState().state.indexes.nodes[componentId];
2137
- const parentId = node.path[node.path.length - 1];
2138
- const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
2139
- const index = contentIds.indexOf(componentId);
2140
- const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
2141
- return {
2142
- label,
2143
- selector: node ? {
2144
- index,
2145
- zone: node.path[node.path.length - 1]
2146
- } : null
2147
- };
2148
- })) || [];
2149
- if (renderCount) {
2150
- return breadcrumbs.slice(breadcrumbs.length - renderCount);
2151
- }
2152
- return breadcrumbs;
2153
- }, [path, renderCount]);
2154
- };
2155
-
2156
- // ../core/components/Loader/index.tsx
2157
- init_react_import();
2158
-
2159
- // ../core/lib/index.ts
2160
- init_react_import();
2161
-
2162
- // ../core/lib/filter.ts
2163
- init_react_import();
2164
-
2165
- // ../core/lib/data/reorder.ts
2166
- init_react_import();
2167
-
2168
- // ../core/lib/data/replace.ts
2169
- init_react_import();
2170
-
2171
- // ../core/lib/use-reset-auto-zoom.ts
2172
- init_react_import();
2173
2554
 
2174
2555
  // ../core/lib/get-zoom-config.ts
2175
2556
  init_react_import();
2176
2557
 
2177
- // css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
2178
- init_react_import();
2179
- var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
2180
-
2181
- // ../core/components/Loader/index.tsx
2182
- import { jsx as jsx2 } from "react/jsx-runtime";
2183
- var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
2184
- var Loader = (_a) => {
2185
- var _b = _a, {
2186
- color,
2187
- size = 16
2188
- } = _b, props = __objRest(_b, [
2189
- "color",
2190
- "size"
2191
- ]);
2192
- return /* @__PURE__ */ jsx2(
2193
- "span",
2194
- __spreadValues({
2195
- className: getClassName2(),
2196
- style: {
2197
- width: size,
2198
- height: size,
2199
- color
2200
- },
2201
- "aria-label": "loading"
2202
- }, props)
2203
- );
2204
- };
2205
-
2206
- // ../core/components/SidebarSection/index.tsx
2207
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
2208
- var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
2209
- var SidebarSection = ({
2210
- children,
2211
- title,
2212
- background,
2213
- showBreadcrumbs,
2214
- noBorderTop,
2215
- noPadding,
2216
- isLoading
2217
- }) => {
2218
- const setUi = useAppStore((s) => s.setUi);
2219
- const breadcrumbs = useBreadcrumbs(1);
2220
- return /* @__PURE__ */ jsxs(
2221
- "div",
2222
- {
2223
- className: getClassName3({ noBorderTop, noPadding }),
2224
- style: { background },
2225
- children: [
2226
- /* @__PURE__ */ jsx3("div", { className: getClassName3("title"), children: /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumbs"), children: [
2227
- showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumb"), children: [
2228
- /* @__PURE__ */ jsx3(
2229
- "button",
2230
- {
2231
- type: "button",
2232
- className: getClassName3("breadcrumbLabel"),
2233
- onClick: () => setUi({ itemSelector: breadcrumb.selector }),
2234
- children: breadcrumb.label
2235
- }
2236
- ),
2237
- /* @__PURE__ */ jsx3(ChevronRight, { size: 16 })
2238
- ] }, i)) : null,
2239
- /* @__PURE__ */ jsx3("div", { className: getClassName3("heading"), children: /* @__PURE__ */ jsx3(Heading, { rank: "2", size: "xs", children: title }) })
2240
- ] }) }),
2241
- /* @__PURE__ */ jsx3("div", { className: getClassName3("content"), children }),
2242
- isLoading && /* @__PURE__ */ jsx3("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ jsx3(Loader, { size: 32 }) })
2243
- ]
2244
- }
2245
- );
2246
- };
2247
-
2248
- // ../core/components/OutlineList/index.tsx
2249
- init_react_import();
2250
-
2251
- // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
2252
- init_react_import();
2253
- var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
2254
-
2255
- // ../core/components/OutlineList/index.tsx
2256
- import { jsx as jsx4 } from "react/jsx-runtime";
2257
- var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
2258
- var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
2259
- var OutlineList = ({ children }) => {
2260
- return /* @__PURE__ */ jsx4("ul", { className: getClassName4(), children });
2261
- };
2262
- OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx4("div", { className: getClassNameItem({ clickable: true }), children });
2263
- OutlineList.Item = ({
2264
- children,
2265
- onClick
2266
- }) => {
2267
- return /* @__PURE__ */ jsx4(
2268
- "li",
2269
- {
2270
- className: getClassNameItem({ clickable: !!onClick }),
2271
- onClick,
2272
- children
2273
- }
2274
- );
2275
- };
2276
-
2277
- // ../core/lib/scroll-into-view.ts
2278
- init_react_import();
2279
- var scrollIntoView = (el) => {
2280
- const oldStyle = __spreadValues({}, el.style);
2281
- el.style.scrollMargin = "256px";
2282
- if (el) {
2283
- el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
2284
- el.style.scrollMargin = oldStyle.scrollMargin || "";
2285
- }
2286
- };
2287
-
2288
- // ../core/lib/get-frame.ts
2289
- init_react_import();
2290
- var getFrame = () => {
2291
- if (typeof window === "undefined") return;
2292
- let frameEl = document.querySelector("#preview-frame");
2293
- if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
2294
- return frameEl.contentDocument || document;
2295
- }
2296
- return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
2297
- };
2298
-
2299
2558
  // src/HeadingAnalyzer.tsx
2300
2559
  import ReactFromJSONModule from "react-from-json";
2301
- import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
2302
- var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2560
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
2561
+ var getClassName2 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2303
2562
  var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
2304
2563
  var ReactFromJSON = ReactFromJSONModule.default || ReactFromJSONModule;
2305
2564
  var getOutline = ({ frame } = {}) => {
@@ -2390,11 +2649,11 @@ var HeadingAnalyzer = () => {
2390
2649
  frameObserver.disconnect();
2391
2650
  };
2392
2651
  }, [data]);
2393
- return /* @__PURE__ */ jsxs2("div", { className: getClassName5(), children: [
2394
- /* @__PURE__ */ jsxs2(
2652
+ return /* @__PURE__ */ jsxs("div", { className: getClassName2(), children: [
2653
+ /* @__PURE__ */ jsxs(
2395
2654
  "small",
2396
2655
  {
2397
- className: getClassName5("cssWarning"),
2656
+ className: getClassName2("cssWarning"),
2398
2657
  style: {
2399
2658
  color: "var(--puck-color-red-04)",
2400
2659
  display: "block",
@@ -2403,19 +2662,19 @@ var HeadingAnalyzer = () => {
2403
2662
  children: [
2404
2663
  "Heading analyzer styles not loaded. Please review the",
2405
2664
  " ",
2406
- /* @__PURE__ */ jsx5("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2665
+ /* @__PURE__ */ jsx2("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2407
2666
  "."
2408
2667
  ]
2409
2668
  }
2410
2669
  ),
2411
- hierarchy.length === 0 && /* @__PURE__ */ jsx5("div", { children: "No headings." }),
2412
- /* @__PURE__ */ jsx5(OutlineList, { children: /* @__PURE__ */ jsx5(
2670
+ hierarchy.length === 0 && /* @__PURE__ */ jsx2("div", { children: "No headings." }),
2671
+ /* @__PURE__ */ jsx2(OutlineList, { children: /* @__PURE__ */ jsx2(
2413
2672
  ReactFromJSON,
2414
2673
  {
2415
2674
  mapping: {
2416
- Root: (props) => /* @__PURE__ */ jsx5(Fragment, { children: props.children }),
2417
- OutlineListItem: (props) => /* @__PURE__ */ jsxs2(OutlineList.Item, { children: [
2418
- /* @__PURE__ */ jsx5(OutlineList.Clickable, { children: /* @__PURE__ */ jsx5(
2675
+ Root: (props) => /* @__PURE__ */ jsx2(Fragment, { children: props.children }),
2676
+ OutlineListItem: (props) => /* @__PURE__ */ jsxs(OutlineList.Item, { children: [
2677
+ /* @__PURE__ */ jsx2(OutlineList.Clickable, { children: /* @__PURE__ */ jsx2(
2419
2678
  "small",
2420
2679
  {
2421
2680
  className: getClassNameItem2({ missing: props.missing }),
@@ -2433,14 +2692,14 @@ var HeadingAnalyzer = () => {
2433
2692
  }, 2e3);
2434
2693
  }
2435
2694
  },
2436
- children: props.missing ? /* @__PURE__ */ jsxs2(Fragment, { children: [
2437
- /* @__PURE__ */ jsxs2("b", { children: [
2695
+ children: props.missing ? /* @__PURE__ */ jsxs(Fragment, { children: [
2696
+ /* @__PURE__ */ jsxs("b", { children: [
2438
2697
  "H",
2439
2698
  props.rank
2440
2699
  ] }),
2441
2700
  ": Missing"
2442
- ] }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
2443
- /* @__PURE__ */ jsxs2("b", { children: [
2701
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2702
+ /* @__PURE__ */ jsxs("b", { children: [
2444
2703
  "H",
2445
2704
  props.rank
2446
2705
  ] }),
@@ -2449,7 +2708,7 @@ var HeadingAnalyzer = () => {
2449
2708
  ] })
2450
2709
  }
2451
2710
  ) }),
2452
- /* @__PURE__ */ jsx5(OutlineList, { children: props.children })
2711
+ /* @__PURE__ */ jsx2(OutlineList, { children: props.children })
2453
2712
  ] })
2454
2713
  },
2455
2714
  entry: {
@@ -2470,12 +2729,10 @@ var HeadingAnalyzer = () => {
2470
2729
  ] });
2471
2730
  };
2472
2731
  var headingAnalyzer = {
2473
- overrides: {
2474
- fields: ({ children, itemSelector }) => /* @__PURE__ */ jsxs2(Fragment, { children: [
2475
- children,
2476
- /* @__PURE__ */ jsx5("div", { style: { display: itemSelector ? "none" : "block" }, children: /* @__PURE__ */ jsx5(SidebarSection, { title: "Heading Outline", children: /* @__PURE__ */ jsx5(HeadingAnalyzer, {}) }) })
2477
- ] })
2478
- }
2732
+ name: "heading-analyzer",
2733
+ label: "Audit",
2734
+ render: HeadingAnalyzer,
2735
+ icon: /* @__PURE__ */ jsx2(Heading1, {})
2479
2736
  };
2480
2737
  var HeadingAnalyzer_default = headingAnalyzer;
2481
2738
  export {
@@ -2491,45 +2748,10 @@ classnames/index.js:
2491
2748
  *)
2492
2749
 
2493
2750
  lucide-react/dist/esm/shared/src/utils.js:
2494
- (**
2495
- * @license lucide-react v0.468.0 - ISC
2496
- *
2497
- * This source code is licensed under the ISC license.
2498
- * See the LICENSE file in the root directory of this source tree.
2499
- *)
2500
-
2501
2751
  lucide-react/dist/esm/defaultAttributes.js:
2502
- (**
2503
- * @license lucide-react v0.468.0 - ISC
2504
- *
2505
- * This source code is licensed under the ISC license.
2506
- * See the LICENSE file in the root directory of this source tree.
2507
- *)
2508
-
2509
2752
  lucide-react/dist/esm/Icon.js:
2510
- (**
2511
- * @license lucide-react v0.468.0 - ISC
2512
- *
2513
- * This source code is licensed under the ISC license.
2514
- * See the LICENSE file in the root directory of this source tree.
2515
- *)
2516
-
2517
2753
  lucide-react/dist/esm/createLucideIcon.js:
2518
- (**
2519
- * @license lucide-react v0.468.0 - ISC
2520
- *
2521
- * This source code is licensed under the ISC license.
2522
- * See the LICENSE file in the root directory of this source tree.
2523
- *)
2524
-
2525
- lucide-react/dist/esm/icons/chevron-right.js:
2526
- (**
2527
- * @license lucide-react v0.468.0 - ISC
2528
- *
2529
- * This source code is licensed under the ISC license.
2530
- * See the LICENSE file in the root directory of this source tree.
2531
- *)
2532
-
2754
+ lucide-react/dist/esm/icons/heading-1.js:
2533
2755
  lucide-react/dist/esm/lucide-react.js:
2534
2756
  (**
2535
2757
  * @license lucide-react v0.468.0 - ISC