@puckeditor/plugin-heading-analyzer 0.22.0-canary.d4985bc0 → 0.22.0-canary.d4c8bcf2
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 +23 -22
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +86 -104
- package/dist/index.mjs +86 -104
- package/package.json +3 -3
package/dist/index.css
CHANGED
|
@@ -14,16 +14,17 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css/#css-module-data */
|
|
17
|
-
.
|
|
18
|
-
|
|
17
|
+
._OutlineList_vmp09_1 {
|
|
18
|
+
--_puck-outline-list-connector: var(--puck-color-border);
|
|
19
|
+
color: var(--puck-color-text);
|
|
19
20
|
font-family: var(--puck-font-family);
|
|
20
21
|
margin: 0;
|
|
21
|
-
padding-inline-start:
|
|
22
|
+
padding-inline-start: var(--puck-space-4);
|
|
22
23
|
position: relative;
|
|
23
24
|
list-style: none;
|
|
24
25
|
}
|
|
25
|
-
.
|
|
26
|
-
background: var(--
|
|
26
|
+
._OutlineList_vmp09_1::before {
|
|
27
|
+
background: var(--_puck-outline-list-connector);
|
|
27
28
|
position: absolute;
|
|
28
29
|
left: -1px;
|
|
29
30
|
top: 0px;
|
|
@@ -31,16 +32,16 @@
|
|
|
31
32
|
height: calc(100% - 9px);
|
|
32
33
|
content: "";
|
|
33
34
|
}
|
|
34
|
-
.
|
|
35
|
+
._OutlineList_vmp09_1:dir(rtl)::before {
|
|
35
36
|
left: unset;
|
|
36
37
|
right: -1px;
|
|
37
38
|
}
|
|
38
|
-
.
|
|
39
|
+
._OutlineListItem_vmp09_27 {
|
|
39
40
|
position: relative;
|
|
40
|
-
margin-bottom:
|
|
41
|
+
margin-bottom: var(--puck-space-1);
|
|
41
42
|
}
|
|
42
|
-
.
|
|
43
|
-
background: var(--
|
|
43
|
+
._OutlineListItem_vmp09_27::before {
|
|
44
|
+
background: var(--_puck-outline-list-connector);
|
|
44
45
|
position: absolute;
|
|
45
46
|
left: -17px;
|
|
46
47
|
top: 9px;
|
|
@@ -48,28 +49,28 @@
|
|
|
48
49
|
height: 1px;
|
|
49
50
|
content: "";
|
|
50
51
|
}
|
|
51
|
-
.
|
|
52
|
+
._OutlineListItem_vmp09_27:dir(rtl)::before {
|
|
52
53
|
left: unset;
|
|
53
54
|
right: -17px;
|
|
54
55
|
}
|
|
55
|
-
._OutlineListItem--
|
|
56
|
+
._OutlineListItem--clickable_vmp09_47 {
|
|
56
57
|
cursor: pointer;
|
|
57
|
-
transition: color
|
|
58
|
+
transition: color var(--puck-duration-fast) var(--puck-ease-exit);
|
|
58
59
|
}
|
|
59
|
-
._OutlineListItem--
|
|
60
|
-
outline:
|
|
61
|
-
outline-offset:
|
|
60
|
+
._OutlineListItem--clickable_vmp09_47:focus-visible {
|
|
61
|
+
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
62
|
+
outline-offset: var(--puck-border-width-focus);
|
|
62
63
|
}
|
|
63
64
|
@media (hover: hover) and (pointer: fine) {
|
|
64
|
-
._OutlineListItem--
|
|
65
|
-
color: var(--puck-color-
|
|
65
|
+
._OutlineListItem--clickable_vmp09_47:hover {
|
|
66
|
+
color: var(--puck-color-interactive);
|
|
66
67
|
transition: none;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
._OutlineListItem--
|
|
70
|
-
color: var(--puck-color-
|
|
70
|
+
._OutlineListItem--clickable_vmp09_47:active {
|
|
71
|
+
color: var(--puck-color-interactive-hover);
|
|
71
72
|
transition: none;
|
|
72
73
|
}
|
|
73
|
-
.
|
|
74
|
-
margin:
|
|
74
|
+
._OutlineListItem_vmp09_27 > ._OutlineList_vmp09_1 {
|
|
75
|
+
margin: var(--puck-space-2) 0;
|
|
75
76
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
|
|
|
308
308
|
name: string;
|
|
309
309
|
id: string;
|
|
310
310
|
value: Value;
|
|
311
|
-
onChange: (value: Value) => void;
|
|
311
|
+
onChange: (value: Value, uiState?: Partial<UiState>) => void;
|
|
312
312
|
readOnly?: boolean;
|
|
313
313
|
}) => ReactElement;
|
|
314
314
|
interface CustomField<Value extends any> extends BaseField {
|
|
@@ -428,6 +428,7 @@ UserField extends BaseField = {}> = {
|
|
|
428
428
|
metadata: ComponentMetadata;
|
|
429
429
|
trigger: ResolveDataTrigger;
|
|
430
430
|
parent: ComponentData | null;
|
|
431
|
+
root: RootData;
|
|
431
432
|
}) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
|
|
432
433
|
resolvePermissions?: (data: DataShape, params: {
|
|
433
434
|
changed: Partial<Record<keyof FieldProps, boolean> & {
|
package/dist/index.d.ts
CHANGED
|
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
|
|
|
308
308
|
name: string;
|
|
309
309
|
id: string;
|
|
310
310
|
value: Value;
|
|
311
|
-
onChange: (value: Value) => void;
|
|
311
|
+
onChange: (value: Value, uiState?: Partial<UiState>) => void;
|
|
312
312
|
readOnly?: boolean;
|
|
313
313
|
}) => ReactElement;
|
|
314
314
|
interface CustomField<Value extends any> extends BaseField {
|
|
@@ -428,6 +428,7 @@ UserField extends BaseField = {}> = {
|
|
|
428
428
|
metadata: ComponentMetadata;
|
|
429
429
|
trigger: ResolveDataTrigger;
|
|
430
430
|
parent: ComponentData | null;
|
|
431
|
+
root: RootData;
|
|
431
432
|
}) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
|
|
432
433
|
resolvePermissions?: (data: DataShape, params: {
|
|
433
434
|
changed: Partial<Record<keyof FieldProps, boolean> & {
|
package/dist/index.js
CHANGED
|
@@ -291,7 +291,7 @@ init_react_import();
|
|
|
291
291
|
|
|
292
292
|
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
|
293
293
|
init_react_import();
|
|
294
|
-
var styles_module_default = { "OutlineList": "
|
|
294
|
+
var styles_module_default = { "OutlineList": "_OutlineList_vmp09_1", "OutlineListItem": "_OutlineListItem_vmp09_27", "OutlineListItem--clickable": "_OutlineListItem--clickable_vmp09_47" };
|
|
295
295
|
|
|
296
296
|
// ../core/lib/get-class-name-factory.ts
|
|
297
297
|
init_react_import();
|
|
@@ -550,20 +550,10 @@ var walkField = ({
|
|
|
550
550
|
if (map && fieldType === "slot") {
|
|
551
551
|
const content = value || [];
|
|
552
552
|
const mappedContent = recurseSlots ? content.map((el) => {
|
|
553
|
-
|
|
554
|
-
const componentConfig = config.components[el.type];
|
|
555
|
-
if (!componentConfig) {
|
|
553
|
+
if (!config.components[el.type]) {
|
|
556
554
|
throw new Error(`Could not find component config for ${el.type}`);
|
|
557
555
|
}
|
|
558
|
-
|
|
559
|
-
return walkField({
|
|
560
|
-
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
|
561
|
-
fields: fields2,
|
|
562
|
-
mappers,
|
|
563
|
-
id: el.props.id,
|
|
564
|
-
config,
|
|
565
|
-
recurseSlots
|
|
566
|
-
});
|
|
556
|
+
return mapFields(el, mappers, config, recurseSlots);
|
|
567
557
|
}) : content;
|
|
568
558
|
if (containsPromise(mappedContent)) {
|
|
569
559
|
return Promise.all(mappedContent);
|
|
@@ -715,6 +705,15 @@ var flattenNode = (node, config) => {
|
|
|
715
705
|
});
|
|
716
706
|
};
|
|
717
707
|
|
|
708
|
+
// ../core/lib/data/to-component.ts
|
|
709
|
+
init_react_import();
|
|
710
|
+
var toComponent = (item) => {
|
|
711
|
+
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
712
|
+
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
713
|
+
type: "root"
|
|
714
|
+
});
|
|
715
|
+
};
|
|
716
|
+
|
|
718
717
|
// ../core/lib/data/walk-app-state.ts
|
|
719
718
|
function walkAppState(state, config, mapContent = (content) => content, mapNodeOrSkip = (item) => item) {
|
|
720
719
|
var _a;
|
|
@@ -778,7 +777,7 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
778
777
|
id
|
|
779
778
|
});
|
|
780
779
|
processRelatedZones(item, id, path);
|
|
781
|
-
const newItem = __spreadProps(__spreadValues({},
|
|
780
|
+
const newItem = __spreadProps(__spreadValues({}, mappedItem), { props: newProps });
|
|
782
781
|
const thisZoneCompound = path[path.length - 1];
|
|
783
782
|
const [parentId, zone] = thisZoneCompound ? thisZoneCompound.split(":") : [null, ""];
|
|
784
783
|
newNodeIndex[id] = {
|
|
@@ -818,17 +817,14 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
818
817
|
);
|
|
819
818
|
newZones[zoneCompound] = newContent2;
|
|
820
819
|
}, newZones);
|
|
821
|
-
|
|
822
|
-
{
|
|
823
|
-
type: "root",
|
|
824
|
-
props: __spreadProps(__spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root), { id: "root" })
|
|
825
|
-
},
|
|
826
|
-
[],
|
|
827
|
-
-1
|
|
828
|
-
);
|
|
829
|
-
const root = __spreadProps(__spreadValues({}, state.data.root), {
|
|
830
|
-
props: processedRoot.props
|
|
820
|
+
let rootAsComponent = toComponent({
|
|
821
|
+
props: __spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root)
|
|
831
822
|
});
|
|
823
|
+
if (state.data.root.readOnly) {
|
|
824
|
+
rootAsComponent.readOnly = state.data.root.readOnly;
|
|
825
|
+
}
|
|
826
|
+
const processedRoot = processItem(rootAsComponent, [], -1);
|
|
827
|
+
const root = __spreadValues(__spreadValues({}, state.data.root), processedRoot);
|
|
832
828
|
return __spreadProps(__spreadValues({}, state), {
|
|
833
829
|
data: {
|
|
834
830
|
root,
|
|
@@ -871,53 +867,49 @@ var insert = (list, index, item) => {
|
|
|
871
867
|
// ../core/lib/generate-id.ts
|
|
872
868
|
init_react_import();
|
|
873
869
|
|
|
874
|
-
// ../core/
|
|
870
|
+
// ../core/lib/uuid/index.ts
|
|
875
871
|
init_react_import();
|
|
876
872
|
|
|
877
|
-
// ../core/
|
|
873
|
+
// ../core/lib/uuid/rng.ts
|
|
878
874
|
init_react_import();
|
|
879
|
-
var
|
|
880
|
-
var rnds8Pool = new Uint8Array(256);
|
|
881
|
-
var poolPtr = rnds8Pool.length;
|
|
875
|
+
var rnds8 = new Uint8Array(16);
|
|
882
876
|
function rng() {
|
|
883
|
-
|
|
884
|
-
import_crypto.default.randomFillSync(rnds8Pool);
|
|
885
|
-
poolPtr = 0;
|
|
886
|
-
}
|
|
887
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
877
|
+
return crypto.getRandomValues(rnds8);
|
|
888
878
|
}
|
|
889
879
|
|
|
890
|
-
// ../core/
|
|
880
|
+
// ../core/lib/uuid/stringify.ts
|
|
891
881
|
init_react_import();
|
|
892
882
|
var byteToHex = [];
|
|
893
883
|
for (let i = 0; i < 256; ++i) {
|
|
894
884
|
byteToHex.push((i + 256).toString(16).slice(1));
|
|
895
885
|
}
|
|
896
886
|
function unsafeStringify(arr, offset = 0) {
|
|
897
|
-
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]];
|
|
887
|
+
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]]).toLowerCase();
|
|
898
888
|
}
|
|
899
889
|
|
|
900
|
-
// ../core/
|
|
901
|
-
init_react_import();
|
|
902
|
-
|
|
903
|
-
// ../core/node_modules/uuid/dist/esm-node/native.js
|
|
904
|
-
init_react_import();
|
|
905
|
-
var import_crypto2 = __toESM(require("crypto"));
|
|
906
|
-
var native_default = {
|
|
907
|
-
randomUUID: import_crypto2.default.randomUUID
|
|
908
|
-
};
|
|
909
|
-
|
|
910
|
-
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
890
|
+
// ../core/lib/uuid/index.ts
|
|
911
891
|
function v4(options, buf, offset) {
|
|
912
|
-
if (
|
|
913
|
-
return
|
|
892
|
+
if (!buf && !options && crypto.randomUUID) {
|
|
893
|
+
return crypto.randomUUID();
|
|
914
894
|
}
|
|
895
|
+
return _v4(options, buf, offset);
|
|
896
|
+
}
|
|
897
|
+
function _v4(options, buf, offset) {
|
|
898
|
+
var _a, _b, _c;
|
|
915
899
|
options = options || {};
|
|
916
|
-
const rnds = options.random
|
|
900
|
+
const rnds = (_c = (_b = options.random) != null ? _b : (_a = options.rng) == null ? void 0 : _a.call(options)) != null ? _c : rng();
|
|
901
|
+
if (rnds.length < 16) {
|
|
902
|
+
throw new Error("Random bytes length must be >= 16");
|
|
903
|
+
}
|
|
917
904
|
rnds[6] = rnds[6] & 15 | 64;
|
|
918
905
|
rnds[8] = rnds[8] & 63 | 128;
|
|
919
906
|
if (buf) {
|
|
920
907
|
offset = offset || 0;
|
|
908
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
909
|
+
throw new RangeError(
|
|
910
|
+
`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`
|
|
911
|
+
);
|
|
912
|
+
}
|
|
921
913
|
for (let i = 0; i < 16; ++i) {
|
|
922
914
|
buf[offset + i] = rnds[i];
|
|
923
915
|
}
|
|
@@ -925,10 +917,10 @@ function v4(options, buf, offset) {
|
|
|
925
917
|
}
|
|
926
918
|
return unsafeStringify(rnds);
|
|
927
919
|
}
|
|
928
|
-
var
|
|
920
|
+
var uuid_default = v4;
|
|
929
921
|
|
|
930
922
|
// ../core/lib/generate-id.ts
|
|
931
|
-
var generateId = (type) => type ? `${type}-${
|
|
923
|
+
var generateId = (type) => type ? `${type}-${uuid_default()}` : uuid_default();
|
|
932
924
|
|
|
933
925
|
// ../core/lib/data/get-ids-for-parent.ts
|
|
934
926
|
init_react_import();
|
|
@@ -1657,44 +1649,39 @@ var createHistorySlice = (set, get) => {
|
|
|
1657
1649
|
|
|
1658
1650
|
// ../core/store/slices/nodes.ts
|
|
1659
1651
|
init_react_import();
|
|
1660
|
-
var createNodesSlice = (
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
})
|
|
1680
|
-
})
|
|
1681
|
-
})
|
|
1682
|
-
});
|
|
1683
|
-
},
|
|
1684
|
-
unregisterNode: (id) => {
|
|
1685
|
-
const s = get().nodes;
|
|
1686
|
-
const existingNode = s.nodes[id];
|
|
1687
|
-
if (existingNode) {
|
|
1688
|
-
const newNodes = __spreadValues({}, s.nodes);
|
|
1689
|
-
delete newNodes[id];
|
|
1690
|
-
set({
|
|
1691
|
-
nodes: __spreadProps(__spreadValues({}, s), {
|
|
1692
|
-
nodes: newNodes
|
|
1693
|
-
})
|
|
1652
|
+
var createNodesSlice = (_set, _get) => {
|
|
1653
|
+
const registry = /* @__PURE__ */ new Map();
|
|
1654
|
+
return {
|
|
1655
|
+
registerNode: (id, handle) => {
|
|
1656
|
+
registry.set(id, handle);
|
|
1657
|
+
},
|
|
1658
|
+
unregisterNode: (id) => {
|
|
1659
|
+
registry.delete(id);
|
|
1660
|
+
},
|
|
1661
|
+
syncNode: (id) => {
|
|
1662
|
+
var _a;
|
|
1663
|
+
if (!id) return;
|
|
1664
|
+
(_a = registry.get(id)) == null ? void 0 : _a.sync();
|
|
1665
|
+
},
|
|
1666
|
+
syncNodes: (ids) => {
|
|
1667
|
+
ids.forEach((id) => {
|
|
1668
|
+
var _a;
|
|
1669
|
+
if (!id) return;
|
|
1670
|
+
(_a = registry.get(id)) == null ? void 0 : _a.sync();
|
|
1694
1671
|
});
|
|
1672
|
+
},
|
|
1673
|
+
setOverlayVisible: (id, visible) => {
|
|
1674
|
+
if (!id) return;
|
|
1675
|
+
const node = registry.get(id);
|
|
1676
|
+
if (!node) return;
|
|
1677
|
+
if (visible) {
|
|
1678
|
+
node.showOverlay();
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
node.hideOverlay();
|
|
1695
1682
|
}
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1683
|
+
};
|
|
1684
|
+
};
|
|
1698
1685
|
|
|
1699
1686
|
// ../core/store/slices/permissions.ts
|
|
1700
1687
|
init_react_import();
|
|
@@ -2270,19 +2257,8 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
2270
2257
|
|
|
2271
2258
|
// ../core/lib/resolve-component-data.ts
|
|
2272
2259
|
init_react_import();
|
|
2273
|
-
|
|
2274
|
-
// ../core/lib/data/to-component.ts
|
|
2275
|
-
init_react_import();
|
|
2276
|
-
var toComponent = (item) => {
|
|
2277
|
-
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
2278
|
-
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
2279
|
-
type: "root"
|
|
2280
|
-
});
|
|
2281
|
-
};
|
|
2282
|
-
|
|
2283
|
-
// ../core/lib/resolve-component-data.ts
|
|
2284
2260
|
var cache = { lastChange: {} };
|
|
2285
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null) {
|
|
2261
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null, root = { props: {} }) {
|
|
2286
2262
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
2287
2263
|
const resolvedItem = __spreadValues({}, item);
|
|
2288
2264
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -2309,7 +2285,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
2309
2285
|
lastData: oldItem,
|
|
2310
2286
|
metadata: __spreadValues(__spreadValues({}, metadata), configForItem.metadata),
|
|
2311
2287
|
trigger,
|
|
2312
|
-
parent
|
|
2288
|
+
parent,
|
|
2289
|
+
root
|
|
2313
2290
|
});
|
|
2314
2291
|
resolvedItem.props = __spreadValues(__spreadValues({}, item.props), resolvedProps);
|
|
2315
2292
|
if (Object.keys(readOnly).length) {
|
|
@@ -2332,7 +2309,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
2332
2309
|
onResolveStart,
|
|
2333
2310
|
onResolveEnd,
|
|
2334
2311
|
trigger,
|
|
2335
|
-
itemAsComponentData
|
|
2312
|
+
itemAsComponentData,
|
|
2313
|
+
root
|
|
2336
2314
|
)).node;
|
|
2337
2315
|
})
|
|
2338
2316
|
)
|
|
@@ -2423,6 +2401,8 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2423
2401
|
},
|
|
2424
2402
|
status: "LOADING",
|
|
2425
2403
|
iframe: {},
|
|
2404
|
+
_experimentalFullScreenCanvas: false,
|
|
2405
|
+
_experimentalVirtualization: false,
|
|
2426
2406
|
metadata: {},
|
|
2427
2407
|
fieldTransforms: {}
|
|
2428
2408
|
}, initialAppStore), {
|
|
@@ -2549,7 +2529,8 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2549
2529
|
timeouts[id]();
|
|
2550
2530
|
}),
|
|
2551
2531
|
trigger,
|
|
2552
|
-
parentData
|
|
2532
|
+
parentData,
|
|
2533
|
+
state.data.root
|
|
2553
2534
|
);
|
|
2554
2535
|
}),
|
|
2555
2536
|
resolveAndCommitData: () => __async(null, null, function* () {
|
|
@@ -2558,7 +2539,8 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2558
2539
|
state,
|
|
2559
2540
|
config,
|
|
2560
2541
|
(content) => content,
|
|
2561
|
-
(childItem) => {
|
|
2542
|
+
(childItem, path) => {
|
|
2543
|
+
if (path.length > 1) return childItem;
|
|
2562
2544
|
resolveComponentData2(childItem, "load").then((resolved) => {
|
|
2563
2545
|
const { state: state2 } = get();
|
|
2564
2546
|
const node = state2.indexes.nodes[resolved.node.props.id];
|
package/dist/index.mjs
CHANGED
|
@@ -279,7 +279,7 @@ init_react_import();
|
|
|
279
279
|
|
|
280
280
|
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
|
281
281
|
init_react_import();
|
|
282
|
-
var styles_module_default = { "OutlineList": "
|
|
282
|
+
var styles_module_default = { "OutlineList": "_OutlineList_vmp09_1", "OutlineListItem": "_OutlineListItem_vmp09_27", "OutlineListItem--clickable": "_OutlineListItem--clickable_vmp09_47" };
|
|
283
283
|
|
|
284
284
|
// ../core/lib/get-class-name-factory.ts
|
|
285
285
|
init_react_import();
|
|
@@ -538,20 +538,10 @@ var walkField = ({
|
|
|
538
538
|
if (map && fieldType === "slot") {
|
|
539
539
|
const content = value || [];
|
|
540
540
|
const mappedContent = recurseSlots ? content.map((el) => {
|
|
541
|
-
|
|
542
|
-
const componentConfig = config.components[el.type];
|
|
543
|
-
if (!componentConfig) {
|
|
541
|
+
if (!config.components[el.type]) {
|
|
544
542
|
throw new Error(`Could not find component config for ${el.type}`);
|
|
545
543
|
}
|
|
546
|
-
|
|
547
|
-
return walkField({
|
|
548
|
-
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
|
549
|
-
fields: fields2,
|
|
550
|
-
mappers,
|
|
551
|
-
id: el.props.id,
|
|
552
|
-
config,
|
|
553
|
-
recurseSlots
|
|
554
|
-
});
|
|
544
|
+
return mapFields(el, mappers, config, recurseSlots);
|
|
555
545
|
}) : content;
|
|
556
546
|
if (containsPromise(mappedContent)) {
|
|
557
547
|
return Promise.all(mappedContent);
|
|
@@ -703,6 +693,15 @@ var flattenNode = (node, config) => {
|
|
|
703
693
|
});
|
|
704
694
|
};
|
|
705
695
|
|
|
696
|
+
// ../core/lib/data/to-component.ts
|
|
697
|
+
init_react_import();
|
|
698
|
+
var toComponent = (item) => {
|
|
699
|
+
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
700
|
+
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
701
|
+
type: "root"
|
|
702
|
+
});
|
|
703
|
+
};
|
|
704
|
+
|
|
706
705
|
// ../core/lib/data/walk-app-state.ts
|
|
707
706
|
function walkAppState(state, config, mapContent = (content) => content, mapNodeOrSkip = (item) => item) {
|
|
708
707
|
var _a;
|
|
@@ -766,7 +765,7 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
766
765
|
id
|
|
767
766
|
});
|
|
768
767
|
processRelatedZones(item, id, path);
|
|
769
|
-
const newItem = __spreadProps(__spreadValues({},
|
|
768
|
+
const newItem = __spreadProps(__spreadValues({}, mappedItem), { props: newProps });
|
|
770
769
|
const thisZoneCompound = path[path.length - 1];
|
|
771
770
|
const [parentId, zone] = thisZoneCompound ? thisZoneCompound.split(":") : [null, ""];
|
|
772
771
|
newNodeIndex[id] = {
|
|
@@ -806,17 +805,14 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
806
805
|
);
|
|
807
806
|
newZones[zoneCompound] = newContent2;
|
|
808
807
|
}, newZones);
|
|
809
|
-
|
|
810
|
-
{
|
|
811
|
-
type: "root",
|
|
812
|
-
props: __spreadProps(__spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root), { id: "root" })
|
|
813
|
-
},
|
|
814
|
-
[],
|
|
815
|
-
-1
|
|
816
|
-
);
|
|
817
|
-
const root = __spreadProps(__spreadValues({}, state.data.root), {
|
|
818
|
-
props: processedRoot.props
|
|
808
|
+
let rootAsComponent = toComponent({
|
|
809
|
+
props: __spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root)
|
|
819
810
|
});
|
|
811
|
+
if (state.data.root.readOnly) {
|
|
812
|
+
rootAsComponent.readOnly = state.data.root.readOnly;
|
|
813
|
+
}
|
|
814
|
+
const processedRoot = processItem(rootAsComponent, [], -1);
|
|
815
|
+
const root = __spreadValues(__spreadValues({}, state.data.root), processedRoot);
|
|
820
816
|
return __spreadProps(__spreadValues({}, state), {
|
|
821
817
|
data: {
|
|
822
818
|
root,
|
|
@@ -859,53 +855,49 @@ var insert = (list, index, item) => {
|
|
|
859
855
|
// ../core/lib/generate-id.ts
|
|
860
856
|
init_react_import();
|
|
861
857
|
|
|
862
|
-
// ../core/
|
|
858
|
+
// ../core/lib/uuid/index.ts
|
|
863
859
|
init_react_import();
|
|
864
860
|
|
|
865
|
-
// ../core/
|
|
861
|
+
// ../core/lib/uuid/rng.ts
|
|
866
862
|
init_react_import();
|
|
867
|
-
|
|
868
|
-
var rnds8Pool = new Uint8Array(256);
|
|
869
|
-
var poolPtr = rnds8Pool.length;
|
|
863
|
+
var rnds8 = new Uint8Array(16);
|
|
870
864
|
function rng() {
|
|
871
|
-
|
|
872
|
-
crypto.randomFillSync(rnds8Pool);
|
|
873
|
-
poolPtr = 0;
|
|
874
|
-
}
|
|
875
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
865
|
+
return crypto.getRandomValues(rnds8);
|
|
876
866
|
}
|
|
877
867
|
|
|
878
|
-
// ../core/
|
|
868
|
+
// ../core/lib/uuid/stringify.ts
|
|
879
869
|
init_react_import();
|
|
880
870
|
var byteToHex = [];
|
|
881
871
|
for (let i = 0; i < 256; ++i) {
|
|
882
872
|
byteToHex.push((i + 256).toString(16).slice(1));
|
|
883
873
|
}
|
|
884
874
|
function unsafeStringify(arr, offset = 0) {
|
|
885
|
-
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]];
|
|
875
|
+
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]]).toLowerCase();
|
|
886
876
|
}
|
|
887
877
|
|
|
888
|
-
// ../core/
|
|
889
|
-
init_react_import();
|
|
890
|
-
|
|
891
|
-
// ../core/node_modules/uuid/dist/esm-node/native.js
|
|
892
|
-
init_react_import();
|
|
893
|
-
import crypto2 from "crypto";
|
|
894
|
-
var native_default = {
|
|
895
|
-
randomUUID: crypto2.randomUUID
|
|
896
|
-
};
|
|
897
|
-
|
|
898
|
-
// ../core/node_modules/uuid/dist/esm-node/v4.js
|
|
878
|
+
// ../core/lib/uuid/index.ts
|
|
899
879
|
function v4(options, buf, offset) {
|
|
900
|
-
if (
|
|
901
|
-
return
|
|
880
|
+
if (!buf && !options && crypto.randomUUID) {
|
|
881
|
+
return crypto.randomUUID();
|
|
902
882
|
}
|
|
883
|
+
return _v4(options, buf, offset);
|
|
884
|
+
}
|
|
885
|
+
function _v4(options, buf, offset) {
|
|
886
|
+
var _a, _b, _c;
|
|
903
887
|
options = options || {};
|
|
904
|
-
const rnds = options.random
|
|
888
|
+
const rnds = (_c = (_b = options.random) != null ? _b : (_a = options.rng) == null ? void 0 : _a.call(options)) != null ? _c : rng();
|
|
889
|
+
if (rnds.length < 16) {
|
|
890
|
+
throw new Error("Random bytes length must be >= 16");
|
|
891
|
+
}
|
|
905
892
|
rnds[6] = rnds[6] & 15 | 64;
|
|
906
893
|
rnds[8] = rnds[8] & 63 | 128;
|
|
907
894
|
if (buf) {
|
|
908
895
|
offset = offset || 0;
|
|
896
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
897
|
+
throw new RangeError(
|
|
898
|
+
`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`
|
|
899
|
+
);
|
|
900
|
+
}
|
|
909
901
|
for (let i = 0; i < 16; ++i) {
|
|
910
902
|
buf[offset + i] = rnds[i];
|
|
911
903
|
}
|
|
@@ -913,10 +905,10 @@ function v4(options, buf, offset) {
|
|
|
913
905
|
}
|
|
914
906
|
return unsafeStringify(rnds);
|
|
915
907
|
}
|
|
916
|
-
var
|
|
908
|
+
var uuid_default = v4;
|
|
917
909
|
|
|
918
910
|
// ../core/lib/generate-id.ts
|
|
919
|
-
var generateId = (type) => type ? `${type}-${
|
|
911
|
+
var generateId = (type) => type ? `${type}-${uuid_default()}` : uuid_default();
|
|
920
912
|
|
|
921
913
|
// ../core/lib/data/get-ids-for-parent.ts
|
|
922
914
|
init_react_import();
|
|
@@ -1645,44 +1637,39 @@ var createHistorySlice = (set, get) => {
|
|
|
1645
1637
|
|
|
1646
1638
|
// ../core/store/slices/nodes.ts
|
|
1647
1639
|
init_react_import();
|
|
1648
|
-
var createNodesSlice = (
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
})
|
|
1668
|
-
})
|
|
1669
|
-
})
|
|
1670
|
-
});
|
|
1671
|
-
},
|
|
1672
|
-
unregisterNode: (id) => {
|
|
1673
|
-
const s = get().nodes;
|
|
1674
|
-
const existingNode = s.nodes[id];
|
|
1675
|
-
if (existingNode) {
|
|
1676
|
-
const newNodes = __spreadValues({}, s.nodes);
|
|
1677
|
-
delete newNodes[id];
|
|
1678
|
-
set({
|
|
1679
|
-
nodes: __spreadProps(__spreadValues({}, s), {
|
|
1680
|
-
nodes: newNodes
|
|
1681
|
-
})
|
|
1640
|
+
var createNodesSlice = (_set, _get) => {
|
|
1641
|
+
const registry = /* @__PURE__ */ new Map();
|
|
1642
|
+
return {
|
|
1643
|
+
registerNode: (id, handle) => {
|
|
1644
|
+
registry.set(id, handle);
|
|
1645
|
+
},
|
|
1646
|
+
unregisterNode: (id) => {
|
|
1647
|
+
registry.delete(id);
|
|
1648
|
+
},
|
|
1649
|
+
syncNode: (id) => {
|
|
1650
|
+
var _a;
|
|
1651
|
+
if (!id) return;
|
|
1652
|
+
(_a = registry.get(id)) == null ? void 0 : _a.sync();
|
|
1653
|
+
},
|
|
1654
|
+
syncNodes: (ids) => {
|
|
1655
|
+
ids.forEach((id) => {
|
|
1656
|
+
var _a;
|
|
1657
|
+
if (!id) return;
|
|
1658
|
+
(_a = registry.get(id)) == null ? void 0 : _a.sync();
|
|
1682
1659
|
});
|
|
1660
|
+
},
|
|
1661
|
+
setOverlayVisible: (id, visible) => {
|
|
1662
|
+
if (!id) return;
|
|
1663
|
+
const node = registry.get(id);
|
|
1664
|
+
if (!node) return;
|
|
1665
|
+
if (visible) {
|
|
1666
|
+
node.showOverlay();
|
|
1667
|
+
return;
|
|
1668
|
+
}
|
|
1669
|
+
node.hideOverlay();
|
|
1683
1670
|
}
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1671
|
+
};
|
|
1672
|
+
};
|
|
1686
1673
|
|
|
1687
1674
|
// ../core/store/slices/permissions.ts
|
|
1688
1675
|
init_react_import();
|
|
@@ -2258,19 +2245,8 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
2258
2245
|
|
|
2259
2246
|
// ../core/lib/resolve-component-data.ts
|
|
2260
2247
|
init_react_import();
|
|
2261
|
-
|
|
2262
|
-
// ../core/lib/data/to-component.ts
|
|
2263
|
-
init_react_import();
|
|
2264
|
-
var toComponent = (item) => {
|
|
2265
|
-
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
2266
|
-
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
2267
|
-
type: "root"
|
|
2268
|
-
});
|
|
2269
|
-
};
|
|
2270
|
-
|
|
2271
|
-
// ../core/lib/resolve-component-data.ts
|
|
2272
2248
|
var cache = { lastChange: {} };
|
|
2273
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null) {
|
|
2249
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null, root = { props: {} }) {
|
|
2274
2250
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
2275
2251
|
const resolvedItem = __spreadValues({}, item);
|
|
2276
2252
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -2297,7 +2273,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
2297
2273
|
lastData: oldItem,
|
|
2298
2274
|
metadata: __spreadValues(__spreadValues({}, metadata), configForItem.metadata),
|
|
2299
2275
|
trigger,
|
|
2300
|
-
parent
|
|
2276
|
+
parent,
|
|
2277
|
+
root
|
|
2301
2278
|
});
|
|
2302
2279
|
resolvedItem.props = __spreadValues(__spreadValues({}, item.props), resolvedProps);
|
|
2303
2280
|
if (Object.keys(readOnly).length) {
|
|
@@ -2320,7 +2297,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
2320
2297
|
onResolveStart,
|
|
2321
2298
|
onResolveEnd,
|
|
2322
2299
|
trigger,
|
|
2323
|
-
itemAsComponentData
|
|
2300
|
+
itemAsComponentData,
|
|
2301
|
+
root
|
|
2324
2302
|
)).node;
|
|
2325
2303
|
})
|
|
2326
2304
|
)
|
|
@@ -2411,6 +2389,8 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2411
2389
|
},
|
|
2412
2390
|
status: "LOADING",
|
|
2413
2391
|
iframe: {},
|
|
2392
|
+
_experimentalFullScreenCanvas: false,
|
|
2393
|
+
_experimentalVirtualization: false,
|
|
2414
2394
|
metadata: {},
|
|
2415
2395
|
fieldTransforms: {}
|
|
2416
2396
|
}, initialAppStore), {
|
|
@@ -2537,7 +2517,8 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2537
2517
|
timeouts[id]();
|
|
2538
2518
|
}),
|
|
2539
2519
|
trigger,
|
|
2540
|
-
parentData
|
|
2520
|
+
parentData,
|
|
2521
|
+
state.data.root
|
|
2541
2522
|
);
|
|
2542
2523
|
}),
|
|
2543
2524
|
resolveAndCommitData: () => __async(null, null, function* () {
|
|
@@ -2546,7 +2527,8 @@ var createAppStore = (initialAppStore) => create()(
|
|
|
2546
2527
|
state,
|
|
2547
2528
|
config,
|
|
2548
2529
|
(content) => content,
|
|
2549
|
-
(childItem) => {
|
|
2530
|
+
(childItem, path) => {
|
|
2531
|
+
if (path.length > 1) return childItem;
|
|
2550
2532
|
resolveComponentData2(childItem, "load").then((resolved) => {
|
|
2551
2533
|
const { state: state2 } = get();
|
|
2552
2534
|
const node = state2.indexes.nodes[resolved.node.props.id];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/plugin-heading-analyzer",
|
|
3
|
-
"version": "0.22.0-canary.
|
|
3
|
+
"version": "0.22.0-canary.d4c8bcf2",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": "puckeditor/puck",
|
|
6
6
|
"bugs": "https://github.com/puckeditor/puck/issues",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@puckeditor/core": "^0.22.0-canary.
|
|
28
|
+
"@puckeditor/core": "^0.22.0-canary.d4c8bcf2",
|
|
29
29
|
"@types/minimatch": "3.0.5",
|
|
30
30
|
"@types/react": "^19.0.1",
|
|
31
31
|
"@types/react-dom": "^19.0.2",
|
|
32
|
-
"eslint": "^
|
|
32
|
+
"eslint": "^9.0.0",
|
|
33
33
|
"eslint-config-custom": "*",
|
|
34
34
|
"tsconfig": "*",
|
|
35
35
|
"tsup": "^8.2.4",
|