@measured/puck-plugin-heading-analyzer 0.21.0-canary.d32e582b → 0.21.0-canary.e1cbf777

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
 
@@ -595,7 +559,7 @@ var walkField = ({
595
559
  return map({
596
560
  value: mappedContent,
597
561
  parentId: id,
598
- propName: propKey,
562
+ propName: propPath,
599
563
  field: fields[propKey],
600
564
  propPath
601
565
  });
@@ -877,10 +841,10 @@ var insert = (list, index, item) => {
877
841
  // ../core/lib/generate-id.ts
878
842
  init_react_import();
879
843
 
880
- // ../../node_modules/uuid/dist/esm-node/index.js
844
+ // ../core/node_modules/uuid/dist/esm-node/index.js
881
845
  init_react_import();
882
846
 
883
- // ../../node_modules/uuid/dist/esm-node/rng.js
847
+ // ../core/node_modules/uuid/dist/esm-node/rng.js
884
848
  init_react_import();
885
849
  import crypto from "crypto";
886
850
  var rnds8Pool = new Uint8Array(256);
@@ -893,7 +857,7 @@ function rng() {
893
857
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
894
858
  }
895
859
 
896
- // ../../node_modules/uuid/dist/esm-node/stringify.js
860
+ // ../core/node_modules/uuid/dist/esm-node/stringify.js
897
861
  init_react_import();
898
862
  var byteToHex = [];
899
863
  for (let i = 0; i < 256; ++i) {
@@ -903,17 +867,17 @@ function unsafeStringify(arr, offset = 0) {
903
867
  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]];
904
868
  }
905
869
 
906
- // ../../node_modules/uuid/dist/esm-node/v4.js
870
+ // ../core/node_modules/uuid/dist/esm-node/v4.js
907
871
  init_react_import();
908
872
 
909
- // ../../node_modules/uuid/dist/esm-node/native.js
873
+ // ../core/node_modules/uuid/dist/esm-node/native.js
910
874
  init_react_import();
911
875
  import crypto2 from "crypto";
912
876
  var native_default = {
913
877
  randomUUID: crypto2.randomUUID
914
878
  };
915
879
 
916
- // ../../node_modules/uuid/dist/esm-node/v4.js
880
+ // ../core/node_modules/uuid/dist/esm-node/v4.js
917
881
  function v4(options, buf, offset) {
918
882
  if (native_default.randomUUID && !buf && !options) {
919
883
  return native_default.randomUUID();
@@ -1065,7 +1029,9 @@ var replaceAction = (state, action, appStore) => {
1065
1029
  });
1066
1030
  });
1067
1031
  });
