@measured/puck-plugin-heading-analyzer 0.21.0-canary.6dae6cb7 → 0.21.0-canary.73664fc6

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.js CHANGED
@@ -98,7 +98,7 @@ var require_classnames = __commonJS({
98
98
  init_react_import();
99
99
  (function() {
100
100
  "use strict";
101
- var hasOwn = {}.hasOwnProperty;
101
+ var hasOwn2 = {}.hasOwnProperty;
102
102
  function classNames() {
103
103
  var classes = "";
104
104
  for (var i = 0; i < arguments.length; i++) {
@@ -124,7 +124,7 @@ var require_classnames = __commonJS({
124
124
  }
125
125
  var classes = "";
126
126
  for (var key in arg) {
127
- if (hasOwn.call(arg, key) && arg[key]) {
127
+ if (hasOwn2.call(arg, key) && arg[key]) {
128
128
  classes = appendClass(classes, key);
129
129
  }
130
130
  }
@@ -213,11 +213,11 @@ var require_flat = __commonJS({
213
213
  }
214
214
  function isEmpty(val) {
215
215
  const type = Object.prototype.toString.call(val);
216
- const isArray = type === "[object Array]";
216
+ const isArray2 = type === "[object Array]";
217
217
  const isObject = type === "[object Object]";
218
218
  if (!val) {
219
219
  return true;
220
- } else if (isArray) {
220
+ } else if (isArray2) {
221
221
  return !val.length;
222
222
  } else if (isObject) {
223
223
  return !Object.keys(val).length;
@@ -267,48 +267,12 @@ var require_flat = __commonJS({
267
267
  }
268
268
  });
269
269
 
270
- // ../../node_modules/fast-deep-equal/index.js
271
- var require_fast_deep_equal = __commonJS({
272
- "../../node_modules/fast-deep-equal/index.js"(exports2, module2) {
273
- "use strict";
274
- init_react_import();
275
- module2.exports = function equal(a, b) {
276
- if (a === b) return true;
277
- if (a && b && typeof a == "object" && typeof b == "object") {
278
- if (a.constructor !== b.constructor) return false;
279
- var length, i, keys;
280
- if (Array.isArray(a)) {
281
- length = a.length;
282
- if (length != b.length) return false;
283
- for (i = length; i-- !== 0; )
284
- if (!equal(a[i], b[i])) return false;
285
- return true;
286
- }
287
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
288
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
289
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
290
- keys = Object.keys(a);
291
- length = keys.length;
292
- if (length !== Object.keys(b).length) return false;
293
- for (i = length; i-- !== 0; )
294
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
295
- for (i = length; i-- !== 0; ) {
296
- var key = keys[i];
297
- if (!equal(a[key], b[key])) return false;
298
- }
299
- return true;
300
- }
301
- return a !== a && b !== b;
302
- };
303
- }
304
- });
305
-
306
270
  // index.ts
307
- var plugin_heading_analyzer_exports = {};
308
- __export(plugin_heading_analyzer_exports, {
271
+ var index_exports = {};
272
+ __export(index_exports, {
309
273
  default: () => HeadingAnalyzer_default
310
274
  });
311
- module.exports = __toCommonJS(plugin_heading_analyzer_exports);
275
+ module.exports = __toCommonJS(index_exports);
312
276
  init_react_import();
313
277
 
314
278
  // src/HeadingAnalyzer.tsx
@@ -854,10 +818,10 @@ var insert = (list, index, item) => {
854
818
  // ../core/lib/generate-id.ts
855
819
  init_react_import();
856
820
 
857
- // ../../node_modules/uuid/dist/esm-node/index.js
821
+ // ../core/node_modules/uuid/dist/esm-node/index.js
858
822
  init_react_import();
859
823
 
860
- // ../../node_modules/uuid/dist/esm-node/rng.js
824
+ // ../core/node_modules/uuid/dist/esm-node/rng.js
861
825
  init_react_import();
862
826
  var import_crypto = __toESM(require("crypto"));
863
827
  var rnds8Pool = new Uint8Array(256);
@@ -870,7 +834,7 @@ function rng() {
870
834
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
871
835
  }
872
836
 
873
- // ../../node_modules/uuid/dist/esm-node/stringify.js
837
+ // ../core/node_modules/uuid/dist/esm-node/stringify.js
874
838
  init_react_import();
875
839
  var byteToHex = [];
876
840
  for (let i = 0; i < 256; ++i) {
@@ -880,17 +844,17 @@ function unsafeStringify(arr, offset = 0) {
880
844
  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]];
881
845
  }
882
846
 
883
- // ../../node_modules/uuid/dist/esm-node/v4.js
847
+ // ../core/node_modules/uuid/dist/esm-node/v4.js
884
848
  init_react_import();
885
849
 
886
- // ../../node_modules/uuid/dist/esm-node/native.js
850
+ // ../core/node_modules/uuid/dist/esm-node/native.js
887
851
  init_react_import();
888
852
  var import_crypto2 = __toESM(require("crypto"));
889
853
  var native_default = {
890
854
  randomUUID: import_crypto2.default.randomUUID
891
855
  };
892
856
 
893
- // ../../node_modules/uuid/dist/esm-node/v4.js
857
+ // ../core/node_modules/uuid/dist/esm-node/v4.js
894
858
  function v4(options, buf, offset) {
895
859
  if (native_default.randomUUID && !buf && !options) {
896
860
  return native_default.randomUUID();
@@ -1042,7 +1006,9 @@ var replaceAction = (state, action, appStore) => {
1042
1006
  });
1043
1007
  });
1044
1008
  });
1045
- const stateWithDeepSlotsRemoved = __spreadValues({}, state);
1009
+ const stateWithDeepSlotsRemoved = __spreadProps(__spreadValues({}, state), {
1010
+ ui: __spreadValues(__spreadValues({}, state.ui), action.ui)
1011
+ });
1046
1012
  Object.keys(state.indexes.zones).forEach((zoneCompound) => {
1047
1013
  const id = zoneCompound.split(":")[0];
1048
1014
  if (id === originalId) {
@@ -1470,7 +1436,7 @@ var createStoreImpl = (createState) => {
1470
1436
  const initialState = state = createState(setState, getState, api);
1471
1437
  return api;
1472
1438
  };
1473
- var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
1439
+ var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
1474
1440
 
1475
1441
  // ../../node_modules/zustand/esm/react.mjs
1476
1442
  init_react_import();
@@ -1479,8 +1445,8 @@ var identity = (arg) => arg;
1479
1445
  function useStore(api, selector = identity) {
1480
1446
  const slice = import_react4.default.useSyncExternalStore(
1481
1447
  api.subscribe,
1482
- () => selector(api.getState()),
1483
- () => selector(api.getInitialState())
1448
+ import_react4.default.useCallback(() => selector(api.getState()), [api, selector]),
1449
+ import_react4.default.useCallback(() => selector(api.getInitialState()), [api, selector])
1484
1450
  );
1485
1451
  import_react4.default.useDebugValue(slice);
1486
1452
  return slice;
@@ -1491,13 +1457,13 @@ var createImpl = (createState) => {
1491
1457
  Object.assign(useBoundStore, api);
1492
1458
  return useBoundStore;
1493
1459
  };
1494
- var create = (createState) => createState ? createImpl(createState) : createImpl;
1460
+ var create = ((createState) => createState ? createImpl(createState) : createImpl);
1495
1461
 
1496
1462
  // ../../node_modules/zustand/esm/middleware.mjs
1497
1463
  init_react_import();
1498
1464
  var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
1499
1465
  const origSubscribe = api.subscribe;
1500
- api.subscribe = (selector, optListener, options) => {
1466
+ api.subscribe = ((selector, optListener, options) => {
1501
1467
  let listener = selector;
1502
1468
  if (optListener) {
1503
1469
  const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
@@ -1514,7 +1480,7 @@ var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
1514
1480
  }
1515
1481
  }
1516
1482
  return origSubscribe(listener);
1517
- };
1483
+ });
1518
1484
  const initialState = fn(set, get, api);
1519
1485
  return initialState;
1520
1486
  };
@@ -1554,9 +1520,9 @@ function debounce(func, timeout = 300) {
1554
1520
  var tidyState = (state) => {
1555
1521
  return __spreadProps(__spreadValues({}, state), {
1556
1522
  ui: __spreadProps(__spreadValues({}, state.ui), {
1557
- field: {
1523
+ field: __spreadProps(__spreadValues({}, state.ui.field), {
1558
1524
  focus: null
1559
- }
1525
+ })
1560
1526
  })
1561
1527
  });
1562
1528
  };
@@ -1690,7 +1656,7 @@ var flattenData = (state, config) => {
1690
1656
  (content) => content,
1691
1657
  (item) => {
1692
1658
  data.push(item);
1693
- return null;
1659
+ return item;
1694
1660
  }
1695
1661
  );
1696
1662
  return data;
@@ -1698,42 +1664,462 @@ var flattenData = (state, config) => {
1698
1664
 
1699
1665
  // ../core/lib/get-changed.ts
1700
1666
  init_react_import();
1701
- var import_fast_deep_equal = __toESM(require_fast_deep_equal());
1667
+
1668
+ // ../../node_modules/fast-equals/dist/esm/index.mjs
1669
+ init_react_import();
1670
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
1671
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1672
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1673
+ function combineComparators(comparatorA, comparatorB) {
1674
+ return function isEqual(a, b, state) {
1675
+ return comparatorA(a, b, state) && comparatorB(a, b, state);
1676
+ };
1677
+ }
1678
+ function createIsCircular(areItemsEqual) {
1679
+ return function isCircular(a, b, state) {
1680
+ if (!a || !b || typeof a !== "object" || typeof b !== "object") {
1681
+ return areItemsEqual(a, b, state);
1682
+ }
1683
+ var cache2 = state.cache;
1684
+ var cachedA = cache2.get(a);
1685
+ var cachedB = cache2.get(b);
1686
+ if (cachedA && cachedB) {
1687
+ return cachedA === b && cachedB === a;
1688
+ }
1689
+ cache2.set(a, b);
1690
+ cache2.set(b, a);
1691
+ var result = areItemsEqual(a, b, state);
1692
+ cache2.delete(a);
1693
+ cache2.delete(b);
1694
+ return result;
1695
+ };
1696
+ }
1697
+ function getStrictProperties(object) {
1698
+ return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
1699
+ }
1700
+ var hasOwn = Object.hasOwn || (function(object, property) {
1701
+ return hasOwnProperty.call(object, property);
1702
+ });
1703
+ function sameValueZeroEqual(a, b) {
1704
+ return a === b || !a && !b && a !== a && b !== b;
1705
+ }
1706
+ var PREACT_VNODE = "__v";
1707
+ var PREACT_OWNER = "__o";
1708
+ var REACT_OWNER = "_owner";
1709
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1710
+ var keys = Object.keys;
1711
+ function areArraysEqual(a, b, state) {
1712
+ var index = a.length;
1713
+ if (b.length !== index) {
1714
+ return false;
1715
+ }
1716
+ while (index-- > 0) {
1717
+ if (!state.equals(a[index], b[index], index, index, a, b, state)) {
1718
+ return false;
1719
+ }
1720
+ }
1721
+ return true;
1722
+ }
1723
+ function areDatesEqual(a, b) {
1724
+ return sameValueZeroEqual(a.getTime(), b.getTime());
1725
+ }
1726
+ function areErrorsEqual(a, b) {
1727
+ return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
1728
+ }
1729
+ function areFunctionsEqual(a, b) {
1730
+ return a === b;
1731
+ }
1732
+ function areMapsEqual(a, b, state) {
1733
+ var size = a.size;
1734
+ if (size !== b.size) {
1735
+ return false;
1736
+ }
1737
+ if (!size) {
1738
+ return true;
1739
+ }
1740
+ var matchedIndices = new Array(size);
1741
+ var aIterable = a.entries();
1742
+ var aResult;
1743
+ var bResult;
1744
+ var index = 0;
1745
+ while (aResult = aIterable.next()) {
1746
+ if (aResult.done) {
1747
+ break;
1748
+ }
1749
+ var bIterable = b.entries();
1750
+ var hasMatch = false;
1751
+ var matchIndex = 0;
1752
+ while (bResult = bIterable.next()) {
1753
+ if (bResult.done) {
1754
+ break;
1755
+ }
1756
+ if (matchedIndices[matchIndex]) {
1757
+ matchIndex++;
1758
+ continue;
1759
+ }
1760
+ var aEntry = aResult.value;
1761
+ var bEntry = bResult.value;
1762
+ 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)) {
1763
+ hasMatch = matchedIndices[matchIndex] = true;
1764
+ break;
1765
+ }
1766
+ matchIndex++;
1767
+ }
1768
+ if (!hasMatch) {
1769
+ return false;
1770
+ }
1771
+ index++;
1772
+ }
1773
+ return true;
1774
+ }
1775
+ var areNumbersEqual = sameValueZeroEqual;
1776
+ function areObjectsEqual(a, b, state) {
1777
+ var properties = keys(a);
1778
+ var index = properties.length;
1779
+ if (keys(b).length !== index) {
1780
+ return false;
1781
+ }
1782
+ while (index-- > 0) {
1783
+ if (!isPropertyEqual(a, b, state, properties[index])) {
1784
+ return false;
1785
+ }
1786
+ }
1787
+ return true;
1788
+ }
1789
+ function areObjectsEqualStrict(a, b, state) {
1790
+ var properties = getStrictProperties(a);
1791
+ var index = properties.length;
1792
+ if (getStrictProperties(b).length !== index) {
1793
+ return false;
1794
+ }
1795
+ var property;
1796
+ var descriptorA;
1797
+ var descriptorB;
1798
+ while (index-- > 0) {
1799
+ property = properties[index];
1800
+ if (!isPropertyEqual(a, b, state, property)) {
1801
+ return false;
1802
+ }
1803
+ descriptorA = getOwnPropertyDescriptor(a, property);
1804
+ descriptorB = getOwnPropertyDescriptor(b, property);
1805
+ if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
1806
+ return false;
1807
+ }
1808
+ }
1809
+ return true;
1810
+ }
1811
+ function arePrimitiveWrappersEqual(a, b) {
1812
+ return sameValueZeroEqual(a.valueOf(), b.valueOf());
1813
+ }
1814
+ function areRegExpsEqual(a, b) {
1815
+ return a.source === b.source && a.flags === b.flags;
1816
+ }
1817
+ function areSetsEqual(a, b, state) {
1818
+ var size = a.size;
1819
+ if (size !== b.size) {
1820
+ return false;
1821
+ }
1822
+ if (!size) {
1823
+ return true;
1824
+ }
1825
+ var matchedIndices = new Array(size);
1826
+ var aIterable = a.values();
1827
+ var aResult;
1828
+ var bResult;
1829
+ while (aResult = aIterable.next()) {
1830
+ if (aResult.done) {
1831
+ break;
1832
+ }
1833
+ var bIterable = b.values();
1834
+ var hasMatch = false;
1835
+ var matchIndex = 0;
1836
+ while (bResult = bIterable.next()) {
1837
+ if (bResult.done) {
1838
+ break;
1839
+ }
1840
+ if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
1841
+ hasMatch = matchedIndices[matchIndex] = true;
1842
+ break;
1843
+ }
1844
+ matchIndex++;
1845
+ }
1846
+ if (!hasMatch) {
1847
+ return false;
1848
+ }
1849
+ }
1850
+ return true;
1851
+ }
1852
+ function areTypedArraysEqual(a, b) {
1853
+ var index = a.length;
1854
+ if (b.length !== index) {
1855
+ return false;
1856
+ }
1857
+ while (index-- > 0) {
1858
+ if (a[index] !== b[index]) {
1859
+ return false;
1860
+ }
1861
+ }
1862
+ return true;
1863
+ }
1864
+ function areUrlsEqual(a, b) {
1865
+ 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;
1866
+ }
1867
+ function isPropertyEqual(a, b, state, property) {
1868
+ if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) {
1869
+ return true;
1870
+ }
1871
+ return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
1872
+ }
1873
+ var ARGUMENTS_TAG = "[object Arguments]";
1874
+ var BOOLEAN_TAG = "[object Boolean]";
1875
+ var DATE_TAG = "[object Date]";
1876
+ var ERROR_TAG = "[object Error]";
1877
+ var MAP_TAG = "[object Map]";
1878
+ var NUMBER_TAG = "[object Number]";
1879
+ var OBJECT_TAG = "[object Object]";
1880
+ var REG_EXP_TAG = "[object RegExp]";
1881
+ var SET_TAG = "[object Set]";
1882
+ var STRING_TAG = "[object String]";
1883
+ var URL_TAG = "[object URL]";
1884
+ var isArray = Array.isArray;
1885
+ var isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null;
1886
+ var assign = Object.assign;
1887
+ var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
1888
+ function createEqualityComparator(_a) {
1889
+ 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;
1890
+ return function comparator(a, b, state) {
1891
+ if (a === b) {
1892
+ return true;
1893
+ }
1894
+ if (a == null || b == null) {
1895
+ return false;
1896
+ }
1897
+ var type = typeof a;
1898
+ if (type !== typeof b) {
1899
+ return false;
1900
+ }
1901
+ if (type !== "object") {
1902
+ if (type === "number") {
1903
+ return areNumbersEqual2(a, b, state);
1904
+ }
1905
+ if (type === "function") {
1906
+ return areFunctionsEqual2(a, b, state);
1907
+ }
1908
+ return false;
1909
+ }
1910
+ var constructor = a.constructor;
1911
+ if (constructor !== b.constructor) {
1912
+ return false;
1913
+ }
1914
+ if (constructor === Object) {
1915
+ return areObjectsEqual2(a, b, state);
1916
+ }
1917
+ if (isArray(a)) {
1918
+ return areArraysEqual2(a, b, state);
1919
+ }
1920
+ if (isTypedArray != null && isTypedArray(a)) {
1921
+ return areTypedArraysEqual2(a, b, state);
1922
+ }
1923
+ if (constructor === Date) {
1924
+ return areDatesEqual2(a, b, state);
1925
+ }
1926
+ if (constructor === RegExp) {
1927
+ return areRegExpsEqual2(a, b, state);
1928
+ }
1929
+ if (constructor === Map) {
1930
+ return areMapsEqual2(a, b, state);
1931
+ }
1932
+ if (constructor === Set) {
1933
+ return areSetsEqual2(a, b, state);
1934
+ }
1935
+ var tag = getTag(a);
1936
+ if (tag === DATE_TAG) {
1937
+ return areDatesEqual2(a, b, state);
1938
+ }
1939
+ if (tag === REG_EXP_TAG) {
1940
+ return areRegExpsEqual2(a, b, state);
1941
+ }
1942
+ if (tag === MAP_TAG) {
1943
+ return areMapsEqual2(a, b, state);
1944
+ }
1945
+ if (tag === SET_TAG) {
1946
+ return areSetsEqual2(a, b, state);
1947
+ }
1948
+ if (tag === OBJECT_TAG) {
1949
+ return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
1950
+ }
1951
+ if (tag === URL_TAG) {
1952
+ return areUrlsEqual2(a, b, state);
1953
+ }
1954
+ if (tag === ERROR_TAG) {
1955
+ return areErrorsEqual2(a, b, state);
1956
+ }
1957
+ if (tag === ARGUMENTS_TAG) {
1958
+ return areObjectsEqual2(a, b, state);
1959
+ }
1960
+ if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
1961
+ return arePrimitiveWrappersEqual2(a, b, state);
1962
+ }
1963
+ return false;
1964
+ };
1965
+ }
1966
+ function createEqualityComparatorConfig(_a) {
1967
+ var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
1968
+ var config = {
1969
+ areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
1970
+ areDatesEqual,
1971
+ areErrorsEqual,
1972
+ areFunctionsEqual,
1973
+ areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
1974
+ areNumbersEqual,
1975
+ areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
1976
+ arePrimitiveWrappersEqual,
1977
+ areRegExpsEqual,
1978
+ areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
1979
+ areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
1980
+ areUrlsEqual
1981
+ };
1982
+ if (createCustomConfig) {
1983
+ config = assign({}, config, createCustomConfig(config));
1984
+ }
1985
+ if (circular) {
1986
+ var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
1987
+ var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
1988
+ var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
1989
+ var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
1990
+ config = assign({}, config, {
1991
+ areArraysEqual: areArraysEqual$1,
1992
+ areMapsEqual: areMapsEqual$1,
1993
+ areObjectsEqual: areObjectsEqual$1,
1994
+ areSetsEqual: areSetsEqual$1
1995
+ });
1996
+ }
1997
+ return config;
1998
+ }
1999
+ function createInternalEqualityComparator(compare) {
2000
+ return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
2001
+ return compare(a, b, state);
2002
+ };
2003
+ }
2004
+ function createIsEqual(_a) {
2005
+ var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
2006
+ if (createState) {
2007
+ return function isEqual(a, b) {
2008
+ var _a2 = createState(), _b = _a2.cache, cache2 = _b === void 0 ? circular ? /* @__PURE__ */ new WeakMap() : void 0 : _b, meta = _a2.meta;
2009
+ return comparator(a, b, {
2010
+ cache: cache2,
2011
+ equals,
2012
+ meta,
2013
+ strict
2014
+ });
2015
+ };
2016
+ }
2017
+ if (circular) {
2018
+ return function isEqual(a, b) {
2019
+ return comparator(a, b, {
2020
+ cache: /* @__PURE__ */ new WeakMap(),
2021
+ equals,
2022
+ meta: void 0,
2023
+ strict
2024
+ });
2025
+ };
2026
+ }
2027
+ var state = {
2028
+ cache: void 0,
2029
+ equals,
2030
+ meta: void 0,
2031
+ strict
2032
+ };
2033
+ return function isEqual(a, b) {
2034
+ return comparator(a, b, state);
2035
+ };
2036
+ }
2037
+ var deepEqual = createCustomEqual();
2038
+ var strictDeepEqual = createCustomEqual({ strict: true });
2039
+ var circularDeepEqual = createCustomEqual({ circular: true });
2040
+ var strictCircularDeepEqual = createCustomEqual({
2041
+ circular: true,
2042
+ strict: true
2043
+ });
2044
+ var shallowEqual = createCustomEqual({
2045
+ createInternalComparator: function() {
2046
+ return sameValueZeroEqual;
2047
+ }
2048
+ });
2049
+ var strictShallowEqual = createCustomEqual({
2050
+ strict: true,
2051
+ createInternalComparator: function() {
2052
+ return sameValueZeroEqual;
2053
+ }
2054
+ });
2055
+ var circularShallowEqual = createCustomEqual({
2056
+ circular: true,
2057
+ createInternalComparator: function() {
2058
+ return sameValueZeroEqual;
2059
+ }
2060
+ });
2061
+ var strictCircularShallowEqual = createCustomEqual({
2062
+ circular: true,
2063
+ createInternalComparator: function() {
2064
+ return sameValueZeroEqual;
2065
+ },
2066
+ strict: true
2067
+ });
2068
+ function createCustomEqual(options) {
2069
+ if (options === void 0) {
2070
+ options = {};
2071
+ }
2072
+ 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;
2073
+ var config = createEqualityComparatorConfig(options);
2074
+ var comparator = createEqualityComparator(config);
2075
+ var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
2076
+ return createIsEqual({ circular, comparator, createState, equals, strict });
2077
+ }
2078
+
2079
+ // ../core/lib/get-changed.ts
1702
2080
  var getChanged = (newItem, oldItem) => {
1703
2081
  return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
1704
2082
  const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
1705
2083
  const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
1706
2084
  return __spreadProps(__spreadValues({}, acc), {
1707
- [item]: !(0, import_fast_deep_equal.default)(oldItemProps[item], newItemProps[item])
2085
+ [item]: !deepEqual(oldItemProps[item], newItemProps[item])
1708
2086
  });
1709
2087
  }, {}) : {};
1710
2088
  };
1711
2089
 
1712
2090
  // ../core/store/slices/permissions.ts
1713
2091
  var createPermissionsSlice = (set, get) => {
1714
- const resolvePermissions = (..._0) => __async(void 0, [..._0], function* (params = {}, force) {
2092
+ const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
1715
2093
  const { state, permissions, config } = get();
1716
2094
  const { cache: cache2, globalPermissions } = permissions;
1717
- const resolveDataForItem = (item2, force2 = false) => __async(void 0, null, function* () {
1718
- var _a, _b, _c;
2095
+ const resolvePermissionsForItem = (item2, force2 = false) => __async(null, null, function* () {
2096
+ var _a, _b;
1719
2097
  const { config: config2, state: appState, setComponentLoading } = get();
2098
+ const itemCache = cache2[item2.props.id];
2099
+ const nodes = appState.indexes.nodes;
2100
+ const parentId = (_a = nodes[item2.props.id]) == null ? void 0 : _a.parentId;
2101
+ const parentNode = parentId ? nodes[parentId] : null;
2102
+ const parentData = (_b = parentNode == null ? void 0 : parentNode.data) != null ? _b : null;
1720
2103
  const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
1721
2104
  if (!componentConfig) {
1722
2105
  return;
1723
2106
  }
1724
2107
  const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig.permissions);
1725
2108
  if (componentConfig.resolvePermissions) {
1726
- const changed = getChanged(item2, (_a = cache2[item2.props.id]) == null ? void 0 : _a.lastData);
1727
- if (Object.values(changed).some((el) => el === true) || force2) {
2109
+ const changed = getChanged(item2, itemCache == null ? void 0 : itemCache.lastData);
2110
+ const propsChanged = Object.values(changed).some((el) => el === true);
2111
+ const parentChanged = (itemCache == null ? void 0 : itemCache.lastParentId) !== parentId;
2112
+ if (propsChanged || parentChanged || force2) {
1728
2113
  const clearTimeout2 = setComponentLoading(item2.props.id, true, 50);
1729
2114
  const resolvedPermissions = yield componentConfig.resolvePermissions(
1730
2115
  item2,
1731
2116
  {
1732
2117
  changed,
1733
- lastPermissions: ((_b = cache2[item2.props.id]) == null ? void 0 : _b.lastPermissions) || null,
2118
+ lastPermissions: (itemCache == null ? void 0 : itemCache.lastPermissions) || null,
1734
2119
  permissions: initialPermissions,
1735
2120
  appState: makeStatePublic(appState),
1736
- lastData: ((_c = cache2[item2.props.id]) == null ? void 0 : _c.lastData) || null
2121
+ lastData: (itemCache == null ? void 0 : itemCache.lastData) || null,
2122
+ parent: parentData
1737
2123
  }
1738
2124
  );
1739
2125
  const latest = get().permissions;
@@ -1741,6 +2127,7 @@ var createPermissionsSlice = (set, get) => {
1741
2127
  permissions: __spreadProps(__spreadValues({}, latest), {
1742
2128
  cache: __spreadProps(__spreadValues({}, latest.cache), {
1743
2129
  [item2.props.id]: {
2130
+ lastParentId: parentId,
1744
2131
  lastData: item2,
1745
2132
  lastPermissions: resolvedPermissions
1746
2133
  }
@@ -1754,9 +2141,9 @@ var createPermissionsSlice = (set, get) => {
1754
2141
  }
1755
2142
  }
1756
2143
  });
1757
- const resolveDataForRoot = (force2 = false) => {
2144
+ const resolvePermissionsForRoot = (force2 = false) => {
1758
2145
  const { state: appState } = get();
1759
- resolveDataForItem(
2146
+ resolvePermissionsForItem(
1760
2147
  // Shim the root data in by conforming to component data shape
1761
2148
  {
1762
2149
  type: "root",
@@ -1767,16 +2154,16 @@ var createPermissionsSlice = (set, get) => {
1767
2154
  };
1768
2155
  const { item, type, root } = params;
1769
2156
  if (item) {
1770
- yield resolveDataForItem(item, force);
2157
+ yield resolvePermissionsForItem(item, force);
1771
2158
  } else if (type) {
1772
- flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(void 0, null, function* () {
1773
- yield resolveDataForItem(item2, force);
2159
+ flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
2160
+ yield resolvePermissionsForItem(item2, force);
1774
2161
  }));
1775
2162
  } else if (root) {
1776
- resolveDataForRoot(force);
2163
+ resolvePermissionsForRoot(force);
1777
2164
  } else {
1778
- flattenData(state, config).map((item2) => __async(void 0, null, function* () {
1779
- yield resolveDataForItem(item2, force);
2165
+ flattenData(state, config).map((item2) => __async(null, null, function* () {
2166
+ yield resolvePermissionsForItem(item2, force);
1780
2167
  }));
1781
2168
  }
1782
2169
  });
@@ -1829,16 +2216,15 @@ var createFieldsSlice = (_set, _get) => {
1829
2216
 
1830
2217
  // ../core/lib/resolve-component-data.ts
1831
2218
  init_react_import();
1832
- var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
1833
2219
  var cache = { lastChange: {} };
1834
- var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
2220
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
1835
2221
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
1836
2222
  const resolvedItem = __spreadValues({}, item);
1837
2223
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
1838
2224
  const id = "id" in item.props ? item.props.id : "root";
1839
2225
  if (shouldRunResolver) {
1840
2226
  const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
1841
- if (trigger !== "force" && item && (0, import_fast_deep_equal2.default)(item, oldItem)) {
2227
+ if (trigger !== "force" && item && deepEqual(item, oldItem)) {
1842
2228
  return { node: resolved, didChange: false };
1843
2229
  }
1844
2230
  const changed = getChanged(item, oldItem);
@@ -1859,11 +2245,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1859
2245
  let itemWithResolvedChildren = yield mapFields(
1860
2246
  resolvedItem,
1861
2247
  {
1862
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
2248
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
1863
2249
  const content = value;
1864
2250
  return yield Promise.all(
1865
2251
  content.map(
1866
- (childItem) => __async(void 0, null, function* () {
2252
+ (childItem) => __async(null, null, function* () {
1867
2253
  return (yield resolveComponentData(
1868
2254
  childItem,
1869
2255
  config,
@@ -1888,7 +2274,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1888
2274
  };
1889
2275
  return {
1890
2276
  node: itemWithResolvedChildren,
1891
- didChange: !(0, import_fast_deep_equal2.default)(item, itemWithResolvedChildren)
2277
+ didChange: !deepEqual(item, itemWithResolvedChildren)
1892
2278
  };
1893
2279
  });
1894
2280
 
@@ -2053,7 +2439,7 @@ var createAppStore = (initialAppStore) => create()(
2053
2439
  const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
2054
2440
  return __spreadProps(__spreadValues({}, s), { state, selectedItem });
2055
2441
  }),
2056
- resolveComponentData: (componentData, trigger) => __async(void 0, null, function* () {
2442
+ resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
2057
2443
  const { config, metadata, setComponentLoading, permissions } = get();
2058
2444
  const timeouts = {};
2059
2445
  return yield resolveComponentData(
@@ -2064,7 +2450,7 @@ var createAppStore = (initialAppStore) => create()(
2064
2450
  const id = "id" in item.props ? item.props.id : "root";
2065
2451
  timeouts[id] = setComponentLoading(id, true, 50);
2066
2452
  },
2067
- (item) => __async(void 0, null, function* () {
2453
+ (item) => __async(null, null, function* () {
2068
2454
  const id = "id" in item.props ? item.props.id : "root";
2069
2455
  if ("type" in item) {
2070
2456
  yield permissions.refreshPermissions({ item });
@@ -2076,7 +2462,7 @@ var createAppStore = (initialAppStore) => create()(
2076
2462
  trigger
2077
2463
  );
2078
2464
  }),
2079
- resolveAndCommitData: () => __async(void 0, null, function* () {
2465
+ resolveAndCommitData: () => __async(null, null, function* () {
2080
2466
  const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
2081
2467
  walkAppState(
2082
2468
  state,
@@ -2500,45 +2886,10 @@ classnames/index.js:
2500
2886
  *)
2501
2887
 
2502
2888
  lucide-react/dist/esm/shared/src/utils.js:
2503
- (**
2504
- * @license lucide-react v0.468.0 - ISC
2505
- *
2506
- * This source code is licensed under the ISC license.
2507
- * See the LICENSE file in the root directory of this source tree.
2508
- *)
2509
-
2510
2889
  lucide-react/dist/esm/defaultAttributes.js:
2511
- (**
2512
- * @license lucide-react v0.468.0 - ISC
2513
- *
2514
- * This source code is licensed under the ISC license.
2515
- * See the LICENSE file in the root directory of this source tree.
2516
- *)
2517
-
2518
2890
  lucide-react/dist/esm/Icon.js:
2519
- (**
2520
- * @license lucide-react v0.468.0 - ISC
2521
- *
2522
- * This source code is licensed under the ISC license.
2523
- * See the LICENSE file in the root directory of this source tree.
2524
- *)
2525
-
2526
2891
  lucide-react/dist/esm/createLucideIcon.js:
2527
- (**
2528
- * @license lucide-react v0.468.0 - ISC
2529
- *
2530
- * This source code is licensed under the ISC license.
2531
- * See the LICENSE file in the root directory of this source tree.
2532
- *)
2533
-
2534
2892
  lucide-react/dist/esm/icons/chevron-right.js:
2535
- (**
2536
- * @license lucide-react v0.468.0 - ISC
2537
- *
2538
- * This source code is licensed under the ISC license.
2539
- * See the LICENSE file in the root directory of this source tree.
2540
- *)
2541
-
2542
2893
  lucide-react/dist/esm/lucide-react.js:
2543
2894
  (**
2544
2895
  * @license lucide-react v0.468.0 - ISC