@measured/puck-plugin-heading-analyzer 0.21.0-canary.d32e582b → 0.21.0-canary.dfecd012
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.css +149 -5
- package/dist/index.d.mts +63 -58
- package/dist/index.d.ts +63 -58
- package/dist/index.js +688 -195
- package/dist/index.mjs +682 -189
- package/package.json +3 -2
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
|
|
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 (
|
|
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
|
|
209
|
+
const isArray2 = type === "[object Array]";
|
|
210
210
|
const isObject = type === "[object Object]";
|
|
211
211
|
if (!val) {
|
|
212
212
|
return true;
|
|
213
|
-
} else if (
|
|
213
|
+
} else if (isArray2) {
|
|
214
214
|
return !val.length;
|
|
215
215
|
} else if (isObject) {
|
|
216
216
|
return !Object.keys(val).length;
|
|
@@ -260,42 +260,6 @@ var require_flat = __commonJS({
|
|
|
260
260
|
}
|
|
261
261
|
});
|
|
262
262
|
|
|
263
|
-
// ../../node_modules/fast-deep-equal/index.js
|
|
264
|
-
var require_fast_deep_equal = __commonJS({
|
|
265
|
-
"../../node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
266
|
-
"use strict";
|
|
267
|
-
init_react_import();
|
|
268
|
-
module.exports = function equal(a, b) {
|
|
269
|
-
if (a === b) return true;
|
|
270
|
-
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
271
|
-
if (a.constructor !== b.constructor) return false;
|
|
272
|
-
var length, i, keys;
|
|
273
|
-
if (Array.isArray(a)) {
|
|
274
|
-
length = a.length;
|
|
275
|
-
if (length != b.length) return false;
|
|
276
|
-
for (i = length; i-- !== 0; )
|
|
277
|
-
if (!equal(a[i], b[i])) return false;
|
|
278
|
-
return true;
|
|
279
|
-
}
|
|
280
|
-
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
281
|
-
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
282
|
-
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
283
|
-
keys = Object.keys(a);
|
|
284
|
-
length = keys.length;
|
|
285
|
-
if (length !== Object.keys(b).length) return false;
|
|
286
|
-
for (i = length; i-- !== 0; )
|
|
287
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
288
|
-
for (i = length; i-- !== 0; ) {
|
|
289
|
-
var key = keys[i];
|
|
290
|
-
if (!equal(a[key], b[key])) return false;
|
|
291
|
-
}
|
|
292
|
-
return true;
|
|
293
|
-
}
|
|
294
|
-
return a !== a && b !== b;
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
|
|
299
263
|
// index.ts
|
|
300
264
|
init_react_import();
|
|
301
265
|
|
|
@@ -305,17 +269,17 @@ import { useEffect as useEffect5, useState } from "react";
|
|
|
305
269
|
|
|
306
270
|
// css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
|
|
307
271
|
init_react_import();
|
|
308
|
-
var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "
|
|
272
|
+
var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_116v6_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_116v6_5", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_116v6_9", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_116v6_13" };
|
|
309
273
|
|
|
310
274
|
// src/HeadingAnalyzer.tsx
|
|
311
275
|
import { createUsePuck } from "@measured/puck";
|
|
312
276
|
|
|
313
|
-
// ../core/components/
|
|
277
|
+
// ../core/components/SidebarSection/index.tsx
|
|
314
278
|
init_react_import();
|
|
315
279
|
|
|
316
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/
|
|
280
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
|
317
281
|
init_react_import();
|
|
318
|
-
var styles_module_default = { "
|
|
282
|
+
var styles_module_default = { "SidebarSection": "_SidebarSection_8boj8_1", "SidebarSection-title": "_SidebarSection-title_8boj8_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_8boj8_20", "SidebarSection-content": "_SidebarSection-content_8boj8_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_8boj8_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_8boj8_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_8boj8_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_8boj8_41", "SidebarSection-heading": "_SidebarSection-heading_8boj8_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_8boj8_86" };
|
|
319
283
|
|
|
320
284
|
// ../core/lib/get-class-name-factory.ts
|
|
321
285
|
init_react_import();
|
|
@@ -344,50 +308,29 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
|
|
|
344
308
|
};
|
|
345
309
|
var get_class_name_factory_default = getClassNameFactory;
|
|
346
310
|
|
|
347
|
-
// ../core/components/
|
|
311
|
+
// ../core/components/Heading/index.tsx
|
|
312
|
+
init_react_import();
|
|
313
|
+
|
|
314
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
|
|
315
|
+
init_react_import();
|
|
316
|
+
var styles_module_default2 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
|
|
317
|
+
|
|
318
|
+
// ../core/components/Heading/index.tsx
|
|
348
319
|
import { jsx } from "react/jsx-runtime";
|
|
349
|
-
var getClassName = get_class_name_factory_default("
|
|
350
|
-
var
|
|
351
|
-
|
|
352
|
-
return /* @__PURE__ */ jsx("ul", { className: getClassName(), children });
|
|
353
|
-
};
|
|
354
|
-
OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx("div", { className: getClassNameItem({ clickable: true }), children });
|
|
355
|
-
OutlineList.Item = ({
|
|
356
|
-
children,
|
|
357
|
-
onClick
|
|
358
|
-
}) => {
|
|
320
|
+
var getClassName = get_class_name_factory_default("Heading", styles_module_default2);
|
|
321
|
+
var Heading = ({ children, rank, size = "m" }) => {
|
|
322
|
+
const Tag = rank ? `h${rank}` : "span";
|
|
359
323
|
return /* @__PURE__ */ jsx(
|
|
360
|
-
|
|
324
|
+
Tag,
|
|
361
325
|
{
|
|
362
|
-
className:
|
|
363
|
-
|
|
326
|
+
className: getClassName({
|
|
327
|
+
[size]: true
|
|
328
|
+
}),
|
|
364
329
|
children
|
|
365
330
|
}
|
|
366
331
|
);
|
|
367
332
|
};
|
|
368
333
|
|
|
369
|
-
// ../core/lib/scroll-into-view.ts
|
|
370
|
-
init_react_import();
|
|
371
|
-
var scrollIntoView = (el) => {
|
|
372
|
-
const oldStyle = __spreadValues({}, el.style);
|
|
373
|
-
el.style.scrollMargin = "256px";
|
|
374
|
-
if (el) {
|
|
375
|
-
el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
|
|
376
|
-
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
// ../core/lib/get-frame.ts
|
|
381
|
-
init_react_import();
|
|
382
|
-
var getFrame = () => {
|
|
383
|
-
if (typeof window === "undefined") return;
|
|
384
|
-
let frameEl = document.querySelector("#preview-frame");
|
|
385
|
-
if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
|
|
386
|
-
return frameEl.contentDocument || document;
|
|
387
|
-
}
|
|
388
|
-
return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
|
|
389
|
-
};
|
|
390
|
-
|
|
391
334
|
// ../../node_modules/lucide-react/dist/esm/lucide-react.js
|
|
392
335
|
init_react_import();
|
|
393
336
|
|
|
@@ -475,29 +418,15 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
475
418
|
return Component;
|
|
476
419
|
};
|
|
477
420
|
|
|
478
|
-
// ../../node_modules/lucide-react/dist/esm/icons/
|
|
421
|
+
// ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
479
422
|
init_react_import();
|
|
480
|
-
var
|
|
481
|
-
["path", { d: "
|
|
482
|
-
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
483
|
-
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
484
|
-
["path", { d: "m17 12 3-2v8", key: "1hhhft" }]
|
|
423
|
+
var ChevronRight = createLucideIcon("ChevronRight", [
|
|
424
|
+
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
485
425
|
]);
|
|
486
426
|
|
|
487
|
-
// ../core/lib/
|
|
488
|
-
init_react_import();
|
|
489
|
-
|
|
490
|
-
// ../core/lib/filter.ts
|
|
491
|
-
init_react_import();
|
|
492
|
-
|
|
493
|
-
// ../core/lib/data/reorder.ts
|
|
494
|
-
init_react_import();
|
|
495
|
-
|
|
496
|
-
// ../core/lib/data/replace.ts
|
|
497
|
-
init_react_import();
|
|
498
|
-
|
|
499
|
-
// ../core/lib/use-reset-auto-zoom.ts
|
|
427
|
+
// ../core/lib/use-breadcrumbs.ts
|
|
500
428
|
init_react_import();
|
|
429
|
+
import { useMemo } from "react";
|
|
501
430
|
|
|
502
431
|
// ../core/store/index.ts
|
|
503
432
|
init_react_import();
|
|
@@ -595,7 +524,7 @@ var walkField = ({
|
|
|
595
524
|
return map({
|
|
596
525
|
value: mappedContent,
|
|
597
526
|
parentId: id,
|
|
598
|
-
propName:
|
|
527
|
+
propName: propPath,
|
|
599
528
|
field: fields[propKey],
|
|
600
529
|
propPath
|
|
601
530
|
});
|
|
@@ -877,10 +806,10 @@ var insert = (list, index, item) => {
|
|
|
877
806
|
// ../core/lib/generate-id.ts
|
|
878
807
|
init_react_import();
|
|
879
808
|
|
|
880
|
-
//
|
|
809
|
+
// ../core/node_modules/uuid/dist/esm-node/index.js
|
|
881
810
|
init_react_import();
|
|
882
811
|
|
|
883
|
-
//
|
|
812
|
+
// ../core/node_modules/uuid/dist/esm-node/rng.js
|
|
884
813
|
init_react_import();
|
|
885
814
|
import crypto from "crypto";
|
|
886
815
|
var rnds8Pool = new Uint8Array(256);
|
|
@@ -893,7 +822,7 @@ function rng() {
|
|
|
893
822
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
894
823
|
}
|
|
895
824
|
|
|
896
|
-
//
|
|
825
|
+
// ../core/node_modules/uuid/dist/esm-node/stringify.js
|
|
897
826
|
init_react_import();
|
|
898
827
|
var byteToHex = [];
|
|
899
828
|
for (let i = 0; i < 256; ++i) {
|
|
@@ -903,17 +832,17 @@ function unsafeStringify(arr, offset = 0) {
|
|
|
903
832
|
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
833
|
}
|
|
905
834
|
|
|
906
|
-
//
|
|
835
|
+
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
907
836
|
init_react_import();
|
|
908
837
|
|
|
909
|
-
//
|
|
838
|
+
// ../core/node_modules/uuid/dist/esm-node/native.js
|
|
910
839
|
init_react_import();
|
|
911
840
|
import crypto2 from "crypto";
|
|
912
841
|
var native_default = {
|
|
913
842
|
randomUUID: crypto2.randomUUID
|
|
914
843
|
};
|
|
915
844
|
|
|
916
|
-
//
|
|
845
|
+
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
917
846
|
function v4(options, buf, offset) {
|
|
918
847
|
if (native_default.randomUUID && !buf && !options) {
|
|
919
848
|
return native_default.randomUUID();
|
|
@@ -1467,8 +1396,7 @@ init_react_import();
|
|
|
1467
1396
|
var defaultViewports = [
|
|
1468
1397
|
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
|
1469
1398
|
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
|
1470
|
-
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
1471
|
-
{ width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
|
|
1399
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
1472
1400
|
];
|
|
1473
1401
|
|
|
1474
1402
|
// ../../node_modules/zustand/esm/vanilla.mjs
|
|
@@ -1494,7 +1422,7 @@ var createStoreImpl = (createState) => {
|
|
|
1494
1422
|
const initialState = state = createState(setState, getState, api);
|
|
1495
1423
|
return api;
|
|
1496
1424
|
};
|
|
1497
|
-
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
1425
|
+
var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
1498
1426
|
|
|
1499
1427
|
// ../../node_modules/zustand/esm/react.mjs
|
|
1500
1428
|
init_react_import();
|
|
@@ -1503,8 +1431,8 @@ var identity = (arg) => arg;
|
|
|
1503
1431
|
function useStore(api, selector = identity) {
|
|
1504
1432
|
const slice = React2.useSyncExternalStore(
|
|
1505
1433
|
api.subscribe,
|
|
1506
|
-
() => selector(api.getState()),
|
|
1507
|
-
() => selector(api.getInitialState())
|
|
1434
|
+
React2.useCallback(() => selector(api.getState()), [api, selector]),
|
|
1435
|
+
React2.useCallback(() => selector(api.getInitialState()), [api, selector])
|
|
1508
1436
|
);
|
|
1509
1437
|
React2.useDebugValue(slice);
|
|
1510
1438
|
return slice;
|
|
@@ -1515,13 +1443,13 @@ var createImpl = (createState) => {
|
|
|
1515
1443
|
Object.assign(useBoundStore, api);
|
|
1516
1444
|
return useBoundStore;
|
|
1517
1445
|
};
|
|
1518
|
-
var create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
1446
|
+
var create = ((createState) => createState ? createImpl(createState) : createImpl);
|
|
1519
1447
|
|
|
1520
1448
|
// ../../node_modules/zustand/esm/middleware.mjs
|
|
1521
1449
|
init_react_import();
|
|
1522
1450
|
var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
1523
1451
|
const origSubscribe = api.subscribe;
|
|
1524
|
-
api.subscribe = (selector, optListener, options) => {
|
|
1452
|
+
api.subscribe = ((selector, optListener, options) => {
|
|
1525
1453
|
let listener = selector;
|
|
1526
1454
|
if (optListener) {
|
|
1527
1455
|
const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
|
|
@@ -1538,7 +1466,7 @@ var subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
|
|
1538
1466
|
}
|
|
1539
1467
|
}
|
|
1540
1468
|
return origSubscribe(listener);
|
|
1541
|
-
};
|
|
1469
|
+
});
|
|
1542
1470
|
const initialState = fn(set, get, api);
|
|
1543
1471
|
return initialState;
|
|
1544
1472
|
};
|
|
@@ -1714,7 +1642,7 @@ var flattenData = (state, config) => {
|
|
|
1714
1642
|
(content) => content,
|
|
1715
1643
|
(item) => {
|
|
1716
1644
|
data.push(item);
|
|
1717
|
-
return
|
|
1645
|
+
return item;
|
|
1718
1646
|
}
|
|
1719
1647
|
);
|
|
1720
1648
|
return data;
|
|
@@ -1722,23 +1650,435 @@ var flattenData = (state, config) => {
|
|
|
1722
1650
|
|
|
1723
1651
|
// ../core/lib/get-changed.ts
|
|
1724
1652
|
init_react_import();
|
|
1725
|
-
|
|
1653
|
+
|
|
1654
|
+
// ../../node_modules/fast-equals/dist/esm/index.mjs
|
|
1655
|
+
init_react_import();
|
|
1656
|
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
1657
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
1658
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1659
|
+
function combineComparators(comparatorA, comparatorB) {
|
|
1660
|
+
return function isEqual(a, b, state) {
|
|
1661
|
+
return comparatorA(a, b, state) && comparatorB(a, b, state);
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
function createIsCircular(areItemsEqual) {
|
|
1665
|
+
return function isCircular(a, b, state) {
|
|
1666
|
+
if (!a || !b || typeof a !== "object" || typeof b !== "object") {
|
|
1667
|
+
return areItemsEqual(a, b, state);
|
|
1668
|
+
}
|
|
1669
|
+
var cache2 = state.cache;
|
|
1670
|
+
var cachedA = cache2.get(a);
|
|
1671
|
+
var cachedB = cache2.get(b);
|
|
1672
|
+
if (cachedA && cachedB) {
|
|
1673
|
+
return cachedA === b && cachedB === a;
|
|
1674
|
+
}
|
|
1675
|
+
cache2.set(a, b);
|
|
1676
|
+
cache2.set(b, a);
|
|
1677
|
+
var result = areItemsEqual(a, b, state);
|
|
1678
|
+
cache2.delete(a);
|
|
1679
|
+
cache2.delete(b);
|
|
1680
|
+
return result;
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
function getStrictProperties(object) {
|
|
1684
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
1685
|
+
}
|
|
1686
|
+
var hasOwn = Object.hasOwn || (function(object, property) {
|
|
1687
|
+
return hasOwnProperty.call(object, property);
|
|
1688
|
+
});
|
|
1689
|
+
function sameValueZeroEqual(a, b) {
|
|
1690
|
+
return a === b || !a && !b && a !== a && b !== b;
|
|
1691
|
+
}
|
|
1692
|
+
var PREACT_VNODE = "__v";
|
|
1693
|
+
var PREACT_OWNER = "__o";
|
|
1694
|
+
var REACT_OWNER = "_owner";
|
|
1695
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
1696
|
+
var keys = Object.keys;
|
|
1697
|
+
function areArraysEqual(a, b, state) {
|
|
1698
|
+
var index = a.length;
|
|
1699
|
+
if (b.length !== index) {
|
|
1700
|
+
return false;
|
|
1701
|
+
}
|
|
1702
|
+
while (index-- > 0) {
|
|
1703
|
+
if (!state.equals(a[index], b[index], index, index, a, b, state)) {
|
|
1704
|
+
return false;
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
return true;
|
|
1708
|
+
}
|
|
1709
|
+
function areDatesEqual(a, b) {
|
|
1710
|
+
return sameValueZeroEqual(a.getTime(), b.getTime());
|
|
1711
|
+
}
|
|
1712
|
+
function areErrorsEqual(a, b) {
|
|
1713
|
+
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
|
|
1714
|
+
}
|
|
1715
|
+
function areFunctionsEqual(a, b) {
|
|
1716
|
+
return a === b;
|
|
1717
|
+
}
|
|
1718
|
+
function areMapsEqual(a, b, state) {
|
|
1719
|
+
var size = a.size;
|
|
1720
|
+
if (size !== b.size) {
|
|
1721
|
+
return false;
|
|
1722
|
+
}
|
|
1723
|
+
if (!size) {
|
|
1724
|
+
return true;
|
|
1725
|
+
}
|
|
1726
|
+
var matchedIndices = new Array(size);
|
|
1727
|
+
var aIterable = a.entries();
|
|
1728
|
+
var aResult;
|
|
1729
|
+
var bResult;
|
|
1730
|
+
var index = 0;
|
|
1731
|
+
while (aResult = aIterable.next()) {
|
|
1732
|
+
if (aResult.done) {
|
|
1733
|
+
break;
|
|
1734
|
+
}
|
|
1735
|
+
var bIterable = b.entries();
|
|
1736
|
+
var hasMatch = false;
|
|
1737
|
+
var matchIndex = 0;
|
|
1738
|
+
while (bResult = bIterable.next()) {
|
|
1739
|
+
if (bResult.done) {
|
|
1740
|
+
break;
|
|
1741
|
+
}
|
|
1742
|
+
if (matchedIndices[matchIndex]) {
|
|
1743
|
+
matchIndex++;
|
|
1744
|
+
continue;
|
|
1745
|
+
}
|
|
1746
|
+
var aEntry = aResult.value;
|
|
1747
|
+
var bEntry = bResult.value;
|
|
1748
|
+
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)) {
|
|
1749
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
1750
|
+
break;
|
|
1751
|
+
}
|
|
1752
|
+
matchIndex++;
|
|
1753
|
+
}
|
|
1754
|
+
if (!hasMatch) {
|
|
1755
|
+
return false;
|
|
1756
|
+
}
|
|
1757
|
+
index++;
|
|
1758
|
+
}
|
|
1759
|
+
return true;
|
|
1760
|
+
}
|
|
1761
|
+
var areNumbersEqual = sameValueZeroEqual;
|
|
1762
|
+
function areObjectsEqual(a, b, state) {
|
|
1763
|
+
var properties = keys(a);
|
|
1764
|
+
var index = properties.length;
|
|
1765
|
+
if (keys(b).length !== index) {
|
|
1766
|
+
return false;
|
|
1767
|
+
}
|
|
1768
|
+
while (index-- > 0) {
|
|
1769
|
+
if (!isPropertyEqual(a, b, state, properties[index])) {
|
|
1770
|
+
return false;
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
return true;
|
|
1774
|
+
}
|
|
1775
|
+
function areObjectsEqualStrict(a, b, state) {
|
|
1776
|
+
var properties = getStrictProperties(a);
|
|
1777
|
+
var index = properties.length;
|
|
1778
|
+
if (getStrictProperties(b).length !== index) {
|
|
1779
|
+
return false;
|
|
1780
|
+
}
|
|
1781
|
+
var property;
|
|
1782
|
+
var descriptorA;
|
|
1783
|
+
var descriptorB;
|
|
1784
|
+
while (index-- > 0) {
|
|
1785
|
+
property = properties[index];
|
|
1786
|
+
if (!isPropertyEqual(a, b, state, property)) {
|
|
1787
|
+
return false;
|
|
1788
|
+
}
|
|
1789
|
+
descriptorA = getOwnPropertyDescriptor(a, property);
|
|
1790
|
+
descriptorB = getOwnPropertyDescriptor(b, property);
|
|
1791
|
+
if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
|
|
1792
|
+
return false;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
return true;
|
|
1796
|
+
}
|
|
1797
|
+
function arePrimitiveWrappersEqual(a, b) {
|
|
1798
|
+
return sameValueZeroEqual(a.valueOf(), b.valueOf());
|
|
1799
|
+
}
|
|
1800
|
+
function areRegExpsEqual(a, b) {
|
|
1801
|
+
return a.source === b.source && a.flags === b.flags;
|
|
1802
|
+
}
|
|
1803
|
+
function areSetsEqual(a, b, state) {
|
|
1804
|
+
var size = a.size;
|
|
1805
|
+
if (size !== b.size) {
|
|
1806
|
+
return false;
|
|
1807
|
+
}
|
|
1808
|
+
if (!size) {
|
|
1809
|
+
return true;
|
|
1810
|
+
}
|
|
1811
|
+
var matchedIndices = new Array(size);
|
|
1812
|
+
var aIterable = a.values();
|
|
1813
|
+
var aResult;
|
|
1814
|
+
var bResult;
|
|
1815
|
+
while (aResult = aIterable.next()) {
|
|
1816
|
+
if (aResult.done) {
|
|
1817
|
+
break;
|
|
1818
|
+
}
|
|
1819
|
+
var bIterable = b.values();
|
|
1820
|
+
var hasMatch = false;
|
|
1821
|
+
var matchIndex = 0;
|
|
1822
|
+
while (bResult = bIterable.next()) {
|
|
1823
|
+
if (bResult.done) {
|
|
1824
|
+
break;
|
|
1825
|
+
}
|
|
1826
|
+
if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
|
|
1827
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
1828
|
+
break;
|
|
1829
|
+
}
|
|
1830
|
+
matchIndex++;
|
|
1831
|
+
}
|
|
1832
|
+
if (!hasMatch) {
|
|
1833
|
+
return false;
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
return true;
|
|
1837
|
+
}
|
|
1838
|
+
function areTypedArraysEqual(a, b) {
|
|
1839
|
+
var index = a.length;
|
|
1840
|
+
if (b.length !== index) {
|
|
1841
|
+
return false;
|
|
1842
|
+
}
|
|
1843
|
+
while (index-- > 0) {
|
|
1844
|
+
if (a[index] !== b[index]) {
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
return true;
|
|
1849
|
+
}
|
|
1850
|
+
function areUrlsEqual(a, b) {
|
|
1851
|
+
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;
|
|
1852
|
+
}
|
|
1853
|
+
function isPropertyEqual(a, b, state, property) {
|
|
1854
|
+
if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) {
|
|
1855
|
+
return true;
|
|
1856
|
+
}
|
|
1857
|
+
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
|
|
1858
|
+
}
|
|
1859
|
+
var ARGUMENTS_TAG = "[object Arguments]";
|
|
1860
|
+
var BOOLEAN_TAG = "[object Boolean]";
|
|
1861
|
+
var DATE_TAG = "[object Date]";
|
|
1862
|
+
var ERROR_TAG = "[object Error]";
|
|
1863
|
+
var MAP_TAG = "[object Map]";
|
|
1864
|
+
var NUMBER_TAG = "[object Number]";
|
|
1865
|
+
var OBJECT_TAG = "[object Object]";
|
|
1866
|
+
var REG_EXP_TAG = "[object RegExp]";
|
|
1867
|
+
var SET_TAG = "[object Set]";
|
|
1868
|
+
var STRING_TAG = "[object String]";
|
|
1869
|
+
var URL_TAG = "[object URL]";
|
|
1870
|
+
var isArray = Array.isArray;
|
|
1871
|
+
var isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null;
|
|
1872
|
+
var assign = Object.assign;
|
|
1873
|
+
var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
|
|
1874
|
+
function createEqualityComparator(_a) {
|
|
1875
|
+
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;
|
|
1876
|
+
return function comparator(a, b, state) {
|
|
1877
|
+
if (a === b) {
|
|
1878
|
+
return true;
|
|
1879
|
+
}
|
|
1880
|
+
if (a == null || b == null) {
|
|
1881
|
+
return false;
|
|
1882
|
+
}
|
|
1883
|
+
var type = typeof a;
|
|
1884
|
+
if (type !== typeof b) {
|
|
1885
|
+
return false;
|
|
1886
|
+
}
|
|
1887
|
+
if (type !== "object") {
|
|
1888
|
+
if (type === "number") {
|
|
1889
|
+
return areNumbersEqual2(a, b, state);
|
|
1890
|
+
}
|
|
1891
|
+
if (type === "function") {
|
|
1892
|
+
return areFunctionsEqual2(a, b, state);
|
|
1893
|
+
}
|
|
1894
|
+
return false;
|
|
1895
|
+
}
|
|
1896
|
+
var constructor = a.constructor;
|
|
1897
|
+
if (constructor !== b.constructor) {
|
|
1898
|
+
return false;
|
|
1899
|
+
}
|
|
1900
|
+
if (constructor === Object) {
|
|
1901
|
+
return areObjectsEqual2(a, b, state);
|
|
1902
|
+
}
|
|
1903
|
+
if (isArray(a)) {
|
|
1904
|
+
return areArraysEqual2(a, b, state);
|
|
1905
|
+
}
|
|
1906
|
+
if (isTypedArray != null && isTypedArray(a)) {
|
|
1907
|
+
return areTypedArraysEqual2(a, b, state);
|
|
1908
|
+
}
|
|
1909
|
+
if (constructor === Date) {
|
|
1910
|
+
return areDatesEqual2(a, b, state);
|
|
1911
|
+
}
|
|
1912
|
+
if (constructor === RegExp) {
|
|
1913
|
+
return areRegExpsEqual2(a, b, state);
|
|
1914
|
+
}
|
|
1915
|
+
if (constructor === Map) {
|
|
1916
|
+
return areMapsEqual2(a, b, state);
|
|
1917
|
+
}
|
|
1918
|
+
if (constructor === Set) {
|
|
1919
|
+
return areSetsEqual2(a, b, state);
|
|
1920
|
+
}
|
|
1921
|
+
var tag = getTag(a);
|
|
1922
|
+
if (tag === DATE_TAG) {
|
|
1923
|
+
return areDatesEqual2(a, b, state);
|
|
1924
|
+
}
|
|
1925
|
+
if (tag === REG_EXP_TAG) {
|
|
1926
|
+
return areRegExpsEqual2(a, b, state);
|
|
1927
|
+
}
|
|
1928
|
+
if (tag === MAP_TAG) {
|
|
1929
|
+
return areMapsEqual2(a, b, state);
|
|
1930
|
+
}
|
|
1931
|
+
if (tag === SET_TAG) {
|
|
1932
|
+
return areSetsEqual2(a, b, state);
|
|
1933
|
+
}
|
|
1934
|
+
if (tag === OBJECT_TAG) {
|
|
1935
|
+
return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
|
|
1936
|
+
}
|
|
1937
|
+
if (tag === URL_TAG) {
|
|
1938
|
+
return areUrlsEqual2(a, b, state);
|
|
1939
|
+
}
|
|
1940
|
+
if (tag === ERROR_TAG) {
|
|
1941
|
+
return areErrorsEqual2(a, b, state);
|
|
1942
|
+
}
|
|
1943
|
+
if (tag === ARGUMENTS_TAG) {
|
|
1944
|
+
return areObjectsEqual2(a, b, state);
|
|
1945
|
+
}
|
|
1946
|
+
if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
|
|
1947
|
+
return arePrimitiveWrappersEqual2(a, b, state);
|
|
1948
|
+
}
|
|
1949
|
+
return false;
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
function createEqualityComparatorConfig(_a) {
|
|
1953
|
+
var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
|
|
1954
|
+
var config = {
|
|
1955
|
+
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
1956
|
+
areDatesEqual,
|
|
1957
|
+
areErrorsEqual,
|
|
1958
|
+
areFunctionsEqual,
|
|
1959
|
+
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
|
|
1960
|
+
areNumbersEqual,
|
|
1961
|
+
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
|
|
1962
|
+
arePrimitiveWrappersEqual,
|
|
1963
|
+
areRegExpsEqual,
|
|
1964
|
+
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
1965
|
+
areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
|
|
1966
|
+
areUrlsEqual
|
|
1967
|
+
};
|
|
1968
|
+
if (createCustomConfig) {
|
|
1969
|
+
config = assign({}, config, createCustomConfig(config));
|
|
1970
|
+
}
|
|
1971
|
+
if (circular) {
|
|
1972
|
+
var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
|
|
1973
|
+
var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
|
|
1974
|
+
var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
|
|
1975
|
+
var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
|
|
1976
|
+
config = assign({}, config, {
|
|
1977
|
+
areArraysEqual: areArraysEqual$1,
|
|
1978
|
+
areMapsEqual: areMapsEqual$1,
|
|
1979
|
+
areObjectsEqual: areObjectsEqual$1,
|
|
1980
|
+
areSetsEqual: areSetsEqual$1
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
return config;
|
|
1984
|
+
}
|
|
1985
|
+
function createInternalEqualityComparator(compare) {
|
|
1986
|
+
return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
|
|
1987
|
+
return compare(a, b, state);
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
function createIsEqual(_a) {
|
|
1991
|
+
var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
|
|
1992
|
+
if (createState) {
|
|
1993
|
+
return function isEqual(a, b) {
|
|
1994
|
+
var _a2 = createState(), _b = _a2.cache, cache2 = _b === void 0 ? circular ? /* @__PURE__ */ new WeakMap() : void 0 : _b, meta = _a2.meta;
|
|
1995
|
+
return comparator(a, b, {
|
|
1996
|
+
cache: cache2,
|
|
1997
|
+
equals,
|
|
1998
|
+
meta,
|
|
1999
|
+
strict
|
|
2000
|
+
});
|
|
2001
|
+
};
|
|
2002
|
+
}
|
|
2003
|
+
if (circular) {
|
|
2004
|
+
return function isEqual(a, b) {
|
|
2005
|
+
return comparator(a, b, {
|
|
2006
|
+
cache: /* @__PURE__ */ new WeakMap(),
|
|
2007
|
+
equals,
|
|
2008
|
+
meta: void 0,
|
|
2009
|
+
strict
|
|
2010
|
+
});
|
|
2011
|
+
};
|
|
2012
|
+
}
|
|
2013
|
+
var state = {
|
|
2014
|
+
cache: void 0,
|
|
2015
|
+
equals,
|
|
2016
|
+
meta: void 0,
|
|
2017
|
+
strict
|
|
2018
|
+
};
|
|
2019
|
+
return function isEqual(a, b) {
|
|
2020
|
+
return comparator(a, b, state);
|
|
2021
|
+
};
|
|
2022
|
+
}
|
|
2023
|
+
var deepEqual = createCustomEqual();
|
|
2024
|
+
var strictDeepEqual = createCustomEqual({ strict: true });
|
|
2025
|
+
var circularDeepEqual = createCustomEqual({ circular: true });
|
|
2026
|
+
var strictCircularDeepEqual = createCustomEqual({
|
|
2027
|
+
circular: true,
|
|
2028
|
+
strict: true
|
|
2029
|
+
});
|
|
2030
|
+
var shallowEqual = createCustomEqual({
|
|
2031
|
+
createInternalComparator: function() {
|
|
2032
|
+
return sameValueZeroEqual;
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
var strictShallowEqual = createCustomEqual({
|
|
2036
|
+
strict: true,
|
|
2037
|
+
createInternalComparator: function() {
|
|
2038
|
+
return sameValueZeroEqual;
|
|
2039
|
+
}
|
|
2040
|
+
});
|
|
2041
|
+
var circularShallowEqual = createCustomEqual({
|
|
2042
|
+
circular: true,
|
|
2043
|
+
createInternalComparator: function() {
|
|
2044
|
+
return sameValueZeroEqual;
|
|
2045
|
+
}
|
|
2046
|
+
});
|
|
2047
|
+
var strictCircularShallowEqual = createCustomEqual({
|
|
2048
|
+
circular: true,
|
|
2049
|
+
createInternalComparator: function() {
|
|
2050
|
+
return sameValueZeroEqual;
|
|
2051
|
+
},
|
|
2052
|
+
strict: true
|
|
2053
|
+
});
|
|
2054
|
+
function createCustomEqual(options) {
|
|
2055
|
+
if (options === void 0) {
|
|
2056
|
+
options = {};
|
|
2057
|
+
}
|
|
2058
|
+
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;
|
|
2059
|
+
var config = createEqualityComparatorConfig(options);
|
|
2060
|
+
var comparator = createEqualityComparator(config);
|
|
2061
|
+
var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
|
|
2062
|
+
return createIsEqual({ circular, comparator, createState, equals, strict });
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
// ../core/lib/get-changed.ts
|
|
1726
2066
|
var getChanged = (newItem, oldItem) => {
|
|
1727
2067
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
|
1728
2068
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
|
1729
2069
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
|
1730
2070
|
return __spreadProps(__spreadValues({}, acc), {
|
|
1731
|
-
[item]: !(
|
|
2071
|
+
[item]: !deepEqual(oldItemProps[item], newItemProps[item])
|
|
1732
2072
|
});
|
|
1733
2073
|
}, {}) : {};
|
|
1734
2074
|
};
|
|
1735
2075
|
|
|
1736
2076
|
// ../core/store/slices/permissions.ts
|
|
1737
2077
|
var createPermissionsSlice = (set, get) => {
|
|
1738
|
-
const resolvePermissions = (..._0) => __async(
|
|
2078
|
+
const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
|
|
1739
2079
|
const { state, permissions, config } = get();
|
|
1740
2080
|
const { cache: cache2, globalPermissions } = permissions;
|
|
1741
|
-
const resolveDataForItem = (item2, force2 = false) => __async(
|
|
2081
|
+
const resolveDataForItem = (item2, force2 = false) => __async(null, null, function* () {
|
|
1742
2082
|
var _a, _b, _c;
|
|
1743
2083
|
const { config: config2, state: appState, setComponentLoading } = get();
|
|
1744
2084
|
const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
|
|
@@ -1793,13 +2133,13 @@ var createPermissionsSlice = (set, get) => {
|
|
|
1793
2133
|
if (item) {
|
|
1794
2134
|
yield resolveDataForItem(item, force);
|
|
1795
2135
|
} else if (type) {
|
|
1796
|
-
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(
|
|
2136
|
+
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
|
|
1797
2137
|
yield resolveDataForItem(item2, force);
|
|
1798
2138
|
}));
|
|
1799
2139
|
} else if (root) {
|
|
1800
2140
|
resolveDataForRoot(force);
|
|
1801
2141
|
} else {
|
|
1802
|
-
flattenData(state, config).map((item2) => __async(
|
|
2142
|
+
flattenData(state, config).map((item2) => __async(null, null, function* () {
|
|
1803
2143
|
yield resolveDataForItem(item2, force);
|
|
1804
2144
|
}));
|
|
1805
2145
|
}
|
|
@@ -1853,16 +2193,15 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
1853
2193
|
|
|
1854
2194
|
// ../core/lib/resolve-component-data.ts
|
|
1855
2195
|
init_react_import();
|
|
1856
|
-
var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
|
|
1857
2196
|
var cache = { lastChange: {} };
|
|
1858
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(
|
|
2197
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
1859
2198
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
1860
2199
|
const resolvedItem = __spreadValues({}, item);
|
|
1861
2200
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
1862
2201
|
const id = "id" in item.props ? item.props.id : "root";
|
|
1863
2202
|
if (shouldRunResolver) {
|
|
1864
2203
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
|
1865
|
-
if (item && (
|
|
2204
|
+
if (trigger !== "force" && item && deepEqual(item, oldItem)) {
|
|
1866
2205
|
return { node: resolved, didChange: false };
|
|
1867
2206
|
}
|
|
1868
2207
|
const changed = getChanged(item, oldItem);
|
|
@@ -1883,11 +2222,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
1883
2222
|
let itemWithResolvedChildren = yield mapFields(
|
|
1884
2223
|
resolvedItem,
|
|
1885
2224
|
{
|
|
1886
|
-
slot: (_02) => __async(
|
|
2225
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
1887
2226
|
const content = value;
|
|
1888
2227
|
return yield Promise.all(
|
|
1889
2228
|
content.map(
|
|
1890
|
-
(childItem) => __async(
|
|
2229
|
+
(childItem) => __async(null, null, function* () {
|
|
1891
2230
|
return (yield resolveComponentData(
|
|
1892
2231
|
childItem,
|
|
1893
2232
|
config,
|
|
@@ -1912,7 +2251,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
1912
2251
|
};
|
|
1913
2252
|
return {
|
|
1914
2253
|
node: itemWithResolvedChildren,
|
|
1915
|
-
didChange: !(
|
|
2254
|
+
didChange: !deepEqual(item, itemWithResolvedChildren)
|
|
1916
2255
|
};
|
|
1917
2256
|
});
|
|
1918
2257
|
|
|
@@ -1953,8 +2292,7 @@ var defaultAppState = {
|
|
|
1953
2292
|
options: [],
|
|
1954
2293
|
controlsVisible: true
|
|
1955
2294
|
},
|
|
1956
|
-
field: { focus: null }
|
|
1957
|
-
plugin: { current: null }
|
|
2295
|
+
field: { focus: null }
|
|
1958
2296
|
},
|
|
1959
2297
|
indexes: {
|
|
1960
2298
|
nodes: {},
|
|
@@ -1970,7 +2308,6 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
1970
2308
|
subscribeWithSelector((set, get) => {
|
|
1971
2309
|
var _a, _b;
|
|
1972
2310
|
return __spreadProps(__spreadValues({
|
|
1973
|
-
instanceId: generateId(),
|
|
1974
2311
|
state: defaultAppState,
|
|
1975
2312
|
config: { components: {} },
|
|
1976
2313
|
componentState: {},
|
|
@@ -2079,7 +2416,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2079
2416
|
const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
|
|
2080
2417
|
return __spreadProps(__spreadValues({}, s), { state, selectedItem });
|
|
2081
2418
|
}),
|
|
2082
|
-
resolveComponentData: (componentData, trigger) => __async(
|
|
2419
|
+
resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
|
|
2083
2420
|
const { config, metadata, setComponentLoading, permissions } = get();
|
|
2084
2421
|
const timeouts = {};
|
|
2085
2422
|
return yield resolveComponentData(
|
|
@@ -2090,7 +2427,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2090
2427
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2091
2428
|
timeouts[id] = setComponentLoading(id, true, 50);
|
|
2092
2429
|
},
|
|
2093
|
-
(item) => __async(
|
|
2430
|
+
(item) => __async(null, null, function* () {
|
|
2094
2431
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2095
2432
|
if ("type" in item) {
|
|
2096
2433
|
yield permissions.refreshPermissions({ item });
|
|
@@ -2102,7 +2439,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2102
2439
|
trigger
|
|
2103
2440
|
);
|
|
2104
2441
|
}),
|
|
2105
|
-
resolveAndCommitData: () => __async(
|
|
2442
|
+
resolveAndCommitData: () => __async(null, null, function* () {
|
|
2106
2443
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
|
2107
2444
|
walkAppState(
|
|
2108
2445
|
state,
|
|
@@ -2141,14 +2478,203 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2141
2478
|
})
|
|
2142
2479
|
);
|
|
2143
2480
|
var appStoreContext = createContext(createAppStore());
|
|
2481
|
+
function useAppStore(selector) {
|
|
2482
|
+
const context = useContext(appStoreContext);
|
|
2483
|
+
return useStore(context, selector);
|
|
2484
|
+
}
|
|
2485
|
+
function useAppStoreApi() {
|
|
2486
|
+
return useContext(appStoreContext);
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
// ../core/lib/use-breadcrumbs.ts
|
|
2490
|
+
var useBreadcrumbs = (renderCount) => {
|
|
2491
|
+
const selectedId = useAppStore((s) => {
|
|
2492
|
+
var _a;
|
|
2493
|
+
return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
|
|
2494
|
+
});
|
|
2495
|
+
const config = useAppStore((s) => s.config);
|
|
2496
|
+
const path = useAppStore((s) => {
|
|
2497
|
+
var _a;
|
|
2498
|
+
return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
|
|
2499
|
+
});
|
|
2500
|
+
const appStore = useAppStoreApi();
|
|
2501
|
+
return useMemo(() => {
|
|
2502
|
+
const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
|
|
2503
|
+
var _a, _b, _c;
|
|
2504
|
+
const [componentId] = zoneCompound.split(":");
|
|
2505
|
+
if (componentId === "root") {
|
|
2506
|
+
return {
|
|
2507
|
+
label: "Page",
|
|
2508
|
+
selector: null
|
|
2509
|
+
};
|
|
2510
|
+
}
|
|
2511
|
+
const node = appStore.getState().state.indexes.nodes[componentId];
|
|
2512
|
+
const parentId = node.path[node.path.length - 1];
|
|
2513
|
+
const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
|
|
2514
|
+
const index = contentIds.indexOf(componentId);
|
|
2515
|
+
const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
|
|
2516
|
+
return {
|
|
2517
|
+
label,
|
|
2518
|
+
selector: node ? {
|
|
2519
|
+
index,
|
|
2520
|
+
zone: node.path[node.path.length - 1]
|
|
2521
|
+
} : null
|
|
2522
|
+
};
|
|
2523
|
+
})) || [];
|
|
2524
|
+
if (renderCount) {
|
|
2525
|
+
return breadcrumbs.slice(breadcrumbs.length - renderCount);
|
|
2526
|
+
}
|
|
2527
|
+
return breadcrumbs;
|
|
2528
|
+
}, [path, renderCount]);
|
|
2529
|
+
};
|
|
2530
|
+
|
|
2531
|
+
// ../core/components/Loader/index.tsx
|
|
2532
|
+
init_react_import();
|
|
2533
|
+
|
|
2534
|
+
// ../core/lib/index.ts
|
|
2535
|
+
init_react_import();
|
|
2536
|
+
|
|
2537
|
+
// ../core/lib/filter.ts
|
|
2538
|
+
init_react_import();
|
|
2539
|
+
|
|
2540
|
+
// ../core/lib/data/reorder.ts
|
|
2541
|
+
init_react_import();
|
|
2542
|
+
|
|
2543
|
+
// ../core/lib/data/replace.ts
|
|
2544
|
+
init_react_import();
|
|
2545
|
+
|
|
2546
|
+
// ../core/lib/use-reset-auto-zoom.ts
|
|
2547
|
+
init_react_import();
|
|
2144
2548
|
|
|
2145
2549
|
// ../core/lib/get-zoom-config.ts
|
|
2146
2550
|
init_react_import();
|
|
2147
2551
|
|
|
2552
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
|
|
2553
|
+
init_react_import();
|
|
2554
|
+
var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
|
|
2555
|
+
|
|
2556
|
+
// ../core/components/Loader/index.tsx
|
|
2557
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
2558
|
+
var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
|
|
2559
|
+
var Loader = (_a) => {
|
|
2560
|
+
var _b = _a, {
|
|
2561
|
+
color,
|
|
2562
|
+
size = 16
|
|
2563
|
+
} = _b, props = __objRest(_b, [
|
|
2564
|
+
"color",
|
|
2565
|
+
"size"
|
|
2566
|
+
]);
|
|
2567
|
+
return /* @__PURE__ */ jsx2(
|
|
2568
|
+
"span",
|
|
2569
|
+
__spreadValues({
|
|
2570
|
+
className: getClassName2(),
|
|
2571
|
+
style: {
|
|
2572
|
+
width: size,
|
|
2573
|
+
height: size,
|
|
2574
|
+
color
|
|
2575
|
+
},
|
|
2576
|
+
"aria-label": "loading"
|
|
2577
|
+
}, props)
|
|
2578
|
+
);
|
|
2579
|
+
};
|
|
2580
|
+
|
|
2581
|
+
// ../core/components/SidebarSection/index.tsx
|
|
2582
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
2583
|
+
var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
|
|
2584
|
+
var SidebarSection = ({
|
|
2585
|
+
children,
|
|
2586
|
+
title,
|
|
2587
|
+
background,
|
|
2588
|
+
showBreadcrumbs,
|
|
2589
|
+
noBorderTop,
|
|
2590
|
+
noPadding,
|
|
2591
|
+
isLoading
|
|
2592
|
+
}) => {
|
|
2593
|
+
const setUi = useAppStore((s) => s.setUi);
|
|
2594
|
+
const breadcrumbs = useBreadcrumbs(1);
|
|
2595
|
+
return /* @__PURE__ */ jsxs(
|
|
2596
|
+
"div",
|
|
2597
|
+
{
|
|
2598
|
+
className: getClassName3({ noBorderTop, noPadding }),
|
|
2599
|
+
style: { background },
|
|
2600
|
+
children: [
|
|
2601
|
+
/* @__PURE__ */ jsx3("div", { className: getClassName3("title"), children: /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumbs"), children: [
|
|
2602
|
+
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumb"), children: [
|
|
2603
|
+
/* @__PURE__ */ jsx3(
|
|
2604
|
+
"button",
|
|
2605
|
+
{
|
|
2606
|
+
type: "button",
|
|
2607
|
+
className: getClassName3("breadcrumbLabel"),
|
|
2608
|
+
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
|
2609
|
+
children: breadcrumb.label
|
|
2610
|
+
}
|
|
2611
|
+
),
|
|
2612
|
+
/* @__PURE__ */ jsx3(ChevronRight, { size: 16 })
|
|
2613
|
+
] }, i)) : null,
|
|
2614
|
+
/* @__PURE__ */ jsx3("div", { className: getClassName3("heading"), children: /* @__PURE__ */ jsx3(Heading, { rank: "2", size: "xs", children: title }) })
|
|
2615
|
+
] }) }),
|
|
2616
|
+
/* @__PURE__ */ jsx3("div", { className: getClassName3("content"), children }),
|
|
2617
|
+
isLoading && /* @__PURE__ */ jsx3("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ jsx3(Loader, { size: 32 }) })
|
|
2618
|
+
]
|
|
2619
|
+
}
|
|
2620
|
+
);
|
|
2621
|
+
};
|
|
2622
|
+
|
|
2623
|
+
// ../core/components/OutlineList/index.tsx
|
|
2624
|
+
init_react_import();
|
|
2625
|
+
|
|
2626
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
|
2627
|
+
init_react_import();
|
|
2628
|
+
var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
|
|
2629
|
+
|
|
2630
|
+
// ../core/components/OutlineList/index.tsx
|
|
2631
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
2632
|
+
var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
|
|
2633
|
+
var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
|
|
2634
|
+
var OutlineList = ({ children }) => {
|
|
2635
|
+
return /* @__PURE__ */ jsx4("ul", { className: getClassName4(), children });
|
|
2636
|
+
};
|
|
2637
|
+
OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx4("div", { className: getClassNameItem({ clickable: true }), children });
|
|
2638
|
+
OutlineList.Item = ({
|
|
2639
|
+
children,
|
|
2640
|
+
onClick
|
|
2641
|
+
}) => {
|
|
2642
|
+
return /* @__PURE__ */ jsx4(
|
|
2643
|
+
"li",
|
|
2644
|
+
{
|
|
2645
|
+
className: getClassNameItem({ clickable: !!onClick }),
|
|
2646
|
+
onClick,
|
|
2647
|
+
children
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
};
|
|
2651
|
+
|
|
2652
|
+
// ../core/lib/scroll-into-view.ts
|
|
2653
|
+
init_react_import();
|
|
2654
|
+
var scrollIntoView = (el) => {
|
|
2655
|
+
const oldStyle = __spreadValues({}, el.style);
|
|
2656
|
+
el.style.scrollMargin = "256px";
|
|
2657
|
+
if (el) {
|
|
2658
|
+
el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
|
|
2659
|
+
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
|
2660
|
+
}
|
|
2661
|
+
};
|
|
2662
|
+
|
|
2663
|
+
// ../core/lib/get-frame.ts
|
|
2664
|
+
init_react_import();
|
|
2665
|
+
var getFrame = () => {
|
|
2666
|
+
if (typeof window === "undefined") return;
|
|
2667
|
+
let frameEl = document.querySelector("#preview-frame");
|
|
2668
|
+
if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
|
|
2669
|
+
return frameEl.contentDocument || document;
|
|
2670
|
+
}
|
|
2671
|
+
return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2148
2674
|
// src/HeadingAnalyzer.tsx
|
|
2149
2675
|
import ReactFromJSONModule from "react-from-json";
|
|
2150
|
-
import { Fragment, jsx as
|
|
2151
|
-
var
|
|
2676
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2677
|
+
var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
|
|
2152
2678
|
var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
|
|
2153
2679
|
var ReactFromJSON = ReactFromJSONModule.default || ReactFromJSONModule;
|
|
2154
2680
|
var getOutline = ({ frame } = {}) => {
|
|
@@ -2239,11 +2765,11 @@ var HeadingAnalyzer = () => {
|
|
|
2239
2765
|
frameObserver.disconnect();
|
|
2240
2766
|
};
|
|
2241
2767
|
}, [data]);
|
|
2242
|
-
return /* @__PURE__ */
|
|
2243
|
-
/* @__PURE__ */
|
|
2768
|
+
return /* @__PURE__ */ jsxs2("div", { className: getClassName5(), children: [
|
|
2769
|
+
/* @__PURE__ */ jsxs2(
|
|
2244
2770
|
"small",
|
|
2245
2771
|
{
|
|
2246
|
-
className:
|
|
2772
|
+
className: getClassName5("cssWarning"),
|
|
2247
2773
|
style: {
|
|
2248
2774
|
color: "var(--puck-color-red-04)",
|
|
2249
2775
|
display: "block",
|
|
@@ -2252,19 +2778,19 @@ var HeadingAnalyzer = () => {
|
|
|
2252
2778
|
children: [
|
|
2253
2779
|
"Heading analyzer styles not loaded. Please review the",
|
|
2254
2780
|
" ",
|
|
2255
|
-
/* @__PURE__ */
|
|
2781
|
+
/* @__PURE__ */ jsx5("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
|
|
2256
2782
|
"."
|
|
2257
2783
|
]
|
|
2258
2784
|
}
|
|
2259
2785
|
),
|
|
2260
|
-
hierarchy.length === 0 && /* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2786
|
+
hierarchy.length === 0 && /* @__PURE__ */ jsx5("div", { children: "No headings." }),
|
|
2787
|
+
/* @__PURE__ */ jsx5(OutlineList, { children: /* @__PURE__ */ jsx5(
|
|
2262
2788
|
ReactFromJSON,
|
|
2263
2789
|
{
|
|
2264
2790
|
mapping: {
|
|
2265
|
-
Root: (props) => /* @__PURE__ */
|
|
2266
|
-
OutlineListItem: (props) => /* @__PURE__ */
|
|
2267
|
-
/* @__PURE__ */
|
|
2791
|
+
Root: (props) => /* @__PURE__ */ jsx5(Fragment, { children: props.children }),
|
|
2792
|
+
OutlineListItem: (props) => /* @__PURE__ */ jsxs2(OutlineList.Item, { children: [
|
|
2793
|
+
/* @__PURE__ */ jsx5(OutlineList.Clickable, { children: /* @__PURE__ */ jsx5(
|
|
2268
2794
|
"small",
|
|
2269
2795
|
{
|
|
2270
2796
|
className: getClassNameItem2({ missing: props.missing }),
|
|
@@ -2282,14 +2808,14 @@ var HeadingAnalyzer = () => {
|
|
|
2282
2808
|
}, 2e3);
|
|
2283
2809
|
}
|
|
2284
2810
|
},
|
|
2285
|
-
children: props.missing ? /* @__PURE__ */
|
|
2286
|
-
/* @__PURE__ */
|
|
2811
|
+
children: props.missing ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
2812
|
+
/* @__PURE__ */ jsxs2("b", { children: [
|
|
2287
2813
|
"H",
|
|
2288
2814
|
props.rank
|
|
2289
2815
|
] }),
|
|
2290
2816
|
": Missing"
|
|
2291
|
-
] }) : /* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2817
|
+
] }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
2818
|
+
/* @__PURE__ */ jsxs2("b", { children: [
|
|
2293
2819
|
"H",
|
|
2294
2820
|
props.rank
|
|
2295
2821
|
] }),
|
|
@@ -2298,7 +2824,7 @@ var HeadingAnalyzer = () => {
|
|
|
2298
2824
|
] })
|
|
2299
2825
|
}
|
|
2300
2826
|
) }),
|
|
2301
|
-
/* @__PURE__ */
|
|
2827
|
+
/* @__PURE__ */ jsx5(OutlineList, { children: props.children })
|
|
2302
2828
|
] })
|
|
2303
2829
|
},
|
|
2304
2830
|
entry: {
|
|
@@ -2319,10 +2845,12 @@ var HeadingAnalyzer = () => {
|
|
|
2319
2845
|
] });
|
|
2320
2846
|
};
|
|
2321
2847
|
var headingAnalyzer = {
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2848
|
+
overrides: {
|
|
2849
|
+
fields: ({ children, itemSelector }) => /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
2850
|
+
children,
|
|
2851
|
+
/* @__PURE__ */ jsx5("div", { style: { display: itemSelector ? "none" : "block" }, children: /* @__PURE__ */ jsx5(SidebarSection, { title: "Heading Outline", children: /* @__PURE__ */ jsx5(HeadingAnalyzer, {}) }) })
|
|
2852
|
+
] })
|
|
2853
|
+
}
|
|
2326
2854
|
};
|
|
2327
2855
|
var HeadingAnalyzer_default = headingAnalyzer;
|
|
2328
2856
|
export {
|
|
@@ -2338,45 +2866,10 @@ classnames/index.js:
|
|
|
2338
2866
|
*)
|
|
2339
2867
|
|
|
2340
2868
|
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
2869
|
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
2870
|
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
2871
|
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
|
-
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
|
-
|
|
2872
|
+
lucide-react/dist/esm/icons/chevron-right.js:
|
|
2380
2873
|
lucide-react/dist/esm/lucide-react.js:
|
|
2381
2874
|
(**
|
|
2382
2875
|
* @license lucide-react v0.468.0 - ISC
|