@measured/puck 0.16.1-canary.8fcf0d8 → 0.16.1-canary.ed282b9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +14 -8
- package/dist/index.js +134 -131
- package/dist/index.mjs +115 -112
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -138,7 +138,7 @@ var get_class_name_factory_default = getClassNameFactory;
|
|
|
138
138
|
|
|
139
139
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css#css-module
|
|
140
140
|
init_react_import();
|
|
141
|
-
var styles_module_default = { "ActionBar": "
|
|
141
|
+
var styles_module_default = { "ActionBar": "_ActionBar_1xlbj_1", "ActionBar-actionsLabel": "_ActionBar-actionsLabel_1xlbj_16", "ActionBar-group": "_ActionBar-group_1xlbj_29", "ActionBar-action": "_ActionBar-action_1xlbj_16" };
|
|
142
142
|
|
|
143
143
|
// components/ActionBar/index.tsx
|
|
144
144
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1339,6 +1339,9 @@ var ArrayField = ({
|
|
|
1339
1339
|
e.stopPropagation();
|
|
1340
1340
|
setHovering(false);
|
|
1341
1341
|
},
|
|
1342
|
+
onClick: (e) => {
|
|
1343
|
+
e.preventDefault();
|
|
1344
|
+
},
|
|
1342
1345
|
children: [
|
|
1343
1346
|
localState.arrayState.items.map((item, i) => {
|
|
1344
1347
|
const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
|
|
@@ -2388,13 +2391,8 @@ var isIos = () => [
|
|
|
2388
2391
|
].includes(navigator.platform) || // iPad on iOS 13 detection
|
|
2389
2392
|
navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
2390
2393
|
|
|
2391
|
-
// components/DefaultOverride/index.tsx
|
|
2392
|
-
init_react_import();
|
|
2393
|
-
import { Fragment as Fragment9, jsx as jsx22 } from "react/jsx-runtime";
|
|
2394
|
-
var DefaultOverride = ({ children }) => /* @__PURE__ */ jsx22(Fragment9, { children });
|
|
2395
|
-
|
|
2396
2394
|
// components/DraggableComponent/index.tsx
|
|
2397
|
-
import { jsx as
|
|
2395
|
+
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2398
2396
|
var getClassName17 = get_class_name_factory_default("DraggableComponent", styles_module_default11);
|
|
2399
2397
|
var space = 8;
|
|
2400
2398
|
var actionsOverlayTop = space * 6.5;
|
|
@@ -2403,7 +2401,7 @@ var actionsRight = space;
|
|
|
2403
2401
|
var DefaultActionBar = ({
|
|
2404
2402
|
label,
|
|
2405
2403
|
children
|
|
2406
|
-
}) => /* @__PURE__ */
|
|
2404
|
+
}) => /* @__PURE__ */ jsx22(ActionBar, { label, children: /* @__PURE__ */ jsx22(ActionBar.Group, { children }) });
|
|
2407
2405
|
var DraggableComponent = ({
|
|
2408
2406
|
children,
|
|
2409
2407
|
id,
|
|
@@ -2443,7 +2441,7 @@ var DraggableComponent = ({
|
|
|
2443
2441
|
const permissions = getPermissions({
|
|
2444
2442
|
item: selectedItem
|
|
2445
2443
|
});
|
|
2446
|
-
return /* @__PURE__ */
|
|
2444
|
+
return /* @__PURE__ */ jsx22(
|
|
2447
2445
|
El,
|
|
2448
2446
|
{
|
|
2449
2447
|
draggableId: id,
|
|
@@ -2473,15 +2471,15 @@ var DraggableComponent = ({
|
|
|
2473
2471
|
onClick,
|
|
2474
2472
|
children: [
|
|
2475
2473
|
debug,
|
|
2476
|
-
isLoading && /* @__PURE__ */
|
|
2477
|
-
isSelected && /* @__PURE__ */
|
|
2474
|
+
isLoading && /* @__PURE__ */ jsx22("div", { className: getClassName17("loadingOverlay"), children: /* @__PURE__ */ jsx22(Loader, {}) }),
|
|
2475
|
+
isSelected && /* @__PURE__ */ jsx22(
|
|
2478
2476
|
"div",
|
|
2479
2477
|
{
|
|
2480
2478
|
className: getClassName17("actionsOverlay"),
|
|
2481
2479
|
style: {
|
|
2482
2480
|
top: actionsOverlayTop / zoomConfig.zoom
|
|
2483
2481
|
},
|
|
2484
|
-
children: /* @__PURE__ */
|
|
2482
|
+
children: /* @__PURE__ */ jsx22(
|
|
2485
2483
|
"div",
|
|
2486
2484
|
{
|
|
2487
2485
|
className: getClassName17("actions"),
|
|
@@ -2491,15 +2489,15 @@ var DraggableComponent = ({
|
|
|
2491
2489
|
right: actionsRight / zoomConfig.zoom
|
|
2492
2490
|
},
|
|
2493
2491
|
children: /* @__PURE__ */ jsxs11(CustomActionBar, { label, children: [
|
|
2494
|
-
permissions.duplicate && /* @__PURE__ */
|
|
2495
|
-
permissions.delete && /* @__PURE__ */
|
|
2492
|
+
permissions.duplicate && /* @__PURE__ */ jsx22(ActionBar.Action, { onClick: onDuplicate, label: "Duplicate", children: /* @__PURE__ */ jsx22(Copy, { size: 16 }) }),
|
|
2493
|
+
permissions.delete && /* @__PURE__ */ jsx22(ActionBar.Action, { onClick: onDelete, label: "Delete", children: /* @__PURE__ */ jsx22(Trash, { size: 16 }) })
|
|
2496
2494
|
] })
|
|
2497
2495
|
}
|
|
2498
2496
|
)
|
|
2499
2497
|
}
|
|
2500
2498
|
),
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ jsx22("div", { className: getClassName17("overlay") }),
|
|
2500
|
+
/* @__PURE__ */ jsx22("div", { className: getClassName17("contents"), children })
|
|
2503
2501
|
]
|
|
2504
2502
|
})
|
|
2505
2503
|
)
|
|
@@ -2534,7 +2532,7 @@ var getZoneId = (zoneCompound) => {
|
|
|
2534
2532
|
};
|
|
2535
2533
|
|
|
2536
2534
|
// components/DropZone/context.tsx
|
|
2537
|
-
import { Fragment as
|
|
2535
|
+
import { Fragment as Fragment9, jsx as jsx23 } from "react/jsx-runtime";
|
|
2538
2536
|
var dropZoneContext = createContext3(null);
|
|
2539
2537
|
var DropZoneProvider = ({
|
|
2540
2538
|
children,
|
|
@@ -2612,7 +2610,7 @@ var DropZoneProvider = ({
|
|
|
2612
2610
|
[value, setPathData]
|
|
2613
2611
|
);
|
|
2614
2612
|
const [zoneWillDrag, setZoneWillDrag] = useState13("");
|
|
2615
|
-
return /* @__PURE__ */
|
|
2613
|
+
return /* @__PURE__ */ jsx23(Fragment9, { children: value && /* @__PURE__ */ jsx23(
|
|
2616
2614
|
dropZoneContext.Provider,
|
|
2617
2615
|
{
|
|
2618
2616
|
value: __spreadValues({
|
|
@@ -2638,7 +2636,7 @@ var DropZoneProvider = ({
|
|
|
2638
2636
|
};
|
|
2639
2637
|
|
|
2640
2638
|
// components/DropZone/index.tsx
|
|
2641
|
-
import { Fragment as
|
|
2639
|
+
import { Fragment as Fragment10, jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2642
2640
|
var getClassName18 = get_class_name_factory_default("DropZone", styles_module_default12);
|
|
2643
2641
|
function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
2644
2642
|
var _a;
|
|
@@ -2693,7 +2691,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
|
2693
2691
|
const draggingOverArea = userIsDragging && zoneArea === draggedSourceArea;
|
|
2694
2692
|
const draggingNewComponent = draggedSourceId == null ? void 0 : draggedSourceId.startsWith("component-list");
|
|
2695
2693
|
if (!(ctx == null ? void 0 : ctx.config) || !ctx.setHoveringArea || !ctx.setHoveringZone || !ctx.setHoveringComponent || !ctx.setItemSelector || !ctx.registerPath || !ctx.dispatch) {
|
|
2696
|
-
return /* @__PURE__ */
|
|
2694
|
+
return /* @__PURE__ */ jsx24("div", { children: "DropZone requires context to work." });
|
|
2697
2695
|
}
|
|
2698
2696
|
const {
|
|
2699
2697
|
hoveringArea = "root",
|
|
@@ -2734,7 +2732,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
|
2734
2732
|
}
|
|
2735
2733
|
const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
|
|
2736
2734
|
const isAreaSelected = selectedItem && zoneArea === selectedItem.props.id;
|
|
2737
|
-
return /* @__PURE__ */
|
|
2735
|
+
return /* @__PURE__ */ jsx24(
|
|
2738
2736
|
"div",
|
|
2739
2737
|
{
|
|
2740
2738
|
className: getClassName18({
|
|
@@ -2751,7 +2749,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
|
2751
2749
|
onMouseUp: () => {
|
|
2752
2750
|
setZoneWillDrag("");
|
|
2753
2751
|
},
|
|
2754
|
-
children: /* @__PURE__ */
|
|
2752
|
+
children: /* @__PURE__ */ jsx24(
|
|
2755
2753
|
Droppable,
|
|
2756
2754
|
{
|
|
2757
2755
|
droppableId: zoneCompound,
|
|
@@ -2806,13 +2804,13 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
|
2806
2804
|
className: getClassName18("item"),
|
|
2807
2805
|
style: { zIndex: isDragging ? 1 : void 0 },
|
|
2808
2806
|
children: [
|
|
2809
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ jsx24(
|
|
2810
2808
|
DropZoneProvider,
|
|
2811
2809
|
{
|
|
2812
2810
|
value: __spreadProps(__spreadValues({}, ctx), {
|
|
2813
2811
|
areaId: componentId
|
|
2814
2812
|
}),
|
|
2815
|
-
children: /* @__PURE__ */
|
|
2813
|
+
children: /* @__PURE__ */ jsx24(
|
|
2816
2814
|
DraggableComponent,
|
|
2817
2815
|
{
|
|
2818
2816
|
label,
|
|
@@ -2880,12 +2878,12 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
|
2880
2878
|
style: {
|
|
2881
2879
|
pointerEvents: userIsDragging && draggingNewComponent ? "all" : void 0
|
|
2882
2880
|
},
|
|
2883
|
-
children: /* @__PURE__ */
|
|
2881
|
+
children: /* @__PURE__ */ jsx24("div", { className: getClassName18("renderWrapper"), children: /* @__PURE__ */ jsx24(Render2, __spreadValues({}, defaultedProps)) })
|
|
2884
2882
|
}
|
|
2885
2883
|
)
|
|
2886
2884
|
}
|
|
2887
2885
|
),
|
|
2888
|
-
userIsDragging && /* @__PURE__ */
|
|
2886
|
+
userIsDragging && /* @__PURE__ */ jsx24(
|
|
2889
2887
|
"div",
|
|
2890
2888
|
{
|
|
2891
2889
|
className: getClassName18("hitbox"),
|
|
@@ -2902,7 +2900,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
|
2902
2900
|
);
|
|
2903
2901
|
}),
|
|
2904
2902
|
provided == null ? void 0 : provided.placeholder,
|
|
2905
|
-
(snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */
|
|
2903
|
+
(snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ jsx24(
|
|
2906
2904
|
"div",
|
|
2907
2905
|
{
|
|
2908
2906
|
"data-puck-placeholder": true,
|
|
@@ -2934,14 +2932,14 @@ function DropZoneRender({ zone }) {
|
|
|
2934
2932
|
zoneCompound = `${areaId}:${zone}`;
|
|
2935
2933
|
content = setupZone(data, zoneCompound).zones[zoneCompound];
|
|
2936
2934
|
}
|
|
2937
|
-
return /* @__PURE__ */
|
|
2935
|
+
return /* @__PURE__ */ jsx24(Fragment10, { children: content.map((item) => {
|
|
2938
2936
|
const Component = config.components[item.type];
|
|
2939
2937
|
if (Component) {
|
|
2940
|
-
return /* @__PURE__ */
|
|
2938
|
+
return /* @__PURE__ */ jsx24(
|
|
2941
2939
|
DropZoneProvider,
|
|
2942
2940
|
{
|
|
2943
2941
|
value: { data, config, areaId: item.props.id },
|
|
2944
|
-
children: /* @__PURE__ */
|
|
2942
|
+
children: /* @__PURE__ */ jsx24(
|
|
2945
2943
|
Component.render,
|
|
2946
2944
|
__spreadProps(__spreadValues({}, item.props), {
|
|
2947
2945
|
puck: { renderDropZone: DropZone }
|
|
@@ -2957,9 +2955,9 @@ function DropZoneRender({ zone }) {
|
|
|
2957
2955
|
function DropZone(props) {
|
|
2958
2956
|
const ctx = useContext3(dropZoneContext);
|
|
2959
2957
|
if ((ctx == null ? void 0 : ctx.mode) === "edit") {
|
|
2960
|
-
return /* @__PURE__ */
|
|
2958
|
+
return /* @__PURE__ */ jsx24(DropZoneEdit, __spreadValues({}, props));
|
|
2961
2959
|
}
|
|
2962
|
-
return /* @__PURE__ */
|
|
2960
|
+
return /* @__PURE__ */ jsx24(DropZoneRender, __spreadValues({}, props));
|
|
2963
2961
|
}
|
|
2964
2962
|
|
|
2965
2963
|
// components/Puck/index.tsx
|
|
@@ -3107,7 +3105,7 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
3107
3105
|
};
|
|
3108
3106
|
|
|
3109
3107
|
// components/SidebarSection/index.tsx
|
|
3110
|
-
import { jsx as
|
|
3108
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3111
3109
|
var getClassName19 = get_class_name_factory_default("SidebarSection", styles_module_default13);
|
|
3112
3110
|
var SidebarSection = ({
|
|
3113
3111
|
children,
|
|
@@ -3126,9 +3124,9 @@ var SidebarSection = ({
|
|
|
3126
3124
|
className: getClassName19({ noBorderTop, noPadding }),
|
|
3127
3125
|
style: { background },
|
|
3128
3126
|
children: [
|
|
3129
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx25("div", { className: getClassName19("title"), children: /* @__PURE__ */ jsxs13("div", { className: getClassName19("breadcrumbs"), children: [
|
|
3130
3128
|
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs13("div", { className: getClassName19("breadcrumb"), children: [
|
|
3131
|
-
/* @__PURE__ */
|
|
3129
|
+
/* @__PURE__ */ jsx25(
|
|
3132
3130
|
"button",
|
|
3133
3131
|
{
|
|
3134
3132
|
type: "button",
|
|
@@ -3137,12 +3135,12 @@ var SidebarSection = ({
|
|
|
3137
3135
|
children: breadcrumb.label
|
|
3138
3136
|
}
|
|
3139
3137
|
),
|
|
3140
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ jsx25(ChevronRight, { size: 16 })
|
|
3141
3139
|
] }, i)) : null,
|
|
3142
|
-
/* @__PURE__ */
|
|
3140
|
+
/* @__PURE__ */ jsx25("div", { className: getClassName19("heading"), children: /* @__PURE__ */ jsx25(Heading, { rank: "2", size: "xs", children: title }) })
|
|
3143
3141
|
] }) }),
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
isLoading && /* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ jsx25("div", { className: getClassName19("content"), children }),
|
|
3143
|
+
isLoading && /* @__PURE__ */ jsx25("div", { className: getClassName19("loadingOverlay"), children: /* @__PURE__ */ jsx25(Loader, { size: 32 }) })
|
|
3146
3144
|
]
|
|
3147
3145
|
}
|
|
3148
3146
|
);
|
|
@@ -3523,7 +3521,7 @@ init_react_import();
|
|
|
3523
3521
|
var styles_module_default14 = { "MenuBar": "_MenuBar_8pf8c_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_8pf8c_14", "MenuBar-inner": "_MenuBar-inner_8pf8c_29", "MenuBar-history": "_MenuBar-history_8pf8c_45" };
|
|
3524
3522
|
|
|
3525
3523
|
// components/MenuBar/index.tsx
|
|
3526
|
-
import { Fragment as
|
|
3524
|
+
import { Fragment as Fragment11, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3527
3525
|
var getClassName20 = get_class_name_factory_default("MenuBar", styles_module_default14);
|
|
3528
3526
|
function MenuBar({
|
|
3529
3527
|
appState,
|
|
@@ -3537,7 +3535,7 @@ function MenuBar({
|
|
|
3537
3535
|
history: { back, forward, historyStore }
|
|
3538
3536
|
} = useAppContext();
|
|
3539
3537
|
const { hasFuture = false, hasPast = false } = historyStore || {};
|
|
3540
|
-
return /* @__PURE__ */
|
|
3538
|
+
return /* @__PURE__ */ jsx26(
|
|
3541
3539
|
"div",
|
|
3542
3540
|
{
|
|
3543
3541
|
className: getClassName20({ menuOpen }),
|
|
@@ -3553,10 +3551,10 @@ function MenuBar({
|
|
|
3553
3551
|
},
|
|
3554
3552
|
children: /* @__PURE__ */ jsxs14("div", { className: getClassName20("inner"), children: [
|
|
3555
3553
|
/* @__PURE__ */ jsxs14("div", { className: getClassName20("history"), children: [
|
|
3556
|
-
/* @__PURE__ */
|
|
3557
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsx26(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ jsx26(Undo2, { size: 21 }) }),
|
|
3555
|
+
/* @__PURE__ */ jsx26(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ jsx26(Redo2, { size: 21 }) })
|
|
3558
3556
|
] }),
|
|
3559
|
-
/* @__PURE__ */
|
|
3557
|
+
/* @__PURE__ */ jsx26(Fragment11, { children: renderHeaderActions && renderHeaderActions({
|
|
3560
3558
|
state: appState,
|
|
3561
3559
|
dispatch
|
|
3562
3560
|
}) })
|
|
@@ -3578,7 +3576,7 @@ var styles_module_default16 = { "PuckFields": "_PuckFields_jp3lw_1", "PuckFields
|
|
|
3578
3576
|
|
|
3579
3577
|
// components/Puck/components/Fields/index.tsx
|
|
3580
3578
|
import { useCallback as useCallback7, useEffect as useEffect13, useMemo as useMemo6, useState as useState15 } from "react";
|
|
3581
|
-
import { Fragment as
|
|
3579
|
+
import { Fragment as Fragment12, jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3582
3580
|
var getClassName21 = get_class_name_factory_default("PuckFields", styles_module_default16);
|
|
3583
3581
|
var defaultPageFields = {
|
|
3584
3582
|
title: { type: "text" }
|
|
@@ -3586,7 +3584,7 @@ var defaultPageFields = {
|
|
|
3586
3584
|
var DefaultFields = ({
|
|
3587
3585
|
children
|
|
3588
3586
|
}) => {
|
|
3589
|
-
return /* @__PURE__ */
|
|
3587
|
+
return /* @__PURE__ */ jsx27(Fragment12, { children });
|
|
3590
3588
|
};
|
|
3591
3589
|
var useResolvedFields = () => {
|
|
3592
3590
|
var _a;
|
|
@@ -3673,7 +3671,7 @@ var Fields = () => {
|
|
|
3673
3671
|
e.preventDefault();
|
|
3674
3672
|
},
|
|
3675
3673
|
children: [
|
|
3676
|
-
/* @__PURE__ */
|
|
3674
|
+
/* @__PURE__ */ jsx27(Wrapper, { isLoading, itemSelector, children: Object.keys(fields).map((fieldName) => {
|
|
3677
3675
|
const field = fields[fieldName];
|
|
3678
3676
|
if (!(field == null ? void 0 : field.type)) return null;
|
|
3679
3677
|
const onChange = (value, updatedUi) => {
|
|
@@ -3743,7 +3741,7 @@ var Fields = () => {
|
|
|
3743
3741
|
const { edit } = getPermissions({
|
|
3744
3742
|
item: selectedItem
|
|
3745
3743
|
});
|
|
3746
|
-
return /* @__PURE__ */
|
|
3744
|
+
return /* @__PURE__ */ jsx27(
|
|
3747
3745
|
AutoFieldPrivate,
|
|
3748
3746
|
{
|
|
3749
3747
|
field,
|
|
@@ -3760,7 +3758,7 @@ var Fields = () => {
|
|
|
3760
3758
|
const { edit } = getPermissions({
|
|
3761
3759
|
root: true
|
|
3762
3760
|
});
|
|
3763
|
-
return /* @__PURE__ */
|
|
3761
|
+
return /* @__PURE__ */ jsx27(
|
|
3764
3762
|
AutoFieldPrivate,
|
|
3765
3763
|
{
|
|
3766
3764
|
field,
|
|
@@ -3774,7 +3772,7 @@ var Fields = () => {
|
|
|
3774
3772
|
);
|
|
3775
3773
|
}
|
|
3776
3774
|
}) }),
|
|
3777
|
-
isLoading && /* @__PURE__ */
|
|
3775
|
+
isLoading && /* @__PURE__ */ jsx27("div", { className: getClassName21("loadingOverlay"), children: /* @__PURE__ */ jsx27("div", { className: getClassName21("loadingOverlayInner"), children: /* @__PURE__ */ jsx27(Loader, { size: 16 }) }) })
|
|
3778
3776
|
]
|
|
3779
3777
|
}
|
|
3780
3778
|
);
|
|
@@ -3795,7 +3793,7 @@ init_react_import();
|
|
|
3795
3793
|
var styles_module_default17 = { "ComponentList": "_ComponentList_odh9d_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_odh9d_5", "ComponentList-content": "_ComponentList-content_odh9d_9", "ComponentList-title": "_ComponentList-title_odh9d_17", "ComponentList-titleIcon": "_ComponentList-titleIcon_odh9d_53" };
|
|
3796
3794
|
|
|
3797
3795
|
// components/ComponentList/index.tsx
|
|
3798
|
-
import { jsx as
|
|
3796
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3799
3797
|
var getClassName22 = get_class_name_factory_default("ComponentList", styles_module_default17);
|
|
3800
3798
|
var ComponentListItem = ({
|
|
3801
3799
|
name,
|
|
@@ -3806,7 +3804,7 @@ var ComponentListItem = ({
|
|
|
3806
3804
|
const canInsert = getPermissions({
|
|
3807
3805
|
type: name
|
|
3808
3806
|
}).insert;
|
|
3809
|
-
return /* @__PURE__ */
|
|
3807
|
+
return /* @__PURE__ */ jsx28(
|
|
3810
3808
|
Drawer.Item,
|
|
3811
3809
|
{
|
|
3812
3810
|
label,
|
|
@@ -3839,14 +3837,14 @@ var ComponentList = ({
|
|
|
3839
3837
|
}),
|
|
3840
3838
|
title: expanded ? `Collapse${title ? ` ${title}` : ""}` : `Expand${title ? ` ${title}` : ""}`,
|
|
3841
3839
|
children: [
|
|
3842
|
-
/* @__PURE__ */
|
|
3843
|
-
/* @__PURE__ */
|
|
3840
|
+
/* @__PURE__ */ jsx28("div", { children: title }),
|
|
3841
|
+
/* @__PURE__ */ jsx28("div", { className: getClassName22("titleIcon"), children: expanded ? /* @__PURE__ */ jsx28(ChevronUp, { size: 12 }) : /* @__PURE__ */ jsx28(ChevronDown, { size: 12 }) })
|
|
3844
3842
|
]
|
|
3845
3843
|
}
|
|
3846
3844
|
),
|
|
3847
|
-
/* @__PURE__ */
|
|
3845
|
+
/* @__PURE__ */ jsx28("div", { className: getClassName22("content"), children: /* @__PURE__ */ jsx28(Drawer, { droppableId: title, children: children || Object.keys(config.components).map((componentKey, i) => {
|
|
3848
3846
|
var _a;
|
|
3849
|
-
return /* @__PURE__ */
|
|
3847
|
+
return /* @__PURE__ */ jsx28(
|
|
3850
3848
|
ComponentListItem,
|
|
3851
3849
|
{
|
|
3852
3850
|
label: (_a = config.components[componentKey]["label"]) != null ? _a : componentKey,
|
|
@@ -3861,7 +3859,7 @@ var ComponentList = ({
|
|
|
3861
3859
|
ComponentList.Item = ComponentListItem;
|
|
3862
3860
|
|
|
3863
3861
|
// lib/use-component-list.tsx
|
|
3864
|
-
import { jsx as
|
|
3862
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3865
3863
|
var useComponentList = (config, ui) => {
|
|
3866
3864
|
const [componentList, setComponentList] = useState16();
|
|
3867
3865
|
useEffect14(() => {
|
|
@@ -3874,7 +3872,7 @@ var useComponentList = (config, ui) => {
|
|
|
3874
3872
|
if (category.visible === false || !category.components) {
|
|
3875
3873
|
return null;
|
|
3876
3874
|
}
|
|
3877
|
-
return /* @__PURE__ */
|
|
3875
|
+
return /* @__PURE__ */ jsx29(
|
|
3878
3876
|
ComponentList,
|
|
3879
3877
|
{
|
|
3880
3878
|
id: categoryKey,
|
|
@@ -3883,7 +3881,7 @@ var useComponentList = (config, ui) => {
|
|
|
3883
3881
|
var _a2;
|
|
3884
3882
|
matchedComponents.push(componentName);
|
|
3885
3883
|
const componentConf = config.components[componentName] || {};
|
|
3886
|
-
return /* @__PURE__ */
|
|
3884
|
+
return /* @__PURE__ */ jsx29(
|
|
3887
3885
|
ComponentList.Item,
|
|
3888
3886
|
{
|
|
3889
3887
|
label: (_a2 = componentConf["label"]) != null ? _a2 : componentName,
|
|
@@ -3903,7 +3901,7 @@ var useComponentList = (config, ui) => {
|
|
|
3903
3901
|
);
|
|
3904
3902
|
if (remainingComponents.length > 0 && !((_a = ui.componentList.other) == null ? void 0 : _a.components) && ((_b = ui.componentList.other) == null ? void 0 : _b.visible) !== false) {
|
|
3905
3903
|
_componentList.push(
|
|
3906
|
-
/* @__PURE__ */
|
|
3904
|
+
/* @__PURE__ */ jsx29(
|
|
3907
3905
|
ComponentList,
|
|
3908
3906
|
{
|
|
3909
3907
|
id: "other",
|
|
@@ -3911,7 +3909,7 @@ var useComponentList = (config, ui) => {
|
|
|
3911
3909
|
children: remainingComponents.map((componentName, i) => {
|
|
3912
3910
|
var _a2;
|
|
3913
3911
|
const componentConf = config.components[componentName] || {};
|
|
3914
|
-
return /* @__PURE__ */
|
|
3912
|
+
return /* @__PURE__ */ jsx29(
|
|
3915
3913
|
ComponentList.Item,
|
|
3916
3914
|
{
|
|
3917
3915
|
name: componentName,
|
|
@@ -3934,12 +3932,12 @@ var useComponentList = (config, ui) => {
|
|
|
3934
3932
|
|
|
3935
3933
|
// components/Puck/components/Components/index.tsx
|
|
3936
3934
|
import { useMemo as useMemo7 } from "react";
|
|
3937
|
-
import { jsx as
|
|
3935
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3938
3936
|
var Components = () => {
|
|
3939
3937
|
const { config, state, overrides } = useAppContext();
|
|
3940
3938
|
const componentList = useComponentList(config, state.ui);
|
|
3941
3939
|
const Wrapper = useMemo7(() => overrides.components || "div", [overrides]);
|
|
3942
|
-
return /* @__PURE__ */
|
|
3940
|
+
return /* @__PURE__ */ jsx30(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ jsx30(ComponentList, { id: "all" }) });
|
|
3943
3941
|
};
|
|
3944
3942
|
|
|
3945
3943
|
// components/Puck/components/Preview/index.tsx
|
|
@@ -3957,7 +3955,7 @@ import {
|
|
|
3957
3955
|
} from "react";
|
|
3958
3956
|
import hash from "object-hash";
|
|
3959
3957
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3960
|
-
import { Fragment as
|
|
3958
|
+
import { Fragment as Fragment13, jsx as jsx31 } from "react/jsx-runtime";
|
|
3961
3959
|
var styleSelector = 'style, link[rel="stylesheet"]';
|
|
3962
3960
|
var collectStyles = (doc) => {
|
|
3963
3961
|
const collected = [];
|
|
@@ -4157,7 +4155,7 @@ var CopyHostStyles = ({
|
|
|
4157
4155
|
observer.disconnect();
|
|
4158
4156
|
};
|
|
4159
4157
|
}, []);
|
|
4160
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ jsx31(Fragment13, { children });
|
|
4161
4159
|
};
|
|
4162
4160
|
var autoFrameContext = createContext4({});
|
|
4163
4161
|
var useFrame = () => useContext5(autoFrameContext);
|
|
@@ -4189,7 +4187,7 @@ function AutoFrame(_a) {
|
|
|
4189
4187
|
setMountTarget((_a2 = ref.current.contentDocument) == null ? void 0 : _a2.getElementById("frame-root"));
|
|
4190
4188
|
}
|
|
4191
4189
|
}, [ref, loaded]);
|
|
4192
|
-
return /* @__PURE__ */
|
|
4190
|
+
return /* @__PURE__ */ jsx31(
|
|
4193
4191
|
"iframe",
|
|
4194
4192
|
__spreadProps(__spreadValues({}, props), {
|
|
4195
4193
|
className,
|
|
@@ -4199,7 +4197,7 @@ function AutoFrame(_a) {
|
|
|
4199
4197
|
onLoad: () => {
|
|
4200
4198
|
setLoaded(true);
|
|
4201
4199
|
},
|
|
4202
|
-
children: /* @__PURE__ */
|
|
4200
|
+
children: /* @__PURE__ */ jsx31(autoFrameContext.Provider, { value: ctx, children: loaded && mountTarget && /* @__PURE__ */ jsx31(CopyHostStyles, { debug, onStylesLoaded, children: createPortal2(children, mountTarget) }) })
|
|
4203
4201
|
})
|
|
4204
4202
|
);
|
|
4205
4203
|
}
|
|
@@ -4211,7 +4209,7 @@ init_react_import();
|
|
|
4211
4209
|
var styles_module_default18 = { "PuckPreview": "_PuckPreview_rxwlr_1", "PuckPreview-frame": "_PuckPreview-frame_rxwlr_5" };
|
|
4212
4210
|
|
|
4213
4211
|
// components/Puck/components/Preview/index.tsx
|
|
4214
|
-
import { Fragment as
|
|
4212
|
+
import { Fragment as Fragment14, jsx as jsx32 } from "react/jsx-runtime";
|
|
4215
4213
|
var getClassName23 = get_class_name_factory_default("PuckPreview", styles_module_default18);
|
|
4216
4214
|
var Preview = ({ id = "puck-preview" }) => {
|
|
4217
4215
|
const { config, dispatch, state, setStatus, iframe, overrides } = useAppContext();
|
|
@@ -4220,13 +4218,13 @@ var Preview = ({ id = "puck-preview" }) => {
|
|
|
4220
4218
|
var _a, _b;
|
|
4221
4219
|
return ((_a = config.root) == null ? void 0 : _a.render) ? (_b = config.root) == null ? void 0 : _b.render(__spreadValues({
|
|
4222
4220
|
id: "puck-root"
|
|
4223
|
-
}, pageProps)) : /* @__PURE__ */
|
|
4221
|
+
}, pageProps)) : /* @__PURE__ */ jsx32(Fragment14, { children: pageProps.children });
|
|
4224
4222
|
},
|
|
4225
4223
|
[config.root]
|
|
4226
4224
|
);
|
|
4227
4225
|
const Frame = useMemo8(() => overrides.iframe, [overrides]);
|
|
4228
4226
|
const rootProps = state.data.root.props || state.data.root;
|
|
4229
|
-
return /* @__PURE__ */
|
|
4227
|
+
return /* @__PURE__ */ jsx32(
|
|
4230
4228
|
"div",
|
|
4231
4229
|
{
|
|
4232
4230
|
className: getClassName23(),
|
|
@@ -4234,7 +4232,7 @@ var Preview = ({ id = "puck-preview" }) => {
|
|
|
4234
4232
|
onClick: () => {
|
|
4235
4233
|
dispatch({ type: "setUi", ui: __spreadProps(__spreadValues({}, state.ui), { itemSelector: null }) });
|
|
4236
4234
|
},
|
|
4237
|
-
children: iframe.enabled ? /* @__PURE__ */
|
|
4235
|
+
children: iframe.enabled ? /* @__PURE__ */ jsx32(
|
|
4238
4236
|
AutoFrame_default,
|
|
4239
4237
|
{
|
|
4240
4238
|
id: "preview-frame",
|
|
@@ -4243,27 +4241,27 @@ var Preview = ({ id = "puck-preview" }) => {
|
|
|
4243
4241
|
onStylesLoaded: () => {
|
|
4244
4242
|
setStatus("READY");
|
|
4245
4243
|
},
|
|
4246
|
-
children: /* @__PURE__ */
|
|
4247
|
-
const inner = /* @__PURE__ */
|
|
4244
|
+
children: /* @__PURE__ */ jsx32(autoFrameContext.Consumer, { children: ({ document: document2 }) => {
|
|
4245
|
+
const inner = /* @__PURE__ */ jsx32(
|
|
4248
4246
|
Page,
|
|
4249
4247
|
__spreadProps(__spreadValues({}, rootProps), {
|
|
4250
4248
|
puck: { renderDropZone: DropZone, isEditing: true },
|
|
4251
4249
|
editMode: true,
|
|
4252
|
-
children: /* @__PURE__ */
|
|
4250
|
+
children: /* @__PURE__ */ jsx32(DropZone, { zone: rootDroppableId })
|
|
4253
4251
|
})
|
|
4254
4252
|
);
|
|
4255
4253
|
if (Frame) {
|
|
4256
|
-
return /* @__PURE__ */
|
|
4254
|
+
return /* @__PURE__ */ jsx32(Frame, { document: document2, children: inner });
|
|
4257
4255
|
}
|
|
4258
4256
|
return inner;
|
|
4259
4257
|
} })
|
|
4260
4258
|
}
|
|
4261
|
-
) : /* @__PURE__ */
|
|
4259
|
+
) : /* @__PURE__ */ jsx32("div", { id: "preview-frame", className: getClassName23("frame"), children: /* @__PURE__ */ jsx32(
|
|
4262
4260
|
Page,
|
|
4263
4261
|
__spreadProps(__spreadValues({}, rootProps), {
|
|
4264
4262
|
puck: { renderDropZone: DropZone, isEditing: true },
|
|
4265
4263
|
editMode: true,
|
|
4266
|
-
children: /* @__PURE__ */
|
|
4264
|
+
children: /* @__PURE__ */ jsx32(DropZone, { zone: rootDroppableId })
|
|
4267
4265
|
})
|
|
4268
4266
|
) })
|
|
4269
4267
|
}
|
|
@@ -4327,7 +4325,7 @@ var isChildOfZone = (item, maybeChild, ctx) => {
|
|
|
4327
4325
|
};
|
|
4328
4326
|
|
|
4329
4327
|
// components/LayerTree/index.tsx
|
|
4330
|
-
import { Fragment as
|
|
4328
|
+
import { Fragment as Fragment15, jsx as jsx33, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4331
4329
|
var getClassName24 = get_class_name_factory_default("LayerTree", styles_module_default19);
|
|
4332
4330
|
var getClassNameLayer = get_class_name_factory_default("Layer", styles_module_default19);
|
|
4333
4331
|
var LayerTree = ({
|
|
@@ -4341,14 +4339,14 @@ var LayerTree = ({
|
|
|
4341
4339
|
}) => {
|
|
4342
4340
|
const zones = data.zones || {};
|
|
4343
4341
|
const ctx = useContext6(dropZoneContext);
|
|
4344
|
-
return /* @__PURE__ */ jsxs17(
|
|
4342
|
+
return /* @__PURE__ */ jsxs17(Fragment15, { children: [
|
|
4345
4343
|
label && /* @__PURE__ */ jsxs17("div", { className: getClassName24("zoneTitle"), children: [
|
|
4346
|
-
/* @__PURE__ */
|
|
4344
|
+
/* @__PURE__ */ jsx33("div", { className: getClassName24("zoneIcon"), children: /* @__PURE__ */ jsx33(Layers, { size: "16" }) }),
|
|
4347
4345
|
" ",
|
|
4348
4346
|
label
|
|
4349
4347
|
] }),
|
|
4350
4348
|
/* @__PURE__ */ jsxs17("ul", { className: getClassName24(), children: [
|
|
4351
|
-
zoneContent.length === 0 && /* @__PURE__ */
|
|
4349
|
+
zoneContent.length === 0 && /* @__PURE__ */ jsx33("div", { className: getClassName24("helper"), children: "No items" }),
|
|
4352
4350
|
zoneContent.map((item, i) => {
|
|
4353
4351
|
var _a;
|
|
4354
4352
|
const isSelected = (itemSelector == null ? void 0 : itemSelector.index) === i && (itemSelector.zone === zone || itemSelector.zone === rootDroppableId && !zone);
|
|
@@ -4376,7 +4374,7 @@ var LayerTree = ({
|
|
|
4376
4374
|
childIsSelected
|
|
4377
4375
|
}),
|
|
4378
4376
|
children: [
|
|
4379
|
-
/* @__PURE__ */
|
|
4377
|
+
/* @__PURE__ */ jsx33("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ jsxs17(
|
|
4380
4378
|
"button",
|
|
4381
4379
|
{
|
|
4382
4380
|
type: "button",
|
|
@@ -4409,22 +4407,22 @@ var LayerTree = ({
|
|
|
4409
4407
|
setHoveringComponent(null);
|
|
4410
4408
|
},
|
|
4411
4409
|
children: [
|
|
4412
|
-
containsZone && /* @__PURE__ */
|
|
4410
|
+
containsZone && /* @__PURE__ */ jsx33(
|
|
4413
4411
|
"div",
|
|
4414
4412
|
{
|
|
4415
4413
|
className: getClassNameLayer("chevron"),
|
|
4416
4414
|
title: isSelected ? "Collapse" : "Expand",
|
|
4417
|
-
children: /* @__PURE__ */
|
|
4415
|
+
children: /* @__PURE__ */ jsx33(ChevronDown, { size: "12" })
|
|
4418
4416
|
}
|
|
4419
4417
|
),
|
|
4420
4418
|
/* @__PURE__ */ jsxs17("div", { className: getClassNameLayer("title"), children: [
|
|
4421
|
-
/* @__PURE__ */
|
|
4422
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ jsx33("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ jsx33(Type, { size: "16" }) : /* @__PURE__ */ jsx33(LayoutGrid, { size: "16" }) }),
|
|
4420
|
+
/* @__PURE__ */ jsx33("div", { className: getClassNameLayer("name"), children: label2 })
|
|
4423
4421
|
] })
|
|
4424
4422
|
]
|
|
4425
4423
|
}
|
|
4426
4424
|
) }),
|
|
4427
|
-
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */
|
|
4425
|
+
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ jsx33("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ jsx33(
|
|
4428
4426
|
LayerTree,
|
|
4429
4427
|
{
|
|
4430
4428
|
config,
|
|
@@ -4447,7 +4445,7 @@ var LayerTree = ({
|
|
|
4447
4445
|
|
|
4448
4446
|
// components/Puck/components/Outline/index.tsx
|
|
4449
4447
|
import { useCallback as useCallback9, useMemo as useMemo9 } from "react";
|
|
4450
|
-
import { Fragment as
|
|
4448
|
+
import { Fragment as Fragment16, jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4451
4449
|
var Outline = () => {
|
|
4452
4450
|
const { dispatch, state, overrides, config } = useAppContext();
|
|
4453
4451
|
const { data, ui } = state;
|
|
@@ -4462,8 +4460,8 @@ var Outline = () => {
|
|
|
4462
4460
|
[]
|
|
4463
4461
|
);
|
|
4464
4462
|
const Wrapper = useMemo9(() => overrides.outline || "div", [overrides]);
|
|
4465
|
-
return /* @__PURE__ */
|
|
4466
|
-
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */
|
|
4463
|
+
return /* @__PURE__ */ jsx34(Wrapper, { children: /* @__PURE__ */ jsx34(dropZoneContext.Consumer, { children: (ctx) => /* @__PURE__ */ jsxs18(Fragment16, { children: [
|
|
4464
|
+
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ jsx34(
|
|
4467
4465
|
LayerTree,
|
|
4468
4466
|
{
|
|
4469
4467
|
config,
|
|
@@ -4476,7 +4474,7 @@ var Outline = () => {
|
|
|
4476
4474
|
),
|
|
4477
4475
|
Object.entries(findZonesForArea(data, "root")).map(
|
|
4478
4476
|
([zoneKey, zone]) => {
|
|
4479
|
-
return /* @__PURE__ */
|
|
4477
|
+
return /* @__PURE__ */ jsx34(
|
|
4480
4478
|
LayerTree,
|
|
4481
4479
|
{
|
|
4482
4480
|
config,
|
|
@@ -4739,11 +4737,11 @@ init_react_import();
|
|
|
4739
4737
|
var styles_module_default20 = { "ViewportControls": "_ViewportControls_g1wgg_1", "ViewportControls-divider": "_ViewportControls-divider_g1wgg_15", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_g1wgg_21", "ViewportButton--isActive": "_ViewportButton--isActive_g1wgg_34", "ViewportButton-inner": "_ViewportButton-inner_g1wgg_34" };
|
|
4740
4738
|
|
|
4741
4739
|
// components/ViewportControls/index.tsx
|
|
4742
|
-
import { jsx as
|
|
4740
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4743
4741
|
var icons = {
|
|
4744
|
-
Smartphone: /* @__PURE__ */
|
|
4745
|
-
Tablet: /* @__PURE__ */
|
|
4746
|
-
Monitor: /* @__PURE__ */
|
|
4742
|
+
Smartphone: /* @__PURE__ */ jsx35(Smartphone, { size: 16 }),
|
|
4743
|
+
Tablet: /* @__PURE__ */ jsx35(Tablet, { size: 16 }),
|
|
4744
|
+
Monitor: /* @__PURE__ */ jsx35(Monitor, { size: 16 })
|
|
4747
4745
|
};
|
|
4748
4746
|
var getClassName25 = get_class_name_factory_default("ViewportControls", styles_module_default20);
|
|
4749
4747
|
var getClassNameButton = get_class_name_factory_default("ViewportButton", styles_module_default20);
|
|
@@ -4759,7 +4757,7 @@ var ViewportButton = ({
|
|
|
4759
4757
|
useEffect16(() => {
|
|
4760
4758
|
setIsActive(width === state.ui.viewports.current.width);
|
|
4761
4759
|
}, [width, state.ui.viewports.current.width]);
|
|
4762
|
-
return /* @__PURE__ */
|
|
4760
|
+
return /* @__PURE__ */ jsx35("span", { className: getClassNameButton({ isActive }), children: /* @__PURE__ */ jsx35(
|
|
4763
4761
|
IconButton,
|
|
4764
4762
|
{
|
|
4765
4763
|
title,
|
|
@@ -4768,7 +4766,7 @@ var ViewportButton = ({
|
|
|
4768
4766
|
e.stopPropagation();
|
|
4769
4767
|
onClick({ width, height });
|
|
4770
4768
|
},
|
|
4771
|
-
children: /* @__PURE__ */
|
|
4769
|
+
children: /* @__PURE__ */ jsx35("span", { className: getClassNameButton("inner"), children })
|
|
4772
4770
|
}
|
|
4773
4771
|
) });
|
|
4774
4772
|
};
|
|
@@ -4805,7 +4803,7 @@ var ViewportControls = ({
|
|
|
4805
4803
|
[autoZoom]
|
|
4806
4804
|
);
|
|
4807
4805
|
return /* @__PURE__ */ jsxs19("div", { className: getClassName25(), children: [
|
|
4808
|
-
viewports.map((viewport, i) => /* @__PURE__ */
|
|
4806
|
+
viewports.map((viewport, i) => /* @__PURE__ */ jsx35(
|
|
4809
4807
|
ViewportButton,
|
|
4810
4808
|
{
|
|
4811
4809
|
height: viewport.height,
|
|
@@ -4816,8 +4814,8 @@ var ViewportControls = ({
|
|
|
4816
4814
|
},
|
|
4817
4815
|
i
|
|
4818
4816
|
)),
|
|
4819
|
-
/* @__PURE__ */
|
|
4820
|
-
/* @__PURE__ */
|
|
4817
|
+
/* @__PURE__ */ jsx35("div", { className: getClassName25("divider") }),
|
|
4818
|
+
/* @__PURE__ */ jsx35(
|
|
4821
4819
|
IconButton,
|
|
4822
4820
|
{
|
|
4823
4821
|
title: "Zoom viewport out",
|
|
@@ -4831,10 +4829,10 @@ var ViewportControls = ({
|
|
|
4831
4829
|
)].value
|
|
4832
4830
|
);
|
|
4833
4831
|
},
|
|
4834
|
-
children: /* @__PURE__ */
|
|
4832
|
+
children: /* @__PURE__ */ jsx35(ZoomOut, { size: 16 })
|
|
4835
4833
|
}
|
|
4836
4834
|
),
|
|
4837
|
-
/* @__PURE__ */
|
|
4835
|
+
/* @__PURE__ */ jsx35(
|
|
4838
4836
|
IconButton,
|
|
4839
4837
|
{
|
|
4840
4838
|
title: "Zoom viewport in",
|
|
@@ -4848,11 +4846,11 @@ var ViewportControls = ({
|
|
|
4848
4846
|
)].value
|
|
4849
4847
|
);
|
|
4850
4848
|
},
|
|
4851
|
-
children: /* @__PURE__ */
|
|
4849
|
+
children: /* @__PURE__ */ jsx35(ZoomIn, { size: 16 })
|
|
4852
4850
|
}
|
|
4853
4851
|
),
|
|
4854
|
-
/* @__PURE__ */
|
|
4855
|
-
/* @__PURE__ */
|
|
4852
|
+
/* @__PURE__ */ jsx35("div", { className: getClassName25("divider") }),
|
|
4853
|
+
/* @__PURE__ */ jsx35(
|
|
4856
4854
|
"select",
|
|
4857
4855
|
{
|
|
4858
4856
|
className: getClassName25("zoomSelect"),
|
|
@@ -4860,7 +4858,7 @@ var ViewportControls = ({
|
|
|
4860
4858
|
onChange: (e) => {
|
|
4861
4859
|
onZoom(parseFloat(e.currentTarget.value));
|
|
4862
4860
|
},
|
|
4863
|
-
children: zoomOptions.map((option) => /* @__PURE__ */
|
|
4861
|
+
children: zoomOptions.map((option) => /* @__PURE__ */ jsx35(
|
|
4864
4862
|
"option",
|
|
4865
4863
|
{
|
|
4866
4864
|
value: option.value,
|
|
@@ -4908,7 +4906,7 @@ var getZoomConfig = (uiViewport, frame, zoom) => {
|
|
|
4908
4906
|
};
|
|
4909
4907
|
|
|
4910
4908
|
// components/Puck/components/Canvas/index.tsx
|
|
4911
|
-
import { Fragment as
|
|
4909
|
+
import { Fragment as Fragment17, jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4912
4910
|
var getClassName26 = get_class_name_factory_default("PuckCanvas", styles_module_default21);
|
|
4913
4911
|
var ZOOM_ON_CHANGE = true;
|
|
4914
4912
|
var Canvas = () => {
|
|
@@ -4918,7 +4916,7 @@ var Canvas = () => {
|
|
|
4918
4916
|
const frameRef = useRef3(null);
|
|
4919
4917
|
const [showTransition, setShowTransition] = useState20(false);
|
|
4920
4918
|
const defaultRender = useMemo11(() => {
|
|
4921
|
-
const PuckDefault = ({ children }) => /* @__PURE__ */
|
|
4919
|
+
const PuckDefault = ({ children }) => /* @__PURE__ */ jsx36(Fragment17, { children });
|
|
4922
4920
|
return PuckDefault;
|
|
4923
4921
|
}, []);
|
|
4924
4922
|
const CustomPreview = useMemo11(
|
|
@@ -4992,7 +4990,7 @@ var Canvas = () => {
|
|
|
4992
4990
|
recordHistory: true
|
|
4993
4991
|
}),
|
|
4994
4992
|
children: [
|
|
4995
|
-
ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */
|
|
4993
|
+
ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ jsx36("div", { className: getClassName26("controls"), children: /* @__PURE__ */ jsx36(
|
|
4996
4994
|
ViewportControls,
|
|
4997
4995
|
{
|
|
4998
4996
|
autoZoom: zoomConfig.autoZoom,
|
|
@@ -5018,7 +5016,7 @@ var Canvas = () => {
|
|
|
5018
5016
|
}
|
|
5019
5017
|
) }),
|
|
5020
5018
|
/* @__PURE__ */ jsxs20("div", { className: getClassName26("inner"), ref: frameRef, children: [
|
|
5021
|
-
/* @__PURE__ */
|
|
5019
|
+
/* @__PURE__ */ jsx36(
|
|
5022
5020
|
"div",
|
|
5023
5021
|
{
|
|
5024
5022
|
className: getClassName26("root"),
|
|
@@ -5030,10 +5028,10 @@ var Canvas = () => {
|
|
|
5030
5028
|
overflow: iframe.enabled ? void 0 : "auto"
|
|
5031
5029
|
},
|
|
5032
5030
|
suppressHydrationWarning: true,
|
|
5033
|
-
children: /* @__PURE__ */
|
|
5031
|
+
children: /* @__PURE__ */ jsx36(CustomPreview, { children: /* @__PURE__ */ jsx36(Preview, {}) })
|
|
5034
5032
|
}
|
|
5035
5033
|
),
|
|
5036
|
-
/* @__PURE__ */
|
|
5034
|
+
/* @__PURE__ */ jsx36("div", { className: getClassName26("loader"), children: /* @__PURE__ */ jsx36(Loader, { size: 24 }) })
|
|
5037
5035
|
] })
|
|
5038
5036
|
]
|
|
5039
5037
|
}
|
|
@@ -5121,6 +5119,11 @@ var useLoadedOverrides = ({
|
|
|
5121
5119
|
}, [plugins, overrides]);
|
|
5122
5120
|
};
|
|
5123
5121
|
|
|
5122
|
+
// components/DefaultOverride/index.tsx
|
|
5123
|
+
init_react_import();
|
|
5124
|
+
import { Fragment as Fragment18, jsx as jsx37 } from "react/jsx-runtime";
|
|
5125
|
+
var DefaultOverride = ({ children }) => /* @__PURE__ */ jsx37(Fragment18, { children });
|
|
5126
|
+
|
|
5124
5127
|
// components/Puck/index.tsx
|
|
5125
5128
|
import { Fragment as Fragment19, jsx as jsx38, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5126
5129
|
var getClassName27 = get_class_name_factory_default("Puck", styles_module_default15);
|