@puckeditor/core 0.22.2 → 0.23.0-canary.20671fd7
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-MLHOIEVM.mjs → Editor-BJP5AFD5.mjs} +6 -6
- package/dist/{chunk-PRZEIT36.mjs → chunk-BMRBP3ET.mjs} +3 -3
- package/dist/{chunk-NKDMBWQC.mjs → chunk-EYJW64M2.mjs} +21 -10
- package/dist/{chunk-4I2WN43X.mjs → chunk-HB4CVO3I.mjs} +15 -8
- package/dist/{chunk-KJQTOPIV.mjs → chunk-JHNG6XYK.mjs} +119 -4
- package/dist/{chunk-C2H4WQP2.mjs → chunk-MU6IPW26.mjs} +27 -12
- package/dist/{chunk-CGHMSBNM.mjs → chunk-Q6WCB6GM.mjs} +265 -144
- package/dist/{chunk-25O24MZR.mjs → chunk-WQV7W7OC.mjs} +37 -22
- package/dist/{full-YXSOFDYM.mjs → full-7ONH7UPJ.mjs} +5 -5
- package/dist/{index-ClzBCbx_.d.mts → index-De5Tn61v.d.mts} +85 -1
- package/dist/{index-B1b1cFug.d.ts → index-t7c1w81O.d.ts} +85 -1
- package/dist/index.d.mts +20 -5
- package/dist/index.d.ts +20 -5
- package/dist/index.js +465 -137
- package/dist/index.mjs +7 -7
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/{loaded-IFFZACEG.mjs → loaded-35D7XAOE.mjs} +2 -2
- package/dist/{loaded-SJJPEREQ.mjs → loaded-6YDNF4HS.mjs} +2 -2
- package/dist/{loaded-LMF4JLYG.mjs → loaded-PF5Y4VWH.mjs} +2 -2
- package/dist/no-external.d.mts +2 -2
- package/dist/no-external.d.ts +2 -2
- package/dist/no-external.js +465 -137
- package/dist/no-external.mjs +7 -7
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditorInner,
|
|
3
3
|
LoadedRichTextMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BMRBP3ET.mjs";
|
|
5
5
|
import {
|
|
6
6
|
RichTextRenderFallback,
|
|
7
7
|
SlotRender,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-JNJJ2M57.mjs";
|
|
14
14
|
import {
|
|
15
15
|
LoadedRichTextMenuInner
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WQV7W7OC.mjs";
|
|
17
17
|
import {
|
|
18
18
|
ActionBar,
|
|
19
19
|
ChevronDown,
|
|
@@ -63,12 +63,13 @@ import {
|
|
|
63
63
|
useAppStore,
|
|
64
64
|
useAppStoreApi,
|
|
65
65
|
useHotkey,
|
|
66
|
+
useMessage,
|
|
66
67
|
useMonitorHotkeys,
|
|
67
68
|
useRegisterFieldsSlice,
|
|
68
69
|
useRegisterHistorySlice,
|
|
69
70
|
useRegisterPermissionsSlice,
|
|
70
71
|
useResetAutoZoom
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-JHNG6XYK.mjs";
|
|
72
73
|
import {
|
|
73
74
|
generateId,
|
|
74
75
|
getItem,
|
|
@@ -263,11 +264,12 @@ var FieldLabel = ({
|
|
|
263
264
|
className
|
|
264
265
|
}) => {
|
|
265
266
|
const El = el;
|
|
267
|
+
const readOnlyLabel = useMessage("field-readonly");
|
|
266
268
|
return /* @__PURE__ */ jsxs2(El, { className, children: [
|
|
267
269
|
/* @__PURE__ */ jsxs2("div", { className: getClassName2("label"), children: [
|
|
268
270
|
icon ? /* @__PURE__ */ jsx2("div", { className: getClassName2("labelIcon"), children: icon }) : /* @__PURE__ */ jsx2(Fragment, {}),
|
|
269
271
|
label,
|
|
270
|
-
readOnly && /* @__PURE__ */ jsx2("div", { className: getClassName2("disabledIcon"), title:
|
|
272
|
+
readOnly && /* @__PURE__ */ jsx2("div", { className: getClassName2("disabledIcon"), title: readOnlyLabel, children: /* @__PURE__ */ jsx2(Lock, { size: "12" }) })
|
|
271
273
|
] }),
|
|
272
274
|
children
|
|
273
275
|
] });
|
|
@@ -956,12 +958,15 @@ var ItemSummaryInner = ({
|
|
|
956
958
|
const path = `${[name]}[${index}]`;
|
|
957
959
|
return getDeep(s, path);
|
|
958
960
|
});
|
|
961
|
+
const fallbackSummary = useMessage("field-arrayitem-summary", {
|
|
962
|
+
index: originalIndex
|
|
963
|
+
});
|
|
959
964
|
const itemSummary = useMemo3(() => {
|
|
960
965
|
if (data && field.getItemSummary) {
|
|
961
966
|
return field.getItemSummary(data, index);
|
|
962
967
|
}
|
|
963
|
-
return
|
|
964
|
-
}, [data, field, originalIndex, index]);
|
|
968
|
+
return fallbackSummary;
|
|
969
|
+
}, [data, field, originalIndex, index, fallbackSummary]);
|
|
965
970
|
return itemSummary;
|
|
966
971
|
};
|
|
967
972
|
var ItemSummary = memo2(ItemSummaryInner);
|
|
@@ -1183,6 +1188,8 @@ var ArrayField = ({
|
|
|
1183
1188
|
const newArrayState = regenerateArrayState(getValue());
|
|
1184
1189
|
setUi(mapArrayStateToUi(newArrayState), false);
|
|
1185
1190
|
}, [numItems]);
|
|
1191
|
+
const duplicateLabel = useMessage("field-arrayitem-duplicate");
|
|
1192
|
+
const deleteLabel = useMessage("field-arrayitem-delete");
|
|
1186
1193
|
if (field.type !== "array" || !field.arrayFields) {
|
|
1187
1194
|
return null;
|
|
1188
1195
|
}
|
|
@@ -1294,7 +1301,7 @@ var ArrayField = ({
|
|
|
1294
1301
|
existingValue.splice(index, 0, newItem);
|
|
1295
1302
|
updateValue(existingValue);
|
|
1296
1303
|
},
|
|
1297
|
-
title:
|
|
1304
|
+
title: duplicateLabel,
|
|
1298
1305
|
children: /* @__PURE__ */ jsx8(Copy, { size: 16 })
|
|
1299
1306
|
}
|
|
1300
1307
|
) }),
|
|
@@ -1310,7 +1317,7 @@ var ArrayField = ({
|
|
|
1310
1317
|
existingValue.splice(index, 1);
|
|
1311
1318
|
updateValue(existingValue);
|
|
1312
1319
|
},
|
|
1313
|
-
title:
|
|
1320
|
+
title: deleteLabel,
|
|
1314
1321
|
children: /* @__PURE__ */ jsx8(Trash, { size: 16 })
|
|
1315
1322
|
}
|
|
1316
1323
|
) })
|
|
@@ -1532,6 +1539,11 @@ init_react_import();
|
|
|
1532
1539
|
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1533
1540
|
var getClassName8 = get_class_name_factory_default("ExternalInput", styles_module_default4);
|
|
1534
1541
|
var getClassNameModal = get_class_name_factory_default("ExternalInputModal", styles_module_default4);
|
|
1542
|
+
var DefaultFooter = ({ count }) => {
|
|
1543
|
+
const singular = useMessage("field-external-result-singular", { count });
|
|
1544
|
+
const plural = useMessage("field-external-result-plural", { count });
|
|
1545
|
+
return /* @__PURE__ */ jsx12("span", { className: getClassNameModal("footer"), children: count === 1 ? singular : plural });
|
|
1546
|
+
};
|
|
1535
1547
|
var dataCache = {};
|
|
1536
1548
|
var ExternalInput = ({
|
|
1537
1549
|
field,
|
|
@@ -1590,16 +1602,16 @@ var ExternalInput = ({
|
|
|
1590
1602
|
[id, field]
|
|
1591
1603
|
);
|
|
1592
1604
|
const Footer = useCallback3(
|
|
1593
|
-
(props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */
|
|
1594
|
-
props.items.length,
|
|
1595
|
-
" result",
|
|
1596
|
-
props.items.length === 1 ? "" : "s"
|
|
1597
|
-
] }),
|
|
1605
|
+
(props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ jsx12(DefaultFooter, { count: props.items.length }),
|
|
1598
1606
|
[field.renderFooter]
|
|
1599
1607
|
);
|
|
1600
1608
|
useEffect5(() => {
|
|
1601
1609
|
search(searchQuery, filters);
|
|
1602
1610
|
}, []);
|
|
1611
|
+
const externalItemLabel = useMessage("field-external-item");
|
|
1612
|
+
const searchLabel = useMessage("field-external-search");
|
|
1613
|
+
const toggleFiltersLabel = useMessage("field-external-togglefilters");
|
|
1614
|
+
const selectDataLabel = useMessage("field-external-selectdata");
|
|
1603
1615
|
return /* @__PURE__ */ jsxs5(
|
|
1604
1616
|
"div",
|
|
1605
1617
|
{
|
|
@@ -1618,7 +1630,7 @@ var ExternalInput = ({
|
|
|
1618
1630
|
onClick: () => setOpen(true),
|
|
1619
1631
|
className: getClassName8("button"),
|
|
1620
1632
|
disabled: readOnly,
|
|
1621
|
-
children: value ? field.getItemSummary ? field.getItemSummary(value) :
|
|
1633
|
+
children: value ? field.getItemSummary ? field.getItemSummary(value) : externalItemLabel : /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
1622
1634
|
/* @__PURE__ */ jsx12(Link, { size: "16" }),
|
|
1623
1635
|
/* @__PURE__ */ jsx12("span", { children: field.placeholder })
|
|
1624
1636
|
] })
|
|
@@ -1654,7 +1666,7 @@ var ExternalInput = ({
|
|
|
1654
1666
|
children: [
|
|
1655
1667
|
/* @__PURE__ */ jsx12("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ jsxs5("div", { className: getClassNameModal("searchForm"), children: [
|
|
1656
1668
|
/* @__PURE__ */ jsxs5("label", { className: getClassNameModal("search"), children: [
|
|
1657
|
-
/* @__PURE__ */ jsx12("span", { className: getClassNameModal("searchIconText"), children:
|
|
1669
|
+
/* @__PURE__ */ jsx12("span", { className: getClassNameModal("searchIconText"), children: searchLabel }),
|
|
1658
1670
|
/* @__PURE__ */ jsx12("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ jsx12(Search, { size: "18" }) }),
|
|
1659
1671
|
/* @__PURE__ */ jsx12(
|
|
1660
1672
|
"input",
|
|
@@ -1672,12 +1684,12 @@ var ExternalInput = ({
|
|
|
1672
1684
|
)
|
|
1673
1685
|
] }),
|
|
1674
1686
|
/* @__PURE__ */ jsxs5("div", { className: getClassNameModal("searchActions"), children: [
|
|
1675
|
-
/* @__PURE__ */ jsx12(Button, { type: "submit", loading: isLoading, fullWidth: true, children:
|
|
1687
|
+
/* @__PURE__ */ jsx12(Button, { type: "submit", loading: isLoading, fullWidth: true, children: searchLabel }),
|
|
1676
1688
|
hasFilterFields && /* @__PURE__ */ jsx12("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ jsx12(
|
|
1677
1689
|
IconButton,
|
|
1678
1690
|
{
|
|
1679
1691
|
type: "button",
|
|
1680
|
-
title:
|
|
1692
|
+
title: toggleFiltersLabel,
|
|
1681
1693
|
onClick: (e) => {
|
|
1682
1694
|
e.preventDefault();
|
|
1683
1695
|
e.stopPropagation();
|
|
@@ -1687,7 +1699,7 @@ var ExternalInput = ({
|
|
|
1687
1699
|
}
|
|
1688
1700
|
) })
|
|
1689
1701
|
] })
|
|
1690
|
-
] }) : /* @__PURE__ */ jsx12(Heading, { rank: "2", size: "xs", children: field.placeholder ||
|
|
1702
|
+
] }) : /* @__PURE__ */ jsx12(Heading, { rank: "2", size: "xs", children: field.placeholder || selectDataLabel }) }),
|
|
1691
1703
|
/* @__PURE__ */ jsxs5("div", { className: getClassNameModal("grid"), children: [
|
|
1692
1704
|
hasFilterFields && /* @__PURE__ */ jsx12("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
|
|
1693
1705
|
const filterField = filterFields[fieldName];
|
|
@@ -1771,6 +1783,7 @@ var ExternalField = ({
|
|
|
1771
1783
|
const value = useDeepField(name);
|
|
1772
1784
|
const validField = field;
|
|
1773
1785
|
const deprecatedField = field;
|
|
1786
|
+
const selectDataLabel = useMessage("field-external-selectdata");
|
|
1774
1787
|
useEffect6(() => {
|
|
1775
1788
|
if (deprecatedField.adaptor) {
|
|
1776
1789
|
console.error(
|
|
@@ -1793,7 +1806,7 @@ var ExternalField = ({
|
|
|
1793
1806
|
name,
|
|
1794
1807
|
field: __spreadProps(__spreadValues({}, validField), {
|
|
1795
1808
|
// DEPRECATED
|
|
1796
|
-
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder ||
|
|
1809
|
+
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || selectDataLabel,
|
|
1797
1810
|
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
|
1798
1811
|
mapRow: validField.mapRow,
|
|
1799
1812
|
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
|
|
@@ -1999,7 +2012,7 @@ EditorFallback.displayName = "EditorFallback";
|
|
|
1999
2012
|
// components/AutoField/fields/RichtextField/index.tsx
|
|
2000
2013
|
import { Fragment as Fragment5, jsx as jsx18 } from "react/jsx-runtime";
|
|
2001
2014
|
var Editor = lazy(
|
|
2002
|
-
() => import("./Editor-
|
|
2015
|
+
() => import("./Editor-BJP5AFD5.mjs").then((m) => ({
|
|
2003
2016
|
default: m.Editor
|
|
2004
2017
|
}))
|
|
2005
2018
|
);
|
|
@@ -2944,9 +2957,12 @@ var DraggableComponent = ({
|
|
|
2944
2957
|
}
|
|
2945
2958
|
setDragAxis(autoDragAxis);
|
|
2946
2959
|
}, [ref, userDragAxis, autoDragAxis]);
|
|
2960
|
+
const selectParentLabel = useMessage("action-selectparent");
|
|
2961
|
+
const duplicateLabel = useMessage("action-duplicate");
|
|
2962
|
+
const deleteLabel = useMessage("action-delete");
|
|
2947
2963
|
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]
|
|
2964
|
+
() => (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 }) }),
|
|
2965
|
+
[ctx == null ? void 0 : ctx.areaId, selectParentLabel]
|
|
2950
2966
|
);
|
|
2951
2967
|
const nextContextValue = useMemo7(
|
|
2952
2968
|
() => __spreadProps(__spreadValues({}, ctx), {
|
|
@@ -3026,8 +3042,15 @@ var DraggableComponent = ({
|
|
|
3026
3042
|
),
|
|
3027
3043
|
hasNormalActions && /* @__PURE__ */ jsx22(ActionBar.Separator, {})
|
|
3028
3044
|
] }),
|
|
3029
|
-
permissions.duplicate && /* @__PURE__ */ jsx22(
|
|
3030
|
-
|
|
3045
|
+
permissions.duplicate && /* @__PURE__ */ jsx22(
|
|
3046
|
+
ActionBar.Action,
|
|
3047
|
+
{
|
|
3048
|
+
onClick: onDuplicate,
|
|
3049
|
+
label: duplicateLabel,
|
|
3050
|
+
children: /* @__PURE__ */ jsx22(Copy, { className: getClassName14("actionsAction") })
|
|
3051
|
+
}
|
|
3052
|
+
),
|
|
3053
|
+
permissions.delete && /* @__PURE__ */ jsx22(ActionBar.Action, { onClick: onDelete, label: deleteLabel, children: /* @__PURE__ */ jsx22(Trash, { className: getClassName14("actionsAction") }) })
|
|
3031
3054
|
]
|
|
3032
3055
|
}
|
|
3033
3056
|
)
|
|
@@ -4515,7 +4538,7 @@ import {
|
|
|
4515
4538
|
} from "react";
|
|
4516
4539
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4517
4540
|
var Editor2 = lazy2(
|
|
4518
|
-
() => import("./Editor-
|
|
4541
|
+
() => import("./Editor-BJP5AFD5.mjs").then((m) => ({
|
|
4519
4542
|
default: m.Editor
|
|
4520
4543
|
}))
|
|
4521
4544
|
);
|
|
@@ -4884,7 +4907,7 @@ var VirtualizedDropZone = ({
|
|
|
4884
4907
|
};
|
|
4885
4908
|
|
|
4886
4909
|
// components/DropZone/index.tsx
|
|
4887
|
-
import { Fragment as Fragment9, jsx as jsx31
|
|
4910
|
+
import { Fragment as Fragment9, jsx as jsx31 } from "react/jsx-runtime";
|
|
4888
4911
|
var getClassName17 = get_class_name_factory_default("DropZone", styles_module_default9);
|
|
4889
4912
|
var getRandomColor = () => `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
|
4890
4913
|
var RENDER_DEBUG = false;
|
|
@@ -4911,7 +4934,7 @@ var DropZoneChild = ({
|
|
|
4911
4934
|
inDroppableZone,
|
|
4912
4935
|
itemRef
|
|
4913
4936
|
}) => {
|
|
4914
|
-
var _a, _b;
|
|
4937
|
+
var _a, _b, _c, _d;
|
|
4915
4938
|
const metadata = useAppStore((s) => s.metadata);
|
|
4916
4939
|
const ctx = useContext9(dropZoneContext);
|
|
4917
4940
|
const { depth = 1 } = ctx != null ? ctx : {};
|
|
@@ -4979,7 +5002,11 @@ var DropZoneChild = ({
|
|
|
4979
5002
|
return ((_a2 = s.selectedItem) == null ? void 0 : _a2.props.id) === componentId || false;
|
|
4980
5003
|
}
|
|
4981
5004
|
);
|
|
4982
|
-
|
|
5005
|
+
const componentLabel = useMessage("label-component");
|
|
5006
|
+
const noConfigMessage = useMessage("canvas-noconfig", {
|
|
5007
|
+
type: (_b = (_a = item == null ? void 0 : item.type) == null ? void 0 : _a.toString()) != null ? _b : ""
|
|
5008
|
+
});
|
|
5009
|
+
let label = (_d = (_c = componentConfig == null ? void 0 : componentConfig.label) != null ? _c : item == null ? void 0 : item.type.toString()) != null ? _d : componentLabel;
|
|
4983
5010
|
const defaultsProps = useMemo12(
|
|
4984
5011
|
() => __spreadProps(__spreadValues(__spreadValues({}, componentConfig == null ? void 0 : componentConfig.defaultProps), item == null ? void 0 : item.props), {
|
|
4985
5012
|
puck: puckProps,
|
|
@@ -5013,10 +5040,7 @@ var DropZoneChild = ({
|
|
|
5013
5040
|
isLoading
|
|
5014
5041
|
);
|
|
5015
5042
|
if (!item) return;
|
|
5016
|
-
const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */
|
|
5017
|
-
"No configuration for ",
|
|
5018
|
-
item.type
|
|
5019
|
-
] });
|
|
5043
|
+
const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */ jsx31("div", { style: { padding: 48, textAlign: "center" }, children: noConfigMessage });
|
|
5020
5044
|
let componentType = item.type;
|
|
5021
5045
|
const isInserting = "previewType" in item ? item.previewType === "insert" : false;
|
|
5022
5046
|
return /* @__PURE__ */ jsx31(
|
|
@@ -5508,7 +5532,8 @@ var generateUsePuck = (store, getState) => {
|
|
|
5508
5532
|
const parentNode = store.state.indexes.nodes[parentId];
|
|
5509
5533
|
if (!parentNode) return;
|
|
5510
5534
|
return parentNode.data;
|
|
5511
|
-
}
|
|
5535
|
+
},
|
|
5536
|
+
dictionary: store.dictionary
|
|
5512
5537
|
};
|
|
5513
5538
|
storeData.__private = {
|
|
5514
5539
|
appState: store.state
|
|
@@ -5525,7 +5550,8 @@ var convertToPickedStore = (store) => {
|
|
|
5525
5550
|
dispatch: store.dispatch,
|
|
5526
5551
|
permissions: store.permissions,
|
|
5527
5552
|
history: store.history,
|
|
5528
|
-
selectedItem: store.selectedItem
|
|
5553
|
+
selectedItem: store.selectedItem,
|
|
5554
|
+
dictionary: store.dictionary
|
|
5529
5555
|
};
|
|
5530
5556
|
};
|
|
5531
5557
|
var useRegisterUsePuckStore = (appStore) => {
|
|
@@ -5595,7 +5621,7 @@ var styles_module_default12 = { "ComponentList": "_ComponentList_htktj_1", "Comp
|
|
|
5595
5621
|
|
|
5596
5622
|
// components/ComponentList/index.tsx
|
|
5597
5623
|
import { useEffect as useEffect18 } from "react";
|
|
5598
|
-
import { jsx as jsx33, jsxs as
|
|
5624
|
+
import { jsx as jsx33, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5599
5625
|
var getClassName18 = get_class_name_factory_default("ComponentList", styles_module_default12);
|
|
5600
5626
|
var ComponentListItem = ({
|
|
5601
5627
|
name,
|
|
@@ -5627,8 +5653,14 @@ var ComponentList = ({
|
|
|
5627
5653
|
const componentList = useAppStore((s) => s.state.ui.componentList);
|
|
5628
5654
|
const { expanded = true } = componentList[id] || {};
|
|
5629
5655
|
const contentId = `puck-drawer-category-${id}`;
|
|
5630
|
-
|
|
5631
|
-
title
|
|
5656
|
+
const collapseTitle = useMessage("drawer-category-collapse", {
|
|
5657
|
+
title: title != null ? title : ""
|
|
5658
|
+
});
|
|
5659
|
+
const expandTitle = useMessage("drawer-category-expand", {
|
|
5660
|
+
title: title != null ? title : ""
|
|
5661
|
+
});
|
|
5662
|
+
return /* @__PURE__ */ jsxs10("div", { className: getClassName18({ isExpanded: expanded }), children: [
|
|
5663
|
+
title && /* @__PURE__ */ jsxs10(
|
|
5632
5664
|
"button",
|
|
5633
5665
|
{
|
|
5634
5666
|
type: "button",
|
|
@@ -5642,7 +5674,7 @@ var ComponentList = ({
|
|
|
5642
5674
|
})
|
|
5643
5675
|
})
|
|
5644
5676
|
}),
|
|
5645
|
-
title: expanded ?
|
|
5677
|
+
title: expanded ? collapseTitle : expandTitle,
|
|
5646
5678
|
children: [
|
|
5647
5679
|
/* @__PURE__ */ jsx33("div", { children: title }),
|
|
5648
5680
|
/* @__PURE__ */ jsx33("div", { className: getClassName18("titleIcon"), children: expanded ? /* @__PURE__ */ jsx33(ChevronUp, { size: 12 }) : /* @__PURE__ */ jsx33(ChevronDown, { size: 12 }) })
|
|
@@ -5670,6 +5702,7 @@ var useComponentList = () => {
|
|
|
5670
5702
|
const [componentList, setComponentList] = useState17();
|
|
5671
5703
|
const config = useAppStore((s) => s.config);
|
|
5672
5704
|
const uiComponentList = useAppStore((s) => s.state.ui.componentList);
|
|
5705
|
+
const otherLabel = useMessage("drawer-category-other");
|
|
5673
5706
|
useEffect19(() => {
|
|
5674
5707
|
var _a, _b, _c;
|
|
5675
5708
|
if (Object.keys(uiComponentList).length > 0) {
|
|
@@ -5677,6 +5710,7 @@ var useComponentList = () => {
|
|
|
5677
5710
|
let _componentList;
|
|
5678
5711
|
_componentList = Object.entries(uiComponentList).map(
|
|
5679
5712
|
([categoryKey, category]) => {
|
|
5713
|
+
var _a2, _b2;
|
|
5680
5714
|
if (!category.components) {
|
|
5681
5715
|
return null;
|
|
5682
5716
|
}
|
|
@@ -5690,14 +5724,14 @@ var useComponentList = () => {
|
|
|
5690
5724
|
ComponentList,
|
|
5691
5725
|
{
|
|
5692
5726
|
id: categoryKey,
|
|
5693
|
-
title: category.title || categoryKey,
|
|
5727
|
+
title: ((_b2 = (_a2 = config.categories) == null ? void 0 : _a2[categoryKey]) == null ? void 0 : _b2.title) || category.title || categoryKey,
|
|
5694
5728
|
children: category.components.map((componentName, i) => {
|
|
5695
|
-
var
|
|
5729
|
+
var _a3;
|
|
5696
5730
|
const componentConf = config.components[componentName] || {};
|
|
5697
5731
|
return /* @__PURE__ */ jsx34(
|
|
5698
5732
|
ComponentList.Item,
|
|
5699
5733
|
{
|
|
5700
|
-
label: (
|
|
5734
|
+
label: (_a3 = componentConf["label"]) != null ? _a3 : componentName,
|
|
5701
5735
|
name: componentName,
|
|
5702
5736
|
index: i
|
|
5703
5737
|
},
|
|
@@ -5718,7 +5752,7 @@ var useComponentList = () => {
|
|
|
5718
5752
|
ComponentList,
|
|
5719
5753
|
{
|
|
5720
5754
|
id: "other",
|
|
5721
|
-
title: ((_c = uiComponentList.other) == null ? void 0 : _c.title) ||
|
|
5755
|
+
title: ((_c = uiComponentList.other) == null ? void 0 : _c.title) || otherLabel,
|
|
5722
5756
|
children: remainingComponents.map((componentName, i) => {
|
|
5723
5757
|
var _a2;
|
|
5724
5758
|
const componentConf = config.components[componentName] || {};
|
|
@@ -5739,7 +5773,7 @@ var useComponentList = () => {
|
|
|
5739
5773
|
}
|
|
5740
5774
|
setComponentList(_componentList);
|
|
5741
5775
|
}
|
|
5742
|
-
}, [config.categories, config.components, uiComponentList]);
|
|
5776
|
+
}, [config.categories, config.components, uiComponentList, otherLabel]);
|
|
5743
5777
|
return componentList;
|
|
5744
5778
|
};
|
|
5745
5779
|
|
|
@@ -5767,12 +5801,15 @@ var styles_module_default13 = { "BlocksPlugin": "_BlocksPlugin_9af19_1" };
|
|
|
5767
5801
|
// plugins/blocks/index.tsx
|
|
5768
5802
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5769
5803
|
var getClassName19 = get_class_name_factory_default("BlocksPlugin", styles_module_default13);
|
|
5770
|
-
var blocksPlugin = () =>
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
})
|
|
5804
|
+
var blocksPlugin = (props = {}) => {
|
|
5805
|
+
var _a, _b;
|
|
5806
|
+
return {
|
|
5807
|
+
name: "blocks",
|
|
5808
|
+
label: (_a = props.label) != null ? _a : "Blocks",
|
|
5809
|
+
render: () => /* @__PURE__ */ jsx36("div", { className: getClassName19(), children: /* @__PURE__ */ jsx36(Components, {}) }),
|
|
5810
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ jsx36(Hammer, {})
|
|
5811
|
+
};
|
|
5812
|
+
};
|
|
5776
5813
|
|
|
5777
5814
|
// plugins/outline/index.tsx
|
|
5778
5815
|
init_react_import();
|
|
@@ -5795,7 +5832,7 @@ import {
|
|
|
5795
5832
|
useRef as useRef10
|
|
5796
5833
|
} from "react";
|
|
5797
5834
|
import { useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
|
|
5798
|
-
import { Fragment as Fragment10, jsx as jsx37, jsxs as
|
|
5835
|
+
import { Fragment as Fragment10, jsx as jsx37, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5799
5836
|
var getClassName20 = get_class_name_factory_default("LayerTree", styles_module_default14);
|
|
5800
5837
|
var getClassNameLayer = get_class_name_factory_default("Layer", styles_module_default14);
|
|
5801
5838
|
var DEFAULT_LAYER_ROW_HEIGHT = 32;
|
|
@@ -5829,11 +5866,12 @@ var buildLayerNode = ({
|
|
|
5829
5866
|
nodes,
|
|
5830
5867
|
zoneCompound,
|
|
5831
5868
|
zones,
|
|
5832
|
-
zonesByParent
|
|
5869
|
+
zonesByParent,
|
|
5870
|
+
componentFallbackLabel = "Component"
|
|
5833
5871
|
}) => {
|
|
5834
5872
|
var _a, _b, _c;
|
|
5835
5873
|
const nodeData = nodes[itemId];
|
|
5836
|
-
const componentType = ((_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) ||
|
|
5874
|
+
const componentType = ((_a = nodeData == null ? void 0 : nodeData.data.type) == null ? void 0 : _a.toString()) || componentFallbackLabel;
|
|
5837
5875
|
const label = (_c = (_b = config.components[componentType]) == null ? void 0 : _b.label) != null ? _c : componentType;
|
|
5838
5876
|
const childZoneCompounds = zonesByParent[itemId] || [];
|
|
5839
5877
|
return {
|
|
@@ -5843,7 +5881,8 @@ var buildLayerNode = ({
|
|
|
5843
5881
|
nodes,
|
|
5844
5882
|
zoneCompound: childZoneCompound,
|
|
5845
5883
|
zones,
|
|
5846
|
-
zonesByParent
|
|
5884
|
+
zonesByParent,
|
|
5885
|
+
componentFallbackLabel
|
|
5847
5886
|
})
|
|
5848
5887
|
),
|
|
5849
5888
|
componentType,
|
|
@@ -5859,7 +5898,8 @@ var buildLayerTree = ({
|
|
|
5859
5898
|
nodes,
|
|
5860
5899
|
zoneCompound,
|
|
5861
5900
|
zones,
|
|
5862
|
-
zonesByParent = getZonesByParent(zones)
|
|
5901
|
+
zonesByParent = getZonesByParent(zones),
|
|
5902
|
+
componentFallbackLabel = "Component"
|
|
5863
5903
|
}) => {
|
|
5864
5904
|
var _a, _b;
|
|
5865
5905
|
const contentIds = (_b = (_a = zones[zoneCompound]) == null ? void 0 : _a.contentIds) != null ? _b : [];
|
|
@@ -5872,7 +5912,8 @@ var buildLayerTree = ({
|
|
|
5872
5912
|
nodes,
|
|
5873
5913
|
zoneCompound,
|
|
5874
5914
|
zones,
|
|
5875
|
-
zonesByParent
|
|
5915
|
+
zonesByParent,
|
|
5916
|
+
componentFallbackLabel
|
|
5876
5917
|
})
|
|
5877
5918
|
),
|
|
5878
5919
|
label: getZoneLabel(zoneCompound, nodes, config, label),
|
|
@@ -5917,6 +5958,8 @@ var Layer = forwardRef2(function Layer2({
|
|
|
5917
5958
|
(s) => s.hoveringComponent === node.itemId
|
|
5918
5959
|
);
|
|
5919
5960
|
const containsZone = node.childZones.length > 0;
|
|
5961
|
+
const collapseLabel = useMessage("outline-collapse");
|
|
5962
|
+
const expandLabel = useMessage("outline-expand");
|
|
5920
5963
|
const setItemSelector = useCallback14(
|
|
5921
5964
|
(itemSelector) => {
|
|
5922
5965
|
dispatch({ type: "setUi", ui: { itemSelector } });
|
|
@@ -5924,7 +5967,7 @@ var Layer = forwardRef2(function Layer2({
|
|
|
5924
5967
|
[dispatch]
|
|
5925
5968
|
);
|
|
5926
5969
|
const shouldRenderChildren = isSelected || childIsSelected;
|
|
5927
|
-
return /* @__PURE__ */
|
|
5970
|
+
return /* @__PURE__ */ jsxs11(
|
|
5928
5971
|
"li",
|
|
5929
5972
|
{
|
|
5930
5973
|
ref,
|
|
@@ -5937,7 +5980,7 @@ var Layer = forwardRef2(function Layer2({
|
|
|
5937
5980
|
"data-index": dataIndex,
|
|
5938
5981
|
"data-puck-layer-tree-id": node.itemId,
|
|
5939
5982
|
children: [
|
|
5940
|
-
/* @__PURE__ */ jsx37("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */
|
|
5983
|
+
/* @__PURE__ */ jsx37("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ jsxs11(
|
|
5941
5984
|
"button",
|
|
5942
5985
|
{
|
|
5943
5986
|
type: "button",
|
|
@@ -5966,11 +6009,11 @@ var Layer = forwardRef2(function Layer2({
|
|
|
5966
6009
|
"div",
|
|
5967
6010
|
{
|
|
5968
6011
|
className: getClassNameLayer("chevron"),
|
|
5969
|
-
title: isSelected ?
|
|
6012
|
+
title: isSelected ? collapseLabel : expandLabel,
|
|
5970
6013
|
children: /* @__PURE__ */ jsx37(ChevronDown, { size: "12" })
|
|
5971
6014
|
}
|
|
5972
6015
|
),
|
|
5973
|
-
/* @__PURE__ */
|
|
6016
|
+
/* @__PURE__ */ jsxs11("div", { className: getClassNameLayer("title"), children: [
|
|
5974
6017
|
/* @__PURE__ */ jsx37("div", { className: getClassNameLayer("icon"), children: node.componentType === "Text" || node.componentType === "Heading" ? /* @__PURE__ */ jsx37(Type, { size: "16" }) : /* @__PURE__ */ jsx37(LayoutGrid, { size: "16" }) }),
|
|
5975
6018
|
/* @__PURE__ */ jsx37("div", { className: getClassNameLayer("name"), children: node.label })
|
|
5976
6019
|
] })
|
|
@@ -6004,8 +6047,8 @@ var LayerTreeZone = ({
|
|
|
6004
6047
|
tree
|
|
6005
6048
|
}) => {
|
|
6006
6049
|
const shouldVirtualize = depth === 0 && tree.items.length >= MIN_VIRTUALIZED_LAYER_COUNT;
|
|
6007
|
-
return /* @__PURE__ */
|
|
6008
|
-
tree.label && /* @__PURE__ */
|
|
6050
|
+
return /* @__PURE__ */ jsxs11(Fragment10, { children: [
|
|
6051
|
+
tree.label && /* @__PURE__ */ jsxs11("div", { className: getClassName20("zoneTitle"), children: [
|
|
6009
6052
|
/* @__PURE__ */ jsx37("div", { className: getClassName20("zoneIcon"), children: /* @__PURE__ */ jsx37(Layers, { size: "16" }) }),
|
|
6010
6053
|
tree.label
|
|
6011
6054
|
] }),
|
|
@@ -6034,8 +6077,9 @@ var StaticLayerTreeItems = ({
|
|
|
6034
6077
|
selectedPathIds,
|
|
6035
6078
|
tree
|
|
6036
6079
|
}) => {
|
|
6037
|
-
|
|
6038
|
-
|
|
6080
|
+
const noItemsLabel = useMessage("outline-empty");
|
|
6081
|
+
return /* @__PURE__ */ jsxs11("ul", { className: getClassName20(), children: [
|
|
6082
|
+
tree.items.length === 0 && /* @__PURE__ */ jsx37("div", { className: getClassName20("helper"), children: noItemsLabel }),
|
|
6039
6083
|
tree.items.map((node) => /* @__PURE__ */ jsx37(
|
|
6040
6084
|
Layer,
|
|
6041
6085
|
{
|
|
@@ -6057,6 +6101,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6057
6101
|
tree
|
|
6058
6102
|
}) => {
|
|
6059
6103
|
const listRef = useRef10(null);
|
|
6104
|
+
const noItemsLabel = useMessage("outline-empty");
|
|
6060
6105
|
const virtualizer = useVirtualizer2({
|
|
6061
6106
|
count: tree.items.length,
|
|
6062
6107
|
estimateSize: (index) => getEstimatedRowHeight(tree.items[index].itemId),
|
|
@@ -6124,8 +6169,8 @@ var VirtualizedLayerTreeItems = ({
|
|
|
6124
6169
|
)
|
|
6125
6170
|
);
|
|
6126
6171
|
}
|
|
6127
|
-
return /* @__PURE__ */
|
|
6128
|
-
tree.items.length === 0 && /* @__PURE__ */ jsx37("div", { className: getClassName20("helper"), children:
|
|
6172
|
+
return /* @__PURE__ */ jsxs11("ul", { className: getClassName20(), ref: listRef, children: [
|
|
6173
|
+
tree.items.length === 0 && /* @__PURE__ */ jsx37("div", { className: getClassName20("helper"), children: noItemsLabel }),
|
|
6129
6174
|
renderedItems
|
|
6130
6175
|
] });
|
|
6131
6176
|
};
|
|
@@ -6169,6 +6214,7 @@ var Outline = () => {
|
|
|
6169
6214
|
var _a;
|
|
6170
6215
|
return ((_a = s.selectedItem) == null ? void 0 : _a.props.id) || null;
|
|
6171
6216
|
});
|
|
6217
|
+
const componentFallbackLabel = useMessage("label-component");
|
|
6172
6218
|
const rootZones = useAppStore(
|
|
6173
6219
|
useShallow7((s) => findZonesForArea(s.state, "root"))
|
|
6174
6220
|
);
|
|
@@ -6186,10 +6232,11 @@ var Outline = () => {
|
|
|
6186
6232
|
label: rootZones.length === 1 ? "" : zoneCompound.split(":")[1],
|
|
6187
6233
|
nodes,
|
|
6188
6234
|
zoneCompound,
|
|
6189
|
-
zones
|
|
6235
|
+
zones,
|
|
6236
|
+
componentFallbackLabel
|
|
6190
6237
|
})
|
|
6191
6238
|
),
|
|
6192
|
-
[config, nodes, rootZones, zones]
|
|
6239
|
+
[config, nodes, rootZones, zones, componentFallbackLabel]
|
|
6193
6240
|
);
|
|
6194
6241
|
const Wrapper = useMemo15(() => outlineOverride || "div", [outlineOverride]);
|
|
6195
6242
|
return /* @__PURE__ */ jsx38(Wrapper, { children: /* @__PURE__ */ jsx38(
|
|
@@ -6209,12 +6256,15 @@ var styles_module_default15 = { "OutlinePlugin": "_OutlinePlugin_16k03_1" };
|
|
|
6209
6256
|
// plugins/outline/index.tsx
|
|
6210
6257
|
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
6211
6258
|
var getClassName21 = get_class_name_factory_default("OutlinePlugin", styles_module_default15);
|
|
6212
|
-
var outlinePlugin = () =>
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
})
|
|
6259
|
+
var outlinePlugin = (props = {}) => {
|
|
6260
|
+
var _a, _b;
|
|
6261
|
+
return {
|
|
6262
|
+
name: "outline",
|
|
6263
|
+
label: (_a = props.label) != null ? _a : "Outline",
|
|
6264
|
+
render: () => /* @__PURE__ */ jsx39("div", { className: getClassName21(), children: /* @__PURE__ */ jsx39(Outline, {}) }),
|
|
6265
|
+
icon: (_b = props.icon) != null ? _b : /* @__PURE__ */ jsx39(Layers, {})
|
|
6266
|
+
};
|
|
6267
|
+
};
|
|
6218
6268
|
|
|
6219
6269
|
// plugins/fields/index.tsx
|
|
6220
6270
|
init_react_import();
|
|
@@ -6240,13 +6290,15 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
6240
6290
|
return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
|
|
6241
6291
|
});
|
|
6242
6292
|
const appStore = useAppStoreApi();
|
|
6293
|
+
const pageLabel = useMessage("label-page");
|
|
6294
|
+
const componentLabel = useMessage("label-component");
|
|
6243
6295
|
return useMemo16(() => {
|
|
6244
6296
|
const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
|
|
6245
6297
|
var _a, _b, _c, _d;
|
|
6246
6298
|
const [componentId] = zoneCompound.split(":");
|
|
6247
6299
|
if (componentId === "root") {
|
|
6248
6300
|
return {
|
|
6249
|
-
label: ((_a = config == null ? void 0 : config.root) == null ? void 0 : _a.label) ||
|
|
6301
|
+
label: ((_a = config == null ? void 0 : config.root) == null ? void 0 : _a.label) || pageLabel,
|
|
6250
6302
|
selector: null
|
|
6251
6303
|
};
|
|
6252
6304
|
}
|
|
@@ -6254,7 +6306,7 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
6254
6306
|
const parentId = node.path[node.path.length - 1];
|
|
6255
6307
|
const contentIds = ((_b = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _b.contentIds) || [];
|
|
6256
6308
|
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 :
|
|
6309
|
+
const label = node ? (_d = (_c = config.components[node.data.type]) == null ? void 0 : _c.label) != null ? _d : node.data.type : componentLabel;
|
|
6258
6310
|
return {
|
|
6259
6311
|
label,
|
|
6260
6312
|
selector: node ? {
|
|
@@ -6267,11 +6319,11 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
6267
6319
|
return breadcrumbs.slice(breadcrumbs.length - renderCount);
|
|
6268
6320
|
}
|
|
6269
6321
|
return breadcrumbs;
|
|
6270
|
-
}, [path, renderCount]);
|
|
6322
|
+
}, [path, renderCount, pageLabel, componentLabel]);
|
|
6271
6323
|
};
|
|
6272
6324
|
|
|
6273
6325
|
// components/Breadcrumbs/index.tsx
|
|
6274
|
-
import { jsx as jsx40, jsxs as
|
|
6326
|
+
import { jsx as jsx40, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6275
6327
|
var getClassName22 = get_class_name_factory_default("Breadcrumbs", styles_module_default16);
|
|
6276
6328
|
var Breadcrumbs = ({
|
|
6277
6329
|
children,
|
|
@@ -6279,8 +6331,8 @@ var Breadcrumbs = ({
|
|
|
6279
6331
|
}) => {
|
|
6280
6332
|
const setUi = useAppStore((s) => s.setUi);
|
|
6281
6333
|
const breadcrumbs = useBreadcrumbs(numParents);
|
|
6282
|
-
return /* @__PURE__ */
|
|
6283
|
-
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */
|
|
6334
|
+
return /* @__PURE__ */ jsxs12("div", { className: getClassName22(), children: [
|
|
6335
|
+
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs12("div", { className: getClassName22("breadcrumb"), children: [
|
|
6284
6336
|
/* @__PURE__ */ jsx40(
|
|
6285
6337
|
"button",
|
|
6286
6338
|
{
|
|
@@ -6312,7 +6364,7 @@ import {
|
|
|
6312
6364
|
useMemo as useMemo17
|
|
6313
6365
|
} from "react";
|
|
6314
6366
|
import { useShallow as useShallow8 } from "zustand/react/shallow";
|
|
6315
|
-
import { Fragment as Fragment11, jsx as jsx41, jsxs as
|
|
6367
|
+
import { Fragment as Fragment11, jsx as jsx41, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6316
6368
|
var getClassName23 = get_class_name_factory_default("PuckFields", styles_module_default17);
|
|
6317
6369
|
var DefaultFields = ({
|
|
6318
6370
|
children
|
|
@@ -6443,7 +6495,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
6443
6495
|
);
|
|
6444
6496
|
const isLoading = fieldsLoading || componentResolving;
|
|
6445
6497
|
const Wrapper = useMemo17(() => overrides.fields || DefaultFields, [overrides]);
|
|
6446
|
-
return /* @__PURE__ */
|
|
6498
|
+
return /* @__PURE__ */ jsxs13(
|
|
6447
6499
|
"form",
|
|
6448
6500
|
{
|
|
6449
6501
|
className: getClassName23({ wrapFields }),
|
|
@@ -6464,24 +6516,25 @@ init_react_import();
|
|
|
6464
6516
|
var styles_module_default18 = { "FieldsPlugin": "_FieldsPlugin_18cj3_1", "FieldsPlugin-header": "_FieldsPlugin-header_18cj3_7" };
|
|
6465
6517
|
|
|
6466
6518
|
// plugins/fields/index.tsx
|
|
6467
|
-
import { jsx as jsx42, jsxs as
|
|
6519
|
+
import { jsx as jsx42, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6468
6520
|
var getClassName24 = get_class_name_factory_default("FieldsPlugin", styles_module_default18);
|
|
6469
6521
|
var CurrentTitle = () => {
|
|
6522
|
+
const pageLabel = useMessage("label-page");
|
|
6470
6523
|
const label = useAppStore((s) => {
|
|
6471
6524
|
var _a, _b;
|
|
6472
6525
|
const selectedItem = s.selectedItem;
|
|
6473
|
-
return selectedItem ? (_b = (_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.label) != null ? _b : selectedItem.type :
|
|
6526
|
+
return selectedItem ? (_b = (_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.label) != null ? _b : selectedItem.type : null;
|
|
6474
6527
|
});
|
|
6475
|
-
return label;
|
|
6528
|
+
return label != null ? label : pageLabel;
|
|
6476
6529
|
};
|
|
6477
|
-
var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
|
|
6530
|
+
var fieldsPlugin = ({ desktopSideBar = "right", label, icon } = {}) => ({
|
|
6478
6531
|
name: "fields",
|
|
6479
|
-
label: "Fields",
|
|
6480
|
-
render: () => /* @__PURE__ */
|
|
6532
|
+
label: label != null ? label : "Fields",
|
|
6533
|
+
render: () => /* @__PURE__ */ jsxs14("div", { className: getClassName24(), children: [
|
|
6481
6534
|
/* @__PURE__ */ jsx42("div", { className: getClassName24("header"), children: /* @__PURE__ */ jsx42(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ jsx42(CurrentTitle, {}) }) }),
|
|
6482
6535
|
/* @__PURE__ */ jsx42(Fields, {})
|
|
6483
6536
|
] }),
|
|
6484
|
-
icon: /* @__PURE__ */ jsx42(RectangleEllipsis, {}),
|
|
6537
|
+
icon: icon != null ? icon : /* @__PURE__ */ jsx42(RectangleEllipsis, {}),
|
|
6485
6538
|
mobileOnly: desktopSideBar === "right"
|
|
6486
6539
|
});
|
|
6487
6540
|
|
|
@@ -9996,7 +10049,7 @@ init_react_import();
|
|
|
9996
10049
|
var styles_module_default21 = { "MenuBar": "_MenuBar_1hxnj_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_1hxnj_14", "MenuBar-inner": "_MenuBar-inner_1hxnj_29", "MenuBar-history": "_MenuBar-history_1hxnj_45" };
|
|
9997
10050
|
|
|
9998
10051
|
// components/MenuBar/index.tsx
|
|
9999
|
-
import { Fragment as Fragment15, jsx as jsx46, jsxs as
|
|
10052
|
+
import { Fragment as Fragment15, jsx as jsx46, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
10000
10053
|
var getClassName26 = get_class_name_factory_default("MenuBar", styles_module_default21);
|
|
10001
10054
|
function MenuBar({
|
|
10002
10055
|
menuOpen = false,
|
|
@@ -10007,6 +10060,8 @@ function MenuBar({
|
|
|
10007
10060
|
const forward = useAppStore((s) => s.history.forward);
|
|
10008
10061
|
const hasFuture = useAppStore((s) => s.history.hasFuture());
|
|
10009
10062
|
const hasPast = useAppStore((s) => s.history.hasPast());
|
|
10063
|
+
const undoLabel = useMessage("header-undo");
|
|
10064
|
+
const redoLabel = useMessage("header-redo");
|
|
10010
10065
|
return /* @__PURE__ */ jsx46(
|
|
10011
10066
|
"div",
|
|
10012
10067
|
{
|
|
@@ -10021,13 +10076,13 @@ function MenuBar({
|
|
|
10021
10076
|
setMenuOpen(false);
|
|
10022
10077
|
}
|
|
10023
10078
|
},
|
|
10024
|
-
children: /* @__PURE__ */
|
|
10025
|
-
/* @__PURE__ */
|
|
10079
|
+
children: /* @__PURE__ */ jsxs15("div", { className: getClassName26("inner"), children: [
|
|
10080
|
+
/* @__PURE__ */ jsxs15("div", { className: getClassName26("history"), children: [
|
|
10026
10081
|
/* @__PURE__ */ jsx46(
|
|
10027
10082
|
IconButton,
|
|
10028
10083
|
{
|
|
10029
10084
|
type: "button",
|
|
10030
|
-
title:
|
|
10085
|
+
title: undoLabel,
|
|
10031
10086
|
disabled: !hasPast,
|
|
10032
10087
|
onClick: back,
|
|
10033
10088
|
children: /* @__PURE__ */ jsx46(Undo2, { size: 21 })
|
|
@@ -10037,7 +10092,7 @@ function MenuBar({
|
|
|
10037
10092
|
IconButton,
|
|
10038
10093
|
{
|
|
10039
10094
|
type: "button",
|
|
10040
|
-
title:
|
|
10095
|
+
title: redoLabel,
|
|
10041
10096
|
disabled: !hasFuture,
|
|
10042
10097
|
onClick: forward,
|
|
10043
10098
|
children: /* @__PURE__ */ jsx46(Redo2, { size: 21 })
|
|
@@ -10055,7 +10110,7 @@ init_react_import();
|
|
|
10055
10110
|
var styles_module_default22 = { "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
10111
|
|
|
10057
10112
|
// components/Puck/components/Header/index.tsx
|
|
10058
|
-
import { Fragment as Fragment16, jsx as jsx47, jsxs as
|
|
10113
|
+
import { Fragment as Fragment16, jsx as jsx47, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10059
10114
|
var getClassName27 = get_class_name_factory_default("PuckHeader", styles_module_default22);
|
|
10060
10115
|
var HeaderInner = ({
|
|
10061
10116
|
hidePlugins
|
|
@@ -10129,6 +10184,11 @@ var HeaderInner = ({
|
|
|
10129
10184
|
},
|
|
10130
10185
|
[dispatch, leftSideBarVisible, rightSideBarVisible]
|
|
10131
10186
|
);
|
|
10187
|
+
const publishLabel = useMessage("header-publish");
|
|
10188
|
+
const pageLabel = useMessage("label-page");
|
|
10189
|
+
const toggleLeftLabel = useMessage("header-toggle-leftsidebar");
|
|
10190
|
+
const toggleRightLabel = useMessage("header-toggle-rightsidebar");
|
|
10191
|
+
const toggleMenuLabel = useMessage("header-toggle-menubar");
|
|
10132
10192
|
return /* @__PURE__ */ jsx47(
|
|
10133
10193
|
CustomHeader,
|
|
10134
10194
|
{
|
|
@@ -10140,7 +10200,7 @@ var HeaderInner = ({
|
|
|
10140
10200
|
onPublish && onPublish(data);
|
|
10141
10201
|
},
|
|
10142
10202
|
icon: /* @__PURE__ */ jsx47(Globe, { size: "14px" }),
|
|
10143
|
-
children:
|
|
10203
|
+
children: publishLabel
|
|
10144
10204
|
}
|
|
10145
10205
|
) }) }),
|
|
10146
10206
|
children: /* @__PURE__ */ jsx47(
|
|
@@ -10151,8 +10211,8 @@ var HeaderInner = ({
|
|
|
10151
10211
|
rightSideBarVisible,
|
|
10152
10212
|
hidePlugins
|
|
10153
10213
|
}),
|
|
10154
|
-
children: /* @__PURE__ */
|
|
10155
|
-
/* @__PURE__ */
|
|
10214
|
+
children: /* @__PURE__ */ jsxs16("div", { className: getClassName27("inner"), children: [
|
|
10215
|
+
/* @__PURE__ */ jsxs16("div", { className: getClassName27("toggle"), children: [
|
|
10156
10216
|
/* @__PURE__ */ jsx47("div", { className: getClassName27("leftSideBarToggle"), children: /* @__PURE__ */ jsx47(
|
|
10157
10217
|
IconButton,
|
|
10158
10218
|
{
|
|
@@ -10160,7 +10220,7 @@ var HeaderInner = ({
|
|
|
10160
10220
|
onClick: () => {
|
|
10161
10221
|
toggleSidebars("left");
|
|
10162
10222
|
},
|
|
10163
|
-
title:
|
|
10223
|
+
title: toggleLeftLabel,
|
|
10164
10224
|
children: /* @__PURE__ */ jsx47(PanelLeft, { focusable: "false" })
|
|
10165
10225
|
}
|
|
10166
10226
|
) }),
|
|
@@ -10171,19 +10231,19 @@ var HeaderInner = ({
|
|
|
10171
10231
|
onClick: () => {
|
|
10172
10232
|
toggleSidebars("right");
|
|
10173
10233
|
},
|
|
10174
|
-
title:
|
|
10234
|
+
title: toggleRightLabel,
|
|
10175
10235
|
children: /* @__PURE__ */ jsx47(PanelRight, { focusable: "false" })
|
|
10176
10236
|
}
|
|
10177
10237
|
) })
|
|
10178
10238
|
] }),
|
|
10179
|
-
/* @__PURE__ */ jsx47("div", { className: getClassName27("title"), children: /* @__PURE__ */
|
|
10180
|
-
headerTitle || rootTitle ||
|
|
10181
|
-
headerPath && /* @__PURE__ */
|
|
10239
|
+
/* @__PURE__ */ jsx47("div", { className: getClassName27("title"), children: /* @__PURE__ */ jsxs16(Heading, { rank: "2", size: "xs", children: [
|
|
10240
|
+
headerTitle || rootTitle || pageLabel,
|
|
10241
|
+
headerPath && /* @__PURE__ */ jsxs16(Fragment16, { children: [
|
|
10182
10242
|
" ",
|
|
10183
10243
|
/* @__PURE__ */ jsx47("code", { className: getClassName27("path"), children: headerPath })
|
|
10184
10244
|
] })
|
|
10185
10245
|
] }) }),
|
|
10186
|
-
/* @__PURE__ */
|
|
10246
|
+
/* @__PURE__ */ jsxs16("div", { className: getClassName27("tools"), children: [
|
|
10187
10247
|
/* @__PURE__ */ jsx47("div", { className: getClassName27("menuButton"), children: /* @__PURE__ */ jsx47(
|
|
10188
10248
|
IconButton,
|
|
10189
10249
|
{
|
|
@@ -10191,7 +10251,7 @@ var HeaderInner = ({
|
|
|
10191
10251
|
onClick: () => {
|
|
10192
10252
|
return setMenuOpen(!menuOpen);
|
|
10193
10253
|
},
|
|
10194
|
-
title:
|
|
10254
|
+
title: toggleMenuLabel,
|
|
10195
10255
|
children: menuOpen ? /* @__PURE__ */ jsx47(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ jsx47(ChevronDown, { focusable: "false" })
|
|
10196
10256
|
}
|
|
10197
10257
|
) }),
|
|
@@ -10209,7 +10269,7 @@ var HeaderInner = ({
|
|
|
10209
10269
|
onPublish && onPublish(data);
|
|
10210
10270
|
},
|
|
10211
10271
|
icon: /* @__PURE__ */ jsx47(Globe, { size: "14px" }),
|
|
10212
|
-
children:
|
|
10272
|
+
children: publishLabel
|
|
10213
10273
|
}
|
|
10214
10274
|
) }),
|
|
10215
10275
|
setMenuOpen
|
|
@@ -10232,7 +10292,7 @@ init_react_import();
|
|
|
10232
10292
|
var styles_module_default23 = { "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
10293
|
|
|
10234
10294
|
// components/SidebarSection/index.tsx
|
|
10235
|
-
import { jsx as jsx48, jsxs as
|
|
10295
|
+
import { jsx as jsx48, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10236
10296
|
var getClassName28 = get_class_name_factory_default("SidebarSection", styles_module_default23);
|
|
10237
10297
|
var SidebarSection = ({
|
|
10238
10298
|
children,
|
|
@@ -10242,8 +10302,8 @@ var SidebarSection = ({
|
|
|
10242
10302
|
noBorderTop,
|
|
10243
10303
|
isLoading
|
|
10244
10304
|
}) => {
|
|
10245
|
-
return /* @__PURE__ */
|
|
10246
|
-
/* @__PURE__ */ jsx48("div", { className: getClassName28("title"), children: /* @__PURE__ */
|
|
10305
|
+
return /* @__PURE__ */ jsxs17("div", { className: getClassName28({ noBorderTop }), style: { background }, children: [
|
|
10306
|
+
/* @__PURE__ */ jsx48("div", { className: getClassName28("title"), children: /* @__PURE__ */ jsxs17("div", { className: getClassName28("breadcrumbs"), children: [
|
|
10247
10307
|
showBreadcrumbs && /* @__PURE__ */ jsx48(Breadcrumbs, {}),
|
|
10248
10308
|
/* @__PURE__ */ jsx48("div", { className: getClassName28("heading"), children: /* @__PURE__ */ jsx48(Heading, { rank: "2", size: "xs", children: title }) })
|
|
10249
10309
|
] }) }),
|
|
@@ -10271,7 +10331,7 @@ init_react_import();
|
|
|
10271
10331
|
var styles_module_default24 = { "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
10332
|
|
|
10273
10333
|
// components/ViewportControls/index.tsx
|
|
10274
|
-
import { jsx as jsx49, jsxs as
|
|
10334
|
+
import { jsx as jsx49, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
10275
10335
|
var icons = {
|
|
10276
10336
|
Smartphone: /* @__PURE__ */ jsx49(Smartphone, { size: 16 }),
|
|
10277
10337
|
Tablet: /* @__PURE__ */ jsx49(Tablet, { size: 16 }),
|
|
@@ -10308,6 +10368,26 @@ var defaultZoomOptions = [
|
|
|
10308
10368
|
{ label: "150%", value: 1.5 },
|
|
10309
10369
|
{ label: "200%", value: 2 }
|
|
10310
10370
|
];
|
|
10371
|
+
var ViewportButton = ({
|
|
10372
|
+
viewport,
|
|
10373
|
+
isActive,
|
|
10374
|
+
onClick
|
|
10375
|
+
}) => {
|
|
10376
|
+
var _a;
|
|
10377
|
+
const switchTitle = useMessage("viewport-switch", {
|
|
10378
|
+
label: (_a = viewport.label) != null ? _a : ""
|
|
10379
|
+
});
|
|
10380
|
+
const switchDefaultTitle = useMessage("viewport-switch-default");
|
|
10381
|
+
return /* @__PURE__ */ jsx49(
|
|
10382
|
+
ActionButton,
|
|
10383
|
+
{
|
|
10384
|
+
title: viewport.label ? switchTitle : switchDefaultTitle,
|
|
10385
|
+
onClick,
|
|
10386
|
+
isActive,
|
|
10387
|
+
children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
|
|
10388
|
+
}
|
|
10389
|
+
);
|
|
10390
|
+
};
|
|
10311
10391
|
var ViewportControls = ({
|
|
10312
10392
|
autoZoom,
|
|
10313
10393
|
zoom,
|
|
@@ -10321,17 +10401,20 @@ var ViewportControls = ({
|
|
|
10321
10401
|
const defaultsContainAutoZoom = defaultZoomOptions.find(
|
|
10322
10402
|
(option) => option.value === autoZoom
|
|
10323
10403
|
);
|
|
10404
|
+
const autoZoomLabel = useMessage("viewport-zoom-auto", {
|
|
10405
|
+
zoom: (autoZoom * 100).toFixed(0)
|
|
10406
|
+
});
|
|
10324
10407
|
const zoomOptions = useMemo21(
|
|
10325
10408
|
() => [
|
|
10326
10409
|
...defaultZoomOptions,
|
|
10327
10410
|
...defaultsContainAutoZoom ? [] : [
|
|
10328
10411
|
{
|
|
10329
10412
|
value: autoZoom,
|
|
10330
|
-
label:
|
|
10413
|
+
label: autoZoomLabel
|
|
10331
10414
|
}
|
|
10332
10415
|
]
|
|
10333
10416
|
].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
|
|
10334
|
-
[autoZoom]
|
|
10417
|
+
[autoZoom, autoZoomLabel]
|
|
10335
10418
|
);
|
|
10336
10419
|
const [activeViewport, setActiveViewport] = useState20(
|
|
10337
10420
|
uiViewports.current.width
|
|
@@ -10340,23 +10423,25 @@ var ViewportControls = ({
|
|
|
10340
10423
|
setActiveViewport(uiViewports.current.width);
|
|
10341
10424
|
}, [uiViewports.current]);
|
|
10342
10425
|
const [isExpanded, setIsExpanded] = useState20(false);
|
|
10343
|
-
|
|
10426
|
+
const zoomOutLabel = useMessage("viewport-zoom-out");
|
|
10427
|
+
const zoomInLabel = useMessage("viewport-zoom-in");
|
|
10428
|
+
const toggleMenuLabel = useMessage("viewport-toggle-menu");
|
|
10429
|
+
return /* @__PURE__ */ jsxs18(
|
|
10344
10430
|
"div",
|
|
10345
10431
|
{
|
|
10346
10432
|
className: getClassName29({ isExpanded, fullScreen }),
|
|
10347
10433
|
suppressHydrationWarning: true,
|
|
10348
10434
|
children: [
|
|
10349
|
-
/* @__PURE__ */ jsx49("div", { className: getClassName29("actions"), children: /* @__PURE__ */
|
|
10435
|
+
/* @__PURE__ */ jsx49("div", { className: getClassName29("actions"), children: /* @__PURE__ */ jsxs18("div", { className: getClassName29("actionsInner"), children: [
|
|
10350
10436
|
viewports.map((viewport, i) => /* @__PURE__ */ jsx49(
|
|
10351
|
-
|
|
10437
|
+
ViewportButton,
|
|
10352
10438
|
{
|
|
10353
|
-
|
|
10439
|
+
viewport,
|
|
10354
10440
|
onClick: () => {
|
|
10355
10441
|
setActiveViewport(viewport.width);
|
|
10356
10442
|
onViewportChange(viewport);
|
|
10357
10443
|
},
|
|
10358
|
-
isActive: activeViewport === viewport.width
|
|
10359
|
-
children: typeof viewport.icon === "string" ? icons[viewport.icon] || viewport.icon : viewport.icon || icons.Smartphone
|
|
10444
|
+
isActive: activeViewport === viewport.width
|
|
10360
10445
|
},
|
|
10361
10446
|
i
|
|
10362
10447
|
)),
|
|
@@ -10364,7 +10449,7 @@ var ViewportControls = ({
|
|
|
10364
10449
|
/* @__PURE__ */ jsx49(
|
|
10365
10450
|
ActionButton,
|
|
10366
10451
|
{
|
|
10367
|
-
title:
|
|
10452
|
+
title: zoomOutLabel,
|
|
10368
10453
|
disabled: zoom <= ((_a = zoomOptions[0]) == null ? void 0 : _a.value),
|
|
10369
10454
|
onClick: (e) => {
|
|
10370
10455
|
e.stopPropagation();
|
|
@@ -10381,7 +10466,7 @@ var ViewportControls = ({
|
|
|
10381
10466
|
/* @__PURE__ */ jsx49(
|
|
10382
10467
|
ActionButton,
|
|
10383
10468
|
{
|
|
10384
|
-
title:
|
|
10469
|
+
title: zoomInLabel,
|
|
10385
10470
|
disabled: zoom >= ((_b = zoomOptions[zoomOptions.length - 1]) == null ? void 0 : _b.value),
|
|
10386
10471
|
onClick: (e) => {
|
|
10387
10472
|
e.stopPropagation();
|
|
@@ -10395,7 +10480,7 @@ var ViewportControls = ({
|
|
|
10395
10480
|
children: /* @__PURE__ */ jsx49(ZoomIn, { size: 16 })
|
|
10396
10481
|
}
|
|
10397
10482
|
),
|
|
10398
|
-
/* @__PURE__ */
|
|
10483
|
+
/* @__PURE__ */ jsxs18("div", { className: getClassName29("zoom"), children: [
|
|
10399
10484
|
/* @__PURE__ */ jsx49("div", { className: getClassName29("divider") }),
|
|
10400
10485
|
/* @__PURE__ */ jsx49(
|
|
10401
10486
|
"select",
|
|
@@ -10424,7 +10509,7 @@ var ViewportControls = ({
|
|
|
10424
10509
|
"button",
|
|
10425
10510
|
{
|
|
10426
10511
|
className: getClassName29("toggleButton"),
|
|
10427
|
-
title:
|
|
10512
|
+
title: toggleMenuLabel,
|
|
10428
10513
|
onClick: () => setIsExpanded((s) => !s),
|
|
10429
10514
|
children: isExpanded ? /* @__PURE__ */ jsx49(X, { size: 16 }) : /* @__PURE__ */ jsx49(Monitor, { size: 16 })
|
|
10430
10515
|
}
|
|
@@ -10472,7 +10557,7 @@ var useCanvasFrame = () => {
|
|
|
10472
10557
|
};
|
|
10473
10558
|
|
|
10474
10559
|
// components/Puck/components/Canvas/index.tsx
|
|
10475
|
-
import { Fragment as Fragment17, jsx as jsx51, jsxs as
|
|
10560
|
+
import { Fragment as Fragment17, jsx as jsx51, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
10476
10561
|
var getClassName30 = get_class_name_factory_default("PuckCanvas", styles_module_default25);
|
|
10477
10562
|
var ZOOM_ON_CHANGE = true;
|
|
10478
10563
|
var TRANSITION_DURATION = 150;
|
|
@@ -10628,7 +10713,7 @@ var Canvas = () => {
|
|
|
10628
10713
|
appStoreApi,
|
|
10629
10714
|
(_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
|
|
10630
10715
|
]);
|
|
10631
|
-
return /* @__PURE__ */
|
|
10716
|
+
return /* @__PURE__ */ jsxs19(
|
|
10632
10717
|
"div",
|
|
10633
10718
|
{
|
|
10634
10719
|
className: getClassName30({
|
|
@@ -10677,7 +10762,7 @@ var Canvas = () => {
|
|
|
10677
10762
|
}
|
|
10678
10763
|
}
|
|
10679
10764
|
) }),
|
|
10680
|
-
/* @__PURE__ */
|
|
10765
|
+
/* @__PURE__ */ jsxs19("div", { className: getClassName30("inner"), ref: frameRef, children: [
|
|
10681
10766
|
/* @__PURE__ */ jsx51(
|
|
10682
10767
|
"div",
|
|
10683
10768
|
{
|
|
@@ -10872,7 +10957,7 @@ init_react_import();
|
|
|
10872
10957
|
var styles_module_default27 = { "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
10958
|
|
|
10874
10959
|
// components/Puck/components/Sidebar/index.tsx
|
|
10875
|
-
import { Fragment as Fragment18, jsx as jsx53, jsxs as
|
|
10960
|
+
import { Fragment as Fragment18, jsx as jsx53, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
10876
10961
|
var getClassName32 = get_class_name_factory_default("Sidebar", styles_module_default27);
|
|
10877
10962
|
var Sidebar = ({
|
|
10878
10963
|
position,
|
|
@@ -10882,7 +10967,7 @@ var Sidebar = ({
|
|
|
10882
10967
|
onResizeEnd,
|
|
10883
10968
|
children
|
|
10884
10969
|
}) => {
|
|
10885
|
-
return /* @__PURE__ */
|
|
10970
|
+
return /* @__PURE__ */ jsxs20(Fragment18, { children: [
|
|
10886
10971
|
/* @__PURE__ */ jsx53(
|
|
10887
10972
|
"div",
|
|
10888
10973
|
{
|
|
@@ -10972,7 +11057,7 @@ init_react_import();
|
|
|
10972
11057
|
var styles_module_default28 = { "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
11058
|
|
|
10974
11059
|
// components/Puck/components/Nav/index.tsx
|
|
10975
|
-
import { jsx as jsx54, jsxs as
|
|
11060
|
+
import { jsx as jsx54, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
10976
11061
|
var getClassName33 = get_class_name_factory_default("Nav", styles_module_default28);
|
|
10977
11062
|
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default28);
|
|
10978
11063
|
var MenuItem = ({
|
|
@@ -10991,7 +11076,7 @@ var MenuItem = ({
|
|
|
10991
11076
|
mobileOnly,
|
|
10992
11077
|
desktopOnly
|
|
10993
11078
|
}),
|
|
10994
|
-
children: onClick && /* @__PURE__ */
|
|
11079
|
+
children: onClick && /* @__PURE__ */ jsxs21("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
10995
11080
|
icon && /* @__PURE__ */ jsx54("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
10996
11081
|
/* @__PURE__ */ jsx54("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
10997
11082
|
] })
|
|
@@ -11002,7 +11087,7 @@ var Nav = ({
|
|
|
11002
11087
|
items,
|
|
11003
11088
|
mobileActions
|
|
11004
11089
|
}) => {
|
|
11005
|
-
return /* @__PURE__ */
|
|
11090
|
+
return /* @__PURE__ */ jsxs21("nav", { className: getClassName33(), children: [
|
|
11006
11091
|
/* @__PURE__ */ jsx54("ul", { className: getClassName33("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ jsx54(MenuItem, __spreadValues({}, item), key)) }),
|
|
11007
11092
|
mobileActions && /* @__PURE__ */ jsx54("div", { className: getClassName33("mobileActions"), children: mobileActions })
|
|
11008
11093
|
] });
|
|
@@ -11017,19 +11102,20 @@ var normalizeIframeConfig = (iframe) => __spreadValues({
|
|
|
11017
11102
|
}, iframe);
|
|
11018
11103
|
|
|
11019
11104
|
// components/Puck/components/Layout/index.tsx
|
|
11020
|
-
import { jsx as jsx55, jsxs as
|
|
11105
|
+
import { jsx as jsx55, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
11021
11106
|
var getClassName34 = get_class_name_factory_default("Puck", styles_module_default20);
|
|
11022
11107
|
var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_module_default20);
|
|
11023
11108
|
var getPluginTabClassName = get_class_name_factory_default("PuckPluginTab", styles_module_default20);
|
|
11024
11109
|
var useBrowserLayoutEffect = typeof window === "undefined" ? useEffect28 : useLayoutEffect2;
|
|
11025
11110
|
var FieldSideBar = () => {
|
|
11111
|
+
const pageLabel = useMessage("label-page");
|
|
11026
11112
|
const title = useAppStore(
|
|
11027
11113
|
(s) => {
|
|
11028
11114
|
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() : (
|
|
11115
|
+
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
11116
|
}
|
|
11031
11117
|
);
|
|
11032
|
-
return /* @__PURE__ */ jsx55(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ jsx55(Fields, {}) });
|
|
11118
|
+
return /* @__PURE__ */ jsx55(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title: title || pageLabel, children: /* @__PURE__ */ jsx55(Fields, {}) });
|
|
11033
11119
|
};
|
|
11034
11120
|
var PluginTab = ({
|
|
11035
11121
|
children,
|
|
@@ -11131,16 +11217,22 @@ var Layout = ({ children }) => {
|
|
|
11131
11217
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
11132
11218
|
[plugins]
|
|
11133
11219
|
);
|
|
11220
|
+
const blocksLabel = useMessage("plugin-blocks");
|
|
11221
|
+
const outlineLabel = useMessage("plugin-outline");
|
|
11222
|
+
const fieldsLabel = useMessage("plugin-fields");
|
|
11134
11223
|
const pluginItems = useMemo24(() => {
|
|
11135
11224
|
const details = {};
|
|
11136
|
-
const defaultPlugins = [
|
|
11225
|
+
const defaultPlugins = [
|
|
11226
|
+
blocksPlugin({ label: blocksLabel }),
|
|
11227
|
+
outlinePlugin({ label: outlineLabel })
|
|
11228
|
+
];
|
|
11137
11229
|
const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
|
|
11138
11230
|
const combinedPlugins = [
|
|
11139
11231
|
...defaultPlugins,
|
|
11140
11232
|
...plugins != null ? plugins : []
|
|
11141
11233
|
].sort((a, b) => isLegacy(a) - isLegacy(b));
|
|
11142
11234
|
if (!(plugins == null ? void 0 : plugins.some((p) => p.name === "fields"))) {
|
|
11143
|
-
combinedPlugins.push(fieldsPlugin());
|
|
11235
|
+
combinedPlugins.push(fieldsPlugin({ label: fieldsLabel }));
|
|
11144
11236
|
}
|
|
11145
11237
|
combinedPlugins == null ? void 0 : combinedPlugins.forEach((plugin) => {
|
|
11146
11238
|
var _a, _b;
|
|
@@ -11177,7 +11269,15 @@ var Layout = ({ children }) => {
|
|
|
11177
11269
|
}
|
|
11178
11270
|
});
|
|
11179
11271
|
return details;
|
|
11180
|
-
}, [
|
|
11272
|
+
}, [
|
|
11273
|
+
plugins,
|
|
11274
|
+
currentPlugin,
|
|
11275
|
+
appStoreApi,
|
|
11276
|
+
leftSideBarVisible,
|
|
11277
|
+
blocksLabel,
|
|
11278
|
+
outlineLabel,
|
|
11279
|
+
fieldsLabel
|
|
11280
|
+
]);
|
|
11181
11281
|
useEffect28(() => {
|
|
11182
11282
|
if (!currentPlugin) {
|
|
11183
11283
|
const names = Object.keys(pluginItems);
|
|
@@ -11191,7 +11291,9 @@ var Layout = ({ children }) => {
|
|
|
11191
11291
|
return (_a = s.state.ui.mobilePanelExpanded) != null ? _a : false;
|
|
11192
11292
|
}
|
|
11193
11293
|
);
|
|
11194
|
-
|
|
11294
|
+
const maximizeLabel = useMessage("layout-maximize");
|
|
11295
|
+
const minimizeLabel = useMessage("layout-minimize");
|
|
11296
|
+
return /* @__PURE__ */ jsxs22(
|
|
11195
11297
|
"div",
|
|
11196
11298
|
{
|
|
11197
11299
|
className: `Puck ${getClassName34({
|
|
@@ -11212,7 +11314,7 @@ var Layout = ({ children }) => {
|
|
|
11212
11314
|
mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
|
|
11213
11315
|
}),
|
|
11214
11316
|
style: { height },
|
|
11215
|
-
children: /* @__PURE__ */
|
|
11317
|
+
children: /* @__PURE__ */ jsxs22(
|
|
11216
11318
|
"div",
|
|
11217
11319
|
{
|
|
11218
11320
|
className: getLayoutClassName("inner"),
|
|
@@ -11227,7 +11329,7 @@ var Layout = ({ children }) => {
|
|
|
11227
11329
|
IconButton,
|
|
11228
11330
|
{
|
|
11229
11331
|
type: "button",
|
|
11230
|
-
title:
|
|
11332
|
+
title: mobilePanelExpanded ? minimizeLabel : maximizeLabel,
|
|
11231
11333
|
onClick: () => {
|
|
11232
11334
|
setUi({
|
|
11233
11335
|
mobilePanelExpanded: !mobilePanelExpanded
|
|
@@ -11302,6 +11404,7 @@ function PuckProvider({ children }) {
|
|
|
11302
11404
|
iframe: _iframe,
|
|
11303
11405
|
initialHistory: _initialHistory,
|
|
11304
11406
|
metadata,
|
|
11407
|
+
dictionary,
|
|
11305
11408
|
onAction,
|
|
11306
11409
|
fieldTransforms,
|
|
11307
11410
|
_experimentalFullScreenCanvas,
|
|
@@ -11399,6 +11502,7 @@ function PuckProvider({ children }) {
|
|
|
11399
11502
|
_experimentalVirtualization: !!_experimentalVirtualization,
|
|
11400
11503
|
onAction,
|
|
11401
11504
|
metadata,
|
|
11505
|
+
dictionary: dictionary || {},
|
|
11402
11506
|
fieldTransforms: loadedFieldTransforms
|
|
11403
11507
|
};
|
|
11404
11508
|
},
|
|
@@ -11414,6 +11518,7 @@ function PuckProvider({ children }) {
|
|
|
11414
11518
|
_experimentalVirtualization,
|
|
11415
11519
|
onAction,
|
|
11416
11520
|
metadata,
|
|
11521
|
+
dictionary,
|
|
11417
11522
|
loadedFieldTransforms
|
|
11418
11523
|
]
|
|
11419
11524
|
);
|
|
@@ -11468,13 +11573,29 @@ Puck.Preview = Preview2;
|
|
|
11468
11573
|
|
|
11469
11574
|
// plugins/legacy-side-bar/index.tsx
|
|
11470
11575
|
init_react_import();
|
|
11471
|
-
import { jsx as jsx57, jsxs as
|
|
11472
|
-
var
|
|
11576
|
+
import { jsx as jsx57, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
11577
|
+
var LegacySideBar = ({
|
|
11578
|
+
outlineLabel,
|
|
11579
|
+
componentsLabel
|
|
11580
|
+
}) => {
|
|
11581
|
+
const componentsLabelMessage = useMessage("plugin-components");
|
|
11582
|
+
const outlineLabelMessage = useMessage("plugin-outline");
|
|
11583
|
+
const resolvedComponentsLabel = componentsLabel != null ? componentsLabel : componentsLabelMessage;
|
|
11584
|
+
const resolvedOutlineLabel = outlineLabel != null ? outlineLabel : outlineLabelMessage;
|
|
11585
|
+
return /* @__PURE__ */ jsxs23("div", { style: { overflowY: "auto" }, children: [
|
|
11586
|
+
/* @__PURE__ */ jsx57(SidebarSection, { title: resolvedComponentsLabel, noBorderTop: true, children: /* @__PURE__ */ jsx57(Components, {}) }),
|
|
11587
|
+
/* @__PURE__ */ jsx57(SidebarSection, { title: resolvedOutlineLabel, children: /* @__PURE__ */ jsx57(Outline, {}) })
|
|
11588
|
+
] });
|
|
11589
|
+
};
|
|
11590
|
+
var legacySideBarPlugin = (props = {}) => ({
|
|
11473
11591
|
name: "legacy-side-bar",
|
|
11474
|
-
render: () => /* @__PURE__ */
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11592
|
+
render: () => /* @__PURE__ */ jsx57(
|
|
11593
|
+
LegacySideBar,
|
|
11594
|
+
{
|
|
11595
|
+
outlineLabel: props.outlineLabel,
|
|
11596
|
+
componentsLabel: props.componentsLabel
|
|
11597
|
+
}
|
|
11598
|
+
)
|
|
11478
11599
|
});
|
|
11479
11600
|
|
|
11480
11601
|
// bundle/core.ts
|