1068
- const stateWithDeepSlotsRemoved = __spreadValues({}, state);
1032
+ const stateWithDeepSlotsRemoved = __spreadProps(__spreadValues({}, state), {
1033
+ ui: __spreadValues(__spreadValues({}, state.ui), action.ui)
1034
+ });
1069
1035
  Object.keys(state.indexes.zones).forEach((zoneCompound) => {
1070
1036
  const id = zoneCompound.split(":")[0];
1071
1037
  if (id === originalId) {
@@ -1494,7 +1460,7 @@ var createStoreImpl = (createState) => {
1494
1460
  const initialState = state = createState(setState, getState, api);
1495
1461
  return api;
1496
1462
  };
1497
- var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
1463
+ var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
1498
1464
 
1499
1465
  // ../../node_modules/zustand/esm/react.mjs
1500
1466
  init_react_import();
@@ -1503,8 +1469,8 @@ var identity = (arg) => arg;
1503
1469
  function useStore(api, selector = identity) {
1504
1470
  const slice = React2.useSyncExternalStore(
1505
1471
  api.subscribe,
1506
- () => selector(api.getState()),
1507
- () => selector(api.getInitialState())
1472
+ React2.useCallback(() => selector(api.getState()), [api, selector]),
1473
+ React2.useCallback(() => selector(api.getInitialState()), [api, selector])
1508
1474
  );
1509
1475
  React2.useDebugValue(slice);
1510
1476
  return slice;
@@ -1515,13 +1481,13 @@ var createImpl = (createState) => {
1515
1481
  Object.assign(useBoundStore, api);
1516
1482
  return useBoundStore;
1517
1483
  };
1518
- var create = (createState) => createState ? createImpl(createState) : createImpl;
1484
+ var create = ((createState) => createState ? createImpl(createState) : createImpl);
1519
1485
 
1520
1486
  // ../../node_modules/zustand/esm/middleware.mjs
1521
1487
  init_react_import();
1522
1488
  var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
1523
1489
  const origSubscribe = api.subscribe;
1524
- api.subscribe = (selector, optListener, options) => {
1490
+ api.subscribe = ((selector, optListener, options) => {
1525
1491
  let listener = selector;
1526
1492
  if (optListener) {
1527
1493
  const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
@@ -1538,7 +1504,7 @@ var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
1538
1504
  }
1539
1505
  }
1540
1506
  return origSubscribe(listener);
1541
- };
1507
+ });
1542
1508
  const initialState = fn(set, get, api);
1543
1509
  return initialState;
1544
1510
  };
@@ -1578,9 +1544,9 @@ function debounce(func, timeout = 300) {
1578
1544
  var tidyState = (state) => {
1579
1545
  return __spreadProps(__spreadValues({}, state), {
1580
1546
  ui: __spreadProps(__spreadValues({}, state.ui), {
1581
- field: {
1547
+ field: __spreadProps(__spreadValues({}, state.ui.field), {
1582
1548
  focus: null
1583
- }
1549
+ })
1584
1550
  })
1585
1551
  });
1586
1552
  };
@@ -1714,7 +1680,7 @@ var flattenData = (state, config) => {
1714
1680
  (content) => content,
1715
1681
  (item) => {
1716
1682
  data.push(item);
1717
- return null;
1683
+ return item;
1718
1684
  }
1719
1685
  );
1720
1686
  return data;
@@ -1722,42 +1688,462 @@ var flattenData = (state, config) => {
1722
1688
 
1723
1689
  // ../core/lib/get-changed.ts
1724
1690
  init_react_import();
1725
- var import_fast_deep_equal = __toESM(require_fast_deep_equal());
1691
+
1692
+ // ../../node_modules/fast-equals/dist/esm/index.mjs
1693
+ init_react_import();
1694
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
1695
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1696
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1697
+ function combineComparators(comparatorA, comparatorB) {
1698
+ return function isEqual(a, b, state) {
1699
+ return comparatorA(a, b, state) && comparatorB(a, b, state);
1700
+ };
1701
+ }
1702
+ function createIsCircular(areItemsEqual) {
1703
+ return function isCircular(a, b, state) {
1704
+ if (!a || !b || typeof a !== "object" || typeof b !== "object") {
1705
+ return areItemsEqual(a, b, state);
1706
+ }
1707
+ var cache2 = state.cache;
1708
+ var cachedA = cache2.get(a);
1709
+ var cachedB = cache2.get(b);
1710
+ if (cachedA && cachedB) {
1711
+ return cachedA === b && cachedB === a;
1712
+ }
1713
+ cache2.set(a, b);
1714
+ cache2.set(b, a);
1715
+ var result = areItemsEqual(a, b, state);
1716
+ cache2.delete(a);
1717
+ cache2.delete(b);
1718
+ return result;
1719
+ };
1720
+ }
1721
+ function getStrictProperties(object) {
1722
+ return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
1723
+ }
1724
+ var hasOwn = Object.hasOwn || (function(object, property) {
1725
+ return hasOwnProperty.call(object, property);
1726
+ });
1727
+ function sameValueZeroEqual(a, b) {
1728
+ return a === b || !a && !b && a !== a && b !== b;
1729
+ }
1730
+ var PREACT_VNODE = "__v";
1731
+ var PREACT_OWNER = "__o";
1732
+ var REACT_OWNER = "_owner";
1733
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1734
+ var keys = Object.keys;
1735
+ function areArraysEqual(a, b, state) {
1736
+ var index = a.length;
1737
+ if (b.length !== index) {
1738
+ return false;
1739
+ }
1740
+ while (index-- > 0) {
1741
+ if (!state.equals(a[index], b[index], index, index, a, b, state)) {
1742
+ return false;
1743
+ }
1744
+ }
1745
+ return true;
1746
+ }
1747
+ function areDatesEqual(a, b) {
1748
+ return sameValueZeroEqual(a.getTime(), b.getTime());
1749
+ }
1750
+ function areErrorsEqual(a, b) {
1751
+ return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
1752
+ }
1753
+ function areFunctionsEqual(a, b) {
1754
+ return a === b;
1755
+ }
1756
+ function areMapsEqual(a, b, state) {
1757
+ var size = a.size;
1758
+ if (size !== b.size) {
1759
+ return false;
1760
+ }
1761
+ if (!size) {
1762
+ return true;
1763
+ }
1764
+ var matchedIndices = new Array(size);
1765
+ var aIterable = a.entries();
1766
+ var aResult;
1767
+ var bResult;
1768
+ var index = 0;
1769
+ while (aResult = aIterable.next()) {
1770
+ if (aResult.done) {
1771
+ break;
1772
+ }
1773
+ var bIterable = b.entries();
1774
+ var hasMatch = false;
1775
+ var matchIndex = 0;
1776
+ while (bResult = bIterable.next()) {
1777
+ if (bResult.done) {
1778
+ break;
1779
+ }
1780
+ if (matchedIndices[matchIndex]) {
1781
+ matchIndex++;
1782
+ continue;
1783
+ }
1784
+ var aEntry = aResult.value;
1785
+ var bEntry = bResult.value;
1786
+ 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)) {
1787
+ hasMatch = matchedIndices[matchIndex] = true;
1788
+ break;
1789
+ }
1790
+ matchIndex++;
1791
+ }
1792
+ if (!hasMatch) {
1793
+ return false;
1794
+ }
1795
+ index++;
1796
+ }
1797
+ return true;
1798
+ }
1799
+ var areNumbersEqual = sameValueZeroEqual;
1800
+ function areObjectsEqual(a, b, state) {
1801
+ var properties = keys(a);
1802
+ var index = properties.length;
1803
+ if (keys(b).length !== index) {
1804
+ return false;
1805
+ }
1806
+ while (index-- > 0) {
1807
+ if (!isPropertyEqual(a, b, state, properties[index])) {
1808
+ return false;
1809
+ }
1810
+ }
1811
+ return true;
1812
+ }
1813
+ function areObjectsEqualStrict(a, b, state) {
1814
+ var properties = getStrictProperties(a);
1815
+ var index = properties.length;
1816
+ if (getStrictProperties(b).length !== index) {
1817
+ return false;
1818
+ }
1819
+ var property;
1820
+ var descriptorA;
1821
+ var descriptorB;
1822
+ while (index-- > 0) {
1823
+ property = properties[index];
1824
+ if (!isPropertyEqual(a, b, state, property)) {
1825
+ return false;
1826
+ }
1827
+ descriptorA = getOwnPropertyDescriptor(a, property);
1828
+ descriptorB = getOwnPropertyDescriptor(b, property);
1829
+ if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
1830
+ return false;
1831
+ }
1832
+ }
1833
+ return true;
1834
+ }
1835
+ function arePrimitiveWrappersEqual(a, b) {
1836
+ return sameValueZeroEqual(a.valueOf(), b.valueOf());
1837
+ }
1838
+ function areRegExpsEqual(a, b) {
1839
+ return a.source === b.source && a.flags === b.flags;
1840
+ }
1841
+ function areSetsEqual(a, b, state) {
1842
+ var size = a.size;
1843
+ if (size !== b.size) {
1844
+ return false;
1845
+ }
1846
+ if (!size) {
1847
+ return true;
1848
+ }
1849
+ var matchedIndices = new Array(size);
1850
+ var aIterable = a.values();
1851
+ var aResult;
1852
+ var bResult;
1853
+ while (aResult = aIterable.next()) {
1854
+ if (aResult.done) {
1855
+ break;
1856
+ }
1857
+ var bIterable = b.values();
1858
+ var hasMatch = false;
1859
+ var matchIndex = 0;
1860
+ while (bResult = bIterable.next()) {
1861
+ if (bResult.done) {
1862
+ break;
1863
+ }
1864
+ if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
1865
+ hasMatch = matchedIndices[matchIndex] = true;
1866
+ break;
1867
+ }
1868
+ matchIndex++;
1869
+ }
1870
+ if (!hasMatch) {
1871
+ return false;
1872
+ }
1873
+ }
1874
+ return true;
1875
+ }
1876
+ function areTypedArraysEqual(a, b) {
1877
+ var index = a.length;
1878
+ if (b.length !== index) {
1879
+ return false;
1880
+ }
1881
+ while (index-- > 0) {
1882
+ if (a[index] !== b[index]) {
1883
+ return false;
1884
+ }
1885
+ }
1886
+ return true;
1887
+ }
1888
+ function areUrlsEqual(a, b) {
1889
+ 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;
1890
+ }
1891
+ function isPropertyEqual(a, b, state, property) {
1892
+ if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) {
1893
+ return true;
1894
+ }
1895
+ return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
1896
+ }
1897
+ var ARGUMENTS_TAG = "[object Arguments]";
1898
+ var BOOLEAN_TAG = "[object Boolean]";
1899
+ var DATE_TAG = "[object Date]";
1900
+ var ERROR_TAG = "[object Error]";
1901
+ var MAP_TAG = "[object Map]";
1902
+ var NUMBER_TAG = "[object Number]";
1903
+ var OBJECT_TAG = "[object Object]";
1904
+ var REG_EXP_TAG = "[object RegExp]";
1905
+ var SET_TAG = "[object Set]";
1906
+ var STRING_TAG = "[object String]";
1907
+ var URL_TAG = "[object URL]";
1908
+ var isArray = Array.isArray;
1909
+ var isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null;
1910
+ var assign = Object.assign;
1911
+ var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
1912
+ function createEqualityComparator(_a) {
1913
+ 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;
1914
+ return function comparator(a, b, state) {
1915
+ if (a === b) {
1916
+ return true;
1917
+ }
1918
+ if (a == null || b == null) {
1919
+ return false;
1920
+ }
1921
+ var type = typeof a;
1922
+ if (type !== typeof b) {
1923
+ return false;
1924
+ }
1925
+ if (type !== "object") {
1926
+ if (type === "number") {
1927
+ return areNumbersEqual2(a, b, state);
1928
+ }
1929
+ if (type === "function") {
1930
+ return areFunctionsEqual2(a, b, state);
1931
+ }
1932
+ return false;
1933
+ }
1934
+ var constructor = a.constructor;
1935
+ if (constructor !== b.constructor) {
1936
+ return false;
1937
+ }
1938
+ if (constructor === Object) {
1939
+ return areObjectsEqual2(a, b, state);
1940
+ }
1941
+ if (isArray(a)) {
1942
+ return areArraysEqual2(a, b, state);
1943
+ }
1944
+ if (isTypedArray != null && isTypedArray(a)) {
1945
+ return areTypedArraysEqual2(a, b, state);
1946
+ }
1947
+ if (constructor === Date) {
1948
+ return areDatesEqual2(a, b, state);
1949
+ }
1950
+ if (constructor === RegExp) {
1951
+ return areRegExpsEqual2(a, b, state);
1952
+ }
1953
+ if (constructor === Map) {
1954
+ return areMapsEqual2(a, b, state);
1955
+ }
1956
+ if (constructor === Set) {
1957
+ return areSetsEqual2(a, b, state);
1958
+ }
1959
+ var tag = getTag(a);
1960
+ if (tag === DATE_TAG) {
1961
+ return areDatesEqual2(a, b, state);
1962
+ }
1963
+ if (tag === REG_EXP_TAG) {
1964
+ return areRegExpsEqual2(a, b, state);
1965
+ }
1966
+ if (tag === MAP_TAG) {
1967
+ return areMapsEqual2(a, b, state);
1968
+ }
1969
+ if (tag === SET_TAG) {
1970
+ return areSetsEqual2(a, b, state);
1971
+ }
1972
+ if (tag === OBJECT_TAG) {
1973
+ return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
1974
+ }
1975
+ if (tag === URL_TAG) {
1976
+ return areUrlsEqual2(a, b, state);
1977
+ }
1978
+ if (tag === ERROR_TAG) {
1979
+ return areErrorsEqual2(a, b, state);
1980
+ }
1981
+ if (tag === ARGUMENTS_TAG) {
1982
+ return areObjectsEqual2(a, b, state);
1983
+ }
1984
+ if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
1985
+ return arePrimitiveWrappersEqual2(a, b, state);
1986
+ }
1987
+ return false;
1988
+ };
1989
+ }
1990
+ function createEqualityComparatorConfig(_a) {
1991
+ var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
1992
+ var config = {
1993
+ areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
1994
+ areDatesEqual,
1995
+ areErrorsEqual,
1996
+ areFunctionsEqual,
1997
+ areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
1998
+ areNumbersEqual,
1999
+ areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
2000
+ arePrimitiveWrappersEqual,
2001
+ areRegExpsEqual,
2002
+ areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
2003
+ areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
2004
+ areUrlsEqual
2005
+ };
2006
+ if (createCustomConfig) {
2007
+ config = assign({}, config, createCustomConfig(config));
2008
+ }
2009
+ if (circular) {
2010
+ var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
2011
+ var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
2012
+ var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
2013
+ var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
2014
+ config = assign({}, config, {
2015
+ areArraysEqual: areArraysEqual$1,
2016
+ areMapsEqual: areMapsEqual$1,
2017
+ areObjectsEqual: areObjectsEqual$1,
2018
+ areSetsEqual: areSetsEqual$1
2019
+ });
2020
+ }
2021
+ return config;
2022
+ }
2023
+ function createInternalEqualityComparator(compare) {
2024
+ return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
2025
+ return compare(a, b, state);
2026
+ };
2027
+ }
2028
+ function createIsEqual(_a) {
2029
+ var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
2030
+ if (createState) {
2031
+ return function isEqual(a, b) {
2032
+ var _a2 = createState(), _b = _a2.cache, cache2 = _b === void 0 ? circular ? /* @__PURE__ */ new WeakMap() : void 0 : _b, meta = _a2.meta;
2033
+ return comparator(a, b, {
2034
+ cache: cache2,
2035
+ equals,
2036
+ meta,
2037
+ strict
2038
+ });
2039
+ };
2040
+ }
2041
+ if (circular) {
2042
+ return function isEqual(a, b) {
2043
+ return comparator(a, b, {
2044
+ cache: /* @__PURE__ */ new WeakMap(),
2045
+ equals,
2046
+ meta: void 0,
2047
+ strict
2048
+ });
2049
+ };
2050
+ }
2051
+ var state = {
2052
+ cache: void 0,
2053
+ equals,
2054
+ meta: void 0,
2055
+ strict
2056
+ };
2057
+ return function isEqual(a, b) {
2058
+ return comparator(a, b, state);
2059
+ };
2060
+ }
2061
+ var deepEqual = createCustomEqual();
2062
+ var strictDeepEqual = createCustomEqual({ strict: true });
2063
+ var circularDeepEqual = createCustomEqual({ circular: true });
2064
+ var strictCircularDeepEqual = createCustomEqual({
2065
+ circular: true,
2066
+ strict: true
2067
+ });
2068
+ var shallowEqual = createCustomEqual({
2069
+ createInternalComparator: function() {
2070
+ return sameValueZeroEqual;
2071
+ }
2072
+ });
2073
+ var strictShallowEqual = createCustomEqual({
2074
+ strict: true,
2075
+ createInternalComparator: function() {
2076
+ return sameValueZeroEqual;
2077
+ }
2078
+ });
2079
+ var circularShallowEqual = createCustomEqual({
2080
+ circular: true,
2081
+ createInternalComparator: function() {
2082
+ return sameValueZeroEqual;
2083
+ }
2084
+ });
2085
+ var strictCircularShallowEqual = createCustomEqual({
2086
+ circular: true,
2087
+ createInternalComparator: function() {
2088
+ return sameValueZeroEqual;
2089
+ },
2090
+ strict: true
2091
+ });
2092
+ function createCustomEqual(options) {
2093
+ if (options === void 0) {
2094
+ options = {};
2095
+ }
2096
+ 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;
2097
+ var config = createEqualityComparatorConfig(options);
2098
+ var comparator = createEqualityComparator(config);
2099
+ var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
2100
+ return createIsEqual({ circular, comparator, createState, equals, strict });
2101
+ }
2102
+
2103
+ // ../core/lib/get-changed.ts
1726
2104
  var getChanged = (newItem, oldItem) => {
1727
2105
  return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
1728
2106
  const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
1729
2107
  const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
1730
2108
  return __spreadProps(__spreadValues({}, acc), {
1731
- [item]: !(0, import_fast_deep_equal.default)(oldItemProps[item], newItemProps[item])
2109
+ [item]: !deepEqual(oldItemProps[item], newItemProps[item])
1732
2110
  });
1733
2111
  }, {}) : {};
