@measured/puck-plugin-heading-analyzer 0.21.0-canary.6dae6cb7 → 0.21.0-canary.73b98fb4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +57 -42
- package/dist/index.d.ts +57 -42
- package/dist/index.js +466 -117
- package/dist/index.mjs +463 -114
- package/package.json +3 -2
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
|
|
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 (
|
|
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
|
|
216
|
+
const isArray2 = type === "[object Array]";
|
|
217
217
|
const isObject = type === "[object Object]";
|
|
218
218
|
if (!val) {
|
|
219
219
|
return true;
|
|
220
|
-
} else if (
|
|
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
|
|
308
|
-
__export(
|
|
271
|
+
var index_exports = {};
|
|
272
|
+
__export(index_exports, {
|
|
309
273
|
default: () => HeadingAnalyzer_default
|
|
310
274
|
});
|
|
311
|
-
module.exports = __toCommonJS(
|
|
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
|
-
//
|
|
821
|
+
// ../core/node_modules/uuid/dist/esm-node/index.js
|
|
858
822
|
init_react_import();
|
|
859
823
|
|
|
860
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
847
|
+
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
884
848
|
init_react_import();
|
|
885
849
|
|
|
886
|
-
//
|
|
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
|
-
//
|
|
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();
|
|
@@ -1470,7 +1434,7 @@ var createStoreImpl = (createState) => {
|
|
|
1470
1434
|
const initialState = state = createState(setState, getState, api);
|
|
1471
1435
|
return api;
|
|
1472
1436
|
};
|
|
1473
|
-
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
1437
|
+
var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
1474
1438
|
|
|
1475
1439
|
// ../../node_modules/zustand/esm/react.mjs
|
|
1476
1440
|
init_react_import();
|
|
@@ -1479,8 +1443,8 @@ var identity = (arg) => arg;
|
|
|
1479
1443
|
function useStore(api, selector = identity) {
|
|
1480
1444
|
const slice = import_react4.default.useSyncExternalStore(
|
|
1481
1445
|
api.subscribe,
|
|
1482
|
-
() => selector(api.getState()),
|
|
1483
|
-
() => selector(api.getInitialState())
|
|
1446
|
+
import_react4.default.useCallback(() => selector(api.getState()), [api, selector]),
|
|
1447
|
+
import_react4.default.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
1484
1448
|
);
|
|
1485
1449
|
import_react4.default.useDebugValue(slice);
|
|
1486
1450
|
return slice;
|
|
@@ -1491,13 +1455,13 @@ var createImpl = (createState) => {
|
|
|
1491
1455
|
Object.assign(useBoundStore, api);
|
|
1492
1456
|
return useBoundStore;
|
|
1493
1457
|
};
|
|
1494
|
-
var create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
1458
|
+
var create = ((createState) => createState ? createImpl(createState) : createImpl);
|
|
1495
1459
|
|
|
1496
1460
|
// ../../node_modules/zustand/esm/middleware.mjs
|
|
1497
1461
|
init_react_import();
|
|
1498
1462
|
var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
1499
1463
|
const origSubscribe = api.subscribe;
|
|
1500
|
-
api.subscribe = (selector, optListener, options) => {
|
|
1464
|
+
api.subscribe = ((selector, optListener, options) => {
|
|
1501
1465
|
let listener = selector;
|
|
1502
1466
|
if (optListener) {
|
|
1503
1467
|
const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
|
|
@@ -1514,7 +1478,7 @@ var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
|
1514
1478
|
}
|
|
1515
1479
|
}
|
|
1516
1480
|
return origSubscribe(listener);
|
|
1517
|
-
};
|
|
1481
|
+
});
|
|
1518
1482
|
const initialState = fn(set, get, api);
|
|
1519
1483
|
return initialState;
|
|
1520
1484
|
};
|
|
@@ -1690,7 +1654,7 @@ var flattenData = (state, config) => {
|
|
|
1690
1654
|
(content) => content,
|
|
1691
1655
|
(item) => {
|
|
1692
1656
|
data.push(item);
|
|
1693
|
-
return
|
|
1657
|
+
return item;
|
|
1694
1658
|
}
|
|
1695
1659
|
);
|
|
1696
1660
|
return data;
|
|
@@ -1698,42 +1662,462 @@ var flattenData = (state, config) => {
|
|
|
1698
1662
|
|
|
1699
1663
|
// ../core/lib/get-changed.ts
|
|
1700
1664
|
init_react_import();
|
|
1701
|
-
|
|
1665
|
+
|
|
1666
|
+
// ../../node_modules/fast-equals/dist/esm/index.mjs
|
|
1667
|
+
init_react_import();
|
|
1668
|
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
1669
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
1670
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1671
|
+
function combineComparators(comparatorA, comparatorB) {
|
|
1672
|
+
return function isEqual(a, b, state) {
|
|
1673
|
+
return comparatorA(a, b, state) && comparatorB(a, b, state);
|
|
1674
|
+
};
|
|
1675
|
+
}
|
|
1676
|
+
function createIsCircular(areItemsEqual) {
|
|
1677
|
+
return function isCircular(a, b, state) {
|
|
1678
|
+
if (!a || !b || typeof a !== "object" || typeof b !== "object") {
|
|
1679
|
+
return areItemsEqual(a, b, state);
|
|
1680
|
+
}
|
|
1681
|
+
var cache2 = state.cache;
|
|
1682
|
+
var cachedA = cache2.get(a);
|
|
1683
|
+
var cachedB = cache2.get(b);
|
|
1684
|
+
if (cachedA && cachedB) {
|
|
1685
|
+
return cachedA === b && cachedB === a;
|
|
1686
|
+
}
|
|
1687
|
+
cache2.set(a, b);
|
|
1688
|
+
cache2.set(b, a);
|
|
1689
|
+
var result = areItemsEqual(a, b, state);
|
|
1690
|
+
cache2.delete(a);
|
|
1691
|
+
cache2.delete(b);
|
|
1692
|
+
return result;
|
|
1693
|
+
};
|
|
1694
|
+
}
|
|
1695
|
+
function getStrictProperties(object) {
|
|
1696
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
1697
|
+
}
|
|
1698
|
+
var hasOwn = Object.hasOwn || (function(object, property) {
|
|
1699
|
+
return hasOwnProperty.call(object, property);
|
|
1700
|
+
});
|
|
1701
|
+
function sameValueZeroEqual(a, b) {
|
|
1702
|
+
return a === b || !a && !b && a !== a && b !== b;
|
|
1703
|
+
}
|
|
1704
|
+
var PREACT_VNODE = "__v";
|
|
1705
|
+
var PREACT_OWNER = "__o";
|
|
1706
|
+
var REACT_OWNER = "_owner";
|
|
1707
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
1708
|
+
var keys = Object.keys;
|
|
1709
|
+
function areArraysEqual(a, b, state) {
|
|
1710
|
+
var index = a.length;
|
|
1711
|
+
if (b.length !== index) {
|
|
1712
|
+
return false;
|
|
1713
|
+
}
|
|
1714
|
+
while (index-- > 0) {
|
|
1715
|
+
if (!state.equals(a[index], b[index], index, index, a, b, state)) {
|
|
1716
|
+
return false;
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
return true;
|
|
1720
|
+
}
|
|
1721
|
+
function areDatesEqual(a, b) {
|
|
1722
|
+
return sameValueZeroEqual(a.getTime(), b.getTime());
|
|
1723
|
+
}
|
|
1724
|
+
function areErrorsEqual(a, b) {
|
|
1725
|
+
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
|
|
1726
|
+
}
|
|
1727
|
+
function areFunctionsEqual(a, b) {
|
|
1728
|
+
return a === b;
|
|
1729
|
+
}
|
|
1730
|
+
function areMapsEqual(a, b, state) {
|
|
1731
|
+
var size = a.size;
|
|
1732
|
+
if (size !== b.size) {
|
|
1733
|
+
return false;
|
|
1734
|
+
}
|
|
1735
|
+
if (!size) {
|
|
1736
|
+
return true;
|
|
1737
|
+
}
|
|
1738
|
+
var matchedIndices = new Array(size);
|
|
1739
|
+
var aIterable = a.entries();
|
|
1740
|
+
var aResult;
|
|
1741
|
+
var bResult;
|
|
1742
|
+
var index = 0;
|
|
1743
|
+
while (aResult = aIterable.next()) {
|
|
1744
|
+
if (aResult.done) {
|
|
1745
|
+
break;
|
|
1746
|
+
}
|
|
1747
|
+
var bIterable = b.entries();
|
|
1748
|
+
var hasMatch = false;
|
|
1749
|
+
var matchIndex = 0;
|
|
1750
|
+
while (bResult = bIterable.next()) {
|
|
1751
|
+
if (bResult.done) {
|
|
1752
|
+
break;
|
|
1753
|
+
}
|
|
1754
|
+
if (matchedIndices[matchIndex]) {
|
|
1755
|
+
matchIndex++;
|
|
1756
|
+
continue;
|
|
1757
|
+
}
|
|
1758
|
+
var aEntry = aResult.value;
|
|
1759
|
+
var bEntry = bResult.value;
|
|
1760
|
+
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)) {
|
|
1761
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
1762
|
+
break;
|
|
1763
|
+
}
|
|
1764
|
+
matchIndex++;
|
|
1765
|
+
}
|
|
1766
|
+
if (!hasMatch) {
|
|
1767
|
+
return false;
|
|
1768
|
+
}
|
|
1769
|
+
index++;
|
|
1770
|
+
}
|
|
1771
|
+
return true;
|
|
1772
|
+
}
|
|
1773
|
+
var areNumbersEqual = sameValueZeroEqual;
|
|
1774
|
+
function areObjectsEqual(a, b, state) {
|
|
1775
|
+
var properties = keys(a);
|
|
1776
|
+
var index = properties.length;
|
|
1777
|
+
if (keys(b).length !== index) {
|
|
1778
|
+
return false;
|
|
1779
|
+
}
|
|
1780
|
+
while (index-- > 0) {
|
|
1781
|
+
if (!isPropertyEqual(a, b, state, properties[index])) {
|
|
1782
|
+
return false;
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
return true;
|
|
1786
|
+
}
|
|
1787
|
+
function areObjectsEqualStrict(a, b, state) {
|
|
1788
|
+
var properties = getStrictProperties(a);
|
|
1789
|
+
var index = properties.length;
|
|
1790
|
+
if (getStrictProperties(b).length !== index) {
|
|
1791
|
+
return false;
|
|
1792
|
+
}
|
|
1793
|
+
var property;
|
|
1794
|
+
var descriptorA;
|
|
1795
|
+
var descriptorB;
|
|
1796
|
+
while (index-- > 0) {
|
|
1797
|
+
property = properties[index];
|
|
1798
|
+
if (!isPropertyEqual(a, b, state, property)) {
|
|
1799
|
+
return false;
|
|
1800
|
+
}
|
|
1801
|
+
descriptorA = getOwnPropertyDescriptor(a, property);
|
|
1802
|
+
descriptorB = getOwnPropertyDescriptor(b, property);
|
|
1803
|
+
if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
|
|
1804
|
+
return false;
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
return true;
|
|
1808
|
+
}
|
|
1809
|
+
function arePrimitiveWrappersEqual(a, b) {
|
|
1810
|
+
return sameValueZeroEqual(a.valueOf(), b.valueOf());
|
|
1811
|
+
}
|
|
1812
|
+
function areRegExpsEqual(a, b) {
|
|
1813
|
+
return a.source === b.source && a.flags === b.flags;
|
|
1814
|
+
}
|
|
1815
|
+
function areSetsEqual(a, b, state) {
|
|
1816
|
+
var size = a.size;
|
|
1817
|
+
if (size !== b.size) {
|
|
1818
|
+
return false;
|
|
1819
|
+
}
|
|
1820
|
+
if (!size) {
|
|
1821
|
+
return true;
|
|
1822
|
+
}
|
|
1823
|
+
var matchedIndices = new Array(size);
|
|
1824
|
+
var aIterable = a.values();
|
|
1825
|
+
var aResult;
|
|
1826
|
+
var bResult;
|
|
1827
|
+
while (aResult = aIterable.next()) {
|
|
1828
|
+
if (aResult.done) {
|
|
1829
|
+
break;
|
|
1830
|
+
}
|
|
1831
|
+
var bIterable = b.values();
|
|
1832
|
+
var hasMatch = false;
|
|
1833
|
+
var matchIndex = 0;
|
|
1834
|
+
while (bResult = bIterable.next()) {
|
|
1835
|
+
if (bResult.done) {
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
|
|
1839
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
1840
|
+
break;
|
|
1841
|
+
}
|
|
1842
|
+
matchIndex++;
|
|
1843
|
+
}
|
|
1844
|
+
if (!hasMatch) {
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
return true;
|
|
1849
|
+
}
|
|
1850
|
+
function areTypedArraysEqual(a, b) {
|
|
1851
|
+
var index = a.length;
|
|
1852
|
+
if (b.length !== index) {
|
|
1853
|
+
return false;
|
|
1854
|
+
}
|
|
1855
|
+
while (index-- > 0) {
|
|
1856
|
+
if (a[index] !== b[index]) {
|
|
1857
|
+
return false;
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
return true;
|
|
1861
|
+
}
|
|
1862
|
+
function areUrlsEqual(a, b) {
|
|
1863
|
+
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;
|
|
1864
|
+
}
|
|
1865
|
+
function isPropertyEqual(a, b, state, property) {
|
|
1866
|
+
if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) {
|
|
1867
|
+
return true;
|
|
1868
|
+
}
|
|
1869
|
+
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
|
|
1870
|
+
}
|
|
1871
|
+
var ARGUMENTS_TAG = "[object Arguments]";
|
|
1872
|
+
var BOOLEAN_TAG = "[object Boolean]";
|
|
1873
|
+
var DATE_TAG = "[object Date]";
|
|
1874
|
+
var ERROR_TAG = "[object Error]";
|
|
1875
|
+
var MAP_TAG = "[object Map]";
|
|
1876
|
+
var NUMBER_TAG = "[object Number]";
|
|
1877
|
+
var OBJECT_TAG = "[object Object]";
|
|
1878
|
+
var REG_EXP_TAG = "[object RegExp]";
|
|
1879
|
+
var SET_TAG = "[object Set]";
|
|
1880
|
+
var STRING_TAG = "[object String]";
|
|
1881
|
+
var URL_TAG = "[object URL]";
|
|
1882
|
+
var isArray = Array.isArray;
|
|
1883
|
+
var isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null;
|
|
1884
|
+
var assign = Object.assign;
|
|
1885
|
+
var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
|
|
1886
|
+
function createEqualityComparator(_a) {
|
|
1887
|
+
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;
|
|
1888
|
+
return function comparator(a, b, state) {
|
|
1889
|
+
if (a === b) {
|
|
1890
|
+
return true;
|
|
1891
|
+
}
|
|
1892
|
+
if (a == null || b == null) {
|
|
1893
|
+
return false;
|
|
1894
|
+
}
|
|
1895
|
+
var type = typeof a;
|
|
1896
|
+
if (type !== typeof b) {
|
|
1897
|
+
return false;
|
|
1898
|
+
}
|
|
1899
|
+
if (type !== "object") {
|
|
1900
|
+
if (type === "number") {
|
|
1901
|
+
return areNumbersEqual2(a, b, state);
|
|
1902
|
+
}
|
|
1903
|
+
if (type === "function") {
|
|
1904
|
+
return areFunctionsEqual2(a, b, state);
|
|
1905
|
+
}
|
|
1906
|
+
return false;
|
|
1907
|
+
}
|
|
1908
|
+
var constructor = a.constructor;
|
|
1909
|
+
if (constructor !== b.constructor) {
|
|
1910
|
+
return false;
|
|
1911
|
+
}
|
|
1912
|
+
if (constructor === Object) {
|
|
1913
|
+
return areObjectsEqual2(a, b, state);
|
|
1914
|
+
}
|
|
1915
|
+
if (isArray(a)) {
|
|
1916
|
+
return areArraysEqual2(a, b, state);
|
|
1917
|
+
}
|
|
1918
|
+
if (isTypedArray != null && isTypedArray(a)) {
|
|
1919
|
+
return areTypedArraysEqual2(a, b, state);
|
|
1920
|
+
}
|
|
1921
|
+
if (constructor === Date) {
|
|
1922
|
+
return areDatesEqual2(a, b, state);
|
|
1923
|
+
}
|
|
1924
|
+
if (constructor === RegExp) {
|
|
1925
|
+
return areRegExpsEqual2(a, b, state);
|
|
1926
|
+
}
|
|
1927
|
+
if (constructor === Map) {
|
|
1928
|
+
return areMapsEqual2(a, b, state);
|
|
1929
|
+
}
|
|
1930
|
+
if (constructor === Set) {
|
|
1931
|
+
return areSetsEqual2(a, b, state);
|
|
1932
|
+
}
|
|
1933
|
+
var tag = getTag(a);
|
|
1934
|
+
if (tag === DATE_TAG) {
|
|
1935
|
+
return areDatesEqual2(a, b, state);
|
|
1936
|
+
}
|
|
1937
|
+
if (tag === REG_EXP_TAG) {
|
|
1938
|
+
return areRegExpsEqual2(a, b, state);
|
|
1939
|
+
}
|
|
1940
|
+
if (tag === MAP_TAG) {
|
|
1941
|
+
return areMapsEqual2(a, b, state);
|
|
1942
|
+
}
|
|
1943
|
+
if (tag === SET_TAG) {
|
|
1944
|
+
return areSetsEqual2(a, b, state);
|
|
1945
|
+
}
|
|
1946
|
+
if (tag === OBJECT_TAG) {
|
|
1947
|
+
return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
|
|
1948
|
+
}
|
|
1949
|
+
if (tag === URL_TAG) {
|
|
1950
|
+
return areUrlsEqual2(a, b, state);
|
|
1951
|
+
}
|
|
1952
|
+
if (tag === ERROR_TAG) {
|
|
1953
|
+
return areErrorsEqual2(a, b, state);
|
|
1954
|
+
}
|
|
1955
|
+
if (tag === ARGUMENTS_TAG) {
|
|
1956
|
+
return areObjectsEqual2(a, b, state);
|
|
1957
|
+
}
|
|
1958
|
+
if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
|
|
1959
|
+
return arePrimitiveWrappersEqual2(a, b, state);
|
|
1960
|
+
}
|
|
1961
|
+
return false;
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
function createEqualityComparatorConfig(_a) {
|
|
1965
|
+
var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
|
|
1966
|
+
var config = {
|
|
1967
|
+
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
1968
|
+
areDatesEqual,
|
|
1969
|
+
areErrorsEqual,
|
|
1970
|
+
areFunctionsEqual,
|
|
1971
|
+
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
|
|
1972
|
+
areNumbersEqual,
|
|
1973
|
+
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
|
|
1974
|
+
arePrimitiveWrappersEqual,
|
|
1975
|
+
areRegExpsEqual,
|
|
1976
|
+
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
1977
|
+
areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
|
|
1978
|
+
areUrlsEqual
|
|
1979
|
+
};
|
|
1980
|
+
if (createCustomConfig) {
|
|
1981
|
+
config = assign({}, config, createCustomConfig(config));
|
|
1982
|
+
}
|
|
1983
|
+
if (circular) {
|
|
1984
|
+
var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
|
|
1985
|
+
var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
|
|
1986
|
+
var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
|
|
1987
|
+
var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
|
|
1988
|
+
config = assign({}, config, {
|
|
1989
|
+
areArraysEqual: areArraysEqual$1,
|
|
1990
|
+
areMapsEqual: areMapsEqual$1,
|
|
1991
|
+
areObjectsEqual: areObjectsEqual$1,
|
|
1992
|
+
areSetsEqual: areSetsEqual$1
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
return config;
|
|
1996
|
+
}
|
|
1997
|
+
function createInternalEqualityComparator(compare) {
|
|
1998
|
+
return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
|
|
1999
|
+
return compare(a, b, state);
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
function createIsEqual(_a) {
|
|
2003
|
+
var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
|
|
2004
|
+
if (createState) {
|
|
2005
|
+
return function isEqual(a, b) {
|
|
2006
|
+
var _a2 = createState(), _b = _a2.cache, cache2 = _b === void 0 ? circular ? /* @__PURE__ */ new WeakMap() : void 0 : _b, meta = _a2.meta;
|
|
2007
|
+
return comparator(a, b, {
|
|
2008
|
+
cache: cache2,
|
|
2009
|
+
equals,
|
|
2010
|
+
meta,
|
|
2011
|
+
strict
|
|
2012
|
+
});
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
if (circular) {
|
|
2016
|
+
return function isEqual(a, b) {
|
|
2017
|
+
return comparator(a, b, {
|
|
2018
|
+
cache: /* @__PURE__ */ new WeakMap(),
|
|
2019
|
+
equals,
|
|
2020
|
+
meta: void 0,
|
|
2021
|
+
strict
|
|
2022
|
+
});
|
|
2023
|
+
};
|
|
2024
|
+
}
|
|
2025
|
+
var state = {
|
|
2026
|
+
cache: void 0,
|
|
2027
|
+
equals,
|
|
2028
|
+
meta: void 0,
|
|
2029
|
+
strict
|
|
2030
|
+
};
|
|
2031
|
+
return function isEqual(a, b) {
|
|
2032
|
+
return comparator(a, b, state);
|
|
2033
|
+
};
|
|
2034
|
+
}
|
|
2035
|
+
var deepEqual = createCustomEqual();
|
|
2036
|
+
var strictDeepEqual = createCustomEqual({ strict: true });
|
|
2037
|
+
var circularDeepEqual = createCustomEqual({ circular: true });
|
|
2038
|
+
var strictCircularDeepEqual = createCustomEqual({
|
|
2039
|
+
circular: true,
|
|
2040
|
+
strict: true
|
|
2041
|
+
});
|
|
2042
|
+
var shallowEqual = createCustomEqual({
|
|
2043
|
+
createInternalComparator: function() {
|
|
2044
|
+
return sameValueZeroEqual;
|
|
2045
|
+
}
|
|
2046
|
+
});
|
|
2047
|
+
var strictShallowEqual = createCustomEqual({
|
|
2048
|
+
strict: true,
|
|
2049
|
+
createInternalComparator: function() {
|
|
2050
|
+
return sameValueZeroEqual;
|
|
2051
|
+
}
|
|
2052
|
+
});
|
|
2053
|
+
var circularShallowEqual = createCustomEqual({
|
|
2054
|
+
circular: true,
|
|
2055
|
+
createInternalComparator: function() {
|
|
2056
|
+
return sameValueZeroEqual;
|
|
2057
|
+
}
|
|
2058
|
+
});
|
|
2059
|
+
var strictCircularShallowEqual = createCustomEqual({
|
|
2060
|
+
circular: true,
|
|
2061
|
+
createInternalComparator: function() {
|
|
2062
|
+
return sameValueZeroEqual;
|
|
2063
|
+
},
|
|
2064
|
+
strict: true
|
|
2065
|
+
});
|
|
2066
|
+
function createCustomEqual(options) {
|
|
2067
|
+
if (options === void 0) {
|
|
2068
|
+
options = {};
|
|
2069
|
+
}
|
|
2070
|
+
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;
|
|
2071
|
+
var config = createEqualityComparatorConfig(options);
|
|
2072
|
+
var comparator = createEqualityComparator(config);
|
|
2073
|
+
var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
|
|
2074
|
+
return createIsEqual({ circular, comparator, createState, equals, strict });
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
// ../core/lib/get-changed.ts
|
|
1702
2078
|
var getChanged = (newItem, oldItem) => {
|
|
1703
2079
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
|
1704
2080
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
|
1705
2081
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
|
1706
2082
|
return __spreadProps(__spreadValues({}, acc), {
|
|
1707
|
-
[item]: !(
|
|
2083
|
+
[item]: !deepEqual(oldItemProps[item], newItemProps[item])
|
|
1708
2084
|
});
|
|
1709
2085
|
}, {}) : {};
|
|
1710
2086
|
};
|
|
1711
2087
|
|
|
1712
2088
|
// ../core/store/slices/permissions.ts
|
|
1713
2089
|
var createPermissionsSlice = (set, get) => {
|
|
1714
|
-
const resolvePermissions = (..._0) => __async(
|
|
2090
|
+
const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
|
|
1715
2091
|
const { state, permissions, config } = get();
|
|
1716
2092
|
const { cache: cache2, globalPermissions } = permissions;
|
|
1717
|
-
const
|
|
1718
|
-
var _a, _b
|
|
2093
|
+
const resolvePermissionsForItem = (item2, force2 = false) => __async(null, null, function* () {
|
|
2094
|
+
var _a, _b;
|
|
1719
2095
|
const { config: config2, state: appState, setComponentLoading } = get();
|
|
2096
|
+
const itemCache = cache2[item2.props.id];
|
|
2097
|
+
const nodes = appState.indexes.nodes;
|
|
2098
|
+
const parentId = (_a = nodes[item2.props.id]) == null ? void 0 : _a.parentId;
|
|
2099
|
+
const parentNode = parentId ? nodes[parentId] : null;
|
|
2100
|
+
const parentData = (_b = parentNode == null ? void 0 : parentNode.data) != null ? _b : null;
|
|
1720
2101
|
const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
|
|
1721
2102
|
if (!componentConfig) {
|
|
1722
2103
|
return;
|
|
1723
2104
|
}
|
|
1724
2105
|
const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig.permissions);
|
|
1725
2106
|
if (componentConfig.resolvePermissions) {
|
|
1726
|
-
const changed = getChanged(item2,
|
|
1727
|
-
|
|
2107
|
+
const changed = getChanged(item2, itemCache == null ? void 0 : itemCache.lastData);
|
|
2108
|
+
const propsChanged = Object.values(changed).some((el) => el === true);
|
|
2109
|
+
const parentChanged = (itemCache == null ? void 0 : itemCache.lastParentId) !== parentId;
|
|
2110
|
+
if (propsChanged || parentChanged || force2) {
|
|
1728
2111
|
const clearTimeout2 = setComponentLoading(item2.props.id, true, 50);
|
|
1729
2112
|
const resolvedPermissions = yield componentConfig.resolvePermissions(
|
|
1730
2113
|
item2,
|
|
1731
2114
|
{
|
|
1732
2115
|
changed,
|
|
1733
|
-
lastPermissions: (
|
|
2116
|
+
lastPermissions: (itemCache == null ? void 0 : itemCache.lastPermissions) || null,
|
|
1734
2117
|
permissions: initialPermissions,
|
|
1735
2118
|
appState: makeStatePublic(appState),
|
|
1736
|
-
lastData: (
|
|
2119
|
+
lastData: (itemCache == null ? void 0 : itemCache.lastData) || null,
|
|
2120
|
+
parent: parentData
|
|
1737
2121
|
}
|
|
1738
2122
|
);
|
|
1739
2123
|
const latest = get().permissions;
|
|
@@ -1741,6 +2125,7 @@ var createPermissionsSlice = (set, get) => {
|
|
|
1741
2125
|
permissions: __spreadProps(__spreadValues({}, latest), {
|
|
1742
2126
|
cache: __spreadProps(__spreadValues({}, latest.cache), {
|
|
1743
2127
|
[item2.props.id]: {
|
|
2128
|
+
lastParentId: parentId,
|
|
1744
2129
|
lastData: item2,
|
|
1745
2130
|
lastPermissions: resolvedPermissions
|
|
1746
2131
|
}
|
|
@@ -1754,9 +2139,9 @@ var createPermissionsSlice = (set, get) => {
|
|
|
1754
2139
|
}
|
|
1755
2140
|
}
|
|
1756
2141
|
});
|
|
1757
|
-
const
|
|
2142
|
+
const resolvePermissionsForRoot = (force2 = false) => {
|
|
1758
2143
|
const { state: appState } = get();
|
|
1759
|
-
|
|
2144
|
+
resolvePermissionsForItem(
|
|
1760
2145
|
// Shim the root data in by conforming to component data shape
|
|
1761
2146
|
{
|
|
1762
2147
|
type: "root",
|
|
@@ -1767,16 +2152,16 @@ var createPermissionsSlice = (set, get) => {
|
|
|
1767
2152
|
};
|
|
1768
2153
|
const { item, type, root } = params;
|
|
1769
2154
|
if (item) {
|
|
1770
|
-
yield
|
|
2155
|
+
yield resolvePermissionsForItem(item, force);
|
|
1771
2156
|
} else if (type) {
|
|
1772
|
-
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(
|
|
1773
|
-
yield
|
|
2157
|
+
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
|
|
2158
|
+
yield resolvePermissionsForItem(item2, force);
|
|
1774
2159
|
}));
|
|
1775
2160
|
} else if (root) {
|
|
1776
|
-
|
|
2161
|
+
resolvePermissionsForRoot(force);
|
|
1777
2162
|
} else {
|
|
1778
|
-
flattenData(state, config).map((item2) => __async(
|
|
1779
|
-
yield
|
|
2163
|
+
flattenData(state, config).map((item2) => __async(null, null, function* () {
|
|
2164
|
+
yield resolvePermissionsForItem(item2, force);
|
|
1780
2165
|
}));
|
|
1781
2166
|
}
|
|
1782
2167
|
});
|
|
@@ -1829,16 +2214,15 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
1829
2214
|
|
|
1830
2215
|
// ../core/lib/resolve-component-data.ts
|
|
1831
2216
|
init_react_import();
|
|
1832
|
-
var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
|
|
1833
2217
|
var cache = { lastChange: {} };
|
|
1834
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(
|
|
2218
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
1835
2219
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
1836
2220
|
const resolvedItem = __spreadValues({}, item);
|
|
1837
2221
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
1838
2222
|
const id = "id" in item.props ? item.props.id : "root";
|
|
1839
2223
|
if (shouldRunResolver) {
|
|
1840
2224
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
|
1841
|
-
if (trigger !== "force" && item && (
|
|
2225
|
+
if (trigger !== "force" && item && deepEqual(item, oldItem)) {
|
|
1842
2226
|
return { node: resolved, didChange: false };
|
|
1843
2227
|
}
|
|
1844
2228
|
const changed = getChanged(item, oldItem);
|
|
@@ -1859,11 +2243,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
1859
2243
|
let itemWithResolvedChildren = yield mapFields(
|
|
1860
2244
|
resolvedItem,
|
|
1861
2245
|
{
|
|
1862
|
-
slot: (_02) => __async(
|
|
2246
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
1863
2247
|
const content = value;
|
|
1864
2248
|
return yield Promise.all(
|
|
1865
2249
|
content.map(
|
|
1866
|
-
(childItem) => __async(
|
|
2250
|
+
(childItem) => __async(null, null, function* () {
|
|
1867
2251
|
return (yield resolveComponentData(
|
|
1868
2252
|
childItem,
|
|
1869
2253
|
config,
|
|
@@ -1888,7 +2272,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
1888
2272
|
};
|
|
1889
2273
|
return {
|
|
1890
2274
|
node: itemWithResolvedChildren,
|
|
1891
|
-
didChange: !(
|
|
2275
|
+
didChange: !deepEqual(item, itemWithResolvedChildren)
|
|
1892
2276
|
};
|
|
1893
2277
|
});
|
|
1894
2278
|
|
|
@@ -2053,7 +2437,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2053
2437
|
const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
|
|
2054
2438
|
return __spreadProps(__spreadValues({}, s), { state, selectedItem });
|
|
2055
2439
|
}),
|
|
2056
|
-
resolveComponentData: (componentData, trigger) => __async(
|
|
2440
|
+
resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
|
|
2057
2441
|
const { config, metadata, setComponentLoading, permissions } = get();
|
|
2058
2442
|
const timeouts = {};
|
|
2059
2443
|
return yield resolveComponentData(
|
|
@@ -2064,7 +2448,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2064
2448
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2065
2449
|
timeouts[id] = setComponentLoading(id, true, 50);
|
|
2066
2450
|
},
|
|
2067
|
-
(item) => __async(
|
|
2451
|
+
(item) => __async(null, null, function* () {
|
|
2068
2452
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2069
2453
|
if ("type" in item) {
|
|
2070
2454
|
yield permissions.refreshPermissions({ item });
|
|
@@ -2076,7 +2460,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2076
2460
|
trigger
|
|
2077
2461
|
);
|
|
2078
2462
|
}),
|
|
2079
|
-
resolveAndCommitData: () => __async(
|
|
2463
|
+
resolveAndCommitData: () => __async(null, null, function* () {
|
|
2080
2464
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
|
2081
2465
|
walkAppState(
|
|
2082
2466
|
state,
|
|
@@ -2500,45 +2884,10 @@ classnames/index.js:
|
|
|
2500
2884
|
*)
|
|
2501
2885
|
|
|
2502
2886
|
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
2887
|
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
2888
|
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
2889
|
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
2890
|
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
2891
|
lucide-react/dist/esm/lucide-react.js:
|
|
2543
2892
|
(**
|
|
2544
2893
|
* @license lucide-react v0.468.0 - ISC
|