@measured/puck 0.16.0-canary.7c79787 → 0.16.0-canary.a43914d
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/{Config-VOJqVbHe.d.ts → Config-B7UadvMA.d.ts} +7 -1
- package/dist/index.css +73 -67
- package/dist/index.d.ts +33 -5
- package/dist/index.js +612 -518
- package/dist/rsc.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -7536,7 +7536,7 @@ var require_react_dom_development = __commonJS({
|
|
7536
7536
|
var HostPortal = 4;
|
7537
7537
|
var HostComponent = 5;
|
7538
7538
|
var HostText = 6;
|
7539
|
-
var
|
7539
|
+
var Fragment20 = 7;
|
7540
7540
|
var Mode = 8;
|
7541
7541
|
var ContextConsumer = 9;
|
7542
7542
|
var ContextProvider = 10;
|
@@ -8692,7 +8692,7 @@ var require_react_dom_development = __commonJS({
|
|
8692
8692
|
return "DehydratedFragment";
|
8693
8693
|
case ForwardRef:
|
8694
8694
|
return getWrappedName$1(type, type.render, "ForwardRef");
|
8695
|
-
case
|
8695
|
+
case Fragment20:
|
8696
8696
|
return "Fragment";
|
8697
8697
|
case HostComponent:
|
8698
8698
|
return type;
|
@@ -18343,7 +18343,7 @@ var require_react_dom_development = __commonJS({
|
|
18343
18343
|
}
|
18344
18344
|
}
|
18345
18345
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
18346
|
-
if (current2 === null || current2.tag !==
|
18346
|
+
if (current2 === null || current2.tag !== Fragment20) {
|
18347
18347
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
18348
18348
|
created.return = returnFiber;
|
18349
18349
|
return created;
|
@@ -18746,7 +18746,7 @@ var require_react_dom_development = __commonJS({
|
|
18746
18746
|
if (child.key === key) {
|
18747
18747
|
var elementType = element.type;
|
18748
18748
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
18749
|
-
if (child.tag ===
|
18749
|
+
if (child.tag === Fragment20) {
|
18750
18750
|
deleteRemainingChildren(returnFiber, child.sibling);
|
18751
18751
|
var existing = useFiber(child, element.props.children);
|
18752
18752
|
existing.return = returnFiber;
|
@@ -22921,7 +22921,7 @@ var require_react_dom_development = __commonJS({
|
|
22921
22921
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
22922
22922
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
22923
22923
|
}
|
22924
|
-
case
|
22924
|
+
case Fragment20:
|
22925
22925
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
22926
22926
|
case Mode:
|
22927
22927
|
return updateMode(current2, workInProgress2, renderLanes2);
|
@@ -23193,7 +23193,7 @@ var require_react_dom_development = __commonJS({
|
|
23193
23193
|
case SimpleMemoComponent:
|
23194
23194
|
case FunctionComponent:
|
23195
23195
|
case ForwardRef:
|
23196
|
-
case
|
23196
|
+
case Fragment20:
|
23197
23197
|
case Mode:
|
23198
23198
|
case Profiler:
|
23199
23199
|
case ContextConsumer:
|
@@ -27444,7 +27444,7 @@ var require_react_dom_development = __commonJS({
|
|
27444
27444
|
return fiber;
|
27445
27445
|
}
|
27446
27446
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
27447
|
-
var fiber = createFiber(
|
27447
|
+
var fiber = createFiber(Fragment20, elements, key, mode);
|
27448
27448
|
fiber.lanes = lanes;
|
27449
27449
|
return fiber;
|
27450
27450
|
}
|
@@ -28567,6 +28567,8 @@ var require_react_dom = __commonJS({
|
|
28567
28567
|
// index.ts
|
28568
28568
|
var core_exports = {};
|
28569
28569
|
__export(core_exports, {
|
28570
|
+
Action: () => Action,
|
28571
|
+
ActionBar: () => ActionBar,
|
28570
28572
|
AutoField: () => AutoField,
|
28571
28573
|
AutoFieldPrivate: () => AutoFieldPrivate,
|
28572
28574
|
Button: () => Button,
|
@@ -28596,7 +28598,7 @@ init_react_import();
|
|
28596
28598
|
// types/Fields.ts
|
28597
28599
|
init_react_import();
|
28598
28600
|
|
28599
|
-
// components/
|
28601
|
+
// components/ActionBar/index.tsx
|
28600
28602
|
init_react_import();
|
28601
28603
|
|
28602
28604
|
// lib/get-class-name-factory.ts
|
@@ -28631,9 +28633,33 @@ var getClassNameFactory = (rootClass, styles, { baseClass = "" } = {}) => (optio
|
|
28631
28633
|
};
|
28632
28634
|
var get_class_name_factory_default = getClassNameFactory;
|
28633
28635
|
|
28636
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css#css-module
|
28637
|
+
init_react_import();
|
28638
|
+
var styles_module_default = { "ActionBarComponent": "_ActionBarComponent_16pc9_1", "ActionBarComponent-actionsLabel": "_ActionBarComponent-actionsLabel_16pc9_14", "ActionBarComponent-action": "_ActionBarComponent-action_16pc9_14" };
|
28639
|
+
|
28640
|
+
// components/ActionBar/index.tsx
|
28641
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
28642
|
+
var getClassName = get_class_name_factory_default("ActionBarComponent", styles_module_default);
|
28643
|
+
var ActionBar = ({
|
28644
|
+
label,
|
28645
|
+
children
|
28646
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: getClassName(), children: [
|
28647
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassName("actionsLabel"), children: label }),
|
28648
|
+
children
|
28649
|
+
] });
|
28650
|
+
var Action = ({
|
28651
|
+
children,
|
28652
|
+
label,
|
28653
|
+
onClick
|
28654
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: getClassName("action"), onClick, title: label, children });
|
28655
|
+
ActionBar.Action = Action;
|
28656
|
+
|
28657
|
+
// components/AutoField/index.tsx
|
28658
|
+
init_react_import();
|
28659
|
+
|
28634
28660
|
// css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/styles.module.css#css-module
|
28635
28661
|
init_react_import();
|
28636
|
-
var
|
28662
|
+
var styles_module_default2 = { "Input": "_Input_3pq3z_1", "Input-label": "_Input-label_3pq3z_26", "Input-labelIcon": "_Input-labelIcon_3pq3z_35", "Input-disabledIcon": "_Input-disabledIcon_3pq3z_42", "Input-input": "_Input-input_3pq3z_47", "Input--readOnly": "_Input--readOnly_3pq3z_91", "Input-radioGroupItems": "_Input-radioGroupItems_3pq3z_102", "Input-radio": "_Input-radio_3pq3z_102", "Input-radioInner": "_Input-radioInner_3pq3z_119", "Input-radioInput": "_Input-radioInput_3pq3z_164" };
|
28637
28663
|
|
28638
28664
|
// components/AutoField/index.tsx
|
28639
28665
|
var import_react11 = require("react");
|
@@ -28646,7 +28672,7 @@ init_react_import();
|
|
28646
28672
|
|
28647
28673
|
// css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/fields/ArrayField/styles.module.css#css-module
|
28648
28674
|
init_react_import();
|
28649
|
-
var
|
28675
|
+
var styles_module_default3 = { "ArrayField": "_ArrayField_1go19_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_1go19_13", "ArrayField-addButton": "_ArrayField-addButton_1go19_18", "ArrayField--hasItems": "_ArrayField--hasItems_1go19_33", "ArrayFieldItem": "_ArrayFieldItem_1go19_63", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_1go19_71", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_1go19_81", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_1go19_97", "ArrayField--addDisabled": "_ArrayField--addDisabled_1go19_128", "ArrayFieldItem-body": "_ArrayFieldItem-body_1go19_164", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_1go19_173", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_1go19_181", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_1go19_187" };
|
28650
28676
|
|
28651
28677
|
// ../../node_modules/lucide-react/dist/esm/lucide-react.js
|
28652
28678
|
init_react_import();
|
@@ -28958,11 +28984,11 @@ var replace = (list, index, newItem) => {
|
|
28958
28984
|
|
28959
28985
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
|
28960
28986
|
init_react_import();
|
28961
|
-
var
|
28987
|
+
var styles_module_default4 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
|
28962
28988
|
|
28963
28989
|
// components/Loader/index.tsx
|
28964
|
-
var
|
28965
|
-
var
|
28990
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
28991
|
+
var getClassName2 = get_class_name_factory_default("Loader", styles_module_default4);
|
28966
28992
|
var Loader = (_a) => {
|
28967
28993
|
var _b = _a, {
|
28968
28994
|
color,
|
@@ -28971,10 +28997,10 @@ var Loader = (_a) => {
|
|
28971
28997
|
"color",
|
28972
28998
|
"size"
|
28973
28999
|
]);
|
28974
|
-
return /* @__PURE__ */ (0,
|
29000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
28975
29001
|
"span",
|
28976
29002
|
__spreadValues({
|
28977
|
-
className:
|
29003
|
+
className: getClassName2(),
|
28978
29004
|
style: {
|
28979
29005
|
width: size,
|
28980
29006
|
height: size,
|
@@ -28986,8 +29012,8 @@ var Loader = (_a) => {
|
|
28986
29012
|
};
|
28987
29013
|
|
28988
29014
|
// components/IconButton/IconButton.tsx
|
28989
|
-
var
|
28990
|
-
var
|
29015
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
29016
|
+
var getClassName3 = get_class_name_factory_default("IconButton", IconButton_module_default);
|
28991
29017
|
var IconButton = ({
|
28992
29018
|
children,
|
28993
29019
|
href,
|
@@ -29002,10 +29028,10 @@ var IconButton = ({
|
|
29002
29028
|
}) => {
|
29003
29029
|
const [loading, setLoading] = (0, import_react3.useState)(false);
|
29004
29030
|
const ElementType = href ? "a" : "button";
|
29005
|
-
const el = /* @__PURE__ */ (0,
|
29031
|
+
const el = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
29006
29032
|
ElementType,
|
29007
29033
|
{
|
29008
|
-
className:
|
29034
|
+
className: getClassName3({
|
29009
29035
|
primary: variant === "primary",
|
29010
29036
|
secondary: variant === "secondary",
|
29011
29037
|
disabled,
|
@@ -29026,11 +29052,11 @@ var IconButton = ({
|
|
29026
29052
|
href,
|
29027
29053
|
title,
|
29028
29054
|
children: [
|
29029
|
-
/* @__PURE__ */ (0,
|
29055
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: getClassName3("title"), children: title }),
|
29030
29056
|
children,
|
29031
|
-
loading && /* @__PURE__ */ (0,
|
29057
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
29032
29058
|
"\xA0\xA0",
|
29033
|
-
/* @__PURE__ */ (0,
|
29059
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Loader, { size: 14 })
|
29034
29060
|
] })
|
29035
29061
|
]
|
29036
29062
|
}
|
@@ -29085,7 +29111,7 @@ var defaultViewports = [
|
|
29085
29111
|
|
29086
29112
|
// components/Puck/context.tsx
|
29087
29113
|
var import_ua_parser_js = require("ua-parser-js");
|
29088
|
-
var
|
29114
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
29089
29115
|
var defaultAppState = {
|
29090
29116
|
data: { content: [], root: { props: {} } },
|
29091
29117
|
ui: {
|
@@ -29125,7 +29151,8 @@ var defaultContext = {
|
|
29125
29151
|
status: "LOADING",
|
29126
29152
|
setStatus: () => null,
|
29127
29153
|
iframe: {},
|
29128
|
-
safariFallbackMode: false
|
29154
|
+
safariFallbackMode: false,
|
29155
|
+
globalPermissions: {}
|
29129
29156
|
};
|
29130
29157
|
var appContext = (0, import_react4.createContext)(defaultContext);
|
29131
29158
|
var AppProvider = ({
|
@@ -29155,7 +29182,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
29155
29182
|
setSafariFallbackMode(true);
|
29156
29183
|
}
|
29157
29184
|
}, []);
|
29158
|
-
return /* @__PURE__ */ (0,
|
29185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
29159
29186
|
appContext.Provider,
|
29160
29187
|
{
|
29161
29188
|
value: __spreadProps(__spreadValues({}, value), {
|
@@ -29186,7 +29213,7 @@ function useAppContext() {
|
|
29186
29213
|
}
|
29187
29214
|
|
29188
29215
|
// components/Droppable/index.tsx
|
29189
|
-
var
|
29216
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
29190
29217
|
var defaultProvided = {
|
29191
29218
|
droppableProps: {
|
29192
29219
|
"data-rfd-droppable-context-id": "",
|
@@ -29201,17 +29228,17 @@ var defaultSnapshot = {
|
|
29201
29228
|
draggingFromThisWith: null,
|
29202
29229
|
isUsingPlaceholder: false
|
29203
29230
|
};
|
29204
|
-
var DefaultDroppable = ({ children }) => /* @__PURE__ */ (0,
|
29231
|
+
var DefaultDroppable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: children(defaultProvided, defaultSnapshot) });
|
29205
29232
|
var Droppable = (props) => {
|
29206
29233
|
const { status } = useAppContext();
|
29207
29234
|
const El = status !== "LOADING" ? import_dnd.Droppable : DefaultDroppable;
|
29208
|
-
return /* @__PURE__ */ (0,
|
29235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(El, __spreadValues({}, props));
|
29209
29236
|
};
|
29210
29237
|
|
29211
29238
|
// components/Draggable/index.tsx
|
29212
29239
|
init_react_import();
|
29213
29240
|
var import_dnd2 = require("@measured/dnd");
|
29214
|
-
var
|
29241
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
29215
29242
|
var defaultProvided2 = {
|
29216
29243
|
draggableProps: {
|
29217
29244
|
"data-rfd-draggable-context-id": "",
|
@@ -29235,7 +29262,7 @@ var defaultRubric = {
|
|
29235
29262
|
type: "",
|
29236
29263
|
source: { droppableId: "", index: 0 }
|
29237
29264
|
};
|
29238
|
-
var DefaultDraggable = ({ children }) => /* @__PURE__ */ (0,
|
29265
|
+
var DefaultDraggable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: children(defaultProvided2, defaultSnapshot2, defaultRubric) });
|
29239
29266
|
var Draggable = ({
|
29240
29267
|
className,
|
29241
29268
|
children,
|
@@ -29247,10 +29274,10 @@ var Draggable = ({
|
|
29247
29274
|
}) => {
|
29248
29275
|
const { status } = useAppContext();
|
29249
29276
|
const El = status !== "LOADING" ? import_dnd2.Draggable : DefaultDraggable;
|
29250
|
-
return /* @__PURE__ */ (0,
|
29277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(El, { draggableId: id, index, isDragDisabled, children: (provided, snapshot) => {
|
29251
29278
|
var _a;
|
29252
|
-
return /* @__PURE__ */ (0,
|
29253
|
-
/* @__PURE__ */ (0,
|
29279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
29280
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
29254
29281
|
"div",
|
29255
29282
|
__spreadProps(__spreadValues(__spreadValues({
|
29256
29283
|
className: className && className(provided, snapshot),
|
@@ -29262,7 +29289,7 @@ var Draggable = ({
|
|
29262
29289
|
children: children(provided, snapshot)
|
29263
29290
|
})
|
29264
29291
|
),
|
29265
|
-
showShadow && snapshot.isDragging && /* @__PURE__ */ (0,
|
29292
|
+
showShadow && snapshot.isDragging && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
29266
29293
|
"div",
|
29267
29294
|
{
|
29268
29295
|
className: className && className(provided, snapshot),
|
@@ -29282,28 +29309,28 @@ init_react_import();
|
|
29282
29309
|
|
29283
29310
|
// css-module:/home/runner/work/puck/puck/packages/core/components/DragIcon/styles.module.css#css-module
|
29284
29311
|
init_react_import();
|
29285
|
-
var
|
29312
|
+
var styles_module_default5 = { "DragIcon": "_DragIcon_1p5wn_1" };
|
29286
29313
|
|
29287
29314
|
// components/DragIcon/index.tsx
|
29288
|
-
var
|
29289
|
-
var
|
29290
|
-
var DragIcon = () => /* @__PURE__ */ (0,
|
29315
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
29316
|
+
var getClassName4 = get_class_name_factory_default("DragIcon", styles_module_default5);
|
29317
|
+
var DragIcon = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassName4(), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { viewBox: "0 0 20 20", width: "12", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" }) }) });
|
29291
29318
|
|
29292
29319
|
// components/DragDropContext/index.tsx
|
29293
29320
|
init_react_import();
|
29294
29321
|
var import_dnd3 = require("@measured/dnd");
|
29295
|
-
var
|
29296
|
-
var DefaultDragDropContext = ({ children }) => /* @__PURE__ */ (0,
|
29322
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
29323
|
+
var DefaultDragDropContext = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
|
29297
29324
|
var DragDropContext = (props) => {
|
29298
29325
|
const { status } = useAppContext();
|
29299
29326
|
const El = status !== "LOADING" ? import_dnd3.DragDropContext : DefaultDragDropContext;
|
29300
|
-
return /* @__PURE__ */ (0,
|
29327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(El, __spreadValues({}, props));
|
29301
29328
|
};
|
29302
29329
|
|
29303
29330
|
// components/AutoField/fields/ArrayField/index.tsx
|
29304
|
-
var
|
29305
|
-
var
|
29306
|
-
var getClassNameItem = get_class_name_factory_default("ArrayFieldItem",
|
29331
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
29332
|
+
var getClassName5 = get_class_name_factory_default("ArrayField", styles_module_default3);
|
29333
|
+
var getClassNameItem = get_class_name_factory_default("ArrayFieldItem", styles_module_default3);
|
29307
29334
|
var ArrayField = ({
|
29308
29335
|
field,
|
29309
29336
|
onChange,
|
@@ -29312,7 +29339,7 @@ var ArrayField = ({
|
|
29312
29339
|
label,
|
29313
29340
|
readOnly,
|
29314
29341
|
id,
|
29315
|
-
Label = (props) => /* @__PURE__ */ (0,
|
29342
|
+
Label = (props) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", __spreadValues({}, props))
|
29316
29343
|
}) => {
|
29317
29344
|
const { state, setUi, selectedItem } = useAppContext();
|
29318
29345
|
const readOnlyFields = (selectedItem == null ? void 0 : selectedItem.readOnly) || {};
|
@@ -29375,14 +29402,14 @@ var ArrayField = ({
|
|
29375
29402
|
return null;
|
29376
29403
|
}
|
29377
29404
|
const addDisabled = field.max !== void 0 && localState.arrayState.items.length >= field.max || readOnly;
|
29378
|
-
return /* @__PURE__ */ (0,
|
29405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
29379
29406
|
Label,
|
29380
29407
|
{
|
29381
29408
|
label: label || name,
|
29382
|
-
icon: /* @__PURE__ */ (0,
|
29409
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(List, { size: 16 }),
|
29383
29410
|
el: "div",
|
29384
29411
|
readOnly,
|
29385
|
-
children: /* @__PURE__ */ (0,
|
29412
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
29386
29413
|
DragDropContext,
|
29387
29414
|
{
|
29388
29415
|
onDragEnd: (event) => {
|
@@ -29409,12 +29436,12 @@ var ArrayField = ({
|
|
29409
29436
|
});
|
29410
29437
|
}
|
29411
29438
|
},
|
29412
|
-
children: /* @__PURE__ */ (0,
|
29413
|
-
return /* @__PURE__ */ (0,
|
29439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Droppable, { droppableId: "array", isDropDisabled: readOnly, children: (provided, snapshot) => {
|
29440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
29414
29441
|
"div",
|
29415
29442
|
__spreadProps(__spreadValues({}, provided.droppableProps), {
|
29416
29443
|
ref: provided.innerRef,
|
29417
|
-
className:
|
29444
|
+
className: getClassName5({
|
29418
29445
|
isDraggingFrom: !!snapshot.draggingFromThisWith,
|
29419
29446
|
hasItems: Array.isArray(value) && value.length > 0,
|
29420
29447
|
addDisabled
|
@@ -29431,7 +29458,7 @@ var ArrayField = ({
|
|
29431
29458
|
localState.arrayState.items.map((item, i) => {
|
29432
29459
|
const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
|
29433
29460
|
const data = Array.from(localState.value || [])[i] || {};
|
29434
|
-
return /* @__PURE__ */ (0,
|
29461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
29435
29462
|
Draggable,
|
29436
29463
|
{
|
29437
29464
|
id: _arrayId,
|
@@ -29442,8 +29469,8 @@ var ArrayField = ({
|
|
29442
29469
|
readOnly
|
29443
29470
|
}),
|
29444
29471
|
isDragDisabled: readOnly || !hovering,
|
29445
|
-
children: () => /* @__PURE__ */ (0,
|
29446
|
-
/* @__PURE__ */ (0,
|
29472
|
+
children: () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
29473
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
29447
29474
|
"div",
|
29448
29475
|
{
|
29449
29476
|
onClick: () => {
|
@@ -29464,8 +29491,8 @@ var ArrayField = ({
|
|
29464
29491
|
className: getClassNameItem("summary"),
|
29465
29492
|
children: [
|
29466
29493
|
field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
|
29467
|
-
/* @__PURE__ */ (0,
|
29468
|
-
!readOnly && /* @__PURE__ */ (0,
|
29494
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("rhs"), children: [
|
29495
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
29469
29496
|
IconButton,
|
29470
29497
|
{
|
29471
29498
|
type: "button",
|
@@ -29488,20 +29515,20 @@ var ArrayField = ({
|
|
29488
29515
|
);
|
29489
29516
|
},
|
29490
29517
|
title: "Delete",
|
29491
|
-
children: /* @__PURE__ */ (0,
|
29518
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
|
29492
29519
|
}
|
29493
29520
|
) }) }),
|
29494
|
-
/* @__PURE__ */ (0,
|
29521
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DragIcon, {}) })
|
29495
29522
|
] })
|
29496
29523
|
]
|
29497
29524
|
}
|
29498
29525
|
),
|
29499
|
-
/* @__PURE__ */ (0,
|
29526
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map(
|
29500
29527
|
(fieldName) => {
|
29501
29528
|
const subField = field.arrayFields[fieldName];
|
29502
29529
|
const subFieldName = `${name}[${i}].${fieldName}`;
|
29503
29530
|
const wildcardFieldName = `${name}[*].${fieldName}`;
|
29504
|
-
return /* @__PURE__ */ (0,
|
29531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
29505
29532
|
AutoFieldPrivate,
|
29506
29533
|
{
|
29507
29534
|
name: subFieldName,
|
@@ -29529,11 +29556,11 @@ var ArrayField = ({
|
|
29529
29556
|
);
|
29530
29557
|
}),
|
29531
29558
|
provided.placeholder,
|
29532
|
-
!addDisabled && /* @__PURE__ */ (0,
|
29559
|
+
!addDisabled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
29533
29560
|
"button",
|
29534
29561
|
{
|
29535
29562
|
type: "button",
|
29536
|
-
className:
|
29563
|
+
className: getClassName5("addButton"),
|
29537
29564
|
onClick: () => {
|
29538
29565
|
const existingValue = value || [];
|
29539
29566
|
const newValue = [
|
@@ -29543,7 +29570,7 @@ var ArrayField = ({
|
|
29543
29570
|
const newArrayState = regenerateArrayState(newValue);
|
29544
29571
|
onChange(newValue, mapArrayStateToUi(newArrayState));
|
29545
29572
|
},
|
29546
|
-
children: /* @__PURE__ */ (0,
|
29573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Plus, { size: 21 })
|
29547
29574
|
}
|
29548
29575
|
)
|
29549
29576
|
]
|
@@ -29558,8 +29585,8 @@ var ArrayField = ({
|
|
29558
29585
|
|
29559
29586
|
// components/AutoField/fields/DefaultField/index.tsx
|
29560
29587
|
init_react_import();
|
29561
|
-
var
|
29562
|
-
var
|
29588
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
29589
|
+
var getClassName6 = get_class_name_factory_default("Input", styles_module_default2);
|
29563
29590
|
var DefaultField = ({
|
29564
29591
|
field,
|
29565
29592
|
onChange,
|
@@ -29570,19 +29597,19 @@ var DefaultField = ({
|
|
29570
29597
|
Label,
|
29571
29598
|
id
|
29572
29599
|
}) => {
|
29573
|
-
return /* @__PURE__ */ (0,
|
29600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
29574
29601
|
Label,
|
29575
29602
|
{
|
29576
29603
|
label: label || name,
|
29577
|
-
icon: /* @__PURE__ */ (0,
|
29578
|
-
field.type === "text" && /* @__PURE__ */ (0,
|
29579
|
-
field.type === "number" && /* @__PURE__ */ (0,
|
29604
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
29605
|
+
field.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Type, { size: 16 }),
|
29606
|
+
field.type === "number" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Hash, { size: 16 })
|
29580
29607
|
] }),
|
29581
29608
|
readOnly,
|
29582
|
-
children: /* @__PURE__ */ (0,
|
29609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
29583
29610
|
"input",
|
29584
29611
|
{
|
29585
|
-
className:
|
29612
|
+
className: getClassName6("input"),
|
29586
29613
|
autoComplete: "off",
|
29587
29614
|
type: field.type,
|
29588
29615
|
name,
|
@@ -29615,7 +29642,7 @@ var import_react8 = require("react");
|
|
29615
29642
|
|
29616
29643
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
|
29617
29644
|
init_react_import();
|
29618
|
-
var
|
29645
|
+
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_19obq_1", "ExternalInput-button": "_ExternalInput-button_19obq_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_19obq_25", "ExternalInput-detachButton": "_ExternalInput-detachButton_19obq_32", "ExternalInputModal": "_ExternalInputModal_19obq_74", "ExternalInputModal-grid": "_ExternalInputModal-grid_19obq_84", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_19obq_95", "ExternalInputModal-filters": "_ExternalInputModal-filters_19obq_100", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_19obq_119", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_19obq_128", "ExternalInputModal-table": "_ExternalInputModal-table_19obq_128", "ExternalInputModal-thead": "_ExternalInputModal-thead_19obq_144", "ExternalInputModal-th": "_ExternalInputModal-th_19obq_144", "ExternalInputModal-td": "_ExternalInputModal-td_19obq_159", "ExternalInputModal-tr": "_ExternalInputModal-tr_19obq_164", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_19obq_171", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_19obq_197", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_19obq_201", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_19obq_218", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_19obq_222", "ExternalInputModal-search": "_ExternalInputModal-search_19obq_222", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_19obq_259", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_19obq_284", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_19obq_294", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_19obq_308", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_19obq_321", "ExternalInputModal-footer": "_ExternalInputModal-footer_19obq_325" };
|
29619
29646
|
|
29620
29647
|
// components/Modal/index.tsx
|
29621
29648
|
init_react_import();
|
@@ -29623,12 +29650,12 @@ var import_react6 = require("react");
|
|
29623
29650
|
|
29624
29651
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Modal/styles.module.css#css-module
|
29625
29652
|
init_react_import();
|
29626
|
-
var
|
29653
|
+
var styles_module_default7 = { "Modal": "_Modal_ikbaj_1", "Modal--isOpen": "_Modal--isOpen_ikbaj_15", "Modal-inner": "_Modal-inner_ikbaj_19" };
|
29627
29654
|
|
29628
29655
|
// components/Modal/index.tsx
|
29629
29656
|
var import_react_dom = __toESM(require_react_dom());
|
29630
|
-
var
|
29631
|
-
var
|
29657
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
29658
|
+
var getClassName7 = get_class_name_factory_default("Modal", styles_module_default7);
|
29632
29659
|
var Modal = ({
|
29633
29660
|
children,
|
29634
29661
|
onClose,
|
@@ -29639,13 +29666,13 @@ var Modal = ({
|
|
29639
29666
|
setRootEl(document.getElementById("puck-portal-root"));
|
29640
29667
|
}, []);
|
29641
29668
|
if (!rootEl) {
|
29642
|
-
return /* @__PURE__ */ (0,
|
29669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {});
|
29643
29670
|
}
|
29644
29671
|
return (0, import_react_dom.createPortal)(
|
29645
|
-
/* @__PURE__ */ (0,
|
29672
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: getClassName7({ isOpen }), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
29646
29673
|
"div",
|
29647
29674
|
{
|
29648
|
-
className:
|
29675
|
+
className: getClassName7("inner"),
|
29649
29676
|
onClick: (e) => e.stopPropagation(),
|
29650
29677
|
children
|
29651
29678
|
}
|
@@ -29659,17 +29686,17 @@ init_react_import();
|
|
29659
29686
|
|
29660
29687
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
|
29661
29688
|
init_react_import();
|
29662
|
-
var
|
29689
|
+
var styles_module_default8 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
|
29663
29690
|
|
29664
29691
|
// components/Heading/index.tsx
|
29665
|
-
var
|
29666
|
-
var
|
29692
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
29693
|
+
var getClassName8 = get_class_name_factory_default("Heading", styles_module_default8);
|
29667
29694
|
var Heading = ({ children, rank, size = "m" }) => {
|
29668
29695
|
const Tag = rank ? `h${rank}` : "span";
|
29669
|
-
return /* @__PURE__ */ (0,
|
29696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
29670
29697
|
Tag,
|
29671
29698
|
{
|
29672
|
-
className:
|
29699
|
+
className: getClassName8({
|
29673
29700
|
[size]: true
|
29674
29701
|
}),
|
29675
29702
|
children
|
@@ -29689,8 +29716,8 @@ init_react_import();
|
|
29689
29716
|
var Button_module_default = { "Button": "_Button_1t64k_1", "Button--medium": "_Button--medium_1t64k_29", "Button--large": "_Button--large_1t64k_37", "Button-icon": "_Button-icon_1t64k_44", "Button--primary": "_Button--primary_1t64k_48", "Button--secondary": "_Button--secondary_1t64k_67", "Button--flush": "_Button--flush_1t64k_84", "Button--disabled": "_Button--disabled_1t64k_88", "Button--fullWidth": "_Button--fullWidth_1t64k_95", "Button-spinner": "_Button-spinner_1t64k_100" };
|
29690
29717
|
|
29691
29718
|
// components/Button/Button.tsx
|
29692
|
-
var
|
29693
|
-
var
|
29719
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
29720
|
+
var getClassName9 = get_class_name_factory_default("Button", Button_module_default);
|
29694
29721
|
var Button = ({
|
29695
29722
|
children,
|
29696
29723
|
href,
|
@@ -29708,10 +29735,10 @@ var Button = ({
|
|
29708
29735
|
const [loading, setLoading] = (0, import_react7.useState)(loadingProp);
|
29709
29736
|
(0, import_react7.useEffect)(() => setLoading(loadingProp), [loadingProp]);
|
29710
29737
|
const ElementType = href ? "a" : type ? "button" : "span";
|
29711
|
-
const el = /* @__PURE__ */ (0,
|
29738
|
+
const el = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
29712
29739
|
ElementType,
|
29713
29740
|
{
|
29714
|
-
className:
|
29741
|
+
className: getClassName9({
|
29715
29742
|
primary: variant === "primary",
|
29716
29743
|
secondary: variant === "secondary",
|
29717
29744
|
disabled,
|
@@ -29732,9 +29759,9 @@ var Button = ({
|
|
29732
29759
|
rel: newTab ? "noreferrer" : void 0,
|
29733
29760
|
href,
|
29734
29761
|
children: [
|
29735
|
-
icon && /* @__PURE__ */ (0,
|
29762
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassName9("icon"), children: icon }),
|
29736
29763
|
children,
|
29737
|
-
loading && /* @__PURE__ */ (0,
|
29764
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassName9("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Loader, { size: 14 }) })
|
29738
29765
|
]
|
29739
29766
|
}
|
29740
29767
|
);
|
@@ -29742,9 +29769,9 @@ var Button = ({
|
|
29742
29769
|
};
|
29743
29770
|
|
29744
29771
|
// components/ExternalInput/index.tsx
|
29745
|
-
var
|
29746
|
-
var
|
29747
|
-
var getClassNameModal = get_class_name_factory_default("ExternalInputModal",
|
29772
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
29773
|
+
var getClassName10 = get_class_name_factory_default("ExternalInput", styles_module_default6);
|
29774
|
+
var getClassNameModal = get_class_name_factory_default("ExternalInputModal", styles_module_default6);
|
29748
29775
|
var dataCache = {};
|
29749
29776
|
var ExternalInput = ({
|
29750
29777
|
field,
|
@@ -29795,40 +29822,40 @@ var ExternalInput = ({
|
|
29795
29822
|
(0, import_react8.useEffect)(() => {
|
29796
29823
|
search(searchQuery, filters);
|
29797
29824
|
}, []);
|
29798
|
-
return /* @__PURE__ */ (0,
|
29825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
29799
29826
|
"div",
|
29800
29827
|
{
|
29801
|
-
className:
|
29828
|
+
className: getClassName10({
|
29802
29829
|
dataSelected: !!value,
|
29803
29830
|
modalVisible: isOpen
|
29804
29831
|
}),
|
29805
29832
|
id,
|
29806
29833
|
children: [
|
29807
|
-
/* @__PURE__ */ (0,
|
29808
|
-
/* @__PURE__ */ (0,
|
29834
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassName10("actions"), children: [
|
29835
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
29809
29836
|
"button",
|
29810
29837
|
{
|
29811
29838
|
type: "button",
|
29812
29839
|
onClick: () => setOpen(true),
|
29813
|
-
className:
|
29814
|
-
children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0,
|
29815
|
-
/* @__PURE__ */ (0,
|
29816
|
-
/* @__PURE__ */ (0,
|
29840
|
+
className: getClassName10("button"),
|
29841
|
+
children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
29842
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Link, { size: "16" }),
|
29843
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: field.placeholder })
|
29817
29844
|
] })
|
29818
29845
|
}
|
29819
29846
|
),
|
29820
|
-
value && /* @__PURE__ */ (0,
|
29847
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
29821
29848
|
"button",
|
29822
29849
|
{
|
29823
|
-
className:
|
29850
|
+
className: getClassName10("detachButton"),
|
29824
29851
|
onClick: () => {
|
29825
29852
|
onChange(null);
|
29826
29853
|
},
|
29827
|
-
children: /* @__PURE__ */ (0,
|
29854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Unlock, { size: 16 })
|
29828
29855
|
}
|
29829
29856
|
)
|
29830
29857
|
] }),
|
29831
|
-
/* @__PURE__ */ (0,
|
29858
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Modal, { onClose: () => setOpen(false), isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
29832
29859
|
"form",
|
29833
29860
|
{
|
29834
29861
|
className: getClassNameModal({
|
@@ -29842,11 +29869,11 @@ var ExternalInput = ({
|
|
29842
29869
|
search(searchQuery, filters);
|
29843
29870
|
},
|
29844
29871
|
children: [
|
29845
|
-
/* @__PURE__ */ (0,
|
29846
|
-
/* @__PURE__ */ (0,
|
29847
|
-
/* @__PURE__ */ (0,
|
29848
|
-
/* @__PURE__ */ (0,
|
29849
|
-
/* @__PURE__ */ (0,
|
29872
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
|
29873
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: getClassNameModal("search"), children: [
|
29874
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
|
29875
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Search, { size: "18" }) }),
|
29876
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
29850
29877
|
"input",
|
29851
29878
|
{
|
29852
29879
|
className: getClassNameModal("searchInput"),
|
@@ -29861,9 +29888,9 @@ var ExternalInput = ({
|
|
29861
29888
|
}
|
29862
29889
|
)
|
29863
29890
|
] }),
|
29864
|
-
/* @__PURE__ */ (0,
|
29865
|
-
/* @__PURE__ */ (0,
|
29866
|
-
hasFilterFields && /* @__PURE__ */ (0,
|
29891
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
|
29892
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
|
29893
|
+
hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
29867
29894
|
IconButton,
|
29868
29895
|
{
|
29869
29896
|
title: "Toggle filters",
|
@@ -29872,15 +29899,15 @@ var ExternalInput = ({
|
|
29872
29899
|
e.stopPropagation();
|
29873
29900
|
setFiltersToggled(!filtersToggled);
|
29874
29901
|
},
|
29875
|
-
children: /* @__PURE__ */ (0,
|
29902
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SlidersHorizontal, { size: 20 })
|
29876
29903
|
}
|
29877
29904
|
) })
|
29878
29905
|
] })
|
29879
|
-
] }) : /* @__PURE__ */ (0,
|
29880
|
-
/* @__PURE__ */ (0,
|
29881
|
-
hasFilterFields && /* @__PURE__ */ (0,
|
29906
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { rank: 2, size: "xs", children: field.placeholder || "Select data" }) }),
|
29907
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("grid"), children: [
|
29908
|
+
hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
|
29882
29909
|
const filterField = filterFields[fieldName];
|
29883
|
-
return /* @__PURE__ */ (0,
|
29910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
29884
29911
|
AutoFieldPrivate,
|
29885
29912
|
{
|
29886
29913
|
field: filterField,
|
@@ -29897,9 +29924,9 @@ var ExternalInput = ({
|
|
29897
29924
|
fieldName
|
29898
29925
|
);
|
29899
29926
|
}) }),
|
29900
|
-
/* @__PURE__ */ (0,
|
29901
|
-
/* @__PURE__ */ (0,
|
29902
|
-
/* @__PURE__ */ (0,
|
29927
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
|
29928
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: getClassNameModal("table"), children: [
|
29929
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
29903
29930
|
"th",
|
29904
29931
|
{
|
29905
29932
|
className: getClassNameModal("th"),
|
@@ -29908,8 +29935,8 @@ var ExternalInput = ({
|
|
29908
29935
|
},
|
29909
29936
|
key
|
29910
29937
|
)) }) }),
|
29911
|
-
/* @__PURE__ */ (0,
|
29912
|
-
return /* @__PURE__ */ (0,
|
29938
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { className: getClassNameModal("tbody"), children: mappedData.map((item, i) => {
|
29939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
29913
29940
|
"tr",
|
29914
29941
|
{
|
29915
29942
|
style: { whiteSpace: "nowrap" },
|
@@ -29918,16 +29945,16 @@ var ExternalInput = ({
|
|
29918
29945
|
onChange(mapProp(data[i]));
|
29919
29946
|
setOpen(false);
|
29920
29947
|
},
|
29921
|
-
children: keys.map((key) => /* @__PURE__ */ (0,
|
29948
|
+
children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
|
29922
29949
|
},
|
29923
29950
|
i
|
29924
29951
|
);
|
29925
29952
|
}) })
|
29926
29953
|
] }),
|
29927
|
-
/* @__PURE__ */ (0,
|
29954
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 24 }) })
|
29928
29955
|
] })
|
29929
29956
|
] }),
|
29930
|
-
/* @__PURE__ */ (0,
|
29957
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("footer"), children: [
|
29931
29958
|
mappedData.length,
|
29932
29959
|
" result",
|
29933
29960
|
mappedData.length === 1 ? "" : "s"
|
@@ -29941,7 +29968,7 @@ var ExternalInput = ({
|
|
29941
29968
|
};
|
29942
29969
|
|
29943
29970
|
// components/AutoField/fields/ExternalField/index.tsx
|
29944
|
-
var
|
29971
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
29945
29972
|
var ExternalField = ({
|
29946
29973
|
field,
|
29947
29974
|
onChange,
|
@@ -29964,7 +29991,7 @@ var ExternalField = ({
|
|
29964
29991
|
if (field.type !== "external") {
|
29965
29992
|
return null;
|
29966
29993
|
}
|
29967
|
-
return /* @__PURE__ */ (0,
|
29994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Label, { label: label || name, icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Link, { size: 16 }), el: "div", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
29968
29995
|
ExternalInput,
|
29969
29996
|
{
|
29970
29997
|
name,
|
@@ -29988,8 +30015,8 @@ var ExternalField = ({
|
|
29988
30015
|
|
29989
30016
|
// components/AutoField/fields/RadioField/index.tsx
|
29990
30017
|
init_react_import();
|
29991
|
-
var
|
29992
|
-
var
|
30018
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
30019
|
+
var getClassName11 = get_class_name_factory_default("Input", styles_module_default2);
|
29993
30020
|
var RadioField = ({
|
29994
30021
|
field,
|
29995
30022
|
onChange,
|
@@ -30003,23 +30030,23 @@ var RadioField = ({
|
|
30003
30030
|
if (field.type !== "radio" || !field.options) {
|
30004
30031
|
return null;
|
30005
30032
|
}
|
30006
|
-
return /* @__PURE__ */ (0,
|
30033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
30007
30034
|
Label,
|
30008
30035
|
{
|
30009
|
-
icon: /* @__PURE__ */ (0,
|
30036
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CheckCircle, { size: 16 }),
|
30010
30037
|
label: label || name,
|
30011
30038
|
readOnly,
|
30012
30039
|
el: "div",
|
30013
|
-
children: /* @__PURE__ */ (0,
|
30040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: getClassName11("radioGroupItems"), id, children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
30014
30041
|
"label",
|
30015
30042
|
{
|
30016
|
-
className:
|
30043
|
+
className: getClassName11("radio"),
|
30017
30044
|
children: [
|
30018
|
-
/* @__PURE__ */ (0,
|
30045
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
30019
30046
|
"input",
|
30020
30047
|
{
|
30021
30048
|
type: "radio",
|
30022
|
-
className:
|
30049
|
+
className: getClassName11("radioInput"),
|
30023
30050
|
value: option.value,
|
30024
30051
|
name,
|
30025
30052
|
onChange: (e) => {
|
@@ -30033,7 +30060,7 @@ var RadioField = ({
|
|
30033
30060
|
checked: value === option.value
|
30034
30061
|
}
|
30035
30062
|
),
|
30036
|
-
/* @__PURE__ */ (0,
|
30063
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: getClassName11("radioInner"), children: option.label || option.value })
|
30037
30064
|
]
|
30038
30065
|
},
|
30039
30066
|
option.label + option.value
|
@@ -30044,8 +30071,8 @@ var RadioField = ({
|
|
30044
30071
|
|
30045
30072
|
// components/AutoField/fields/SelectField/index.tsx
|
30046
30073
|
init_react_import();
|
30047
|
-
var
|
30048
|
-
var
|
30074
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
30075
|
+
var getClassName12 = get_class_name_factory_default("Input", styles_module_default2);
|
30049
30076
|
var SelectField = ({
|
30050
30077
|
field,
|
30051
30078
|
onChange,
|
@@ -30059,17 +30086,17 @@ var SelectField = ({
|
|
30059
30086
|
if (field.type !== "select" || !field.options) {
|
30060
30087
|
return null;
|
30061
30088
|
}
|
30062
|
-
return /* @__PURE__ */ (0,
|
30089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
30063
30090
|
Label,
|
30064
30091
|
{
|
30065
30092
|
label: label || name,
|
30066
|
-
icon: /* @__PURE__ */ (0,
|
30093
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronDown, { size: 16 }),
|
30067
30094
|
readOnly,
|
30068
|
-
children: /* @__PURE__ */ (0,
|
30095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
30069
30096
|
"select",
|
30070
30097
|
{
|
30071
30098
|
id,
|
30072
|
-
className:
|
30099
|
+
className: getClassName12("input"),
|
30073
30100
|
disabled: readOnly,
|
30074
30101
|
onChange: (e) => {
|
30075
30102
|
if (e.currentTarget.value === "true" || e.currentTarget.value === "false") {
|
@@ -30079,7 +30106,7 @@ var SelectField = ({
|
|
30079
30106
|
onChange(e.currentTarget.value);
|
30080
30107
|
},
|
30081
30108
|
value,
|
30082
|
-
children: field.options.map((option) => /* @__PURE__ */ (0,
|
30109
|
+
children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
30083
30110
|
"option",
|
30084
30111
|
{
|
30085
30112
|
label: option.label,
|
@@ -30095,8 +30122,8 @@ var SelectField = ({
|
|
30095
30122
|
|
30096
30123
|
// components/AutoField/fields/TextareaField/index.tsx
|
30097
30124
|
init_react_import();
|
30098
|
-
var
|
30099
|
-
var
|
30125
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
30126
|
+
var getClassName13 = get_class_name_factory_default("Input", styles_module_default2);
|
30100
30127
|
var TextareaField = ({
|
30101
30128
|
onChange,
|
30102
30129
|
readOnly,
|
@@ -30106,11 +30133,11 @@ var TextareaField = ({
|
|
30106
30133
|
Label,
|
30107
30134
|
id
|
30108
30135
|
}) => {
|
30109
|
-
return /* @__PURE__ */ (0,
|
30136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Label, { label: label || name, icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Type, { size: 16 }), readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
30110
30137
|
"textarea",
|
30111
30138
|
{
|
30112
30139
|
id,
|
30113
|
-
className:
|
30140
|
+
className: getClassName13("input"),
|
30114
30141
|
autoComplete: "off",
|
30115
30142
|
name,
|
30116
30143
|
value: typeof value === "undefined" ? "" : value,
|
@@ -30130,11 +30157,11 @@ init_react_import();
|
|
30130
30157
|
|
30131
30158
|
// css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/fields/ObjectField/styles.module.css#css-module
|
30132
30159
|
init_react_import();
|
30133
|
-
var
|
30160
|
+
var styles_module_default9 = { "ObjectField": "_ObjectField_1ua3y_5", "ObjectField-fieldset": "_ObjectField-fieldset_1ua3y_13" };
|
30134
30161
|
|
30135
30162
|
// components/AutoField/fields/ObjectField/index.tsx
|
30136
|
-
var
|
30137
|
-
var
|
30163
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
30164
|
+
var getClassName14 = get_class_name_factory_default("ObjectField", styles_module_default9);
|
30138
30165
|
var ObjectField = ({
|
30139
30166
|
field,
|
30140
30167
|
onChange,
|
@@ -30151,18 +30178,18 @@ var ObjectField = ({
|
|
30151
30178
|
}
|
30152
30179
|
const readOnlyFields = (selectedItem == null ? void 0 : selectedItem.readOnly) || {};
|
30153
30180
|
const data = value || {};
|
30154
|
-
return /* @__PURE__ */ (0,
|
30181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
30155
30182
|
Label,
|
30156
30183
|
{
|
30157
30184
|
label: label || name,
|
30158
|
-
icon: /* @__PURE__ */ (0,
|
30185
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MoreVertical, { size: 16 }),
|
30159
30186
|
el: "div",
|
30160
30187
|
readOnly,
|
30161
|
-
children: /* @__PURE__ */ (0,
|
30188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassName14(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("fieldset", { className: getClassName14("fieldset"), children: Object.keys(field.objectFields).map((fieldName) => {
|
30162
30189
|
const subField = field.objectFields[fieldName];
|
30163
30190
|
const subFieldName = `${name}.${fieldName}`;
|
30164
30191
|
const wildcardFieldName = `${name}.${fieldName}`;
|
30165
|
-
return /* @__PURE__ */ (0,
|
30192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
30166
30193
|
AutoFieldPrivate,
|
30167
30194
|
{
|
30168
30195
|
name: subFieldName,
|
@@ -30206,8 +30233,8 @@ var useSafeId = () => {
|
|
30206
30233
|
};
|
30207
30234
|
|
30208
30235
|
// components/AutoField/index.tsx
|
30209
|
-
var
|
30210
|
-
var
|
30236
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
30237
|
+
var getClassName15 = get_class_name_factory_default("Input", styles_module_default2);
|
30211
30238
|
var FieldLabel = ({
|
30212
30239
|
children,
|
30213
30240
|
icon,
|
@@ -30217,11 +30244,11 @@ var FieldLabel = ({
|
|
30217
30244
|
className
|
30218
30245
|
}) => {
|
30219
30246
|
const El = el;
|
30220
|
-
return /* @__PURE__ */ (0,
|
30221
|
-
/* @__PURE__ */ (0,
|
30222
|
-
icon ? /* @__PURE__ */ (0,
|
30247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(El, { className, children: [
|
30248
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: getClassName15("label"), children: [
|
30249
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, {}),
|
30223
30250
|
label,
|
30224
|
-
readOnly && /* @__PURE__ */ (0,
|
30251
|
+
readOnly && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Lock, { size: "12" }) })
|
30225
30252
|
] }),
|
30226
30253
|
children
|
30227
30254
|
] });
|
@@ -30239,14 +30266,14 @@ var FieldLabelInternal2 = ({
|
|
30239
30266
|
[overrides]
|
30240
30267
|
);
|
30241
30268
|
if (!label) {
|
30242
|
-
return /* @__PURE__ */ (0,
|
30269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children });
|
30243
30270
|
}
|
30244
|
-
return /* @__PURE__ */ (0,
|
30271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
30245
30272
|
Wrapper,
|
30246
30273
|
{
|
30247
30274
|
label,
|
30248
30275
|
icon,
|
30249
|
-
className:
|
30276
|
+
className: getClassName15({ readOnly }),
|
30250
30277
|
readOnly,
|
30251
30278
|
el,
|
30252
30279
|
children
|
@@ -30290,11 +30317,11 @@ function AutoFieldInternal(props) {
|
|
30290
30317
|
return null;
|
30291
30318
|
}
|
30292
30319
|
const CustomField = field.render;
|
30293
|
-
return /* @__PURE__ */ (0,
|
30320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15(), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CustomField, __spreadValues({}, mergedProps)) });
|
30294
30321
|
}
|
30295
30322
|
const children = defaultFields[field.type](mergedProps);
|
30296
30323
|
const Render2 = render[field.type];
|
30297
|
-
return /* @__PURE__ */ (0,
|
30324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }));
|
30298
30325
|
}
|
30299
30326
|
function AutoFieldPrivate(props) {
|
30300
30327
|
const { value, onChange } = props;
|
@@ -30317,11 +30344,11 @@ function AutoFieldPrivate(props) {
|
|
30317
30344
|
value: localValue,
|
30318
30345
|
onChange: onChangeLocal
|
30319
30346
|
};
|
30320
|
-
return /* @__PURE__ */ (0,
|
30347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
|
30321
30348
|
}
|
30322
|
-
var DefaultLabel = (props) => /* @__PURE__ */ (0,
|
30349
|
+
var DefaultLabel = (props) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", __spreadValues({}, props));
|
30323
30350
|
function AutoField(props) {
|
30324
|
-
return /* @__PURE__ */ (0,
|
30351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadProps(__spreadValues({}, props), { Label: DefaultLabel }));
|
30325
30352
|
}
|
30326
30353
|
|
30327
30354
|
// components/Drawer/index.tsx
|
@@ -30329,13 +30356,13 @@ init_react_import();
|
|
30329
30356
|
|
30330
30357
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css#css-module
|
30331
30358
|
init_react_import();
|
30332
|
-
var
|
30359
|
+
var styles_module_default10 = { "Drawer": "_Drawer_6zh0b_1", "DrawerItem-default": "_DrawerItem-default_6zh0b_5", "DrawerItem-draggableWrapper": "_DrawerItem-draggableWrapper_6zh0b_5", "DrawerItem": "_DrawerItem_6zh0b_5", "DrawerItem-draggable": "_DrawerItem-draggable_6zh0b_5", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_6zh0b_31", "DrawerItem-name": "_DrawerItem-name_6zh0b_47" };
|
30333
30360
|
|
30334
30361
|
// components/Drawer/index.tsx
|
30335
30362
|
var import_react12 = require("react");
|
30336
|
-
var
|
30337
|
-
var
|
30338
|
-
var getClassNameItem2 = get_class_name_factory_default("DrawerItem",
|
30363
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
30364
|
+
var getClassName16 = get_class_name_factory_default("Drawer", styles_module_default10);
|
30365
|
+
var getClassNameItem2 = get_class_name_factory_default("DrawerItem", styles_module_default10);
|
30339
30366
|
var drawerContext = (0, import_react12.createContext)({
|
30340
30367
|
droppableId: ""
|
30341
30368
|
});
|
@@ -30343,7 +30370,7 @@ var DrawerDraggable = ({
|
|
30343
30370
|
children,
|
30344
30371
|
id,
|
30345
30372
|
index
|
30346
|
-
}) => /* @__PURE__ */ (0,
|
30373
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
30347
30374
|
Draggable,
|
30348
30375
|
{
|
30349
30376
|
id,
|
@@ -30365,12 +30392,12 @@ var DrawerItem = ({
|
|
30365
30392
|
const ctx = (0, import_react12.useContext)(drawerContext);
|
30366
30393
|
const resolvedId = `${ctx.droppableId}::${id || name}`;
|
30367
30394
|
const CustomInner = (0, import_react12.useMemo)(
|
30368
|
-
() => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0,
|
30395
|
+
() => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem2("default"), children: children2 })),
|
30369
30396
|
[children]
|
30370
30397
|
);
|
30371
|
-
return /* @__PURE__ */ (0,
|
30372
|
-
/* @__PURE__ */ (0,
|
30373
|
-
/* @__PURE__ */ (0,
|
30398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DrawerDraggable, { id: resolvedId, index, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomInner, { name, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem2("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: getClassNameItem2("draggable"), children: [
|
30399
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem2("name"), children: label != null ? label : name }),
|
30400
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem2("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DragIcon, {}) })
|
30374
30401
|
] }) }) }) });
|
30375
30402
|
};
|
30376
30403
|
var Drawer = ({
|
@@ -30379,16 +30406,16 @@ var Drawer = ({
|
|
30379
30406
|
direction = "vertical"
|
30380
30407
|
}) => {
|
30381
30408
|
const droppableId = `component-list:${_droppableId}`;
|
30382
|
-
return /* @__PURE__ */ (0,
|
30409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(drawerContext.Provider, { value: { droppableId }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Droppable, { droppableId, isDropDisabled: true, direction, children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
30383
30410
|
"div",
|
30384
30411
|
__spreadProps(__spreadValues({}, provided.droppableProps), {
|
30385
30412
|
ref: provided.innerRef,
|
30386
|
-
className:
|
30413
|
+
className: getClassName16({
|
30387
30414
|
isDraggingFrom: !!snapshot.draggingFromThisWith
|
30388
30415
|
}),
|
30389
30416
|
children: [
|
30390
30417
|
children,
|
30391
|
-
/* @__PURE__ */ (0,
|
30418
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { display: "none" }, children: provided.placeholder })
|
30392
30419
|
]
|
30393
30420
|
})
|
30394
30421
|
) }) });
|
@@ -30397,16 +30424,16 @@ Drawer.Item = DrawerItem;
|
|
30397
30424
|
|
30398
30425
|
// components/DropZone/index.tsx
|
30399
30426
|
init_react_import();
|
30400
|
-
var
|
30427
|
+
var import_react17 = require("react");
|
30401
30428
|
|
30402
30429
|
// components/DraggableComponent/index.tsx
|
30403
30430
|
init_react_import();
|
30404
|
-
var
|
30431
|
+
var import_react15 = require("react");
|
30405
30432
|
var import_dnd4 = require("@measured/dnd");
|
30406
30433
|
|
30407
30434
|
// css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css#css-module
|
30408
30435
|
init_react_import();
|
30409
|
-
var
|
30436
|
+
var styles_module_default11 = { "DraggableComponent": "_DraggableComponent_1bhad_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_1bhad_11", "DraggableComponent-contents": "_DraggableComponent-contents_1bhad_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_1bhad_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_1bhad_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_1bhad_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_1bhad_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_1bhad_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_1bhad_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_1bhad_97", "DraggableComponent-actions": "_DraggableComponent-actions_1bhad_97" };
|
30410
30437
|
|
30411
30438
|
// lib/use-modifier-held.ts
|
30412
30439
|
init_react_import();
|
@@ -30446,13 +30473,67 @@ var isIos = () => [
|
|
30446
30473
|
].includes(navigator.platform) || // iPad on iOS 13 detection
|
30447
30474
|
navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
30448
30475
|
|
30476
|
+
// components/DefaultOverride/index.tsx
|
30477
|
+
init_react_import();
|
30478
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
30479
|
+
var DefaultOverride = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, { children });
|
30480
|
+
|
30481
|
+
// lib/use-loaded-overrides.ts
|
30482
|
+
init_react_import();
|
30483
|
+
var import_react14 = require("react");
|
30484
|
+
|
30485
|
+
// lib/load-overrides.ts
|
30486
|
+
init_react_import();
|
30487
|
+
var loadOverrides = ({
|
30488
|
+
overrides,
|
30489
|
+
plugins
|
30490
|
+
}) => {
|
30491
|
+
const collected = __spreadValues({}, overrides);
|
30492
|
+
plugins.forEach((plugin) => {
|
30493
|
+
Object.keys(plugin.overrides).forEach((overridesType) => {
|
30494
|
+
if (overridesType === "fieldTypes") {
|
30495
|
+
const fieldTypes = plugin.overrides.fieldTypes;
|
30496
|
+
Object.keys(fieldTypes).forEach((fieldType) => {
|
30497
|
+
collected.fieldTypes = collected.fieldTypes || {};
|
30498
|
+
const childNode2 = collected.fieldTypes[fieldType];
|
30499
|
+
const Comp2 = (props) => fieldTypes[fieldType](__spreadProps(__spreadValues({}, props), {
|
30500
|
+
children: childNode2 ? childNode2(props) : props.children
|
30501
|
+
}));
|
30502
|
+
collected.fieldTypes[fieldType] = Comp2;
|
30503
|
+
});
|
30504
|
+
return;
|
30505
|
+
}
|
30506
|
+
const childNode = collected[overridesType];
|
30507
|
+
const Comp = (props) => plugin.overrides[overridesType](__spreadProps(__spreadValues({}, props), {
|
30508
|
+
children: childNode ? childNode(props) : props.children
|
30509
|
+
}));
|
30510
|
+
collected[overridesType] = Comp;
|
30511
|
+
});
|
30512
|
+
});
|
30513
|
+
return collected;
|
30514
|
+
};
|
30515
|
+
|
30516
|
+
// lib/use-loaded-overrides.ts
|
30517
|
+
var useLoadedOverrides = ({
|
30518
|
+
overrides,
|
30519
|
+
plugins
|
30520
|
+
}) => {
|
30521
|
+
return (0, import_react14.useMemo)(() => {
|
30522
|
+
return loadOverrides({ overrides, plugins });
|
30523
|
+
}, [plugins, overrides]);
|
30524
|
+
};
|
30525
|
+
|
30449
30526
|
// components/DraggableComponent/index.tsx
|
30450
|
-
var
|
30451
|
-
var
|
30527
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
30528
|
+
var getClassName17 = get_class_name_factory_default("DraggableComponent", styles_module_default11);
|
30452
30529
|
var space = 8;
|
30453
30530
|
var actionsOverlayTop = space * 6.5;
|
30454
30531
|
var actionsTop = -(actionsOverlayTop - 8);
|
30455
30532
|
var actionsRight = space;
|
30533
|
+
var DefaultActionBar = ({
|
30534
|
+
label,
|
30535
|
+
children
|
30536
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar, { label, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DefaultOverride, { children }) });
|
30456
30537
|
var DraggableComponent = ({
|
30457
30538
|
children,
|
30458
30539
|
id,
|
@@ -30475,30 +30556,37 @@ var DraggableComponent = ({
|
|
30475
30556
|
indicativeHover = false,
|
30476
30557
|
style
|
30477
30558
|
}) => {
|
30478
|
-
const { zoomConfig } = useAppContext();
|
30559
|
+
const { zoomConfig, status, overrides, plugins } = useAppContext();
|
30479
30560
|
const isModifierHeld = useModifierHeld("Alt");
|
30480
|
-
const { status } = useAppContext();
|
30481
30561
|
const El = status !== "LOADING" ? import_dnd4.Draggable : DefaultDraggable;
|
30482
|
-
(0,
|
30483
|
-
const [disableSecondaryAnimation, setDisableSecondaryAnimation] = (0,
|
30484
|
-
(0,
|
30562
|
+
(0, import_react15.useEffect)(onMount, []);
|
30563
|
+
const [disableSecondaryAnimation, setDisableSecondaryAnimation] = (0, import_react15.useState)(false);
|
30564
|
+
(0, import_react15.useEffect)(() => {
|
30485
30565
|
if (isIos()) {
|
30486
30566
|
setDisableSecondaryAnimation(true);
|
30487
30567
|
}
|
30488
30568
|
}, []);
|
30489
|
-
|
30569
|
+
const loadedOverrides = useLoadedOverrides({
|
30570
|
+
overrides,
|
30571
|
+
plugins
|
30572
|
+
});
|
30573
|
+
const CustomActionBar = (0, import_react15.useMemo)(
|
30574
|
+
() => loadedOverrides.actionBar || DefaultActionBar,
|
30575
|
+
[loadedOverrides]
|
30576
|
+
);
|
30577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
30490
30578
|
El,
|
30491
30579
|
{
|
30492
30580
|
draggableId: id,
|
30493
30581
|
index,
|
30494
30582
|
isDragDisabled,
|
30495
30583
|
disableSecondaryAnimation,
|
30496
|
-
children: (provided, snapshot) => /* @__PURE__ */ (0,
|
30584
|
+
children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
30497
30585
|
"div",
|
30498
30586
|
__spreadProps(__spreadValues(__spreadValues({
|
30499
30587
|
ref: provided.innerRef
|
30500
30588
|
}, provided.draggableProps), provided.dragHandleProps), {
|
30501
|
-
className:
|
30589
|
+
className: getClassName17({
|
30502
30590
|
isSelected,
|
30503
30591
|
isModifierHeld,
|
30504
30592
|
isDragging: snapshot.isDragging,
|
@@ -30516,34 +30604,33 @@ var DraggableComponent = ({
|
|
30516
30604
|
onClick,
|
30517
30605
|
children: [
|
30518
30606
|
debug,
|
30519
|
-
isLoading && /* @__PURE__ */ (0,
|
30520
|
-
/* @__PURE__ */ (0,
|
30607
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loader, {}) }),
|
30608
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
30521
30609
|
"div",
|
30522
30610
|
{
|
30523
|
-
className:
|
30611
|
+
className: getClassName17("actionsOverlay"),
|
30524
30612
|
style: {
|
30525
30613
|
top: actionsOverlayTop / zoomConfig.zoom
|
30526
30614
|
},
|
30527
|
-
children: /* @__PURE__ */ (0,
|
30615
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
30528
30616
|
"div",
|
30529
30617
|
{
|
30530
|
-
className:
|
30618
|
+
className: getClassName17("actions"),
|
30531
30619
|
style: {
|
30532
30620
|
transform: `scale(${1 / zoomConfig.zoom}`,
|
30533
30621
|
top: actionsTop / zoomConfig.zoom,
|
30534
30622
|
right: actionsRight / zoomConfig.zoom
|
30535
30623
|
},
|
30536
|
-
children: [
|
30537
|
-
|
30538
|
-
/* @__PURE__ */ (0,
|
30539
|
-
|
30540
|
-
]
|
30624
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(CustomActionBar, { label, children: [
|
30625
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar.Action, { onClick: onDuplicate, label: "Duplicate", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Copy, { size: 16 }) }),
|
30626
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar.Action, { onClick: onDelete, label: "Delete", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 16 }) })
|
30627
|
+
] })
|
30541
30628
|
}
|
30542
30629
|
)
|
30543
30630
|
}
|
30544
30631
|
),
|
30545
|
-
/* @__PURE__ */ (0,
|
30546
|
-
/* @__PURE__ */ (0,
|
30632
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("overlay") }),
|
30633
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("contents"), children })
|
30547
30634
|
]
|
30548
30635
|
})
|
30549
30636
|
)
|
@@ -30554,11 +30641,11 @@ var DraggableComponent = ({
|
|
30554
30641
|
|
30555
30642
|
// css-module:/home/runner/work/puck/puck/packages/core/components/DropZone/styles.module.css#css-module
|
30556
30643
|
init_react_import();
|
30557
|
-
var
|
30644
|
+
var styles_module_default12 = { "DropZone": "_DropZone_djoti_1", "DropZone-content": "_DropZone-content_djoti_10", "DropZone--userIsDragging": "_DropZone--userIsDragging_djoti_15", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_djoti_19", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_djoti_20", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_djoti_26", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_djoti_27", "DropZone--isDisabled": "_DropZone--isDisabled_djoti_28", "DropZone--isRootZone": "_DropZone--isRootZone_djoti_29", "DropZone--hasChildren": "_DropZone--hasChildren_djoti_30", "DropZone--isDestination": "_DropZone--isDestination_djoti_40", "DropZone-item": "_DropZone-item_djoti_52", "DropZone-hitbox": "_DropZone-hitbox_djoti_56" };
|
30558
30645
|
|
30559
30646
|
// components/DropZone/context.tsx
|
30560
30647
|
init_react_import();
|
30561
|
-
var
|
30648
|
+
var import_react16 = require("react");
|
30562
30649
|
var import_use_debounce2 = require("use-debounce");
|
30563
30650
|
|
30564
30651
|
// lib/get-zone-id.ts
|
@@ -30574,30 +30661,30 @@ var getZoneId = (zoneCompound) => {
|
|
30574
30661
|
};
|
30575
30662
|
|
30576
30663
|
// components/DropZone/context.tsx
|
30577
|
-
var
|
30578
|
-
var dropZoneContext = (0,
|
30664
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
30665
|
+
var dropZoneContext = (0, import_react16.createContext)(null);
|
30579
30666
|
var DropZoneProvider = ({
|
30580
30667
|
children,
|
30581
30668
|
value
|
30582
30669
|
}) => {
|
30583
|
-
const [hoveringArea, setHoveringArea] = (0,
|
30584
|
-
const [hoveringZone, setHoveringZone] = (0,
|
30670
|
+
const [hoveringArea, setHoveringArea] = (0, import_react16.useState)(null);
|
30671
|
+
const [hoveringZone, setHoveringZone] = (0, import_react16.useState)(
|
30585
30672
|
rootDroppableId
|
30586
30673
|
);
|
30587
|
-
const [hoveringComponent, setHoveringComponent] = (0,
|
30674
|
+
const [hoveringComponent, setHoveringComponent] = (0, import_react16.useState)();
|
30588
30675
|
const [hoveringAreaDb] = (0, import_use_debounce2.useDebounce)(hoveringArea, 75, { leading: false });
|
30589
|
-
const [areasWithZones, setAreasWithZones] = (0,
|
30676
|
+
const [areasWithZones, setAreasWithZones] = (0, import_react16.useState)(
|
30590
30677
|
{}
|
30591
30678
|
);
|
30592
|
-
const [activeZones, setActiveZones] = (0,
|
30679
|
+
const [activeZones, setActiveZones] = (0, import_react16.useState)({});
|
30593
30680
|
const { dispatch = null } = value ? value : {};
|
30594
|
-
const registerZoneArea = (0,
|
30681
|
+
const registerZoneArea = (0, import_react16.useCallback)(
|
30595
30682
|
(area) => {
|
30596
30683
|
setAreasWithZones((latest) => __spreadProps(__spreadValues({}, latest), { [area]: true }));
|
30597
30684
|
},
|
30598
30685
|
[setAreasWithZones]
|
30599
30686
|
);
|
30600
|
-
const registerZone = (0,
|
30687
|
+
const registerZone = (0, import_react16.useCallback)(
|
30601
30688
|
(zoneCompound) => {
|
30602
30689
|
if (!dispatch) {
|
30603
30690
|
return;
|
@@ -30610,7 +30697,7 @@ var DropZoneProvider = ({
|
|
30610
30697
|
},
|
30611
30698
|
[setActiveZones, dispatch]
|
30612
30699
|
);
|
30613
|
-
const unregisterZone = (0,
|
30700
|
+
const unregisterZone = (0, import_react16.useCallback)(
|
30614
30701
|
(zoneCompound) => {
|
30615
30702
|
if (!dispatch) {
|
30616
30703
|
return;
|
@@ -30625,8 +30712,8 @@ var DropZoneProvider = ({
|
|
30625
30712
|
},
|
30626
30713
|
[setActiveZones, dispatch]
|
30627
30714
|
);
|
30628
|
-
const [pathData, setPathData] = (0,
|
30629
|
-
const registerPath = (0,
|
30715
|
+
const [pathData, setPathData] = (0, import_react16.useState)();
|
30716
|
+
const registerPath = (0, import_react16.useCallback)(
|
30630
30717
|
(selector) => {
|
30631
30718
|
if (!(value == null ? void 0 : value.data)) {
|
30632
30719
|
return;
|
@@ -30651,8 +30738,8 @@ var DropZoneProvider = ({
|
|
30651
30738
|
},
|
30652
30739
|
[value, setPathData]
|
30653
30740
|
);
|
30654
|
-
const [zoneWillDrag, setZoneWillDrag] = (0,
|
30655
|
-
return /* @__PURE__ */ (0,
|
30741
|
+
const [zoneWillDrag, setZoneWillDrag] = (0, import_react16.useState)("");
|
30742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: value && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
30656
30743
|
dropZoneContext.Provider,
|
30657
30744
|
{
|
30658
30745
|
value: __spreadValues({
|
@@ -30678,12 +30765,12 @@ var DropZoneProvider = ({
|
|
30678
30765
|
};
|
30679
30766
|
|
30680
30767
|
// components/DropZone/index.tsx
|
30681
|
-
var
|
30682
|
-
var
|
30768
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
30769
|
+
var getClassName18 = get_class_name_factory_default("DropZone", styles_module_default12);
|
30683
30770
|
function DropZoneEdit({ zone, allow, disallow, style }) {
|
30684
30771
|
var _a;
|
30685
30772
|
const appContext2 = useAppContext();
|
30686
|
-
const ctx = (0,
|
30773
|
+
const ctx = (0, import_react17.useContext)(dropZoneContext);
|
30687
30774
|
const {
|
30688
30775
|
// These all need setting via context
|
30689
30776
|
data,
|
@@ -30702,12 +30789,12 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30702
30789
|
} = ctx || {};
|
30703
30790
|
let content = data.content || [];
|
30704
30791
|
let zoneCompound = rootDroppableId;
|
30705
|
-
(0,
|
30792
|
+
(0, import_react17.useEffect)(() => {
|
30706
30793
|
if (areaId && registerZoneArea) {
|
30707
30794
|
registerZoneArea(areaId);
|
30708
30795
|
}
|
30709
30796
|
}, [areaId]);
|
30710
|
-
(0,
|
30797
|
+
(0, import_react17.useEffect)(() => {
|
30711
30798
|
if (ctx == null ? void 0 : ctx.registerZone) {
|
30712
30799
|
ctx == null ? void 0 : ctx.registerZone(zoneCompound);
|
30713
30800
|
}
|
@@ -30733,7 +30820,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30733
30820
|
const draggingOverArea = userIsDragging && zoneArea === draggedSourceArea;
|
30734
30821
|
const draggingNewComponent = draggedSourceId == null ? void 0 : draggedSourceId.startsWith("component-list");
|
30735
30822
|
if (!(ctx == null ? void 0 : ctx.config) || !ctx.setHoveringArea || !ctx.setHoveringZone || !ctx.setHoveringComponent || !ctx.setItemSelector || !ctx.registerPath || !ctx.dispatch) {
|
30736
|
-
return /* @__PURE__ */ (0,
|
30823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { children: "DropZone requires context to work." });
|
30737
30824
|
}
|
30738
30825
|
const {
|
30739
30826
|
hoveringArea = "root",
|
@@ -30774,10 +30861,10 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30774
30861
|
}
|
30775
30862
|
const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
|
30776
30863
|
const isAreaSelected = selectedItem && zoneArea === selectedItem.props.id;
|
30777
|
-
return /* @__PURE__ */ (0,
|
30864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
30778
30865
|
"div",
|
30779
30866
|
{
|
30780
|
-
className:
|
30867
|
+
className: getClassName18({
|
30781
30868
|
isRootZone,
|
30782
30869
|
userIsDragging,
|
30783
30870
|
draggingOverArea,
|
@@ -30791,17 +30878,17 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30791
30878
|
onMouseUp: () => {
|
30792
30879
|
setZoneWillDrag("");
|
30793
30880
|
},
|
30794
|
-
children: /* @__PURE__ */ (0,
|
30881
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
30795
30882
|
Droppable,
|
30796
30883
|
{
|
30797
30884
|
droppableId: zoneCompound,
|
30798
30885
|
direction: "vertical",
|
30799
30886
|
isDropDisabled: !isEnabled,
|
30800
30887
|
children: (provided, snapshot) => {
|
30801
|
-
return /* @__PURE__ */ (0,
|
30888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
30802
30889
|
"div",
|
30803
30890
|
__spreadProps(__spreadValues({}, (provided || { droppableProps: {} }).droppableProps), {
|
30804
|
-
className:
|
30891
|
+
className: getClassName18("content"),
|
30805
30892
|
ref: provided == null ? void 0 : provided.innerRef,
|
30806
30893
|
style,
|
30807
30894
|
id: zoneCompound,
|
@@ -30828,25 +30915,25 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30828
30915
|
"draggable-"
|
30829
30916
|
)[1] === componentId;
|
30830
30917
|
const containsZone = areasWithZones ? areasWithZones[componentId] : false;
|
30831
|
-
const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0,
|
30918
|
+
const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
|
30832
30919
|
"No configuration for ",
|
30833
30920
|
item.type
|
30834
30921
|
] });
|
30835
30922
|
const componentConfig = config.components[item.type];
|
30836
30923
|
const label = (_b = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _b : item.type.toString();
|
30837
|
-
return /* @__PURE__ */ (0,
|
30924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
30838
30925
|
"div",
|
30839
30926
|
{
|
30840
|
-
className:
|
30927
|
+
className: getClassName18("item"),
|
30841
30928
|
style: { zIndex: isDragging ? 1 : void 0 },
|
30842
30929
|
children: [
|
30843
|
-
/* @__PURE__ */ (0,
|
30930
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
30844
30931
|
DropZoneProvider,
|
30845
30932
|
{
|
30846
30933
|
value: __spreadProps(__spreadValues({}, ctx), {
|
30847
30934
|
areaId: componentId
|
30848
30935
|
}),
|
30849
|
-
children: /* @__PURE__ */ (0,
|
30936
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
30850
30937
|
DraggableComponent,
|
30851
30938
|
{
|
30852
30939
|
label,
|
@@ -30913,15 +31000,15 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30913
31000
|
style: {
|
30914
31001
|
pointerEvents: userIsDragging && draggingNewComponent ? "all" : void 0
|
30915
31002
|
},
|
30916
|
-
children: /* @__PURE__ */ (0,
|
31003
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName18("renderWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Render2, __spreadValues({}, defaultedProps)) })
|
30917
31004
|
}
|
30918
31005
|
)
|
30919
31006
|
}
|
30920
31007
|
),
|
30921
|
-
userIsDragging && /* @__PURE__ */ (0,
|
31008
|
+
userIsDragging && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
30922
31009
|
"div",
|
30923
31010
|
{
|
30924
|
-
className:
|
31011
|
+
className: getClassName18("hitbox"),
|
30925
31012
|
onMouseOver: (e) => {
|
30926
31013
|
e.stopPropagation();
|
30927
31014
|
setHoveringArea(zoneArea);
|
@@ -30935,7 +31022,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30935
31022
|
);
|
30936
31023
|
}),
|
30937
31024
|
provided == null ? void 0 : provided.placeholder,
|
30938
|
-
(snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ (0,
|
31025
|
+
(snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
30939
31026
|
"div",
|
30940
31027
|
{
|
30941
31028
|
"data-puck-placeholder": true,
|
@@ -30956,7 +31043,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
30956
31043
|
);
|
30957
31044
|
}
|
30958
31045
|
function DropZoneRender({ zone }) {
|
30959
|
-
const ctx = (0,
|
31046
|
+
const ctx = (0, import_react17.useContext)(dropZoneContext);
|
30960
31047
|
const { data, areaId = "root", config } = ctx || {};
|
30961
31048
|
let zoneCompound = rootDroppableId;
|
30962
31049
|
let content = (data == null ? void 0 : data.content) || [];
|
@@ -30967,14 +31054,14 @@ function DropZoneRender({ zone }) {
|
|
30967
31054
|
zoneCompound = `${areaId}:${zone}`;
|
30968
31055
|
content = setupZone(data, zoneCompound).zones[zoneCompound];
|
30969
31056
|
}
|
30970
|
-
return /* @__PURE__ */ (0,
|
31057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: content.map((item) => {
|
30971
31058
|
const Component = config.components[item.type];
|
30972
31059
|
if (Component) {
|
30973
|
-
return /* @__PURE__ */ (0,
|
31060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
30974
31061
|
DropZoneProvider,
|
30975
31062
|
{
|
30976
31063
|
value: { data, config, areaId: item.props.id },
|
30977
|
-
children: /* @__PURE__ */ (0,
|
31064
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
30978
31065
|
Component.render,
|
30979
31066
|
__spreadProps(__spreadValues({}, item.props), {
|
30980
31067
|
puck: { renderDropZone: DropZone }
|
@@ -30988,20 +31075,20 @@ function DropZoneRender({ zone }) {
|
|
30988
31075
|
}) });
|
30989
31076
|
}
|
30990
31077
|
function DropZone(props) {
|
30991
|
-
const ctx = (0,
|
31078
|
+
const ctx = (0, import_react17.useContext)(dropZoneContext);
|
30992
31079
|
if ((ctx == null ? void 0 : ctx.mode) === "edit") {
|
30993
|
-
return /* @__PURE__ */ (0,
|
31080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZoneEdit, __spreadValues({}, props));
|
30994
31081
|
}
|
30995
|
-
return /* @__PURE__ */ (0,
|
31082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZoneRender, __spreadValues({}, props));
|
30996
31083
|
}
|
30997
31084
|
|
30998
31085
|
// components/Puck/index.tsx
|
30999
31086
|
init_react_import();
|
31000
|
-
var
|
31087
|
+
var import_react31 = require("react");
|
31001
31088
|
|
31002
31089
|
// lib/use-placeholder-style.ts
|
31003
31090
|
init_react_import();
|
31004
|
-
var
|
31091
|
+
var import_react18 = require("react");
|
31005
31092
|
|
31006
31093
|
// lib/get-frame.ts
|
31007
31094
|
init_react_import();
|
@@ -31016,7 +31103,7 @@ var getFrame = () => {
|
|
31016
31103
|
// lib/use-placeholder-style.ts
|
31017
31104
|
var usePlaceholderStyle = () => {
|
31018
31105
|
const queryAttr = "data-rfd-drag-handle-draggable-id";
|
31019
|
-
const [placeholderStyle, setPlaceholderStyle] = (0,
|
31106
|
+
const [placeholderStyle, setPlaceholderStyle] = (0, import_react18.useState)();
|
31020
31107
|
const onDragStartOrUpdate = (draggedItem) => {
|
31021
31108
|
var _a;
|
31022
31109
|
const draggableId = draggedItem.draggableId;
|
@@ -31065,11 +31152,11 @@ init_react_import();
|
|
31065
31152
|
|
31066
31153
|
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
31067
31154
|
init_react_import();
|
31068
|
-
var
|
31155
|
+
var styles_module_default13 = { "SidebarSection": "_SidebarSection_125qe_1", "SidebarSection-title": "_SidebarSection-title_125qe_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_125qe_20", "SidebarSection-content": "_SidebarSection-content_125qe_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_125qe_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_125qe_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_125qe_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_125qe_41", "SidebarSection-heading": "_SidebarSection-heading_125qe_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_125qe_86" };
|
31069
31156
|
|
31070
31157
|
// lib/use-breadcrumbs.ts
|
31071
31158
|
init_react_import();
|
31072
|
-
var
|
31159
|
+
var import_react19 = require("react");
|
31073
31160
|
var convertPathDataToBreadcrumbs = (selectedItem, pathData, data) => {
|
31074
31161
|
const id = selectedItem ? selectedItem == null ? void 0 : selectedItem.props.id : "";
|
31075
31162
|
const currentPathData = pathData && id && pathData[id] ? __spreadValues({}, pathData[id]) : { label: "Page", path: [] };
|
@@ -31119,8 +31206,8 @@ var useBreadcrumbs = (renderCount) => {
|
|
31119
31206
|
state: { data },
|
31120
31207
|
selectedItem
|
31121
31208
|
} = useAppContext();
|
31122
|
-
const dzContext = (0,
|
31123
|
-
return (0,
|
31209
|
+
const dzContext = (0, import_react19.useContext)(dropZoneContext);
|
31210
|
+
return (0, import_react19.useMemo)(() => {
|
31124
31211
|
const breadcrumbs = convertPathDataToBreadcrumbs(
|
31125
31212
|
selectedItem,
|
31126
31213
|
dzContext == null ? void 0 : dzContext.pathData,
|
@@ -31134,8 +31221,8 @@ var useBreadcrumbs = (renderCount) => {
|
|
31134
31221
|
};
|
31135
31222
|
|
31136
31223
|
// components/SidebarSection/index.tsx
|
31137
|
-
var
|
31138
|
-
var
|
31224
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
31225
|
+
var getClassName19 = get_class_name_factory_default("SidebarSection", styles_module_default13);
|
31139
31226
|
var SidebarSection = ({
|
31140
31227
|
children,
|
31141
31228
|
title,
|
@@ -31147,28 +31234,28 @@ var SidebarSection = ({
|
|
31147
31234
|
}) => {
|
31148
31235
|
const { setUi } = useAppContext();
|
31149
31236
|
const breadcrumbs = useBreadcrumbs(1);
|
31150
|
-
return /* @__PURE__ */ (0,
|
31237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
31151
31238
|
"div",
|
31152
31239
|
{
|
31153
|
-
className:
|
31240
|
+
className: getClassName19({ noBorderTop, noPadding }),
|
31154
31241
|
style: { background },
|
31155
31242
|
children: [
|
31156
|
-
/* @__PURE__ */ (0,
|
31157
|
-
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0,
|
31158
|
-
/* @__PURE__ */ (0,
|
31243
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("title"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName19("breadcrumbs"), children: [
|
31244
|
+
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName19("breadcrumb"), children: [
|
31245
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
31159
31246
|
"button",
|
31160
31247
|
{
|
31161
|
-
className:
|
31248
|
+
className: getClassName19("breadcrumbLabel"),
|
31162
31249
|
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
31163
31250
|
children: breadcrumb.label
|
31164
31251
|
}
|
31165
31252
|
),
|
31166
|
-
/* @__PURE__ */ (0,
|
31253
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronRight, { size: 16 })
|
31167
31254
|
] }, i)) : null,
|
31168
|
-
/* @__PURE__ */ (0,
|
31255
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, { rank: 2, size: "xs", children: title }) })
|
31169
31256
|
] }) }),
|
31170
|
-
/* @__PURE__ */ (0,
|
31171
|
-
isLoading && /* @__PURE__ */ (0,
|
31257
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("content"), children }),
|
31258
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Loader, { size: 32 }) })
|
31172
31259
|
]
|
31173
31260
|
}
|
31174
31261
|
);
|
@@ -31537,7 +31624,7 @@ var flushZones = (appState) => {
|
|
31537
31624
|
|
31538
31625
|
// lib/use-resolved-data.ts
|
31539
31626
|
init_react_import();
|
31540
|
-
var
|
31627
|
+
var import_react20 = require("react");
|
31541
31628
|
|
31542
31629
|
// lib/resolve-component-data.ts
|
31543
31630
|
init_react_import();
|
@@ -31646,13 +31733,13 @@ var resolveRootData = (data, config) => __async(void 0, null, function* () {
|
|
31646
31733
|
|
31647
31734
|
// lib/use-resolved-data.ts
|
31648
31735
|
var useResolvedData = (appState, config, dispatch) => {
|
31649
|
-
const [{ resolverKey, newAppState }, setResolverState] = (0,
|
31736
|
+
const [{ resolverKey, newAppState }, setResolverState] = (0, import_react20.useState)({
|
31650
31737
|
resolverKey: 0,
|
31651
31738
|
newAppState: appState
|
31652
31739
|
});
|
31653
|
-
const [componentState, setComponentState] = (0,
|
31740
|
+
const [componentState, setComponentState] = (0, import_react20.useState)({});
|
31654
31741
|
const deferredSetStates = {};
|
31655
|
-
const setComponentLoading = (0,
|
31742
|
+
const setComponentLoading = (0, import_react20.useCallback)(
|
31656
31743
|
(id, loading, defer2 = 0) => {
|
31657
31744
|
if (deferredSetStates[id]) {
|
31658
31745
|
clearTimeout(deferredSetStates[id]);
|
@@ -31722,10 +31809,10 @@ var useResolvedData = (appState, config, dispatch) => {
|
|
31722
31809
|
});
|
31723
31810
|
yield Promise.all(promises);
|
31724
31811
|
});
|
31725
|
-
(0,
|
31812
|
+
(0, import_react20.useEffect)(() => {
|
31726
31813
|
runResolvers();
|
31727
31814
|
}, [resolverKey]);
|
31728
|
-
const resolveData = (0,
|
31815
|
+
const resolveData = (0, import_react20.useCallback)((newAppState2 = appState) => {
|
31729
31816
|
setResolverState((curr) => ({
|
31730
31817
|
resolverKey: curr.resolverKey + 1,
|
31731
31818
|
newAppState: newAppState2
|
@@ -31742,11 +31829,11 @@ init_react_import();
|
|
31742
31829
|
|
31743
31830
|
// css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css#css-module
|
31744
31831
|
init_react_import();
|
31745
|
-
var
|
31832
|
+
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" };
|
31746
31833
|
|
31747
31834
|
// components/MenuBar/index.tsx
|
31748
|
-
var
|
31749
|
-
var
|
31835
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
31836
|
+
var getClassName20 = get_class_name_factory_default("MenuBar", styles_module_default14);
|
31750
31837
|
var MenuBar = ({
|
31751
31838
|
appState,
|
31752
31839
|
data = { content: [], root: {} },
|
@@ -31760,10 +31847,10 @@ var MenuBar = ({
|
|
31760
31847
|
history: { back, forward, historyStore }
|
31761
31848
|
} = useAppContext();
|
31762
31849
|
const { hasFuture = false, hasPast = false } = historyStore || {};
|
31763
|
-
return /* @__PURE__ */ (0,
|
31850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
31764
31851
|
"div",
|
31765
31852
|
{
|
31766
|
-
className:
|
31853
|
+
className: getClassName20({ menuOpen }),
|
31767
31854
|
onClick: (event) => {
|
31768
31855
|
var _a;
|
31769
31856
|
const element = event.target;
|
@@ -31774,12 +31861,12 @@ var MenuBar = ({
|
|
31774
31861
|
setMenuOpen(false);
|
31775
31862
|
}
|
31776
31863
|
},
|
31777
|
-
children: /* @__PURE__ */ (0,
|
31778
|
-
/* @__PURE__ */ (0,
|
31779
|
-
/* @__PURE__ */ (0,
|
31780
|
-
/* @__PURE__ */ (0,
|
31864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getClassName20("inner"), children: [
|
31865
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getClassName20("history"), children: [
|
31866
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Undo2, { size: 21 }) }),
|
31867
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Redo2, { size: 21 }) })
|
31781
31868
|
] }),
|
31782
|
-
/* @__PURE__ */ (0,
|
31869
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children: renderHeaderActions && renderHeaderActions({
|
31783
31870
|
state: appState,
|
31784
31871
|
dispatch
|
31785
31872
|
}) })
|
@@ -31790,26 +31877,26 @@ var MenuBar = ({
|
|
31790
31877
|
|
31791
31878
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/styles.module.css#css-module
|
31792
31879
|
init_react_import();
|
31793
|
-
var
|
31880
|
+
var styles_module_default15 = { "Puck": "_Puck_1g88c_19", "Puck-portal": "_Puck-portal_1g88c_24", "PuckLayout": "_PuckLayout_1g88c_31", "PuckLayout-inner": "_PuckLayout-inner_1g88c_39", "PuckLayout--mounted": "_PuckLayout--mounted_1g88c_51", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_1g88c_55", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_1g88c_61", "PuckLayout-mounted": "_PuckLayout-mounted_1g88c_75", "PuckLayout-header": "_PuckLayout-header_1g88c_116", "PuckLayout-headerInner": "_PuckLayout-headerInner_1g88c_125", "PuckLayout-headerToggle": "_PuckLayout-headerToggle_1g88c_135", "PuckLayout-rightSideBarToggle": "_PuckLayout-rightSideBarToggle_1g88c_142", "PuckLayout-leftSideBarToggle": "_PuckLayout-leftSideBarToggle_1g88c_143", "PuckLayout-headerTitle": "_PuckLayout-headerTitle_1g88c_147", "PuckLayout-headerPath": "_PuckLayout-headerPath_1g88c_151", "PuckLayout-headerTools": "_PuckLayout-headerTools_1g88c_158", "PuckLayout-menuButton": "_PuckLayout-menuButton_1g88c_164", "PuckLayout--menuOpen": "_PuckLayout--menuOpen_1g88c_169", "PuckLayout-leftSideBar": "_PuckLayout-leftSideBar_1g88c_143", "PuckLayout-rightSideBar": "_PuckLayout-rightSideBar_1g88c_142" };
|
31794
31881
|
|
31795
31882
|
// components/Puck/components/Fields/index.tsx
|
31796
31883
|
init_react_import();
|
31797
31884
|
|
31798
31885
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Fields/styles.module.css#css-module
|
31799
31886
|
init_react_import();
|
31800
|
-
var
|
31887
|
+
var styles_module_default16 = { "PuckFields": "_PuckFields_jp3lw_1", "PuckFields--isLoading": "_PuckFields--isLoading_jp3lw_6", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_jp3lw_10", "PuckFields-loadingOverlayInner": "_PuckFields-loadingOverlayInner_jp3lw_25" };
|
31801
31888
|
|
31802
31889
|
// components/Puck/components/Fields/index.tsx
|
31803
|
-
var
|
31804
|
-
var
|
31805
|
-
var
|
31890
|
+
var import_react21 = require("react");
|
31891
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
31892
|
+
var getClassName21 = get_class_name_factory_default("PuckFields", styles_module_default16);
|
31806
31893
|
var defaultPageFields = {
|
31807
31894
|
title: { type: "text" }
|
31808
31895
|
};
|
31809
31896
|
var DefaultFields = ({
|
31810
31897
|
children
|
31811
31898
|
}) => {
|
31812
|
-
return /* @__PURE__ */ (0,
|
31899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children });
|
31813
31900
|
};
|
31814
31901
|
var useResolvedFields = () => {
|
31815
31902
|
var _a;
|
@@ -31819,14 +31906,14 @@ var useResolvedFields = () => {
|
|
31819
31906
|
const componentConfig = selectedItem ? config.components[selectedItem.type] : null;
|
31820
31907
|
const defaultFields = selectedItem ? componentConfig == null ? void 0 : componentConfig.fields : rootFields;
|
31821
31908
|
const rootProps = data.root.props || data.root;
|
31822
|
-
const [lastSelectedData, setLastSelectedData] = (0,
|
31909
|
+
const [lastSelectedData, setLastSelectedData] = (0, import_react21.useState)(
|
31823
31910
|
{}
|
31824
31911
|
);
|
31825
|
-
const [resolvedFields, setResolvedFields] = (0,
|
31826
|
-
const [fieldsLoading, setFieldsLoading] = (0,
|
31912
|
+
const [resolvedFields, setResolvedFields] = (0, import_react21.useState)(defaultFields || {});
|
31913
|
+
const [fieldsLoading, setFieldsLoading] = (0, import_react21.useState)(false);
|
31827
31914
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
31828
31915
|
const componentData = selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly };
|
31829
|
-
const resolveFields = (0,
|
31916
|
+
const resolveFields = (0, import_react21.useCallback)(
|
31830
31917
|
(..._0) => __async(void 0, [..._0], function* (fields = {}) {
|
31831
31918
|
var _a2, _b, _c;
|
31832
31919
|
const lastData = ((_a2 = lastSelectedData.props) == null ? void 0 : _a2.id) === componentData.props.id ? lastSelectedData : {};
|
@@ -31862,7 +31949,7 @@ var useResolvedFields = () => {
|
|
31862
31949
|
}),
|
31863
31950
|
[data, config, componentData, selectedItem, resolvedFields, state]
|
31864
31951
|
);
|
31865
|
-
(0,
|
31952
|
+
(0, import_react21.useEffect)(() => {
|
31866
31953
|
setFieldsLoading(true);
|
31867
31954
|
resolveFields(defaultFields).then((fields) => {
|
31868
31955
|
setResolvedFields(fields || {});
|
@@ -31888,16 +31975,16 @@ var Fields = () => {
|
|
31888
31975
|
const componentResolving = selectedItem ? (_a = componentState[selectedItem == null ? void 0 : selectedItem.props.id]) == null ? void 0 : _a.loading : (_b = componentState["puck-root"]) == null ? void 0 : _b.loading;
|
31889
31976
|
const isLoading = fieldsResolving || componentResolving;
|
31890
31977
|
const rootProps = data.root.props || data.root;
|
31891
|
-
const Wrapper = (0,
|
31892
|
-
return /* @__PURE__ */ (0,
|
31978
|
+
const Wrapper = (0, import_react21.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
|
31979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
31893
31980
|
"form",
|
31894
31981
|
{
|
31895
|
-
className:
|
31982
|
+
className: getClassName21(),
|
31896
31983
|
onSubmit: (e) => {
|
31897
31984
|
e.preventDefault();
|
31898
31985
|
},
|
31899
31986
|
children: [
|
31900
|
-
/* @__PURE__ */ (0,
|
31987
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Wrapper, { isLoading, itemSelector, children: Object.keys(fields).map((fieldName) => {
|
31901
31988
|
const field = fields[fieldName];
|
31902
31989
|
if (!(field == null ? void 0 : field.type)) return null;
|
31903
31990
|
const onChange = (value, updatedUi) => {
|
@@ -31964,7 +32051,7 @@ var Fields = () => {
|
|
31964
32051
|
};
|
31965
32052
|
if (selectedItem && itemSelector) {
|
31966
32053
|
const { readOnly = {} } = selectedItem;
|
31967
|
-
return /* @__PURE__ */ (0,
|
32054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
31968
32055
|
AutoFieldPrivate,
|
31969
32056
|
{
|
31970
32057
|
field,
|
@@ -31978,7 +32065,7 @@ var Fields = () => {
|
|
31978
32065
|
);
|
31979
32066
|
} else {
|
31980
32067
|
const { readOnly = {} } = data.root;
|
31981
|
-
return /* @__PURE__ */ (0,
|
32068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
31982
32069
|
AutoFieldPrivate,
|
31983
32070
|
{
|
31984
32071
|
field,
|
@@ -31992,7 +32079,7 @@ var Fields = () => {
|
|
31992
32079
|
);
|
31993
32080
|
}
|
31994
32081
|
}) }),
|
31995
|
-
isLoading && /* @__PURE__ */ (0,
|
32082
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getClassName21("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getClassName21("loadingOverlayInner"), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Loader, { size: 16 }) }) })
|
31996
32083
|
]
|
31997
32084
|
}
|
31998
32085
|
);
|
@@ -32003,25 +32090,25 @@ init_react_import();
|
|
32003
32090
|
|
32004
32091
|
// lib/use-component-list.tsx
|
32005
32092
|
init_react_import();
|
32006
|
-
var
|
32093
|
+
var import_react22 = require("react");
|
32007
32094
|
|
32008
32095
|
// components/ComponentList/index.tsx
|
32009
32096
|
init_react_import();
|
32010
32097
|
|
32011
32098
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ComponentList/styles.module.css#css-module
|
32012
32099
|
init_react_import();
|
32013
|
-
var
|
32100
|
+
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" };
|
32014
32101
|
|
32015
32102
|
// components/ComponentList/index.tsx
|
32016
|
-
var
|
32017
|
-
var
|
32103
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
32104
|
+
var getClassName22 = get_class_name_factory_default("ComponentList", styles_module_default17);
|
32018
32105
|
var ComponentListItem = ({
|
32019
32106
|
name,
|
32020
32107
|
label,
|
32021
32108
|
index
|
32022
32109
|
}) => {
|
32023
32110
|
const { overrides } = useAppContext();
|
32024
|
-
return /* @__PURE__ */ (0,
|
32111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Drawer.Item, { label, name, index, children: overrides.componentItem });
|
32025
32112
|
};
|
32026
32113
|
var ComponentList = ({
|
32027
32114
|
children,
|
@@ -32030,11 +32117,11 @@ var ComponentList = ({
|
|
32030
32117
|
}) => {
|
32031
32118
|
const { config, state, setUi } = useAppContext();
|
32032
32119
|
const { expanded = true } = state.ui.componentList[id] || {};
|
32033
|
-
return /* @__PURE__ */ (0,
|
32034
|
-
title && /* @__PURE__ */ (0,
|
32120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: getClassName22({ isExpanded: expanded }), children: [
|
32121
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
32035
32122
|
"button",
|
32036
32123
|
{
|
32037
|
-
className:
|
32124
|
+
className: getClassName22("title"),
|
32038
32125
|
onClick: () => setUi({
|
32039
32126
|
componentList: __spreadProps(__spreadValues({}, state.ui.componentList), {
|
32040
32127
|
[id]: __spreadProps(__spreadValues({}, state.ui.componentList[id]), {
|
@@ -32044,14 +32131,14 @@ var ComponentList = ({
|
|
32044
32131
|
}),
|
32045
32132
|
title: expanded ? `Collapse${title ? ` ${title}` : ""}` : `Expand${title ? ` ${title}` : ""}`,
|
32046
32133
|
children: [
|
32047
|
-
/* @__PURE__ */ (0,
|
32048
|
-
/* @__PURE__ */ (0,
|
32134
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: title }),
|
32135
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName22("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronUp, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronDown, { size: 12 }) })
|
32049
32136
|
]
|
32050
32137
|
}
|
32051
32138
|
),
|
32052
|
-
/* @__PURE__ */ (0,
|
32139
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName22("content"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Drawer, { droppableId: title, children: children || Object.keys(config.components).map((componentKey, i) => {
|
32053
32140
|
var _a;
|
32054
|
-
return /* @__PURE__ */ (0,
|
32141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
32055
32142
|
ComponentListItem,
|
32056
32143
|
{
|
32057
32144
|
label: (_a = config.components[componentKey]["label"]) != null ? _a : componentKey,
|
@@ -32066,10 +32153,10 @@ var ComponentList = ({
|
|
32066
32153
|
ComponentList.Item = ComponentListItem;
|
32067
32154
|
|
32068
32155
|
// lib/use-component-list.tsx
|
32069
|
-
var
|
32156
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
32070
32157
|
var useComponentList = (config, ui) => {
|
32071
|
-
const [componentList, setComponentList] = (0,
|
32072
|
-
(0,
|
32158
|
+
const [componentList, setComponentList] = (0, import_react22.useState)();
|
32159
|
+
(0, import_react22.useEffect)(() => {
|
32073
32160
|
var _a, _b, _c;
|
32074
32161
|
if (Object.keys(ui.componentList).length > 0) {
|
32075
32162
|
const matchedComponents = [];
|
@@ -32079,7 +32166,7 @@ var useComponentList = (config, ui) => {
|
|
32079
32166
|
if (category.visible === false || !category.components) {
|
32080
32167
|
return null;
|
32081
32168
|
}
|
32082
|
-
return /* @__PURE__ */ (0,
|
32169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
32083
32170
|
ComponentList,
|
32084
32171
|
{
|
32085
32172
|
id: categoryKey,
|
@@ -32088,7 +32175,7 @@ var useComponentList = (config, ui) => {
|
|
32088
32175
|
var _a2;
|
32089
32176
|
matchedComponents.push(componentName);
|
32090
32177
|
const componentConf = config.components[componentName] || {};
|
32091
|
-
return /* @__PURE__ */ (0,
|
32178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
32092
32179
|
ComponentList.Item,
|
32093
32180
|
{
|
32094
32181
|
label: (_a2 = componentConf["label"]) != null ? _a2 : componentName,
|
@@ -32108,7 +32195,7 @@ var useComponentList = (config, ui) => {
|
|
32108
32195
|
);
|
32109
32196
|
if (remainingComponents.length > 0 && !((_a = ui.componentList.other) == null ? void 0 : _a.components) && ((_b = ui.componentList.other) == null ? void 0 : _b.visible) !== false) {
|
32110
32197
|
_componentList.push(
|
32111
|
-
/* @__PURE__ */ (0,
|
32198
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
32112
32199
|
ComponentList,
|
32113
32200
|
{
|
32114
32201
|
id: "other",
|
@@ -32116,7 +32203,7 @@ var useComponentList = (config, ui) => {
|
|
32116
32203
|
children: remainingComponents.map((componentName, i) => {
|
32117
32204
|
var _a2;
|
32118
32205
|
const componentConf = config.components[componentName] || {};
|
32119
|
-
return /* @__PURE__ */ (0,
|
32206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
32120
32207
|
ComponentList.Item,
|
32121
32208
|
{
|
32122
32209
|
name: componentName,
|
@@ -32138,25 +32225,25 @@ var useComponentList = (config, ui) => {
|
|
32138
32225
|
};
|
32139
32226
|
|
32140
32227
|
// components/Puck/components/Components/index.tsx
|
32141
|
-
var
|
32142
|
-
var
|
32228
|
+
var import_react23 = require("react");
|
32229
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
32143
32230
|
var Components = () => {
|
32144
32231
|
const { config, state, overrides } = useAppContext();
|
32145
32232
|
const componentList = useComponentList(config, state.ui);
|
32146
|
-
const Wrapper = (0,
|
32147
|
-
return /* @__PURE__ */ (0,
|
32233
|
+
const Wrapper = (0, import_react23.useMemo)(() => overrides.components || "div", [overrides]);
|
32234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ComponentList, { id: "all" }) });
|
32148
32235
|
};
|
32149
32236
|
|
32150
32237
|
// components/Puck/components/Preview/index.tsx
|
32151
32238
|
init_react_import();
|
32152
|
-
var
|
32239
|
+
var import_react25 = require("react");
|
32153
32240
|
|
32154
32241
|
// components/AutoFrame/index.tsx
|
32155
32242
|
init_react_import();
|
32156
|
-
var
|
32243
|
+
var import_react24 = __toESM(require("react"));
|
32157
32244
|
var import_react_frame_component = __toESM(require("react-frame-component"));
|
32158
32245
|
var import_object_hash = __toESM(require("object-hash"));
|
32159
|
-
var
|
32246
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
32160
32247
|
var styleSelector = 'style, link[rel="stylesheet"]';
|
32161
32248
|
var collectStyles = (doc) => {
|
32162
32249
|
const collected = [];
|
@@ -32199,7 +32286,7 @@ var CopyHostStyles = ({
|
|
32199
32286
|
onStylesLoaded = () => null
|
32200
32287
|
}) => {
|
32201
32288
|
const { document: doc, window: win } = (0, import_react_frame_component.useFrame)();
|
32202
|
-
(0,
|
32289
|
+
(0, import_react24.useEffect)(() => {
|
32203
32290
|
if (!win || !doc) {
|
32204
32291
|
return () => {
|
32205
32292
|
};
|
@@ -32356,12 +32443,12 @@ var CopyHostStyles = ({
|
|
32356
32443
|
observer.disconnect();
|
32357
32444
|
};
|
32358
32445
|
}, []);
|
32359
|
-
return /* @__PURE__ */ (0,
|
32446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
|
32360
32447
|
};
|
32361
|
-
var AutoFrameComponent =
|
32448
|
+
var AutoFrameComponent = import_react24.default.forwardRef(
|
32362
32449
|
function(_a, ref) {
|
32363
32450
|
var _b = _a, { children, debug, onStylesLoaded } = _b, props = __objRest(_b, ["children", "debug", "onStylesLoaded"]);
|
32364
|
-
return /* @__PURE__ */ (0,
|
32451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_frame_component.default, __spreadProps(__spreadValues({}, props), { ref, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
|
32365
32452
|
}
|
32366
32453
|
);
|
32367
32454
|
AutoFrameComponent.displayName = "AutoFrameComponent";
|
@@ -32369,14 +32456,14 @@ var AutoFrame_default = AutoFrameComponent;
|
|
32369
32456
|
|
32370
32457
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Preview/styles.module.css#css-module
|
32371
32458
|
init_react_import();
|
32372
|
-
var
|
32459
|
+
var styles_module_default18 = { "PuckPreview": "_PuckPreview_rxwlr_1", "PuckPreview-frame": "_PuckPreview-frame_rxwlr_5" };
|
32373
32460
|
|
32374
32461
|
// components/Puck/components/Preview/index.tsx
|
32375
|
-
var
|
32376
|
-
var
|
32462
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
32463
|
+
var getClassName23 = get_class_name_factory_default("PuckPreview", styles_module_default18);
|
32377
32464
|
var Preview = ({ id = "puck-preview" }) => {
|
32378
32465
|
const { config, dispatch, state, setStatus, iframe } = useAppContext();
|
32379
|
-
const Page = (0,
|
32466
|
+
const Page = (0, import_react25.useCallback)(
|
32380
32467
|
(pageProps) => {
|
32381
32468
|
var _a, _b;
|
32382
32469
|
return ((_a = config.root) == null ? void 0 : _a.render) ? (_b = config.root) == null ? void 0 : _b.render(__spreadProps(__spreadValues({
|
@@ -32385,33 +32472,33 @@ var Preview = ({ id = "puck-preview" }) => {
|
|
32385
32472
|
editMode: true,
|
32386
32473
|
// DEPRECATED
|
32387
32474
|
puck: { renderDropZone: DropZone, isEditing: true }
|
32388
|
-
})) : /* @__PURE__ */ (0,
|
32475
|
+
})) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: pageProps.children });
|
32389
32476
|
},
|
32390
32477
|
[config.root]
|
32391
32478
|
);
|
32392
32479
|
const rootProps = state.data.root.props || state.data.root;
|
32393
|
-
const ref = (0,
|
32394
|
-
return /* @__PURE__ */ (0,
|
32480
|
+
const ref = (0, import_react25.useRef)(null);
|
32481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
32395
32482
|
"div",
|
32396
32483
|
{
|
32397
|
-
className:
|
32484
|
+
className: getClassName23(),
|
32398
32485
|
id,
|
32399
32486
|
onClick: () => {
|
32400
32487
|
dispatch({ type: "setUi", ui: __spreadProps(__spreadValues({}, state.ui), { itemSelector: null }) });
|
32401
32488
|
},
|
32402
|
-
children: iframe.enabled ? /* @__PURE__ */ (0,
|
32489
|
+
children: iframe.enabled ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
32403
32490
|
AutoFrame_default,
|
32404
32491
|
{
|
32405
32492
|
id: "preview-frame",
|
32406
|
-
className:
|
32493
|
+
className: getClassName23("frame"),
|
32407
32494
|
"data-rfd-iframe": true,
|
32408
32495
|
ref,
|
32409
32496
|
onStylesLoaded: () => {
|
32410
32497
|
setStatus("READY");
|
32411
32498
|
},
|
32412
|
-
children: /* @__PURE__ */ (0,
|
32499
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Page, __spreadProps(__spreadValues({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DropZone, { zone: rootDroppableId }) }))
|
32413
32500
|
}
|
32414
|
-
) : /* @__PURE__ */ (0,
|
32501
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { id: "preview-frame", className: getClassName23("frame"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Page, __spreadProps(__spreadValues({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DropZone, { zone: rootDroppableId }) })) })
|
32415
32502
|
}
|
32416
32503
|
);
|
32417
32504
|
};
|
@@ -32445,7 +32532,7 @@ init_react_import();
|
|
32445
32532
|
|
32446
32533
|
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css#css-module
|
32447
32534
|
init_react_import();
|
32448
|
-
var
|
32535
|
+
var styles_module_default19 = { "LayerTree": "_LayerTree_1pgw8_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_1pgw8_11", "LayerTree-helper": "_LayerTree-helper_1pgw8_17", "Layer": "_Layer_1pgw8_1", "Layer-inner": "_Layer-inner_1pgw8_29", "Layer--containsZone": "_Layer--containsZone_1pgw8_35", "Layer-clickable": "_Layer-clickable_1pgw8_39", "Layer--isSelected": "_Layer--isSelected_1pgw8_61", "Layer-chevron": "_Layer-chevron_1pgw8_77", "Layer--childIsSelected": "_Layer--childIsSelected_1pgw8_78", "Layer-zones": "_Layer-zones_1pgw8_82", "Layer-title": "_Layer-title_1pgw8_96", "Layer-name": "_Layer-name_1pgw8_105", "Layer-icon": "_Layer-icon_1pgw8_111", "Layer-zoneIcon": "_Layer-zoneIcon_1pgw8_116" };
|
32449
32536
|
|
32450
32537
|
// lib/scroll-into-view.ts
|
32451
32538
|
init_react_import();
|
@@ -32459,7 +32546,7 @@ var scrollIntoView = (el) => {
|
|
32459
32546
|
};
|
32460
32547
|
|
32461
32548
|
// components/LayerTree/index.tsx
|
32462
|
-
var
|
32549
|
+
var import_react26 = require("react");
|
32463
32550
|
|
32464
32551
|
// lib/is-child-of-zone.ts
|
32465
32552
|
init_react_import();
|
@@ -32473,9 +32560,9 @@ var isChildOfZone = (item, maybeChild, ctx) => {
|
|
32473
32560
|
};
|
32474
32561
|
|
32475
32562
|
// components/LayerTree/index.tsx
|
32476
|
-
var
|
32477
|
-
var
|
32478
|
-
var getClassNameLayer = get_class_name_factory_default("Layer",
|
32563
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
32564
|
+
var getClassName24 = get_class_name_factory_default("LayerTree", styles_module_default19);
|
32565
|
+
var getClassNameLayer = get_class_name_factory_default("Layer", styles_module_default19);
|
32479
32566
|
var LayerTree = ({
|
32480
32567
|
data,
|
32481
32568
|
config,
|
@@ -32486,15 +32573,15 @@ var LayerTree = ({
|
|
32486
32573
|
label
|
32487
32574
|
}) => {
|
32488
32575
|
const zones = data.zones || {};
|
32489
|
-
const ctx = (0,
|
32490
|
-
return /* @__PURE__ */ (0,
|
32491
|
-
label && /* @__PURE__ */ (0,
|
32492
|
-
/* @__PURE__ */ (0,
|
32576
|
+
const ctx = (0, import_react26.useContext)(dropZoneContext);
|
32577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
32578
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName24("zoneTitle"), children: [
|
32579
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Layers, { size: "16" }) }),
|
32493
32580
|
" ",
|
32494
32581
|
label
|
32495
32582
|
] }),
|
32496
|
-
/* @__PURE__ */ (0,
|
32497
|
-
zoneContent.length === 0 && /* @__PURE__ */ (0,
|
32583
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("ul", { className: getClassName24(), children: [
|
32584
|
+
zoneContent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("helper"), children: "No items" }),
|
32498
32585
|
zoneContent.map((item, i) => {
|
32499
32586
|
var _a;
|
32500
32587
|
const isSelected = (itemSelector == null ? void 0 : itemSelector.index) === i && (itemSelector.zone === zone || itemSelector.zone === rootDroppableId && !zone);
|
@@ -32512,7 +32599,7 @@ var LayerTree = ({
|
|
32512
32599
|
const childIsSelected = isChildOfZone(item, selectedItem, ctx);
|
32513
32600
|
const componentConfig = config.components[item.type];
|
32514
32601
|
const label2 = (_a = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _a : item.type.toString();
|
32515
|
-
return /* @__PURE__ */ (0,
|
32602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
32516
32603
|
"li",
|
32517
32604
|
{
|
32518
32605
|
className: getClassNameLayer({
|
@@ -32522,7 +32609,7 @@ var LayerTree = ({
|
|
32522
32609
|
childIsSelected
|
32523
32610
|
}),
|
32524
32611
|
children: [
|
32525
|
-
/* @__PURE__ */ (0,
|
32612
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
32526
32613
|
"button",
|
32527
32614
|
{
|
32528
32615
|
className: getClassNameLayer("clickable"),
|
@@ -32554,22 +32641,22 @@ var LayerTree = ({
|
|
32554
32641
|
setHoveringComponent(null);
|
32555
32642
|
},
|
32556
32643
|
children: [
|
32557
|
-
containsZone && /* @__PURE__ */ (0,
|
32644
|
+
containsZone && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
32558
32645
|
"div",
|
32559
32646
|
{
|
32560
32647
|
className: getClassNameLayer("chevron"),
|
32561
32648
|
title: isSelected ? "Collapse" : "Expand",
|
32562
|
-
children: /* @__PURE__ */ (0,
|
32649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronDown, { size: "12" })
|
32563
32650
|
}
|
32564
32651
|
),
|
32565
|
-
/* @__PURE__ */ (0,
|
32566
|
-
/* @__PURE__ */ (0,
|
32567
|
-
/* @__PURE__ */ (0,
|
32652
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassNameLayer("title"), children: [
|
32653
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Type, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LayoutGrid, { size: "16" }) }),
|
32654
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("name"), children: label2 })
|
32568
32655
|
] })
|
32569
32656
|
]
|
32570
32657
|
}
|
32571
32658
|
) }),
|
32572
|
-
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0,
|
32659
|
+
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
32573
32660
|
LayerTree,
|
32574
32661
|
{
|
32575
32662
|
config,
|
@@ -32591,13 +32678,13 @@ var LayerTree = ({
|
|
32591
32678
|
};
|
32592
32679
|
|
32593
32680
|
// components/Puck/components/Outline/index.tsx
|
32594
|
-
var
|
32595
|
-
var
|
32681
|
+
var import_react27 = require("react");
|
32682
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
32596
32683
|
var Outline = () => {
|
32597
32684
|
const { dispatch, state, overrides, config } = useAppContext();
|
32598
32685
|
const { data, ui } = state;
|
32599
32686
|
const { itemSelector } = ui;
|
32600
|
-
const setItemSelector = (0,
|
32687
|
+
const setItemSelector = (0, import_react27.useCallback)(
|
32601
32688
|
(newItemSelector) => {
|
32602
32689
|
dispatch({
|
32603
32690
|
type: "setUi",
|
@@ -32606,9 +32693,9 @@ var Outline = () => {
|
|
32606
32693
|
},
|
32607
32694
|
[]
|
32608
32695
|
);
|
32609
|
-
const Wrapper = (0,
|
32610
|
-
return /* @__PURE__ */ (0,
|
32611
|
-
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0,
|
32696
|
+
const Wrapper = (0, import_react27.useMemo)(() => overrides.outline || "div", [overrides]);
|
32697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(dropZoneContext.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
32698
|
+
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
32612
32699
|
LayerTree,
|
32613
32700
|
{
|
32614
32701
|
config,
|
@@ -32621,7 +32708,7 @@ var Outline = () => {
|
|
32621
32708
|
),
|
32622
32709
|
Object.entries(findZonesForArea(data, "root")).map(
|
32623
32710
|
([zoneKey, zone]) => {
|
32624
|
-
return /* @__PURE__ */ (0,
|
32711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
32625
32712
|
LayerTree,
|
32626
32713
|
{
|
32627
32714
|
config,
|
@@ -32639,37 +32726,6 @@ var Outline = () => {
|
|
32639
32726
|
] }) }) });
|
32640
32727
|
};
|
32641
32728
|
|
32642
|
-
// lib/load-overrides.ts
|
32643
|
-
init_react_import();
|
32644
|
-
var loadOverrides = ({
|
32645
|
-
overrides,
|
32646
|
-
plugins
|
32647
|
-
}) => {
|
32648
|
-
const collected = __spreadValues({}, overrides);
|
32649
|
-
plugins.forEach((plugin) => {
|
32650
|
-
Object.keys(plugin.overrides).forEach((overridesType) => {
|
32651
|
-
if (overridesType === "fieldTypes") {
|
32652
|
-
const fieldTypes = plugin.overrides.fieldTypes;
|
32653
|
-
Object.keys(fieldTypes).forEach((fieldType) => {
|
32654
|
-
collected.fieldTypes = collected.fieldTypes || {};
|
32655
|
-
const childNode2 = collected.fieldTypes[fieldType];
|
32656
|
-
const Comp2 = (props) => fieldTypes[fieldType](__spreadProps(__spreadValues({}, props), {
|
32657
|
-
children: childNode2 ? childNode2(props) : props.children
|
32658
|
-
}));
|
32659
|
-
collected.fieldTypes[fieldType] = Comp2;
|
32660
|
-
});
|
32661
|
-
return;
|
32662
|
-
}
|
32663
|
-
const childNode = collected[overridesType];
|
32664
|
-
const Comp = (props) => plugin.overrides[overridesType](__spreadProps(__spreadValues({}, props), {
|
32665
|
-
children: childNode ? childNode(props) : props.children
|
32666
|
-
}));
|
32667
|
-
collected[overridesType] = Comp;
|
32668
|
-
});
|
32669
|
-
});
|
32670
|
-
return collected;
|
32671
|
-
};
|
32672
|
-
|
32673
32729
|
// lib/use-puck-history.ts
|
32674
32730
|
init_react_import();
|
32675
32731
|
var import_react_hotkeys_hook = require("react-hotkeys-hook");
|
@@ -32726,19 +32782,19 @@ function usePuckHistory({
|
|
32726
32782
|
|
32727
32783
|
// lib/use-history-store.ts
|
32728
32784
|
init_react_import();
|
32729
|
-
var
|
32785
|
+
var import_react28 = require("react");
|
32730
32786
|
var import_use_debounce3 = require("use-debounce");
|
32731
32787
|
var EMPTY_HISTORY_INDEX = -1;
|
32732
32788
|
function useHistoryStore(initialHistory) {
|
32733
32789
|
var _a, _b;
|
32734
|
-
const [histories, setHistories] = (0,
|
32790
|
+
const [histories, setHistories] = (0, import_react28.useState)(
|
32735
32791
|
(_a = initialHistory == null ? void 0 : initialHistory.histories) != null ? _a : []
|
32736
32792
|
);
|
32737
32793
|
const updateHistories = (histories2) => {
|
32738
32794
|
setHistories(histories2);
|
32739
32795
|
setIndex(histories2.length - 1);
|
32740
32796
|
};
|
32741
|
-
const [index, setIndex] = (0,
|
32797
|
+
const [index, setIndex] = (0, import_react28.useState)(
|
32742
32798
|
(_b = initialHistory == null ? void 0 : initialHistory.index) != null ? _b : EMPTY_HISTORY_INDEX
|
32743
32799
|
);
|
32744
32800
|
const hasPast = index > EMPTY_HISTORY_INDEX;
|
@@ -32898,25 +32954,25 @@ var getBox = function getBox2(el) {
|
|
32898
32954
|
};
|
32899
32955
|
|
32900
32956
|
// components/Puck/components/Canvas/index.tsx
|
32901
|
-
var
|
32957
|
+
var import_react30 = require("react");
|
32902
32958
|
|
32903
32959
|
// components/ViewportControls/index.tsx
|
32904
32960
|
init_react_import();
|
32905
|
-
var
|
32961
|
+
var import_react29 = require("react");
|
32906
32962
|
|
32907
32963
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
|
32908
32964
|
init_react_import();
|
32909
|
-
var
|
32965
|
+
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" };
|
32910
32966
|
|
32911
32967
|
// components/ViewportControls/index.tsx
|
32912
|
-
var
|
32968
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
32913
32969
|
var icons = {
|
32914
|
-
Smartphone: /* @__PURE__ */ (0,
|
32915
|
-
Tablet: /* @__PURE__ */ (0,
|
32916
|
-
Monitor: /* @__PURE__ */ (0,
|
32970
|
+
Smartphone: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Smartphone, { size: 16 }),
|
32971
|
+
Tablet: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Tablet, { size: 16 }),
|
32972
|
+
Monitor: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Monitor, { size: 16 })
|
32917
32973
|
};
|
32918
|
-
var
|
32919
|
-
var getClassNameButton = get_class_name_factory_default("ViewportButton",
|
32974
|
+
var getClassName25 = get_class_name_factory_default("ViewportControls", styles_module_default20);
|
32975
|
+
var getClassNameButton = get_class_name_factory_default("ViewportButton", styles_module_default20);
|
32920
32976
|
var ViewportButton = ({
|
32921
32977
|
children,
|
32922
32978
|
height = "auto",
|
@@ -32925,11 +32981,11 @@ var ViewportButton = ({
|
|
32925
32981
|
onClick
|
32926
32982
|
}) => {
|
32927
32983
|
const { state } = useAppContext();
|
32928
|
-
const [isActive, setIsActive] = (0,
|
32929
|
-
(0,
|
32984
|
+
const [isActive, setIsActive] = (0, import_react29.useState)(false);
|
32985
|
+
(0, import_react29.useEffect)(() => {
|
32930
32986
|
setIsActive(width === state.ui.viewports.current.width);
|
32931
32987
|
}, [width, state.ui.viewports.current.width]);
|
32932
|
-
return /* @__PURE__ */ (0,
|
32988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: getClassNameButton({ isActive }), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
32933
32989
|
IconButton,
|
32934
32990
|
{
|
32935
32991
|
title,
|
@@ -32938,7 +32994,7 @@ var ViewportButton = ({
|
|
32938
32994
|
e.stopPropagation();
|
32939
32995
|
onClick({ width, height });
|
32940
32996
|
},
|
32941
|
-
children: /* @__PURE__ */ (0,
|
32997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: getClassNameButton("inner"), children })
|
32942
32998
|
}
|
32943
32999
|
) });
|
32944
33000
|
};
|
@@ -32962,7 +33018,7 @@ var ViewportControls = ({
|
|
32962
33018
|
const defaultsContainAutoZoom = defaultZoomOptions.find(
|
32963
33019
|
(option) => option.value === autoZoom
|
32964
33020
|
);
|
32965
|
-
const zoomOptions = (0,
|
33021
|
+
const zoomOptions = (0, import_react29.useMemo)(
|
32966
33022
|
() => [
|
32967
33023
|
...defaultZoomOptions,
|
32968
33024
|
...defaultsContainAutoZoom ? [] : [
|
@@ -32974,8 +33030,8 @@ var ViewportControls = ({
|
|
32974
33030
|
].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
|
32975
33031
|
[autoZoom]
|
32976
33032
|
);
|
32977
|
-
return /* @__PURE__ */ (0,
|
32978
|
-
viewports.map((viewport, i) => /* @__PURE__ */ (0,
|
33033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getClassName25(), children: [
|
33034
|
+
viewports.map((viewport, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
32979
33035
|
ViewportButton,
|
32980
33036
|
{
|
32981
33037
|
height: viewport.height,
|
@@ -32986,8 +33042,8 @@ var ViewportControls = ({
|
|
32986
33042
|
},
|
32987
33043
|
i
|
32988
33044
|
)),
|
32989
|
-
/* @__PURE__ */ (0,
|
32990
|
-
/* @__PURE__ */ (0,
|
33045
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getClassName25("divider") }),
|
33046
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
32991
33047
|
IconButton,
|
32992
33048
|
{
|
32993
33049
|
title: "Zoom viewport out",
|
@@ -33001,10 +33057,10 @@ var ViewportControls = ({
|
|
33001
33057
|
)].value
|
33002
33058
|
);
|
33003
33059
|
},
|
33004
|
-
children: /* @__PURE__ */ (0,
|
33060
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ZoomOut, { size: 16 })
|
33005
33061
|
}
|
33006
33062
|
),
|
33007
|
-
/* @__PURE__ */ (0,
|
33063
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
33008
33064
|
IconButton,
|
33009
33065
|
{
|
33010
33066
|
title: "Zoom viewport in",
|
@@ -33018,19 +33074,19 @@ var ViewportControls = ({
|
|
33018
33074
|
)].value
|
33019
33075
|
);
|
33020
33076
|
},
|
33021
|
-
children: /* @__PURE__ */ (0,
|
33077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ZoomIn, { size: 16 })
|
33022
33078
|
}
|
33023
33079
|
),
|
33024
|
-
/* @__PURE__ */ (0,
|
33025
|
-
/* @__PURE__ */ (0,
|
33080
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getClassName25("divider") }),
|
33081
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
33026
33082
|
"select",
|
33027
33083
|
{
|
33028
|
-
className:
|
33084
|
+
className: getClassName25("zoomSelect"),
|
33029
33085
|
value: zoom.toString(),
|
33030
33086
|
onChange: (e) => {
|
33031
33087
|
onZoom(parseFloat(e.currentTarget.value));
|
33032
33088
|
},
|
33033
|
-
children: zoomOptions.map((option) => /* @__PURE__ */ (0,
|
33089
|
+
children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
33034
33090
|
"option",
|
33035
33091
|
{
|
33036
33092
|
value: option.value,
|
@@ -33045,7 +33101,7 @@ var ViewportControls = ({
|
|
33045
33101
|
|
33046
33102
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
|
33047
33103
|
init_react_import();
|
33048
|
-
var
|
33104
|
+
var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_6zd4y_1", "PuckCanvas-controls": "_PuckCanvas-controls_6zd4y_16", "PuckCanvas-inner": "_PuckCanvas-inner_6zd4y_21", "PuckCanvas-root": "_PuckCanvas-root_6zd4y_32", "PuckCanvas--ready": "_PuckCanvas--ready_6zd4y_56" };
|
33049
33105
|
|
33050
33106
|
// lib/get-zoom-config.ts
|
33051
33107
|
init_react_import();
|
@@ -33078,24 +33134,24 @@ var getZoomConfig = (uiViewport, frame, zoom) => {
|
|
33078
33134
|
};
|
33079
33135
|
|
33080
33136
|
// components/Puck/components/Canvas/index.tsx
|
33081
|
-
var
|
33082
|
-
var
|
33137
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
33138
|
+
var getClassName26 = get_class_name_factory_default("PuckCanvas", styles_module_default21);
|
33083
33139
|
var ZOOM_ON_CHANGE = true;
|
33084
33140
|
var Canvas = () => {
|
33085
33141
|
const { status, iframe } = useAppContext();
|
33086
33142
|
const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext();
|
33087
33143
|
const { ui } = state;
|
33088
|
-
const frameRef = (0,
|
33089
|
-
const [showTransition, setShowTransition] = (0,
|
33090
|
-
const defaultRender = (0,
|
33091
|
-
const PuckDefault = ({ children }) => /* @__PURE__ */ (0,
|
33144
|
+
const frameRef = (0, import_react30.useRef)(null);
|
33145
|
+
const [showTransition, setShowTransition] = (0, import_react30.useState)(false);
|
33146
|
+
const defaultRender = (0, import_react30.useMemo)(() => {
|
33147
|
+
const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children });
|
33092
33148
|
return PuckDefault;
|
33093
33149
|
}, []);
|
33094
|
-
const CustomPreview = (0,
|
33150
|
+
const CustomPreview = (0, import_react30.useMemo)(
|
33095
33151
|
() => overrides.preview || defaultRender,
|
33096
33152
|
[overrides]
|
33097
33153
|
);
|
33098
|
-
const getFrameDimensions = (0,
|
33154
|
+
const getFrameDimensions = (0, import_react30.useCallback)(() => {
|
33099
33155
|
if (frameRef.current) {
|
33100
33156
|
const frame = frameRef.current;
|
33101
33157
|
const box = getBox(frame);
|
@@ -33103,7 +33159,7 @@ var Canvas = () => {
|
|
33103
33159
|
}
|
33104
33160
|
return { width: 0, height: 0 };
|
33105
33161
|
}, [frameRef]);
|
33106
|
-
const resetAutoZoom = (0,
|
33162
|
+
const resetAutoZoom = (0, import_react30.useCallback)(
|
33107
33163
|
(ui2 = state.ui) => {
|
33108
33164
|
if (frameRef.current) {
|
33109
33165
|
setZoomConfig(
|
@@ -33113,11 +33169,11 @@ var Canvas = () => {
|
|
33113
33169
|
},
|
33114
33170
|
[frameRef, zoomConfig, state.ui]
|
33115
33171
|
);
|
33116
|
-
(0,
|
33172
|
+
(0, import_react30.useEffect)(() => {
|
33117
33173
|
setShowTransition(false);
|
33118
33174
|
resetAutoZoom();
|
33119
33175
|
}, [frameRef, ui.leftSideBarVisible, ui.rightSideBarVisible]);
|
33120
|
-
(0,
|
33176
|
+
(0, import_react30.useEffect)(() => {
|
33121
33177
|
const { height: frameHeight } = getFrameDimensions();
|
33122
33178
|
if (ui.viewports.current.height === "auto") {
|
33123
33179
|
setZoomConfig(__spreadProps(__spreadValues({}, zoomConfig), {
|
@@ -33125,7 +33181,7 @@ var Canvas = () => {
|
|
33125
33181
|
}));
|
33126
33182
|
}
|
33127
33183
|
}, [zoomConfig.zoom]);
|
33128
|
-
(0,
|
33184
|
+
(0, import_react30.useEffect)(() => {
|
33129
33185
|
const observer = new ResizeObserver(() => {
|
33130
33186
|
setShowTransition(false);
|
33131
33187
|
resetAutoZoom();
|
@@ -33137,10 +33193,10 @@ var Canvas = () => {
|
|
33137
33193
|
observer.disconnect();
|
33138
33194
|
};
|
33139
33195
|
}, []);
|
33140
|
-
return /* @__PURE__ */ (0,
|
33196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
33141
33197
|
"div",
|
33142
33198
|
{
|
33143
|
-
className:
|
33199
|
+
className: getClassName26({
|
33144
33200
|
ready: status === "READY" || !iframe.enabled
|
33145
33201
|
}),
|
33146
33202
|
onClick: () => dispatch({
|
@@ -33149,7 +33205,7 @@ var Canvas = () => {
|
|
33149
33205
|
recordHistory: true
|
33150
33206
|
}),
|
33151
33207
|
children: [
|
33152
|
-
ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0,
|
33208
|
+
ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getClassName26("controls"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
33153
33209
|
ViewportControls,
|
33154
33210
|
{
|
33155
33211
|
autoZoom: zoomConfig.autoZoom,
|
@@ -33174,10 +33230,10 @@ var Canvas = () => {
|
|
33174
33230
|
}
|
33175
33231
|
}
|
33176
33232
|
) }),
|
33177
|
-
/* @__PURE__ */ (0,
|
33233
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getClassName26("inner"), ref: frameRef, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
33178
33234
|
"div",
|
33179
33235
|
{
|
33180
|
-
className:
|
33236
|
+
className: getClassName26("root"),
|
33181
33237
|
style: {
|
33182
33238
|
width: iframe.enabled ? ui.viewports.current.width : "100%",
|
33183
33239
|
height: zoomConfig.rootHeight,
|
@@ -33186,7 +33242,7 @@ var Canvas = () => {
|
|
33186
33242
|
overflow: iframe.enabled ? void 0 : "auto"
|
33187
33243
|
},
|
33188
33244
|
suppressHydrationWarning: true,
|
33189
|
-
children: /* @__PURE__ */ (0,
|
33245
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Preview, {}) })
|
33190
33246
|
}
|
33191
33247
|
) })
|
33192
33248
|
]
|
@@ -33227,9 +33283,9 @@ var insertComponent = (componentType, zone, index, {
|
|
33227
33283
|
};
|
33228
33284
|
|
33229
33285
|
// components/Puck/index.tsx
|
33230
|
-
var
|
33231
|
-
var
|
33232
|
-
var getLayoutClassName = get_class_name_factory_default("PuckLayout",
|
33286
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
33287
|
+
var getClassName27 = get_class_name_factory_default("Puck", styles_module_default15);
|
33288
|
+
var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_module_default15);
|
33233
33289
|
function Puck({
|
33234
33290
|
children,
|
33235
33291
|
config,
|
@@ -33238,6 +33294,7 @@ function Puck({
|
|
33238
33294
|
onChange,
|
33239
33295
|
onPublish,
|
33240
33296
|
onAction,
|
33297
|
+
permissions = {},
|
33241
33298
|
plugins = [],
|
33242
33299
|
overrides = {},
|
33243
33300
|
renderHeader,
|
@@ -33253,10 +33310,10 @@ function Puck({
|
|
33253
33310
|
}) {
|
33254
33311
|
var _a;
|
33255
33312
|
const historyStore = useHistoryStore(initialHistory);
|
33256
|
-
const [reducer] = (0,
|
33313
|
+
const [reducer] = (0, import_react31.useState)(
|
33257
33314
|
() => createReducer({ config, record: historyStore.record, onAction })
|
33258
33315
|
);
|
33259
|
-
const [initialAppState] = (0,
|
33316
|
+
const [initialAppState] = (0, import_react31.useState)(() => {
|
33260
33317
|
var _a2, _b, _c, _d, _e, _f, _g;
|
33261
33318
|
const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
|
33262
33319
|
let clientUiState = {};
|
@@ -33314,7 +33371,7 @@ function Puck({
|
|
33314
33371
|
})
|
33315
33372
|
});
|
33316
33373
|
});
|
33317
|
-
const [appState, dispatch] = (0,
|
33374
|
+
const [appState, dispatch] = (0, import_react31.useReducer)(
|
33318
33375
|
reducer,
|
33319
33376
|
flushZones(initialAppState)
|
33320
33377
|
);
|
@@ -33325,9 +33382,9 @@ function Puck({
|
|
33325
33382
|
config,
|
33326
33383
|
dispatch
|
33327
33384
|
);
|
33328
|
-
const [menuOpen, setMenuOpen] = (0,
|
33385
|
+
const [menuOpen, setMenuOpen] = (0, import_react31.useState)(false);
|
33329
33386
|
const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
|
33330
|
-
const setItemSelector = (0,
|
33387
|
+
const setItemSelector = (0, import_react31.useCallback)(
|
33331
33388
|
(newItemSelector) => {
|
33332
33389
|
if (newItemSelector === itemSelector) return;
|
33333
33390
|
dispatch({
|
@@ -33339,13 +33396,13 @@ function Puck({
|
|
33339
33396
|
[itemSelector]
|
33340
33397
|
);
|
33341
33398
|
const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
|
33342
|
-
(0,
|
33399
|
+
(0, import_react31.useEffect)(() => {
|
33343
33400
|
if (onChange) onChange(data);
|
33344
33401
|
}, [data]);
|
33345
33402
|
const { onDragStartOrUpdate, placeholderStyle } = usePlaceholderStyle();
|
33346
|
-
const [draggedItem, setDraggedItem] = (0,
|
33403
|
+
const [draggedItem, setDraggedItem] = (0, import_react31.useState)();
|
33347
33404
|
const rootProps = data.root.props || data.root;
|
33348
|
-
const toggleSidebars = (0,
|
33405
|
+
const toggleSidebars = (0, import_react31.useCallback)(
|
33349
33406
|
(sidebar) => {
|
33350
33407
|
const widerViewport = window.matchMedia("(min-width: 638px)").matches;
|
33351
33408
|
const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
|
@@ -33359,7 +33416,7 @@ function Puck({
|
|
33359
33416
|
},
|
33360
33417
|
[dispatch, leftSideBarVisible, rightSideBarVisible]
|
33361
33418
|
);
|
33362
|
-
(0,
|
33419
|
+
(0, import_react31.useEffect)(() => {
|
33363
33420
|
if (!window.matchMedia("(min-width: 638px)").matches) {
|
33364
33421
|
dispatch({
|
33365
33422
|
type: "setUi",
|
@@ -33382,11 +33439,7 @@ function Puck({
|
|
33382
33439
|
window.removeEventListener("resize", handleResize);
|
33383
33440
|
};
|
33384
33441
|
}, []);
|
33385
|
-
const
|
33386
|
-
const PuckDefault = ({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_jsx_runtime36.Fragment, { children: children2 });
|
33387
|
-
return PuckDefault;
|
33388
|
-
}, []);
|
33389
|
-
const defaultHeaderRender = (0, import_react30.useMemo)(() => {
|
33442
|
+
const defaultHeaderRender = (0, import_react31.useMemo)(() => {
|
33390
33443
|
if (renderHeader) {
|
33391
33444
|
console.warn(
|
33392
33445
|
"`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
|
@@ -33394,48 +33447,49 @@ function Puck({
|
|
33394
33447
|
const RenderHeader = (_a2) => {
|
33395
33448
|
var _b = _a2, { actions } = _b, props = __objRest(_b, ["actions"]);
|
33396
33449
|
const Comp = renderHeader;
|
33397
|
-
return /* @__PURE__ */ (0,
|
33450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
|
33398
33451
|
};
|
33399
33452
|
return RenderHeader;
|
33400
33453
|
}
|
33401
|
-
return
|
33454
|
+
return DefaultOverride;
|
33402
33455
|
}, [renderHeader]);
|
33403
|
-
const defaultHeaderActionsRender = (0,
|
33456
|
+
const defaultHeaderActionsRender = (0, import_react31.useMemo)(() => {
|
33404
33457
|
if (renderHeaderActions) {
|
33405
33458
|
console.warn(
|
33406
33459
|
"`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
|
33407
33460
|
);
|
33408
33461
|
const RenderHeader = (props) => {
|
33409
33462
|
const Comp = renderHeaderActions;
|
33410
|
-
return /* @__PURE__ */ (0,
|
33463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
|
33411
33464
|
};
|
33412
33465
|
return RenderHeader;
|
33413
33466
|
}
|
33414
|
-
return
|
33467
|
+
return DefaultOverride;
|
33415
33468
|
}, [renderHeader]);
|
33416
|
-
const loadedOverrides = (
|
33417
|
-
|
33418
|
-
|
33419
|
-
|
33420
|
-
|
33469
|
+
const loadedOverrides = useLoadedOverrides({
|
33470
|
+
overrides,
|
33471
|
+
plugins
|
33472
|
+
});
|
33473
|
+
const CustomPuck = (0, import_react31.useMemo)(
|
33474
|
+
() => loadedOverrides.puck || DefaultOverride,
|
33421
33475
|
[loadedOverrides]
|
33422
33476
|
);
|
33423
|
-
const CustomHeader = (0,
|
33477
|
+
const CustomHeader = (0, import_react31.useMemo)(
|
33424
33478
|
() => loadedOverrides.header || defaultHeaderRender,
|
33425
33479
|
[loadedOverrides]
|
33426
33480
|
);
|
33427
|
-
const CustomHeaderActions = (0,
|
33481
|
+
const CustomHeaderActions = (0, import_react31.useMemo)(
|
33428
33482
|
() => loadedOverrides.headerActions || defaultHeaderActionsRender,
|
33429
33483
|
[loadedOverrides]
|
33430
33484
|
);
|
33431
|
-
const [mounted, setMounted] = (0,
|
33432
|
-
(0,
|
33485
|
+
const [mounted, setMounted] = (0, import_react31.useState)(false);
|
33486
|
+
(0, import_react31.useEffect)(() => {
|
33433
33487
|
setMounted(true);
|
33434
33488
|
}, []);
|
33435
33489
|
const selectedComponentConfig = selectedItem && config.components[selectedItem.type];
|
33436
33490
|
const selectedComponentLabel = selectedItem ? (_a = selectedComponentConfig == null ? void 0 : selectedComponentConfig["label"]) != null ? _a : selectedItem.type.toString() : "";
|
33437
|
-
return /* @__PURE__ */ (0,
|
33438
|
-
/* @__PURE__ */ (0,
|
33491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: `Puck ${getClassName27()}`, children: [
|
33492
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33439
33493
|
AppProvider,
|
33440
33494
|
{
|
33441
33495
|
value: {
|
@@ -33448,9 +33502,14 @@ function Puck({
|
|
33448
33502
|
overrides: loadedOverrides,
|
33449
33503
|
history,
|
33450
33504
|
viewports,
|
33451
|
-
iframe
|
33505
|
+
iframe,
|
33506
|
+
globalPermissions: __spreadValues({
|
33507
|
+
delete: true,
|
33508
|
+
drag: true,
|
33509
|
+
duplicate: true
|
33510
|
+
}, permissions)
|
33452
33511
|
},
|
33453
|
-
children: /* @__PURE__ */ (0,
|
33512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33454
33513
|
DragDropContext,
|
33455
33514
|
{
|
33456
33515
|
autoScrollerOptions: { disabled: dnd == null ? void 0 : dnd.disableAutoScroll },
|
@@ -33502,7 +33561,7 @@ function Puck({
|
|
33502
33561
|
});
|
33503
33562
|
}
|
33504
33563
|
},
|
33505
|
-
children: /* @__PURE__ */ (0,
|
33564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33506
33565
|
DropZoneProvider,
|
33507
33566
|
{
|
33508
33567
|
value: {
|
@@ -33516,7 +33575,7 @@ function Puck({
|
|
33516
33575
|
mode: "edit",
|
33517
33576
|
areaId: "root"
|
33518
33577
|
},
|
33519
|
-
children: /* @__PURE__ */ (0,
|
33578
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33520
33579
|
"div",
|
33521
33580
|
{
|
33522
33581
|
className: getLayoutClassName({
|
@@ -33525,64 +33584,64 @@ function Puck({
|
|
33525
33584
|
mounted,
|
33526
33585
|
rightSideBarVisible
|
33527
33586
|
}),
|
33528
|
-
children: /* @__PURE__ */ (0,
|
33529
|
-
/* @__PURE__ */ (0,
|
33587
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("inner"), children: [
|
33588
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33530
33589
|
CustomHeader,
|
33531
33590
|
{
|
33532
|
-
actions: /* @__PURE__ */ (0,
|
33591
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33533
33592
|
Button,
|
33534
33593
|
{
|
33535
33594
|
onClick: () => {
|
33536
33595
|
onPublish && onPublish(data);
|
33537
33596
|
},
|
33538
|
-
icon: /* @__PURE__ */ (0,
|
33597
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Globe, { size: "14px" }),
|
33539
33598
|
children: "Publish"
|
33540
33599
|
}
|
33541
33600
|
) }) }),
|
33542
|
-
children: /* @__PURE__ */ (0,
|
33543
|
-
/* @__PURE__ */ (0,
|
33544
|
-
/* @__PURE__ */ (0,
|
33601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("header", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerInner"), children: [
|
33602
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerToggle"), children: [
|
33603
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33545
33604
|
"div",
|
33546
33605
|
{
|
33547
33606
|
className: getLayoutClassName(
|
33548
33607
|
"leftSideBarToggle"
|
33549
33608
|
),
|
33550
|
-
children: /* @__PURE__ */ (0,
|
33609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33551
33610
|
IconButton,
|
33552
33611
|
{
|
33553
33612
|
onClick: () => {
|
33554
33613
|
toggleSidebars("left");
|
33555
33614
|
},
|
33556
33615
|
title: "Toggle left sidebar",
|
33557
|
-
children: /* @__PURE__ */ (0,
|
33616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelLeft, { focusable: "false" })
|
33558
33617
|
}
|
33559
33618
|
)
|
33560
33619
|
}
|
33561
33620
|
),
|
33562
|
-
/* @__PURE__ */ (0,
|
33621
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33563
33622
|
"div",
|
33564
33623
|
{
|
33565
33624
|
className: getLayoutClassName(
|
33566
33625
|
"rightSideBarToggle"
|
33567
33626
|
),
|
33568
|
-
children: /* @__PURE__ */ (0,
|
33627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33569
33628
|
IconButton,
|
33570
33629
|
{
|
33571
33630
|
onClick: () => {
|
33572
33631
|
toggleSidebars("right");
|
33573
33632
|
},
|
33574
33633
|
title: "Toggle right sidebar",
|
33575
|
-
children: /* @__PURE__ */ (0,
|
33634
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelRight, { focusable: "false" })
|
33576
33635
|
}
|
33577
33636
|
)
|
33578
33637
|
}
|
33579
33638
|
)
|
33580
33639
|
] }),
|
33581
|
-
/* @__PURE__ */ (0,
|
33640
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("headerTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Heading, { rank: 2, size: "xs", children: [
|
33582
33641
|
headerTitle || rootProps.title || "Page",
|
33583
|
-
headerPath && /* @__PURE__ */ (0,
|
33642
|
+
headerPath && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
33584
33643
|
" ",
|
33585
|
-
/* @__PURE__ */ (0,
|
33644
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33586
33645
|
"code",
|
33587
33646
|
{
|
33588
33647
|
className: getLayoutClassName("headerPath"),
|
@@ -33591,18 +33650,18 @@ function Puck({
|
|
33591
33650
|
)
|
33592
33651
|
] })
|
33593
33652
|
] }) }),
|
33594
|
-
/* @__PURE__ */ (0,
|
33595
|
-
/* @__PURE__ */ (0,
|
33653
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerTools"), children: [
|
33654
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33596
33655
|
IconButton,
|
33597
33656
|
{
|
33598
33657
|
onClick: () => {
|
33599
33658
|
return setMenuOpen(!menuOpen);
|
33600
33659
|
},
|
33601
33660
|
title: "Toggle menu bar",
|
33602
|
-
children: menuOpen ? /* @__PURE__ */ (0,
|
33661
|
+
children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronDown, { focusable: "false" })
|
33603
33662
|
}
|
33604
33663
|
) }),
|
33605
|
-
/* @__PURE__ */ (0,
|
33664
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33606
33665
|
MenuBar,
|
33607
33666
|
{
|
33608
33667
|
appState,
|
@@ -33610,13 +33669,13 @@ function Puck({
|
|
33610
33669
|
dispatch,
|
33611
33670
|
onPublish,
|
33612
33671
|
menuOpen,
|
33613
|
-
renderHeaderActions: () => /* @__PURE__ */ (0,
|
33672
|
+
renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33614
33673
|
Button,
|
33615
33674
|
{
|
33616
33675
|
onClick: () => {
|
33617
33676
|
onPublish && onPublish(data);
|
33618
33677
|
},
|
33619
|
-
icon: /* @__PURE__ */ (0,
|
33678
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Globe, { size: "14px" }),
|
33620
33679
|
children: "Publish"
|
33621
33680
|
}
|
33622
33681
|
) }),
|
@@ -33627,19 +33686,19 @@ function Puck({
|
|
33627
33686
|
] }) })
|
33628
33687
|
}
|
33629
33688
|
),
|
33630
|
-
/* @__PURE__ */ (0,
|
33631
|
-
/* @__PURE__ */ (0,
|
33632
|
-
/* @__PURE__ */ (0,
|
33689
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("leftSideBar"), children: [
|
33690
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Components, {}) }),
|
33691
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Outline, {}) })
|
33633
33692
|
] }),
|
33634
|
-
/* @__PURE__ */ (0,
|
33635
|
-
/* @__PURE__ */ (0,
|
33693
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Canvas, {}),
|
33694
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
33636
33695
|
SidebarSection,
|
33637
33696
|
{
|
33638
33697
|
noPadding: true,
|
33639
33698
|
noBorderTop: true,
|
33640
33699
|
showBreadcrumbs: true,
|
33641
33700
|
title: selectedItem ? selectedComponentLabel : "Page",
|
33642
|
-
children: /* @__PURE__ */ (0,
|
33701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Fields, {})
|
33643
33702
|
}
|
33644
33703
|
) })
|
33645
33704
|
] })
|
@@ -33651,7 +33710,7 @@ function Puck({
|
|
33651
33710
|
)
|
33652
33711
|
}
|
33653
33712
|
),
|
33654
|
-
/* @__PURE__ */ (0,
|
33713
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { id: "puck-portal-root", className: getClassName27("portal") })
|
33655
33714
|
] });
|
33656
33715
|
}
|
33657
33716
|
Puck.Components = Components;
|
@@ -33661,7 +33720,7 @@ Puck.Preview = Preview;
|
|
33661
33720
|
|
33662
33721
|
// components/Render/index.tsx
|
33663
33722
|
init_react_import();
|
33664
|
-
var
|
33723
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
33665
33724
|
function Render({
|
33666
33725
|
config,
|
33667
33726
|
data
|
@@ -33674,7 +33733,7 @@ function Render({
|
|
33674
33733
|
const rootProps = defaultedData.root.props || defaultedData.root;
|
33675
33734
|
const title = (rootProps == null ? void 0 : rootProps.title) || "";
|
33676
33735
|
if ((_a = config.root) == null ? void 0 : _a.render) {
|
33677
|
-
return /* @__PURE__ */ (0,
|
33736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
33678
33737
|
config.root.render,
|
33679
33738
|
__spreadProps(__spreadValues({}, rootProps), {
|
33680
33739
|
puck: {
|
@@ -33684,11 +33743,11 @@ function Render({
|
|
33684
33743
|
title,
|
33685
33744
|
editMode: false,
|
33686
33745
|
id: "puck-root",
|
33687
|
-
children: /* @__PURE__ */ (0,
|
33746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZone, { zone: rootDroppableId })
|
33688
33747
|
})
|
33689
33748
|
) });
|
33690
33749
|
}
|
33691
|
-
return /* @__PURE__ */ (0,
|
33750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZone, { zone: rootDroppableId }) });
|
33692
33751
|
}
|
33693
33752
|
|
33694
33753
|
// lib/migrate.ts
|
@@ -33790,18 +33849,51 @@ function resolveAllData(data, config, onResolveStart, onResolveEnd) {
|
|
33790
33849
|
|
33791
33850
|
// lib/use-puck.ts
|
33792
33851
|
init_react_import();
|
33852
|
+
|
33853
|
+
// lib/get-permissions.ts
|
33854
|
+
init_react_import();
|
33855
|
+
var getPermissions = ({
|
33856
|
+
selectedItem,
|
33857
|
+
globalPermissions,
|
33858
|
+
config
|
33859
|
+
}) => {
|
33860
|
+
const componentType = selectedItem && selectedItem.type || "";
|
33861
|
+
let componentPermissions = getInitialPermissions({
|
33862
|
+
componentType,
|
33863
|
+
config,
|
33864
|
+
globalPermissions
|
33865
|
+
});
|
33866
|
+
return componentPermissions;
|
33867
|
+
};
|
33868
|
+
var getInitialPermissions = ({
|
33869
|
+
componentType,
|
33870
|
+
globalPermissions,
|
33871
|
+
config
|
33872
|
+
}) => {
|
33873
|
+
return __spreadValues(__spreadValues({}, globalPermissions), config.components[componentType].permissions);
|
33874
|
+
};
|
33875
|
+
|
33876
|
+
// lib/use-puck.ts
|
33793
33877
|
var usePuck = () => {
|
33794
33878
|
const {
|
33795
33879
|
state: appState,
|
33796
33880
|
config,
|
33797
33881
|
history,
|
33798
33882
|
dispatch,
|
33799
|
-
selectedItem
|
33883
|
+
selectedItem: currentItem,
|
33884
|
+
globalPermissions
|
33800
33885
|
} = useAppContext();
|
33801
33886
|
return {
|
33802
33887
|
appState,
|
33803
33888
|
config,
|
33804
33889
|
dispatch,
|
33890
|
+
getPermissions: (selectedItem) => {
|
33891
|
+
return getPermissions({
|
33892
|
+
selectedItem: selectedItem || currentItem,
|
33893
|
+
globalPermissions: globalPermissions || {},
|
33894
|
+
config
|
33895
|
+
});
|
33896
|
+
},
|
33805
33897
|
history: {
|
33806
33898
|
back: history.back,
|
33807
33899
|
forward: history.forward,
|
@@ -33813,11 +33905,13 @@ var usePuck = () => {
|
|
33813
33905
|
index: history.historyStore.index,
|
33814
33906
|
historyStore: history.historyStore
|
33815
33907
|
},
|
33816
|
-
selectedItem:
|
33908
|
+
selectedItem: currentItem || null
|
33817
33909
|
};
|
33818
33910
|
};
|
33819
33911
|
// Annotate the CommonJS export names for ESM import in node:
|
33820
33912
|
0 && (module.exports = {
|
33913
|
+
Action,
|
33914
|
+
ActionBar,
|
33821
33915
|
AutoField,
|
33822
33916
|
AutoFieldPrivate,
|
33823
33917
|
Button,
|