@measured/puck-plugin-heading-analyzer 0.21.0-canary.d32e582b → 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
 
@@ -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
  });
@@ -715,9 +679,28 @@ var stripSlots = (data, config) => {
715
679
 
716
680
  // ../core/lib/data/flatten-node.ts
717
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
+ }
718
701
  var flattenNode = (node, config) => {
719
702
  return __spreadProps(__spreadValues({}, node), {
720
- props: flatten2(stripSlots(node, config).props)
703
+ props: stripEmptyObjects(flatten2(stripSlots(node, config).props))
721
704
  });
722
705
  };
723
706
 
@@ -877,10 +860,10 @@ var insert = (list, index, item) => {
877
860
  // ../core/lib/generate-id.ts
878
861
  init_react_import();
879
862
 
880
- // ../../node_modules/uuid/dist/esm-node/index.js
863
+ // ../core/node_modules/uuid/dist/esm-node/index.js
881
864
  init_react_import();
882
865
 
883
- // ../../node_modules/uuid/dist/esm-node/rng.js
866
+ // ../core/node_modules/uuid/dist/esm-node/rng.js
884
867
  init_react_import();
885
868
  import crypto from "crypto";
886
869
  var rnds8Pool = new Uint8Array(256);
@@ -893,7 +876,7 @@ function rng() {
893
876
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
894
877
  }
895
878
 
896
- // ../../node_modules/uuid/dist/esm-node/stringify.js
879
+ // ../core/node_modules/uuid/dist/esm-node/stringify.js
897
880
  init_react_import();
898
881
  var byteToHex = [];
899
882
  for (let i = 0; i < 256; ++i) {
@@ -903,17 +886,17 @@ function unsafeStringify(arr, offset = 0) {
903
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]];
904
887
  }
905
888
 
906
- // ../../node_modules/uuid/dist/esm-node/v4.js
889
+ // ../core/node_modules/uuid/dist/esm-node/v4.js
907
890
  init_react_import();
908
891
 
909
- // ../../node_modules/uuid/dist/esm-node/native.js
892
+ // ../core/node_modules/uuid/dist/esm-node/native.js
910
893
  init_react_import();
911
894
  import crypto2 from "crypto";
912
895
  var native_default = {
913
896
  randomUUID: crypto2.randomUUID
914
897
  };
915
898
 
916
- // ../../node_modules/uuid/dist/esm-node/v4.js
899
+ // ../core/node_modules/uuid/dist/esm-node/v4.js
917
900
  function v4(options, buf, offset) {
918
901
  if (native_default.randomUUID && !buf && !options) {
919
902
  return native_default.randomUUID();
@@ -1065,7 +1048,9 @@ var replaceAction = (state, action, appStore) => {
1065
1048
  });
1066
1049
  });
1067
1050
  });