1734
2112
  };
1735
2113
 
1736
2114
  // ../core/store/slices/permissions.ts
1737
2115
  var createPermissionsSlice = (set, get) => {
1738
- const resolvePermissions = (..._0) => __async(void 0, [..._0], function* (params = {}, force) {
2116
+ const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
1739
2117
  const { state, permissions, config } = get();
1740
2118
  const { cache: cache2, globalPermissions } = permissions;
1741
- const resolveDataForItem = (item2, force2 = false) => __async(void 0, null, function* () {
1742
- var _a, _b, _c;
2119
+ const resolvePermissionsForItem = (item2, force2 = false) => __async(null, null, function* () {
2120
+ var _a, _b;
1743
2121
  const { config: config2, state: appState, setComponentLoading } = get();
2122
+ const itemCache = cache2[item2.props.id];
2123
+ const nodes = appState.indexes.nodes;
2124
+ const parentId = (_a = nodes[item2.props.id]) == null ? void 0 : _a.parentId;
2125
+ const parentNode = parentId ? nodes[parentId] : null;
2126
+ const parentData = (_b = parentNode == null ? void 0 : parentNode.data) != null ? _b : null;
1744
2127
  const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
1745
2128
  if (!componentConfig) {
1746
2129
  return;
1747
2130
  }
1748
2131
  const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig.permissions);
1749
2132
  if (componentConfig.resolvePermissions) {
1750
- const changed = getChanged(item2, (_a = cache2[item2.props.id]) == null ? void 0 : _a.lastData);
1751
- if (Object.values(changed).some((el) => el === true) || force2) {
2133
+ const changed = getChanged(item2, itemCache == null ? void 0 : itemCache.lastData);
2134
+ const propsChanged = Object.values(changed).some((el) => el === true);
2135
+ const parentChanged = (itemCache == null ? void 0 : itemCache.lastParentId) !== parentId;
2136
+ if (propsChanged || parentChanged || force2) {
1752
2137
  const clearTimeout2 = setComponentLoading(item2.props.id, true, 50);
1753
2138
  const resolvedPermissions = yield componentConfig.resolvePermissions(
1754
2139
  item2,
1755
2140
  {
1756
2141
  changed,
1757
- lastPermissions: ((_b = cache2[item2.props.id]) == null ? void 0 : _b.lastPermissions) || null,
2142
+ lastPermissions: (itemCache == null ? void 0 : itemCache.lastPermissions) || null,
1758
2143
  permissions: initialPermissions,
1759
2144
  appState: makeStatePublic(appState),
1760
- lastData: ((_c = cache2[item2.props.id]) == null ? void 0 : _c.lastData) || null
2145
+ lastData: (itemCache == null ? void 0 : itemCache.lastData) || null,
2146
+ parent: parentData
1761
2147
  }
1762
2148
  );
1763
2149
  const latest = get().permissions;
@@ -1765,6 +2151,7 @@ var createPermissionsSlice = (set, get) => {
1765
2151
  permissions: __spreadProps(__spreadValues({}, latest), {
1766
2152
  cache: __spreadProps(__spreadValues({}, latest.cache), {
1767
2153
  [item2.props.id]: {
2154
+ lastParentId: parentId,
1768
2155
  lastData: item2,
1769
2156
  lastPermissions: resolvedPermissions
1770
2157
  }
@@ -1778,9 +2165,9 @@ var createPermissionsSlice = (set, get) => {
1778
2165
  }
1779
2166
  }
1780
2167
  });
1781
- const resolveDataForRoot = (force2 = false) => {
2168
+ const resolvePermissionsForRoot = (force2 = false) => {
1782
2169
  const { state: appState } = get();
1783
- resolveDataForItem(
2170
+ resolvePermissionsForItem(
1784
2171
  // Shim the root data in by conforming to component data shape
1785
2172
  {
1786
2173
  type: "root",
@@ -1791,16 +2178,16 @@ var createPermissionsSlice = (set, get) => {
1791
2178
  };
1792
2179
  const { item, type, root } = params;
1793
2180
  if (item) {
1794
- yield resolveDataForItem(item, force);
2181
+ yield resolvePermissionsForItem(item, force);
1795
2182
  } else if (type) {
1796
- flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(void 0, null, function* () {
1797
- yield resolveDataForItem(item2, force);
2183
+ flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
2184
+ yield resolvePermissionsForItem(item2, force);
1798
2185
  }));
1799
2186
  } else if (root) {
1800
- resolveDataForRoot(force);
2187
+ resolvePermissionsForRoot(force);
1801
2188
  } else {
1802
- flattenData(state, config).map((item2) => __async(void 0, null, function* () {
1803
- yield resolveDataForItem(item2, force);
2189
+ flattenData(state, config).map((item2) => __async(null, null, function* () {
2190
+ yield resolvePermissionsForItem(item2, force);
1804
2191
  }));
1805
2192
  }
1806
2193
  });
@@ -1853,16 +2240,15 @@ var createFieldsSlice = (_set, _get) => {
1853
2240
 
1854
2241
  // ../core/lib/resolve-component-data.ts
1855
2242
  init_react_import();
1856
- var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
1857
2243
  var cache = { lastChange: {} };
1858
- var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
2244
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
1859
2245
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
1860
2246
  const resolvedItem = __spreadValues({}, item);
1861
2247
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
1862
2248
  const id = "id" in item.props ? item.props.id : "root";
1863
2249
  if (shouldRunResolver) {
1864
2250
  const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
1865
- if (item && (0, import_fast_deep_equal2.default)(item, oldItem)) {
2251
+ if (trigger !== "force" && item && deepEqual(item, oldItem)) {
1866
2252
  return { node: resolved, didChange: false };
1867
2253
  }
1868
2254
  const changed = getChanged(item, oldItem);
@@ -1883,11 +2269,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1883
2269
  let itemWithResolvedChildren = yield mapFields(
1884
2270
  resolvedItem,
1885
2271
  {
1886
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
2272
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
1887
2273
  const content = value;
1888
2274
  return yield Promise.all(
1889
2275
  content.map(
1890
- (childItem) => __async(void 0, null, function* () {
2276
+ (childItem) => __async(null, null, function* () {
1891
2277
  return (yield resolveComponentData(
1892
2278
  childItem,
1893
2279
  config,
@@ -1912,7 +2298,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1912
2298
  };
1913
2299
  return {
1914
2300
  node: itemWithResolvedChildren,
1915
- didChange: !(0, import_fast_deep_equal2.default)(item, itemWithResolvedChildren)
2301
+ didChange: !deepEqual(item, itemWithResolvedChildren)
1916
2302
  };
1917
2303
  });
1918
2304
 
@@ -1991,6 +2377,11 @@ var createAppStore = (initialAppStore) => create()(
1991
2377
  history: createHistorySlice(set, get),
1992
2378
  nodes: createNodesSlice(set, get),
1993
2379
  permissions: createPermissionsSlice(set, get),
2380
+ getCurrentData: () => {
2381
+ var _a2;
2382
+ const s = get();
2383
+ return (_a2 = s.selectedItem) != null ? _a2 : s.state.data.root;
2384
+ },
1994
2385
  getComponentConfig: (type) => {
1995
2386
  var _a2;
1996
2387
  const { config, selectedItem } = get();
@@ -2079,7 +2470,7 @@ var createAppStore = (initialAppStore) => create()(
2079
2470
  const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
2080
2471
  return __spreadProps(__spreadValues({}, s), { state, selectedItem });
2081
2472
  }),
2082
- resolveComponentData: (componentData, trigger) => __async(void 0, null, function* () {
2473
+ resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
2083
2474
  const { config, metadata, setComponentLoading, permissions } = get();
2084
2475
  const timeouts = {};
2085
2476
  return yield resolveComponentData(
@@ -2090,7 +2481,7 @@ var createAppStore = (initialAppStore) => create()(
2090
2481
  const id = "id" in item.props ? item.props.id : "root";
2091
2482
  timeouts[id] = setComponentLoading(id, true, 50);
2092
2483
  },
2093
- (item) => __async(void 0, null, function* () {
2484
+ (item) => __async(null, null, function* () {
2094
2485
  const id = "id" in item.props ? item.props.id : "root";
2095
2486
  if ("type" in item) {
2096
2487
  yield permissions.refreshPermissions({ item });
@@ -2102,7 +2493,7 @@ var createAppStore = (initialAppStore) => create()(
2102
2493
  trigger
2103
2494
  );
2104
2495
  }),
2105
- resolveAndCommitData: () => __async(void 0, null, function* () {
2496
+ resolveAndCommitData: () => __async(null, null, function* () {
2106
2497
  const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
2107
2498
  walkAppState(
2108
2499
  state,
@@ -2338,45 +2729,10 @@ classnames/index.js:
2338
2729
  *)
2339
2730
 
2340
2731
  lucide-react/dist/esm/shared/src/utils.js:
2341
- (**
2342
- * @license lucide-react v0.468.0 - ISC
2343
- *
2344
- * This source code is licensed under the ISC license.
2345
- * See the LICENSE file in the root directory of this source tree.
2346
- *)
2347
-
2348
2732
  lucide-react/dist/esm/defaultAttributes.js:
2349
- (**
2350
- * @license lucide-react v0.468.0 - ISC
2351
- *
2352
- * This source code is licensed under the ISC license.
2353
- * See the LICENSE file in the root directory of this source tree.
2354
- *)
2355
-
2356
2733
  lucide-react/dist/esm/Icon.js:
2357
- (**
2358
- * @license lucide-react v0.468.0 - ISC
2359
- *
2360
- * This source code is licensed under the ISC license.
2361
- * See the LICENSE file in the root directory of this source tree.
2362
- *)
2363
-
2364
2734
  lucide-react/dist/esm/createLucideIcon.js:
2365
- (**
2366
- * @license lucide-react v0.468.0 - ISC
2367
- *
2368
- * This source code is licensed under the ISC license.
2369
- * See the LICENSE file in the root directory of this source tree.
2370
- *)
2371
-
2372
2735
  lucide-react/dist/esm/icons/heading-1.js:
2373
- (**
2374
- * @license lucide-react v0.468.0 - ISC
2375
- *
2376
- * This source code is licensed under the ISC license.
2377
- * See the LICENSE file in the root directory of this source tree.
2378
- *)
2379
-
2380
2736
  lucide-react/dist/esm/lucide-react.js:
2381
2737
  (**
2382
2738
  * @license lucide-react v0.468.0 - ISC