@puckeditor/core 0.22.4 → 0.23.0-canary.026f0300
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/{Editor-ZZW3KF2T.css → Editor-T7TKW6NT.css} +7 -7
- package/dist/{Editor-MLHOIEVM.mjs → Editor-Z6P5UAVB.mjs} +8 -8
- package/dist/{actions-Csn3gOP8.d.mts → actions-3w-1VzY_.d.mts} +7 -1
- package/dist/{actions-Csn3gOP8.d.ts → actions-3w-1VzY_.d.ts} +7 -1
- package/dist/{chunk-25O24MZR.mjs → chunk-3OLRWMRO.mjs} +37 -22
- package/dist/{chunk-JNJJ2M57.mjs → chunk-3TERNOIP.mjs} +1 -1
- package/dist/{chunk-KJQTOPIV.mjs → chunk-DIYX54ZO.mjs} +136 -7
- package/dist/{chunk-4I2WN43X.mjs → chunk-L73ATZ55.mjs} +15 -8
- package/dist/{chunk-WUO7D6OQ.mjs → chunk-NPAYGEG5.mjs} +1 -0
- package/dist/{chunk-C2H4WQP2.mjs → chunk-OCFR2FFG.mjs} +27 -12
- package/dist/{chunk-NKDMBWQC.mjs → chunk-OSPG5CWL.mjs} +21 -10
- package/dist/{chunk-PRZEIT36.mjs → chunk-PJYHZPJK.mjs} +3 -3
- package/dist/{chunk-WH6PO5ND.mjs → chunk-S3CSGIQ3.mjs} +2047 -797
- package/dist/{chunk-25QAPMLH.mjs → chunk-UAWUZ45G.mjs} +41 -18
- package/dist/{full-YXSOFDYM.mjs → full-67VCA5MX.mjs} +7 -7
- package/dist/{full-S3QQ2IBQ.css → full-AAZK6KLI.css} +7 -7
- package/dist/index-KWLAZybR.d.ts +206 -0
- package/dist/index-l1l-a8tj.d.mts +206 -0
- package/dist/index.css +308 -111
- package/dist/index.d.mts +24 -11
- package/dist/index.d.ts +24 -11
- package/dist/index.js +2352 -809
- package/dist/index.mjs +10 -10
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +40 -18
- package/dist/internal.mjs +1 -1
- package/dist/{loaded-LMF4JLYG.mjs → loaded-4XVG2RKQ.mjs} +4 -4
- package/dist/{loaded-FVWRAJR3.css → loaded-CA3Q7UHH.css} +7 -7
- package/dist/{loaded-IFFZACEG.mjs → loaded-LM723CWI.mjs} +4 -4
- package/dist/{loaded-SJJPEREQ.mjs → loaded-VBJBTUSI.mjs} +4 -4
- package/dist/no-external.css +308 -111
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +2352 -809
- package/dist/no-external.mjs +10 -10
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +1 -0
- package/dist/rsc.mjs +2 -2
- package/dist/{walk-tree-CWrsBHHe.d.ts → walk-tree-ConR82Y6.d.ts} +1 -1
- package/dist/{walk-tree-BrW9VQ_t.d.mts → walk-tree-DJMo6GTF.d.mts} +1 -1
- package/package.json +1 -1
- package/dist/index-B1b1cFug.d.ts +0 -117
- package/dist/index-ClzBCbx_.d.mts +0 -117
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditorInner,
|
|
3
3
|
LoadedRichTextMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PJYHZPJK.mjs";
|
|
5
5
|
import {
|
|
6
6
|
RichTextRenderFallback,
|
|
7
7
|
SlotRender,
|
|
@@ -10,15 +10,16 @@ import {
|
|
|
10
10
|
getSlotTransform,
|
|
11
11
|
useRichtextProps,
|
|
12
12
|
useSlots
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3TERNOIP.mjs";
|
|
14
14
|
import {
|
|
15
15
|
LoadedRichTextMenuInner
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3OLRWMRO.mjs";
|
|
17
17
|
import {
|
|
18
18
|
ActionBar,
|
|
19
19
|
ChevronDown,
|
|
20
20
|
ChevronRight,
|
|
21
21
|
ChevronUp,
|
|
22
|
+
ChevronsDownUp,
|
|
22
23
|
CircleCheckBig,
|
|
23
24
|
Copy,
|
|
24
25
|
CornerLeftUp,
|
|
@@ -63,12 +64,13 @@ import {
|
|
|
63
64
|
useAppStore,
|
|
64
65
|
useAppStoreApi,
|
|
65
66
|
useHotkey,
|
|
67
|
+
useMessage,
|
|
66
68
|
useMonitorHotkeys,
|
|
67
69
|
useRegisterFieldsSlice,
|
|
68
70
|
useRegisterHistorySlice,
|
|
69
71
|
useRegisterPermissionsSlice,
|
|
70
72
|
useResetAutoZoom
|
|
71
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-DIYX54ZO.mjs";
|
|
72
74
|
import {
|
|
73
75
|
generateId,
|
|
74
76
|
getItem,
|
|
@@ -76,11 +78,11 @@ import {
|
|
|
76
78
|
insertAction,
|
|
77
79
|
makeStatePublic,
|
|
78
80
|
populateIds
|
|
79
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-UAWUZ45G.mjs";
|
|
80
82
|
import {
|
|
81
83
|
defaultAppState,
|
|
82
84
|
defaultViewports
|
|
83
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-NPAYGEG5.mjs";
|
|
84
86
|
import {
|
|
85
87
|
get_class_name_factory_default
|
|
86
88
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -263,11 +265,12 @@ var FieldLabel = ({
|
|
|
263
265
|
className
|
|
264
266
|
}) => {
|
|
265
267
|
const El = el;
|
|
268
|
+
const readOnlyLabel = useMessage("field-readonly");
|
|
266
269
|
return /* @__PURE__ */ jsxs2(El, { className, children: [
|
|
267
270
|
/* @__PURE__ */ jsxs2("div", { className: getClassName2("label"), children: [
|
|
268
271
|
icon ? /* @__PURE__ */ jsx2("div", { className: getClassName2("labelIcon"), children: icon }) : /* @__PURE__ */ jsx2(Fragment, {}),
|
|
269
272
|
label,
|
|
270
|
-
readOnly && /* @__PURE__ */ jsx2("div", { className: getClassName2("disabledIcon"), title:
|
|
273
|
+
readOnly && /* @__PURE__ */ jsx2("div", { className: getClassName2("disabledIcon"), title: readOnlyLabel, children: /* @__PURE__ */ jsx2(Lock, { size: "12" }) })
|
|
271
274
|
] }),
|
|
272
275
|
children
|
|
273
276
|
] });
|
|
@@ -395,6 +398,8 @@ var DragIcon = ({ isDragDisabled }) => /* @__PURE__ */ jsx4("div", { className:
|
|
|
395
398
|
// components/Sortable/index.tsx
|
|
396
399
|
init_react_import();
|
|
397
400
|
import { DragDropProvider } from "@dnd-kit/react";
|
|
401
|
+
import { useSortable } from "@dnd-kit/react/sortable";
|
|
402
|
+
import { PointerActivationConstraints as PointerActivationConstraints2 } from "@dnd-kit/dom";
|
|
398
403
|
|
|
399
404
|
// lib/dnd/use-sensors.ts
|
|
400
405
|
init_react_import();
|
|
@@ -755,9 +760,26 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((inpu
|
|
|
755
760
|
return null;
|
|
756
761
|
});
|
|
757
762
|
|
|
763
|
+
// lib/dnd/get-insert-index.ts
|
|
764
|
+
init_react_import();
|
|
765
|
+
var getCollisionPosition = (direction, dir = "ltr") => direction === "up" || dir === "ltr" && direction === "left" || dir === "rtl" && direction === "right" ? "before" : "after";
|
|
766
|
+
var getInsertIndex = ({
|
|
767
|
+
position,
|
|
768
|
+
sourceIndex,
|
|
769
|
+
targetIndex,
|
|
770
|
+
isSameZone
|
|
771
|
+
}) => {
|
|
772
|
+
let index = targetIndex;
|
|
773
|
+
if (isSameZone && index >= sourceIndex) {
|
|
774
|
+
index = index - 1;
|
|
775
|
+
}
|
|
776
|
+
if (position === "after") {
|
|
777
|
+
index = index + 1;
|
|
778
|
+
}
|
|
779
|
+
return index;
|
|
780
|
+
};
|
|
781
|
+
|
|
758
782
|
// components/Sortable/index.tsx
|
|
759
|
-
import { useSortable } from "@dnd-kit/react/sortable";
|
|
760
|
-
import { PointerActivationConstraints as PointerActivationConstraints2 } from "@dnd-kit/dom";
|
|
761
783
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
762
784
|
var SortableProvider = ({
|
|
763
785
|
children,
|
|
@@ -782,20 +804,18 @@ var SortableProvider = ({
|
|
|
782
804
|
const { operation } = event;
|
|
783
805
|
const { source, target } = operation;
|
|
784
806
|
if (!source || !target) return;
|
|
785
|
-
|
|
786
|
-
|
|
807
|
+
const sourceIndex = source.data.index;
|
|
808
|
+
const targetIndex = target.data.index;
|
|
787
809
|
const collisionData = (_a = manager.collisionObserver.collisions[0]) == null ? void 0 : _a.data;
|
|
788
810
|
if (sourceIndex !== targetIndex && source.id !== target.id) {
|
|
789
|
-
const collisionPosition = (collisionData == null ? void 0 : collisionData.direction) === "up" ? "before" : "after";
|
|
790
|
-
if (targetIndex >= sourceIndex) {
|
|
791
|
-
targetIndex = targetIndex - 1;
|
|
792
|
-
}
|
|
793
|
-
if (collisionPosition === "after") {
|
|
794
|
-
targetIndex = targetIndex + 1;
|
|
795
|
-
}
|
|
796
811
|
onMove({
|
|
797
812
|
source: sourceIndex,
|
|
798
|
-
target:
|
|
813
|
+
target: getInsertIndex({
|
|
814
|
+
position: getCollisionPosition(collisionData == null ? void 0 : collisionData.direction),
|
|
815
|
+
sourceIndex,
|
|
816
|
+
targetIndex,
|
|
817
|
+
isSameZone: true
|
|
818
|
+
})
|
|
799
819
|
});
|
|
800
820
|
}
|
|
801
821
|
},
|
|
@@ -956,12 +976,15 @@ var ItemSummaryInner = ({
|
|
|
956
976
|
const path = `${[name]}[${index}]`;
|
|
957
977
|
return getDeep(s, path);
|
|
958
978
|
});
|
|
979
|
+
const fallbackSummary = useMessage("field-arrayitem-summary", {
|
|
980
|
+
index: originalIndex
|
|
981
|
+
});
|
|
959
982
|
const itemSummary = useMemo3(() => {
|
|
960
983
|
if (data && field.getItemSummary) {
|
|
961
984
|
return field.getItemSummary(data, index);
|
|
962
985
|
}
|
|
963
|
-
return
|
|
964
|
-
}, [data, field, originalIndex, index]);
|
|
986
|
+
return fallbackSummary;
|
|
987
|
+
}, [data, field, originalIndex, index, fallbackSummary]);
|
|
965
988
|
return itemSummary;
|
|
966
989
|
};
|
|
967
990
|
var ItemSummary = memo2(ItemSummaryInner);
|
|
@@ -1183,6 +1206,8 @@ var ArrayField = ({
|
|
|
1183
1206
|
const newArrayState = regenerateArrayState(getValue());
|
|
1184
1207
|
setUi(mapArrayStateToUi(newArrayState), false);
|
|
1185
1208
|
}, [numItems]);
|
|
1209
|
+
const duplicateLabel = useMessage("field-arrayitem-duplicate");
|
|
1210
|
+
const deleteLabel = useMessage("field-arrayitem-delete");
|
|
1186
1211
|
if (field.type !== "array" || !field.arrayFields) {
|
|
1187
1212
|
return null;
|
|
1188
1213
|
}
|
|
@@ -1294,7 +1319,7 @@ var ArrayField = ({
|
|
|
1294
1319
|
existingValue.splice(index, 0, newItem);
|
|
1295
1320
|
updateValue(existingValue);
|
|
1296
1321
|
},
|
|
1297
|
-
title:
|
|
1322
|
+
title: duplicateLabel,
|
|
1298
1323
|
children: /* @__PURE__ */ jsx8(Copy, { size: 16 })
|
|
1299
1324
|
}
|
|
1300
1325
|
) }),
|
|
@@ -1310,7 +1335,7 @@ var ArrayField = ({
|
|
|
1310
1335
|
existingValue.splice(index, 1);
|
|
1311
1336
|
updateValue(existingValue);
|
|
1312
1337
|
},
|
|
1313
|
-
title:
|
|
1338
|
+
title: deleteLabel,
|
|
1314
1339
|
children: /* @__PURE__ */ jsx8(Trash, { size: 16 })
|
|
1315
1340
|
}
|
|
1316
1341
|
) })
|
|
@@ -1532,6 +1557,11 @@ init_react_import();
|
|
|
1532
1557
|
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1533
1558
|
var getClassName8 = get_class_name_factory_default("ExternalInput", styles_module_default4);
|
|
1534
1559
|
var getClassNameModal = get_class_name_factory_default("ExternalInputModal", styles_module_default4);
|
|
1560
|
+
var DefaultFooter = ({ count }) => {
|
|
1561
|
+
const singular = useMessage("field-external-result-singular", { count });
|
|
1562
|
+
const plural = useMessage("field-external-result-plural", { count });
|
|
1563
|
+
return /* @__PURE__ */ jsx12("span", { className: getClassNameModal("footer"), children: count === 1 ? singular : plural });
|
|
1564
|
+
};
|
|
1535
1565
|
var dataCache = {};
|
|
1536
1566
|
var ExternalInput = ({
|
|
1537
1567
|
field,
|
|
@@ -1590,16 +1620,16 @@ var ExternalInput = ({
|
|
|
1590
1620
|
[id, field]
|
|
1591
1621
|
);
|
|
1592
1622
|
const Footer = useCallback3(
|
|
1593
|
-
(props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */
|
|
1594
|
-
props.items.length,
|
|
1595
|
-
" result",
|
|
1596
|
-
props.items.length === 1 ? "" : "s"
|
|
1597
|
-
] }),
|
|
1623
|
+
(props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ jsx12(DefaultFooter, { count: props.items.length }),
|
|
1598
1624
|
[field.renderFooter]
|
|
1599
1625
|
);
|
|
1600
1626
|
useEffect5(() => {
|
|
1601
1627
|
search(searchQuery, filters);
|
|
1602
1628
|
}, []);
|
|
1629
|
+
const externalItemLabel = useMessage("field-external-item");
|
|
1630
|
+
const searchLabel = useMessage("field-external-search");
|
|
1631
|
+
const toggleFiltersLabel = useMessage("field-external-togglefilters");
|
|
1632
|
+
const selectDataLabel = useMessage("field-external-selectdata");
|
|
1603
1633
|
return /* @__PURE__ */ jsxs5(
|
|
1604
1634
|
"div",
|
|
1605
1635
|
{
|
|
@@ -1618,7 +1648,7 @@ var ExternalInput = ({
|
|
|
1618
1648
|
onClick: () => setOpen(true),
|
|
1619
1649
|
className: getClassName8("button"),
|
|
1620
1650
|
disabled: readOnly,
|
|
1621
|
-
children: value ? field.getItemSummary ? field.getItemSummary(value) :
|
|
1651
|
+
children: value ? field.getItemSummary ? field.getItemSummary(value) : externalItemLabel : /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
1622
1652
|
/* @__PURE__ */ jsx12(Link, { size: "16" }),
|
|
1623
1653
|
/* @__PURE__ */ jsx12("span", { children: field.placeholder })
|
|
1624
1654
|
] })
|
|
@@ -1654,7 +1684,7 @@ var ExternalInput = ({
|
|
|
1654
1684
|
children: [
|
|
1655
1685
|
/* @__PURE__ */ jsx12("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ jsxs5("div", { className: getClassNameModal("searchForm"), children: [
|
|
1656
1686
|
/* @__PURE__ */ jsxs5("label", { className: getClassNameModal("search"), children: [
|
|
1657
|
-
/* @__PURE__ */ jsx12("span", { className: getClassNameModal("searchIconText"), children:
|
|
1687
|
+
/* @__PURE__ */ jsx12("span", { className: getClassNameModal("searchIconText"), children: searchLabel }),
|
|
1658
1688
|
/* @__PURE__ */ jsx12("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ jsx12(Search, { size: "18" }) }),
|
|
1659
1689
|
/* @__PURE__ */ jsx12(
|
|
1660
1690
|
"input",
|
|
@@ -1672,12 +1702,12 @@ var ExternalInput = ({
|
|
|
1672
1702
|
)
|
|
1673
1703
|
] }),
|
|
1674
1704
|
/* @__PURE__ */ jsxs5("div", { className: getClassNameModal("searchActions"), children: [
|
|
1675
|
-
/* @__PURE__ */ jsx12(Button, { type: "submit", loading: isLoading, fullWidth: true, children:
|
|
1705
|
+
/* @__PURE__ */ jsx12(Button, { type: "submit", loading: isLoading, fullWidth: true, children: searchLabel }),
|
|
1676
1706
|
hasFilterFields && /* @__PURE__ */ jsx12("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ jsx12(
|
|
1677
1707
|
IconButton,
|
|
1678
1708
|
{
|
|
1679
1709
|
type: "button",
|
|
1680
|
-
title:
|
|
1710
|
+
title: toggleFiltersLabel,
|
|
1681
1711
|
onClick: (e) => {
|
|
1682
1712
|
e.preventDefault();
|
|
1683
1713
|
e.stopPropagation();
|
|
@@ -1687,7 +1717,7 @@ var ExternalInput = ({
|
|
|
1687
1717
|
}
|
|
1688
1718
|
) })
|
|
1689
1719
|
] })
|
|
1690
|
-
] }) : /* @__PURE__ */ jsx12(Heading, { rank: "2", size: "xs", children: field.placeholder ||
|
|
1720
|
+
] }) : /* @__PURE__ */ jsx12(Heading, { rank: "2", size: "xs", children: field.placeholder || selectDataLabel }) }),
|
|
1691
1721
|
/* @__PURE__ */ jsxs5("div", { className: getClassNameModal("grid"), children: [
|
|
1692
1722
|
hasFilterFields && /* @__PURE__ */ jsx12("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
|
|
1693
1723
|
const filterField = filterFields[fieldName];
|
|
@@ -1771,6 +1801,7 @@ var ExternalField = ({
|
|
|
1771
1801
|
const value = useDeepField(name);
|
|
1772
1802
|
const validField = field;
|
|
1773
1803
|
const deprecatedField = field;
|
|
1804
|
+
const selectDataLabel = useMessage("field-external-selectdata");
|
|
1774
1805
|
useEffect6(() => {
|
|
1775
1806
|
if (deprecatedField.adaptor) {
|
|
1776
1807
|
console.error(
|
|
@@ -1793,7 +1824,7 @@ var ExternalField = ({
|
|
|
1793
1824
|
name,
|
|
1794
1825
|
field: __spreadProps(__spreadValues({}, validField), {
|
|
1795
1826
|
// DEPRECATED
|
|
1796
|
-
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder ||
|
|
1827
|
+
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || selectDataLabel,
|
|
1797
1828
|
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
|
1798
1829
|
mapRow: validField.mapRow,
|
|
1799
1830
|
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
|
|
@@ -1999,7 +2030,7 @@ EditorFallback.displayName = "EditorFallback";
|
|
|
1999
2030
|
// components/AutoField/fields/RichtextField/index.tsx
|
|
2000
2031
|
import { Fragment as Fragment5, jsx as jsx18 } from "react/jsx-runtime";
|
|
2001
2032
|
var Editor = lazy(
|
|
2002
|
-
() => import("./Editor-
|
|
2033
|
+
() => import("./Editor-Z6P5UAVB.mjs").then((m) => ({
|
|
2003
2034
|
default: m.Editor
|
|
2004
2035
|
}))
|
|
2005
2036
|
);
|
|
@@ -2944,9 +2975,12 @@ var DraggableComponent = ({
|
|
|
2944
2975
|
}
|
|
2945
2976
|
setDragAxis(autoDragAxis);
|
|
2946
2977
|
}, [ref, userDragAxis, autoDragAxis]);
|
|
2978
|
+
const selectParentLabel = useMessage("action-selectparent");
|
|
2979
|
+
const duplicateLabel = useMessage("action-duplicate");
|
|
2980
|
+
const deleteLabel = useMessage("action-delete");
|
|
2947
2981
|
const parentAction = useMemo7(
|
|
2948
|
-
() => (ctx == null ? void 0 : ctx.areaId) && (ctx == null ? void 0 : ctx.areaId) !== "root" && /* @__PURE__ */ jsx22(ActionBar.Action, { onClick: onSelectParent, label:
|
|
2949
|
-
[ctx == null ? void 0 : ctx.areaId]
|
|
2982
|
+
() => (ctx == null ? void 0 : ctx.areaId) && (ctx == null ? void 0 : ctx.areaId) !== "root" && /* @__PURE__ */ jsx22(ActionBar.Action, { onClick: onSelectParent, label: selectParentLabel, children: /* @__PURE__ */ jsx22(CornerLeftUp, { size: 16 }) }),
|
|
2983
|
+
[ctx == null ? void 0 : ctx.areaId, selectParentLabel]
|
|
2950
2984
|
);
|
|
2951
2985
|
const nextContextValue = useMemo7(
|
|
2952
2986
|
() => __spreadProps(__spreadValues({}, ctx), {
|
|
@@ -3026,8 +3060,15 @@ var DraggableComponent = ({
|
|
|
3026
3060
|
),
|
|
3027
3061
|
hasNormalActions && /* @__PURE__ */ jsx22(ActionBar.Separator, {})
|
|
3028
3062
|
] }),
|
|
3029
|
-
permissions.duplicate && /* @__PURE__ */ jsx22(
|
|
3030
|
-
|
|
3063
|
+
permissions.duplicate && /* @__PURE__ */ jsx22(
|
|
3064
|
+
ActionBar.Action,
|
|
3065
|
+
{
|
|
3066
|
+
onClick: onDuplicate,
|
|
3067
|
+
label: duplicateLabel,
|
|
3068
|
+
children: /* @__PURE__ */ jsx22(Copy, { className: getClassName14("actionsAction") })
|
|
3069
|
+
}
|
|
3070
|
+
),
|
|
3071
|
+
permissions.delete && /* @__PURE__ */ jsx22(ActionBar.Action, { onClick: onDelete, label: deleteLabel, children: /* @__PURE__ */ jsx22(Trash, { className: getClassName14("actionsAction") }) })
|
|
3031
3072
|
]
|
|
3032
3073
|
}
|
|
3033
3074
|
)
|
|
@@ -3061,6 +3102,25 @@ var styles_module_default9 = { "DropZone": "_DropZone_ybznu_1", "DropZone--hasCh
|
|
|
3061
3102
|
// components/DropZone/index.tsx
|
|
3062
3103
|
import { useDroppable as useDroppable2 } from "@dnd-kit/react";
|
|
3063
3104
|
|
|
3105
|
+
// lib/data/is-component-allowed.ts
|
|
3106
|
+
init_react_import();
|
|
3107
|
+
var isComponentAllowed = (componentType, { allow, disallow }) => {
|
|
3108
|
+
if (!componentType) {
|
|
3109
|
+
return true;
|
|
3110
|
+
}
|
|
3111
|
+
const allowed = new Set(allow);
|
|
3112
|
+
const disallowed = new Set(disallow);
|
|
3113
|
+
if (disallow) {
|
|
3114
|
+
if (disallowed.has(componentType) && allowed.has(componentType)) {
|
|
3115
|
+
disallowed.delete(componentType);
|
|
3116
|
+
}
|
|
3117
|
+
return !disallowed.has(componentType);
|
|
3118
|
+
} else if (allow) {
|
|
3119
|
+
return allowed.has(componentType);
|
|
3120
|
+
}
|
|
3121
|
+
return true;
|
|
3122
|
+
};
|
|
3123
|
+
|
|
3064
3124
|
// components/Drawer/index.tsx
|
|
3065
3125
|
init_react_import();
|
|
3066
3126
|
|
|
@@ -3083,10 +3143,7 @@ import {
|
|
|
3083
3143
|
useRef as useRef3,
|
|
3084
3144
|
useState as useState10
|
|
3085
3145
|
} from "react";
|
|
3086
|
-
import {
|
|
3087
|
-
AutoScroller,
|
|
3088
|
-
defaultPreset
|
|
3089
|
-
} from "@dnd-kit/dom";
|
|
3146
|
+
import { AutoScroller, defaultPreset } from "@dnd-kit/dom";
|
|
3090
3147
|
|
|
3091
3148
|
// lib/dnd/NestedDroppablePlugin.ts
|
|
3092
3149
|
init_react_import();
|
|
@@ -3757,16 +3814,16 @@ var DragDropContextClient = ({
|
|
|
3757
3814
|
if (target.type === "component") {
|
|
3758
3815
|
const targetData = target.data;
|
|
3759
3816
|
targetZone = targetData.zone;
|
|
3760
|
-
targetIndex = targetData.index;
|
|
3761
3817
|
const collisionData = (_b = manager.collisionObserver.collisions[0]) == null ? void 0 : _b.data;
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
targetIndex
|
|
3769
|
-
|
|
3818
|
+
targetIndex = getInsertIndex({
|
|
3819
|
+
position: getCollisionPosition(
|
|
3820
|
+
collisionData == null ? void 0 : collisionData.direction,
|
|
3821
|
+
getDeepDir(target.element)
|
|
3822
|
+
),
|
|
3823
|
+
sourceIndex,
|
|
3824
|
+
targetIndex: targetData.index,
|
|
3825
|
+
isSameZone: sourceZone === targetZone
|
|
3826
|
+
});
|
|
3770
3827
|
} else {
|
|
3771
3828
|
targetZone = target.id.toString();
|
|
3772
3829
|
targetIndex = 0;
|
|
@@ -4515,7 +4572,7 @@ import {
|
|
|
4515
4572
|
} from "react";
|
|
4516
4573
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4517
4574
|
var Editor2 = lazy2(
|
|
4518
|
-
() => import("./Editor-
|
|
4575
|
+
() => import("./Editor-Z6P5UAVB.mjs").then((m) => ({
|
|
4519
4576
|
default: m.Editor
|
|
4520
4577
|
}))
|
|
4521
4578
|
);
|
|
@@ -4884,7 +4941,7 @@ var VirtualizedDropZone = ({
|
|
|
4884
4941
|
};
|
|
4885
4942
|
|
|
4886
4943
|
// components/DropZone/index.tsx
|
|
4887
|
-
import { Fragment as Fragment9, jsx as jsx31
|
|
4944
|
+
import { Fragment as Fragment9, jsx as jsx31 } from "react/jsx-runtime";
|
|
4888
4945
|
var getClassName17 = get_class_name_factory_default("DropZone", styles_module_default9);
|
|
4889
4946
|
var getRandomColor = () => `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
|
4890
4947
|
var RENDER_DEBUG = false;
|
|
@@ -4911,7 +4968,7 @@ var DropZoneChild = ({
|
|
|
4911
4968
|
inDroppableZone,
|
|
4912
4969
|
itemRef
|
|
4913
4970
|
}) => {
|
|
4914
|
-
var _a, _b;
|
|
4971
|
+
var _a, _b, _c, _d;
|
|
4915
4972
|
const metadata = useAppStore((s) => s.metadata);
|
|
4916
4973
|
const ctx = useContext9(dropZoneContext);
|
|
4917
4974
|
const { depth = 1 } = ctx != null ? ctx : {};
|
|
@@ -4979,7 +5036,11 @@ var DropZoneChild = ({
|
|
|
4979
5036
|
return ((_a2 = s.selectedItem) == null ? void 0 : _a2.props.id) === componentId || false;
|
|
4980
5037
|
}
|
|
4981
5038
|
);
|
|
4982
|
-
|
|
5039
|
+
const componentLabel = useMessage("label-component");
|
|
5040
|
+
const noConfigMessage = useMessage("canvas-noconfig", {
|
|
5041
|
+
type: (_b = (_a = item == null ? void 0 : item.type) == null ? void 0 : _a.toString()) != null ? _b : ""
|
|
5042
|
+
});
|
|
5043
|
+
let label = (_d = (_c = componentConfig == null ? void 0 : componentConfig.label) != null ? _c : item == null ? void 0 : item.type.toString()) != null ? _d : componentLabel;
|
|
4983
5044
|
const defaultsProps = useMemo12(
|
|
4984
5045
|
() => __spreadProps(__spreadValues(__spreadValues({}, componentConfig == null ? void 0 : componentConfig.defaultProps), item == null ? void 0 : item.props), {
|
|
4985
5046
|
puck: puckProps,
|
|
@@ -5013,10 +5074,7 @@ var DropZoneChild = ({
|
|
|
5013
5074
|
isLoading
|
|
5014
5075
|
);
|
|
5015
5076
|
if (!item) return;
|
|
5016
|
-
const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */
|
|
5017
|
-
"No configuration for ",
|
|
5018
|
-
item.type
|
|
5019
|
-
] });
|
|
5077
|
+
const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */ jsx31("div", { style: { padding: 48, textAlign: "center" }, children: noConfigMessage });
|
|
5020
5078
|
let componentType = item.type;
|
|
5021
5079
|
const isInserting = "previewType" in item ? item.previewType === "insert" : false;
|
|
5022
5080
|
return /* @__PURE__ */ jsx31(
|
|
@@ -5136,25 +5194,7 @@ var DropZoneEdit = forwardRef(
|
|
|
5136
5194
|
}, [zoneContentIds]);
|
|
5137
5195
|
const ref = useRef9(null);
|
|
5138
5196
|
const acceptsTarget = useCallback13(
|
|
5139
|
-
(componentType) => {
|
|
5140
|
-
if (!componentType) {
|
|
5141
|
-
return true;
|
|
5142
|
-
}
|
|
5143
|
-
if (disallow) {
|
|
5144
|
-
const defaultedAllow = allow || [];
|
|
5145
|
-
const filteredDisallow = (disallow || []).filter(
|
|
5146
|
-
(item) => defaultedAllow.indexOf(item) === -1
|
|
5147
|
-
);
|
|
5148
|
-
if (filteredDisallow.indexOf(componentType) !== -1) {
|
|
5149
|
-
return false;
|
|
5150
|
-
}
|
|
5151
|
-
} else if (allow) {
|
|
5152
|
-
if (allow.indexOf(componentType) === -1) {
|
|
5153
|
-
return false;
|
|
5154
|
-
}
|
|
5155
|
-
}
|
|
5156
|
-
return true;
|
|
5157
|
-
},
|
|
5197
|
+
(componentType) => isComponentAllowed(componentType, { allow, disallow }),
|
|
5158
5198
|
[allow, disallow]
|
|
5159
5199
|
);
|
|
5160
5200
|
const targetAccepted = useContextStore(ZoneStoreContext, (s) => {
|
|
@@ -5508,7 +5548,8 @@ var generateUsePuck = (store, getState) => {
|
|
|
5508
5548
|
const parentNode = store.state.indexes.nodes[parentId];
|
|
5509
5549
|
if (!parentNode) return;
|
|
5510
5550
|
return parentNode.data;
|
|
5511
|
-
}
|
|
5551
|
+
},
|
|
5552
|
+
dictionary: store.dictionary
|
|
5512
5553
|
};
|
|
5513
5554
|
storeData.__private = {
|
|
5514
5555
|
appState: store.state
|
|
@@ -5525,7 +5566,8 @@ var convertToPickedStore = (store) => {
|
|
|
5525
5566
|
dispatch: store.dispatch,
|
|
5526
5567
|
permissions: store.permissions,
|
|
5527
5568
|
history: store.history,
|
|
5528
|
-
selectedItem: store.selectedItem
|
|
5569
|
+
selectedItem: store.selectedItem,
|
|
5570
|
+
dictionary: store.dictionary
|
|
5529
5571
|
};
|
|
5530
5572
|
};
|
|
5531
5573
|
var useRegisterUsePuckStore = (appStore) => {
|
|
@@ -5595,7 +5637,7 @@ var styles_module_default12 = { "ComponentList": "_ComponentList_htktj_1", "Comp
|
|
|
5595
5637
|
|
|
5596
5638
|
// components/ComponentList/index.tsx
|
|
5597
5639
|
import { useEffect as useEffect18 } from "react";
|
|
5598
|
-
import { jsx as jsx33, jsxs as
|
|
5640
|
+
import { jsx as jsx33, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5599
5641
|
var getClassName18 = get_class_name_factory_default("ComponentList", styles_module_default12);
|
|
5600
5642
|
var ComponentListItem = ({
|
|
5601
5643
|
name,
|
|
@@ -5627,8 +5669,14 @@ var ComponentList = ({
|
|
|
5627
5669
|
const componentList = useAppStore((s) => s.state.ui.componentList);
|
|
5628
5670
|
const { expanded = true } = componentList[id] || {};
|
|
5629
5671
|
const contentId = `puck-drawer-category-${id}`;
|
|
5630
|
-
|
|
5631
|
-
title
|
|
5672
|
+
const collapseTitle = useMessage("drawer-category-collapse", {
|
|
5673
|
+
title: title != null ? title : ""
|
|
5674
|
+
});
|
|
5675
|
+
const expandTitle = useMessage("drawer-category-expand", {
|
|
5676
|
+
title: title != null ? title : ""
|
|
5677
|
+
});
|
|
5678
|
+
return /* @__PURE__ */ jsxs10("div", { className: getClassName18({ isExpanded: expanded }), children: [
|
|
5679
|
+
title && /* @__PURE__ */ jsxs10(
|
|
5632
5680
|
"button",
|
|
5633
5681
|
{
|
|
5634
5682
|
type: "button",
|
|
@@ -5642,7 +5690,7 @@ var ComponentList = ({
|
|
|
5642
5690
|
})
|
|
5643
5691
|
})
|
|
5644
5692
|
}),
|
|
5645
|
-
title: expanded ?
|
|
5693
|
+
title: expanded ? collapseTitle : expandTitle,
|
|
5646
5694
|
children: [
|
|
5647
5695
|
/* @__PURE__ */ jsx33("div", { children: title }),
|
|
5648
5696
|
/* @__PURE__ */ jsx33("div", { className: getClassName18("titleIcon"), children: expanded ? /* @__PURE__ */ jsx33(ChevronUp, { size: 12 }) : /* @__PURE__ */ jsx33(ChevronDown, { size: 12 }) })
|
|
@@ -5670,6 +5718,7 @@ var useComponentList = () => {
|
|
|
5670
5718
|
const [componentList, setComponentList] = useState17();
|
|
5671
5719
|
const config = useAppStore((s) => s.config);
|
|
5672
5720
|
const uiComponentList = useAppStore((s) => s.state.ui.componentList);
|
|
5721
|
+
const otherLabel = useMessage("drawer-category-other");
|
|
5673
5722
|
useEffect19(() => {
|
|
5674
5723
|
var _a, _b, _c;
|
|
5675
5724
|
if (Object.keys(uiComponentList).length > 0) {
|
|
@@ -5677,6 +5726,7 @@ var useComponentList = () => {
|
|
|
5677
5726
|
let _componentList;
|
|
5678
5727
|
_componentList = Object.entries(uiComponentList).map(
|
|
5679
5728
|
([categoryKey, category]) => {
|
|
5729
|
+
var _a2, _b2;
|
|
5680
5730
|
if (!category.components) {
|
|
5681
5731
|
return null;
|
|
5682
5732
|
}
|
|
@@ -5690,14 +5740,14 @@ var useComponentList = () => {
|
|
|
5690
5740
|
ComponentList,
|
|
5691
5741
|
{
|
|
5692
5742
|
id: categoryKey,
|
|
5693
|
-
title: category.title || categoryKey,
|
|
5743
|
+
title: ((_b2 = (_a2 = config.categories) == null ? void 0 : _a2[categoryKey]) == null ? void 0 : _b2.title) || category.title || categoryKey,
|
|
5694
5744
|
children: category.components.map((componentName, i) => {
|
|
5695
|
-
var
|
|
5745
|
+
var _a3;
|
|
5696
5746
|
const componentConf = config.components[componentName] || {};
|
|
5697
5747
|
return /* @__PURE__ */ jsx34(
|
|
5698
5748
|
ComponentList.Item,
|
|
5699
5749
|
{
|
|
5700
|
-
label: (
|
|
5750
|
+
label: (_a3 = componentConf["label"]) != null ? _a3 : componentName,
|
|
5701
5751
|
name: componentName,
|
|
5702
5752
|
index: i
|
|
5703
5753
|
},
|
|
@@ -5718,7 +5768,7 @@ var useComponentList = () => {
|
|
|
5718
5768
|
ComponentList,
|
|
5719
5769
|
{
|
|
5720
5770
|
id: "other",
|
|
5721
|
-
title: ((_c = uiComponentList.other) == null ? void 0 : _c.title) ||
|
|
5771
|
+
title: ((_c = uiComponentList.other) == null ? void 0 : _c.title) || otherLabel,
|
|
5722
5772
|
children: remainingComponents.map((componentName, i) => {
|
|
5723
5773
|
var _a2;
|
|
5724
5774
|
const componentConf = config.components[componentName] || {};
|
|
@@ -5739,7 +5789,7 @@ var useComponentList = () => {
|
|
|
5739
5789
|
}
|
|
5740
5790
|
setComponentList(_componentList);
|
|
5741
5791
|
}
|
|
5742
|
-
}, [config.categories, config.components, uiComponentList]);
|
|
5792
|
+
}, [config.categories, config.components, uiComponentList, otherLabel]);
|
|
5743
5793
|
return componentList;
|
|
5744
5794
|
};
|
|
5745
5795
|
|
|
@@ -5767,302 +5817,798 @@ var styles_module_default13 = { "BlocksPlugin": "_BlocksPlugin_9af19_1" };
|
|
|
5767
5817
|
// plugins/blocks/index.tsx
|
|
5768
5818
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5769
5819
|
var getClassName19 = get_class_name_factory_default("BlocksPlugin", styles_module_default13);
|
|
5770
|
-
var blocksPlugin = () =>
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
})
|
|
5820
|
+
var blocksPlugin = (props = {}) => {
|
|
5821
|
+
var _a, _b;
|
|
5822
|
+
return {
|
|
5823
|
+
name: "blocks",
|
|
5824
|
+
label: (_a = props.label) != null ? _a : "Blocks",
|
|
5825
|
+
render: () => /* @__PURE__ */ jsx36("div", { className: getClassName19(), children: /* @__PURE__ */ jsx36(Components, {}) }),
|
|
5826
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ jsx36(Hammer, {})
|
|
5827
|
+
};
|
|
5828
|
+
};
|
|
5776
5829
|
|
|
5777
5830
|
// plugins/outline/index.tsx
|
|
5778
5831
|
init_react_import();
|
|
5779
5832
|
|
|
5780
5833
|
// components/Puck/components/Outline/index.tsx
|
|
5781
5834
|
init_react_import();
|
|
5835
|
+
import { useMemo as useMemo18 } from "react";
|
|
5836
|
+
import { useShallow as useShallow8 } from "zustand/react/shallow";
|
|
5837
|
+
|
|
5838
|
+
// lib/data/find-zones-for-area.ts
|
|
5839
|
+
init_react_import();
|
|
5840
|
+
var findZonesForArea = (state, area) => {
|
|
5841
|
+
return Object.keys(state.indexes.zones).filter(
|
|
5842
|
+
(zone) => zone.split(":")[0] === area
|
|
5843
|
+
);
|
|
5844
|
+
};
|
|
5782
5845
|
|
|
5783
5846
|
// components/LayerTree/index.tsx
|
|
5784
5847
|
init_react_import();
|
|
5785
5848
|
|
|
5786
|
-
//
|
|
5849
|
+
// components/LayerTree/components/layer-tree-zone/index.tsx
|
|
5787
5850
|
init_react_import();
|
|
5788
|
-
var styles_module_default14 = { "LayerTree": "_LayerTree_1vltj_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_1vltj_11", "LayerTree-helper": "_LayerTree-helper_1vltj_17", "Layer": "_Layer_1vltj_1", "Layer-inner": "_Layer-inner_1vltj_30", "Layer--containsZone": "_Layer--containsZone_1vltj_37", "Layer-clickable": "_Layer-clickable_1vltj_41", "Layer--isSelected": "_Layer--isSelected_1vltj_63", "Layer-chevron": "_Layer-chevron_1vltj_91", "Layer--childIsSelected": "_Layer--childIsSelected_1vltj_92", "Layer-zones": "_Layer-zones_1vltj_96", "Layer-title": "_Layer-title_1vltj_110", "Layer-name": "_Layer-name_1vltj_119", "Layer-icon": "_Layer-icon_1vltj_125", "Layer-zoneIcon": "_Layer-zoneIcon_1vltj_130" };
|
|
5789
5851
|
|
|
5790
|
-
// components/LayerTree/
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
}
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5852
|
+
// components/LayerTree/lib/dnd/use-outline-drop-zone.ts
|
|
5853
|
+
init_react_import();
|
|
5854
|
+
import { useMemo as useMemo15 } from "react";
|
|
5855
|
+
import { useDroppable as useDroppable3 } from "@dnd-kit/react";
|
|
5856
|
+
|
|
5857
|
+
// components/LayerTree/lib/dnd/compute.ts
|
|
5858
|
+
init_react_import();
|
|
5859
|
+
|
|
5860
|
+
// lib/data/resolve-zone-constraints.ts
|
|
5861
|
+
init_react_import();
|
|
5862
|
+
|
|
5863
|
+
// lib/data/get-slot-field.ts
|
|
5864
|
+
init_react_import();
|
|
5865
|
+
|
|
5866
|
+
// lib/data/get-field-by-path.ts
|
|
5867
|
+
init_react_import();
|
|
5868
|
+
function getFieldByPath(path, fields) {
|
|
5869
|
+
if (typeof path !== "string") {
|
|
5870
|
+
throw new Error(
|
|
5871
|
+
`Can't get field definition for path (${path}): Path should be a string`
|
|
5872
|
+
);
|
|
5873
|
+
}
|
|
5874
|
+
if (!fields || typeof fields !== "object") {
|
|
5875
|
+
return void 0;
|
|
5876
|
+
}
|
|
5877
|
+
const segments = path.split(/\.|\[\d+\]/).filter(Boolean);
|
|
5878
|
+
let currFields = fields;
|
|
5879
|
+
let currField = void 0;
|
|
5880
|
+
for (let index = 0; index < segments.length; index++) {
|
|
5881
|
+
const currSegment = segments[index];
|
|
5882
|
+
currField = currFields[currSegment];
|
|
5883
|
+
if (index === segments.length - 1) {
|
|
5884
|
+
return currField;
|
|
5885
|
+
}
|
|
5886
|
+
if (!currField) {
|
|
5887
|
+
return;
|
|
5888
|
+
}
|
|
5889
|
+
if ((currField.type !== "object" || !currField.objectFields) && (currField.type !== "array" || !currField.arrayFields))
|
|
5890
|
+
return;
|
|
5891
|
+
if (currField.type === "object") {
|
|
5892
|
+
currFields = currField.objectFields;
|
|
5893
|
+
}
|
|
5894
|
+
if (currField.type === "array") {
|
|
5895
|
+
currFields = currField.arrayFields;
|
|
5896
|
+
}
|
|
5816
5897
|
}
|
|
5898
|
+
}
|
|
5899
|
+
|
|
5900
|
+
// lib/data/get-slot-field.ts
|
|
5901
|
+
var getSlotField = (zoneCompound, config, nodes) => {
|
|
5902
|
+
var _a;
|
|
5817
5903
|
const [componentId, slotId] = zoneCompound.split(":");
|
|
5818
5904
|
if (!slotId) {
|
|
5819
5905
|
return;
|
|
5820
5906
|
}
|
|
5821
5907
|
const componentType = (_a = nodes[componentId]) == null ? void 0 : _a.data.type;
|
|
5822
5908
|
const configForComponent = componentType && componentType !== rootAreaId ? config.components[componentType] : config.root;
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
var buildLayerNode = ({
|
|
5826
|
-
config,
|
|
5827
|
-
itemId,
|
|
5828
|
-
index,
|
|
5829
|
-
nodes,
|
|
5830
|
-
zoneCompound,
|
|
5831
|
-
zones,
|
|
5832
|
-
zonesByParent
|
|
5833
|
-
}) => {
|
|
5834
|
-
var _a, _b, _c;
|
|
5835
|
-
const nodeData = nodes[itemId];
|
|
5836
|
-
const componentType = ((_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) || "Component";
|
|
5837
|
-
const label = (_c = (_b = config.components[componentType]) == null ? void 0 : _b.label) != null ? _c : componentType;
|
|
5838
|
-
const childZoneCompounds = zonesByParent[itemId] || [];
|
|
5839
|
-
return {
|
|
5840
|
-
childZones: childZoneCompounds.map(
|
|
5841
|
-
(childZoneCompound) => buildLayerTree({
|
|
5842
|
-
config,
|
|
5843
|
-
nodes,
|
|
5844
|
-
zoneCompound: childZoneCompound,
|
|
5845
|
-
zones,
|
|
5846
|
-
zonesByParent
|
|
5847
|
-
})
|
|
5848
|
-
),
|
|
5849
|
-
componentType,
|
|
5850
|
-
index,
|
|
5851
|
-
itemId,
|
|
5852
|
-
label,
|
|
5853
|
-
zoneCompound
|
|
5854
|
-
};
|
|
5855
|
-
};
|
|
5856
|
-
var buildLayerTree = ({
|
|
5857
|
-
config,
|
|
5858
|
-
label,
|
|
5859
|
-
nodes,
|
|
5860
|
-
zoneCompound,
|
|
5861
|
-
zones,
|
|
5862
|
-
zonesByParent = getZonesByParent(zones)
|
|
5863
|
-
}) => {
|
|
5864
|
-
var _a, _b;
|
|
5865
|
-
const contentIds = (_b = (_a = zones[zoneCompound]) == null ? void 0 : _a.contentIds) != null ? _b : [];
|
|
5866
|
-
return {
|
|
5867
|
-
items: contentIds.map(
|
|
5868
|
-
(itemId, index) => buildLayerNode({
|
|
5869
|
-
config,
|
|
5870
|
-
itemId,
|
|
5871
|
-
index,
|
|
5872
|
-
nodes,
|
|
5873
|
-
zoneCompound,
|
|
5874
|
-
zones,
|
|
5875
|
-
zonesByParent
|
|
5876
|
-
})
|
|
5877
|
-
),
|
|
5878
|
-
label: getZoneLabel(zoneCompound, nodes, config, label),
|
|
5879
|
-
zoneCompound
|
|
5880
|
-
};
|
|
5909
|
+
const slotField = getFieldByPath(slotId, configForComponent == null ? void 0 : configForComponent.fields);
|
|
5910
|
+
return slotField;
|
|
5881
5911
|
};
|
|
5882
|
-
|
|
5912
|
+
|
|
5913
|
+
// lib/data/resolve-zone-constraints.ts
|
|
5914
|
+
var NO_CONSTRAINTS = {};
|
|
5915
|
+
var getZoneConstraints = (zoneCompound, config, indexes) => {
|
|
5883
5916
|
var _a;
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
var cacheMeasuredRowHeight = (itemId, height) => {
|
|
5887
|
-
if (height <= 0) {
|
|
5888
|
-
return;
|
|
5917
|
+
if (((_a = indexes.zones[zoneCompound]) == null ? void 0 : _a.type) !== "slot") {
|
|
5918
|
+
return NO_CONSTRAINTS;
|
|
5889
5919
|
}
|
|
5890
|
-
|
|
5920
|
+
const field = getSlotField(zoneCompound, config, indexes.nodes);
|
|
5921
|
+
if ((field == null ? void 0 : field.type) !== "slot") {
|
|
5922
|
+
return NO_CONSTRAINTS;
|
|
5923
|
+
}
|
|
5924
|
+
return { allow: field.allow, disallow: field.disallow };
|
|
5891
5925
|
};
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
current = current.parentElement;
|
|
5926
|
+
|
|
5927
|
+
// components/LayerTree/lib/dnd/compute.ts
|
|
5928
|
+
var OUTLINE_ITEM_TYPE = "outline-item";
|
|
5929
|
+
var OUTLINE_ZONE_TYPE = "outline-zone";
|
|
5930
|
+
var cached = (cache, key, compute) => {
|
|
5931
|
+
const hit = cache.get(key);
|
|
5932
|
+
if (hit !== void 0) {
|
|
5933
|
+
return hit;
|
|
5901
5934
|
}
|
|
5902
|
-
|
|
5935
|
+
const result = compute();
|
|
5936
|
+
cache.set(key, result);
|
|
5937
|
+
return result;
|
|
5903
5938
|
};
|
|
5904
|
-
var
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
node,
|
|
5910
|
-
selectedId,
|
|
5911
|
-
selectedPathIds
|
|
5912
|
-
}, ref) {
|
|
5913
|
-
const dispatch = useAppStore((s) => s.dispatch);
|
|
5914
|
-
const zoneStore = useContext11(ZoneStoreContext);
|
|
5915
|
-
const isHovering = useContextStore(
|
|
5916
|
-
ZoneStoreContext,
|
|
5917
|
-
(s) => s.hoveringComponent === node.itemId
|
|
5939
|
+
var zoneAcceptsComponent = (cache, zoneCompound, componentType, config, indexes) => cached(cache, `zone:${zoneCompound}`, () => {
|
|
5940
|
+
const targetZoneConstraints = getZoneConstraints(
|
|
5941
|
+
zoneCompound,
|
|
5942
|
+
config,
|
|
5943
|
+
indexes
|
|
5918
5944
|
);
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
}
|
|
5924
|
-
|
|
5945
|
+
return isComponentAllowed(componentType, targetZoneConstraints);
|
|
5946
|
+
});
|
|
5947
|
+
var itemAcceptsComponent = (cache, itemId, componentType, config, indexes) => cached(cache, `childZones:${itemId}`, () => {
|
|
5948
|
+
return Object.keys(indexes.zones).some(
|
|
5949
|
+
(zoneCompound) => zoneCompound.startsWith(`${itemId}:`) && zoneAcceptsComponent(
|
|
5950
|
+
cache,
|
|
5951
|
+
zoneCompound,
|
|
5952
|
+
componentType,
|
|
5953
|
+
config,
|
|
5954
|
+
indexes
|
|
5955
|
+
)
|
|
5925
5956
|
);
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
isSelected
|
|
5936
|
-
}),
|
|
5937
|
-
"data-index": dataIndex,
|
|
5938
|
-
"data-puck-layer-tree-id": node.itemId,
|
|
5939
|
-
children: [
|
|
5940
|
-
/* @__PURE__ */ jsx37("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ jsxs12(
|
|
5941
|
-
"button",
|
|
5942
|
-
{
|
|
5943
|
-
type: "button",
|
|
5944
|
-
className: getClassNameLayer("clickable"),
|
|
5945
|
-
onClick: () => {
|
|
5946
|
-
if (isSelected) {
|
|
5947
|
-
setItemSelector(null);
|
|
5948
|
-
return;
|
|
5949
|
-
}
|
|
5950
|
-
setItemSelector({
|
|
5951
|
-
index: node.index,
|
|
5952
|
-
zone: node.zoneCompound
|
|
5953
|
-
});
|
|
5954
|
-
zoneStore.getState().scrollToComponent(node.itemId);
|
|
5955
|
-
},
|
|
5956
|
-
onMouseEnter: (e) => {
|
|
5957
|
-
e.stopPropagation();
|
|
5958
|
-
zoneStore.setState({ hoveringComponent: node.itemId });
|
|
5959
|
-
},
|
|
5960
|
-
onMouseLeave: (e) => {
|
|
5961
|
-
e.stopPropagation();
|
|
5962
|
-
zoneStore.setState({ hoveringComponent: null });
|
|
5963
|
-
},
|
|
5964
|
-
children: [
|
|
5965
|
-
containsZone && /* @__PURE__ */ jsx37(
|
|
5966
|
-
"div",
|
|
5967
|
-
{
|
|
5968
|
-
className: getClassNameLayer("chevron"),
|
|
5969
|
-
title: isSelected ? "Collapse" : "Expand",
|
|
5970
|
-
children: /* @__PURE__ */ jsx37(ChevronDown, { size: "12" })
|
|
5971
|
-
}
|
|
5972
|
-
),
|
|
5973
|
-
/* @__PURE__ */ jsxs12("div", { className: getClassNameLayer("title"), children: [
|
|
5974
|
-
/* @__PURE__ */ jsx37("div", { className: getClassNameLayer("icon"), children: node.componentType === "Text" || node.componentType === "Heading" ? /* @__PURE__ */ jsx37(Type, { size: "16" }) : /* @__PURE__ */ jsx37(LayoutGrid, { size: "16" }) }),
|
|
5975
|
-
/* @__PURE__ */ jsx37("div", { className: getClassNameLayer("name"), children: node.label })
|
|
5976
|
-
] })
|
|
5977
|
-
]
|
|
5978
|
-
}
|
|
5979
|
-
) }),
|
|
5980
|
-
containsZone && shouldRenderChildren && node.childZones.map((childZone) => /* @__PURE__ */ jsx37(
|
|
5981
|
-
"div",
|
|
5982
|
-
{
|
|
5983
|
-
className: getClassNameLayer("zones"),
|
|
5984
|
-
children: /* @__PURE__ */ jsx37(
|
|
5985
|
-
LayerTreeZone,
|
|
5986
|
-
{
|
|
5987
|
-
depth: depth + 1,
|
|
5988
|
-
selectedId,
|
|
5989
|
-
selectedPathIds,
|
|
5990
|
-
tree: childZone
|
|
5991
|
-
}
|
|
5992
|
-
)
|
|
5993
|
-
},
|
|
5994
|
-
childZone.zoneCompound
|
|
5995
|
-
))
|
|
5996
|
-
]
|
|
5997
|
-
}
|
|
5957
|
+
});
|
|
5958
|
+
var isSourceOrDescendantOfSource = (cache, itemId, sourceItemId, nodes) => cached(cache, `subtree:${itemId}`, () => {
|
|
5959
|
+
var _a;
|
|
5960
|
+
if (itemId === sourceItemId) {
|
|
5961
|
+
return true;
|
|
5962
|
+
}
|
|
5963
|
+
const path = ((_a = nodes[itemId]) == null ? void 0 : _a.path) || [];
|
|
5964
|
+
return path.some(
|
|
5965
|
+
(zoneCompound) => zoneCompound.split(":")[0] === sourceItemId
|
|
5998
5966
|
);
|
|
5999
5967
|
});
|
|
6000
|
-
var
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
const
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
5968
|
+
var createOutlineAccept = (stores, target) => (source) => {
|
|
5969
|
+
if (source.type !== OUTLINE_ITEM_TYPE) return false;
|
|
5970
|
+
const sourceData = source.data;
|
|
5971
|
+
const cache = stores.outlineStore.getState().acceptCache;
|
|
5972
|
+
const { config, state } = stores.appStore.getState();
|
|
5973
|
+
const indexes = state.indexes;
|
|
5974
|
+
const anchorId = target.kind === "row" ? target.itemId : target.zoneCompound.split(":")[0];
|
|
5975
|
+
if (isSourceOrDescendantOfSource(
|
|
5976
|
+
cache,
|
|
5977
|
+
anchorId,
|
|
5978
|
+
sourceData.itemId,
|
|
5979
|
+
indexes.nodes
|
|
5980
|
+
)) {
|
|
5981
|
+
return false;
|
|
5982
|
+
}
|
|
5983
|
+
if (target.kind === "zone") {
|
|
5984
|
+
return zoneAcceptsComponent(
|
|
5985
|
+
cache,
|
|
5986
|
+
target.zoneCompound,
|
|
5987
|
+
sourceData.componentType,
|
|
5988
|
+
config,
|
|
5989
|
+
indexes
|
|
5990
|
+
);
|
|
5991
|
+
}
|
|
5992
|
+
return zoneAcceptsComponent(
|
|
5993
|
+
cache,
|
|
5994
|
+
target.zoneCompound,
|
|
5995
|
+
sourceData.componentType,
|
|
5996
|
+
config,
|
|
5997
|
+
indexes
|
|
5998
|
+
) || itemAcceptsComponent(
|
|
5999
|
+
cache,
|
|
6000
|
+
target.itemId,
|
|
6001
|
+
sourceData.componentType,
|
|
6002
|
+
config,
|
|
6003
|
+
indexes
|
|
6004
|
+
);
|
|
6005
|
+
};
|
|
6006
|
+
|
|
6007
|
+
// components/LayerTree/lib/store.ts
|
|
6008
|
+
init_react_import();
|
|
6009
|
+
import { createContext as createContext6, useContext as useContext11 } from "react";
|
|
6010
|
+
import { createStore as createStore6 } from "zustand";
|
|
6011
|
+
var OUTLINE_EXPAND_DELAY_MS = 600;
|
|
6012
|
+
var createOutlineDndStore = () => {
|
|
6013
|
+
let expandTimer = null;
|
|
6014
|
+
let pendingRowId = null;
|
|
6015
|
+
const cancelTimer = () => {
|
|
6016
|
+
if (expandTimer !== null) {
|
|
6017
|
+
clearTimeout(expandTimer);
|
|
6018
|
+
expandTimer = null;
|
|
6019
|
+
}
|
|
6020
|
+
pendingRowId = null;
|
|
6021
|
+
};
|
|
6022
|
+
return createStore6((set, get) => ({
|
|
6023
|
+
status: "idle",
|
|
6024
|
+
draggedRow: null,
|
|
6025
|
+
tempExpandedIds: /* @__PURE__ */ new Set(),
|
|
6026
|
+
expandCandidateId: null,
|
|
6027
|
+
indicator: null,
|
|
6028
|
+
drop: null,
|
|
6029
|
+
acceptCache: /* @__PURE__ */ new Map(),
|
|
6030
|
+
startDrag: (draggedRow) => set({
|
|
6031
|
+
status: "dragging",
|
|
6032
|
+
draggedRow,
|
|
6033
|
+
acceptCache: /* @__PURE__ */ new Map()
|
|
6034
|
+
}),
|
|
6035
|
+
setTarget: (indicator, drop) => {
|
|
6036
|
+
var _a, _b, _c, _d;
|
|
6037
|
+
const current = get();
|
|
6038
|
+
if (((_a = current.indicator) == null ? void 0 : _a.targetId) === indicator.targetId && ((_b = current.indicator) == null ? void 0 : _b.position) === indicator.position && ((_c = current.drop) == null ? void 0 : _c.zone) === drop.zone && ((_d = current.drop) == null ? void 0 : _d.index) === drop.index) {
|
|
6039
|
+
return;
|
|
6027
6040
|
}
|
|
6028
|
-
|
|
6041
|
+
set({ indicator, drop });
|
|
6042
|
+
},
|
|
6043
|
+
clearTarget: () => {
|
|
6044
|
+
if (get().indicator === null && get().drop === null) {
|
|
6045
|
+
return;
|
|
6046
|
+
}
|
|
6047
|
+
set({ indicator: null, drop: null });
|
|
6048
|
+
},
|
|
6049
|
+
scheduleExpand: (rowId, onExpand) => {
|
|
6050
|
+
if (pendingRowId === rowId || get().tempExpandedIds.has(rowId)) {
|
|
6051
|
+
return;
|
|
6052
|
+
}
|
|
6053
|
+
cancelTimer();
|
|
6054
|
+
pendingRowId = rowId;
|
|
6055
|
+
set({ expandCandidateId: rowId });
|
|
6056
|
+
expandTimer = setTimeout(() => {
|
|
6057
|
+
expandTimer = null;
|
|
6058
|
+
pendingRowId = null;
|
|
6059
|
+
set((s) => ({
|
|
6060
|
+
tempExpandedIds: new Set(s.tempExpandedIds).add(rowId),
|
|
6061
|
+
expandCandidateId: null
|
|
6062
|
+
}));
|
|
6063
|
+
onExpand();
|
|
6064
|
+
}, OUTLINE_EXPAND_DELAY_MS);
|
|
6065
|
+
},
|
|
6066
|
+
cancelPendingExpand: () => {
|
|
6067
|
+
cancelTimer();
|
|
6068
|
+
if (get().expandCandidateId !== null) {
|
|
6069
|
+
set({ expandCandidateId: null });
|
|
6070
|
+
}
|
|
6071
|
+
},
|
|
6072
|
+
endDrag: () => {
|
|
6073
|
+
cancelTimer();
|
|
6074
|
+
set({
|
|
6075
|
+
status: "dropping",
|
|
6076
|
+
indicator: null,
|
|
6077
|
+
drop: null,
|
|
6078
|
+
expandCandidateId: null
|
|
6079
|
+
});
|
|
6080
|
+
},
|
|
6081
|
+
reset: () => {
|
|
6082
|
+
cancelTimer();
|
|
6083
|
+
set({
|
|
6084
|
+
status: "idle",
|
|
6085
|
+
draggedRow: null,
|
|
6086
|
+
tempExpandedIds: /* @__PURE__ */ new Set(),
|
|
6087
|
+
expandCandidateId: null,
|
|
6088
|
+
indicator: null,
|
|
6089
|
+
drop: null,
|
|
6090
|
+
acceptCache: /* @__PURE__ */ new Map()
|
|
6091
|
+
});
|
|
6092
|
+
}
|
|
6093
|
+
}));
|
|
6094
|
+
};
|
|
6095
|
+
var OutlineDndStoreContext = createContext6(
|
|
6096
|
+
createOutlineDndStore()
|
|
6097
|
+
);
|
|
6098
|
+
var useOutlineDndStoreApi = () => {
|
|
6099
|
+
return useContext11(OutlineDndStoreContext);
|
|
6100
|
+
};
|
|
6101
|
+
var useOutlineDndStore = (selector) => {
|
|
6102
|
+
return useContextStore(OutlineDndStoreContext, selector);
|
|
6103
|
+
};
|
|
6104
|
+
|
|
6105
|
+
// components/LayerTree/lib/dnd/use-outline-drop-zone.ts
|
|
6106
|
+
var useOutlineDropZone = ({
|
|
6107
|
+
kind,
|
|
6108
|
+
zoneCompound
|
|
6109
|
+
}) => {
|
|
6110
|
+
const appStore = useAppStoreApi();
|
|
6111
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
6112
|
+
const dndId = `${kind}:${zoneCompound}`;
|
|
6113
|
+
const accept = useMemo15(
|
|
6114
|
+
() => createOutlineAccept(
|
|
6115
|
+
{ appStore, outlineStore },
|
|
6116
|
+
{
|
|
6117
|
+
kind: "zone",
|
|
6118
|
+
zoneCompound
|
|
6119
|
+
}
|
|
6120
|
+
),
|
|
6121
|
+
[appStore, outlineStore, zoneCompound]
|
|
6122
|
+
);
|
|
6123
|
+
const { ref } = useDroppable3({
|
|
6124
|
+
id: dndId,
|
|
6125
|
+
type: OUTLINE_ZONE_TYPE,
|
|
6126
|
+
accept,
|
|
6127
|
+
collisionDetector: pointerIntersection,
|
|
6128
|
+
data: { kind: "zone", zoneCompound }
|
|
6129
|
+
});
|
|
6130
|
+
const isDropTarget = useOutlineDndStore(
|
|
6131
|
+
(s) => {
|
|
6132
|
+
var _a;
|
|
6133
|
+
return ((_a = s.indicator) == null ? void 0 : _a.targetId) === dndId;
|
|
6134
|
+
}
|
|
6135
|
+
);
|
|
6136
|
+
const outlineDropZoneObject = useMemo15(
|
|
6137
|
+
() => ({ isDropTarget, ref }),
|
|
6138
|
+
[isDropTarget, ref]
|
|
6139
|
+
);
|
|
6140
|
+
return outlineDropZoneObject;
|
|
6141
|
+
};
|
|
6142
|
+
var use_outline_drop_zone_default = useOutlineDropZone;
|
|
6143
|
+
|
|
6144
|
+
// components/LayerTree/components/drop-line/index.tsx
|
|
6145
|
+
init_react_import();
|
|
6146
|
+
|
|
6147
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/drop-line/styles.module.css#css-module
|
|
6148
|
+
init_react_import();
|
|
6149
|
+
var styles_module_default14 = { "DropLine": "_DropLine_eyz3q_2", "DropLine--top": "_DropLine--top_eyz3q_12", "DropLine--bottom": "_DropLine--bottom_eyz3q_16", "DropLine--outset": "_DropLine--outset_eyz3q_20" };
|
|
6150
|
+
|
|
6151
|
+
// components/LayerTree/components/drop-line/index.tsx
|
|
6152
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
6153
|
+
var getClassName20 = get_class_name_factory_default("DropLine", styles_module_default14);
|
|
6154
|
+
var DropLine = ({
|
|
6155
|
+
edge,
|
|
6156
|
+
outset
|
|
6157
|
+
}) => /* @__PURE__ */ jsx37(
|
|
6158
|
+
"div",
|
|
6159
|
+
{
|
|
6160
|
+
className: getClassName20({
|
|
6161
|
+
top: edge === "top",
|
|
6162
|
+
bottom: edge === "bottom",
|
|
6163
|
+
outset: Boolean(outset)
|
|
6164
|
+
})
|
|
6165
|
+
}
|
|
6166
|
+
);
|
|
6167
|
+
|
|
6168
|
+
// components/LayerTree/components/layer-tree-items/index.ts
|
|
6169
|
+
init_react_import();
|
|
6170
|
+
|
|
6171
|
+
// components/LayerTree/components/layer-tree-items/static-layer-tree-items.tsx
|
|
6172
|
+
init_react_import();
|
|
6173
|
+
|
|
6174
|
+
// components/LayerTree/components/empty-zone-placeholder/index.tsx
|
|
6175
|
+
init_react_import();
|
|
6176
|
+
|
|
6177
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/empty-zone-placeholder/styles.module.css#css-module
|
|
6178
|
+
init_react_import();
|
|
6179
|
+
var styles_module_default15 = { "LayerTree-helper": "_LayerTree-helper_1niov_2" };
|
|
6180
|
+
|
|
6181
|
+
// components/LayerTree/components/empty-zone-placeholder/index.tsx
|
|
6182
|
+
import { jsx as jsx38, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6183
|
+
var getClassName21 = get_class_name_factory_default("LayerTree", styles_module_default15);
|
|
6184
|
+
var EmptyZonePlaceholder = ({
|
|
6185
|
+
zoneCompound
|
|
6186
|
+
}) => {
|
|
6187
|
+
const { ref, isDropTarget } = use_outline_drop_zone_default({
|
|
6188
|
+
kind: "empty",
|
|
6189
|
+
zoneCompound
|
|
6190
|
+
});
|
|
6191
|
+
const noItemsMsg = useMessage("outline-empty");
|
|
6192
|
+
return /* @__PURE__ */ jsxs11(
|
|
6193
|
+
"li",
|
|
6194
|
+
{
|
|
6195
|
+
className: getClassName21("helper"),
|
|
6196
|
+
"data-puck-drop-target": isDropTarget || void 0,
|
|
6197
|
+
ref,
|
|
6198
|
+
children: [
|
|
6199
|
+
noItemsMsg,
|
|
6200
|
+
isDropTarget && /* @__PURE__ */ jsx38(DropLine, { edge: "top" })
|
|
6201
|
+
]
|
|
6202
|
+
}
|
|
6203
|
+
);
|
|
6204
|
+
};
|
|
6205
|
+
|
|
6206
|
+
// components/LayerTree/components/layer/index.tsx
|
|
6207
|
+
init_react_import();
|
|
6208
|
+
import { forwardRef as forwardRef2, useCallback as useCallback16, useContext as useContext13 } from "react";
|
|
6209
|
+
|
|
6210
|
+
// components/LayerTree/lib/dnd/use-outline-row-dnd.ts
|
|
6211
|
+
init_react_import();
|
|
6212
|
+
import { useCallback as useCallback14, useMemo as useMemo16 } from "react";
|
|
6213
|
+
import { Feedback as Feedback2 } from "@dnd-kit/dom";
|
|
6214
|
+
import { useSortable as useSortable3 } from "@dnd-kit/react/sortable";
|
|
6215
|
+
var useOutlineRowDnd = ({
|
|
6216
|
+
componentType,
|
|
6217
|
+
index,
|
|
6218
|
+
itemId,
|
|
6219
|
+
zoneCompound
|
|
6220
|
+
}) => {
|
|
6221
|
+
const appStore = useAppStoreApi();
|
|
6222
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
6223
|
+
const accept = useMemo16(
|
|
6224
|
+
() => createOutlineAccept(
|
|
6225
|
+
{ appStore, outlineStore },
|
|
6226
|
+
{ kind: "row", itemId, zoneCompound }
|
|
6227
|
+
),
|
|
6228
|
+
[appStore, outlineStore, itemId, zoneCompound]
|
|
6229
|
+
);
|
|
6230
|
+
const collisionDetector = useMemo16(
|
|
6231
|
+
() => createDynamicCollisionDetector("y"),
|
|
6232
|
+
[]
|
|
6233
|
+
);
|
|
6234
|
+
const { handleRef, ref, isDragSource } = useSortable3({
|
|
6235
|
+
id: itemId,
|
|
6236
|
+
index,
|
|
6237
|
+
group: zoneCompound,
|
|
6238
|
+
type: OUTLINE_ITEM_TYPE,
|
|
6239
|
+
accept,
|
|
6240
|
+
data: {
|
|
6241
|
+
kind: "row",
|
|
6242
|
+
itemId,
|
|
6243
|
+
zoneCompound,
|
|
6244
|
+
index,
|
|
6245
|
+
componentType
|
|
6246
|
+
},
|
|
6247
|
+
collisionPriority: 1,
|
|
6248
|
+
collisionDetector,
|
|
6249
|
+
// Don't animate rows while dragging or dropping
|
|
6250
|
+
transition: { duration: 0 },
|
|
6251
|
+
plugins: (defaults) => [
|
|
6252
|
+
...defaults,
|
|
6253
|
+
// The source row stays rendered in place
|
|
6254
|
+
// The drop animation is disabled for a more snappy feel
|
|
6255
|
+
Feedback2.configure({ feedback: "clone", dropAnimation: null })
|
|
6256
|
+
]
|
|
6257
|
+
});
|
|
6258
|
+
const { indicatorPosition, isExpandCandidate, isTempExpanded } = useOutlineDndStore((s) => {
|
|
6259
|
+
var _a;
|
|
6260
|
+
return {
|
|
6261
|
+
indicatorPosition: ((_a = s.indicator) == null ? void 0 : _a.targetId) === itemId ? s.indicator.position : null,
|
|
6262
|
+
isExpandCandidate: s.expandCandidateId === itemId,
|
|
6263
|
+
isTempExpanded: s.tempExpandedIds.has(itemId)
|
|
6264
|
+
};
|
|
6265
|
+
});
|
|
6266
|
+
const rowRef = useCallback14(
|
|
6267
|
+
(element) => {
|
|
6268
|
+
ref(element);
|
|
6269
|
+
handleRef(element);
|
|
6270
|
+
},
|
|
6271
|
+
[ref, handleRef]
|
|
6272
|
+
);
|
|
6273
|
+
return {
|
|
6274
|
+
rowRef,
|
|
6275
|
+
isDragSource,
|
|
6276
|
+
indicatorPosition,
|
|
6277
|
+
isExpandCandidate,
|
|
6278
|
+
isTempExpanded
|
|
6279
|
+
};
|
|
6280
|
+
};
|
|
6281
|
+
|
|
6282
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer/styles.module.css#css-module
|
|
6283
|
+
init_react_import();
|
|
6284
|
+
var styles_module_default16 = { "Layer": "_Layer_1o110_1", "Layer-inner": "_Layer-inner_1o110_8", "Layer--isSortable": "_Layer--isSortable_1o110_18", "Layer-content": "_Layer-content_1o110_22", "Layer-clickable": "_Layer-clickable_1o110_29", "Layer-caret": "_Layer-caret_1o110_57", "Layer--containsZone": "_Layer--containsZone_1o110_68", "Layer-title": "_Layer-title_1o110_76", "Layer-name": "_Layer-name_1o110_85", "Layer-icon": "_Layer-icon_1o110_91", "Layer-zones": "_Layer-zones_1o110_101", "Layer--isExpanded": "_Layer--isExpanded_1o110_106", "Layer--isSelected": "_Layer--isSelected_1o110_115", "Layer--isExpandCandidate": "_Layer--isExpandCandidate_1o110_138", "Layer--isDragSource": "_Layer--isDragSource_1o110_143" };
|
|
6285
|
+
|
|
6286
|
+
// components/LayerTree/components/layer-actions/index.tsx
|
|
6287
|
+
init_react_import();
|
|
6288
|
+
import { useCallback as useCallback15 } from "react";
|
|
6289
|
+
import { useShallow as useShallow7 } from "zustand/react/shallow";
|
|
6290
|
+
|
|
6291
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-actions/styles.module.css#css-module
|
|
6292
|
+
init_react_import();
|
|
6293
|
+
var styles_module_default17 = { "LayerActions": "_LayerActions_1m5z5_2", "LayerActions--visible": "_LayerActions--visible_1m5z5_17" };
|
|
6294
|
+
|
|
6295
|
+
// components/LayerTree/components/layer-actions/index.tsx
|
|
6296
|
+
import { jsx as jsx39, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6297
|
+
var getClassName22 = get_class_name_factory_default("LayerActions", styles_module_default17);
|
|
6298
|
+
var LayerActions = ({
|
|
6299
|
+
node,
|
|
6300
|
+
visible
|
|
6301
|
+
}) => {
|
|
6302
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
6303
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
6304
|
+
const permissions = useAppStore(
|
|
6305
|
+
useShallow7((s) => {
|
|
6306
|
+
const item = getItem(
|
|
6307
|
+
{ index: node.index, zone: node.zoneCompound },
|
|
6308
|
+
s.state
|
|
6309
|
+
);
|
|
6310
|
+
const itemPermissions = s.permissions.getPermissions({ item });
|
|
6311
|
+
return {
|
|
6312
|
+
delete: itemPermissions.delete,
|
|
6313
|
+
duplicate: itemPermissions.duplicate
|
|
6314
|
+
};
|
|
6315
|
+
})
|
|
6316
|
+
);
|
|
6317
|
+
const duplicateMsg = useMessage("outline-item-duplicate");
|
|
6318
|
+
const deleteMsg = useMessage("outline-item-delete");
|
|
6319
|
+
const deleteItem = useCallback15(
|
|
6320
|
+
(e) => {
|
|
6321
|
+
e.stopPropagation();
|
|
6322
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6323
|
+
return;
|
|
6324
|
+
}
|
|
6325
|
+
dispatch({
|
|
6326
|
+
type: "remove",
|
|
6327
|
+
index: node.index,
|
|
6328
|
+
zone: node.zoneCompound
|
|
6329
|
+
});
|
|
6330
|
+
},
|
|
6331
|
+
[dispatch, outlineStore, node]
|
|
6332
|
+
);
|
|
6333
|
+
const duplicateItem = useCallback15(
|
|
6334
|
+
(e) => {
|
|
6335
|
+
e.stopPropagation();
|
|
6336
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6337
|
+
return;
|
|
6338
|
+
}
|
|
6339
|
+
dispatch({
|
|
6340
|
+
type: "duplicate",
|
|
6341
|
+
sourceIndex: node.index,
|
|
6342
|
+
sourceZone: node.zoneCompound
|
|
6343
|
+
});
|
|
6344
|
+
},
|
|
6345
|
+
[dispatch, outlineStore, node.index, node.zoneCompound]
|
|
6346
|
+
);
|
|
6347
|
+
if (!permissions.delete && !permissions.duplicate) {
|
|
6348
|
+
return null;
|
|
6349
|
+
}
|
|
6350
|
+
return /* @__PURE__ */ jsxs12("div", { className: getClassName22({ visible }), children: [
|
|
6351
|
+
permissions.duplicate && /* @__PURE__ */ jsx39(IconButton, { onClick: duplicateItem, title: duplicateMsg, type: "button", children: /* @__PURE__ */ jsx39(Copy, {}) }),
|
|
6352
|
+
permissions.delete && /* @__PURE__ */ jsx39(IconButton, { onClick: deleteItem, title: deleteMsg, type: "button", children: /* @__PURE__ */ jsx39(Trash, {}) })
|
|
6029
6353
|
] });
|
|
6030
6354
|
};
|
|
6355
|
+
|
|
6356
|
+
// components/LayerTree/components/layer/index.tsx
|
|
6357
|
+
import { jsx as jsx40, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6358
|
+
var getClassName23 = get_class_name_factory_default("Layer", styles_module_default16);
|
|
6359
|
+
var Layer = forwardRef2(function Layer2({
|
|
6360
|
+
dataIndex,
|
|
6361
|
+
depth,
|
|
6362
|
+
isSelected,
|
|
6363
|
+
node,
|
|
6364
|
+
selectedId
|
|
6365
|
+
}, ref) {
|
|
6366
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
6367
|
+
const isExpanded = useAppStore(
|
|
6368
|
+
(s) => {
|
|
6369
|
+
var _a, _b;
|
|
6370
|
+
return (_b = (_a = s.state.ui.itemExpanded) == null ? void 0 : _a[node.itemId]) != null ? _b : false;
|
|
6371
|
+
}
|
|
6372
|
+
);
|
|
6373
|
+
const isHovering = useContextStore(
|
|
6374
|
+
ZoneStoreContext,
|
|
6375
|
+
(s) => s.hoveringComponent === node.itemId
|
|
6376
|
+
);
|
|
6377
|
+
const isDraggable = useAppStore((s) => {
|
|
6378
|
+
var _a;
|
|
6379
|
+
const item = getItem(
|
|
6380
|
+
{ index: node.index, zone: node.zoneCompound },
|
|
6381
|
+
s.state
|
|
6382
|
+
);
|
|
6383
|
+
return (_a = s.permissions.getPermissions({ item })) == null ? void 0 : _a.drag;
|
|
6384
|
+
});
|
|
6385
|
+
const {
|
|
6386
|
+
indicatorPosition,
|
|
6387
|
+
isDragSource,
|
|
6388
|
+
isExpandCandidate,
|
|
6389
|
+
isTempExpanded,
|
|
6390
|
+
rowRef
|
|
6391
|
+
} = useOutlineRowDnd({
|
|
6392
|
+
componentType: node.componentType,
|
|
6393
|
+
index: node.index,
|
|
6394
|
+
itemId: node.itemId,
|
|
6395
|
+
zoneCompound: node.zoneCompound
|
|
6396
|
+
});
|
|
6397
|
+
const zoneStore = useContext13(ZoneStoreContext);
|
|
6398
|
+
const outlineStore = useOutlineDndStoreApi();
|
|
6399
|
+
const collapseMsg = useMessage("outline-item-collapse");
|
|
6400
|
+
const expandMsg = useMessage("outline-item-expand");
|
|
6401
|
+
const containsZone = node.childZones.length > 0;
|
|
6402
|
+
const setItemSelector = useCallback16(
|
|
6403
|
+
(itemSelector) => {
|
|
6404
|
+
dispatch({ type: "setUi", ui: { itemSelector } });
|
|
6405
|
+
},
|
|
6406
|
+
[dispatch]
|
|
6407
|
+
);
|
|
6408
|
+
const shouldBeExpanded = isExpanded || isTempExpanded;
|
|
6409
|
+
const shouldShowIndicator = indicatorPosition !== null;
|
|
6410
|
+
const shouldShowZoneTitles = node.childZones.length !== 1;
|
|
6411
|
+
return /* @__PURE__ */ jsxs13(
|
|
6412
|
+
"li",
|
|
6413
|
+
{
|
|
6414
|
+
ref,
|
|
6415
|
+
className: getClassName23({
|
|
6416
|
+
containsZone,
|
|
6417
|
+
isDragSource,
|
|
6418
|
+
isExpandCandidate,
|
|
6419
|
+
isExpanded: shouldBeExpanded,
|
|
6420
|
+
isHovering,
|
|
6421
|
+
isSelected,
|
|
6422
|
+
isSortable: isDraggable
|
|
6423
|
+
}),
|
|
6424
|
+
"data-index": dataIndex,
|
|
6425
|
+
"data-puck-layer-tree-id": node.itemId,
|
|
6426
|
+
children: [
|
|
6427
|
+
shouldShowIndicator && /* @__PURE__ */ jsx40(
|
|
6428
|
+
DropLine,
|
|
6429
|
+
{
|
|
6430
|
+
edge: indicatorPosition === "before" ? "top" : "bottom",
|
|
6431
|
+
outset: true
|
|
6432
|
+
}
|
|
6433
|
+
),
|
|
6434
|
+
/* @__PURE__ */ jsxs13(
|
|
6435
|
+
"div",
|
|
6436
|
+
{
|
|
6437
|
+
className: getClassName23("inner"),
|
|
6438
|
+
ref: rowRef,
|
|
6439
|
+
onMouseEnter: (e) => {
|
|
6440
|
+
e.stopPropagation();
|
|
6441
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6442
|
+
return;
|
|
6443
|
+
}
|
|
6444
|
+
zoneStore.setState({ hoveringComponent: node.itemId });
|
|
6445
|
+
},
|
|
6446
|
+
onMouseLeave: (e) => {
|
|
6447
|
+
e.stopPropagation();
|
|
6448
|
+
zoneStore.setState({ hoveringComponent: null });
|
|
6449
|
+
},
|
|
6450
|
+
children: [
|
|
6451
|
+
/* @__PURE__ */ jsx40("div", { className: getClassName23("caret"), children: /* @__PURE__ */ jsx40(
|
|
6452
|
+
IconButton,
|
|
6453
|
+
{
|
|
6454
|
+
onClick: (e) => {
|
|
6455
|
+
e.stopPropagation();
|
|
6456
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6457
|
+
return;
|
|
6458
|
+
}
|
|
6459
|
+
dispatch({
|
|
6460
|
+
type: "setUi",
|
|
6461
|
+
ui: (previous) => {
|
|
6462
|
+
var _a;
|
|
6463
|
+
const newItemExpanded = __spreadValues({}, previous.itemExpanded);
|
|
6464
|
+
if ((_a = previous.itemExpanded) == null ? void 0 : _a[node.itemId]) {
|
|
6465
|
+
delete newItemExpanded[node.itemId];
|
|
6466
|
+
} else {
|
|
6467
|
+
newItemExpanded[node.itemId] = true;
|
|
6468
|
+
}
|
|
6469
|
+
return {
|
|
6470
|
+
itemExpanded: newItemExpanded
|
|
6471
|
+
};
|
|
6472
|
+
},
|
|
6473
|
+
recordHistory: false
|
|
6474
|
+
});
|
|
6475
|
+
},
|
|
6476
|
+
title: isExpanded ? collapseMsg : expandMsg,
|
|
6477
|
+
type: "button",
|
|
6478
|
+
children: /* @__PURE__ */ jsx40(ChevronRight, {})
|
|
6479
|
+
}
|
|
6480
|
+
) }),
|
|
6481
|
+
/* @__PURE__ */ jsxs13("div", { className: getClassName23("content"), children: [
|
|
6482
|
+
/* @__PURE__ */ jsx40(
|
|
6483
|
+
"button",
|
|
6484
|
+
{
|
|
6485
|
+
type: "button",
|
|
6486
|
+
className: getClassName23("clickable"),
|
|
6487
|
+
onClick: () => {
|
|
6488
|
+
if (outlineStore.getState().status !== "idle") {
|
|
6489
|
+
return;
|
|
6490
|
+
}
|
|
6491
|
+
setItemSelector({
|
|
6492
|
+
index: node.index,
|
|
6493
|
+
zone: node.zoneCompound
|
|
6494
|
+
});
|
|
6495
|
+
zoneStore.getState().scrollToComponent(node.itemId);
|
|
6496
|
+
},
|
|
6497
|
+
children: /* @__PURE__ */ jsxs13("div", { className: getClassName23("title"), children: [
|
|
6498
|
+
/* @__PURE__ */ jsx40("div", { className: getClassName23("icon"), children: node.componentType === "Text" || node.componentType === "Heading" ? (
|
|
6499
|
+
// Sized in CSS via --puck-outline-icon-size
|
|
6500
|
+
/* @__PURE__ */ jsx40(Type, {})
|
|
6501
|
+
) : /* @__PURE__ */ jsx40(LayoutGrid, {}) }),
|
|
6502
|
+
/* @__PURE__ */ jsx40("div", { className: getClassName23("name"), children: node.label })
|
|
6503
|
+
] })
|
|
6504
|
+
}
|
|
6505
|
+
),
|
|
6506
|
+
/* @__PURE__ */ jsx40(LayerActions, { node, visible: isHovering && !isDragSource })
|
|
6507
|
+
] })
|
|
6508
|
+
]
|
|
6509
|
+
}
|
|
6510
|
+
),
|
|
6511
|
+
containsZone && shouldBeExpanded && node.childZones.map((childZone) => /* @__PURE__ */ jsx40("div", { className: getClassName23("zones"), children: /* @__PURE__ */ jsx40(
|
|
6512
|
+
LayerTreeZone,
|
|
6513
|
+
{
|
|
6514
|
+
depth: shouldShowZoneTitles ? depth + 1 : depth,
|
|
6515
|
+
selectedId,
|
|
6516
|
+
tree: shouldShowZoneTitles ? childZone : __spreadProps(__spreadValues({}, childZone), { label: void 0 })
|
|
6517
|
+
}
|
|
6518
|
+
) }, childZone.zoneCompound))
|
|
6519
|
+
]
|
|
6520
|
+
}
|
|
6521
|
+
);
|
|
6522
|
+
});
|
|
6523
|
+
|
|
6524
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-items/styles.module.css#css-module
|
|
6525
|
+
init_react_import();
|
|
6526
|
+
var styles_module_default18 = { "LayerTree": "_LayerTree_o5tyt_1", "LayerTree--nested": "_LayerTree--nested_o5tyt_12" };
|
|
6527
|
+
|
|
6528
|
+
// components/LayerTree/components/layer-tree-items/static-layer-tree-items.tsx
|
|
6529
|
+
import { jsx as jsx41, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6530
|
+
var getClassName24 = get_class_name_factory_default("LayerTree", styles_module_default18);
|
|
6031
6531
|
var StaticLayerTreeItems = ({
|
|
6032
6532
|
depth,
|
|
6033
6533
|
selectedId,
|
|
6034
|
-
selectedPathIds,
|
|
6035
6534
|
tree
|
|
6036
6535
|
}) => {
|
|
6037
|
-
return /* @__PURE__ */
|
|
6038
|
-
tree.items.length === 0 && /* @__PURE__ */
|
|
6039
|
-
tree.items.map((node) => /* @__PURE__ */
|
|
6536
|
+
return /* @__PURE__ */ jsxs14("ul", { className: getClassName24({ nested: depth > 0 }), children: [
|
|
6537
|
+
tree.items.length === 0 && /* @__PURE__ */ jsx41(EmptyZonePlaceholder, { zoneCompound: tree.zoneCompound }),
|
|
6538
|
+
tree.items.map((node) => /* @__PURE__ */ jsx41(
|
|
6040
6539
|
Layer,
|
|
6041
6540
|
{
|
|
6042
|
-
childIsSelected: selectedPathIds.has(node.itemId),
|
|
6043
6541
|
depth,
|
|
6044
6542
|
isSelected: selectedId === node.itemId,
|
|
6045
6543
|
node,
|
|
6046
|
-
selectedId
|
|
6047
|
-
selectedPathIds
|
|
6544
|
+
selectedId
|
|
6048
6545
|
},
|
|
6049
6546
|
node.itemId
|
|
6050
6547
|
))
|
|
6051
6548
|
] });
|
|
6052
6549
|
};
|
|
6550
|
+
|
|
6551
|
+
// components/LayerTree/components/layer-tree-items/virtualized-layer-tree-items.tsx
|
|
6552
|
+
init_react_import();
|
|
6553
|
+
import { defaultRangeExtractor as defaultRangeExtractor2, useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
|
|
6554
|
+
import { useCallback as useCallback17, useRef as useRef10 } from "react";
|
|
6555
|
+
import { jsx as jsx42, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6556
|
+
var getClassName25 = get_class_name_factory_default("LayerTree", styles_module_default18);
|
|
6557
|
+
var DEFAULT_LAYER_ROW_HEIGHT = 32;
|
|
6558
|
+
var LAYER_TREE_VIRTUALIZATION_OVERSCAN = 8;
|
|
6559
|
+
var measuredRowHeights = /* @__PURE__ */ new Map();
|
|
6560
|
+
var getEstimatedRowHeight = (itemId) => {
|
|
6561
|
+
var _a;
|
|
6562
|
+
return (_a = measuredRowHeights.get(itemId)) != null ? _a : DEFAULT_LAYER_ROW_HEIGHT;
|
|
6563
|
+
};
|
|
6564
|
+
var cacheMeasuredRowHeight = (itemId, height) => {
|
|
6565
|
+
if (height <= 0) {
|
|
6566
|
+
return;
|
|
6567
|
+
}
|
|
6568
|
+
measuredRowHeights.set(itemId, height);
|
|
6569
|
+
};
|
|
6570
|
+
var getFirstScrollAncestor = (el) => {
|
|
6571
|
+
var _a;
|
|
6572
|
+
let current = (_a = el == null ? void 0 : el.parentElement) != null ? _a : null;
|
|
6573
|
+
while (current) {
|
|
6574
|
+
const { overflow, overflowY } = getComputedStyle(current);
|
|
6575
|
+
if ([overflow, overflowY].some((value) => /auto|scroll/.test(value))) {
|
|
6576
|
+
return current;
|
|
6577
|
+
}
|
|
6578
|
+
current = current.parentElement;
|
|
6579
|
+
}
|
|
6580
|
+
return null;
|
|
6581
|
+
};
|
|
6053
6582
|
var VirtualizedLayerTreeItems = ({
|
|
6054
6583
|
depth,
|
|
6055
6584
|
selectedId,
|
|
6056
|
-
selectedPathIds,
|
|
6057
6585
|
tree
|
|
6058
6586
|
}) => {
|
|
6059
6587
|
const listRef = useRef10(null);
|
|
6588
|
+
const pinnedIndex = useOutlineDndStore(
|
|
6589
|
+
(s) => {
|
|
6590
|
+
var _a;
|
|
6591
|
+
return ((_a = s.draggedRow) == null ? void 0 : _a.zoneCompound) === tree.zoneCompound ? s.draggedRow.index : null;
|
|
6592
|
+
}
|
|
6593
|
+
);
|
|
6594
|
+
const rangeExtractor = useCallback17(
|
|
6595
|
+
(range) => {
|
|
6596
|
+
const indexes = defaultRangeExtractor2(range);
|
|
6597
|
+
if (pinnedIndex !== null && !indexes.includes(pinnedIndex)) {
|
|
6598
|
+
indexes.push(pinnedIndex);
|
|
6599
|
+
indexes.sort((a, b) => a - b);
|
|
6600
|
+
}
|
|
6601
|
+
return indexes;
|
|
6602
|
+
},
|
|
6603
|
+
[pinnedIndex]
|
|
6604
|
+
);
|
|
6060
6605
|
const virtualizer = useVirtualizer2({
|
|
6061
6606
|
count: tree.items.length,
|
|
6062
6607
|
estimateSize: (index) => getEstimatedRowHeight(tree.items[index].itemId),
|
|
6063
6608
|
getItemKey: (index) => tree.items[index].itemId,
|
|
6064
|
-
getScrollElement: () =>
|
|
6609
|
+
getScrollElement: () => getFirstScrollAncestor(listRef.current),
|
|
6065
6610
|
overscan: LAYER_TREE_VIRTUALIZATION_OVERSCAN,
|
|
6611
|
+
rangeExtractor,
|
|
6066
6612
|
measureElement: (element) => {
|
|
6067
6613
|
const height = Math.ceil(element.getBoundingClientRect().height);
|
|
6068
6614
|
const itemId = element.dataset.puckLayerTreeId;
|
|
@@ -6082,7 +6628,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6082
6628
|
const gapSize = Math.max(virtualItem.start - previousEnd, 0);
|
|
6083
6629
|
if (gapSize > 0) {
|
|
6084
6630
|
renderedItems.push(
|
|
6085
|
-
/* @__PURE__ */
|
|
6631
|
+
/* @__PURE__ */ jsx42(
|
|
6086
6632
|
"li",
|
|
6087
6633
|
{
|
|
6088
6634
|
"aria-hidden": "true",
|
|
@@ -6093,17 +6639,15 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6093
6639
|
);
|
|
6094
6640
|
}
|
|
6095
6641
|
renderedItems.push(
|
|
6096
|
-
/* @__PURE__ */
|
|
6642
|
+
/* @__PURE__ */ jsx42(
|
|
6097
6643
|
Layer,
|
|
6098
6644
|
{
|
|
6099
|
-
childIsSelected: selectedPathIds.has(node.itemId),
|
|
6100
6645
|
dataIndex: virtualItem.index,
|
|
6101
6646
|
depth,
|
|
6102
6647
|
isSelected: selectedId === node.itemId,
|
|
6103
6648
|
node,
|
|
6104
6649
|
ref: virtualizer.measureElement,
|
|
6105
|
-
selectedId
|
|
6106
|
-
selectedPathIds
|
|
6650
|
+
selectedId
|
|
6107
6651
|
},
|
|
6108
6652
|
node.itemId
|
|
6109
6653
|
)
|
|
@@ -6114,7 +6658,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6114
6658
|
const trailingGap = Math.max(totalSize - previousEnd, 0);
|
|
6115
6659
|
if (trailingGap > 0) {
|
|
6116
6660
|
renderedItems.push(
|
|
6117
|
-
/* @__PURE__ */
|
|
6661
|
+
/* @__PURE__ */ jsx42(
|
|
6118
6662
|
"li",
|
|
6119
6663
|
{
|
|
6120
6664
|
"aria-hidden": "true",
|
|
@@ -6124,42 +6668,480 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6124
6668
|
)
|
|
6125
6669
|
);
|
|
6126
6670
|
}
|
|
6127
|
-
return /* @__PURE__ */
|
|
6128
|
-
tree.items.length === 0 && /* @__PURE__ */
|
|
6671
|
+
return /* @__PURE__ */ jsxs15("ul", { className: getClassName25({ nested: depth > 0 }), ref: listRef, children: [
|
|
6672
|
+
tree.items.length === 0 && /* @__PURE__ */ jsx42(EmptyZonePlaceholder, { zoneCompound: tree.zoneCompound }),
|
|
6129
6673
|
renderedItems
|
|
6130
6674
|
] });
|
|
6131
6675
|
};
|
|
6676
|
+
|
|
6677
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-zone/styles.module.css#css-module
|
|
6678
|
+
init_react_import();
|
|
6679
|
+
var styles_module_default19 = { "LayerTree-zoneTitle": "_LayerTree-zoneTitle_fvhlh_2", "LayerTree-zoneIcon": "_LayerTree-zoneIcon_fvhlh_19" };
|
|
6680
|
+
|
|
6681
|
+
// components/LayerTree/components/layer-tree-zone/index.tsx
|
|
6682
|
+
import { Fragment as Fragment10, jsx as jsx43, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6683
|
+
var getClassName26 = get_class_name_factory_default("LayerTree", styles_module_default19);
|
|
6684
|
+
var MIN_VIRTUALIZED_LAYER_COUNT = 25;
|
|
6685
|
+
var ZoneLabel = ({
|
|
6686
|
+
label,
|
|
6687
|
+
zoneCompound
|
|
6688
|
+
}) => {
|
|
6689
|
+
const { ref, isDropTarget } = use_outline_drop_zone_default({
|
|
6690
|
+
kind: "label",
|
|
6691
|
+
zoneCompound
|
|
6692
|
+
});
|
|
6693
|
+
return /* @__PURE__ */ jsxs16(
|
|
6694
|
+
"div",
|
|
6695
|
+
{
|
|
6696
|
+
className: getClassName26("zoneTitle"),
|
|
6697
|
+
"data-puck-drop-target": isDropTarget || void 0,
|
|
6698
|
+
ref,
|
|
6699
|
+
children: [
|
|
6700
|
+
/* @__PURE__ */ jsx43("div", { className: getClassName26("zoneIcon"), children: /* @__PURE__ */ jsx43(Layers, {}) }),
|
|
6701
|
+
label,
|
|
6702
|
+
isDropTarget && /* @__PURE__ */ jsx43(DropLine, { edge: "bottom" })
|
|
6703
|
+
]
|
|
6704
|
+
}
|
|
6705
|
+
);
|
|
6706
|
+
};
|
|
6707
|
+
var LayerTreeZone = ({
|
|
6708
|
+
depth,
|
|
6709
|
+
selectedId,
|
|
6710
|
+
tree
|
|
6711
|
+
}) => {
|
|
6712
|
+
const shouldVirtualize = depth === 0 && tree.items.length >= MIN_VIRTUALIZED_LAYER_COUNT;
|
|
6713
|
+
return /* @__PURE__ */ jsxs16(Fragment10, { children: [
|
|
6714
|
+
tree.label && /* @__PURE__ */ jsx43(ZoneLabel, { label: tree.label, zoneCompound: tree.zoneCompound }),
|
|
6715
|
+
shouldVirtualize ? /* @__PURE__ */ jsx43(
|
|
6716
|
+
VirtualizedLayerTreeItems,
|
|
6717
|
+
{
|
|
6718
|
+
depth,
|
|
6719
|
+
selectedId,
|
|
6720
|
+
tree
|
|
6721
|
+
}
|
|
6722
|
+
) : /* @__PURE__ */ jsx43(
|
|
6723
|
+
StaticLayerTreeItems,
|
|
6724
|
+
{
|
|
6725
|
+
depth,
|
|
6726
|
+
selectedId,
|
|
6727
|
+
tree
|
|
6728
|
+
}
|
|
6729
|
+
)
|
|
6730
|
+
] });
|
|
6731
|
+
};
|
|
6732
|
+
|
|
6733
|
+
// components/LayerTree/components/outline-dnd-provider/index.tsx
|
|
6734
|
+
init_react_import();
|
|
6735
|
+
import { PointerActivationConstraints as PointerActivationConstraints3 } from "@dnd-kit/dom";
|
|
6736
|
+
import { DragDropProvider as DragDropProvider3 } from "@dnd-kit/react";
|
|
6737
|
+
import { useContext as useContext14, useMemo as useMemo17, useState as useState18 } from "react";
|
|
6738
|
+
|
|
6739
|
+
// components/LayerTree/lib/dnd/handlers.ts
|
|
6740
|
+
init_react_import();
|
|
6741
|
+
import { effect as effect2 } from "@dnd-kit/state";
|
|
6742
|
+
|
|
6743
|
+
// lib/data/component-has-slots.ts
|
|
6744
|
+
init_react_import();
|
|
6745
|
+
function componentDataHasSlots(componentId, indexes) {
|
|
6746
|
+
return Object.keys(indexes).some(
|
|
6747
|
+
(zoneCompound) => zoneCompound.startsWith(`${componentId}:`)
|
|
6748
|
+
);
|
|
6749
|
+
}
|
|
6750
|
+
|
|
6751
|
+
// components/LayerTree/lib/dnd/handlers.ts
|
|
6752
|
+
var SCROLL_SETTLE_FRAMES = 2;
|
|
6753
|
+
var SCROLL_SETTLE_MAX_FRAMES = 60;
|
|
6754
|
+
var scrollToComponentWhenSettled = (id, scrollToComponent) => {
|
|
6755
|
+
let lastTop;
|
|
6756
|
+
let stableFrames = 0;
|
|
6757
|
+
let totalFrames = 0;
|
|
6758
|
+
const check = () => {
|
|
6759
|
+
var _a;
|
|
6760
|
+
const el = (_a = getFrame()) == null ? void 0 : _a.querySelector(`[data-puck-component="${id}"]`);
|
|
6761
|
+
const top = el ? el.getBoundingClientRect().top : null;
|
|
6762
|
+
stableFrames = top === lastTop ? stableFrames + 1 : 0;
|
|
6763
|
+
lastTop = top;
|
|
6764
|
+
totalFrames += 1;
|
|
6765
|
+
if (stableFrames >= SCROLL_SETTLE_FRAMES || totalFrames >= SCROLL_SETTLE_MAX_FRAMES) {
|
|
6766
|
+
scrollToComponent(id);
|
|
6767
|
+
return;
|
|
6768
|
+
}
|
|
6769
|
+
requestAnimationFrame(check);
|
|
6770
|
+
};
|
|
6771
|
+
requestAnimationFrame(check);
|
|
6772
|
+
};
|
|
6773
|
+
var setPreviewFence = (enabled) => {
|
|
6774
|
+
if (typeof document === "undefined") return;
|
|
6775
|
+
const frameEl = document.getElementById("preview-frame");
|
|
6776
|
+
if (enabled) {
|
|
6777
|
+
frameEl == null ? void 0 : frameEl.setAttribute("data-puck-outline-dragging", "true");
|
|
6778
|
+
} else {
|
|
6779
|
+
frameEl == null ? void 0 : frameEl.removeAttribute("data-puck-outline-dragging");
|
|
6780
|
+
}
|
|
6781
|
+
};
|
|
6782
|
+
var onOutlineBeforeDragStart = (event, ctx) => {
|
|
6783
|
+
const source = event.operation.source;
|
|
6784
|
+
const data = source == null ? void 0 : source.data;
|
|
6785
|
+
if (!source || !data) return;
|
|
6786
|
+
const appState = ctx.appStore.getState();
|
|
6787
|
+
const item = getItem(
|
|
6788
|
+
{ zone: data.zoneCompound, index: data.index },
|
|
6789
|
+
appState.state
|
|
6790
|
+
);
|
|
6791
|
+
if (!item || !appState.permissions.getPermissions({ item }).drag) {
|
|
6792
|
+
event.preventDefault();
|
|
6793
|
+
return;
|
|
6794
|
+
}
|
|
6795
|
+
ctx.outlineDndStore.getState().startDrag({
|
|
6796
|
+
itemId: data.itemId,
|
|
6797
|
+
zoneCompound: data.zoneCompound,
|
|
6798
|
+
index: data.index,
|
|
6799
|
+
componentType: data.componentType
|
|
6800
|
+
});
|
|
6801
|
+
setPreviewFence(true);
|
|
6802
|
+
appState.dispatch({
|
|
6803
|
+
type: "setUi",
|
|
6804
|
+
ui: { isDragging: true },
|
|
6805
|
+
recordHistory: false
|
|
6806
|
+
});
|
|
6807
|
+
};
|
|
6808
|
+
var onOutlineDragMove = (event, manager, ctx) => {
|
|
6809
|
+
var _a, _b;
|
|
6810
|
+
const outlineStore = ctx.outlineDndStore.getState();
|
|
6811
|
+
const dragged = outlineStore.draggedRow;
|
|
6812
|
+
if (!dragged) return;
|
|
6813
|
+
const target = event.operation.target;
|
|
6814
|
+
if (!target) {
|
|
6815
|
+
outlineStore.cancelPendingExpand();
|
|
6816
|
+
outlineStore.clearTarget();
|
|
6817
|
+
return;
|
|
6818
|
+
}
|
|
6819
|
+
const targetData = target.data;
|
|
6820
|
+
if (targetData.kind === "zone") {
|
|
6821
|
+
outlineStore.cancelPendingExpand();
|
|
6822
|
+
outlineStore.setTarget(
|
|
6823
|
+
{ targetId: target.id.toString(), position: "inside" },
|
|
6824
|
+
{ zone: targetData.zoneCompound, index: 0 }
|
|
6825
|
+
);
|
|
6826
|
+
return;
|
|
6827
|
+
}
|
|
6828
|
+
const { config, state } = ctx.appStore.getState();
|
|
6829
|
+
const indexes = state.indexes;
|
|
6830
|
+
const cache = outlineStore.acceptCache;
|
|
6831
|
+
if (zoneAcceptsComponent(
|
|
6832
|
+
cache,
|
|
6833
|
+
targetData.zoneCompound,
|
|
6834
|
+
dragged.componentType,
|
|
6835
|
+
config,
|
|
6836
|
+
indexes
|
|
6837
|
+
)) {
|
|
6838
|
+
const collisionData = (_a = manager.collisionObserver.collisions[0]) == null ? void 0 : _a.data;
|
|
6839
|
+
const position = getCollisionPosition(collisionData == null ? void 0 : collisionData.direction);
|
|
6840
|
+
outlineStore.setTarget(
|
|
6841
|
+
{ targetId: target.id.toString(), position },
|
|
6842
|
+
{
|
|
6843
|
+
zone: targetData.zoneCompound,
|
|
6844
|
+
index: getInsertIndex({
|
|
6845
|
+
position,
|
|
6846
|
+
sourceIndex: dragged.index,
|
|
6847
|
+
targetIndex: targetData.index,
|
|
6848
|
+
isSameZone: targetData.zoneCompound === dragged.zoneCompound
|
|
6849
|
+
})
|
|
6850
|
+
}
|
|
6851
|
+
);
|
|
6852
|
+
} else {
|
|
6853
|
+
outlineStore.clearTarget();
|
|
6854
|
+
}
|
|
6855
|
+
const isCurrentlyExpanded = Boolean((_b = state.ui.itemExpanded) == null ? void 0 : _b[targetData.itemId]) || outlineStore.tempExpandedIds.has(targetData.itemId);
|
|
6856
|
+
const isExpandable = componentDataHasSlots(targetData.itemId, indexes.zones);
|
|
6857
|
+
if (!isCurrentlyExpanded && isExpandable) {
|
|
6858
|
+
outlineStore.scheduleExpand(targetData.itemId, () => {
|
|
6859
|
+
requestAnimationFrame(() => manager.collisionObserver.forceUpdate(true));
|
|
6860
|
+
});
|
|
6861
|
+
} else {
|
|
6862
|
+
outlineStore.cancelPendingExpand();
|
|
6863
|
+
}
|
|
6864
|
+
};
|
|
6865
|
+
var onOutlineDragEnd = (event, ctx) => {
|
|
6866
|
+
const { source } = event.operation;
|
|
6867
|
+
const outlineDnDState = ctx.outlineDndStore.getState();
|
|
6868
|
+
const dragged = outlineDnDState.draggedRow;
|
|
6869
|
+
const drop = event.canceled ? null : outlineDnDState.drop;
|
|
6870
|
+
const dispatch = ctx.appStore.getState().dispatch;
|
|
6871
|
+
setPreviewFence(false);
|
|
6872
|
+
if (dragged && drop) {
|
|
6873
|
+
moveComponent(
|
|
6874
|
+
dragged.itemId,
|
|
6875
|
+
{ zone: dragged.zoneCompound, index: dragged.index },
|
|
6876
|
+
{ zone: drop.zone, index: drop.index },
|
|
6877
|
+
ctx.appStore
|
|
6878
|
+
);
|
|
6879
|
+
const moved = drop.zone !== dragged.zoneCompound || drop.index !== dragged.index;
|
|
6880
|
+
dispatch({
|
|
6881
|
+
type: "setUi",
|
|
6882
|
+
ui: {
|
|
6883
|
+
itemSelector: { zone: drop.zone, index: drop.index },
|
|
6884
|
+
isDragging: false
|
|
6885
|
+
},
|
|
6886
|
+
recordHistory: moved
|
|
6887
|
+
});
|
|
6888
|
+
scrollToComponentWhenSettled(dragged.itemId, ctx.scrollToComponent);
|
|
6889
|
+
} else {
|
|
6890
|
+
dispatch({
|
|
6891
|
+
type: "setUi",
|
|
6892
|
+
ui: { isDragging: false },
|
|
6893
|
+
recordHistory: false
|
|
6894
|
+
});
|
|
6895
|
+
}
|
|
6896
|
+
outlineDnDState.endDrag();
|
|
6897
|
+
const reset = () => ctx.outlineDndStore.getState().reset();
|
|
6898
|
+
if (!source || source.status === "idle") {
|
|
6899
|
+
reset();
|
|
6900
|
+
} else {
|
|
6901
|
+
const dispose = effect2(() => {
|
|
6902
|
+
if (source.status === "idle") {
|
|
6903
|
+
reset();
|
|
6904
|
+
dispose == null ? void 0 : dispose();
|
|
6905
|
+
}
|
|
6906
|
+
});
|
|
6907
|
+
}
|
|
6908
|
+
};
|
|
6909
|
+
|
|
6910
|
+
// components/LayerTree/components/outline-dnd-provider/index.tsx
|
|
6911
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
6912
|
+
var NO_SENSORS = [];
|
|
6913
|
+
var OutlineDndProvider = ({ children }) => {
|
|
6914
|
+
const appStore = useAppStoreApi();
|
|
6915
|
+
const zoneStore = useContext14(ZoneStoreContext);
|
|
6916
|
+
const [outlineDndStore] = useState18(() => createOutlineDndStore());
|
|
6917
|
+
const disableOutlineDrag = useAppStore(
|
|
6918
|
+
(s) => {
|
|
6919
|
+
var _a, _b;
|
|
6920
|
+
return (_b = (_a = s.dnd) == null ? void 0 : _a.disableOutlineDrag) != null ? _b : false;
|
|
6921
|
+
}
|
|
6922
|
+
);
|
|
6923
|
+
const sensors = useSensors({
|
|
6924
|
+
mouse: [new PointerActivationConstraints3.Distance({ value: 5 })]
|
|
6925
|
+
});
|
|
6926
|
+
const dragContext = useMemo17(
|
|
6927
|
+
() => ({
|
|
6928
|
+
outlineDndStore,
|
|
6929
|
+
appStore,
|
|
6930
|
+
scrollToComponent: (id) => zoneStore.getState().scrollToComponent(id)
|
|
6931
|
+
}),
|
|
6932
|
+
[outlineDndStore, appStore, zoneStore]
|
|
6933
|
+
);
|
|
6934
|
+
return /* @__PURE__ */ jsx44(OutlineDndStoreContext.Provider, { value: outlineDndStore, children: /* @__PURE__ */ jsx44(
|
|
6935
|
+
DragDropProvider3,
|
|
6936
|
+
{
|
|
6937
|
+
sensors: disableOutlineDrag ? NO_SENSORS : sensors,
|
|
6938
|
+
onBeforeDragStart: (event) => {
|
|
6939
|
+
onOutlineBeforeDragStart(event, dragContext);
|
|
6940
|
+
},
|
|
6941
|
+
onDragOver: (event, manager) => {
|
|
6942
|
+
event.preventDefault();
|
|
6943
|
+
onOutlineDragMove(event, manager, dragContext);
|
|
6944
|
+
},
|
|
6945
|
+
onDragMove: (event, manager) => {
|
|
6946
|
+
onOutlineDragMove(event, manager, dragContext);
|
|
6947
|
+
},
|
|
6948
|
+
onDragEnd: (event) => {
|
|
6949
|
+
onOutlineDragEnd(event, dragContext);
|
|
6950
|
+
},
|
|
6951
|
+
children
|
|
6952
|
+
}
|
|
6953
|
+
) });
|
|
6954
|
+
};
|
|
6955
|
+
|
|
6956
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css#css-module
|
|
6957
|
+
init_react_import();
|
|
6958
|
+
var styles_module_default20 = { "LayerTreeRoot": "_LayerTreeRoot_kxnd1_1" };
|
|
6959
|
+
|
|
6960
|
+
// components/LayerTree/lib/build-layer-tree.ts
|
|
6961
|
+
init_react_import();
|
|
6962
|
+
var getZonesByParent = (zones) => {
|
|
6963
|
+
const result = {};
|
|
6964
|
+
Object.keys(zones).forEach((zone) => {
|
|
6965
|
+
const [parentId] = zone.split(":");
|
|
6966
|
+
if (!parentId) return;
|
|
6967
|
+
if (!result[parentId]) result[parentId] = [];
|
|
6968
|
+
result[parentId].push(zone);
|
|
6969
|
+
});
|
|
6970
|
+
return result;
|
|
6971
|
+
};
|
|
6972
|
+
var getZoneLabel = (zoneCompound, nodes, config, label) => {
|
|
6973
|
+
var _a, _b;
|
|
6974
|
+
if (label !== void 0) {
|
|
6975
|
+
return label;
|
|
6976
|
+
}
|
|
6977
|
+
const [, slotId] = zoneCompound.split(":");
|
|
6978
|
+
if (!slotId) {
|
|
6979
|
+
return;
|
|
6980
|
+
}
|
|
6981
|
+
return (_b = (_a = getSlotField(zoneCompound, config, nodes)) == null ? void 0 : _a.label) != null ? _b : slotId;
|
|
6982
|
+
};
|
|
6983
|
+
var buildLayerNode = ({
|
|
6984
|
+
config,
|
|
6985
|
+
itemId,
|
|
6986
|
+
index,
|
|
6987
|
+
nodes,
|
|
6988
|
+
zoneCompound,
|
|
6989
|
+
zones,
|
|
6990
|
+
zonesByParent,
|
|
6991
|
+
componentFallbackLabel
|
|
6992
|
+
}) => {
|
|
6993
|
+
var _a, _b, _c, _d;
|
|
6994
|
+
const nodeData = nodes[itemId];
|
|
6995
|
+
const componentType = (_b = (_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) != null ? _b : componentFallbackLabel;
|
|
6996
|
+
const label = (_d = (_c = config.components[componentType]) == null ? void 0 : _c.label) != null ? _d : componentType;
|
|
6997
|
+
const childZoneCompounds = zonesByParent[itemId] || [];
|
|
6998
|
+
return {
|
|
6999
|
+
childZones: childZoneCompounds.map(
|
|
7000
|
+
(childZoneCompound) => buildLayerTree({
|
|
7001
|
+
config,
|
|
7002
|
+
nodes,
|
|
7003
|
+
zoneCompound: childZoneCompound,
|
|
7004
|
+
zones,
|
|
7005
|
+
zonesByParent
|
|
7006
|
+
})
|
|
7007
|
+
),
|
|
7008
|
+
componentType,
|
|
7009
|
+
index,
|
|
7010
|
+
itemId,
|
|
7011
|
+
label,
|
|
7012
|
+
zoneCompound
|
|
7013
|
+
};
|
|
7014
|
+
};
|
|
7015
|
+
var buildLayerTree = ({
|
|
7016
|
+
config,
|
|
7017
|
+
label,
|
|
7018
|
+
nodes,
|
|
7019
|
+
zoneCompound,
|
|
7020
|
+
zones,
|
|
7021
|
+
zonesByParent = getZonesByParent(zones),
|
|
7022
|
+
componentFallbackLabel
|
|
7023
|
+
}) => {
|
|
7024
|
+
var _a, _b;
|
|
7025
|
+
const contentIds = (_b = (_a = zones[zoneCompound]) == null ? void 0 : _a.contentIds) != null ? _b : [];
|
|
7026
|
+
return {
|
|
7027
|
+
items: contentIds.map(
|
|
7028
|
+
(itemId, index) => buildLayerNode({
|
|
7029
|
+
config,
|
|
7030
|
+
itemId,
|
|
7031
|
+
index,
|
|
7032
|
+
nodes,
|
|
7033
|
+
zoneCompound,
|
|
7034
|
+
zones,
|
|
7035
|
+
zonesByParent
|
|
7036
|
+
})
|
|
7037
|
+
),
|
|
7038
|
+
label: getZoneLabel(zoneCompound, nodes, config, label),
|
|
7039
|
+
zoneCompound
|
|
7040
|
+
};
|
|
7041
|
+
};
|
|
7042
|
+
|
|
7043
|
+
// components/LayerTree/index.tsx
|
|
7044
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
7045
|
+
var getClassNameDragRoot = get_class_name_factory_default("LayerTreeRoot", styles_module_default20);
|
|
6132
7046
|
var LayerTree = ({
|
|
6133
7047
|
selectedId,
|
|
6134
|
-
selectedPathIds,
|
|
6135
7048
|
trees
|
|
6136
7049
|
}) => {
|
|
6137
|
-
|
|
6138
|
-
|
|
7050
|
+
const disableOutlineDrag = useAppStore(
|
|
7051
|
+
(s) => {
|
|
7052
|
+
var _a, _b;
|
|
7053
|
+
return (_b = (_a = s.dnd) == null ? void 0 : _a.disableOutlineDrag) != null ? _b : false;
|
|
7054
|
+
}
|
|
7055
|
+
);
|
|
7056
|
+
const hasItems = trees.length > 0 && trees[0].items.length > 0;
|
|
7057
|
+
return /* @__PURE__ */ jsx45(OutlineDndProvider, { children: /* @__PURE__ */ jsx45(
|
|
7058
|
+
"div",
|
|
6139
7059
|
{
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
7060
|
+
className: getClassNameDragRoot(),
|
|
7061
|
+
"data-puck-dnd-disabled": disableOutlineDrag || void 0,
|
|
7062
|
+
children: hasItems && trees.map((tree) => /* @__PURE__ */ jsx45(
|
|
7063
|
+
LayerTreeZone,
|
|
7064
|
+
{
|
|
7065
|
+
depth: 0,
|
|
7066
|
+
selectedId,
|
|
7067
|
+
tree
|
|
7068
|
+
},
|
|
7069
|
+
tree.zoneCompound
|
|
7070
|
+
))
|
|
7071
|
+
}
|
|
7072
|
+
) });
|
|
6147
7073
|
};
|
|
6148
7074
|
|
|
6149
|
-
// components/Puck/components/Outline/index.tsx
|
|
6150
|
-
|
|
7075
|
+
// components/Puck/components/Outline/components/collapse-all/index.tsx
|
|
7076
|
+
init_react_import();
|
|
6151
7077
|
|
|
6152
|
-
// lib/
|
|
7078
|
+
// lib/merge-class-names.ts
|
|
6153
7079
|
init_react_import();
|
|
6154
|
-
var
|
|
6155
|
-
|
|
6156
|
-
|
|
7080
|
+
var mergeClassNames = (...classNames) => [...classNames].filter(Boolean).join(" ");
|
|
7081
|
+
var merge_class_names_default = mergeClassNames;
|
|
7082
|
+
|
|
7083
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/collapse-all/styles.module.css#css-module
|
|
7084
|
+
init_react_import();
|
|
7085
|
+
var styles_module_default21 = { "CollapseAll": "_CollapseAll_1r4cy_1", "CollapseAll-icon": "_CollapseAll-icon_1r4cy_5", "CollapseAll--visible": "_CollapseAll--visible_1r4cy_10" };
|
|
7086
|
+
|
|
7087
|
+
// components/Puck/components/Outline/components/collapse-all/index.tsx
|
|
7088
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
7089
|
+
var getClassName27 = get_class_name_factory_default("CollapseAll", styles_module_default21);
|
|
7090
|
+
function CollapseAll({ className }) {
|
|
7091
|
+
const hasExpandedItems = useAppStore(
|
|
7092
|
+
(s) => {
|
|
7093
|
+
var _a;
|
|
7094
|
+
return Object.keys((_a = s.state.ui.itemExpanded) != null ? _a : {}).length > 0;
|
|
7095
|
+
}
|
|
6157
7096
|
);
|
|
7097
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
7098
|
+
const collapseAllMsg = useMessage("outline-header-collapseall");
|
|
7099
|
+
const collapseAll = () => {
|
|
7100
|
+
dispatch({ type: "setUi", ui: { itemExpanded: {} } });
|
|
7101
|
+
};
|
|
7102
|
+
return /* @__PURE__ */ jsx46(
|
|
7103
|
+
"div",
|
|
7104
|
+
{
|
|
7105
|
+
className: merge_class_names_default(
|
|
7106
|
+
getClassName27({ visible: hasExpandedItems }),
|
|
7107
|
+
className
|
|
7108
|
+
),
|
|
7109
|
+
children: /* @__PURE__ */ jsx46(IconButton, { title: collapseAllMsg, onClick: collapseAll, children: /* @__PURE__ */ jsx46(ChevronsDownUp, { className: getClassName27("icon") }) })
|
|
7110
|
+
}
|
|
7111
|
+
);
|
|
7112
|
+
}
|
|
7113
|
+
var collapse_all_default = CollapseAll;
|
|
7114
|
+
|
|
7115
|
+
// components/Puck/components/Outline/components/outline-header/index.tsx
|
|
7116
|
+
init_react_import();
|
|
7117
|
+
|
|
7118
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/outline-header/styles.module.css#css-module
|
|
7119
|
+
init_react_import();
|
|
7120
|
+
var styles_module_default22 = { "OutlineHeader": "_OutlineHeader_filq3_1", "OutlineHeader-title": "_OutlineHeader-title_filq3_12" };
|
|
7121
|
+
|
|
7122
|
+
// components/Puck/components/Outline/components/outline-header/index.tsx
|
|
7123
|
+
import { jsx as jsx47, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7124
|
+
var getClassName28 = get_class_name_factory_default("OutlineHeader", styles_module_default22);
|
|
7125
|
+
var OutlineHeader = ({
|
|
7126
|
+
children,
|
|
7127
|
+
title
|
|
7128
|
+
}) => {
|
|
7129
|
+
const outlineHeaderMsg = useMessage("outline-header-title");
|
|
7130
|
+
return /* @__PURE__ */ jsxs17("div", { className: getClassName28(), children: [
|
|
7131
|
+
/* @__PURE__ */ jsx47("div", { className: getClassName28("title"), children: outlineHeaderMsg != null ? outlineHeaderMsg : title }),
|
|
7132
|
+
children
|
|
7133
|
+
] });
|
|
6158
7134
|
};
|
|
7135
|
+
var outline_header_default = OutlineHeader;
|
|
7136
|
+
|
|
7137
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/styles.module.css#css-module
|
|
7138
|
+
init_react_import();
|
|
7139
|
+
var styles_module_default23 = { "OutlineWrapper": "_OutlineWrapper_b9ln0_1", "OutlineWrapper-collapseAll": "_OutlineWrapper-collapseAll_b9ln0_9", "OutlineWrapper-layers": "_OutlineWrapper-layers_b9ln0_15" };
|
|
6159
7140
|
|
|
6160
7141
|
// components/Puck/components/Outline/index.tsx
|
|
6161
|
-
import {
|
|
6162
|
-
|
|
7142
|
+
import { jsx as jsx48, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7143
|
+
var getClassName29 = get_class_name_factory_default("OutlineWrapper", styles_module_default23);
|
|
7144
|
+
var DefaultWrapper = ({ children }) => /* @__PURE__ */ jsx48("div", { className: getClassName29(), children });
|
|
6163
7145
|
var Outline = () => {
|
|
6164
7146
|
const outlineOverride = useAppStore((s) => s.overrides.outline);
|
|
6165
7147
|
const config = useAppStore((s) => s.config);
|
|
@@ -6169,52 +7151,49 @@ var Outline = () => {
|
|
|
6169
7151
|
var _a;
|
|
6170
7152
|
return ((_a = s.selectedItem) == null ? void 0 : _a.props.id) || null;
|
|
6171
7153
|
});
|
|
7154
|
+
const componentFallbackLabel = useMessage("label-component");
|
|
6172
7155
|
const rootZones = useAppStore(
|
|
6173
|
-
|
|
7156
|
+
useShallow8((s) => findZonesForArea(s.state, "root"))
|
|
6174
7157
|
);
|
|
6175
|
-
const
|
|
6176
|
-
var _a;
|
|
6177
|
-
const selectedPath = selectedId ? (_a = nodes[selectedId]) == null ? void 0 : _a.path : null;
|
|
6178
|
-
return new Set(
|
|
6179
|
-
(selectedPath == null ? void 0 : selectedPath.map((candidate) => candidate.split(":")[0]).filter(Boolean)) || []
|
|
6180
|
-
);
|
|
6181
|
-
}, [nodes, selectedId]);
|
|
6182
|
-
const trees = useMemo15(
|
|
7158
|
+
const trees = useMemo18(
|
|
6183
7159
|
() => rootZones.map(
|
|
6184
7160
|
(zoneCompound) => buildLayerTree({
|
|
6185
7161
|
config,
|
|
6186
7162
|
label: rootZones.length === 1 ? "" : zoneCompound.split(":")[1],
|
|
6187
7163
|
nodes,
|
|
6188
7164
|
zoneCompound,
|
|
6189
|
-
zones
|
|
7165
|
+
zones,
|
|
7166
|
+
componentFallbackLabel
|
|
6190
7167
|
})
|
|
6191
7168
|
),
|
|
6192
|
-
[config, nodes, rootZones, zones]
|
|
7169
|
+
[config, nodes, rootZones, zones, componentFallbackLabel]
|
|
6193
7170
|
);
|
|
6194
|
-
const Wrapper =
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
) });
|
|
7171
|
+
const Wrapper = useMemo18(
|
|
7172
|
+
() => outlineOverride || DefaultWrapper,
|
|
7173
|
+
[outlineOverride]
|
|
7174
|
+
);
|
|
7175
|
+
return /* @__PURE__ */ jsxs18(Wrapper, { children: [
|
|
7176
|
+
/* @__PURE__ */ jsx48(outline_header_default, { children: /* @__PURE__ */ jsx48(collapse_all_default, { className: getClassName29("collapseAll") }) }),
|
|
7177
|
+
/* @__PURE__ */ jsx48("div", { className: getClassName29("layers"), children: /* @__PURE__ */ jsx48(LayerTree, { selectedId, trees }) })
|
|
7178
|
+
] });
|
|
6203
7179
|
};
|
|
6204
7180
|
|
|
6205
7181
|
// css-module:/home/runner/work/puck/puck/packages/core/plugins/outline/styles.module.css#css-module
|
|
6206
7182
|
init_react_import();
|
|
6207
|
-
var
|
|
7183
|
+
var styles_module_default24 = { "OutlinePlugin": "_OutlinePlugin_1ylsc_1" };
|
|
6208
7184
|
|
|
6209
7185
|
// plugins/outline/index.tsx
|
|
6210
|
-
import { jsx as
|
|
6211
|
-
var
|
|
6212
|
-
var outlinePlugin = () =>
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
})
|
|
7186
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
7187
|
+
var getClassName30 = get_class_name_factory_default("OutlinePlugin", styles_module_default24);
|
|
7188
|
+
var outlinePlugin = (props = {}) => {
|
|
7189
|
+
var _a, _b;
|
|
7190
|
+
return {
|
|
7191
|
+
name: "outline",
|
|
7192
|
+
label: (_a = props.label) != null ? _a : "Outline",
|
|
7193
|
+
render: () => /* @__PURE__ */ jsx49("div", { className: getClassName30(), children: /* @__PURE__ */ jsx49(Outline, {}) }),
|
|
7194
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ jsx49(Layers, {})
|
|
7195
|
+
};
|
|
7196
|
+
};
|
|
6218
7197
|
|
|
6219
7198
|
// plugins/fields/index.tsx
|
|
6220
7199
|
init_react_import();
|
|
@@ -6224,11 +7203,11 @@ init_react_import();
|
|
|
6224
7203
|
|
|
6225
7204
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Breadcrumbs/styles.module.css#css-module
|
|
6226
7205
|
init_react_import();
|
|
6227
|
-
var
|
|
7206
|
+
var styles_module_default25 = { "Breadcrumbs": "_Breadcrumbs_8c6w5_1", "Breadcrumbs-breadcrumbLabel": "_Breadcrumbs-breadcrumbLabel_8c6w5_7", "Breadcrumbs-breadcrumb": "_Breadcrumbs-breadcrumb_8c6w5_7" };
|
|
6228
7207
|
|
|
6229
7208
|
// lib/use-breadcrumbs.ts
|
|
6230
7209
|
init_react_import();
|
|
6231
|
-
import { useMemo as
|
|
7210
|
+
import { useMemo as useMemo19 } from "react";
|
|
6232
7211
|
var useBreadcrumbs = (renderCount) => {
|
|
6233
7212
|
const selectedId = useAppStore((s) => {
|
|
6234
7213
|
var _a;
|
|
@@ -6240,13 +7219,15 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
6240
7219
|
return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
|
|
6241
7220
|
});
|
|
6242
7221
|
const appStore = useAppStoreApi();
|
|
6243
|
-
|
|
7222
|
+
const pageLabel = useMessage("label-page");
|
|
7223
|
+
const componentLabel = useMessage("label-component");
|
|
7224
|
+
return useMemo19(() => {
|
|
6244
7225
|
const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
|
|
6245
7226
|
var _a, _b, _c, _d;
|
|
6246
7227
|
const [componentId] = zoneCompound.split(":");
|
|
6247
7228
|
if (componentId === "root") {
|
|
6248
7229
|
return {
|
|
6249
|
-
label: ((_a = config == null ? void 0 : config.root) == null ? void 0 : _a.label) ||
|
|
7230
|
+
label: ((_a = config == null ? void 0 : config.root) == null ? void 0 : _a.label) || pageLabel,
|
|
6250
7231
|
selector: null
|
|
6251
7232
|
};
|
|
6252
7233
|
}
|
|
@@ -6254,7 +7235,7 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
6254
7235
|
const parentId = node.path[node.path.length - 1];
|
|
6255
7236
|
const contentIds = ((_b = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _b.contentIds) || [];
|
|
6256
7237
|
const index = contentIds.indexOf(componentId);
|
|
6257
|
-
const label = node ? (_d = (_c = config.components[node.data.type]) == null ? void 0 : _c.label) != null ? _d : node.data.type :
|
|
7238
|
+
const label = node ? (_d = (_c = config.components[node.data.type]) == null ? void 0 : _c.label) != null ? _d : node.data.type : componentLabel;
|
|
6258
7239
|
return {
|
|
6259
7240
|
label,
|
|
6260
7241
|
selector: node ? {
|
|
@@ -6267,30 +7248,30 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
6267
7248
|
return breadcrumbs.slice(breadcrumbs.length - renderCount);
|
|
6268
7249
|
}
|
|
6269
7250
|
return breadcrumbs;
|
|
6270
|
-
}, [path, renderCount]);
|
|
7251
|
+
}, [path, renderCount, pageLabel, componentLabel]);
|
|
6271
7252
|
};
|
|
6272
7253
|
|
|
6273
7254
|
// components/Breadcrumbs/index.tsx
|
|
6274
|
-
import { jsx as
|
|
6275
|
-
var
|
|
7255
|
+
import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7256
|
+
var getClassName31 = get_class_name_factory_default("Breadcrumbs", styles_module_default25);
|
|
6276
7257
|
var Breadcrumbs = ({
|
|
6277
7258
|
children,
|
|
6278
7259
|
numParents = 1
|
|
6279
7260
|
}) => {
|
|
6280
7261
|
const setUi = useAppStore((s) => s.setUi);
|
|
6281
7262
|
const breadcrumbs = useBreadcrumbs(numParents);
|
|
6282
|
-
return /* @__PURE__ */
|
|
6283
|
-
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */
|
|
6284
|
-
/* @__PURE__ */
|
|
7263
|
+
return /* @__PURE__ */ jsxs19("div", { className: getClassName31(), children: [
|
|
7264
|
+
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs19("div", { className: getClassName31("breadcrumb"), children: [
|
|
7265
|
+
/* @__PURE__ */ jsx50(
|
|
6285
7266
|
"button",
|
|
6286
7267
|
{
|
|
6287
7268
|
type: "button",
|
|
6288
|
-
className:
|
|
7269
|
+
className: getClassName31("breadcrumbLabel"),
|
|
6289
7270
|
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
|
6290
7271
|
children: breadcrumb.label
|
|
6291
7272
|
}
|
|
6292
7273
|
),
|
|
6293
|
-
/* @__PURE__ */
|
|
7274
|
+
/* @__PURE__ */ jsx50(ChevronRight, { size: 16 })
|
|
6294
7275
|
] }, i)),
|
|
6295
7276
|
children
|
|
6296
7277
|
] });
|
|
@@ -6301,23 +7282,23 @@ init_react_import();
|
|
|
6301
7282
|
|
|
6302
7283
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Fields/styles.module.css#css-module
|
|
6303
7284
|
init_react_import();
|
|
6304
|
-
var
|
|
7285
|
+
var styles_module_default26 = { "PuckFields": "_PuckFields_wnj25_1", "PuckFields--isLoading": "_PuckFields--isLoading_wnj25_6", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_wnj25_10", "PuckFields-loadingOverlayInner": "_PuckFields-loadingOverlayInner_wnj25_25", "PuckFields-field": "_PuckFields-field_wnj25_32", "PuckFields--wrapFields": "_PuckFields--wrapFields_wnj25_36" };
|
|
6305
7286
|
|
|
6306
7287
|
// components/Puck/components/Fields/index.tsx
|
|
6307
7288
|
import {
|
|
6308
7289
|
memo as memo8,
|
|
6309
|
-
useCallback as
|
|
6310
|
-
useContext as
|
|
7290
|
+
useCallback as useCallback18,
|
|
7291
|
+
useContext as useContext15,
|
|
6311
7292
|
useEffect as useEffect20,
|
|
6312
|
-
useMemo as
|
|
7293
|
+
useMemo as useMemo20
|
|
6313
7294
|
} from "react";
|
|
6314
|
-
import { useShallow as
|
|
6315
|
-
import { Fragment as Fragment11, jsx as
|
|
6316
|
-
var
|
|
7295
|
+
import { useShallow as useShallow9 } from "zustand/react/shallow";
|
|
7296
|
+
import { Fragment as Fragment11, jsx as jsx51, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
7297
|
+
var getClassName32 = get_class_name_factory_default("PuckFields", styles_module_default26);
|
|
6317
7298
|
var DefaultFields = ({
|
|
6318
7299
|
children
|
|
6319
7300
|
}) => {
|
|
6320
|
-
return /* @__PURE__ */
|
|
7301
|
+
return /* @__PURE__ */ jsx51(Fragment11, { children });
|
|
6321
7302
|
};
|
|
6322
7303
|
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(null, null, function* () {
|
|
6323
7304
|
const { dispatch, state, selectedItem, resolveComponentData } = appStore.getState();
|
|
@@ -6372,17 +7353,17 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
6372
7353
|
return s.selectedItem ? `${s.selectedItem.props.id}_${field.type}_${fieldName}` : `root_${field.type}_${fieldName}`;
|
|
6373
7354
|
});
|
|
6374
7355
|
const permissions = useAppStore(
|
|
6375
|
-
|
|
7356
|
+
useShallow9((s) => {
|
|
6376
7357
|
const { selectedItem, permissions: permissions2 } = s;
|
|
6377
7358
|
return selectedItem ? permissions2.getPermissions({ item: selectedItem }) : permissions2.getPermissions({ root: true });
|
|
6378
7359
|
})
|
|
6379
7360
|
);
|
|
6380
7361
|
const appStore = useAppStoreApi();
|
|
6381
|
-
const onChange =
|
|
7362
|
+
const onChange = useCallback18(createOnChange(fieldName, appStore), [
|
|
6382
7363
|
fieldName
|
|
6383
7364
|
]);
|
|
6384
7365
|
const { visible = true } = field != null ? field : {};
|
|
6385
|
-
const fieldStore =
|
|
7366
|
+
const fieldStore = useContext15(fieldContextStore.ctx);
|
|
6386
7367
|
useEffect20(() => {
|
|
6387
7368
|
return appStore.subscribe(
|
|
6388
7369
|
(s) => {
|
|
@@ -6397,7 +7378,7 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
6397
7378
|
}, [appStore, fieldStore]);
|
|
6398
7379
|
if (!field || !id || !visible) return null;
|
|
6399
7380
|
if (field.type === "slot") return null;
|
|
6400
|
-
return /* @__PURE__ */
|
|
7381
|
+
return /* @__PURE__ */ jsx51("div", { className: getClassName32("field"), children: /* @__PURE__ */ jsx51(
|
|
6401
7382
|
AutoFieldPrivate,
|
|
6402
7383
|
{
|
|
6403
7384
|
field,
|
|
@@ -6410,12 +7391,12 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
6410
7391
|
};
|
|
6411
7392
|
var FieldsChild = ({ fieldName }) => {
|
|
6412
7393
|
const appStore = useAppStoreApi();
|
|
6413
|
-
const initialValue =
|
|
7394
|
+
const initialValue = useMemo20(() => {
|
|
6414
7395
|
var _a;
|
|
6415
7396
|
const value = (_a = appStore.getState().getCurrentData().props) == null ? void 0 : _a[fieldName];
|
|
6416
7397
|
return { [fieldName]: value };
|
|
6417
7398
|
}, []);
|
|
6418
|
-
return /* @__PURE__ */
|
|
7399
|
+
return /* @__PURE__ */ jsx51(fieldContextStore.Provider, { value: initialValue, children: /* @__PURE__ */ jsx51(FieldsChildInner, { fieldName }) });
|
|
6419
7400
|
};
|
|
6420
7401
|
var FieldsChildMemo = memo8(FieldsChild);
|
|
6421
7402
|
var FieldsInternal = ({ wrapFields = true }) => {
|
|
@@ -6425,7 +7406,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
6425
7406
|
const loadingCount = s.selectedItem ? (_a = s.componentState[s.selectedItem.props.id]) == null ? void 0 : _a.loadingCount : (_b = s.componentState["root"]) == null ? void 0 : _b.loadingCount;
|
|
6426
7407
|
return (loadingCount != null ? loadingCount : 0) > 0;
|
|
6427
7408
|
});
|
|
6428
|
-
const itemSelector = useAppStore(
|
|
7409
|
+
const itemSelector = useAppStore(useShallow9((s) => s.state.ui.itemSelector));
|
|
6429
7410
|
const id = useAppStore((s) => {
|
|
6430
7411
|
var _a;
|
|
6431
7412
|
return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
|
|
@@ -6434,7 +7415,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
6434
7415
|
useRegisterFieldsSlice(appStore, id);
|
|
6435
7416
|
const fieldsLoading = useAppStore((s) => s.fields.loading);
|
|
6436
7417
|
const fieldNames = useAppStore(
|
|
6437
|
-
|
|
7418
|
+
useShallow9((s) => {
|
|
6438
7419
|
if (s.fields.id === id) {
|
|
6439
7420
|
return Object.keys(s.fields.fields);
|
|
6440
7421
|
}
|
|
@@ -6442,17 +7423,17 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
6442
7423
|
})
|
|
6443
7424
|
);
|
|
6444
7425
|
const isLoading = fieldsLoading || componentResolving;
|
|
6445
|
-
const Wrapper =
|
|
6446
|
-
return /* @__PURE__ */
|
|
7426
|
+
const Wrapper = useMemo20(() => overrides.fields || DefaultFields, [overrides]);
|
|
7427
|
+
return /* @__PURE__ */ jsxs20(
|
|
6447
7428
|
"form",
|
|
6448
7429
|
{
|
|
6449
|
-
className:
|
|
7430
|
+
className: getClassName32({ wrapFields }),
|
|
6450
7431
|
onSubmit: (e) => {
|
|
6451
7432
|
e.preventDefault();
|
|
6452
7433
|
},
|
|
6453
7434
|
children: [
|
|
6454
|
-
/* @__PURE__ */
|
|
6455
|
-
isLoading && /* @__PURE__ */
|
|
7435
|
+
/* @__PURE__ */ jsx51(Wrapper, { isLoading, itemSelector, children: fieldNames.map((fieldName) => /* @__PURE__ */ jsx51(FieldsChildMemo, { fieldName }, fieldName)) }),
|
|
7436
|
+
isLoading && /* @__PURE__ */ jsx51("div", { className: getClassName32("loadingOverlay"), children: /* @__PURE__ */ jsx51("div", { className: getClassName32("loadingOverlayInner"), children: /* @__PURE__ */ jsx51(Loader, { size: 16 }) }) })
|
|
6456
7437
|
]
|
|
6457
7438
|
}
|
|
6458
7439
|
);
|
|
@@ -6461,53 +7442,54 @@ var Fields = memo8(FieldsInternal);
|
|
|
6461
7442
|
|
|
6462
7443
|
// css-module:/home/runner/work/puck/puck/packages/core/plugins/fields/styles.module.css#css-module
|
|
6463
7444
|
init_react_import();
|
|
6464
|
-
var
|
|
7445
|
+
var styles_module_default27 = { "FieldsPlugin": "_FieldsPlugin_18cj3_1", "FieldsPlugin-header": "_FieldsPlugin-header_18cj3_7" };
|
|
6465
7446
|
|
|
6466
7447
|
// plugins/fields/index.tsx
|
|
6467
|
-
import { jsx as
|
|
6468
|
-
var
|
|
7448
|
+
import { jsx as jsx52, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
7449
|
+
var getClassName33 = get_class_name_factory_default("FieldsPlugin", styles_module_default27);
|
|
6469
7450
|
var CurrentTitle = () => {
|
|
7451
|
+
const pageLabel = useMessage("label-page");
|
|
6470
7452
|
const label = useAppStore((s) => {
|
|
6471
7453
|
var _a, _b;
|
|
6472
7454
|
const selectedItem = s.selectedItem;
|
|
6473
|
-
return selectedItem ? (_b = (_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.label) != null ? _b : selectedItem.type :
|
|
7455
|
+
return selectedItem ? (_b = (_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.label) != null ? _b : selectedItem.type : null;
|
|
6474
7456
|
});
|
|
6475
|
-
return label;
|
|
7457
|
+
return label != null ? label : pageLabel;
|
|
6476
7458
|
};
|
|
6477
|
-
var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
|
|
7459
|
+
var fieldsPlugin = ({ desktopSideBar = "right", label, icon } = {}) => ({
|
|
6478
7460
|
name: "fields",
|
|
6479
|
-
label: "Fields",
|
|
6480
|
-
render: () => /* @__PURE__ */
|
|
6481
|
-
/* @__PURE__ */
|
|
6482
|
-
/* @__PURE__ */
|
|
7461
|
+
label: label != null ? label : "Fields",
|
|
7462
|
+
render: () => /* @__PURE__ */ jsxs21("div", { className: getClassName33(), children: [
|
|
7463
|
+
/* @__PURE__ */ jsx52("div", { className: getClassName33("header"), children: /* @__PURE__ */ jsx52(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ jsx52(CurrentTitle, {}) }) }),
|
|
7464
|
+
/* @__PURE__ */ jsx52(Fields, {})
|
|
6483
7465
|
] }),
|
|
6484
|
-
icon: /* @__PURE__ */
|
|
7466
|
+
icon: icon != null ? icon : /* @__PURE__ */ jsx52(RectangleEllipsis, {}),
|
|
6485
7467
|
mobileOnly: desktopSideBar === "right"
|
|
6486
7468
|
});
|
|
6487
7469
|
|
|
6488
7470
|
// components/Puck/index.tsx
|
|
6489
7471
|
init_react_import();
|
|
6490
7472
|
import {
|
|
6491
|
-
createContext as
|
|
6492
|
-
useCallback as
|
|
6493
|
-
useContext as
|
|
7473
|
+
createContext as createContext9,
|
|
7474
|
+
useCallback as useCallback25,
|
|
7475
|
+
useContext as useContext18,
|
|
6494
7476
|
useEffect as useEffect29,
|
|
6495
|
-
useMemo as
|
|
7477
|
+
useMemo as useMemo28,
|
|
6496
7478
|
useRef as useRef16,
|
|
6497
|
-
useState as
|
|
7479
|
+
useState as useState25
|
|
6498
7480
|
} from "react";
|
|
6499
7481
|
|
|
6500
7482
|
// components/Puck/components/Preview/index.tsx
|
|
6501
7483
|
init_react_import();
|
|
6502
|
-
import { useEffect as useEffect23, useRef as useRef11, useMemo as
|
|
7484
|
+
import { useEffect as useEffect23, useRef as useRef11, useMemo as useMemo21, memo as memo9 } from "react";
|
|
6503
7485
|
|
|
6504
7486
|
// components/AutoFrame/index.tsx
|
|
6505
7487
|
init_react_import();
|
|
6506
7488
|
import {
|
|
6507
|
-
createContext as
|
|
6508
|
-
useContext as
|
|
7489
|
+
createContext as createContext7,
|
|
7490
|
+
useContext as useContext16,
|
|
6509
7491
|
useEffect as useEffect22,
|
|
6510
|
-
useState as
|
|
7492
|
+
useState as useState19
|
|
6511
7493
|
} from "react";
|
|
6512
7494
|
import hash from "object-hash";
|
|
6513
7495
|
import { createPortal as createPortal3 } from "react-dom";
|
|
@@ -6629,6 +7611,7 @@ var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
|
|
|
6629
7611
|
--puck-color-focus-ring: var(--puck-color-azure-05);
|
|
6630
7612
|
--puck-color-selection-bg: color-mix( in srgb, var(--puck-color-azure-09) 30%, transparent );
|
|
6631
7613
|
--puck-color-selection-border: var(--puck-color-azure-08);
|
|
7614
|
+
--puck-color-insertion-indicator: var(--puck-color-azure-06);
|
|
6632
7615
|
--puck-color-highlight: var(--puck-color-rose-07);
|
|
6633
7616
|
--puck-color-bg-disabled: var(--puck-color-grey-07);
|
|
6634
7617
|
--puck-color-text-disabled: var(--puck-color-grey-03);
|
|
@@ -6663,6 +7646,7 @@ var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
|
|
|
6663
7646
|
--puck-font-weight-heavy: 800;
|
|
6664
7647
|
--puck-letter-spacing-ui: 0.05ch;
|
|
6665
7648
|
--puck-letter-spacing-heading: 0.08ch;
|
|
7649
|
+
--puck-icon-size-xs: 14px;
|
|
6666
7650
|
--puck-icon-size-s: 16px;
|
|
6667
7651
|
--puck-icon-size-m: 18px;
|
|
6668
7652
|
--puck-icon-size-l: 24px;
|
|
@@ -7196,7 +8180,7 @@ textarea._Input-input_qyenz_29 {
|
|
|
7196
8180
|
}
|
|
7197
8181
|
|
|
7198
8182
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
|
|
7199
|
-
.
|
|
8183
|
+
._IconButton_1pxxt_1 {
|
|
7200
8184
|
align-items: center;
|
|
7201
8185
|
background: var(--puck-iconbutton-color-bg, transparent);
|
|
7202
8186
|
border: none;
|
|
@@ -7208,26 +8192,26 @@ textarea._Input-input_qyenz_29 {
|
|
|
7208
8192
|
padding: var(--puck-iconbutton-space, var(--puck-space-1));
|
|
7209
8193
|
transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);
|
|
7210
8194
|
}
|
|
7211
|
-
._IconButton--
|
|
8195
|
+
._IconButton--active_1pxxt_15 {
|
|
7212
8196
|
color: var( --puck-iconbutton-color-icon-active, var(--puck-color-interactive) );
|
|
7213
8197
|
}
|
|
7214
|
-
.
|
|
8198
|
+
._IconButton_1pxxt_1:focus-visible {
|
|
7215
8199
|
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
7216
8200
|
outline-offset: calc(var(--puck-border-width-focus) * -1);
|
|
7217
8201
|
}
|
|
7218
8202
|
@media (hover: hover) and (pointer: fine) {
|
|
7219
|
-
.
|
|
7220
|
-
background: var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) );
|
|
8203
|
+
._IconButton_1pxxt_1:hover:not(._IconButton--disabled_1pxxt_28) {
|
|
8204
|
+
background: var( --_puck-iconbutton-color-bg-hover, var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) ) );
|
|
7221
8205
|
color: var( --puck-iconbutton-color-icon-hover, var(--puck-color-interactive) );
|
|
7222
8206
|
cursor: pointer;
|
|
7223
8207
|
transition: none;
|
|
7224
8208
|
}
|
|
7225
8209
|
}
|
|
7226
|
-
.
|
|
8210
|
+
._IconButton_1pxxt_1:active {
|
|
7227
8211
|
background: var( --puck-iconbutton-color-bg-active, var(--puck-color-interactive-soft) );
|
|
7228
8212
|
transition: none;
|
|
7229
8213
|
}
|
|
7230
|
-
._IconButton--
|
|
8214
|
+
._IconButton--disabled_1pxxt_28 {
|
|
7231
8215
|
color: var( --puck-iconbutton-color-icon-disabled, var(--puck-color-text-subtle) );
|
|
7232
8216
|
}
|
|
7233
8217
|
|
|
@@ -8336,138 +9320,327 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
8336
9320
|
}
|
|
8337
9321
|
|
|
8338
9322
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css/#css-module-data */
|
|
8339
|
-
.
|
|
9323
|
+
._PuckPreview_zbic3_1 {
|
|
8340
9324
|
position: relative;
|
|
8341
9325
|
height: 100%;
|
|
8342
9326
|
}
|
|
8343
|
-
._PuckPreview-
|
|
9327
|
+
._PuckPreview-frame_zbic3_6 {
|
|
8344
9328
|
border: none;
|
|
8345
9329
|
height: 100%;
|
|
8346
9330
|
width: 100%;
|
|
8347
9331
|
}
|
|
9332
|
+
._PuckPreview-frame_zbic3_6[data-puck-outline-dragging] {
|
|
9333
|
+
pointer-events: none;
|
|
9334
|
+
}
|
|
8348
9335
|
|
|
8349
|
-
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css/#css-module-data */
|
|
8350
|
-
.
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
9336
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/drop-line/styles.module.css/#css-module-data */
|
|
9337
|
+
._DropLine_eyz3q_2 {
|
|
9338
|
+
background: var(--_puck-outline-color-drop-indicator);
|
|
9339
|
+
border-radius: calc(var(--_puck-outline-drop-indicator-size) / 2);
|
|
9340
|
+
height: var(--_puck-outline-drop-indicator-size);
|
|
9341
|
+
inset-inline: 0;
|
|
9342
|
+
pointer-events: none;
|
|
9343
|
+
position: absolute;
|
|
9344
|
+
z-index: 1;
|
|
8358
9345
|
}
|
|
8359
|
-
.
|
|
8360
|
-
|
|
8361
|
-
font-size: var(--puck-outline-zone-font-size, var(--puck-font-size-xxxs));
|
|
8362
|
-
text-transform: uppercase;
|
|
9346
|
+
._DropLine--top_eyz3q_12 {
|
|
9347
|
+
top: 0;
|
|
8363
9348
|
}
|
|
8364
|
-
.
|
|
8365
|
-
|
|
8366
|
-
color: var(--puck-color-text-subtle);
|
|
8367
|
-
margin: var(--puck-space-2) var(--puck-space-1);
|
|
9349
|
+
._DropLine--bottom_eyz3q_16 {
|
|
9350
|
+
bottom: 0;
|
|
8368
9351
|
}
|
|
8369
|
-
.
|
|
9352
|
+
._DropLine--top_eyz3q_12._DropLine--outset_eyz3q_20 {
|
|
9353
|
+
top: calc(-1 * var(--_puck-outline-drop-indicator-size));
|
|
9354
|
+
}
|
|
9355
|
+
._DropLine--bottom_eyz3q_16._DropLine--outset_eyz3q_20 {
|
|
9356
|
+
bottom: calc(-1 * var(--_puck-outline-drop-indicator-size));
|
|
9357
|
+
}
|
|
9358
|
+
|
|
9359
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/empty-zone-placeholder/styles.module.css/#css-module-data */
|
|
9360
|
+
._LayerTree-helper_1niov_2 {
|
|
9361
|
+
color: var(--puck-outline-color-text-helper, var(--puck-color-text-subtle));
|
|
9362
|
+
padding-top: var(--puck-space-1);
|
|
9363
|
+
padding-bottom: var(--puck-space-1);
|
|
9364
|
+
padding-inline-start: var(--_puck-outline-label-indent);
|
|
9365
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
9366
|
+
}
|
|
9367
|
+
._LayerTree-helper_1niov_2[data-puck-drop-target] {
|
|
9368
|
+
position: relative;
|
|
9369
|
+
overflow: visible;
|
|
9370
|
+
}
|
|
9371
|
+
|
|
9372
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer/styles.module.css/#css-module-data */
|
|
9373
|
+
._Layer_1o110_1 {
|
|
8370
9374
|
position: relative;
|
|
8371
|
-
border: var(--
|
|
8372
|
-
border-radius: var(--
|
|
9375
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
9376
|
+
border-radius: var(--_puck-outline-radius);
|
|
8373
9377
|
}
|
|
8374
|
-
._Layer-
|
|
8375
|
-
|
|
8376
|
-
border
|
|
9378
|
+
._Layer-inner_1o110_8 {
|
|
9379
|
+
align-items: center;
|
|
9380
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
9381
|
+
border-radius: var(--_puck-outline-radius);
|
|
9382
|
+
cursor: pointer;
|
|
9383
|
+
display: flex;
|
|
9384
|
+
position: relative;
|
|
8377
9385
|
transition: color var(--puck-duration-fast) var(--puck-ease-exit);
|
|
8378
9386
|
}
|
|
8379
|
-
._Layer--
|
|
8380
|
-
|
|
9387
|
+
._Layer--isSortable_1o110_18 > ._Layer-inner_1o110_8 {
|
|
9388
|
+
cursor: grab;
|
|
9389
|
+
}
|
|
9390
|
+
._Layer-content_1o110_22 {
|
|
9391
|
+
display: flex;
|
|
9392
|
+
gap: var(--puck-space-4);
|
|
9393
|
+
flex: 1 1 auto;
|
|
9394
|
+
min-width: 0;
|
|
8381
9395
|
}
|
|
8382
|
-
._Layer-
|
|
9396
|
+
._Layer-clickable_1o110_29 {
|
|
8383
9397
|
align-items: center;
|
|
8384
9398
|
background: none;
|
|
8385
9399
|
border: 0;
|
|
8386
|
-
border-radius: var(--
|
|
9400
|
+
border-radius: var(--_puck-outline-radius);
|
|
8387
9401
|
color: inherit;
|
|
8388
|
-
cursor:
|
|
9402
|
+
cursor: inherit;
|
|
8389
9403
|
display: flex;
|
|
9404
|
+
flex: 1 1 auto;
|
|
8390
9405
|
font: inherit;
|
|
8391
|
-
|
|
8392
|
-
padding
|
|
8393
|
-
|
|
9406
|
+
min-width: 0;
|
|
9407
|
+
padding: 0;
|
|
9408
|
+
}
|
|
9409
|
+
[data-puck-dnd-disabled] ._Layer-inner_1o110_8,
|
|
9410
|
+
[data-puck-dnd-disabled] ._Layer-clickable_1o110_29 {
|
|
9411
|
+
cursor: pointer;
|
|
8394
9412
|
}
|
|
8395
|
-
._Layer-
|
|
9413
|
+
._Layer-clickable_1o110_29:focus-visible {
|
|
8396
9414
|
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
8397
9415
|
outline-offset: var(--puck-border-width-focus);
|
|
8398
9416
|
position: relative;
|
|
8399
9417
|
z-index: 1;
|
|
8400
9418
|
}
|
|
9419
|
+
._Layer-caret_1o110_57 {
|
|
9420
|
+
visibility: hidden;
|
|
9421
|
+
display: flex;
|
|
9422
|
+
flex-shrink: 0;
|
|
9423
|
+
}
|
|
9424
|
+
._Layer-caret_1o110_57 svg {
|
|
9425
|
+
height: var(--_puck-outline-caret-size);
|
|
9426
|
+
width: var(--_puck-outline-caret-size);
|
|
9427
|
+
}
|
|
9428
|
+
._Layer--containsZone_1o110_68 > ._Layer-inner_1o110_8 > ._Layer-content_1o110_22 {
|
|
9429
|
+
font-weight: var(--puck-font-weight-bold);
|
|
9430
|
+
}
|
|
9431
|
+
._Layer--containsZone_1o110_68 > ._Layer-inner_1o110_8 > ._Layer-caret_1o110_57 {
|
|
9432
|
+
visibility: visible;
|
|
9433
|
+
}
|
|
9434
|
+
._Layer-title_1o110_76 {
|
|
9435
|
+
display: flex;
|
|
9436
|
+
gap: var(--puck-space-2);
|
|
9437
|
+
align-items: center;
|
|
9438
|
+
overflow-x: hidden;
|
|
9439
|
+
margin: var(--puck-space-1);
|
|
9440
|
+
cursor: pointer;
|
|
9441
|
+
}
|
|
9442
|
+
._Layer-name_1o110_85 {
|
|
9443
|
+
overflow-x: hidden;
|
|
9444
|
+
text-overflow: ellipsis;
|
|
9445
|
+
white-space: nowrap;
|
|
9446
|
+
}
|
|
9447
|
+
._Layer-icon_1o110_91 {
|
|
9448
|
+
color: var(--puck-outline-color-icon, var(--puck-color-text-subtle));
|
|
9449
|
+
margin-top: var(--puck-space-1);
|
|
9450
|
+
}
|
|
9451
|
+
._Layer-icon_1o110_91 svg {
|
|
9452
|
+
height: var(--_puck-outline-icon-size);
|
|
9453
|
+
width: var(--_puck-outline-icon-size);
|
|
9454
|
+
}
|
|
9455
|
+
._Layer-zones_1o110_101 {
|
|
9456
|
+
display: none;
|
|
9457
|
+
margin-inline-start: var(--puck-outline-space-indent, var(--puck-space-4));
|
|
9458
|
+
}
|
|
9459
|
+
._Layer--isExpanded_1o110_106 > ._Layer-zones_1o110_101 {
|
|
9460
|
+
display: block;
|
|
9461
|
+
}
|
|
9462
|
+
._Layer--isExpanded_1o110_106 > ._Layer-inner_1o110_8 > ._Layer-caret_1o110_57 svg {
|
|
9463
|
+
transform: rotate(90deg);
|
|
9464
|
+
}
|
|
8401
9465
|
@media (hover: hover) and (pointer: fine) {
|
|
8402
|
-
.
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
9466
|
+
._Layer_1o110_1:not(._Layer--isSelected_1o110_115) > ._Layer-inner_1o110_8:hover {
|
|
9467
|
+
--_puck-outline-actions-color-bg: var(--_puck-outline-color-bg-hover);
|
|
9468
|
+
border-color: var(--_puck-outline-color-border-hover);
|
|
9469
|
+
background: var(--_puck-outline-color-bg-hover);
|
|
8406
9470
|
transition: none;
|
|
8407
9471
|
}
|
|
8408
9472
|
}
|
|
8409
|
-
._Layer--
|
|
9473
|
+
._Layer--isSelected_1o110_115 {
|
|
8410
9474
|
border-color: var( --puck-outline-color-border-selected, var(--puck-color-selection-border) );
|
|
8411
9475
|
}
|
|
8412
|
-
._Layer--
|
|
8413
|
-
|
|
9476
|
+
._Layer--isSelected_1o110_115 > ._Layer-inner_1o110_8 {
|
|
9477
|
+
--_puck-outline-actions-color-bg: var(--_puck-outline-color-bg-selected);
|
|
9478
|
+
background: var(--_puck-outline-color-bg-selected);
|
|
8414
9479
|
}
|
|
8415
|
-
._Layer--
|
|
8416
|
-
|
|
8417
|
-
|
|
9480
|
+
._Layer--isExpandCandidate_1o110_138 > ._Layer-inner_1o110_8 {
|
|
9481
|
+
border-color: var(--_puck-outline-color-border-hover);
|
|
9482
|
+
background: var(--_puck-outline-color-bg-hover);
|
|
8418
9483
|
}
|
|
8419
|
-
._Layer-
|
|
8420
|
-
|
|
8421
|
-
|
|
9484
|
+
._Layer--isDragSource_1o110_143 > ._Layer-inner_1o110_8 {
|
|
9485
|
+
color: var(--puck-color-text-muted);
|
|
9486
|
+
background: transparent;
|
|
8422
9487
|
}
|
|
8423
|
-
._Layer--
|
|
8424
|
-
|
|
8425
|
-
|
|
9488
|
+
._Layer--isDragSource_1o110_143 > ._Layer-zones_1o110_101 {
|
|
9489
|
+
opacity: 0.5;
|
|
9490
|
+
}
|
|
9491
|
+
|
|
9492
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-actions/styles.module.css/#css-module-data */
|
|
9493
|
+
._LayerActions_1m5z5_2 {
|
|
9494
|
+
position: sticky;
|
|
9495
|
+
inset-inline-end: calc(var(--puck-space-1) * -1);
|
|
9496
|
+
padding-inline: var(--puck-space-1);
|
|
9497
|
+
display: flex;
|
|
9498
|
+
visibility: hidden;
|
|
9499
|
+
flex-shrink: 0;
|
|
9500
|
+
gap: var(--puck-space-1);
|
|
9501
|
+
color: var(--_puck-outline-color-text);
|
|
9502
|
+
background: var(--_puck-outline-actions-color-bg);
|
|
9503
|
+
}
|
|
9504
|
+
._LayerActions--visible_1m5z5_17 {
|
|
9505
|
+
visibility: visible;
|
|
9506
|
+
}
|
|
9507
|
+
._LayerActions_1m5z5_2 svg {
|
|
9508
|
+
height: var(--_puck-outline-caret-size);
|
|
9509
|
+
width: var(--_puck-outline-caret-size);
|
|
9510
|
+
}
|
|
9511
|
+
|
|
9512
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-items/styles.module.css/#css-module-data */
|
|
9513
|
+
._LayerTree_o5tyt_1 {
|
|
9514
|
+
color: var(--_puck-outline-color-text);
|
|
9515
|
+
font-family: var(--puck-outline-font-family, var(--puck-font-family));
|
|
9516
|
+
font-size: var(--puck-outline-font-size, var(--puck-font-size-xxxs));
|
|
9517
|
+
margin: 0;
|
|
9518
|
+
position: relative;
|
|
9519
|
+
list-style: none;
|
|
9520
|
+
padding: 0;
|
|
8426
9521
|
}
|
|
8427
|
-
.
|
|
8428
|
-
margin-inline-start: var(--puck-space-3);
|
|
9522
|
+
._LayerTree--nested_o5tyt_12 {
|
|
9523
|
+
margin-inline-start: var(--puck-outline-space-indent, var(--puck-space-3));
|
|
8429
9524
|
}
|
|
8430
|
-
|
|
8431
|
-
.
|
|
9525
|
+
|
|
9526
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/components/layer-tree-zone/styles.module.css/#css-module-data */
|
|
9527
|
+
._LayerTree-zoneTitle_fvhlh_2 {
|
|
9528
|
+
color: var(--_puck-outline-zone-color-text);
|
|
9529
|
+
font-size: var( --puck-outline-zone-font-size, calc(var(--puck-font-size-xxxs) * 0.9) );
|
|
8432
9530
|
display: flex;
|
|
8433
9531
|
gap: var(--puck-space-2);
|
|
8434
9532
|
align-items: center;
|
|
8435
|
-
margin: var(--puck-space-2) var(--puck-space-1);
|
|
8436
|
-
overflow-x: hidden;
|
|
8437
|
-
}
|
|
8438
|
-
._Layer-name_1vltj_119 {
|
|
8439
9533
|
overflow-x: hidden;
|
|
8440
|
-
|
|
8441
|
-
|
|
9534
|
+
padding-top: var(--puck-space-1);
|
|
9535
|
+
padding-bottom: var(--puck-space-1);
|
|
9536
|
+
padding-inline-start: var(--_puck-outline-label-indent);
|
|
9537
|
+
border: var(--_puck-outline-border-width) solid transparent;
|
|
8442
9538
|
}
|
|
8443
|
-
.
|
|
8444
|
-
color: var(--puck-outline-color-icon, var(--puck-color-highlight));
|
|
9539
|
+
._LayerTree-zoneIcon_fvhlh_19 {
|
|
8445
9540
|
margin-top: var(--puck-space-1);
|
|
8446
9541
|
}
|
|
8447
|
-
.
|
|
8448
|
-
|
|
8449
|
-
|
|
9542
|
+
._LayerTree-zoneIcon_fvhlh_19 svg {
|
|
9543
|
+
height: var(--_puck-outline-icon-size);
|
|
9544
|
+
width: var(--_puck-outline-icon-size);
|
|
9545
|
+
}
|
|
9546
|
+
._LayerTree-zoneTitle_fvhlh_2[data-puck-drop-target] {
|
|
9547
|
+
color: var(--_puck-outline-color-text-hover);
|
|
9548
|
+
position: relative;
|
|
9549
|
+
overflow: visible;
|
|
9550
|
+
}
|
|
9551
|
+
|
|
9552
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css/#css-module-data */
|
|
9553
|
+
._LayerTreeRoot_kxnd1_1 {
|
|
9554
|
+
min-width: max-content;
|
|
9555
|
+
--_puck-iconbutton-color-bg-hover: transparent;
|
|
9556
|
+
--_puck-outline-color-text: var( --puck-outline-color-text, var(--puck-color-text-secondary) );
|
|
9557
|
+
--_puck-outline-border-width: var( --puck-outline-border-width, var(--puck-border-width-regular) );
|
|
9558
|
+
--_puck-outline-radius: var(--puck-outline-radius, var(--puck-radius-m));
|
|
9559
|
+
--_puck-outline-caret-size: var( --puck-outline-action-size, var(--puck-icon-size-s) );
|
|
9560
|
+
--_puck-outline-icon-size: var( --puck-outline-icon-size, var(--puck-icon-size-xs) );
|
|
9561
|
+
--_puck-outline-color-bg-selected: var( --puck-outline-color-bg-selected, var(--puck-color-interactive-subtle) );
|
|
9562
|
+
--_puck-outline-color-bg-hover: var( --puck-outline-color-bg-hover, var(--puck-color-interactive-soft) );
|
|
9563
|
+
--_puck-outline-color-border-hover: var( --puck-outline-color-border-hover, var(--puck-color-interactive-subtle) );
|
|
9564
|
+
--_puck-outline-color-text-hover: var( --puck-outline-color-text-hover, var(--puck-color-interactive) );
|
|
9565
|
+
--_puck-outline-color-drop-indicator: var( --puck-outline-color-drop-indicator, var(--puck-color-insertion-indicator) );
|
|
9566
|
+
--_puck-outline-drop-indicator-size: var(--puck-border-width-focus);
|
|
9567
|
+
--_puck-outline-zone-color-text: var( --puck-outline-zone-color-text, var(--puck-color-text-muted) );
|
|
9568
|
+
--_puck-outline-actions-color-bg: transparent;
|
|
9569
|
+
--_puck-outline-caret-slot: calc( var(--_puck-outline-caret-size) + var(--puck-iconbutton-space, var(--puck-space-1)) * 2 );
|
|
9570
|
+
--_puck-outline-label-indent: calc( var(--_puck-outline-caret-slot) + var(--puck-space-1) + var(--_puck-outline-border-width) );
|
|
9571
|
+
}
|
|
9572
|
+
|
|
9573
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/collapse-all/styles.module.css/#css-module-data */
|
|
9574
|
+
._CollapseAll_1r4cy_1 {
|
|
9575
|
+
visibility: hidden;
|
|
9576
|
+
}
|
|
9577
|
+
._CollapseAll-icon_1r4cy_5 {
|
|
9578
|
+
height: var(--puck-icon-size-m);
|
|
9579
|
+
width: var(--puck-icon-size-m);
|
|
9580
|
+
}
|
|
9581
|
+
._CollapseAll--visible_1r4cy_10 {
|
|
9582
|
+
visibility: visible;
|
|
9583
|
+
}
|
|
9584
|
+
|
|
9585
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/components/outline-header/styles.module.css/#css-module-data */
|
|
9586
|
+
._OutlineHeader_filq3_1 {
|
|
9587
|
+
display: flex;
|
|
9588
|
+
align-items: center;
|
|
9589
|
+
width: 100%;
|
|
9590
|
+
gap: var(--puck-space-2);
|
|
9591
|
+
padding-block: var(--puck-space-3);
|
|
9592
|
+
padding-inline: var(--puck-space-4);
|
|
9593
|
+
border-bottom: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
9594
|
+
box-sizing: border-box;
|
|
9595
|
+
}
|
|
9596
|
+
._OutlineHeader-title_filq3_12 {
|
|
9597
|
+
color: var(--puck-color-text-secondary);
|
|
9598
|
+
font-size: var(--puck-font-size-xs);
|
|
9599
|
+
font-weight: var(--puck-font-weight-regular);
|
|
9600
|
+
line-height: var(--puck-line-height-m);
|
|
9601
|
+
margin: 0;
|
|
9602
|
+
}
|
|
9603
|
+
|
|
9604
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Outline/styles.module.css/#css-module-data */
|
|
9605
|
+
._OutlineWrapper_b9ln0_1 {
|
|
9606
|
+
display: flex;
|
|
9607
|
+
flex-direction: column;
|
|
9608
|
+
flex-grow: 1;
|
|
9609
|
+
min-height: 0;
|
|
9610
|
+
min-width: 0;
|
|
9611
|
+
}
|
|
9612
|
+
._OutlineWrapper-collapseAll_b9ln0_9 {
|
|
9613
|
+
display: flex;
|
|
9614
|
+
align-items: center;
|
|
9615
|
+
margin-inline-start: auto;
|
|
9616
|
+
}
|
|
9617
|
+
._OutlineWrapper-layers_b9ln0_15 {
|
|
9618
|
+
flex-grow: 1;
|
|
9619
|
+
min-height: 0;
|
|
9620
|
+
overflow: auto;
|
|
9621
|
+
padding: var(--puck-space-1);
|
|
9622
|
+
box-sizing: border-box;
|
|
8450
9623
|
}
|
|
8451
9624
|
|
|
8452
9625
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Layout/styles.module.css/#css-module-data */
|
|
8453
|
-
.
|
|
9626
|
+
._Puck_tzaxg_19 {
|
|
8454
9627
|
font-family: var(--puck-font-family);
|
|
8455
9628
|
overflow-x: hidden;
|
|
8456
9629
|
visibility: visible !important;
|
|
8457
9630
|
}
|
|
8458
9631
|
@media (min-width: 766px) {
|
|
8459
|
-
.
|
|
9632
|
+
._Puck_tzaxg_19 {
|
|
8460
9633
|
overflow-x: auto;
|
|
8461
9634
|
}
|
|
8462
9635
|
}
|
|
8463
|
-
._Puck-
|
|
9636
|
+
._Puck-portal_tzaxg_31 {
|
|
8464
9637
|
position: relative;
|
|
8465
9638
|
z-index: 2;
|
|
8466
9639
|
}
|
|
8467
|
-
.
|
|
9640
|
+
._PuckLayout_tzaxg_36 {
|
|
8468
9641
|
height: 100dvh;
|
|
8469
9642
|
}
|
|
8470
|
-
._PuckLayout-
|
|
9643
|
+
._PuckLayout-inner_tzaxg_40 {
|
|
8471
9644
|
--puck-frame-width: auto;
|
|
8472
9645
|
--puck-pluginbar-width: min-content;
|
|
8473
9646
|
--puck-sidebar-width: 0px;
|
|
@@ -8485,92 +9658,92 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
8485
9658
|
overflow: hidden;
|
|
8486
9659
|
}
|
|
8487
9660
|
@media (min-width: 638px) {
|
|
8488
|
-
._PuckLayout-
|
|
9661
|
+
._PuckLayout-inner_tzaxg_40 {
|
|
8489
9662
|
--puck-pluginbar-width: 68px;
|
|
8490
9663
|
grid-template-areas: "header header header header" "sidenav left editor right";
|
|
8491
9664
|
grid-template-columns: var(--puck-pluginbar-width) 0 var(--puck-frame-width) 0;
|
|
8492
9665
|
grid-template-rows: min-content auto;
|
|
8493
9666
|
}
|
|
8494
|
-
._Puck--
|
|
9667
|
+
._Puck--hidePlugins_tzaxg_73 ._PuckLayout-inner_tzaxg_40 {
|
|
8495
9668
|
--puck-pluginbar-width: 0;
|
|
8496
9669
|
}
|
|
8497
9670
|
}
|
|
8498
|
-
._PuckLayout--
|
|
9671
|
+
._PuckLayout--mounted_tzaxg_78 ._PuckLayout-inner_tzaxg_40 {
|
|
8499
9672
|
--puck-sidebar-width: 186px;
|
|
8500
9673
|
}
|
|
8501
|
-
._PuckLayout--
|
|
9674
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40 {
|
|
8502
9675
|
grid-template-rows: 0 auto 30% 0 var(--puck-pluginbar-width);
|
|
8503
9676
|
transition: grid-template-rows var(--puck-duration-medium) var(--puck-ease-entrance);
|
|
8504
9677
|
}
|
|
8505
|
-
._PuckLayout--
|
|
9678
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
8506
9679
|
grid-template-rows: 0 auto 55% 0 var(--puck-pluginbar-width);
|
|
8507
9680
|
transition: grid-template-rows var(--puck-duration-medium) var(--puck-ease-entrance);
|
|
8508
9681
|
}
|
|
8509
9682
|
@media (min-width: 638px) {
|
|
8510
|
-
._PuckLayout--
|
|
9683
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40 {
|
|
8511
9684
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) 0;
|
|
8512
9685
|
grid-template-rows: min-content auto;
|
|
8513
9686
|
}
|
|
8514
9687
|
}
|
|
8515
|
-
._PuckLayout--
|
|
8516
|
-
._PuckLayout--
|
|
9688
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
9689
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
8517
9690
|
grid-template-rows: 0 auto min-content 0 var(--puck-pluginbar-width);
|
|
8518
9691
|
}
|
|
8519
9692
|
@media (min-width: 638px) {
|
|
8520
|
-
._PuckLayout--
|
|
8521
|
-
._PuckLayout--
|
|
8522
|
-
._PuckLayout--
|
|
8523
|
-
._PuckLayout--
|
|
9693
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
9694
|
+
._PuckLayout--mobilePanelHeightToggle_tzaxg_82._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40,
|
|
9695
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-inner_tzaxg_40,
|
|
9696
|
+
._PuckLayout--mobilePanelHeightMinContent_tzaxg_110._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--isExpanded_tzaxg_90 ._PuckLayout-inner_tzaxg_40 {
|
|
8524
9697
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) 0;
|
|
8525
9698
|
grid-template-rows: min-content auto;
|
|
8526
9699
|
}
|
|
8527
9700
|
}
|
|
8528
9701
|
@media (min-width: 638px) {
|
|
8529
|
-
._PuckLayout--
|
|
9702
|
+
._PuckLayout--rightSideBarVisible_tzaxg_137 ._PuckLayout-inner_tzaxg_40 {
|
|
8530
9703
|
grid-template-columns: var(--puck-pluginbar-width) 0 var(--puck-frame-width) var(--puck-sidebar-right-width);
|
|
8531
9704
|
}
|
|
8532
9705
|
}
|
|
8533
9706
|
@media (min-width: 638px) {
|
|
8534
|
-
._PuckLayout--
|
|
9707
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82._PuckLayout--rightSideBarVisible_tzaxg_137 ._PuckLayout-inner_tzaxg_40 {
|
|
8535
9708
|
grid-template-columns: var(--puck-pluginbar-width) var(--puck-sidebar-left-width) var( --puck-frame-width ) var(--puck-sidebar-right-width);
|
|
8536
9709
|
}
|
|
8537
9710
|
}
|
|
8538
9711
|
@media (min-width: 458px) {
|
|
8539
|
-
._PuckLayout-
|
|
9712
|
+
._PuckLayout-mounted_tzaxg_156 ._PuckLayout-inner_tzaxg_40 {
|
|
8540
9713
|
--puck-frame-width: minmax(266px, auto);
|
|
8541
9714
|
}
|
|
8542
9715
|
}
|
|
8543
9716
|
@media (min-width: 638px) {
|
|
8544
|
-
.
|
|
9717
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8545
9718
|
--puck-sidebar-width: minmax(186px, 250px);
|
|
8546
9719
|
}
|
|
8547
9720
|
}
|
|
8548
9721
|
@media (min-width: 766px) {
|
|
8549
|
-
.
|
|
9722
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8550
9723
|
--puck-frame-width: auto;
|
|
8551
9724
|
}
|
|
8552
9725
|
}
|
|
8553
9726
|
@media (min-width: 990px) {
|
|
8554
|
-
.
|
|
9727
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8555
9728
|
--puck-sidebar-width: 256px;
|
|
8556
9729
|
}
|
|
8557
9730
|
}
|
|
8558
9731
|
@media (min-width: 1198px) {
|
|
8559
|
-
.
|
|
9732
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8560
9733
|
--puck-sidebar-width: 274px;
|
|
8561
9734
|
}
|
|
8562
9735
|
}
|
|
8563
9736
|
@media (min-width: 1398px) {
|
|
8564
|
-
.
|
|
9737
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8565
9738
|
--puck-sidebar-width: 290px;
|
|
8566
9739
|
}
|
|
8567
9740
|
}
|
|
8568
9741
|
@media (min-width: 1598px) {
|
|
8569
|
-
.
|
|
9742
|
+
._PuckLayout_tzaxg_36 ._PuckLayout-inner_tzaxg_40 {
|
|
8570
9743
|
--puck-sidebar-width: 320px;
|
|
8571
9744
|
}
|
|
8572
9745
|
}
|
|
8573
|
-
._PuckLayout-
|
|
9746
|
+
._PuckLayout-nav_tzaxg_197 {
|
|
8574
9747
|
border-top: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
8575
9748
|
background-color: var( --puck-pluginbar-color-bg, var(--puck-color-surface-subtle) );
|
|
8576
9749
|
grid-area: sidenav;
|
|
@@ -8578,35 +9751,39 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
8578
9751
|
width: 100%;
|
|
8579
9752
|
}
|
|
8580
9753
|
@media (min-width: 638px) {
|
|
8581
|
-
._PuckLayout-
|
|
9754
|
+
._PuckLayout-nav_tzaxg_197 {
|
|
8582
9755
|
border-top: 0;
|
|
8583
9756
|
border-right: var(--puck-border-width-regular) solid var(--puck-color-border);
|
|
8584
9757
|
box-sizing: border-box;
|
|
8585
9758
|
}
|
|
8586
9759
|
}
|
|
8587
|
-
._PuckLayout-
|
|
9760
|
+
._PuckLayout-header_tzaxg_217 {
|
|
8588
9761
|
grid-area: header;
|
|
8589
9762
|
}
|
|
8590
|
-
._PuckLayout--
|
|
9763
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-header_tzaxg_217 {
|
|
8591
9764
|
overflow: hidden;
|
|
8592
9765
|
}
|
|
8593
9766
|
@media (min-width: 638px) {
|
|
8594
|
-
._PuckLayout--
|
|
9767
|
+
._PuckLayout--leftSideBarVisible_tzaxg_82 ._PuckLayout-header_tzaxg_217 {
|
|
8595
9768
|
overflow: auto;
|
|
8596
9769
|
}
|
|
8597
9770
|
}
|
|
8598
|
-
.
|
|
9771
|
+
._PuckPluginTab_tzaxg_231 {
|
|
8599
9772
|
display: none;
|
|
8600
9773
|
flex-grow: 1;
|
|
8601
9774
|
max-height: 100%;
|
|
8602
9775
|
}
|
|
8603
|
-
._PuckPluginTab--
|
|
9776
|
+
._PuckPluginTab--visible_tzaxg_237 {
|
|
8604
9777
|
display: flex;
|
|
8605
9778
|
flex-direction: column;
|
|
9779
|
+
min-height: 0;
|
|
8606
9780
|
}
|
|
8607
|
-
._PuckPluginTab-
|
|
9781
|
+
._PuckPluginTab-body_tzaxg_243 {
|
|
9782
|
+
display: flex;
|
|
9783
|
+
flex-direction: column;
|
|
8608
9784
|
flex-grow: 1;
|
|
8609
9785
|
max-height: 100%;
|
|
9786
|
+
min-height: 0;
|
|
8610
9787
|
}
|
|
8611
9788
|
|
|
8612
9789
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css/#css-module-data */
|
|
@@ -9247,11 +10424,13 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
9247
10424
|
}
|
|
9248
10425
|
|
|
9249
10426
|
/* css-module:/home/runner/work/puck/puck/packages/core/plugins/outline/styles.module.css/#css-module-data */
|
|
9250
|
-
.
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
10427
|
+
._OutlinePlugin_1ylsc_1 {
|
|
10428
|
+
display: flex;
|
|
10429
|
+
flex-direction: column;
|
|
10430
|
+
flex-grow: 1;
|
|
10431
|
+
min-height: 0;
|
|
10432
|
+
min-width: 0;
|
|
10433
|
+
position: relative;
|
|
9255
10434
|
}
|
|
9256
10435
|
|
|
9257
10436
|
/* css-module:/home/runner/work/puck/puck/packages/core/plugins/fields/styles.module.css/#css-module-data */
|
|
@@ -9273,7 +10452,7 @@ body:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {
|
|
|
9273
10452
|
padding: var(--puck-space-4);
|
|
9274
10453
|
}
|
|
9275
10454
|
}`;
|
|
9276
|
-
var iframeInteractionStyles = '/* styles/color.css */\n@layer puck-tokens {\n :root {\n --puck-color-rose-01: #4a001c;\n --puck-color-rose-02: #670833;\n --puck-color-rose-03: #87114c;\n --puck-color-rose-04: #a81a66;\n --puck-color-rose-05: #bc5089;\n --puck-color-rose-06: #cc7ca5;\n --puck-color-rose-07: #d89aba;\n --puck-color-rose-08: #e3b8cf;\n --puck-color-rose-09: #efd6e3;\n --puck-color-rose-10: #f6eaf1;\n --puck-color-rose-11: #faf4f8;\n --puck-color-rose-12: #fef8fc;\n --puck-color-azure-01: #00175d;\n --puck-color-azure-02: #002c77;\n --puck-color-azure-03: #014292;\n --puck-color-azure-04: #0158ad;\n --puck-color-azure-05: #3479be;\n --puck-color-azure-06: #6499cf;\n --puck-color-azure-07: #88b0da;\n --puck-color-azure-08: #abc7e5;\n --puck-color-azure-09: #cfdff0;\n --puck-color-azure-10: #e7eef7;\n --puck-color-azure-11: #f3f6fb;\n --puck-color-azure-12: #f7faff;\n --puck-color-green-01: #002000;\n --puck-color-green-02: #043604;\n --puck-color-green-03: #084e08;\n --puck-color-green-04: #0c680c;\n --puck-color-green-05: #1d882f;\n --puck-color-green-06: #2faa53;\n --puck-color-green-07: #56c16f;\n --puck-color-green-08: #7dd78b;\n --puck-color-green-09: #b8e8bf;\n --puck-color-green-10: #ddf3e0;\n --puck-color-green-11: #eff8f0;\n --puck-color-green-12: #f3fcf4;\n --puck-color-yellow-01: #211000;\n --puck-color-yellow-02: #362700;\n --puck-color-yellow-03: #4c4000;\n --puck-color-yellow-04: #645a00;\n --puck-color-yellow-05: #877614;\n --puck-color-yellow-06: #ab9429;\n --puck-color-yellow-07: #bfac4e;\n --puck-color-yellow-08: #d4c474;\n --puck-color-yellow-09: #e6deb1;\n --puck-color-yellow-10: #f3efd9;\n --puck-color-yellow-11: #f9f7ed;\n --puck-color-yellow-12: #fcfaf0;\n --puck-color-red-01: #4c0000;\n --puck-color-red-02: #6a0a10;\n --puck-color-red-03: #8a1422;\n --puck-color-red-04: #ac1f35;\n --puck-color-red-05: #bf5366;\n --puck-color-red-06: #ce7e8e;\n --puck-color-red-07: #d99ca8;\n --puck-color-red-08: #e4b9c2;\n --puck-color-red-09: #efd7db;\n --puck-color-red-10: #f6eaec;\n --puck-color-red-11: #faf4f5;\n --puck-color-red-12: #fff9fa;\n --puck-color-grey-01: #181818;\n --puck-color-grey-02: #292929;\n --puck-color-grey-03: #404040;\n --puck-color-grey-04: #5a5a5a;\n --puck-color-grey-05: #767676;\n --puck-color-grey-06: #949494;\n --puck-color-grey-07: #ababab;\n --puck-color-grey-08: #c3c3c3;\n --puck-color-grey-09: #dcdcdc;\n --puck-color-grey-10: #efefef;\n --puck-color-grey-11: #f5f5f5;\n --puck-color-grey-12: #fafafa;\n --puck-color-black: #000000;\n --puck-color-white: #ffffff;\n }\n}\n\n/* styles/tokens.css */\n@layer puck-tokens {\n :root {\n --puck-color-surface: var(--puck-color-white);\n --puck-color-surface-muted: var(--puck-color-grey-11);\n --puck-color-surface-subtle: var(--puck-color-grey-12);\n --puck-color-surface-inverse: var(--puck-color-grey-01);\n --puck-color-border: var(--puck-color-grey-09);\n --puck-color-border-hover: var(--puck-color-grey-05);\n --puck-color-border-muted: var(--puck-color-grey-10);\n --puck-color-border-inverse: var(--puck-color-grey-05);\n --puck-color-text: var(--puck-color-black);\n --puck-color-text-secondary: var(--puck-color-grey-04);\n --puck-color-text-muted: var(--puck-color-grey-05);\n --puck-color-text-subtle: var(--puck-color-grey-07);\n --puck-color-text-inverse: var(--puck-color-white);\n --puck-opacity-text-inverse: 0.75;\n --puck-color-interactive: var(--puck-color-azure-04);\n --puck-color-interactive-hover: var(--puck-color-azure-03);\n --puck-color-interactive-active: var(--puck-color-azure-02);\n --puck-color-interactive-subtle: var(--puck-color-azure-10);\n --puck-color-interactive-soft: var(--puck-color-azure-11);\n --puck-color-interactive-soft-hover: var(--puck-color-azure-12);\n --puck-color-interactive-neutral-hover: var(--puck-color-grey-10);\n --puck-color-interactive-inverse-hover: var(--puck-color-azure-06);\n --puck-color-interactive-inverse-active: var(--puck-color-azure-07);\n --puck-color-focus-ring: var(--puck-color-azure-05);\n --puck-color-selection-bg: color-mix( in srgb, var(--puck-color-azure-09) 30%, transparent );\n --puck-color-selection-border: var(--puck-color-azure-08);\n --puck-color-highlight: var(--puck-color-rose-07);\n --puck-color-bg-disabled: var(--puck-color-grey-07);\n --puck-color-text-disabled: var(--puck-color-grey-03);\n --puck-color-overlay-backdrop: color-mix( in srgb, var(--puck-color-black) 75%, transparent );\n --puck-space-1: 4px;\n --puck-space-2: 8px;\n --puck-space-3: 12px;\n --puck-space-4: 16px;\n --puck-space-5: 24px;\n --puck-space-chrome-gutter: var(--puck-space-4);\n --puck-radius-none: 0;\n --puck-radius-xs: 2px;\n --puck-radius-s: 3px;\n --puck-radius-m: 4px;\n --puck-radius-l: 8px;\n --puck-radius-pill: 30px;\n --puck-radius-round: 100%;\n --puck-border-width-hairline: 0.5px;\n --puck-border-width-regular: 1px;\n --puck-border-width-focus: 2px;\n --puck-border-width-strong: 4px;\n --puck-duration-fast: 50ms;\n --puck-duration-medium: 150ms;\n --puck-duration-slow: 250ms;\n --puck-ease-exit: ease-in;\n --puck-ease-emphasized: ease-in-out;\n --puck-ease-entrance: ease-out;\n --puck-font-weight-regular: 400;\n --puck-font-weight-medium: 500;\n --puck-font-weight-semibold: 600;\n --puck-font-weight-bold: 700;\n --puck-font-weight-heavy: 800;\n --puck-letter-spacing-ui: 0.05ch;\n --puck-letter-spacing-heading: 0.08ch;\n --puck-icon-size-s: 16px;\n --puck-icon-size-m: 18px;\n --puck-icon-size-l: 24px;\n --puck-space-m-unitless: 24;\n --puck-user-sidebar-left-width: var(--puck-sidebar-width);\n --puck-user-sidebar-right-width: var(--puck-sidebar-width);\n --puck-slot-min-empty-height: 128px;\n }\n}\n\n/* styles/typography.css */\n@layer puck-tokens {\n :root {\n --puck-font-size-scale-base-unitless: 12;\n --puck-font-size-xxxs-unitless: 12;\n --puck-font-size-xxs-unitless: 14;\n --puck-font-size-xs-unitless: 16;\n --puck-font-size-s-unitless: 18;\n --puck-font-size-m-unitless: 21;\n --puck-font-size-l-unitless: 24;\n --puck-font-size-xl-unitless: 28;\n --puck-font-size-xxl-unitless: 36;\n --puck-font-size-xxxl-unitless: 48;\n --puck-font-size-xxxxl-unitless: 56;\n --puck-font-size-xxxs: calc( 1rem * var(--puck-font-size-xxxs-unitless) / 16 );\n --puck-font-size-xxs: calc(1rem * var(--puck-font-size-xxs-unitless) / 16);\n --puck-font-size-xs: calc(1rem * var(--puck-font-size-xs-unitless) / 16);\n --puck-font-size-s: calc(1rem * var(--puck-font-size-s-unitless) / 16);\n --puck-font-size-m: calc(1rem * var(--puck-font-size-m-unitless) / 16);\n --puck-font-size-l: calc(1rem * var(--puck-font-size-l-unitless) / 16);\n --puck-font-size-xl: calc(1rem * var(--puck-font-size-xl-unitless) / 16);\n --puck-font-size-xxl: calc(1rem * var(--puck-font-size-xxl-unitless) / 16);\n --puck-font-size-xxxl: calc( 1rem * var(--puck-font-size-xxxl-unitless) / 16 );\n --puck-font-size-xxxxl: calc( 1rem * var(--puck-font-size-xxxxl-unitless) / 16 );\n --puck-font-size-base: var(--puck-font-size-xs);\n --puck-line-height-reset: 1;\n --puck-line-height-xs: calc( var(--puck-space-m-unitless) / var(--puck-font-size-m-unitless) );\n --puck-line-height-s: calc( var(--puck-space-m-unitless) / var(--puck-font-size-s-unitless) );\n --puck-line-height-m: calc( var(--puck-space-m-unitless) / var(--puck-font-size-xs-unitless) );\n --puck-line-height-l: calc( var(--puck-space-m-unitless) / var(--puck-font-size-xxs-unitless) );\n --puck-line-height-xl: calc( var(--puck-space-m-unitless) / var(--puck-font-size-scale-base-unitless) );\n --puck-line-height-base: var(--puck-line-height-m);\n --puck-fallback-font-stack:\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Helvetica Neue,\n sans-serif,\n Apple Color Emoji,\n Segoe UI Emoji,\n Segoe UI Symbol;\n --puck-font-family: Inter, var(--puck-fallback-font-stack);\n --puck-font-family-monospaced:\n ui-monospace,\n "Cascadia Code",\n "Source Code Pro",\n Menlo,\n Consolas,\n "DejaVu Sans Mono",\n monospace;\n }\n @supports (font-variation-settings: normal) {\n :root {\n --puck-font-family: InterVariable, var(--puck-fallback-font-stack);\n }\n }\n}\n\n/* bundle/core.css */\n:root {\n --_puck-styles-loaded: "true";\n}\n#frame-root {\n height: 1px;\n min-height: 100vh;\n}\n[data-puck-entry] {\n position: relative;\n z-index: 0;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */\n._ActionBar_5vdfr_1 {\n align-items: center;\n cursor: default;\n display: flex;\n width: auto;\n padding-top: var(--puck-actionbar-space-y, var(--puck-space-1));\n padding-bottom: var(--puck-actionbar-space-y, var(--puck-space-1));\n padding-inline-start: var(--puck-actionbar-space-x, 0);\n padding-inline-end: var(--puck-actionbar-space-x, 0);\n border-radius: var(--puck-actionbar-radius, var(--puck-radius-l));\n background: var(--puck-actionbar-color-bg, var(--puck-color-surface-inverse));\n color: var(--puck-color-text-inverse);\n font-family: var(--puck-font-family);\n min-height: 26px;\n}\n._ActionBar-label_5vdfr_17 {\n color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));\n font-size: var(--puck-actionbar-font-size, var(--puck-font-size-xxxs));\n opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));\n font-weight: var(--puck-font-weight-medium);\n padding-inline-start: var(--puck-space-2);\n padding-inline-end: var(--puck-space-2);\n margin-inline-start: var(--puck-space-1);\n margin-inline-end: var(--puck-space-1);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n._ActionBarAction_5vdfr_30 + ._ActionBar-label_5vdfr_17 {\n padding-inline-start: 0;\n}\n._ActionBar-label_5vdfr_17 + ._ActionBarAction_5vdfr_30 {\n margin-inline-start: calc(var(--puck-space-1) * -1);\n}\n._ActionBar-group_5vdfr_38 {\n align-items: center;\n border-inline-start: var(--puck-border-width-hairline) solid var(--puck-actionbar-color-separator, var(--puck-color-border-inverse));\n display: flex;\n height: 100%;\n padding-inline-start: var(--puck-space-1);\n padding-inline-end: var(--puck-space-1);\n}\n._ActionBar-group_5vdfr_38:first-of-type {\n border-inline-start: 0;\n}\n._ActionBar-group_5vdfr_38:empty {\n display: none;\n}\n._ActionBarAction_5vdfr_30 {\n background: transparent;\n border: none;\n color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));\n cursor: pointer;\n padding: var(--puck-actionbar-action-space, 6px);\n margin-inline-start: var(--puck-space-1);\n margin-inline-end: var(--puck-space-1);\n border-radius: var(--puck-radius-m);\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));\n transition: color var(--puck-duration-fast) var(--puck-ease-exit), opacity var(--puck-duration-fast) var(--puck-ease-exit);\n}\n._ActionBarAction--disabled_5vdfr_74 {\n cursor: auto;\n color: var( --puck-actionbar-color-action-disabled, var(--puck-color-text-inverse) );\n opacity: var(--puck-actionbar-opacity-action-disabled, 0.54);\n}\n._ActionBarAction_5vdfr_30 svg {\n max-width: none !important;\n}\n._ActionBarAction_5vdfr_30:focus-visible {\n outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);\n outline-offset: calc(var(--puck-border-width-focus) * -1);\n}\n@media (hover: hover) and (pointer: fine) {\n ._ActionBarAction_5vdfr_30:hover:not(._ActionBarAction--disabled_5vdfr_74) {\n color: var( --puck-actionbar-color-action-hover, var(--puck-color-interactive-inverse-hover) );\n opacity: 1;\n transition: none;\n }\n}\n._ActionBarAction_5vdfr_30:active:not(._ActionBarAction--disabled_5vdfr_74),\n._ActionBarAction--active_5vdfr_104 {\n color: var( --puck-actionbar-color-action-active, var(--puck-color-interactive-inverse-active) );\n opacity: 1;\n transition: none;\n}\n._ActionBar-group_5vdfr_38 * {\n margin: 0;\n}\n._ActionBar-separator_5vdfr_117 {\n background: var( --puck-actionbar-color-separator, var(--puck-color-border-inverse) );\n margin-inline: var(--puck-space-1);\n width: var( --puck-border-width-hairline );\n height: 100%;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */\n._DraggableComponent_1627v_1 {\n position: absolute;\n pointer-events: none;\n}\n._DraggableComponent-overlayWrapper_1627v_6 {\n height: 100%;\n width: 100%;\n top: 0;\n position: absolute;\n pointer-events: none;\n box-sizing: border-box;\n z-index: 1;\n}\n._DraggableComponent-overlay_1627v_6 {\n cursor: pointer;\n height: 100%;\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var( --puck-slot-component-color-overlay-border, var(--puck-color-selection-border) ) solid;\n outline-offset: calc(var(--puck-slot-component-border-width, var(--puck-border-width-focus)) * -1);\n width: 100%;\n}\n._DraggableComponent_1627v_1:focus-visible > ._DraggableComponent-overlayWrapper_1627v_6 {\n outline: var(--puck-border-width-regular) solid var(--puck-color-focus-ring);\n}\n._DraggableComponent-loadingOverlay_1627v_38 {\n background: var(--puck-color-surface);\n color: var(--puck-color-text);\n border-radius: var(--puck-radius-m);\n display: flex;\n padding: var(--puck-space-2);\n top: var(--puck-space-2);\n right: var(--puck-space-2);\n position: absolute;\n z-index: 1;\n pointer-events: all;\n box-sizing: border-box;\n opacity: 0.8;\n z-index: 1;\n}\n._DraggableComponent--hover_1627v_54 > ._DraggableComponent-overlayWrapper_1627v_6 > ._DraggableComponent-overlay_1627v_6 {\n background: var( --puck-slot-component-color-overlay, var(--puck-color-selection-bg) );\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var( --puck-slot-component-color-overlay-border, var(--puck-color-selection-border) ) solid;\n}\n._DraggableComponent--isSelected_1627v_72 > ._DraggableComponent-overlayWrapper_1627v_6 > ._DraggableComponent-overlay_1627v_6 {\n outline-color: var( --puck-slot-component-color-border-selected, var(--puck-color-selection-border) );\n}\n._DraggableComponent_1627v_1:has(._DraggableComponent--hover_1627v_54 > ._DraggableComponent-overlayWrapper_1627v_6) > ._DraggableComponent-overlayWrapper_1627v_6 {\n display: none;\n}\n._DraggableComponent-actionsOverlay_1627v_89 {\n position: sticky;\n opacity: 0;\n pointer-events: none;\n z-index: 2;\n}\n._DraggableComponent--isSelected_1627v_72 ._DraggableComponent-actionsOverlay_1627v_89 {\n opacity: 1;\n pointer-events: auto;\n}\n._DraggableComponent-actions_1627v_89 {\n position: absolute;\n width: auto;\n cursor: grab;\n display: flex;\n box-sizing: border-box;\n transform-origin: right top;\n min-height: 36px;\n}\n._DraggableComponent-actionsAction_1627v_111 {\n height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css/#css-module-data */\n._Drawer_1n90m_1 {\n display: flex;\n flex-direction: column;\n font-family: var(--puck-font-family);\n gap: var(--puck-space-3);\n}\n._Drawer-draggable_1n90m_8 {\n position: relative;\n}\n._Drawer-draggableBg_1n90m_12 {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n z-index: -1;\n}\n._DrawerItem-draggable_1n90m_22 {\n background: var(--puck-drawer-item-color-bg, var(--puck-color-surface));\n color: var(--puck-drawer-item-color-text, var(--puck-color-text));\n cursor: grab;\n padding: var(--puck-drawer-item-space, var(--puck-space-3));\n display: flex;\n border: var(--puck-drawer-item-border-width, var(--puck-border-width-regular)) var(--puck-drawer-item-color-border, var(--puck-color-border)) solid;\n border-radius: var(--puck-drawer-item-radius, var(--puck-radius-m));\n font-size: var(--puck-drawer-item-font-size, var(--puck-font-size-xxs));\n justify-content: space-between;\n align-items: center;\n transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);\n}\n._DrawerItem--disabled_1n90m_38 ._DrawerItem-draggable_1n90m_22 {\n background: var(--puck-color-surface-muted);\n color: var(--puck-color-text-muted);\n cursor: not-allowed;\n}\n._DrawerItem_1n90m_22:focus-visible {\n outline: 0;\n}\n._Drawer_1n90m_1:not(._Drawer--isDraggingFrom_1n90m_48) ._DrawerItem_1n90m_22:focus-visible ._DrawerItem-draggable_1n90m_22 {\n border-radius: var(--puck-radius-m);\n outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);\n outline-offset: var(--puck-border-width-focus);\n}\n@media (hover: hover) and (pointer: fine) {\n ._Drawer_1n90m_1:not(._Drawer--isDraggingFrom_1n90m_48) ._DrawerItem_1n90m_22:not(._DrawerItem--disabled_1n90m_38) ._DrawerItem-draggable_1n90m_22:hover {\n background-color: var( --puck-drawer-item-color-bg-hover, var(--puck-color-interactive-soft-hover) );\n color: var( --puck-drawer-item-color-text-hover, var(--puck-color-interactive) );\n transition: none;\n }\n}\n._DrawerItem-name_1n90m_72 {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/DropZone/styles.module.css/#css-module-data */\n._DropZone_ybznu_1 {\n position: relative;\n height: 100%;\n min-height: var(--puck-slot-min-empty-height);\n outline-offset: calc(var(--puck-slot-border-width, var(--puck-border-width-focus)) * -1);\n width: 100%;\n}\n._DropZone--hasChildren_ybznu_11 {\n min-height: 0;\n}\n._DropZone_ybznu_1:empty {\n min-height: var(--puck-slot-min-empty-height);\n}\n[data-puck-entry]:not([data-puck-dragging]) ._DropZone_ybznu_1 {\n transition: min-height var(--puck-duration-medium) var(--puck-ease-exit);\n}\n._DropZone--isAreaSelected_ybznu_24,\n._DropZone--hoveringOverArea_ybznu_25:not(._DropZone--isRootZone_ybznu_25) {\n background: var(--puck-slot-color-bg, var(--puck-color-selection-bg));\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone_ybznu_1:empty {\n background: var(--puck-slot-color-bg, var(--puck-color-selection-bg));\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone-item_ybznu_39 {\n position: relative;\n}\n._DropZone-hitbox_ybznu_43 {\n position: absolute;\n bottom: calc(var(--puck-space-3) * -1);\n height: var(--puck-space-5);\n width: 100%;\n z-index: 1;\n}\n[data-puck-dragging] ._DropZone--isEnabled_ybznu_51 {\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone_ybznu_1 > *:not([data-puck-component]) {\n opacity: 0;\n}\nbody:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {\n opacity: 0 !important;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */\n._InlineTextField_104qp_1 {\n cursor: text;\n display: inline-block;\n white-space: pre-wrap;\n text-decoration: inherit;\n}\n[data-dnd-dragging] ._InlineTextField_104qp_1 {\n cursor: none;\n caret-color: transparent;\n}\n[data-dnd-dragging] ._InlineTextField_104qp_1::selection {\n display: none;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */\n@keyframes _loader-animation_1w5zn_1 {\n 0% {\n transform: rotate(0deg) scale(1);\n }\n 50% {\n transform: rotate(180deg) scale(0.8);\n }\n 100% {\n transform: rotate(360deg) scale(1);\n }\n}\n._Loader_1w5zn_13 {\n background: transparent;\n border-radius: var(--puck-radius-round);\n border: var(--puck-border-width-focus) solid currentColor;\n border-bottom-color: transparent;\n display: inline-block;\n animation: _loader-animation_1w5zn_1 1s 0s infinite linear;\n animation-fill-mode: both;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css/#css-module-data */\n._RichTextMenu_1ve2j_1 {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n}\n._RichTextMenu--form_1ve2j_7 {\n border-top-left-radius: var(--puck-field-radius, var(--puck-radius-m));\n border-top-right-radius: var(--puck-field-radius, var(--puck-radius-m));\n padding: var(--puck-field-richtext-menu-space-y, 6px) var(--puck-field-richtext-menu-space-x, 6px);\n background-color: var( --puck-field-richtext-menu-color-bg, var(--puck-color-surface-subtle) );\n position: relative;\n scrollbar-width: none;\n overflow-x: auto;\n}\n._RichTextMenu-group_1ve2j_21 {\n display: flex;\n align-items: space-between;\n flex-direction: row;\n flex-wrap: nowrap;\n padding-inline: 6px;\n gap: 2px;\n position: relative;\n}\n._RichTextMenu-group_1ve2j_21:first-of-type {\n padding-left: 0;\n}\n._RichTextMenu-group_1ve2j_21:last-of-type {\n padding-right: 0;\n}\n._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 {\n color: var(--puck-color-text-inverse);\n gap: 0px;\n flex-wrap: nowrap;\n}\n._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {\n border-left: var(--puck-border-width-regular) solid var( --puck-field-richtext-menu-color-separator, var(--puck-color-border-muted) );\n}\n._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {\n border-left: var(--puck-border-width-hairline) solid var(--puck-color-border-inverse);\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data */\n._Control_id4pm_1 .lucide {\n height: var(--puck-icon-size-m);\n width: var(--puck-icon-size-m);\n}\n._Control--inline_id4pm_6 .lucide {\n height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n}\n\n/* components/DraggableComponent/styles.css */\n[data-puck-component] * {\n pointer-events: none;\n user-select: none;\n -webkit-user-select: none;\n}\n[data-puck-component] {\n cursor: grab;\n pointer-events: auto !important;\n user-select: none;\n -webkit-user-select: none;\n}\n[data-puck-dropzone] {\n pointer-events: auto !important;\n}\n[data-puck-disabled] {\n cursor: pointer;\n}\n[data-dnd-placeholder] {\n background: var( --puck-slot-component-color-placeholder, var(--puck-color-azure-06) ) !important;\n border: none !important;\n color: transparent !important;\n opacity: 0.3 !important;\n outline: none !important;\n transition: none !important;\n}\n[data-dnd-placeholder] *,\n[data-dnd-placeholder]::after,\n[data-dnd-placeholder]::before {\n opacity: 0 !important;\n}\n[data-dnd-dragging][data-puck-component] {\n pointer-events: none !important;\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var(--puck-slot-component-color-border-dragging, var(--puck-color-azure-09)) solid !important;\n outline-offset: calc(var(--puck-slot-component-border-width, var(--puck-border-width-focus)) * -1) !important;\n}\n[data-dnd-dragging][data-puck-component] > :first-child {\n margin-top: 0 !important;\n}\n[data-dnd-dragging][data-puck-component] > :last-child {\n margin-bottom: 0 !important;\n}\n\n/* lib/overlay-portal/styles.css */\n[data-puck-overlay-portal],\n[data-puck-overlay-portal] * {\n pointer-events: auto !important;\n}\n[data-puck-entry][data-puck-preview-mode=edit] [data-puck-overlay-portal]:hover {\n outline: 2px var(--puck-color-azure-09, #cfdff0) dashed;\n outline-offset: 2px;\n}\n[data-puck-entry][data-puck-preview-mode=edit] [data-puck-overlay-portal]:focus-within {\n outline: 2px var(--puck-color-azure-07, #88b0da) dashed;\n outline-offset: 2px;\n}';
|
|
10455
|
+
var iframeInteractionStyles = '/* styles/color.css */\n@layer puck-tokens {\n :root {\n --puck-color-rose-01: #4a001c;\n --puck-color-rose-02: #670833;\n --puck-color-rose-03: #87114c;\n --puck-color-rose-04: #a81a66;\n --puck-color-rose-05: #bc5089;\n --puck-color-rose-06: #cc7ca5;\n --puck-color-rose-07: #d89aba;\n --puck-color-rose-08: #e3b8cf;\n --puck-color-rose-09: #efd6e3;\n --puck-color-rose-10: #f6eaf1;\n --puck-color-rose-11: #faf4f8;\n --puck-color-rose-12: #fef8fc;\n --puck-color-azure-01: #00175d;\n --puck-color-azure-02: #002c77;\n --puck-color-azure-03: #014292;\n --puck-color-azure-04: #0158ad;\n --puck-color-azure-05: #3479be;\n --puck-color-azure-06: #6499cf;\n --puck-color-azure-07: #88b0da;\n --puck-color-azure-08: #abc7e5;\n --puck-color-azure-09: #cfdff0;\n --puck-color-azure-10: #e7eef7;\n --puck-color-azure-11: #f3f6fb;\n --puck-color-azure-12: #f7faff;\n --puck-color-green-01: #002000;\n --puck-color-green-02: #043604;\n --puck-color-green-03: #084e08;\n --puck-color-green-04: #0c680c;\n --puck-color-green-05: #1d882f;\n --puck-color-green-06: #2faa53;\n --puck-color-green-07: #56c16f;\n --puck-color-green-08: #7dd78b;\n --puck-color-green-09: #b8e8bf;\n --puck-color-green-10: #ddf3e0;\n --puck-color-green-11: #eff8f0;\n --puck-color-green-12: #f3fcf4;\n --puck-color-yellow-01: #211000;\n --puck-color-yellow-02: #362700;\n --puck-color-yellow-03: #4c4000;\n --puck-color-yellow-04: #645a00;\n --puck-color-yellow-05: #877614;\n --puck-color-yellow-06: #ab9429;\n --puck-color-yellow-07: #bfac4e;\n --puck-color-yellow-08: #d4c474;\n --puck-color-yellow-09: #e6deb1;\n --puck-color-yellow-10: #f3efd9;\n --puck-color-yellow-11: #f9f7ed;\n --puck-color-yellow-12: #fcfaf0;\n --puck-color-red-01: #4c0000;\n --puck-color-red-02: #6a0a10;\n --puck-color-red-03: #8a1422;\n --puck-color-red-04: #ac1f35;\n --puck-color-red-05: #bf5366;\n --puck-color-red-06: #ce7e8e;\n --puck-color-red-07: #d99ca8;\n --puck-color-red-08: #e4b9c2;\n --puck-color-red-09: #efd7db;\n --puck-color-red-10: #f6eaec;\n --puck-color-red-11: #faf4f5;\n --puck-color-red-12: #fff9fa;\n --puck-color-grey-01: #181818;\n --puck-color-grey-02: #292929;\n --puck-color-grey-03: #404040;\n --puck-color-grey-04: #5a5a5a;\n --puck-color-grey-05: #767676;\n --puck-color-grey-06: #949494;\n --puck-color-grey-07: #ababab;\n --puck-color-grey-08: #c3c3c3;\n --puck-color-grey-09: #dcdcdc;\n --puck-color-grey-10: #efefef;\n --puck-color-grey-11: #f5f5f5;\n --puck-color-grey-12: #fafafa;\n --puck-color-black: #000000;\n --puck-color-white: #ffffff;\n }\n}\n\n/* styles/tokens.css */\n@layer puck-tokens {\n :root {\n --puck-color-surface: var(--puck-color-white);\n --puck-color-surface-muted: var(--puck-color-grey-11);\n --puck-color-surface-subtle: var(--puck-color-grey-12);\n --puck-color-surface-inverse: var(--puck-color-grey-01);\n --puck-color-border: var(--puck-color-grey-09);\n --puck-color-border-hover: var(--puck-color-grey-05);\n --puck-color-border-muted: var(--puck-color-grey-10);\n --puck-color-border-inverse: var(--puck-color-grey-05);\n --puck-color-text: var(--puck-color-black);\n --puck-color-text-secondary: var(--puck-color-grey-04);\n --puck-color-text-muted: var(--puck-color-grey-05);\n --puck-color-text-subtle: var(--puck-color-grey-07);\n --puck-color-text-inverse: var(--puck-color-white);\n --puck-opacity-text-inverse: 0.75;\n --puck-color-interactive: var(--puck-color-azure-04);\n --puck-color-interactive-hover: var(--puck-color-azure-03);\n --puck-color-interactive-active: var(--puck-color-azure-02);\n --puck-color-interactive-subtle: var(--puck-color-azure-10);\n --puck-color-interactive-soft: var(--puck-color-azure-11);\n --puck-color-interactive-soft-hover: var(--puck-color-azure-12);\n --puck-color-interactive-neutral-hover: var(--puck-color-grey-10);\n --puck-color-interactive-inverse-hover: var(--puck-color-azure-06);\n --puck-color-interactive-inverse-active: var(--puck-color-azure-07);\n --puck-color-focus-ring: var(--puck-color-azure-05);\n --puck-color-selection-bg: color-mix( in srgb, var(--puck-color-azure-09) 30%, transparent );\n --puck-color-selection-border: var(--puck-color-azure-08);\n --puck-color-insertion-indicator: var(--puck-color-azure-06);\n --puck-color-highlight: var(--puck-color-rose-07);\n --puck-color-bg-disabled: var(--puck-color-grey-07);\n --puck-color-text-disabled: var(--puck-color-grey-03);\n --puck-color-overlay-backdrop: color-mix( in srgb, var(--puck-color-black) 75%, transparent );\n --puck-space-1: 4px;\n --puck-space-2: 8px;\n --puck-space-3: 12px;\n --puck-space-4: 16px;\n --puck-space-5: 24px;\n --puck-space-chrome-gutter: var(--puck-space-4);\n --puck-radius-none: 0;\n --puck-radius-xs: 2px;\n --puck-radius-s: 3px;\n --puck-radius-m: 4px;\n --puck-radius-l: 8px;\n --puck-radius-pill: 30px;\n --puck-radius-round: 100%;\n --puck-border-width-hairline: 0.5px;\n --puck-border-width-regular: 1px;\n --puck-border-width-focus: 2px;\n --puck-border-width-strong: 4px;\n --puck-duration-fast: 50ms;\n --puck-duration-medium: 150ms;\n --puck-duration-slow: 250ms;\n --puck-ease-exit: ease-in;\n --puck-ease-emphasized: ease-in-out;\n --puck-ease-entrance: ease-out;\n --puck-font-weight-regular: 400;\n --puck-font-weight-medium: 500;\n --puck-font-weight-semibold: 600;\n --puck-font-weight-bold: 700;\n --puck-font-weight-heavy: 800;\n --puck-letter-spacing-ui: 0.05ch;\n --puck-letter-spacing-heading: 0.08ch;\n --puck-icon-size-xs: 14px;\n --puck-icon-size-s: 16px;\n --puck-icon-size-m: 18px;\n --puck-icon-size-l: 24px;\n --puck-space-m-unitless: 24;\n --puck-user-sidebar-left-width: var(--puck-sidebar-width);\n --puck-user-sidebar-right-width: var(--puck-sidebar-width);\n --puck-slot-min-empty-height: 128px;\n }\n}\n\n/* styles/typography.css */\n@layer puck-tokens {\n :root {\n --puck-font-size-scale-base-unitless: 12;\n --puck-font-size-xxxs-unitless: 12;\n --puck-font-size-xxs-unitless: 14;\n --puck-font-size-xs-unitless: 16;\n --puck-font-size-s-unitless: 18;\n --puck-font-size-m-unitless: 21;\n --puck-font-size-l-unitless: 24;\n --puck-font-size-xl-unitless: 28;\n --puck-font-size-xxl-unitless: 36;\n --puck-font-size-xxxl-unitless: 48;\n --puck-font-size-xxxxl-unitless: 56;\n --puck-font-size-xxxs: calc( 1rem * var(--puck-font-size-xxxs-unitless) / 16 );\n --puck-font-size-xxs: calc(1rem * var(--puck-font-size-xxs-unitless) / 16);\n --puck-font-size-xs: calc(1rem * var(--puck-font-size-xs-unitless) / 16);\n --puck-font-size-s: calc(1rem * var(--puck-font-size-s-unitless) / 16);\n --puck-font-size-m: calc(1rem * var(--puck-font-size-m-unitless) / 16);\n --puck-font-size-l: calc(1rem * var(--puck-font-size-l-unitless) / 16);\n --puck-font-size-xl: calc(1rem * var(--puck-font-size-xl-unitless) / 16);\n --puck-font-size-xxl: calc(1rem * var(--puck-font-size-xxl-unitless) / 16);\n --puck-font-size-xxxl: calc( 1rem * var(--puck-font-size-xxxl-unitless) / 16 );\n --puck-font-size-xxxxl: calc( 1rem * var(--puck-font-size-xxxxl-unitless) / 16 );\n --puck-font-size-base: var(--puck-font-size-xs);\n --puck-line-height-reset: 1;\n --puck-line-height-xs: calc( var(--puck-space-m-unitless) / var(--puck-font-size-m-unitless) );\n --puck-line-height-s: calc( var(--puck-space-m-unitless) / var(--puck-font-size-s-unitless) );\n --puck-line-height-m: calc( var(--puck-space-m-unitless) / var(--puck-font-size-xs-unitless) );\n --puck-line-height-l: calc( var(--puck-space-m-unitless) / var(--puck-font-size-xxs-unitless) );\n --puck-line-height-xl: calc( var(--puck-space-m-unitless) / var(--puck-font-size-scale-base-unitless) );\n --puck-line-height-base: var(--puck-line-height-m);\n --puck-fallback-font-stack:\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Helvetica Neue,\n sans-serif,\n Apple Color Emoji,\n Segoe UI Emoji,\n Segoe UI Symbol;\n --puck-font-family: Inter, var(--puck-fallback-font-stack);\n --puck-font-family-monospaced:\n ui-monospace,\n "Cascadia Code",\n "Source Code Pro",\n Menlo,\n Consolas,\n "DejaVu Sans Mono",\n monospace;\n }\n @supports (font-variation-settings: normal) {\n :root {\n --puck-font-family: InterVariable, var(--puck-fallback-font-stack);\n }\n }\n}\n\n/* bundle/core.css */\n:root {\n --_puck-styles-loaded: "true";\n}\n#frame-root {\n height: 1px;\n min-height: 100vh;\n}\n[data-puck-entry] {\n position: relative;\n z-index: 0;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */\n._ActionBar_5vdfr_1 {\n align-items: center;\n cursor: default;\n display: flex;\n width: auto;\n padding-top: var(--puck-actionbar-space-y, var(--puck-space-1));\n padding-bottom: var(--puck-actionbar-space-y, var(--puck-space-1));\n padding-inline-start: var(--puck-actionbar-space-x, 0);\n padding-inline-end: var(--puck-actionbar-space-x, 0);\n border-radius: var(--puck-actionbar-radius, var(--puck-radius-l));\n background: var(--puck-actionbar-color-bg, var(--puck-color-surface-inverse));\n color: var(--puck-color-text-inverse);\n font-family: var(--puck-font-family);\n min-height: 26px;\n}\n._ActionBar-label_5vdfr_17 {\n color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));\n font-size: var(--puck-actionbar-font-size, var(--puck-font-size-xxxs));\n opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));\n font-weight: var(--puck-font-weight-medium);\n padding-inline-start: var(--puck-space-2);\n padding-inline-end: var(--puck-space-2);\n margin-inline-start: var(--puck-space-1);\n margin-inline-end: var(--puck-space-1);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n._ActionBarAction_5vdfr_30 + ._ActionBar-label_5vdfr_17 {\n padding-inline-start: 0;\n}\n._ActionBar-label_5vdfr_17 + ._ActionBarAction_5vdfr_30 {\n margin-inline-start: calc(var(--puck-space-1) * -1);\n}\n._ActionBar-group_5vdfr_38 {\n align-items: center;\n border-inline-start: var(--puck-border-width-hairline) solid var(--puck-actionbar-color-separator, var(--puck-color-border-inverse));\n display: flex;\n height: 100%;\n padding-inline-start: var(--puck-space-1);\n padding-inline-end: var(--puck-space-1);\n}\n._ActionBar-group_5vdfr_38:first-of-type {\n border-inline-start: 0;\n}\n._ActionBar-group_5vdfr_38:empty {\n display: none;\n}\n._ActionBarAction_5vdfr_30 {\n background: transparent;\n border: none;\n color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));\n cursor: pointer;\n padding: var(--puck-actionbar-action-space, 6px);\n margin-inline-start: var(--puck-space-1);\n margin-inline-end: var(--puck-space-1);\n border-radius: var(--puck-radius-m);\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));\n transition: color var(--puck-duration-fast) var(--puck-ease-exit), opacity var(--puck-duration-fast) var(--puck-ease-exit);\n}\n._ActionBarAction--disabled_5vdfr_74 {\n cursor: auto;\n color: var( --puck-actionbar-color-action-disabled, var(--puck-color-text-inverse) );\n opacity: var(--puck-actionbar-opacity-action-disabled, 0.54);\n}\n._ActionBarAction_5vdfr_30 svg {\n max-width: none !important;\n}\n._ActionBarAction_5vdfr_30:focus-visible {\n outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);\n outline-offset: calc(var(--puck-border-width-focus) * -1);\n}\n@media (hover: hover) and (pointer: fine) {\n ._ActionBarAction_5vdfr_30:hover:not(._ActionBarAction--disabled_5vdfr_74) {\n color: var( --puck-actionbar-color-action-hover, var(--puck-color-interactive-inverse-hover) );\n opacity: 1;\n transition: none;\n }\n}\n._ActionBarAction_5vdfr_30:active:not(._ActionBarAction--disabled_5vdfr_74),\n._ActionBarAction--active_5vdfr_104 {\n color: var( --puck-actionbar-color-action-active, var(--puck-color-interactive-inverse-active) );\n opacity: 1;\n transition: none;\n}\n._ActionBar-group_5vdfr_38 * {\n margin: 0;\n}\n._ActionBar-separator_5vdfr_117 {\n background: var( --puck-actionbar-color-separator, var(--puck-color-border-inverse) );\n margin-inline: var(--puck-space-1);\n width: var( --puck-border-width-hairline );\n height: 100%;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */\n._DraggableComponent_1627v_1 {\n position: absolute;\n pointer-events: none;\n}\n._DraggableComponent-overlayWrapper_1627v_6 {\n height: 100%;\n width: 100%;\n top: 0;\n position: absolute;\n pointer-events: none;\n box-sizing: border-box;\n z-index: 1;\n}\n._DraggableComponent-overlay_1627v_6 {\n cursor: pointer;\n height: 100%;\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var( --puck-slot-component-color-overlay-border, var(--puck-color-selection-border) ) solid;\n outline-offset: calc(var(--puck-slot-component-border-width, var(--puck-border-width-focus)) * -1);\n width: 100%;\n}\n._DraggableComponent_1627v_1:focus-visible > ._DraggableComponent-overlayWrapper_1627v_6 {\n outline: var(--puck-border-width-regular) solid var(--puck-color-focus-ring);\n}\n._DraggableComponent-loadingOverlay_1627v_38 {\n background: var(--puck-color-surface);\n color: var(--puck-color-text);\n border-radius: var(--puck-radius-m);\n display: flex;\n padding: var(--puck-space-2);\n top: var(--puck-space-2);\n right: var(--puck-space-2);\n position: absolute;\n z-index: 1;\n pointer-events: all;\n box-sizing: border-box;\n opacity: 0.8;\n z-index: 1;\n}\n._DraggableComponent--hover_1627v_54 > ._DraggableComponent-overlayWrapper_1627v_6 > ._DraggableComponent-overlay_1627v_6 {\n background: var( --puck-slot-component-color-overlay, var(--puck-color-selection-bg) );\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var( --puck-slot-component-color-overlay-border, var(--puck-color-selection-border) ) solid;\n}\n._DraggableComponent--isSelected_1627v_72 > ._DraggableComponent-overlayWrapper_1627v_6 > ._DraggableComponent-overlay_1627v_6 {\n outline-color: var( --puck-slot-component-color-border-selected, var(--puck-color-selection-border) );\n}\n._DraggableComponent_1627v_1:has(._DraggableComponent--hover_1627v_54 > ._DraggableComponent-overlayWrapper_1627v_6) > ._DraggableComponent-overlayWrapper_1627v_6 {\n display: none;\n}\n._DraggableComponent-actionsOverlay_1627v_89 {\n position: sticky;\n opacity: 0;\n pointer-events: none;\n z-index: 2;\n}\n._DraggableComponent--isSelected_1627v_72 ._DraggableComponent-actionsOverlay_1627v_89 {\n opacity: 1;\n pointer-events: auto;\n}\n._DraggableComponent-actions_1627v_89 {\n position: absolute;\n width: auto;\n cursor: grab;\n display: flex;\n box-sizing: border-box;\n transform-origin: right top;\n min-height: 36px;\n}\n._DraggableComponent-actionsAction_1627v_111 {\n height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css/#css-module-data */\n._Drawer_1n90m_1 {\n display: flex;\n flex-direction: column;\n font-family: var(--puck-font-family);\n gap: var(--puck-space-3);\n}\n._Drawer-draggable_1n90m_8 {\n position: relative;\n}\n._Drawer-draggableBg_1n90m_12 {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n z-index: -1;\n}\n._DrawerItem-draggable_1n90m_22 {\n background: var(--puck-drawer-item-color-bg, var(--puck-color-surface));\n color: var(--puck-drawer-item-color-text, var(--puck-color-text));\n cursor: grab;\n padding: var(--puck-drawer-item-space, var(--puck-space-3));\n display: flex;\n border: var(--puck-drawer-item-border-width, var(--puck-border-width-regular)) var(--puck-drawer-item-color-border, var(--puck-color-border)) solid;\n border-radius: var(--puck-drawer-item-radius, var(--puck-radius-m));\n font-size: var(--puck-drawer-item-font-size, var(--puck-font-size-xxs));\n justify-content: space-between;\n align-items: center;\n transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);\n}\n._DrawerItem--disabled_1n90m_38 ._DrawerItem-draggable_1n90m_22 {\n background: var(--puck-color-surface-muted);\n color: var(--puck-color-text-muted);\n cursor: not-allowed;\n}\n._DrawerItem_1n90m_22:focus-visible {\n outline: 0;\n}\n._Drawer_1n90m_1:not(._Drawer--isDraggingFrom_1n90m_48) ._DrawerItem_1n90m_22:focus-visible ._DrawerItem-draggable_1n90m_22 {\n border-radius: var(--puck-radius-m);\n outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);\n outline-offset: var(--puck-border-width-focus);\n}\n@media (hover: hover) and (pointer: fine) {\n ._Drawer_1n90m_1:not(._Drawer--isDraggingFrom_1n90m_48) ._DrawerItem_1n90m_22:not(._DrawerItem--disabled_1n90m_38) ._DrawerItem-draggable_1n90m_22:hover {\n background-color: var( --puck-drawer-item-color-bg-hover, var(--puck-color-interactive-soft-hover) );\n color: var( --puck-drawer-item-color-text-hover, var(--puck-color-interactive) );\n transition: none;\n }\n}\n._DrawerItem-name_1n90m_72 {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/DropZone/styles.module.css/#css-module-data */\n._DropZone_ybznu_1 {\n position: relative;\n height: 100%;\n min-height: var(--puck-slot-min-empty-height);\n outline-offset: calc(var(--puck-slot-border-width, var(--puck-border-width-focus)) * -1);\n width: 100%;\n}\n._DropZone--hasChildren_ybznu_11 {\n min-height: 0;\n}\n._DropZone_ybznu_1:empty {\n min-height: var(--puck-slot-min-empty-height);\n}\n[data-puck-entry]:not([data-puck-dragging]) ._DropZone_ybznu_1 {\n transition: min-height var(--puck-duration-medium) var(--puck-ease-exit);\n}\n._DropZone--isAreaSelected_ybznu_24,\n._DropZone--hoveringOverArea_ybznu_25:not(._DropZone--isRootZone_ybznu_25) {\n background: var(--puck-slot-color-bg, var(--puck-color-selection-bg));\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone_ybznu_1:empty {\n background: var(--puck-slot-color-bg, var(--puck-color-selection-bg));\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone-item_ybznu_39 {\n position: relative;\n}\n._DropZone-hitbox_ybznu_43 {\n position: absolute;\n bottom: calc(var(--puck-space-3) * -1);\n height: var(--puck-space-5);\n width: 100%;\n z-index: 1;\n}\n[data-puck-dragging] ._DropZone--isEnabled_ybznu_51 {\n outline: var(--puck-slot-border-width, var(--puck-border-width-focus)) var(--puck-slot-border-style, dashed) var(--puck-slot-color-border, var(--puck-color-selection-border));\n}\n._DropZone_ybznu_1 > *:not([data-puck-component]) {\n opacity: 0;\n}\nbody:has(._DropZone--isAnimating_ybznu_62:empty) [data-puck-overlay] {\n opacity: 0 !important;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */\n._InlineTextField_104qp_1 {\n cursor: text;\n display: inline-block;\n white-space: pre-wrap;\n text-decoration: inherit;\n}\n[data-dnd-dragging] ._InlineTextField_104qp_1 {\n cursor: none;\n caret-color: transparent;\n}\n[data-dnd-dragging] ._InlineTextField_104qp_1::selection {\n display: none;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */\n@keyframes _loader-animation_1w5zn_1 {\n 0% {\n transform: rotate(0deg) scale(1);\n }\n 50% {\n transform: rotate(180deg) scale(0.8);\n }\n 100% {\n transform: rotate(360deg) scale(1);\n }\n}\n._Loader_1w5zn_13 {\n background: transparent;\n border-radius: var(--puck-radius-round);\n border: var(--puck-border-width-focus) solid currentColor;\n border-bottom-color: transparent;\n display: inline-block;\n animation: _loader-animation_1w5zn_1 1s 0s infinite linear;\n animation-fill-mode: both;\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css/#css-module-data */\n._RichTextMenu_1ve2j_1 {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n}\n._RichTextMenu--form_1ve2j_7 {\n border-top-left-radius: var(--puck-field-radius, var(--puck-radius-m));\n border-top-right-radius: var(--puck-field-radius, var(--puck-radius-m));\n padding: var(--puck-field-richtext-menu-space-y, 6px) var(--puck-field-richtext-menu-space-x, 6px);\n background-color: var( --puck-field-richtext-menu-color-bg, var(--puck-color-surface-subtle) );\n position: relative;\n scrollbar-width: none;\n overflow-x: auto;\n}\n._RichTextMenu-group_1ve2j_21 {\n display: flex;\n align-items: space-between;\n flex-direction: row;\n flex-wrap: nowrap;\n padding-inline: 6px;\n gap: 2px;\n position: relative;\n}\n._RichTextMenu-group_1ve2j_21:first-of-type {\n padding-left: 0;\n}\n._RichTextMenu-group_1ve2j_21:last-of-type {\n padding-right: 0;\n}\n._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 {\n color: var(--puck-color-text-inverse);\n gap: 0px;\n flex-wrap: nowrap;\n}\n._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {\n border-left: var(--puck-border-width-regular) solid var( --puck-field-richtext-menu-color-separator, var(--puck-color-border-muted) );\n}\n._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {\n border-left: var(--puck-border-width-hairline) solid var(--puck-color-border-inverse);\n}\n\n/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data */\n._Control_id4pm_1 .lucide {\n height: var(--puck-icon-size-m);\n width: var(--puck-icon-size-m);\n}\n._Control--inline_id4pm_6 .lucide {\n height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));\n}\n\n/* components/DraggableComponent/styles.css */\n[data-puck-component] * {\n pointer-events: none;\n user-select: none;\n -webkit-user-select: none;\n}\n[data-puck-component] {\n cursor: grab;\n pointer-events: auto !important;\n user-select: none;\n -webkit-user-select: none;\n}\n[data-puck-dropzone] {\n pointer-events: auto !important;\n}\n[data-puck-disabled] {\n cursor: pointer;\n}\n[data-dnd-placeholder] {\n background: var( --puck-slot-component-color-placeholder, var(--puck-color-azure-06) ) !important;\n border: none !important;\n color: transparent !important;\n opacity: 0.3 !important;\n outline: none !important;\n transition: none !important;\n}\n[data-dnd-placeholder] *,\n[data-dnd-placeholder]::after,\n[data-dnd-placeholder]::before {\n opacity: 0 !important;\n}\n[data-dnd-dragging][data-puck-component] {\n pointer-events: none !important;\n outline: var( --puck-slot-component-border-width, var(--puck-border-width-focus) ) var(--puck-slot-component-color-border-dragging, var(--puck-color-azure-09)) solid !important;\n outline-offset: calc(var(--puck-slot-component-border-width, var(--puck-border-width-focus)) * -1) !important;\n}\n[data-dnd-dragging][data-puck-component] > :first-child {\n margin-top: 0 !important;\n}\n[data-dnd-dragging][data-puck-component] > :last-child {\n margin-bottom: 0 !important;\n}\n\n/* lib/overlay-portal/styles.css */\n[data-puck-overlay-portal],\n[data-puck-overlay-portal] * {\n pointer-events: auto !important;\n}\n[data-puck-entry][data-puck-preview-mode=edit] [data-puck-overlay-portal]:hover {\n outline: 2px var(--puck-color-azure-09, #cfdff0) dashed;\n outline-offset: 2px;\n}\n[data-puck-entry][data-puck-preview-mode=edit] [data-puck-overlay-portal]:focus-within {\n outline: 2px var(--puck-color-azure-07, #88b0da) dashed;\n outline-offset: 2px;\n}';
|
|
9277
10456
|
|
|
9278
10457
|
// lib/use-inject-css.ts
|
|
9279
10458
|
var PUCK_STYLE_SOURCE_ATTRIBUTE = "data-puck-style-source";
|
|
@@ -9411,7 +10590,7 @@ var useInjectIframeCss = (targetDocument) => {
|
|
|
9411
10590
|
};
|
|
9412
10591
|
|
|
9413
10592
|
// components/AutoFrame/index.tsx
|
|
9414
|
-
import { Fragment as Fragment12, jsx as
|
|
10593
|
+
import { Fragment as Fragment12, jsx as jsx53 } from "react/jsx-runtime";
|
|
9415
10594
|
var styleSelector = 'style, link[rel="stylesheet"]';
|
|
9416
10595
|
var mirroredStyleAttribute = "data-puck-style-mirror";
|
|
9417
10596
|
var shouldMirrorStyleElement = (style) => {
|
|
@@ -9661,10 +10840,10 @@ var CopyHostStyles = ({
|
|
|
9661
10840
|
removeAllMirrors();
|
|
9662
10841
|
};
|
|
9663
10842
|
}, [syncHostStyles]);
|
|
9664
|
-
return /* @__PURE__ */
|
|
10843
|
+
return /* @__PURE__ */ jsx53(Fragment12, { children });
|
|
9665
10844
|
};
|
|
9666
|
-
var autoFrameContext =
|
|
9667
|
-
var useFrame = () =>
|
|
10845
|
+
var autoFrameContext = createContext7({});
|
|
10846
|
+
var useFrame = () => useContext16(autoFrameContext);
|
|
9668
10847
|
function AutoFrame(_a) {
|
|
9669
10848
|
var _b = _a, {
|
|
9670
10849
|
children,
|
|
@@ -9687,10 +10866,10 @@ function AutoFrame(_a) {
|
|
|
9687
10866
|
"frameRef",
|
|
9688
10867
|
"syncHostStyles"
|
|
9689
10868
|
]);
|
|
9690
|
-
const [loaded, setLoaded] =
|
|
9691
|
-
const [ctx, setCtx] =
|
|
9692
|
-
const [mountTarget, setMountTarget] =
|
|
9693
|
-
const [stylesLoaded, setStylesLoaded] =
|
|
10869
|
+
const [loaded, setLoaded] = useState19(false);
|
|
10870
|
+
const [ctx, setCtx] = useState19({});
|
|
10871
|
+
const [mountTarget, setMountTarget] = useState19();
|
|
10872
|
+
const [stylesLoaded, setStylesLoaded] = useState19(false);
|
|
9694
10873
|
useEffect22(() => {
|
|
9695
10874
|
if (loaded) {
|
|
9696
10875
|
setStylesLoaded(!syncHostStyles);
|
|
@@ -9715,7 +10894,7 @@ function AutoFrame(_a) {
|
|
|
9715
10894
|
}
|
|
9716
10895
|
}
|
|
9717
10896
|
}, [frameRef, loaded, stylesLoaded]);
|
|
9718
|
-
return /* @__PURE__ */
|
|
10897
|
+
return /* @__PURE__ */ jsx53(
|
|
9719
10898
|
"iframe",
|
|
9720
10899
|
__spreadProps(__spreadValues({}, props), {
|
|
9721
10900
|
className,
|
|
@@ -9725,7 +10904,7 @@ function AutoFrame(_a) {
|
|
|
9725
10904
|
onLoad: () => {
|
|
9726
10905
|
setLoaded(true);
|
|
9727
10906
|
},
|
|
9728
|
-
children: /* @__PURE__ */
|
|
10907
|
+
children: /* @__PURE__ */ jsx53(autoFrameContext.Provider, { value: ctx, children: loaded && mountTarget && /* @__PURE__ */ jsx53(
|
|
9729
10908
|
CopyHostStyles,
|
|
9730
10909
|
{
|
|
9731
10910
|
debug,
|
|
@@ -9742,11 +10921,11 @@ var AutoFrame_default = AutoFrame;
|
|
|
9742
10921
|
|
|
9743
10922
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css#css-module
|
|
9744
10923
|
init_react_import();
|
|
9745
|
-
var
|
|
10924
|
+
var styles_module_default28 = { "PuckPreview": "_PuckPreview_zbic3_1", "PuckPreview-frame": "_PuckPreview-frame_zbic3_6" };
|
|
9746
10925
|
|
|
9747
10926
|
// components/Puck/components/Preview/index.tsx
|
|
9748
|
-
import { Fragment as Fragment13, jsx as
|
|
9749
|
-
var
|
|
10927
|
+
import { Fragment as Fragment13, jsx as jsx54 } from "react/jsx-runtime";
|
|
10928
|
+
var getClassName34 = get_class_name_factory_default("PuckPreview", styles_module_default28);
|
|
9750
10929
|
var useBubbleIframeEvents = (ref) => {
|
|
9751
10930
|
const status = useAppStore((s) => s.status);
|
|
9752
10931
|
useEffect23(() => {
|
|
@@ -9811,7 +10990,7 @@ var Page = memo9((_a) => {
|
|
|
9811
10990
|
const richtextProps = useRichtextProps((_b2 = (_a2 = config.root) == null ? void 0 : _a2.fields) != null ? _b2 : {}, pageProps);
|
|
9812
10991
|
return ((_c = config.root) == null ? void 0 : _c.render) ? (_d = config.root) == null ? void 0 : _d.render(__spreadValues(__spreadValues({
|
|
9813
10992
|
id: "puck-root"
|
|
9814
|
-
}, propsWithSlots), richtextProps)) : /* @__PURE__ */
|
|
10993
|
+
}, propsWithSlots), richtextProps)) : /* @__PURE__ */ jsx54(Fragment13, { children: propsWithSlots.children });
|
|
9815
10994
|
});
|
|
9816
10995
|
Page.displayName = "Page";
|
|
9817
10996
|
var Preview2 = ({ id = "puck-preview" }) => {
|
|
@@ -9825,12 +11004,12 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9825
11004
|
const renderData = useAppStore(
|
|
9826
11005
|
(s) => s.state.ui.previewMode === "edit" ? null : s.state.data
|
|
9827
11006
|
);
|
|
9828
|
-
const Frame =
|
|
11007
|
+
const Frame = useMemo21(() => overrides.iframe, [overrides]);
|
|
9829
11008
|
const rootProps = root.props || root;
|
|
9830
11009
|
const ref = useRef11(null);
|
|
9831
11010
|
useBubbleIframeEvents(ref);
|
|
9832
11011
|
usePreviewModeAttribute(ref);
|
|
9833
|
-
const inner = !renderData ? /* @__PURE__ */
|
|
11012
|
+
const inner = !renderData ? /* @__PURE__ */ jsx54(
|
|
9834
11013
|
Page,
|
|
9835
11014
|
__spreadProps(__spreadValues({}, rootProps), {
|
|
9836
11015
|
config,
|
|
@@ -9841,18 +11020,18 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9841
11020
|
metadata
|
|
9842
11021
|
},
|
|
9843
11022
|
editMode: true,
|
|
9844
|
-
children: /* @__PURE__ */
|
|
11023
|
+
children: /* @__PURE__ */ jsx54(DropZonePure, { zone: rootDroppableId })
|
|
9845
11024
|
})
|
|
9846
|
-
) : /* @__PURE__ */
|
|
11025
|
+
) : /* @__PURE__ */ jsx54(Render, { data: renderData, config, metadata });
|
|
9847
11026
|
useEffect23(() => {
|
|
9848
11027
|
if (!iframe.enabled) {
|
|
9849
11028
|
setStatus("READY");
|
|
9850
11029
|
}
|
|
9851
11030
|
}, [iframe.enabled]);
|
|
9852
|
-
return /* @__PURE__ */
|
|
11031
|
+
return /* @__PURE__ */ jsx54(
|
|
9853
11032
|
"div",
|
|
9854
11033
|
{
|
|
9855
|
-
className:
|
|
11034
|
+
className: getClassName34(),
|
|
9856
11035
|
id,
|
|
9857
11036
|
"data-puck-preview": true,
|
|
9858
11037
|
onClick: (e) => {
|
|
@@ -9861,11 +11040,11 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9861
11040
|
dispatch({ type: "setUi", ui: { itemSelector: null } });
|
|
9862
11041
|
}
|
|
9863
11042
|
},
|
|
9864
|
-
children: iframe.enabled ? /* @__PURE__ */
|
|
11043
|
+
children: iframe.enabled ? /* @__PURE__ */ jsx54(
|
|
9865
11044
|
AutoFrame_default,
|
|
9866
11045
|
{
|
|
9867
11046
|
id: "preview-frame",
|
|
9868
|
-
className:
|
|
11047
|
+
className: getClassName34("frame"),
|
|
9869
11048
|
"data-rfd-iframe": true,
|
|
9870
11049
|
syncHostStyles: iframe.syncHostStyles,
|
|
9871
11050
|
onReady: () => {
|
|
@@ -9875,18 +11054,18 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9875
11054
|
setStatus("MOUNTED");
|
|
9876
11055
|
},
|
|
9877
11056
|
frameRef: ref,
|
|
9878
|
-
children: /* @__PURE__ */
|
|
11057
|
+
children: /* @__PURE__ */ jsx54(autoFrameContext.Consumer, { children: ({ document: document2 }) => {
|
|
9879
11058
|
if (Frame) {
|
|
9880
|
-
return /* @__PURE__ */
|
|
11059
|
+
return /* @__PURE__ */ jsx54(Frame, { document: document2, children: inner });
|
|
9881
11060
|
}
|
|
9882
11061
|
return inner;
|
|
9883
11062
|
} })
|
|
9884
11063
|
}
|
|
9885
|
-
) : /* @__PURE__ */
|
|
11064
|
+
) : /* @__PURE__ */ jsx54(
|
|
9886
11065
|
"div",
|
|
9887
11066
|
{
|
|
9888
11067
|
id: "preview-frame",
|
|
9889
|
-
className:
|
|
11068
|
+
className: getClassName34("frame"),
|
|
9890
11069
|
ref,
|
|
9891
11070
|
"data-puck-entry": true,
|
|
9892
11071
|
children: inner
|
|
@@ -9898,7 +11077,7 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
|
9898
11077
|
|
|
9899
11078
|
// lib/use-loaded-overrides.ts
|
|
9900
11079
|
init_react_import();
|
|
9901
|
-
import { useMemo as
|
|
11080
|
+
import { useMemo as useMemo22 } from "react";
|
|
9902
11081
|
|
|
9903
11082
|
// lib/load-overrides.ts
|
|
9904
11083
|
init_react_import();
|
|
@@ -9940,7 +11119,7 @@ var useLoadedOverrides = ({
|
|
|
9940
11119
|
overrides,
|
|
9941
11120
|
plugins
|
|
9942
11121
|
}) => {
|
|
9943
|
-
return
|
|
11122
|
+
return useMemo22(() => {
|
|
9944
11123
|
return loadOverrides({ overrides, plugins });
|
|
9945
11124
|
}, [plugins, overrides]);
|
|
9946
11125
|
};
|
|
@@ -9953,25 +11132,25 @@ init_react_import();
|
|
|
9953
11132
|
import {
|
|
9954
11133
|
useEffect as useEffect28,
|
|
9955
11134
|
useLayoutEffect as useLayoutEffect2,
|
|
9956
|
-
useMemo as
|
|
9957
|
-
useState as
|
|
11135
|
+
useMemo as useMemo27,
|
|
11136
|
+
useState as useState24
|
|
9958
11137
|
} from "react";
|
|
9959
11138
|
|
|
9960
11139
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Layout/styles.module.css#css-module
|
|
9961
11140
|
init_react_import();
|
|
9962
|
-
var
|
|
11141
|
+
var styles_module_default29 = { "Puck": "_Puck_tzaxg_19", "Puck-portal": "_Puck-portal_tzaxg_31", "PuckLayout": "_PuckLayout_tzaxg_36", "PuckLayout-inner": "_PuckLayout-inner_tzaxg_40", "Puck--hidePlugins": "_Puck--hidePlugins_tzaxg_73", "PuckLayout--mounted": "_PuckLayout--mounted_tzaxg_78", "PuckLayout--mobilePanelHeightToggle": "_PuckLayout--mobilePanelHeightToggle_tzaxg_82", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_tzaxg_82", "PuckLayout--isExpanded": "_PuckLayout--isExpanded_tzaxg_90", "PuckLayout--mobilePanelHeightMinContent": "_PuckLayout--mobilePanelHeightMinContent_tzaxg_110", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_tzaxg_137", "PuckLayout-mounted": "_PuckLayout-mounted_tzaxg_156", "PuckLayout-nav": "_PuckLayout-nav_tzaxg_197", "PuckLayout-header": "_PuckLayout-header_tzaxg_217", "PuckPluginTab": "_PuckPluginTab_tzaxg_231", "PuckPluginTab--visible": "_PuckPluginTab--visible_tzaxg_237", "PuckPluginTab-body": "_PuckPluginTab-body_tzaxg_243" };
|
|
9963
11142
|
|
|
9964
11143
|
// components/DefaultOverride/index.tsx
|
|
9965
11144
|
init_react_import();
|
|
9966
|
-
import { Fragment as Fragment14, jsx as
|
|
9967
|
-
var DefaultOverride = ({ children }) => /* @__PURE__ */
|
|
11145
|
+
import { Fragment as Fragment14, jsx as jsx55 } from "react/jsx-runtime";
|
|
11146
|
+
var DefaultOverride = ({ children }) => /* @__PURE__ */ jsx55(Fragment14, { children });
|
|
9968
11147
|
|
|
9969
11148
|
// lib/use-preview-mode-hotkeys.ts
|
|
9970
11149
|
init_react_import();
|
|
9971
|
-
import { useCallback as
|
|
11150
|
+
import { useCallback as useCallback19 } from "react";
|
|
9972
11151
|
var usePreviewModeHotkeys = () => {
|
|
9973
11152
|
const appStore = useAppStoreApi();
|
|
9974
|
-
const toggleInteractive =
|
|
11153
|
+
const toggleInteractive = useCallback19(() => {
|
|
9975
11154
|
const dispatch = appStore.getState().dispatch;
|
|
9976
11155
|
dispatch({
|
|
9977
11156
|
type: "setUi",
|
|
@@ -9986,18 +11165,18 @@ var usePreviewModeHotkeys = () => {
|
|
|
9986
11165
|
|
|
9987
11166
|
// components/Puck/components/Header/index.tsx
|
|
9988
11167
|
init_react_import();
|
|
9989
|
-
import { memo as memo10, useCallback as
|
|
11168
|
+
import { memo as memo10, useCallback as useCallback20, useMemo as useMemo23, useState as useState20 } from "react";
|
|
9990
11169
|
|
|
9991
11170
|
// components/MenuBar/index.tsx
|
|
9992
11171
|
init_react_import();
|
|
9993
11172
|
|
|
9994
11173
|
// css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css#css-module
|
|
9995
11174
|
init_react_import();
|
|
9996
|
-
var
|
|
11175
|
+
var styles_module_default30 = { "MenuBar": "_MenuBar_1hxnj_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_1hxnj_14", "MenuBar-inner": "_MenuBar-inner_1hxnj_29", "MenuBar-history": "_MenuBar-history_1hxnj_45" };
|
|
9997
11176
|
|
|
9998
11177
|
// components/MenuBar/index.tsx
|
|
9999
|
-
import { Fragment as Fragment15, jsx as
|
|
10000
|
-
var
|
|
11178
|
+
import { Fragment as Fragment15, jsx as jsx56, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
11179
|
+
var getClassName35 = get_class_name_factory_default("MenuBar", styles_module_default30);
|
|
10001
11180
|
function MenuBar({
|
|
10002
11181
|
menuOpen = false,
|
|
10003
11182
|
renderHeaderActions,
|
|
@@ -10007,10 +11186,12 @@ function MenuBar({
|
|
|
10007
11186
|
const forward = useAppStore((s) => s.history.forward);
|
|
10008
11187
|
const hasFuture = useAppStore((s) => s.history.hasFuture());
|
|
10009
11188
|
const hasPast = useAppStore((s) => s.history.hasPast());
|
|
10010
|
-
|
|
11189
|
+
const undoLabel = useMessage("header-undo");
|
|
11190
|
+
const redoLabel = useMessage("header-redo");
|
|
11191
|
+
return /* @__PURE__ */ jsx56(
|
|
10011
11192
|
"div",
|
|
10012
11193
|
{
|
|
10013
|
-
className:
|
|
11194
|
+
className: getClassName35({ menuOpen }),
|
|
10014
11195
|
onClick: (event) => {
|
|
10015
11196
|
var _a;
|
|
10016
11197
|
const element = event.target;
|
|
@@ -10021,30 +11202,30 @@ function MenuBar({
|
|
|
10021
11202
|
setMenuOpen(false);
|
|
10022
11203
|
}
|
|
10023
11204
|
},
|
|
10024
|
-
children: /* @__PURE__ */
|
|
10025
|
-
/* @__PURE__ */
|
|
10026
|
-
/* @__PURE__ */
|
|
11205
|
+
children: /* @__PURE__ */ jsxs22("div", { className: getClassName35("inner"), children: [
|
|
11206
|
+
/* @__PURE__ */ jsxs22("div", { className: getClassName35("history"), children: [
|
|
11207
|
+
/* @__PURE__ */ jsx56(
|
|
10027
11208
|
IconButton,
|
|
10028
11209
|
{
|
|
10029
11210
|
type: "button",
|
|
10030
|
-
title:
|
|
11211
|
+
title: undoLabel,
|
|
10031
11212
|
disabled: !hasPast,
|
|
10032
11213
|
onClick: back,
|
|
10033
|
-
children: /* @__PURE__ */
|
|
11214
|
+
children: /* @__PURE__ */ jsx56(Undo2, { size: 21 })
|
|
10034
11215
|
}
|
|
10035
11216
|
),
|
|
10036
|
-
/* @__PURE__ */
|
|
11217
|
+
/* @__PURE__ */ jsx56(
|
|
10037
11218
|
IconButton,
|
|
10038
11219
|
{
|
|
10039
11220
|
type: "button",
|
|
10040
|
-
title:
|
|
11221
|
+
title: redoLabel,
|
|
10041
11222
|
disabled: !hasFuture,
|
|
10042
11223
|
onClick: forward,
|
|
10043
|
-
children: /* @__PURE__ */
|
|
11224
|
+
children: /* @__PURE__ */ jsx56(Redo2, { size: 21 })
|
|
10044
11225
|
}
|
|
10045
11226
|
)
|
|
10046
11227
|
] }),
|
|
10047
|
-
/* @__PURE__ */
|
|
11228
|
+
/* @__PURE__ */ jsx56(Fragment15, { children: renderHeaderActions && renderHeaderActions() })
|
|
10048
11229
|
] })
|
|
10049
11230
|
}
|
|
10050
11231
|
);
|
|
@@ -10052,11 +11233,11 @@ function MenuBar({
|
|
|
10052
11233
|
|
|
10053
11234
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Header/styles.module.css#css-module
|
|
10054
11235
|
init_react_import();
|
|
10055
|
-
var
|
|
11236
|
+
var styles_module_default31 = { "PuckHeader": "_PuckHeader_c2nei_1", "PuckHeader--hidePlugins": "_PuckHeader--hidePlugins_c2nei_21", "PuckHeader-inner": "_PuckHeader-inner_c2nei_26", "PuckHeader-toggle": "_PuckHeader-toggle_c2nei_46", "PuckHeader-rightSideBarToggle": "_PuckHeader-rightSideBarToggle_c2nei_52", "PuckHeader-leftSideBarToggle": "_PuckHeader-leftSideBarToggle_c2nei_53", "PuckHeader-title": "_PuckHeader-title_c2nei_64", "PuckHeader-path": "_PuckHeader-path_c2nei_68", "PuckHeader-tools": "_PuckHeader-tools_c2nei_75", "PuckHeader-menuButton": "_PuckHeader-menuButton_c2nei_81", "PuckHeader--menuOpen": "_PuckHeader--menuOpen_c2nei_86" };
|
|
10056
11237
|
|
|
10057
11238
|
// components/Puck/components/Header/index.tsx
|
|
10058
|
-
import { Fragment as Fragment16, jsx as
|
|
10059
|
-
var
|
|
11239
|
+
import { Fragment as Fragment16, jsx as jsx57, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
11240
|
+
var getClassName36 = get_class_name_factory_default("PuckHeader", styles_module_default31);
|
|
10060
11241
|
var HeaderInner = ({
|
|
10061
11242
|
hidePlugins
|
|
10062
11243
|
}) => {
|
|
@@ -10070,7 +11251,7 @@ var HeaderInner = ({
|
|
|
10070
11251
|
} = usePropsContext();
|
|
10071
11252
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
10072
11253
|
const appStore = useAppStoreApi();
|
|
10073
|
-
const defaultHeaderRender =
|
|
11254
|
+
const defaultHeaderRender = useMemo23(() => {
|
|
10074
11255
|
if (renderHeader) {
|
|
10075
11256
|
console.warn(
|
|
10076
11257
|
"`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
|
|
@@ -10079,13 +11260,13 @@ var HeaderInner = ({
|
|
|
10079
11260
|
var _b = _a, { actions } = _b, props = __objRest(_b, ["actions"]);
|
|
10080
11261
|
const Comp = renderHeader;
|
|
10081
11262
|
const appState = useAppStore((s) => s.state);
|
|
10082
|
-
return /* @__PURE__ */
|
|
11263
|
+
return /* @__PURE__ */ jsx57(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
|
|
10083
11264
|
};
|
|
10084
11265
|
return RenderHeader;
|
|
10085
11266
|
}
|
|
10086
11267
|
return DefaultOverride;
|
|
10087
11268
|
}, [renderHeader]);
|
|
10088
|
-
const defaultHeaderActionsRender =
|
|
11269
|
+
const defaultHeaderActionsRender = useMemo23(() => {
|
|
10089
11270
|
if (renderHeaderActions) {
|
|
10090
11271
|
console.warn(
|
|
10091
11272
|
"`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
|
|
@@ -10093,7 +11274,7 @@ var HeaderInner = ({
|
|
|
10093
11274
|
const RenderHeader = (props) => {
|
|
10094
11275
|
const Comp = renderHeaderActions;
|
|
10095
11276
|
const appState = useAppStore((s) => s.state);
|
|
10096
|
-
return /* @__PURE__ */
|
|
11277
|
+
return /* @__PURE__ */ jsx57(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
|
|
10097
11278
|
};
|
|
10098
11279
|
return RenderHeader;
|
|
10099
11280
|
}
|
|
@@ -10105,7 +11286,7 @@ var HeaderInner = ({
|
|
|
10105
11286
|
const CustomHeaderActions = useAppStore(
|
|
10106
11287
|
(s) => s.overrides.headerActions || defaultHeaderActionsRender
|
|
10107
11288
|
);
|
|
10108
|
-
const [menuOpen, setMenuOpen] =
|
|
11289
|
+
const [menuOpen, setMenuOpen] = useState20(false);
|
|
10109
11290
|
const rootTitle = useAppStore((s) => {
|
|
10110
11291
|
var _a, _b;
|
|
10111
11292
|
const rootData = (_a = s.state.indexes.nodes["root"]) == null ? void 0 : _a.data;
|
|
@@ -10115,7 +11296,7 @@ var HeaderInner = ({
|
|
|
10115
11296
|
const rightSideBarVisible = useAppStore(
|
|
10116
11297
|
(s) => s.state.ui.rightSideBarVisible
|
|
10117
11298
|
);
|
|
10118
|
-
const toggleSidebars =
|
|
11299
|
+
const toggleSidebars = useCallback20(
|
|
10119
11300
|
(sidebar) => {
|
|
10120
11301
|
const widerViewport = window.matchMedia("(min-width: 638px)").matches;
|
|
10121
11302
|
const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
|
|
@@ -10129,87 +11310,92 @@ var HeaderInner = ({
|
|
|
10129
11310
|
},
|
|
10130
11311
|
[dispatch, leftSideBarVisible, rightSideBarVisible]
|
|
10131
11312
|
);
|
|
10132
|
-
|
|
11313
|
+
const publishLabel = useMessage("header-publish");
|
|
11314
|
+
const pageLabel = useMessage("label-page");
|
|
11315
|
+
const toggleLeftLabel = useMessage("header-toggle-leftsidebar");
|
|
11316
|
+
const toggleRightLabel = useMessage("header-toggle-rightsidebar");
|
|
11317
|
+
const toggleMenuLabel = useMessage("header-toggle-menubar");
|
|
11318
|
+
return /* @__PURE__ */ jsx57(
|
|
10133
11319
|
CustomHeader,
|
|
10134
11320
|
{
|
|
10135
|
-
actions: /* @__PURE__ */
|
|
11321
|
+
actions: /* @__PURE__ */ jsx57(Fragment16, { children: /* @__PURE__ */ jsx57(CustomHeaderActions, { children: /* @__PURE__ */ jsx57(
|
|
10136
11322
|
Button,
|
|
10137
11323
|
{
|
|
10138
11324
|
onClick: () => {
|
|
10139
11325
|
const data = appStore.getState().state.data;
|
|
10140
11326
|
onPublish && onPublish(data);
|
|
10141
11327
|
},
|
|
10142
|
-
icon: /* @__PURE__ */
|
|
10143
|
-
children:
|
|
11328
|
+
icon: /* @__PURE__ */ jsx57(Globe, { size: "14px" }),
|
|
11329
|
+
children: publishLabel
|
|
10144
11330
|
}
|
|
10145
11331
|
) }) }),
|
|
10146
|
-
children: /* @__PURE__ */
|
|
11332
|
+
children: /* @__PURE__ */ jsx57(
|
|
10147
11333
|
"header",
|
|
10148
11334
|
{
|
|
10149
|
-
className:
|
|
11335
|
+
className: getClassName36({
|
|
10150
11336
|
leftSideBarVisible,
|
|
10151
11337
|
rightSideBarVisible,
|
|
10152
11338
|
hidePlugins
|
|
10153
11339
|
}),
|
|
10154
|
-
children: /* @__PURE__ */
|
|
10155
|
-
/* @__PURE__ */
|
|
10156
|
-
/* @__PURE__ */
|
|
11340
|
+
children: /* @__PURE__ */ jsxs23("div", { className: getClassName36("inner"), children: [
|
|
11341
|
+
/* @__PURE__ */ jsxs23("div", { className: getClassName36("toggle"), children: [
|
|
11342
|
+
/* @__PURE__ */ jsx57("div", { className: getClassName36("leftSideBarToggle"), children: /* @__PURE__ */ jsx57(
|
|
10157
11343
|
IconButton,
|
|
10158
11344
|
{
|
|
10159
11345
|
type: "button",
|
|
10160
11346
|
onClick: () => {
|
|
10161
11347
|
toggleSidebars("left");
|
|
10162
11348
|
},
|
|
10163
|
-
title:
|
|
10164
|
-
children: /* @__PURE__ */
|
|
11349
|
+
title: toggleLeftLabel,
|
|
11350
|
+
children: /* @__PURE__ */ jsx57(PanelLeft, { focusable: "false" })
|
|
10165
11351
|
}
|
|
10166
11352
|
) }),
|
|
10167
|
-
/* @__PURE__ */
|
|
11353
|
+
/* @__PURE__ */ jsx57("div", { className: getClassName36("rightSideBarToggle"), children: /* @__PURE__ */ jsx57(
|
|
10168
11354
|
IconButton,
|
|
10169
11355
|
{
|
|
10170
11356
|
type: "button",
|
|
10171
11357
|
onClick: () => {
|
|
10172
11358
|
toggleSidebars("right");
|
|
10173
11359
|
},
|
|
10174
|
-
title:
|
|
10175
|
-
children: /* @__PURE__ */
|
|
11360
|
+
title: toggleRightLabel,
|
|
11361
|
+
children: /* @__PURE__ */ jsx57(PanelRight, { focusable: "false" })
|
|
10176
11362
|
}
|
|
10177
11363
|
) })
|
|
10178
11364
|
] }),
|
|
10179
|
-
/* @__PURE__ */
|
|
10180
|
-
headerTitle || rootTitle ||
|
|
10181
|
-
headerPath && /* @__PURE__ */
|
|
11365
|
+
/* @__PURE__ */ jsx57("div", { className: getClassName36("title"), children: /* @__PURE__ */ jsxs23(Heading, { rank: "2", size: "xs", children: [
|
|
11366
|
+
headerTitle || rootTitle || pageLabel,
|
|
11367
|
+
headerPath && /* @__PURE__ */ jsxs23(Fragment16, { children: [
|
|
10182
11368
|
" ",
|
|
10183
|
-
/* @__PURE__ */
|
|
11369
|
+
/* @__PURE__ */ jsx57("code", { className: getClassName36("path"), children: headerPath })
|
|
10184
11370
|
] })
|
|
10185
11371
|
] }) }),
|
|
10186
|
-
/* @__PURE__ */
|
|
10187
|
-
/* @__PURE__ */
|
|
11372
|
+
/* @__PURE__ */ jsxs23("div", { className: getClassName36("tools"), children: [
|
|
11373
|
+
/* @__PURE__ */ jsx57("div", { className: getClassName36("menuButton"), children: /* @__PURE__ */ jsx57(
|
|
10188
11374
|
IconButton,
|
|
10189
11375
|
{
|
|
10190
11376
|
type: "button",
|
|
10191
11377
|
onClick: () => {
|
|
10192
11378
|
return setMenuOpen(!menuOpen);
|
|
10193
11379
|
},
|
|
10194
|
-
title:
|
|
10195
|
-
children: menuOpen ? /* @__PURE__ */
|
|
11380
|
+
title: toggleMenuLabel,
|
|
11381
|
+
children: menuOpen ? /* @__PURE__ */ jsx57(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ jsx57(ChevronDown, { focusable: "false" })
|
|
10196
11382
|
}
|
|
10197
11383
|
) }),
|
|
10198
|
-
/* @__PURE__ */
|
|
11384
|
+
/* @__PURE__ */ jsx57(
|
|
10199
11385
|
MenuBar,
|
|
10200
11386
|
{
|
|
10201
11387
|
dispatch,
|
|
10202
11388
|
onPublish,
|
|
10203
11389
|
menuOpen,
|
|
10204
|
-
renderHeaderActions: () => /* @__PURE__ */
|
|
11390
|
+
renderHeaderActions: () => /* @__PURE__ */ jsx57(CustomHeaderActions, { children: /* @__PURE__ */ jsx57(
|
|
10205
11391
|
Button,
|
|
10206
11392
|
{
|
|
10207
11393
|
onClick: () => {
|
|
10208
11394
|
const data = appStore.getState().state.data;
|
|
10209
11395
|
onPublish && onPublish(data);
|
|
10210
11396
|
},
|
|
10211
|
-
icon: /* @__PURE__ */
|
|
10212
|
-
children:
|
|
11397
|
+
icon: /* @__PURE__ */ jsx57(Globe, { size: "14px" }),
|
|
11398
|
+
children: publishLabel
|
|
10213
11399
|
}
|
|
10214
11400
|
) }),
|
|
10215
11401
|
setMenuOpen
|
|
@@ -10229,11 +11415,11 @@ init_react_import();
|
|
|
10229
11415
|
|
|
10230
11416
|
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
|
10231
11417
|
init_react_import();
|
|
10232
|
-
var
|
|
11418
|
+
var styles_module_default32 = { "SidebarSection": "_SidebarSection_1uv88_1", "SidebarSection-title": "_SidebarSection-title_1uv88_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_1uv88_20", "SidebarSection-content": "_SidebarSection-content_1uv88_24", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_1uv88_33", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_1uv88_62", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_1uv88_33", "SidebarSection-heading": "_SidebarSection-heading_1uv88_74", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_1uv88_78" };
|
|
10233
11419
|
|
|
10234
11420
|
// components/SidebarSection/index.tsx
|
|
10235
|
-
import { jsx as
|
|
10236
|
-
var
|
|
11421
|
+
import { jsx as jsx58, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
11422
|
+
var getClassName37 = get_class_name_factory_default("SidebarSection", styles_module_default32);
|
|
10237
11423
|
var SidebarSection = ({
|
|
10238
11424
|
children,
|
|
10239
11425
|
title,
|
|
@@ -10242,44 +11428,44 @@ var SidebarSection = ({
|
|
|
10242
11428
|
noBorderTop,
|
|
10243
11429
|
isLoading
|
|
10244
11430
|
}) => {
|
|
10245
|
-
return /* @__PURE__ */
|
|
10246
|
-
/* @__PURE__ */
|
|
10247
|
-
showBreadcrumbs && /* @__PURE__ */
|
|
10248
|
-
/* @__PURE__ */
|
|
11431
|
+
return /* @__PURE__ */ jsxs24("div", { className: getClassName37({ noBorderTop }), style: { background }, children: [
|
|
11432
|
+
/* @__PURE__ */ jsx58("div", { className: getClassName37("title"), children: /* @__PURE__ */ jsxs24("div", { className: getClassName37("breadcrumbs"), children: [
|
|
11433
|
+
showBreadcrumbs && /* @__PURE__ */ jsx58(Breadcrumbs, {}),
|
|
11434
|
+
/* @__PURE__ */ jsx58("div", { className: getClassName37("heading"), children: /* @__PURE__ */ jsx58(Heading, { rank: "2", size: "xs", children: title }) })
|
|
10249
11435
|
] }) }),
|
|
10250
|
-
/* @__PURE__ */
|
|
10251
|
-
isLoading && /* @__PURE__ */
|
|
11436
|
+
/* @__PURE__ */ jsx58("div", { className: getClassName37("content"), children }),
|
|
11437
|
+
isLoading && /* @__PURE__ */ jsx58("div", { className: getClassName37("loadingOverlay"), children: /* @__PURE__ */ jsx58(Loader, { size: 32 }) })
|
|
10252
11438
|
] });
|
|
10253
11439
|
};
|
|
10254
11440
|
|
|
10255
11441
|
// components/Puck/components/Canvas/index.tsx
|
|
10256
11442
|
init_react_import();
|
|
10257
11443
|
import {
|
|
10258
|
-
useCallback as
|
|
11444
|
+
useCallback as useCallback21,
|
|
10259
11445
|
useEffect as useEffect25,
|
|
10260
|
-
useMemo as
|
|
11446
|
+
useMemo as useMemo26,
|
|
10261
11447
|
useRef as useRef13,
|
|
10262
|
-
useState as
|
|
11448
|
+
useState as useState22
|
|
10263
11449
|
} from "react";
|
|
10264
11450
|
|
|
10265
11451
|
// components/ViewportControls/index.tsx
|
|
10266
11452
|
init_react_import();
|
|
10267
|
-
import { useEffect as useEffect24, useMemo as
|
|
11453
|
+
import { useEffect as useEffect24, useMemo as useMemo24, useState as useState21 } from "react";
|
|
10268
11454
|
|
|
10269
11455
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
|
|
10270
11456
|
init_react_import();
|
|
10271
|
-
var
|
|
11457
|
+
var styles_module_default33 = { "ViewportControls": "_ViewportControls_v26yb_1", "ViewportControls--fullScreen": "_ViewportControls--fullScreen_v26yb_5", "ViewportControls-toggleButton": "_ViewportControls-toggleButton_v26yb_14", "ViewportControls-actions": "_ViewportControls-actions_v26yb_39", "ViewportControls-actionsInner": "_ViewportControls-actionsInner_v26yb_43", "ViewportControls--isExpanded": "_ViewportControls--isExpanded_v26yb_67", "ViewportControls-divider": "_ViewportControls-divider_v26yb_72", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_v26yb_79", "ViewportControls-zoom": "_ViewportControls-zoom_v26yb_79", "ViewportButton-inner": "_ViewportButton-inner_v26yb_110", "ViewportButton--isActive": "_ViewportButton--isActive_v26yb_118" };
|
|
10272
11458
|
|
|
10273
11459
|
// components/ViewportControls/index.tsx
|
|
10274
|
-
import { jsx as
|
|
11460
|
+
import { jsx as jsx59, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10275
11461
|
var icons = {
|
|
10276
|
-
Smartphone: /* @__PURE__ */
|
|
10277
|
-
Tablet: /* @__PURE__ */
|
|
10278
|
-
Monitor: /* @__PURE__ */
|
|
10279
|
-
FullWidth: /* @__PURE__ */
|
|
11462
|
+
Smartphone: /* @__PURE__ */ jsx59(Smartphone, { size: 16 }),
|
|
11463
|
+
Tablet: /* @__PURE__ */ jsx59(Tablet, { size: 16 }),
|
|
11464
|
+
Monitor: /* @__PURE__ */ jsx59(Monitor, { size: 16 }),
|
|
11465
|
+
FullWidth: /* @__PURE__ */ jsx59(Expand, { size: 16 })
|
|
10280
11466
|
};
|
|
10281
|
-
var
|
|
10282
|
-
var getClassNameButton = get_class_name_factory_default("ViewportButton",
|
|
11467
|
+
var getClassName38 = get_class_name_factory_default("ViewportControls", styles_module_default33);
|
|
11468
|
+
var getClassNameButton = get_class_name_factory_default("ViewportButton", styles_module_default33);
|
|
10283
11469
|
var ActionButton = ({
|
|
10284
11470
|
children,
|
|
10285
11471
|
title,
|
|
@@ -10287,7 +11473,7 @@ var ActionButton = ({
|
|
|
10287
11473
|
isActive,
|
|
10288
11474
|
disabled
|
|
10289
11475
|
}) => {
|
|
10290
|
-
return /* @__PURE__ */
|
|
11476
|
+
return /* @__PURE__ */ jsx59("span", { className: getClassNameButton({ isActive }), suppressHydrationWarning: true, children: /* @__PURE__ */ jsx59(
|
|
10291
11477
|
IconButton,
|
|
10292
11478
|
{
|
|
10293
11479
|
type: "button",
|
|
@@ -10295,7 +11481,7 @@ var ActionButton = ({
|
|
|
10295
11481
|
disabled: disabled || isActive,
|
|
10296
11482
|
onClick,
|
|
10297
11483
|
suppressHydrationWarning: true,
|
|
10298
|
-
children: /* @__PURE__ */
|
|
11484
|
+
children: /* @__PURE__ */ jsx59("span", { className: getClassNameButton("inner"), children })
|
|
10299
11485
|
}
|
|
10300
11486
|
) });
|
|
10301
11487
|
};
|
|
@@ -10308,6 +11494,26 @@ var defaultZoomOptions = [
|
|
|
10308
11494
|
{ label: "150%", value: 1.5 },
|
|
10309
11495
|
{ label: "200%", value: 2 }
|
|
10310
11496
|
];
|
|
11497
|
+
var ViewportButton = ({
|
|
11498
|
+
viewport,
|
|
11499
|
+
isActive,
|
|
11500
|
+
onClick
|
|
11501
|
+
}) => {
|
|
11502
|
+
var _a;
|
|
11503
|
+
const switchTitle = useMessage("viewport-switch", {
|
|
11504
|
+
label: (_a = viewport.label) != null ? _a : ""
|
|
11505
|
+
});
|
|
11506
|
+
const switchDefaultTitle = useMessage("viewport-switch-default");
|
|
11507
|
+
return /* @__PURE__ */ jsx59(
|
|
11508
|
+
ActionButton,
|
|
11509
|
+
{
|
|
11510
|
+
title: viewport.label ? switchTitle : switchDefaultTitle,
|
|
11511
|
+
onClick,
|
|
11512
|
+
isActive,
|
|
11513
|
+
children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
|
|
11514
|
+
}
|
|
11515
|
+
);
|
|
11516
|
+
};
|
|
10311
11517
|
var ViewportControls = ({
|
|
10312
11518
|
autoZoom,
|
|
10313
11519
|
zoom,
|
|
@@ -10321,50 +11527,55 @@ var ViewportControls = ({
|
|
|
10321
11527
|
const defaultsContainAutoZoom = defaultZoomOptions.find(
|
|
10322
11528
|
(option) => option.value === autoZoom
|
|
10323
11529
|
);
|
|
10324
|
-
const
|
|
11530
|
+
const autoZoomLabel = useMessage("viewport-zoom-auto", {
|
|
11531
|
+
zoom: (autoZoom * 100).toFixed(0)
|
|
11532
|
+
});
|
|
11533
|
+
const zoomOptions = useMemo24(
|
|
10325
11534
|
() => [
|
|
10326
11535
|
...defaultZoomOptions,
|
|
10327
11536
|
...defaultsContainAutoZoom ? [] : [
|
|
10328
11537
|
{
|
|
10329
11538
|
value: autoZoom,
|
|
10330
|
-
label:
|
|
11539
|
+
label: autoZoomLabel
|
|
10331
11540
|
}
|
|
10332
11541
|
]
|
|
10333
11542
|
].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
|
|
10334
|
-
[autoZoom]
|
|
11543
|
+
[autoZoom, autoZoomLabel]
|
|
10335
11544
|
);
|
|
10336
|
-
const [activeViewport, setActiveViewport] =
|
|
11545
|
+
const [activeViewport, setActiveViewport] = useState21(
|
|
10337
11546
|
uiViewports.current.width
|
|
10338
11547
|
);
|
|
10339
11548
|
useEffect24(() => {
|
|
10340
11549
|
setActiveViewport(uiViewports.current.width);
|
|
10341
11550
|
}, [uiViewports.current]);
|
|
10342
|
-
const [isExpanded, setIsExpanded] =
|
|
10343
|
-
|
|
11551
|
+
const [isExpanded, setIsExpanded] = useState21(false);
|
|
11552
|
+
const zoomOutLabel = useMessage("viewport-zoom-out");
|
|
11553
|
+
const zoomInLabel = useMessage("viewport-zoom-in");
|
|
11554
|
+
const toggleMenuLabel = useMessage("viewport-toggle-menu");
|
|
11555
|
+
return /* @__PURE__ */ jsxs25(
|
|
10344
11556
|
"div",
|
|
10345
11557
|
{
|
|
10346
|
-
className:
|
|
11558
|
+
className: getClassName38({ isExpanded, fullScreen }),
|
|
10347
11559
|
suppressHydrationWarning: true,
|
|
10348
11560
|
children: [
|
|
10349
|
-
/* @__PURE__ */
|
|
10350
|
-
viewports.map((viewport, i) => /* @__PURE__ */
|
|
10351
|
-
|
|
11561
|
+
/* @__PURE__ */ jsx59("div", { className: getClassName38("actions"), children: /* @__PURE__ */ jsxs25("div", { className: getClassName38("actionsInner"), children: [
|
|
11562
|
+
viewports.map((viewport, i) => /* @__PURE__ */ jsx59(
|
|
11563
|
+
ViewportButton,
|
|
10352
11564
|
{
|
|
10353
|
-
|
|
11565
|
+
viewport,
|
|
10354
11566
|
onClick: () => {
|
|
10355
11567
|
setActiveViewport(viewport.width);
|
|
10356
11568
|
onViewportChange(viewport);
|
|
10357
11569
|
},
|
|
10358
|
-
isActive: activeViewport === viewport.width
|
|
10359
|
-
children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
|
|
11570
|
+
isActive: activeViewport === viewport.width
|
|
10360
11571
|
},
|
|
10361
11572
|
i
|
|
10362
11573
|
)),
|
|
10363
|
-
/* @__PURE__ */
|
|
10364
|
-
/* @__PURE__ */
|
|
11574
|
+
/* @__PURE__ */ jsx59("div", { className: getClassName38("divider") }),
|
|
11575
|
+
/* @__PURE__ */ jsx59(
|
|
10365
11576
|
ActionButton,
|
|
10366
11577
|
{
|
|
10367
|
-
title:
|
|
11578
|
+
title: zoomOutLabel,
|
|
10368
11579
|
disabled: zoom <= ((_a = zoomOptions[0]) == null ? void 0 : _a.value),
|
|
10369
11580
|
onClick: (e) => {
|
|
10370
11581
|
e.stopPropagation();
|
|
@@ -10375,13 +11586,13 @@ var ViewportControls = ({
|
|
|
10375
11586
|
)].value
|
|
10376
11587
|
);
|
|
10377
11588
|
},
|
|
10378
|
-
children: /* @__PURE__ */
|
|
11589
|
+
children: /* @__PURE__ */ jsx59(ZoomOut, { size: 16 })
|
|
10379
11590
|
}
|
|
10380
11591
|
),
|
|
10381
|
-
/* @__PURE__ */
|
|
11592
|
+
/* @__PURE__ */ jsx59(
|
|
10382
11593
|
ActionButton,
|
|
10383
11594
|
{
|
|
10384
|
-
title:
|
|
11595
|
+
title: zoomInLabel,
|
|
10385
11596
|
disabled: zoom >= ((_b = zoomOptions[zoomOptions.length - 1]) == null ? void 0 : _b.value),
|
|
10386
11597
|
onClick: (e) => {
|
|
10387
11598
|
e.stopPropagation();
|
|
@@ -10392,15 +11603,15 @@ var ViewportControls = ({
|
|
|
10392
11603
|
)].value
|
|
10393
11604
|
);
|
|
10394
11605
|
},
|
|
10395
|
-
children: /* @__PURE__ */
|
|
11606
|
+
children: /* @__PURE__ */ jsx59(ZoomIn, { size: 16 })
|
|
10396
11607
|
}
|
|
10397
11608
|
),
|
|
10398
|
-
/* @__PURE__ */
|
|
10399
|
-
/* @__PURE__ */
|
|
10400
|
-
/* @__PURE__ */
|
|
11609
|
+
/* @__PURE__ */ jsxs25("div", { className: getClassName38("zoom"), children: [
|
|
11610
|
+
/* @__PURE__ */ jsx59("div", { className: getClassName38("divider") }),
|
|
11611
|
+
/* @__PURE__ */ jsx59(
|
|
10401
11612
|
"select",
|
|
10402
11613
|
{
|
|
10403
|
-
className:
|
|
11614
|
+
className: getClassName38("zoomSelect"),
|
|
10404
11615
|
value: zoom.toString(),
|
|
10405
11616
|
onClick: (e) => {
|
|
10406
11617
|
e.stopPropagation();
|
|
@@ -10408,7 +11619,7 @@ var ViewportControls = ({
|
|
|
10408
11619
|
onChange: (e) => {
|
|
10409
11620
|
onZoom(parseFloat(e.currentTarget.value));
|
|
10410
11621
|
},
|
|
10411
|
-
children: zoomOptions.map((option) => /* @__PURE__ */
|
|
11622
|
+
children: zoomOptions.map((option) => /* @__PURE__ */ jsx59(
|
|
10412
11623
|
"option",
|
|
10413
11624
|
{
|
|
10414
11625
|
value: option.value,
|
|
@@ -10420,13 +11631,13 @@ var ViewportControls = ({
|
|
|
10420
11631
|
)
|
|
10421
11632
|
] })
|
|
10422
11633
|
] }) }),
|
|
10423
|
-
/* @__PURE__ */
|
|
11634
|
+
/* @__PURE__ */ jsx59(
|
|
10424
11635
|
"button",
|
|
10425
11636
|
{
|
|
10426
|
-
className:
|
|
10427
|
-
title:
|
|
11637
|
+
className: getClassName38("toggleButton"),
|
|
11638
|
+
title: toggleMenuLabel,
|
|
10428
11639
|
onClick: () => setIsExpanded((s) => !s),
|
|
10429
|
-
children: isExpanded ? /* @__PURE__ */
|
|
11640
|
+
children: isExpanded ? /* @__PURE__ */ jsx59(X, { size: 16 }) : /* @__PURE__ */ jsx59(Monitor, { size: 16 })
|
|
10430
11641
|
}
|
|
10431
11642
|
)
|
|
10432
11643
|
]
|
|
@@ -10436,35 +11647,35 @@ var ViewportControls = ({
|
|
|
10436
11647
|
|
|
10437
11648
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
|
|
10438
11649
|
init_react_import();
|
|
10439
|
-
var
|
|
11650
|
+
var styles_module_default34 = { "PuckCanvas": "_PuckCanvas_zw9iy_1", "PuckCanvas-controls": "_PuckCanvas-controls_zw9iy_18", "PuckCanvas--fullScreen": "_PuckCanvas--fullScreen_zw9iy_23", "PuckCanvas-inner": "_PuckCanvas-inner_zw9iy_34", "PuckCanvas-root": "_PuckCanvas-root_zw9iy_43", "PuckCanvas--ready": "_PuckCanvas--ready_zw9iy_68", "PuckCanvas-loader": "_PuckCanvas-loader_zw9iy_73", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_zw9iy_84" };
|
|
10440
11651
|
|
|
10441
11652
|
// components/Puck/components/Canvas/index.tsx
|
|
10442
|
-
import { useShallow as
|
|
11653
|
+
import { useShallow as useShallow10 } from "zustand/react/shallow";
|
|
10443
11654
|
|
|
10444
11655
|
// lib/frame-context.tsx
|
|
10445
11656
|
init_react_import();
|
|
10446
11657
|
import {
|
|
10447
|
-
createContext as
|
|
10448
|
-
useContext as
|
|
11658
|
+
createContext as createContext8,
|
|
11659
|
+
useContext as useContext17,
|
|
10449
11660
|
useRef as useRef12,
|
|
10450
|
-
useMemo as
|
|
11661
|
+
useMemo as useMemo25
|
|
10451
11662
|
} from "react";
|
|
10452
|
-
import { jsx as
|
|
10453
|
-
var FrameContext =
|
|
11663
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
11664
|
+
var FrameContext = createContext8(null);
|
|
10454
11665
|
var FrameProvider = ({
|
|
10455
11666
|
children
|
|
10456
11667
|
}) => {
|
|
10457
11668
|
const frameRef = useRef12(null);
|
|
10458
|
-
const value =
|
|
11669
|
+
const value = useMemo25(
|
|
10459
11670
|
() => ({
|
|
10460
11671
|
frameRef
|
|
10461
11672
|
}),
|
|
10462
11673
|
[]
|
|
10463
11674
|
);
|
|
10464
|
-
return /* @__PURE__ */
|
|
11675
|
+
return /* @__PURE__ */ jsx60(FrameContext.Provider, { value, children });
|
|
10465
11676
|
};
|
|
10466
11677
|
var useCanvasFrame = () => {
|
|
10467
|
-
const context =
|
|
11678
|
+
const context = useContext17(FrameContext);
|
|
10468
11679
|
if (context === null) {
|
|
10469
11680
|
throw new Error("useCanvasFrame must be used within a FrameProvider");
|
|
10470
11681
|
}
|
|
@@ -10472,8 +11683,8 @@ var useCanvasFrame = () => {
|
|
|
10472
11683
|
};
|
|
10473
11684
|
|
|
10474
11685
|
// components/Puck/components/Canvas/index.tsx
|
|
10475
|
-
import { Fragment as Fragment17, jsx as
|
|
10476
|
-
var
|
|
11686
|
+
import { Fragment as Fragment17, jsx as jsx61, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11687
|
+
var getClassName39 = get_class_name_factory_default("PuckCanvas", styles_module_default34);
|
|
10477
11688
|
var ZOOM_ON_CHANGE = true;
|
|
10478
11689
|
var TRANSITION_DURATION = 150;
|
|
10479
11690
|
var Canvas = () => {
|
|
@@ -10491,7 +11702,7 @@ var Canvas = () => {
|
|
|
10491
11702
|
iframe,
|
|
10492
11703
|
_experimentalFullScreenCanvas
|
|
10493
11704
|
} = useAppStore(
|
|
10494
|
-
|
|
11705
|
+
useShallow10((s) => ({
|
|
10495
11706
|
dispatch: s.dispatch,
|
|
10496
11707
|
overrides: s.overrides,
|
|
10497
11708
|
setUi: s.setUi,
|
|
@@ -10509,7 +11720,7 @@ var Canvas = () => {
|
|
|
10509
11720
|
rightSideBarWidth,
|
|
10510
11721
|
viewports
|
|
10511
11722
|
} = useAppStore(
|
|
10512
|
-
|
|
11723
|
+
useShallow10((s) => ({
|
|
10513
11724
|
leftSideBarVisible: s.state.ui.leftSideBarVisible,
|
|
10514
11725
|
rightSideBarVisible: s.state.ui.rightSideBarVisible,
|
|
10515
11726
|
leftSideBarWidth: s.state.ui.leftSideBarWidth,
|
|
@@ -10517,17 +11728,17 @@ var Canvas = () => {
|
|
|
10517
11728
|
viewports: s.state.ui.viewports
|
|
10518
11729
|
}))
|
|
10519
11730
|
);
|
|
10520
|
-
const [showTransition, setShowTransition] =
|
|
11731
|
+
const [showTransition, setShowTransition] = useState22(false);
|
|
10521
11732
|
const isResizingRef = useRef13(false);
|
|
10522
|
-
const defaultRender =
|
|
10523
|
-
const PuckDefault = ({ children }) => /* @__PURE__ */
|
|
11733
|
+
const defaultRender = useMemo26(() => {
|
|
11734
|
+
const PuckDefault = ({ children }) => /* @__PURE__ */ jsx61(Fragment17, { children });
|
|
10524
11735
|
return PuckDefault;
|
|
10525
11736
|
}, []);
|
|
10526
|
-
const CustomPreview =
|
|
11737
|
+
const CustomPreview = useMemo26(
|
|
10527
11738
|
() => overrides.preview || defaultRender,
|
|
10528
11739
|
[overrides]
|
|
10529
11740
|
);
|
|
10530
|
-
const getFrameDimensions =
|
|
11741
|
+
const getFrameDimensions = useCallback21(() => {
|
|
10531
11742
|
if (frameRef.current) {
|
|
10532
11743
|
const frame = frameRef.current;
|
|
10533
11744
|
const box = getBox(frame);
|
|
@@ -10570,7 +11781,7 @@ var Canvas = () => {
|
|
|
10570
11781
|
resizeObserver.disconnect();
|
|
10571
11782
|
};
|
|
10572
11783
|
}, [frameRef.current]);
|
|
10573
|
-
const [showLoader, setShowLoader] =
|
|
11784
|
+
const [showLoader, setShowLoader] = useState22(false);
|
|
10574
11785
|
useEffect25(() => {
|
|
10575
11786
|
setTimeout(() => {
|
|
10576
11787
|
setShowLoader(true);
|
|
@@ -10628,10 +11839,10 @@ var Canvas = () => {
|
|
|
10628
11839
|
appStoreApi,
|
|
10629
11840
|
(_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
|
|
10630
11841
|
]);
|
|
10631
|
-
return /* @__PURE__ */
|
|
11842
|
+
return /* @__PURE__ */ jsxs26(
|
|
10632
11843
|
"div",
|
|
10633
11844
|
{
|
|
10634
|
-
className:
|
|
11845
|
+
className: getClassName39({
|
|
10635
11846
|
ready: status === "READY" || !iframe.enabled || !iframe.waitForStyles,
|
|
10636
11847
|
showLoader,
|
|
10637
11848
|
fullScreen: _experimentalFullScreenCanvas
|
|
@@ -10647,7 +11858,7 @@ var Canvas = () => {
|
|
|
10647
11858
|
}
|
|
10648
11859
|
},
|
|
10649
11860
|
children: [
|
|
10650
|
-
viewports.controlsVisible && iframe.enabled && /* @__PURE__ */
|
|
11861
|
+
viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ jsx61("div", { className: getClassName39("controls"), children: /* @__PURE__ */ jsx61(
|
|
10651
11862
|
ViewportControls,
|
|
10652
11863
|
{
|
|
10653
11864
|
fullScreen: _experimentalFullScreenCanvas,
|
|
@@ -10677,11 +11888,11 @@ var Canvas = () => {
|
|
|
10677
11888
|
}
|
|
10678
11889
|
}
|
|
10679
11890
|
) }),
|
|
10680
|
-
/* @__PURE__ */
|
|
10681
|
-
/* @__PURE__ */
|
|
11891
|
+
/* @__PURE__ */ jsxs26("div", { className: getClassName39("inner"), ref: frameRef, children: [
|
|
11892
|
+
/* @__PURE__ */ jsx61(
|
|
10682
11893
|
"div",
|
|
10683
11894
|
{
|
|
10684
|
-
className:
|
|
11895
|
+
className: getClassName39("root"),
|
|
10685
11896
|
style: {
|
|
10686
11897
|
width: iframe.enabled ? viewports.current.width : "100%",
|
|
10687
11898
|
height: zoomConfig.rootHeight,
|
|
@@ -10695,10 +11906,10 @@ var Canvas = () => {
|
|
|
10695
11906
|
setShowTransition(false);
|
|
10696
11907
|
isResizingRef.current = false;
|
|
10697
11908
|
},
|
|
10698
|
-
children: /* @__PURE__ */
|
|
11909
|
+
children: /* @__PURE__ */ jsx61(CustomPreview, { children: /* @__PURE__ */ jsx61(Preview2, {}) })
|
|
10699
11910
|
}
|
|
10700
11911
|
),
|
|
10701
|
-
/* @__PURE__ */
|
|
11912
|
+
/* @__PURE__ */ jsx61("div", { className: getClassName39("loader"), children: /* @__PURE__ */ jsx61(Loader, { size: 24 }) })
|
|
10702
11913
|
] })
|
|
10703
11914
|
]
|
|
10704
11915
|
}
|
|
@@ -10707,9 +11918,9 @@ var Canvas = () => {
|
|
|
10707
11918
|
|
|
10708
11919
|
// lib/use-sidebar-resize.ts
|
|
10709
11920
|
init_react_import();
|
|
10710
|
-
import { useCallback as
|
|
11921
|
+
import { useCallback as useCallback22, useEffect as useEffect26, useRef as useRef14, useState as useState23 } from "react";
|
|
10711
11922
|
function useSidebarResize(position, dispatch) {
|
|
10712
|
-
const [width, setWidth] =
|
|
11923
|
+
const [width, setWidth] = useState23(null);
|
|
10713
11924
|
const sidebarRef = useRef14(null);
|
|
10714
11925
|
const storeWidth = useAppStore(
|
|
10715
11926
|
(s) => position === "left" ? s.state.ui.leftSideBarWidth : s.state.ui.rightSideBarWidth
|
|
@@ -10744,7 +11955,7 @@ function useSidebarResize(position, dispatch) {
|
|
|
10744
11955
|
setWidth(storeWidth);
|
|
10745
11956
|
}
|
|
10746
11957
|
}, [storeWidth]);
|
|
10747
|
-
const handleResizeEnd =
|
|
11958
|
+
const handleResizeEnd = useCallback22(
|
|
10748
11959
|
(width2) => {
|
|
10749
11960
|
dispatch({
|
|
10750
11961
|
type: "setUi",
|
|
@@ -10791,15 +12002,15 @@ init_react_import();
|
|
|
10791
12002
|
|
|
10792
12003
|
// components/Puck/components/ResizeHandle/index.tsx
|
|
10793
12004
|
init_react_import();
|
|
10794
|
-
import { useCallback as
|
|
12005
|
+
import { useCallback as useCallback23, useRef as useRef15 } from "react";
|
|
10795
12006
|
|
|
10796
12007
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/ResizeHandle/styles.module.css#css-module
|
|
10797
12008
|
init_react_import();
|
|
10798
|
-
var
|
|
12009
|
+
var styles_module_default35 = { "ResizeHandle": "_ResizeHandle_144bf_2", "ResizeHandle--left": "_ResizeHandle--left_144bf_16", "ResizeHandle--right": "_ResizeHandle--right_144bf_20" };
|
|
10799
12010
|
|
|
10800
12011
|
// components/Puck/components/ResizeHandle/index.tsx
|
|
10801
|
-
import { jsx as
|
|
10802
|
-
var
|
|
12012
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
12013
|
+
var getClassName40 = get_class_name_factory_default("ResizeHandle", styles_module_default35);
|
|
10803
12014
|
var ResizeHandle = ({
|
|
10804
12015
|
position,
|
|
10805
12016
|
sidebarRef,
|
|
@@ -10812,7 +12023,7 @@ var ResizeHandle = ({
|
|
|
10812
12023
|
const isDragging = useRef15(false);
|
|
10813
12024
|
const startX = useRef15(0);
|
|
10814
12025
|
const startWidth = useRef15(0);
|
|
10815
|
-
const handleMouseMove =
|
|
12026
|
+
const handleMouseMove = useCallback23(
|
|
10816
12027
|
(e) => {
|
|
10817
12028
|
if (!isDragging.current) return;
|
|
10818
12029
|
const delta = e.clientX - startX.current;
|
|
@@ -10823,7 +12034,7 @@ var ResizeHandle = ({
|
|
|
10823
12034
|
},
|
|
10824
12035
|
[onResize, position]
|
|
10825
12036
|
);
|
|
10826
|
-
const handleMouseUp =
|
|
12037
|
+
const handleMouseUp = useCallback23(() => {
|
|
10827
12038
|
var _a;
|
|
10828
12039
|
if (!isDragging.current) return;
|
|
10829
12040
|
isDragging.current = false;
|
|
@@ -10839,7 +12050,7 @@ var ResizeHandle = ({
|
|
|
10839
12050
|
onResizeEnd(finalWidth);
|
|
10840
12051
|
resetAutoZoom();
|
|
10841
12052
|
}, [onResizeEnd]);
|
|
10842
|
-
const handleMouseDown =
|
|
12053
|
+
const handleMouseDown = useCallback23(
|
|
10843
12054
|
(e) => {
|
|
10844
12055
|
var _a;
|
|
10845
12056
|
isDragging.current = true;
|
|
@@ -10857,11 +12068,11 @@ var ResizeHandle = ({
|
|
|
10857
12068
|
},
|
|
10858
12069
|
[position, handleMouseMove, handleMouseUp]
|
|
10859
12070
|
);
|
|
10860
|
-
return /* @__PURE__ */
|
|
12071
|
+
return /* @__PURE__ */ jsx62(
|
|
10861
12072
|
"div",
|
|
10862
12073
|
{
|
|
10863
12074
|
ref: handleRef,
|
|
10864
|
-
className:
|
|
12075
|
+
className: getClassName40({ [position]: true }),
|
|
10865
12076
|
onMouseDown: handleMouseDown
|
|
10866
12077
|
}
|
|
10867
12078
|
);
|
|
@@ -10869,11 +12080,11 @@ var ResizeHandle = ({
|
|
|
10869
12080
|
|
|
10870
12081
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Sidebar/styles.module.css#css-module
|
|
10871
12082
|
init_react_import();
|
|
10872
|
-
var
|
|
12083
|
+
var styles_module_default36 = { "Sidebar": "_Sidebar_16oed_1", "Sidebar--isVisible": "_Sidebar--isVisible_16oed_10", "Sidebar--left": "_Sidebar--left_16oed_14", "Sidebar--right": "_Sidebar--right_16oed_34", "Sidebar-resizeHandle": "_Sidebar-resizeHandle_16oed_51" };
|
|
10873
12084
|
|
|
10874
12085
|
// components/Puck/components/Sidebar/index.tsx
|
|
10875
|
-
import { Fragment as Fragment18, jsx as
|
|
10876
|
-
var
|
|
12086
|
+
import { Fragment as Fragment18, jsx as jsx63, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12087
|
+
var getClassName41 = get_class_name_factory_default("Sidebar", styles_module_default36);
|
|
10877
12088
|
var Sidebar = ({
|
|
10878
12089
|
position,
|
|
10879
12090
|
sidebarRef,
|
|
@@ -10882,16 +12093,16 @@ var Sidebar = ({
|
|
|
10882
12093
|
onResizeEnd,
|
|
10883
12094
|
children
|
|
10884
12095
|
}) => {
|
|
10885
|
-
return /* @__PURE__ */
|
|
10886
|
-
/* @__PURE__ */
|
|
12096
|
+
return /* @__PURE__ */ jsxs27(Fragment18, { children: [
|
|
12097
|
+
/* @__PURE__ */ jsx63(
|
|
10887
12098
|
"div",
|
|
10888
12099
|
{
|
|
10889
12100
|
ref: sidebarRef,
|
|
10890
|
-
className:
|
|
12101
|
+
className: getClassName41({ [position]: true, isVisible }),
|
|
10891
12102
|
children
|
|
10892
12103
|
}
|
|
10893
12104
|
),
|
|
10894
|
-
/* @__PURE__ */
|
|
12105
|
+
/* @__PURE__ */ jsx63("div", { className: `${getClassName41("resizeHandle")}`, children: /* @__PURE__ */ jsx63(
|
|
10895
12106
|
ResizeHandle,
|
|
10896
12107
|
{
|
|
10897
12108
|
position,
|
|
@@ -10905,7 +12116,7 @@ var Sidebar = ({
|
|
|
10905
12116
|
|
|
10906
12117
|
// lib/use-delete-hotkeys.ts
|
|
10907
12118
|
init_react_import();
|
|
10908
|
-
import { useCallback as
|
|
12119
|
+
import { useCallback as useCallback24 } from "react";
|
|
10909
12120
|
var isElementVisible = (element) => {
|
|
10910
12121
|
let current = element;
|
|
10911
12122
|
while (current && current !== document.body) {
|
|
@@ -10940,7 +12151,7 @@ var shouldBlockDeleteHotkey = (e) => {
|
|
|
10940
12151
|
};
|
|
10941
12152
|
var useDeleteHotkeys = () => {
|
|
10942
12153
|
const appStore = useAppStoreApi();
|
|
10943
|
-
const deleteSelectedComponent =
|
|
12154
|
+
const deleteSelectedComponent = useCallback24(
|
|
10944
12155
|
(e) => {
|
|
10945
12156
|
var _a;
|
|
10946
12157
|
if (shouldBlockDeleteHotkey(e)) {
|
|
@@ -10969,12 +12180,12 @@ init_react_import();
|
|
|
10969
12180
|
|
|
10970
12181
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Nav/styles.module.css#css-module
|
|
10971
12182
|
init_react_import();
|
|
10972
|
-
var
|
|
12183
|
+
var styles_module_default37 = { "Nav": "_Nav_vll2r_1", "Nav-list": "_Nav-list_vll2r_5", "Nav-mobileActions": "_Nav-mobileActions_vll2r_23", "NavItem-link": "_NavItem-link_vll2r_39", "NavItem": "_NavItem_vll2r_39", "NavItem-linkIcon": "_NavItem-linkIcon_vll2r_90", "NavItem--active": "_NavItem--active_vll2r_100", "NavItem--mobileOnly": "_NavItem--mobileOnly_vll2r_136", "NavItem--desktopOnly": "_NavItem--desktopOnly_vll2r_141" };
|
|
10973
12184
|
|
|
10974
12185
|
// components/Puck/components/Nav/index.tsx
|
|
10975
|
-
import { jsx as
|
|
10976
|
-
var
|
|
10977
|
-
var getClassNameItem3 = get_class_name_factory_default("NavItem",
|
|
12186
|
+
import { jsx as jsx64, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
12187
|
+
var getClassName42 = get_class_name_factory_default("Nav", styles_module_default37);
|
|
12188
|
+
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default37);
|
|
10978
12189
|
var MenuItem = ({
|
|
10979
12190
|
label,
|
|
10980
12191
|
icon,
|
|
@@ -10983,7 +12194,7 @@ var MenuItem = ({
|
|
|
10983
12194
|
mobileOnly,
|
|
10984
12195
|
desktopOnly
|
|
10985
12196
|
}) => {
|
|
10986
|
-
return /* @__PURE__ */
|
|
12197
|
+
return /* @__PURE__ */ jsx64(
|
|
10987
12198
|
"li",
|
|
10988
12199
|
{
|
|
10989
12200
|
className: getClassNameItem3({
|
|
@@ -10991,9 +12202,9 @@ var MenuItem = ({
|
|
|
10991
12202
|
mobileOnly,
|
|
10992
12203
|
desktopOnly
|
|
10993
12204
|
}),
|
|
10994
|
-
children: onClick && /* @__PURE__ */
|
|
10995
|
-
icon && /* @__PURE__ */
|
|
10996
|
-
/* @__PURE__ */
|
|
12205
|
+
children: onClick && /* @__PURE__ */ jsxs28("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
12206
|
+
icon && /* @__PURE__ */ jsx64("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
12207
|
+
/* @__PURE__ */ jsx64("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
10997
12208
|
] })
|
|
10998
12209
|
}
|
|
10999
12210
|
);
|
|
@@ -11002,9 +12213,9 @@ var Nav = ({
|
|
|
11002
12213
|
items,
|
|
11003
12214
|
mobileActions
|
|
11004
12215
|
}) => {
|
|
11005
|
-
return /* @__PURE__ */
|
|
11006
|
-
/* @__PURE__ */
|
|
11007
|
-
mobileActions && /* @__PURE__ */
|
|
12216
|
+
return /* @__PURE__ */ jsxs28("nav", { className: getClassName42(), children: [
|
|
12217
|
+
/* @__PURE__ */ jsx64("ul", { className: getClassName42("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ jsx64(MenuItem, __spreadValues({}, item), key)) }),
|
|
12218
|
+
mobileActions && /* @__PURE__ */ jsx64("div", { className: getClassName42("mobileActions"), children: mobileActions })
|
|
11008
12219
|
] });
|
|
11009
12220
|
};
|
|
11010
12221
|
|
|
@@ -11017,26 +12228,27 @@ var normalizeIframeConfig = (iframe) => __spreadValues({
|
|
|
11017
12228
|
}, iframe);
|
|
11018
12229
|
|
|
11019
12230
|
// components/Puck/components/Layout/index.tsx
|
|
11020
|
-
import { jsx as
|
|
11021
|
-
var
|
|
11022
|
-
var getLayoutClassName = get_class_name_factory_default("PuckLayout",
|
|
11023
|
-
var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab",
|
|
12231
|
+
import { jsx as jsx65, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
12232
|
+
var getClassName43 = get_class_name_factory_default("Puck", styles_module_default29);
|
|
12233
|
+
var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_module_default29);
|
|
12234
|
+
var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab", styles_module_default29);
|
|
11024
12235
|
var useBrowserLayoutEffect = typeof window === "undefined" ? useEffect28 : useLayoutEffect2;
|
|
11025
12236
|
var FieldSideBar = () => {
|
|
12237
|
+
const pageLabel = useMessage("label-page");
|
|
11026
12238
|
const title = useAppStore(
|
|
11027
12239
|
(s) => {
|
|
11028
12240
|
var _a, _b, _c;
|
|
11029
|
-
return s.selectedItem ? (_b = (_a = s.config.components[s.selectedItem.type]) == null ? void 0 : _a["label"]) != null ? _b : s.selectedItem.type.toString() : (
|
|
12241
|
+
return s.selectedItem ? (_b = (_a = s.config.components[s.selectedItem.type]) == null ? void 0 : _a["label"]) != null ? _b : s.selectedItem.type.toString() : (_c = s.config.root) == null ? void 0 : _c.label;
|
|
11030
12242
|
}
|
|
11031
12243
|
);
|
|
11032
|
-
return /* @__PURE__ */
|
|
12244
|
+
return /* @__PURE__ */ jsx65(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title: title || pageLabel, children: /* @__PURE__ */ jsx65(Fields, {}) });
|
|
11033
12245
|
};
|
|
11034
12246
|
var PluginTab = ({
|
|
11035
12247
|
children,
|
|
11036
12248
|
visible,
|
|
11037
12249
|
mobileOnly
|
|
11038
12250
|
}) => {
|
|
11039
|
-
return /* @__PURE__ */
|
|
12251
|
+
return /* @__PURE__ */ jsx65("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ jsx65("div", { className: getPluginTabClassName("body"), children }) });
|
|
11040
12252
|
};
|
|
11041
12253
|
var Layout = ({ children }) => {
|
|
11042
12254
|
var _a, _b;
|
|
@@ -11047,7 +12259,7 @@ var Layout = ({ children }) => {
|
|
|
11047
12259
|
plugins,
|
|
11048
12260
|
height
|
|
11049
12261
|
} = usePropsContext();
|
|
11050
|
-
const iframe =
|
|
12262
|
+
const iframe = useMemo27(
|
|
11051
12263
|
() => normalizeIframeConfig(_iframe),
|
|
11052
12264
|
[_iframe]
|
|
11053
12265
|
);
|
|
@@ -11094,11 +12306,11 @@ var Layout = ({ children }) => {
|
|
|
11094
12306
|
};
|
|
11095
12307
|
}, []);
|
|
11096
12308
|
const overrides = useAppStore((s) => s.overrides);
|
|
11097
|
-
const CustomPuck =
|
|
12309
|
+
const CustomPuck = useMemo27(
|
|
11098
12310
|
() => overrides.puck || DefaultOverride,
|
|
11099
12311
|
[overrides]
|
|
11100
12312
|
);
|
|
11101
|
-
const [mounted, setMounted] =
|
|
12313
|
+
const [mounted, setMounted] = useState24(false);
|
|
11102
12314
|
useBrowserLayoutEffect(() => {
|
|
11103
12315
|
setMounted(true);
|
|
11104
12316
|
}, []);
|
|
@@ -11127,20 +12339,26 @@ var Layout = ({ children }) => {
|
|
|
11127
12339
|
return (_a2 = s.state.ui.plugin) == null ? void 0 : _a2.current;
|
|
11128
12340
|
});
|
|
11129
12341
|
const appStoreApi = useAppStoreApi();
|
|
11130
|
-
const hasLegacySideBarPlugin =
|
|
12342
|
+
const hasLegacySideBarPlugin = useMemo27(
|
|
11131
12343
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
11132
12344
|
[plugins]
|
|
11133
12345
|
);
|
|
11134
|
-
const
|
|
12346
|
+
const blocksLabel = useMessage("plugin-blocks");
|
|
12347
|
+
const outlineLabel = useMessage("plugin-outline");
|
|
12348
|
+
const fieldsLabel = useMessage("plugin-fields");
|
|
12349
|
+
const pluginItems = useMemo27(() => {
|
|
11135
12350
|
const details = {};
|
|
11136
|
-
const defaultPlugins = [
|
|
12351
|
+
const defaultPlugins = [
|
|
12352
|
+
blocksPlugin({ label: blocksLabel }),
|
|
12353
|
+
outlinePlugin({ label: outlineLabel })
|
|
12354
|
+
];
|
|
11137
12355
|
const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
|
|
11138
12356
|
const combinedPlugins = [
|
|
11139
12357
|
...defaultPlugins,
|
|
11140
12358
|
...plugins != null ? plugins : []
|
|
11141
12359
|
].sort((a, b) => isLegacy(a) - isLegacy(b));
|
|
11142
12360
|
if (!(plugins == null ? void 0 : plugins.some((p) => p.name === "fields"))) {
|
|
11143
|
-
combinedPlugins.push(fieldsPlugin());
|
|
12361
|
+
combinedPlugins.push(fieldsPlugin({ label: fieldsLabel }));
|
|
11144
12362
|
}
|
|
11145
12363
|
combinedPlugins == null ? void 0 : combinedPlugins.forEach((plugin) => {
|
|
11146
12364
|
var _a2, _b2, _c;
|
|
@@ -11150,7 +12368,7 @@ var Layout = ({ children }) => {
|
|
|
11150
12368
|
}
|
|
11151
12369
|
details[plugin.name] = {
|
|
11152
12370
|
label: (_a2 = plugin.label) != null ? _a2 : plugin.name,
|
|
11153
|
-
icon: (_b2 = plugin.icon) != null ? _b2 : /* @__PURE__ */
|
|
12371
|
+
icon: (_b2 = plugin.icon) != null ? _b2 : /* @__PURE__ */ jsx65(ToyBrick, {}),
|
|
11154
12372
|
onClick: () => {
|
|
11155
12373
|
if (plugin.name === currentPlugin) {
|
|
11156
12374
|
if (leftSideBarVisible) {
|
|
@@ -11176,7 +12394,15 @@ var Layout = ({ children }) => {
|
|
|
11176
12394
|
}
|
|
11177
12395
|
});
|
|
11178
12396
|
return details;
|
|
11179
|
-
}, [
|
|
12397
|
+
}, [
|
|
12398
|
+
plugins,
|
|
12399
|
+
currentPlugin,
|
|
12400
|
+
appStoreApi,
|
|
12401
|
+
leftSideBarVisible,
|
|
12402
|
+
blocksLabel,
|
|
12403
|
+
outlineLabel,
|
|
12404
|
+
fieldsLabel
|
|
12405
|
+
]);
|
|
11180
12406
|
const activePlugin = currentPlugin != null ? currentPlugin : Object.keys(pluginItems)[0];
|
|
11181
12407
|
const mobilePanelHeightMode = (_b = (_a = pluginItems[activePlugin]) == null ? void 0 : _a.mobilePanelHeight) != null ? _b : "toggle";
|
|
11182
12408
|
useEffect28(() => {
|
|
@@ -11192,16 +12418,18 @@ var Layout = ({ children }) => {
|
|
|
11192
12418
|
return (_a2 = s.state.ui.mobilePanelExpanded) != null ? _a2 : false;
|
|
11193
12419
|
}
|
|
11194
12420
|
);
|
|
11195
|
-
|
|
12421
|
+
const maximizeLabel = useMessage("layout-maximize");
|
|
12422
|
+
const minimizeLabel = useMessage("layout-minimize");
|
|
12423
|
+
return /* @__PURE__ */ jsxs29(
|
|
11196
12424
|
"div",
|
|
11197
12425
|
{
|
|
11198
|
-
className: `Puck ${
|
|
12426
|
+
className: `Puck ${getClassName43({
|
|
11199
12427
|
hidePlugins: hasLegacySideBarPlugin
|
|
11200
12428
|
})}`,
|
|
11201
12429
|
id: instanceId,
|
|
11202
12430
|
style: { height, visibility: "hidden" },
|
|
11203
12431
|
children: [
|
|
11204
|
-
/* @__PURE__ */
|
|
12432
|
+
/* @__PURE__ */ jsx65(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ jsx65(CustomPuck, { children: children || /* @__PURE__ */ jsx65(FrameProvider, { children: /* @__PURE__ */ jsx65(
|
|
11205
12433
|
"div",
|
|
11206
12434
|
{
|
|
11207
12435
|
className: getLayoutClassName({
|
|
@@ -11213,33 +12441,33 @@ var Layout = ({ children }) => {
|
|
|
11213
12441
|
mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
|
|
11214
12442
|
}),
|
|
11215
12443
|
style: { height },
|
|
11216
|
-
children: /* @__PURE__ */
|
|
12444
|
+
children: /* @__PURE__ */ jsxs29(
|
|
11217
12445
|
"div",
|
|
11218
12446
|
{
|
|
11219
12447
|
className: getLayoutClassName("inner"),
|
|
11220
12448
|
style: layoutOptions,
|
|
11221
12449
|
children: [
|
|
11222
|
-
/* @__PURE__ */
|
|
11223
|
-
/* @__PURE__ */
|
|
12450
|
+
/* @__PURE__ */ jsx65("div", { className: getLayoutClassName("header"), children: /* @__PURE__ */ jsx65(Header, { hidePlugins: hasLegacySideBarPlugin }) }),
|
|
12451
|
+
/* @__PURE__ */ jsx65("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ jsx65(
|
|
11224
12452
|
Nav,
|
|
11225
12453
|
{
|
|
11226
12454
|
items: pluginItems,
|
|
11227
|
-
mobileActions: leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */
|
|
12455
|
+
mobileActions: leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */ jsx65(
|
|
11228
12456
|
IconButton,
|
|
11229
12457
|
{
|
|
11230
12458
|
type: "button",
|
|
11231
|
-
title:
|
|
12459
|
+
title: mobilePanelExpanded ? minimizeLabel : maximizeLabel,
|
|
11232
12460
|
onClick: () => {
|
|
11233
12461
|
setUi({
|
|
11234
12462
|
mobilePanelExpanded: !mobilePanelExpanded
|
|
11235
12463
|
});
|
|
11236
12464
|
},
|
|
11237
|
-
children: mobilePanelExpanded ? /* @__PURE__ */
|
|
12465
|
+
children: mobilePanelExpanded ? /* @__PURE__ */ jsx65(Minimize2, { size: 21 }) : /* @__PURE__ */ jsx65(Maximize2, { size: 21 })
|
|
11238
12466
|
}
|
|
11239
12467
|
)
|
|
11240
12468
|
}
|
|
11241
12469
|
) }),
|
|
11242
|
-
/* @__PURE__ */
|
|
12470
|
+
/* @__PURE__ */ jsx65(
|
|
11243
12471
|
Sidebar,
|
|
11244
12472
|
{
|
|
11245
12473
|
position: "left",
|
|
@@ -11248,20 +12476,20 @@ var Layout = ({ children }) => {
|
|
|
11248
12476
|
onResize: setLeftWidth,
|
|
11249
12477
|
onResizeEnd: handleLeftSidebarResizeEnd,
|
|
11250
12478
|
children: Object.entries(pluginItems).map(
|
|
11251
|
-
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */
|
|
12479
|
+
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ jsx65(
|
|
11252
12480
|
PluginTab,
|
|
11253
12481
|
{
|
|
11254
12482
|
visible: currentPlugin === id,
|
|
11255
12483
|
mobileOnly,
|
|
11256
|
-
children: /* @__PURE__ */
|
|
12484
|
+
children: /* @__PURE__ */ jsx65(Render2, {})
|
|
11257
12485
|
},
|
|
11258
12486
|
id
|
|
11259
12487
|
)
|
|
11260
12488
|
)
|
|
11261
12489
|
}
|
|
11262
12490
|
),
|
|
11263
|
-
/* @__PURE__ */
|
|
11264
|
-
!hasDesktopFieldsPlugin && /* @__PURE__ */
|
|
12491
|
+
/* @__PURE__ */ jsx65(Canvas, {}),
|
|
12492
|
+
!hasDesktopFieldsPlugin && /* @__PURE__ */ jsx65(
|
|
11265
12493
|
Sidebar,
|
|
11266
12494
|
{
|
|
11267
12495
|
position: "right",
|
|
@@ -11269,7 +12497,7 @@ var Layout = ({ children }) => {
|
|
|
11269
12497
|
isVisible: rightSideBarVisible,
|
|
11270
12498
|
onResize: setRightWidth,
|
|
11271
12499
|
onResizeEnd: handleRightSidebarResizeEnd,
|
|
11272
|
-
children: /* @__PURE__ */
|
|
12500
|
+
children: /* @__PURE__ */ jsx65(FieldSideBar, {})
|
|
11273
12501
|
}
|
|
11274
12502
|
)
|
|
11275
12503
|
]
|
|
@@ -11277,19 +12505,19 @@ var Layout = ({ children }) => {
|
|
|
11277
12505
|
)
|
|
11278
12506
|
}
|
|
11279
12507
|
) }) }) }),
|
|
11280
|
-
/* @__PURE__ */
|
|
12508
|
+
/* @__PURE__ */ jsx65("div", { id: "puck-portal-root", className: getClassName43("portal") })
|
|
11281
12509
|
]
|
|
11282
12510
|
}
|
|
11283
12511
|
);
|
|
11284
12512
|
};
|
|
11285
12513
|
|
|
11286
12514
|
// components/Puck/index.tsx
|
|
11287
|
-
import { jsx as
|
|
11288
|
-
var propsContext =
|
|
12515
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
12516
|
+
var propsContext = createContext9({});
|
|
11289
12517
|
function PropsProvider(props) {
|
|
11290
|
-
return /* @__PURE__ */
|
|
12518
|
+
return /* @__PURE__ */ jsx66(propsContext.Provider, { value: props, children: props.children });
|
|
11291
12519
|
}
|
|
11292
|
-
var usePropsContext = () =>
|
|
12520
|
+
var usePropsContext = () => useContext18(propsContext);
|
|
11293
12521
|
function PuckProvider({ children }) {
|
|
11294
12522
|
const {
|
|
11295
12523
|
config,
|
|
@@ -11301,18 +12529,20 @@ function PuckProvider({ children }) {
|
|
|
11301
12529
|
overrides,
|
|
11302
12530
|
viewports = defaultViewports,
|
|
11303
12531
|
iframe: _iframe,
|
|
12532
|
+
dnd,
|
|
11304
12533
|
initialHistory: _initialHistory,
|
|
11305
12534
|
metadata,
|
|
12535
|
+
dictionary,
|
|
11306
12536
|
onAction,
|
|
11307
12537
|
fieldTransforms,
|
|
11308
12538
|
_experimentalFullScreenCanvas,
|
|
11309
12539
|
_experimentalVirtualization
|
|
11310
12540
|
} = usePropsContext();
|
|
11311
|
-
const iframe =
|
|
12541
|
+
const iframe = useMemo28(
|
|
11312
12542
|
() => normalizeIframeConfig(_iframe),
|
|
11313
12543
|
[_iframe]
|
|
11314
12544
|
);
|
|
11315
|
-
const [generatedAppState] =
|
|
12545
|
+
const [generatedAppState] = useState25(() => {
|
|
11316
12546
|
var _a, _b, _c;
|
|
11317
12547
|
const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
|
|
11318
12548
|
let clientUiState = {};
|
|
@@ -11352,7 +12582,7 @@ function PuckProvider({ children }) {
|
|
|
11352
12582
|
return walkAppState(newAppState, config);
|
|
11353
12583
|
});
|
|
11354
12584
|
const { appendData = true } = _initialHistory || {};
|
|
11355
|
-
const [blendedHistories] =
|
|
12585
|
+
const [blendedHistories] = useState25(
|
|
11356
12586
|
[
|
|
11357
12587
|
...(_initialHistory == null ? void 0 : _initialHistory.histories) || [],
|
|
11358
12588
|
...appendData ? [{ state: generatedAppState }] : []
|
|
@@ -11366,7 +12596,7 @@ function PuckProvider({ children }) {
|
|
|
11366
12596
|
});
|
|
11367
12597
|
})
|
|
11368
12598
|
);
|
|
11369
|
-
const initialHistoryIndex =
|
|
12599
|
+
const initialHistoryIndex = useMemo28(() => {
|
|
11370
12600
|
if ((_initialHistory == null ? void 0 : _initialHistory.index) !== void 0 && (_initialHistory == null ? void 0 : _initialHistory.index) >= 0 && (_initialHistory == null ? void 0 : _initialHistory.index) < blendedHistories.length) {
|
|
11371
12601
|
return _initialHistory == null ? void 0 : _initialHistory.index;
|
|
11372
12602
|
}
|
|
@@ -11377,7 +12607,7 @@ function PuckProvider({ children }) {
|
|
|
11377
12607
|
overrides,
|
|
11378
12608
|
plugins
|
|
11379
12609
|
});
|
|
11380
|
-
const loadedFieldTransforms =
|
|
12610
|
+
const loadedFieldTransforms = useMemo28(() => {
|
|
11381
12611
|
const _plugins = plugins || [];
|
|
11382
12612
|
const pluginFieldTransforms = _plugins.reduce(
|
|
11383
12613
|
(acc, plugin) => __spreadValues(__spreadValues({}, acc), plugin.fieldTransforms),
|
|
@@ -11386,7 +12616,7 @@ function PuckProvider({ children }) {
|
|
|
11386
12616
|
return __spreadValues(__spreadValues({}, pluginFieldTransforms), fieldTransforms);
|
|
11387
12617
|
}, [fieldTransforms, plugins]);
|
|
11388
12618
|
const instanceId = useSafeId();
|
|
11389
|
-
const generateAppStore =
|
|
12619
|
+
const generateAppStore = useCallback25(
|
|
11390
12620
|
(state) => {
|
|
11391
12621
|
return {
|
|
11392
12622
|
instanceId,
|
|
@@ -11400,6 +12630,8 @@ function PuckProvider({ children }) {
|
|
|
11400
12630
|
_experimentalVirtualization: !!_experimentalVirtualization,
|
|
11401
12631
|
onAction,
|
|
11402
12632
|
metadata,
|
|
12633
|
+
dictionary: dictionary || {},
|
|
12634
|
+
dnd,
|
|
11403
12635
|
fieldTransforms: loadedFieldTransforms
|
|
11404
12636
|
};
|
|
11405
12637
|
},
|
|
@@ -11415,10 +12647,12 @@ function PuckProvider({ children }) {
|
|
|
11415
12647
|
_experimentalVirtualization,
|
|
11416
12648
|
onAction,
|
|
11417
12649
|
metadata,
|
|
12650
|
+
dictionary,
|
|
12651
|
+
dnd,
|
|
11418
12652
|
loadedFieldTransforms
|
|
11419
12653
|
]
|
|
11420
12654
|
);
|
|
11421
|
-
const [appStore] =
|
|
12655
|
+
const [appStore] = useState25(
|
|
11422
12656
|
() => createAppStore(generateAppStore(initialAppState))
|
|
11423
12657
|
);
|
|
11424
12658
|
useEffect29(() => {
|
|
@@ -11456,10 +12690,10 @@ function PuckProvider({ children }) {
|
|
|
11456
12690
|
resolveAndCommitData();
|
|
11457
12691
|
}, 0);
|
|
11458
12692
|
}, []);
|
|
11459
|
-
return /* @__PURE__ */
|
|
12693
|
+
return /* @__PURE__ */ jsx66(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ jsx66(UsePuckStoreContext.Provider, { value: uPuckStore, children }) });
|
|
11460
12694
|
}
|
|
11461
12695
|
function Puck(props) {
|
|
11462
|
-
return /* @__PURE__ */
|
|
12696
|
+
return /* @__PURE__ */ jsx66(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx66(PuckProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx66(Layout, { children: props.children }) })) }));
|
|
11463
12697
|
}
|
|
11464
12698
|
Puck.Components = Components;
|
|
11465
12699
|
Puck.Fields = Fields;
|
|
@@ -11469,13 +12703,29 @@ Puck.Preview = Preview2;
|
|
|
11469
12703
|
|
|
11470
12704
|
// plugins/legacy-side-bar/index.tsx
|
|
11471
12705
|
init_react_import();
|
|
11472
|
-
import { jsx as
|
|
11473
|
-
var
|
|
12706
|
+
import { jsx as jsx67, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
12707
|
+
var LegacySideBar = ({
|
|
12708
|
+
outlineLabel,
|
|
12709
|
+
componentsLabel
|
|
12710
|
+
}) => {
|
|
12711
|
+
const componentsLabelMessage = useMessage("plugin-components");
|
|
12712
|
+
const outlineLabelMessage = useMessage("plugin-outline");
|
|
12713
|
+
const resolvedComponentsLabel = componentsLabel != null ? componentsLabel : componentsLabelMessage;
|
|
12714
|
+
const resolvedOutlineLabel = outlineLabel != null ? outlineLabel : outlineLabelMessage;
|
|
12715
|
+
return /* @__PURE__ */ jsxs30("div", { style: { overflowY: "auto" }, children: [
|
|
12716
|
+
/* @__PURE__ */ jsx67(SidebarSection, { title: resolvedComponentsLabel, noBorderTop: true, children: /* @__PURE__ */ jsx67(Components, {}) }),
|
|
12717
|
+
/* @__PURE__ */ jsx67(SidebarSection, { title: resolvedOutlineLabel, children: /* @__PURE__ */ jsx67(Outline, {}) })
|
|
12718
|
+
] });
|
|
12719
|
+
};
|
|
12720
|
+
var legacySideBarPlugin = (props = {}) => ({
|
|
11474
12721
|
name: "legacy-side-bar",
|
|
11475
|
-
render: () => /* @__PURE__ */
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
12722
|
+
render: () => /* @__PURE__ */ jsx67(
|
|
12723
|
+
LegacySideBar,
|
|
12724
|
+
{
|
|
12725
|
+
outlineLabel: props.outlineLabel,
|
|
12726
|
+
componentsLabel: props.componentsLabel
|
|
12727
|
+
}
|
|
12728
|
+
)
|
|
11479
12729
|
});
|
|
11480
12730
|
|
|
11481
12731
|
// bundle/core.ts
|