1068
- const stateWithDeepSlotsRemoved = __spreadValues({}, state);
1051
+ const stateWithDeepSlotsRemoved = __spreadProps(__spreadValues({}, state), {
1052
+ ui: __spreadValues(__spreadValues({}, state.ui), action.ui)
1053
+ });
1069
1054
  Object.keys(state.indexes.zones).forEach((zoneCompound) => {
1070
1055
  const id = zoneCompound.split(":")[0];
1071
1056
  if (id === originalId) {
@@ -1494,7 +1479,7 @@ var createStoreImpl = (createState) => {
1494
1479
  const initialState = state = createState(setState, getState, api);
1495
1480
  return api;
1496
1481
  };
1497
- var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
1482
+ var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
1498
1483
 
1499
1484
  // ../../node_modules/zustand/esm/react.mjs
1500
1485
  init_react_import();
@@ -1503,8 +1488,8 @@ var identity = (arg) => arg;
1503
1488
  function useStore(api, selector = identity) {
1504
1489
  const slice = React2.useSyncExternalStore(
1505
1490
  api.subscribe,
1506
- () => selector(api.getState()),
1507
- () => selector(api.getInitialState())
1491
+ React2.useCallback(() => selector(api.getState()), [api, selector]),
1492
+ React2.useCallback(() => selector(api.getInitialState()), [api, selector])
1508
1493
  );
1509
1494
  React2.useDebugValue(slice);
1510
1495
  return slice;
@@ -1515,13 +1500,13 @@ var createImpl = (createState) => {
1515
1500
  Object.assign(useBoundStore, api);
1516
1501
  return useBoundStore;
1517
1502
  };
1518
- var create = (createState) => createState ? createImpl(createState) : createImpl;
1503
+ var create = ((createState) => createState ? createImpl(createState) : createImpl);
1519
1504
 
1520
1505
  // ../../node_modules/zustand/esm/middleware.mjs
1521
1506
  init_react_import();
1522
1507
  var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
1523
1508
  const origSubscribe = api.subscribe;
1524
- api.subscribe = (selector, optListener, options) => {
1509
+ api.subscribe = ((selector, optListener, options) => {
1525
1510
  let listener = selector;
1526
1511
  if (optListener) {
1527
1512
  const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
@@ -1538,7 +1523,7 @@ var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
1538
1523
  }
1539
1524
  }
1540
1525
  return origSubscribe(listener);
1541
- };
1526
+ });
1542
1527
  const initialState = fn(set, get, api);
1543
1528
  return initialState;
1544
1529
  };
@@ -1578,9 +1563,9 @@ function debounce(func, timeout = 300) {
1578
1563
  var tidyState = (state) => {
1579
1564
  return __spreadProps(__spreadValues({}, state), {
1580
1565
  ui: __spreadProps(__spreadValues({}, state.ui), {
1581
- field: {
1566
+ field: __spreadProps(__spreadValues({}, state.ui.field), {
1582
1567
  focus: null
1583
- }
1568
+ })
1584
1569
  })
1585
1570
  });
1586
1571
  };
@@ -1714,7 +1699,7 @@ var flattenData = (state, config) => {
1714
1699
  (content) => content,
1715
1700
  (item) => {
1716
1701
  data.push(item);
1717
- return null;
1702
+ return item;
1718
1703
  }
1719
1704
  );
1720
1705
  return data;
@@ -1722,42 +1707,462 @@ var flattenData = (state, config) => {
1722
1707
 
1723
1708
  // ../core/lib/get-changed.ts
1724
1709
  init_react_import();
1725
- 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
1726
2123
  var getChanged = (newItem, oldItem) => {
1727
2124
  return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
1728
2125
  const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
1729
2126
  const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
1730
2127
  return __spreadProps(__spreadValues({}, acc), {
1731
- [item]: !(0, import_fast_deep_equal.default)(oldItemProps[item], newItemProps[item])
2128
+ [item]: !deepEqual(oldItemProps[item], newItemProps[item])
1732
2129
  });
1733
2130
  }, {}) : {};
1734
2131
  };
1735
2132
 
1736
2133
  // ../core/store/slices/permissions.ts
1737
2134
  var createPermissionsSlice = (set, get) => {
1738
- const resolvePermissions = (..._0) => __async(void 0, [..._0], function* (params = {}, force) {
2135
+ const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
1739
2136
  const { state, permissions, config } = get();
1740
2137
  const { cache: cache2, globalPermissions } = permissions;
1741
- const resolveDataForItem = (item2, force2 = false) => __async(void 0, null, function* () {
1742
- var _a, _b, _c;
2138
+ const resolvePermissionsForItem = (item2, force2 = false) => __async(null, null, function* () {
2139
+ var _a, _b;
1743
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;
1744
2146
  const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
1745
2147
  if (!componentConfig) {
1746
2148
  return;
1747
2149
  }
1748
2150
  const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig.permissions);
1749
2151
  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) {
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) {
1752
2156
  const clearTimeout2 = setComponentLoading(item2.props.id, true, 50);
1753
2157
  const resolvedPermissions = yield componentConfig.resolvePermissions(
1754
2158
  item2,
1755
2159
  {
1756
2160
  changed,
1757
- lastPermissions: ((_b = cache2[item2.props.id]) == null ? void 0 : _b.lastPermissions) || null,
2161
+ lastPermissions: (itemCache == null ? void 0 : itemCache.lastPermissions) || null,
1758
2162
  permissions: initialPermissions,
1759
2163
  appState: makeStatePublic(appState),
1760
- lastData: ((_c = cache2[item2.props.id]) == null ? void 0 : _c.lastData) || null
2164
+ lastData: (itemCache == null ? void 0 : itemCache.lastData) || null,
2165
+ parent: parentData
1761
2166
  }
1762
2167
  );
1763
2168
  const latest = get().permissions;
@@ -1765,6 +2170,7 @@ var createPermissionsSlice = (set, get) => {
1765
2170
  permissions: __spreadProps(__spreadValues({}, latest), {
1766
2171
  cache: __spreadProps(__spreadValues({}, latest.cache), {
1767
2172
  [item2.props.id]: {
2173
+ lastParentId: parentId,
1768
2174
  lastData: item2,
1769
2175
  lastPermissions: resolvedPermissions
1770
2176
  }
@@ -1778,9 +2184,9 @@ var createPermissionsSlice = (set, get) => {
1778
2184
  }
1779
2185
  }
1780
2186
  });
1781
- const resolveDataForRoot = (force2 = false) => {
2187
+ const resolvePermissionsForRoot = (force2 = false) => {
1782
2188
  const { state: appState } = get();
1783
- resolveDataForItem(
2189
+ resolvePermissionsForItem(
1784
2190
  // Shim the root data in by conforming to component data shape
1785
2191
  {
1786
2192
  type: "root",
@@ -1791,16 +2197,16 @@ var createPermissionsSlice = (set, get) => {
1791
2197
  };
1792
2198
  const { item, type, root } = params;
1793
2199
  if (item) {
1794
- yield resolveDataForItem(item, force);
2200
+ yield resolvePermissionsForItem(item, force);
1795
2201
  } else if (type) {
1796
- flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(void 0, null, function* () {
1797
- yield resolveDataForItem(item2, force);
2202
+ flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
2203
+ yield resolvePermissionsForItem(item2, force);
1798
2204
  }));
1799
2205
  } else if (root) {
1800
- resolveDataForRoot(force);
2206
+ resolvePermissionsForRoot(force);
1801
2207
  } else {
1802
- flattenData(state, config).map((item2) => __async(void 0, null, function* () {
1803
- yield resolveDataForItem(item2, force);
2208
+ flattenData(state, config).map((item2) => __async(null, null, function* () {
2209
+ yield resolvePermissionsForItem(item2, force);
1804
2210
  }));
1805
2211
  }
1806
2212
  });
@@ -1853,16 +2259,15 @@ var createFieldsSlice = (_set, _get) => {
1853
2259
 
1854
2260
  // ../core/lib/resolve-component-data.ts
1855
2261
  init_react_import();
1856
- var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
1857
2262
  var cache = { lastChange: {} };
1858
- 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") {
1859
2264
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
1860
2265
  const resolvedItem = __spreadValues({}, item);
1861
2266
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
1862
2267
  const id = "id" in item.props ? item.props.id : "root";
1863
2268
  if (shouldRunResolver) {
1864
2269
  const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
1865
- if (item && (0, import_fast_deep_equal2.default)(item, oldItem)) {
2270
+ if (trigger !== "force" && item && deepEqual(item, oldItem)) {
1866
2271
  return { node: resolved, didChange: false };
1867
2272
  }
1868
2273
  const changed = getChanged(item, oldItem);
@@ -1883,11 +2288,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1883
2288
  let itemWithResolvedChildren = yield mapFields(
1884
2289
  resolvedItem,
1885
2290
  {
1886
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
2291
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
1887
2292
  const content = value;
1888
2293
  return yield Promise.all(
1889
2294
  content.map(
1890
- (childItem) => __async(void 0, null, function* () {
2295
+ (childItem) => __async(null, null, function* () {
1891
2296
  return (yield resolveComponentData(
1892
2297
  childItem,
1893
2298
  config,
@@ -1912,7 +2317,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1912
2317
  };
1913
2318
  return {
1914
2319
  node: itemWithResolvedChildren,
1915
- didChange: !(0, import_fast_deep_equal2.default)(item, itemWithResolvedChildren)
2320
+ didChange: !deepEqual(item, itemWithResolvedChildren)
1916
2321
  };
1917
2322
  });
1918
2323
 
@@ -1991,6 +2396,11 @@ var createAppStore = (initialAppStore) => create()(
1991
2396
  history: createHistorySlice(set, get),
1992
2397
  nodes: createNodesSlice(set, get),
1993
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
+ },
1994
2404
  getComponentConfig: (type) => {
1995
2405
  var _a2;
1996
2406
  const { config, selectedItem } = get();
@@ -2079,7 +2489,7 @@ var createAppStore = (initialAppStore) => create()(
2079
2489
  const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
2080
2490
  return __spreadProps(__spreadValues({}, s), { state, selectedItem });
2081
2491
  }),
2082
- resolveComponentData: (componentData, trigger) => __async(void 0, null, function* () {
2492
+ resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
2083
2493
  const { config, metadata, setComponentLoading, permissions } = get();
2084
2494
  const timeouts = {};
2085
2495
  return yield resolveComponentData(
@@ -2090,7 +2500,7 @@ var createAppStore = (initialAppStore) => create()(
2090
2500
  const id = "id" in item.props ? item.props.id : "root";
2091
2501
  timeouts[id] = setComponentLoading(id, true, 50);
2092
2502
  },
2093
- (item) => __async(void 0, null, function* () {
2503
+ (item) => __async(null, null, function* () {
2094
2504
  const id = "id" in item.props ? item.props.id : "root";
2095
2505
  if ("type" in item) {
2096
2506
  yield permissions.refreshPermissions({ item });
@@ -2102,7 +2512,7 @@ var createAppStore = (initialAppStore) => create()(
2102
2512
  trigger
2103
2513
  );
2104
2514
  }),
2105
- resolveAndCommitData: () => __async(void 0, null, function* () {
2515
+ resolveAndCommitData: () => __async(null, null, function* () {
2106
2516
  const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
2107
2517
  walkAppState(
2108
2518
  state,
@@ -2338,45 +2748,10 @@ classnames/index.js:
2338
2748
  *)
2339
2749
 
2340
2750
  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
2751
  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
2752
  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
2753
  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
2754
  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
2755
  lucide-react/dist/esm/lucide-react.js:
2381
2756
  (**
2382
2757
  * @license lucide-react v0.468.0 - ISC