@measured/puck 0.13.0-canary.28f24f9 → 0.13.0-canary.3aa0057
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{Config-ff244704.d.ts → Config-b8c102e9.d.ts} +17 -3
- package/dist/index.css +107 -27
- package/dist/index.d.ts +4 -3
- package/dist/index.js +597 -320
- package/dist/rsc.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -760,7 +760,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
760
760
|
function validate(props, propName, componentName, location, propFullName) {
|
761
761
|
if (!(props[propName] instanceof expectedClass)) {
|
762
762
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
763
|
-
var actualClassName =
|
763
|
+
var actualClassName = getClassName21(props[propName]);
|
764
764
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
765
765
|
}
|
766
766
|
return null;
|
@@ -1012,7 +1012,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
1012
1012
|
return type;
|
1013
1013
|
}
|
1014
1014
|
}
|
1015
|
-
function
|
1015
|
+
function getClassName21(propValue) {
|
1016
1016
|
if (!propValue.constructor || !propValue.constructor.name) {
|
1017
1017
|
return ANONYMOUS;
|
1018
1018
|
}
|
@@ -8989,9 +8989,9 @@ var require_react_dom_development = __commonJS({
|
|
8989
8989
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
8990
8990
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
8991
8991
|
}
|
8992
|
-
var
|
8992
|
+
var React22 = require("react");
|
8993
8993
|
var Scheduler = require_scheduler();
|
8994
|
-
var ReactSharedInternals =
|
8994
|
+
var ReactSharedInternals = React22.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
8995
8995
|
var suppressWarning = false;
|
8996
8996
|
function setSuppressWarning(newSuppressWarning) {
|
8997
8997
|
{
|
@@ -10596,7 +10596,7 @@ var require_react_dom_development = __commonJS({
|
|
10596
10596
|
{
|
10597
10597
|
if (props.value == null) {
|
10598
10598
|
if (typeof props.children === "object" && props.children !== null) {
|
10599
|
-
|
10599
|
+
React22.Children.forEach(props.children, function(child) {
|
10600
10600
|
if (child == null) {
|
10601
10601
|
return;
|
10602
10602
|
}
|
@@ -19043,7 +19043,7 @@ var require_react_dom_development = __commonJS({
|
|
19043
19043
|
}
|
19044
19044
|
}
|
19045
19045
|
var fakeInternalInstance = {};
|
19046
|
-
var emptyRefsObject = new
|
19046
|
+
var emptyRefsObject = new React22.Component().refs;
|
19047
19047
|
var didWarnAboutStateAssignmentForComponent;
|
19048
19048
|
var didWarnAboutUninitializedState;
|
19049
19049
|
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
|
@@ -30170,9 +30170,11 @@ var Button = ({
|
|
30170
30170
|
newTab,
|
30171
30171
|
fullWidth,
|
30172
30172
|
icon,
|
30173
|
-
size = "medium"
|
30173
|
+
size = "medium",
|
30174
|
+
loading: loadingProp = false
|
30174
30175
|
}) => {
|
30175
|
-
const [loading, setLoading] = (0, import_react2.useState)(
|
30176
|
+
const [loading, setLoading] = (0, import_react2.useState)(loadingProp);
|
30177
|
+
(0, import_react2.useEffect)(() => setLoading(loadingProp), [loadingProp]);
|
30176
30178
|
const ElementType = href ? "a" : "button";
|
30177
30179
|
const el = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
30178
30180
|
ElementType,
|
@@ -30213,11 +30215,11 @@ var Button = ({
|
|
30213
30215
|
|
30214
30216
|
// components/DropZone/index.tsx
|
30215
30217
|
init_react_import();
|
30216
|
-
var
|
30218
|
+
var import_react27 = require("react");
|
30217
30219
|
|
30218
30220
|
// components/DraggableComponent/index.tsx
|
30219
30221
|
init_react_import();
|
30220
|
-
var
|
30222
|
+
var import_react24 = require("react");
|
30221
30223
|
var import_dnd = require("@hello-pangea/dnd");
|
30222
30224
|
|
30223
30225
|
// css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css#css-module
|
@@ -31284,7 +31286,7 @@ Lock.propTypes = {
|
|
31284
31286
|
Lock.displayName = "Lock";
|
31285
31287
|
var lock_default = Lock;
|
31286
31288
|
|
31287
|
-
// ../../node_modules/react-feather/dist/icons/
|
31289
|
+
// ../../node_modules/react-feather/dist/icons/more-vertical.js
|
31288
31290
|
init_react_import();
|
31289
31291
|
var import_react16 = __toESM(require("react"));
|
31290
31292
|
var import_prop_types14 = __toESM(require_prop_types());
|
@@ -31334,7 +31336,7 @@ function _objectWithoutPropertiesLoose14(source, excluded) {
|
|
31334
31336
|
}
|
31335
31337
|
return target;
|
31336
31338
|
}
|
31337
|
-
var
|
31339
|
+
var MoreVertical = (0, import_react16.forwardRef)(function(_ref, ref) {
|
31338
31340
|
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties14(_ref, ["color", "size"]);
|
31339
31341
|
return /* @__PURE__ */ import_react16.default.createElement("svg", _extends14({
|
31340
31342
|
ref,
|
@@ -31347,26 +31349,28 @@ var Plus = (0, import_react16.forwardRef)(function(_ref, ref) {
|
|
31347
31349
|
strokeWidth: "2",
|
31348
31350
|
strokeLinecap: "round",
|
31349
31351
|
strokeLinejoin: "round"
|
31350
|
-
}, rest), /* @__PURE__ */ import_react16.default.createElement("
|
31351
|
-
|
31352
|
-
|
31353
|
-
|
31354
|
-
|
31355
|
-
|
31356
|
-
|
31357
|
-
|
31358
|
-
|
31359
|
-
|
31352
|
+
}, rest), /* @__PURE__ */ import_react16.default.createElement("circle", {
|
31353
|
+
cx: "12",
|
31354
|
+
cy: "12",
|
31355
|
+
r: "1"
|
31356
|
+
}), /* @__PURE__ */ import_react16.default.createElement("circle", {
|
31357
|
+
cx: "12",
|
31358
|
+
cy: "5",
|
31359
|
+
r: "1"
|
31360
|
+
}), /* @__PURE__ */ import_react16.default.createElement("circle", {
|
31361
|
+
cx: "12",
|
31362
|
+
cy: "19",
|
31363
|
+
r: "1"
|
31360
31364
|
}));
|
31361
31365
|
});
|
31362
|
-
|
31366
|
+
MoreVertical.propTypes = {
|
31363
31367
|
color: import_prop_types14.default.string,
|
31364
31368
|
size: import_prop_types14.default.oneOfType([import_prop_types14.default.string, import_prop_types14.default.number])
|
31365
31369
|
};
|
31366
|
-
|
31367
|
-
var
|
31370
|
+
MoreVertical.displayName = "MoreVertical";
|
31371
|
+
var more_vertical_default = MoreVertical;
|
31368
31372
|
|
31369
|
-
// ../../node_modules/react-feather/dist/icons/
|
31373
|
+
// ../../node_modules/react-feather/dist/icons/plus.js
|
31370
31374
|
init_react_import();
|
31371
31375
|
var import_react17 = __toESM(require("react"));
|
31372
31376
|
var import_prop_types15 = __toESM(require_prop_types());
|
@@ -31416,7 +31420,7 @@ function _objectWithoutPropertiesLoose15(source, excluded) {
|
|
31416
31420
|
}
|
31417
31421
|
return target;
|
31418
31422
|
}
|
31419
|
-
var
|
31423
|
+
var Plus = (0, import_react17.forwardRef)(function(_ref, ref) {
|
31420
31424
|
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties15(_ref, ["color", "size"]);
|
31421
31425
|
return /* @__PURE__ */ import_react17.default.createElement("svg", _extends15({
|
31422
31426
|
ref,
|
@@ -31429,28 +31433,26 @@ var Sidebar = (0, import_react17.forwardRef)(function(_ref, ref) {
|
|
31429
31433
|
strokeWidth: "2",
|
31430
31434
|
strokeLinecap: "round",
|
31431
31435
|
strokeLinejoin: "round"
|
31432
|
-
}, rest), /* @__PURE__ */ import_react17.default.createElement("
|
31433
|
-
|
31434
|
-
|
31435
|
-
|
31436
|
-
|
31437
|
-
rx: "2",
|
31438
|
-
ry: "2"
|
31436
|
+
}, rest), /* @__PURE__ */ import_react17.default.createElement("line", {
|
31437
|
+
x1: "12",
|
31438
|
+
y1: "5",
|
31439
|
+
x2: "12",
|
31440
|
+
y2: "19"
|
31439
31441
|
}), /* @__PURE__ */ import_react17.default.createElement("line", {
|
31440
|
-
x1: "
|
31441
|
-
y1: "
|
31442
|
-
x2: "
|
31443
|
-
y2: "
|
31442
|
+
x1: "5",
|
31443
|
+
y1: "12",
|
31444
|
+
x2: "19",
|
31445
|
+
y2: "12"
|
31444
31446
|
}));
|
31445
31447
|
});
|
31446
|
-
|
31448
|
+
Plus.propTypes = {
|
31447
31449
|
color: import_prop_types15.default.string,
|
31448
31450
|
size: import_prop_types15.default.oneOfType([import_prop_types15.default.string, import_prop_types15.default.number])
|
31449
31451
|
};
|
31450
|
-
|
31451
|
-
var
|
31452
|
+
Plus.displayName = "Plus";
|
31453
|
+
var plus_default = Plus;
|
31452
31454
|
|
31453
|
-
// ../../node_modules/react-feather/dist/icons/
|
31455
|
+
// ../../node_modules/react-feather/dist/icons/search.js
|
31454
31456
|
init_react_import();
|
31455
31457
|
var import_react18 = __toESM(require("react"));
|
31456
31458
|
var import_prop_types16 = __toESM(require_prop_types());
|
@@ -31500,7 +31502,7 @@ function _objectWithoutPropertiesLoose16(source, excluded) {
|
|
31500
31502
|
}
|
31501
31503
|
return target;
|
31502
31504
|
}
|
31503
|
-
var
|
31505
|
+
var Search = (0, import_react18.forwardRef)(function(_ref, ref) {
|
31504
31506
|
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties16(_ref, ["color", "size"]);
|
31505
31507
|
return /* @__PURE__ */ import_react18.default.createElement("svg", _extends16({
|
31506
31508
|
ref,
|
@@ -31513,20 +31515,25 @@ var Trash = (0, import_react18.forwardRef)(function(_ref, ref) {
|
|
31513
31515
|
strokeWidth: "2",
|
31514
31516
|
strokeLinecap: "round",
|
31515
31517
|
strokeLinejoin: "round"
|
31516
|
-
}, rest), /* @__PURE__ */ import_react18.default.createElement("
|
31517
|
-
|
31518
|
-
|
31519
|
-
|
31518
|
+
}, rest), /* @__PURE__ */ import_react18.default.createElement("circle", {
|
31519
|
+
cx: "11",
|
31520
|
+
cy: "11",
|
31521
|
+
r: "8"
|
31522
|
+
}), /* @__PURE__ */ import_react18.default.createElement("line", {
|
31523
|
+
x1: "21",
|
31524
|
+
y1: "21",
|
31525
|
+
x2: "16.65",
|
31526
|
+
y2: "16.65"
|
31520
31527
|
}));
|
31521
31528
|
});
|
31522
|
-
|
31529
|
+
Search.propTypes = {
|
31523
31530
|
color: import_prop_types16.default.string,
|
31524
31531
|
size: import_prop_types16.default.oneOfType([import_prop_types16.default.string, import_prop_types16.default.number])
|
31525
31532
|
};
|
31526
|
-
|
31527
|
-
var
|
31533
|
+
Search.displayName = "Search";
|
31534
|
+
var search_default = Search;
|
31528
31535
|
|
31529
|
-
// ../../node_modules/react-feather/dist/icons/
|
31536
|
+
// ../../node_modules/react-feather/dist/icons/sidebar.js
|
31530
31537
|
init_react_import();
|
31531
31538
|
var import_react19 = __toESM(require("react"));
|
31532
31539
|
var import_prop_types17 = __toESM(require_prop_types());
|
@@ -31576,7 +31583,7 @@ function _objectWithoutPropertiesLoose17(source, excluded) {
|
|
31576
31583
|
}
|
31577
31584
|
return target;
|
31578
31585
|
}
|
31579
|
-
var
|
31586
|
+
var Sidebar = (0, import_react19.forwardRef)(function(_ref, ref) {
|
31580
31587
|
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties17(_ref, ["color", "size"]);
|
31581
31588
|
return /* @__PURE__ */ import_react19.default.createElement("svg", _extends17({
|
31582
31589
|
ref,
|
@@ -31589,28 +31596,28 @@ var Type = (0, import_react19.forwardRef)(function(_ref, ref) {
|
|
31589
31596
|
strokeWidth: "2",
|
31590
31597
|
strokeLinecap: "round",
|
31591
31598
|
strokeLinejoin: "round"
|
31592
|
-
}, rest), /* @__PURE__ */ import_react19.default.createElement("
|
31593
|
-
|
31599
|
+
}, rest), /* @__PURE__ */ import_react19.default.createElement("rect", {
|
31600
|
+
x: "3",
|
31601
|
+
y: "3",
|
31602
|
+
width: "18",
|
31603
|
+
height: "18",
|
31604
|
+
rx: "2",
|
31605
|
+
ry: "2"
|
31594
31606
|
}), /* @__PURE__ */ import_react19.default.createElement("line", {
|
31595
31607
|
x1: "9",
|
31596
|
-
y1: "
|
31597
|
-
x2: "
|
31598
|
-
y2: "
|
31599
|
-
}), /* @__PURE__ */ import_react19.default.createElement("line", {
|
31600
|
-
x1: "12",
|
31601
|
-
y1: "4",
|
31602
|
-
x2: "12",
|
31603
|
-
y2: "20"
|
31608
|
+
y1: "3",
|
31609
|
+
x2: "9",
|
31610
|
+
y2: "21"
|
31604
31611
|
}));
|
31605
31612
|
});
|
31606
|
-
|
31613
|
+
Sidebar.propTypes = {
|
31607
31614
|
color: import_prop_types17.default.string,
|
31608
31615
|
size: import_prop_types17.default.oneOfType([import_prop_types17.default.string, import_prop_types17.default.number])
|
31609
31616
|
};
|
31610
|
-
|
31611
|
-
var
|
31617
|
+
Sidebar.displayName = "Sidebar";
|
31618
|
+
var sidebar_default = Sidebar;
|
31612
31619
|
|
31613
|
-
// ../../node_modules/react-feather/dist/icons/
|
31620
|
+
// ../../node_modules/react-feather/dist/icons/trash.js
|
31614
31621
|
init_react_import();
|
31615
31622
|
var import_react20 = __toESM(require("react"));
|
31616
31623
|
var import_prop_types18 = __toESM(require_prop_types());
|
@@ -31660,7 +31667,7 @@ function _objectWithoutPropertiesLoose18(source, excluded) {
|
|
31660
31667
|
}
|
31661
31668
|
return target;
|
31662
31669
|
}
|
31663
|
-
var
|
31670
|
+
var Trash = (0, import_react20.forwardRef)(function(_ref, ref) {
|
31664
31671
|
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties18(_ref, ["color", "size"]);
|
31665
31672
|
return /* @__PURE__ */ import_react20.default.createElement("svg", _extends18({
|
31666
31673
|
ref,
|
@@ -31673,30 +31680,190 @@ var Unlock = (0, import_react20.forwardRef)(function(_ref, ref) {
|
|
31673
31680
|
strokeWidth: "2",
|
31674
31681
|
strokeLinecap: "round",
|
31675
31682
|
strokeLinejoin: "round"
|
31676
|
-
}, rest), /* @__PURE__ */ import_react20.default.createElement("
|
31683
|
+
}, rest), /* @__PURE__ */ import_react20.default.createElement("polyline", {
|
31684
|
+
points: "3 6 5 6 21 6"
|
31685
|
+
}), /* @__PURE__ */ import_react20.default.createElement("path", {
|
31686
|
+
d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
|
31687
|
+
}));
|
31688
|
+
});
|
31689
|
+
Trash.propTypes = {
|
31690
|
+
color: import_prop_types18.default.string,
|
31691
|
+
size: import_prop_types18.default.oneOfType([import_prop_types18.default.string, import_prop_types18.default.number])
|
31692
|
+
};
|
31693
|
+
Trash.displayName = "Trash";
|
31694
|
+
var trash_default = Trash;
|
31695
|
+
|
31696
|
+
// ../../node_modules/react-feather/dist/icons/type.js
|
31697
|
+
init_react_import();
|
31698
|
+
var import_react21 = __toESM(require("react"));
|
31699
|
+
var import_prop_types19 = __toESM(require_prop_types());
|
31700
|
+
function _extends19() {
|
31701
|
+
_extends19 = Object.assign || function(target) {
|
31702
|
+
for (var i = 1; i < arguments.length; i++) {
|
31703
|
+
var source = arguments[i];
|
31704
|
+
for (var key in source) {
|
31705
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
31706
|
+
target[key] = source[key];
|
31707
|
+
}
|
31708
|
+
}
|
31709
|
+
}
|
31710
|
+
return target;
|
31711
|
+
};
|
31712
|
+
return _extends19.apply(this, arguments);
|
31713
|
+
}
|
31714
|
+
function _objectWithoutProperties19(source, excluded) {
|
31715
|
+
if (source == null)
|
31716
|
+
return {};
|
31717
|
+
var target = _objectWithoutPropertiesLoose19(source, excluded);
|
31718
|
+
var key, i;
|
31719
|
+
if (Object.getOwnPropertySymbols) {
|
31720
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
31721
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
31722
|
+
key = sourceSymbolKeys[i];
|
31723
|
+
if (excluded.indexOf(key) >= 0)
|
31724
|
+
continue;
|
31725
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
31726
|
+
continue;
|
31727
|
+
target[key] = source[key];
|
31728
|
+
}
|
31729
|
+
}
|
31730
|
+
return target;
|
31731
|
+
}
|
31732
|
+
function _objectWithoutPropertiesLoose19(source, excluded) {
|
31733
|
+
if (source == null)
|
31734
|
+
return {};
|
31735
|
+
var target = {};
|
31736
|
+
var sourceKeys = Object.keys(source);
|
31737
|
+
var key, i;
|
31738
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
31739
|
+
key = sourceKeys[i];
|
31740
|
+
if (excluded.indexOf(key) >= 0)
|
31741
|
+
continue;
|
31742
|
+
target[key] = source[key];
|
31743
|
+
}
|
31744
|
+
return target;
|
31745
|
+
}
|
31746
|
+
var Type = (0, import_react21.forwardRef)(function(_ref, ref) {
|
31747
|
+
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties19(_ref, ["color", "size"]);
|
31748
|
+
return /* @__PURE__ */ import_react21.default.createElement("svg", _extends19({
|
31749
|
+
ref,
|
31750
|
+
xmlns: "http://www.w3.org/2000/svg",
|
31751
|
+
width: size,
|
31752
|
+
height: size,
|
31753
|
+
viewBox: "0 0 24 24",
|
31754
|
+
fill: "none",
|
31755
|
+
stroke: color,
|
31756
|
+
strokeWidth: "2",
|
31757
|
+
strokeLinecap: "round",
|
31758
|
+
strokeLinejoin: "round"
|
31759
|
+
}, rest), /* @__PURE__ */ import_react21.default.createElement("polyline", {
|
31760
|
+
points: "4 7 4 4 20 4 20 7"
|
31761
|
+
}), /* @__PURE__ */ import_react21.default.createElement("line", {
|
31762
|
+
x1: "9",
|
31763
|
+
y1: "20",
|
31764
|
+
x2: "15",
|
31765
|
+
y2: "20"
|
31766
|
+
}), /* @__PURE__ */ import_react21.default.createElement("line", {
|
31767
|
+
x1: "12",
|
31768
|
+
y1: "4",
|
31769
|
+
x2: "12",
|
31770
|
+
y2: "20"
|
31771
|
+
}));
|
31772
|
+
});
|
31773
|
+
Type.propTypes = {
|
31774
|
+
color: import_prop_types19.default.string,
|
31775
|
+
size: import_prop_types19.default.oneOfType([import_prop_types19.default.string, import_prop_types19.default.number])
|
31776
|
+
};
|
31777
|
+
Type.displayName = "Type";
|
31778
|
+
var type_default = Type;
|
31779
|
+
|
31780
|
+
// ../../node_modules/react-feather/dist/icons/unlock.js
|
31781
|
+
init_react_import();
|
31782
|
+
var import_react22 = __toESM(require("react"));
|
31783
|
+
var import_prop_types20 = __toESM(require_prop_types());
|
31784
|
+
function _extends20() {
|
31785
|
+
_extends20 = Object.assign || function(target) {
|
31786
|
+
for (var i = 1; i < arguments.length; i++) {
|
31787
|
+
var source = arguments[i];
|
31788
|
+
for (var key in source) {
|
31789
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
31790
|
+
target[key] = source[key];
|
31791
|
+
}
|
31792
|
+
}
|
31793
|
+
}
|
31794
|
+
return target;
|
31795
|
+
};
|
31796
|
+
return _extends20.apply(this, arguments);
|
31797
|
+
}
|
31798
|
+
function _objectWithoutProperties20(source, excluded) {
|
31799
|
+
if (source == null)
|
31800
|
+
return {};
|
31801
|
+
var target = _objectWithoutPropertiesLoose20(source, excluded);
|
31802
|
+
var key, i;
|
31803
|
+
if (Object.getOwnPropertySymbols) {
|
31804
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
31805
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
31806
|
+
key = sourceSymbolKeys[i];
|
31807
|
+
if (excluded.indexOf(key) >= 0)
|
31808
|
+
continue;
|
31809
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
31810
|
+
continue;
|
31811
|
+
target[key] = source[key];
|
31812
|
+
}
|
31813
|
+
}
|
31814
|
+
return target;
|
31815
|
+
}
|
31816
|
+
function _objectWithoutPropertiesLoose20(source, excluded) {
|
31817
|
+
if (source == null)
|
31818
|
+
return {};
|
31819
|
+
var target = {};
|
31820
|
+
var sourceKeys = Object.keys(source);
|
31821
|
+
var key, i;
|
31822
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
31823
|
+
key = sourceKeys[i];
|
31824
|
+
if (excluded.indexOf(key) >= 0)
|
31825
|
+
continue;
|
31826
|
+
target[key] = source[key];
|
31827
|
+
}
|
31828
|
+
return target;
|
31829
|
+
}
|
31830
|
+
var Unlock = (0, import_react22.forwardRef)(function(_ref, ref) {
|
31831
|
+
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties20(_ref, ["color", "size"]);
|
31832
|
+
return /* @__PURE__ */ import_react22.default.createElement("svg", _extends20({
|
31833
|
+
ref,
|
31834
|
+
xmlns: "http://www.w3.org/2000/svg",
|
31835
|
+
width: size,
|
31836
|
+
height: size,
|
31837
|
+
viewBox: "0 0 24 24",
|
31838
|
+
fill: "none",
|
31839
|
+
stroke: color,
|
31840
|
+
strokeWidth: "2",
|
31841
|
+
strokeLinecap: "round",
|
31842
|
+
strokeLinejoin: "round"
|
31843
|
+
}, rest), /* @__PURE__ */ import_react22.default.createElement("rect", {
|
31677
31844
|
x: "3",
|
31678
31845
|
y: "11",
|
31679
31846
|
width: "18",
|
31680
31847
|
height: "11",
|
31681
31848
|
rx: "2",
|
31682
31849
|
ry: "2"
|
31683
|
-
}), /* @__PURE__ */
|
31850
|
+
}), /* @__PURE__ */ import_react22.default.createElement("path", {
|
31684
31851
|
d: "M7 11V7a5 5 0 0 1 9.9-1"
|
31685
31852
|
}));
|
31686
31853
|
});
|
31687
31854
|
Unlock.propTypes = {
|
31688
|
-
color:
|
31689
|
-
size:
|
31855
|
+
color: import_prop_types20.default.string,
|
31856
|
+
size: import_prop_types20.default.oneOfType([import_prop_types20.default.string, import_prop_types20.default.number])
|
31690
31857
|
};
|
31691
31858
|
Unlock.displayName = "Unlock";
|
31692
31859
|
var unlock_default = Unlock;
|
31693
31860
|
|
31694
31861
|
// lib/use-modifier-held.ts
|
31695
31862
|
init_react_import();
|
31696
|
-
var
|
31863
|
+
var import_react23 = require("react");
|
31697
31864
|
var useModifierHeld = (modifier) => {
|
31698
|
-
const [modifierHeld, setModifierHeld] = (0,
|
31699
|
-
(0,
|
31865
|
+
const [modifierHeld, setModifierHeld] = (0, import_react23.useState)(false);
|
31866
|
+
(0, import_react23.useEffect)(() => {
|
31700
31867
|
function downHandler({ key }) {
|
31701
31868
|
if (key === modifier) {
|
31702
31869
|
setModifierHeld(true);
|
@@ -31744,7 +31911,7 @@ var DraggableComponent = ({
|
|
31744
31911
|
style
|
31745
31912
|
}) => {
|
31746
31913
|
const isModifierHeld = useModifierHeld("Alt");
|
31747
|
-
(0,
|
31914
|
+
(0, import_react24.useEffect)(onMount, []);
|
31748
31915
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
31749
31916
|
import_dnd.Draggable,
|
31750
31917
|
{
|
@@ -31851,7 +32018,7 @@ var styles_module_default2 = { "DropZone": "_DropZone_1akqa_1", "DropZone-conten
|
|
31851
32018
|
|
31852
32019
|
// components/DropZone/context.tsx
|
31853
32020
|
init_react_import();
|
31854
|
-
var
|
32021
|
+
var import_react25 = require("react");
|
31855
32022
|
var import_use_debounce = require("use-debounce");
|
31856
32023
|
|
31857
32024
|
// lib/get-zone-id.ts
|
@@ -31868,29 +32035,29 @@ var getZoneId = (zoneCompound) => {
|
|
31868
32035
|
|
31869
32036
|
// components/DropZone/context.tsx
|
31870
32037
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
31871
|
-
var dropZoneContext = (0,
|
32038
|
+
var dropZoneContext = (0, import_react25.createContext)(null);
|
31872
32039
|
var DropZoneProvider = ({
|
31873
32040
|
children,
|
31874
32041
|
value
|
31875
32042
|
}) => {
|
31876
|
-
const [hoveringArea, setHoveringArea] = (0,
|
31877
|
-
const [hoveringZone, setHoveringZone] = (0,
|
32043
|
+
const [hoveringArea, setHoveringArea] = (0, import_react25.useState)(null);
|
32044
|
+
const [hoveringZone, setHoveringZone] = (0, import_react25.useState)(
|
31878
32045
|
rootDroppableId
|
31879
32046
|
);
|
31880
|
-
const [hoveringComponent, setHoveringComponent] = (0,
|
32047
|
+
const [hoveringComponent, setHoveringComponent] = (0, import_react25.useState)();
|
31881
32048
|
const [hoveringAreaDb] = (0, import_use_debounce.useDebounce)(hoveringArea, 75, { leading: false });
|
31882
|
-
const [areasWithZones, setAreasWithZones] = (0,
|
32049
|
+
const [areasWithZones, setAreasWithZones] = (0, import_react25.useState)(
|
31883
32050
|
{}
|
31884
32051
|
);
|
31885
|
-
const [activeZones, setActiveZones] = (0,
|
32052
|
+
const [activeZones, setActiveZones] = (0, import_react25.useState)({});
|
31886
32053
|
const { dispatch = null } = value ? value : {};
|
31887
|
-
const registerZoneArea = (0,
|
32054
|
+
const registerZoneArea = (0, import_react25.useCallback)(
|
31888
32055
|
(area) => {
|
31889
32056
|
setAreasWithZones((latest) => __spreadProps(__spreadValues({}, latest), { [area]: true }));
|
31890
32057
|
},
|
31891
32058
|
[setAreasWithZones]
|
31892
32059
|
);
|
31893
|
-
const registerZone = (0,
|
32060
|
+
const registerZone = (0, import_react25.useCallback)(
|
31894
32061
|
(zoneCompound) => {
|
31895
32062
|
if (!dispatch) {
|
31896
32063
|
return;
|
@@ -31903,7 +32070,7 @@ var DropZoneProvider = ({
|
|
31903
32070
|
},
|
31904
32071
|
[setActiveZones, dispatch]
|
31905
32072
|
);
|
31906
|
-
const unregisterZone = (0,
|
32073
|
+
const unregisterZone = (0, import_react25.useCallback)(
|
31907
32074
|
(zoneCompound) => {
|
31908
32075
|
if (!dispatch) {
|
31909
32076
|
return;
|
@@ -31918,8 +32085,8 @@ var DropZoneProvider = ({
|
|
31918
32085
|
},
|
31919
32086
|
[setActiveZones, dispatch]
|
31920
32087
|
);
|
31921
|
-
const [pathData, setPathData] = (0,
|
31922
|
-
const registerPath = (0,
|
32088
|
+
const [pathData, setPathData] = (0, import_react25.useState)();
|
32089
|
+
const registerPath = (0, import_react25.useCallback)(
|
31923
32090
|
(selector) => {
|
31924
32091
|
if (!(value == null ? void 0 : value.data)) {
|
31925
32092
|
return;
|
@@ -31969,7 +32136,7 @@ var DropZoneProvider = ({
|
|
31969
32136
|
|
31970
32137
|
// components/Puck/context.tsx
|
31971
32138
|
init_react_import();
|
31972
|
-
var
|
32139
|
+
var import_react26 = require("react");
|
31973
32140
|
var defaultAppState = {
|
31974
32141
|
data: { content: [], root: { title: "" } },
|
31975
32142
|
ui: {
|
@@ -31980,7 +32147,7 @@ var defaultAppState = {
|
|
31980
32147
|
componentList: {}
|
31981
32148
|
}
|
31982
32149
|
};
|
31983
|
-
var appContext = (0,
|
32150
|
+
var appContext = (0, import_react26.createContext)({
|
31984
32151
|
state: defaultAppState,
|
31985
32152
|
dispatch: () => null,
|
31986
32153
|
config: { components: {} },
|
@@ -31988,7 +32155,7 @@ var appContext = (0, import_react24.createContext)({
|
|
31988
32155
|
});
|
31989
32156
|
var AppProvider = appContext.Provider;
|
31990
32157
|
var useAppContext = () => {
|
31991
|
-
const mainContext = (0,
|
32158
|
+
const mainContext = (0, import_react26.useContext)(appContext);
|
31992
32159
|
const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
|
31993
32160
|
return __spreadProps(__spreadValues({}, mainContext), {
|
31994
32161
|
// Helpers
|
@@ -32009,7 +32176,7 @@ var getClassName3 = get_class_name_factory_default("DropZone", styles_module_def
|
|
32009
32176
|
function DropZoneEdit({ zone, allow, disallow, style }) {
|
32010
32177
|
var _a;
|
32011
32178
|
const appContext2 = useAppContext();
|
32012
|
-
const ctx = (0,
|
32179
|
+
const ctx = (0, import_react27.useContext)(dropZoneContext);
|
32013
32180
|
const {
|
32014
32181
|
// These all need setting via context
|
32015
32182
|
data,
|
@@ -32026,12 +32193,12 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
32026
32193
|
} = ctx || {};
|
32027
32194
|
let content = data.content || [];
|
32028
32195
|
let zoneCompound = rootDroppableId;
|
32029
|
-
(0,
|
32196
|
+
(0, import_react27.useEffect)(() => {
|
32030
32197
|
if (areaId && registerZoneArea) {
|
32031
32198
|
registerZoneArea(areaId);
|
32032
32199
|
}
|
32033
32200
|
}, [areaId]);
|
32034
|
-
(0,
|
32201
|
+
(0, import_react27.useEffect)(() => {
|
32035
32202
|
if (ctx == null ? void 0 : ctx.registerZone) {
|
32036
32203
|
ctx == null ? void 0 : ctx.registerZone(zoneCompound);
|
32037
32204
|
}
|
@@ -32052,7 +32219,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
32052
32219
|
const draggedDestinationId = draggedItem && ((_a = draggedItem.destination) == null ? void 0 : _a.droppableId);
|
32053
32220
|
const [zoneArea] = getZoneId(zoneCompound);
|
32054
32221
|
const [draggedSourceArea] = getZoneId(draggedSourceId);
|
32055
|
-
const [userWillDrag, setUserWillDrag] = (0,
|
32222
|
+
const [userWillDrag, setUserWillDrag] = (0, import_react27.useState)(false);
|
32056
32223
|
const userIsDragging = !!draggedItem;
|
32057
32224
|
const draggingOverArea = userIsDragging && zoneArea === draggedSourceArea;
|
32058
32225
|
const draggingNewComponent = draggedSourceId == null ? void 0 : draggedSourceId.startsWith("component-list");
|
@@ -32270,7 +32437,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
|
|
32270
32437
|
);
|
32271
32438
|
}
|
32272
32439
|
function DropZoneRender({ zone }) {
|
32273
|
-
const ctx = (0,
|
32440
|
+
const ctx = (0, import_react27.useContext)(dropZoneContext);
|
32274
32441
|
const { data, areaId = "root", config } = ctx || {};
|
32275
32442
|
let zoneCompound = rootDroppableId;
|
32276
32443
|
let content = (data == null ? void 0 : data.content) || [];
|
@@ -32302,7 +32469,7 @@ function DropZoneRender({ zone }) {
|
|
32302
32469
|
}) });
|
32303
32470
|
}
|
32304
32471
|
function DropZone(props) {
|
32305
|
-
const ctx = (0,
|
32472
|
+
const ctx = (0, import_react27.useContext)(dropZoneContext);
|
32306
32473
|
if ((ctx == null ? void 0 : ctx.mode) === "edit") {
|
32307
32474
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DropZoneEdit, __spreadValues({}, props));
|
32308
32475
|
}
|
@@ -32314,7 +32481,7 @@ init_react_import();
|
|
32314
32481
|
|
32315
32482
|
// components/IconButton/IconButton.tsx
|
32316
32483
|
init_react_import();
|
32317
|
-
var
|
32484
|
+
var import_react28 = require("react");
|
32318
32485
|
|
32319
32486
|
// css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css#css-module
|
32320
32487
|
init_react_import();
|
@@ -32336,7 +32503,7 @@ var IconButton = ({
|
|
32336
32503
|
fullWidth,
|
32337
32504
|
title
|
32338
32505
|
}) => {
|
32339
|
-
const [loading, setLoading] = (0,
|
32506
|
+
const [loading, setLoading] = (0, import_react28.useState)(false);
|
32340
32507
|
const ElementType = href ? "a" : "button";
|
32341
32508
|
const el = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
32342
32509
|
ElementType,
|
@@ -32377,7 +32544,7 @@ var IconButton = ({
|
|
32377
32544
|
|
32378
32545
|
// components/Puck/index.tsx
|
32379
32546
|
init_react_import();
|
32380
|
-
var
|
32547
|
+
var import_react41 = require("react");
|
32381
32548
|
var import_dnd7 = require("@hello-pangea/dnd");
|
32382
32549
|
|
32383
32550
|
// components/InputOrGroup/index.tsx
|
@@ -32388,7 +32555,7 @@ init_react_import();
|
|
32388
32555
|
var styles_module_default3 = { "Input": "_Input_1jyrm_1", "Input-label": "_Input-label_1jyrm_27", "Input-labelIcon": "_Input-labelIcon_1jyrm_35", "Input-disabledIcon": "_Input-disabledIcon_1jyrm_41", "Input-input": "_Input-input_1jyrm_46", "Input--readOnly": "_Input--readOnly_1jyrm_69", "Input-radioGroupItems": "_Input-radioGroupItems_1jyrm_87", "Input-radio": "_Input-radio_1jyrm_87", "Input-radioInner": "_Input-radioInner_1jyrm_104", "Input-radioInput": "_Input-radioInput_1jyrm_126" };
|
32389
32556
|
|
32390
32557
|
// components/InputOrGroup/index.tsx
|
32391
|
-
var
|
32558
|
+
var import_react33 = require("react");
|
32392
32559
|
|
32393
32560
|
// components/InputOrGroup/fields/index.tsx
|
32394
32561
|
init_react_import();
|
@@ -32453,7 +32620,7 @@ var Draggable2 = ({
|
|
32453
32620
|
};
|
32454
32621
|
|
32455
32622
|
// components/InputOrGroup/fields/ArrayField/index.tsx
|
32456
|
-
var
|
32623
|
+
var import_react29 = require("react");
|
32457
32624
|
|
32458
32625
|
// components/DragIcon/index.tsx
|
32459
32626
|
init_react_import();
|
@@ -32491,11 +32658,11 @@ var ArrayField = ({
|
|
32491
32658
|
}),
|
32492
32659
|
openId: ""
|
32493
32660
|
};
|
32494
|
-
const [localState, setLocalState] = (0,
|
32495
|
-
(0,
|
32661
|
+
const [localState, setLocalState] = (0, import_react29.useState)({ arrayState, value });
|
32662
|
+
(0, import_react29.useEffect)(() => {
|
32496
32663
|
setLocalState({ arrayState, value });
|
32497
32664
|
}, [value, state.ui.arrayState[id]]);
|
32498
|
-
const mapArrayStateToUi = (0,
|
32665
|
+
const mapArrayStateToUi = (0, import_react29.useCallback)(
|
32499
32666
|
(partialArrayState) => {
|
32500
32667
|
return {
|
32501
32668
|
arrayState: __spreadProps(__spreadValues({}, state.ui.arrayState), {
|
@@ -32505,13 +32672,13 @@ var ArrayField = ({
|
|
32505
32672
|
},
|
32506
32673
|
[arrayState]
|
32507
32674
|
);
|
32508
|
-
const getHighestIndex = (0,
|
32675
|
+
const getHighestIndex = (0, import_react29.useCallback)(() => {
|
32509
32676
|
return arrayState.items.reduce(
|
32510
32677
|
(acc, item) => item._originalIndex > acc ? item._originalIndex : acc,
|
32511
32678
|
-1
|
32512
32679
|
);
|
32513
32680
|
}, [arrayState]);
|
32514
|
-
const regenerateArrayState = (0,
|
32681
|
+
const regenerateArrayState = (0, import_react29.useCallback)(
|
32515
32682
|
(value2) => {
|
32516
32683
|
let highestIndex = getHighestIndex();
|
32517
32684
|
const newItems = Array.from(value2 || []).map((item, idx) => {
|
@@ -32530,10 +32697,10 @@ var ArrayField = ({
|
|
32530
32697
|
},
|
32531
32698
|
[arrayState]
|
32532
32699
|
);
|
32533
|
-
(0,
|
32700
|
+
(0, import_react29.useEffect)(() => {
|
32534
32701
|
setUi(mapArrayStateToUi(arrayState));
|
32535
32702
|
}, []);
|
32536
|
-
const [hovering, setHovering] = (0,
|
32703
|
+
const [hovering, setHovering] = (0, import_react29.useState)(false);
|
32537
32704
|
if (field.type !== "array" || !field.arrayFields) {
|
32538
32705
|
return null;
|
32539
32706
|
}
|
@@ -32762,19 +32929,19 @@ var DefaultField = ({
|
|
32762
32929
|
|
32763
32930
|
// components/InputOrGroup/fields/ExternalField/index.tsx
|
32764
32931
|
init_react_import();
|
32765
|
-
var
|
32932
|
+
var import_react32 = require("react");
|
32766
32933
|
|
32767
32934
|
// components/ExternalInput/index.tsx
|
32768
32935
|
init_react_import();
|
32769
|
-
var
|
32936
|
+
var import_react31 = require("react");
|
32770
32937
|
|
32771
32938
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
|
32772
32939
|
init_react_import();
|
32773
|
-
var styles_module_default6 = { "ExternalInput": "
|
32940
|
+
var styles_module_default6 = { "ExternalInput": "_ExternalInput_s6fxy_1", "ExternalInput-actions": "_ExternalInput-actions_s6fxy_5", "ExternalInput-button": "_ExternalInput-button_s6fxy_9", "ExternalInput-detachButton": "_ExternalInput-detachButton_s6fxy_28", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_s6fxy_35", "ExternalInputModal": "_ExternalInputModal_s6fxy_56", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_s6fxy_64", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_s6fxy_72", "ExternalInputModal-table": "_ExternalInputModal-table_s6fxy_72", "ExternalInputModal-thead": "_ExternalInputModal-thead_s6fxy_88", "ExternalInputModal-th": "_ExternalInputModal-th_s6fxy_88", "ExternalInputModal-td": "_ExternalInputModal-td_s6fxy_102", "ExternalInputModal-tr": "_ExternalInputModal-tr_s6fxy_107", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_s6fxy_119", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_s6fxy_138", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_s6fxy_142", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_s6fxy_155", "ExternalInputModal-noContentBanner": "_ExternalInputModal-noContentBanner_s6fxy_159", "ExternalInputModal--loaded": "_ExternalInputModal--loaded_s6fxy_166", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_s6fxy_171", "ExternalInputModal-search": "_ExternalInputModal-search_s6fxy_171", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_s6fxy_194", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_s6fxy_206", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_s6fxy_216" };
|
32774
32941
|
|
32775
32942
|
// components/Modal/index.tsx
|
32776
32943
|
init_react_import();
|
32777
|
-
var
|
32944
|
+
var import_react30 = require("react");
|
32778
32945
|
|
32779
32946
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Modal/styles.module.css#css-module
|
32780
32947
|
init_react_import();
|
@@ -32789,8 +32956,8 @@ var Modal = ({
|
|
32789
32956
|
onClose,
|
32790
32957
|
isOpen
|
32791
32958
|
}) => {
|
32792
|
-
const [rootEl, setRootEl] = (0,
|
32793
|
-
(0,
|
32959
|
+
const [rootEl, setRootEl] = (0, import_react30.useState)(null);
|
32960
|
+
(0, import_react30.useEffect)(() => {
|
32794
32961
|
setRootEl(document.getElementById("puck-portal-root"));
|
32795
32962
|
}, []);
|
32796
32963
|
if (!rootEl) {
|
@@ -32846,10 +33013,10 @@ var ExternalInput = ({
|
|
32846
33013
|
id
|
32847
33014
|
}) => {
|
32848
33015
|
const { mapProp = (val) => val } = field || {};
|
32849
|
-
const [data, setData] = (0,
|
32850
|
-
const [isOpen, setOpen] = (0,
|
32851
|
-
const [isLoading, setIsLoading] = (0,
|
32852
|
-
const keys = (0,
|
33016
|
+
const [data, setData] = (0, import_react31.useState)([]);
|
33017
|
+
const [isOpen, setOpen] = (0, import_react31.useState)(false);
|
33018
|
+
const [isLoading, setIsLoading] = (0, import_react31.useState)(true);
|
33019
|
+
const keys = (0, import_react31.useMemo)(() => {
|
32853
33020
|
const validKeys = /* @__PURE__ */ new Set();
|
32854
33021
|
for (const item of data) {
|
32855
33022
|
for (const key of Object.keys(item)) {
|
@@ -32860,15 +33027,22 @@ var ExternalInput = ({
|
|
32860
33027
|
}
|
32861
33028
|
return Array.from(validKeys);
|
32862
33029
|
}, [data]);
|
32863
|
-
(0,
|
32864
|
-
|
32865
|
-
|
33030
|
+
const [searchQuery, setSearchQuery] = (0, import_react31.useState)(field.initialQuery || "");
|
33031
|
+
const search = (0, import_react31.useCallback)(
|
33032
|
+
(query) => __async(void 0, null, function* () {
|
33033
|
+
setIsLoading(true);
|
33034
|
+
const cacheKey = `${id}-${name}-${query}`;
|
33035
|
+
const listData = dataCache[cacheKey] || (yield field.fetchList({ query }));
|
32866
33036
|
if (listData) {
|
32867
33037
|
setData(listData);
|
32868
33038
|
setIsLoading(false);
|
32869
|
-
dataCache[
|
33039
|
+
dataCache[cacheKey] = listData;
|
32870
33040
|
}
|
32871
|
-
})
|
33041
|
+
}),
|
33042
|
+
[name, field]
|
33043
|
+
);
|
33044
|
+
(0, import_react31.useEffect)(() => {
|
33045
|
+
search(searchQuery);
|
32872
33046
|
}, []);
|
32873
33047
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
32874
33048
|
"div",
|
@@ -32908,38 +33082,73 @@ var ExternalInput = ({
|
|
32908
33082
|
className: getClassNameModal({
|
32909
33083
|
isLoading,
|
32910
33084
|
loaded: !isLoading,
|
32911
|
-
hasData:
|
33085
|
+
hasData: data.length > 0
|
32912
33086
|
}),
|
32913
33087
|
children: [
|
32914
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.
|
32915
|
-
|
32916
|
-
|
32917
|
-
"
|
33088
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: getClassNameModal("masthead"), children: [
|
33089
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Heading, { rank: 2, size: "xxl", children: "Select content" }),
|
33090
|
+
field.showSearch && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
33091
|
+
"form",
|
32918
33092
|
{
|
32919
|
-
className: getClassNameModal("
|
32920
|
-
|
32921
|
-
|
32922
|
-
|
32923
|
-
|
32924
|
-
|
32925
|
-
|
32926
|
-
|
32927
|
-
|
33093
|
+
className: getClassNameModal("searchForm"),
|
33094
|
+
onSubmit: (e) => {
|
33095
|
+
e.preventDefault();
|
33096
|
+
search(searchQuery);
|
33097
|
+
},
|
33098
|
+
children: [
|
33099
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: getClassNameModal("search"), children: [
|
33100
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
|
33101
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(search_default, { size: "18" }) }),
|
33102
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
33103
|
+
"input",
|
33104
|
+
{
|
33105
|
+
className: getClassNameModal("searchInput"),
|
33106
|
+
name: "q",
|
33107
|
+
type: "search",
|
33108
|
+
placeholder: "Search",
|
33109
|
+
onChange: (e) => {
|
33110
|
+
setSearchQuery(e.currentTarget.value);
|
33111
|
+
},
|
33112
|
+
autoComplete: "off",
|
33113
|
+
value: searchQuery
|
33114
|
+
}
|
33115
|
+
)
|
33116
|
+
] }),
|
33117
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { type: "submit", loading: isLoading, disabled: isLoading, children: "Search" })
|
33118
|
+
]
|
33119
|
+
}
|
33120
|
+
)
|
33121
|
+
] }),
|
33122
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
|
33123
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", { className: getClassNameModal("table"), children: [
|
33124
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
33125
|
+
"th",
|
32928
33126
|
{
|
32929
|
-
|
32930
|
-
|
32931
|
-
|
32932
|
-
onChange(mapProp(item));
|
32933
|
-
setOpen(false);
|
32934
|
-
},
|
32935
|
-
children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
|
33127
|
+
className: getClassNameModal("th"),
|
33128
|
+
style: { textAlign: "left" },
|
33129
|
+
children: key
|
32936
33130
|
},
|
32937
|
-
|
32938
|
-
)
|
32939
|
-
|
32940
|
-
|
32941
|
-
|
32942
|
-
|
33131
|
+
key
|
33132
|
+
)) }) }),
|
33133
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { className: getClassNameModal("tbody"), children: data.map((item, i) => {
|
33134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
33135
|
+
"tr",
|
33136
|
+
{
|
33137
|
+
style: { whiteSpace: "nowrap" },
|
33138
|
+
className: getClassNameModal("tr"),
|
33139
|
+
onClick: (e) => {
|
33140
|
+
onChange(mapProp(item));
|
33141
|
+
setOpen(false);
|
33142
|
+
},
|
33143
|
+
children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
|
33144
|
+
},
|
33145
|
+
i
|
33146
|
+
);
|
33147
|
+
}) })
|
33148
|
+
] }),
|
33149
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_spinners4.ClipLoader, { size: 24, "aria-label": "Loading" }) })
|
33150
|
+
] }),
|
33151
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassNameModal("noContentBanner"), children: "No results." })
|
32943
33152
|
]
|
32944
33153
|
}
|
32945
33154
|
) })
|
@@ -32961,7 +33170,7 @@ var ExternalField = ({
|
|
32961
33170
|
var _a, _b, _c;
|
32962
33171
|
const validField = field;
|
32963
33172
|
const deprecatedField = field;
|
32964
|
-
(0,
|
33173
|
+
(0, import_react32.useEffect)(() => {
|
32965
33174
|
if (deprecatedField.adaptor) {
|
32966
33175
|
console.error(
|
32967
33176
|
"Warning: The `adaptor` API is deprecated. Please use updated APIs on the `external` field instead. This will be a breaking change in a future release."
|
@@ -33010,7 +33219,8 @@ var RadioField = ({
|
|
33010
33219
|
readOnly,
|
33011
33220
|
value,
|
33012
33221
|
name,
|
33013
|
-
id
|
33222
|
+
id,
|
33223
|
+
label
|
33014
33224
|
}) => {
|
33015
33225
|
if (field.type !== "radio" || !field.options) {
|
33016
33226
|
return null;
|
@@ -33019,7 +33229,7 @@ var RadioField = ({
|
|
33019
33229
|
FieldLabelInternal,
|
33020
33230
|
{
|
33021
33231
|
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(check_circle_default, { size: 16 }),
|
33022
|
-
label:
|
33232
|
+
label: label || name,
|
33023
33233
|
readOnly,
|
33024
33234
|
el: "div",
|
33025
33235
|
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName11("radioGroupItems"), id, children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
@@ -33141,8 +33351,72 @@ var TextareaField = ({
|
|
33141
33351
|
|
33142
33352
|
// components/InputOrGroup/index.tsx
|
33143
33353
|
var import_use_debounce2 = require("use-debounce");
|
33354
|
+
|
33355
|
+
// components/InputOrGroup/fields/ObjectField/index.tsx
|
33356
|
+
init_react_import();
|
33357
|
+
|
33358
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/InputOrGroup/fields/ObjectField/styles.module.css#css-module
|
33359
|
+
init_react_import();
|
33360
|
+
var styles_module_default9 = { "ObjectField": "_ObjectField_56z4t_5", "ObjectField-fieldset": "_ObjectField-fieldset_56z4t_13" };
|
33361
|
+
|
33362
|
+
// components/InputOrGroup/fields/ObjectField/index.tsx
|
33144
33363
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
33145
|
-
var getClassName14 = get_class_name_factory_default("
|
33364
|
+
var getClassName14 = get_class_name_factory_default("ObjectField", styles_module_default9);
|
33365
|
+
var getClassNameItem2 = get_class_name_factory_default("ObjectFieldItem", styles_module_default9);
|
33366
|
+
var ObjectField = ({
|
33367
|
+
field,
|
33368
|
+
onChange,
|
33369
|
+
value,
|
33370
|
+
name,
|
33371
|
+
label,
|
33372
|
+
readOnly,
|
33373
|
+
readOnlyFields = {},
|
33374
|
+
id
|
33375
|
+
}) => {
|
33376
|
+
if (field.type !== "object" || !field.objectFields) {
|
33377
|
+
return null;
|
33378
|
+
}
|
33379
|
+
const data = value || {};
|
33380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
33381
|
+
FieldLabelInternal,
|
33382
|
+
{
|
33383
|
+
label: label || name,
|
33384
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(more_vertical_default, { size: 16 }),
|
33385
|
+
el: "div",
|
33386
|
+
readOnly,
|
33387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: getClassName14(), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("fieldset", { className: getClassName14("fieldset"), children: Object.keys(field.objectFields).map((fieldName) => {
|
33388
|
+
const subField = field.objectFields[fieldName];
|
33389
|
+
const subFieldName = `${name}.${fieldName}`;
|
33390
|
+
const wildcardFieldName = `${name}.${fieldName}`;
|
33391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
33392
|
+
InputOrGroup,
|
33393
|
+
{
|
33394
|
+
name: subFieldName,
|
33395
|
+
label: subField.label || fieldName,
|
33396
|
+
id: `${id}_${fieldName}`,
|
33397
|
+
readOnly: typeof readOnlyFields[subFieldName] !== "undefined" ? readOnlyFields[subFieldName] : readOnlyFields[wildcardFieldName],
|
33398
|
+
readOnlyFields,
|
33399
|
+
field: subField,
|
33400
|
+
value: data[fieldName],
|
33401
|
+
onChange: (val, ui) => {
|
33402
|
+
onChange(
|
33403
|
+
__spreadProps(__spreadValues({}, data), {
|
33404
|
+
[fieldName]: val
|
33405
|
+
}),
|
33406
|
+
ui
|
33407
|
+
);
|
33408
|
+
}
|
33409
|
+
},
|
33410
|
+
subFieldName
|
33411
|
+
);
|
33412
|
+
}) }) })
|
33413
|
+
}
|
33414
|
+
);
|
33415
|
+
};
|
33416
|
+
|
33417
|
+
// components/InputOrGroup/index.tsx
|
33418
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
33419
|
+
var getClassName15 = get_class_name_factory_default("Input", styles_module_default3);
|
33146
33420
|
var FieldLabel = ({
|
33147
33421
|
children,
|
33148
33422
|
icon,
|
@@ -33152,11 +33426,11 @@ var FieldLabel = ({
|
|
33152
33426
|
className
|
33153
33427
|
}) => {
|
33154
33428
|
const El = el;
|
33155
|
-
return /* @__PURE__ */ (0,
|
33156
|
-
/* @__PURE__ */ (0,
|
33157
|
-
icon ? /* @__PURE__ */ (0,
|
33429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(El, { className, children: [
|
33430
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getClassName15("label"), children: [
|
33431
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassName15("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {}),
|
33158
33432
|
label,
|
33159
|
-
readOnly && /* @__PURE__ */ (0,
|
33433
|
+
readOnly && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassName15("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(lock_default, { size: "12" }) })
|
33160
33434
|
] }),
|
33161
33435
|
children
|
33162
33436
|
] });
|
@@ -33168,12 +33442,12 @@ var FieldLabelInternal = ({
|
|
33168
33442
|
el = "label",
|
33169
33443
|
readOnly
|
33170
33444
|
}) => {
|
33171
|
-
return /* @__PURE__ */ (0,
|
33445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
33172
33446
|
FieldLabel,
|
33173
33447
|
{
|
33174
33448
|
label,
|
33175
33449
|
icon,
|
33176
|
-
className:
|
33450
|
+
className: getClassName15({ readOnly }),
|
33177
33451
|
readOnly,
|
33178
33452
|
el,
|
33179
33453
|
children
|
@@ -33183,7 +33457,7 @@ var FieldLabelInternal = ({
|
|
33183
33457
|
var InputOrGroup = (_a) => {
|
33184
33458
|
var _b = _a, { onChange } = _b, props = __objRest(_b, ["onChange"]);
|
33185
33459
|
const { name, field, value, readOnly } = props;
|
33186
|
-
const [localValue, setLocalValue] = (0,
|
33460
|
+
const [localValue, setLocalValue] = (0, import_react33.useState)(value);
|
33187
33461
|
const onChangeDb = (0, import_use_debounce2.useDebouncedCallback)(
|
33188
33462
|
(val, ui) => {
|
33189
33463
|
onChange(val, ui);
|
@@ -33191,11 +33465,11 @@ var InputOrGroup = (_a) => {
|
|
33191
33465
|
50,
|
33192
33466
|
{ leading: true }
|
33193
33467
|
);
|
33194
|
-
const onChangeLocal = (0,
|
33468
|
+
const onChangeLocal = (0, import_react33.useCallback)((val, ui) => {
|
33195
33469
|
setLocalValue(val);
|
33196
33470
|
onChangeDb(val, ui);
|
33197
33471
|
}, []);
|
33198
|
-
(0,
|
33472
|
+
(0, import_react33.useEffect)(() => {
|
33199
33473
|
setLocalValue(value);
|
33200
33474
|
}, [value]);
|
33201
33475
|
const localProps = {
|
@@ -33203,31 +33477,34 @@ var InputOrGroup = (_a) => {
|
|
33203
33477
|
onChange: onChangeLocal
|
33204
33478
|
};
|
33205
33479
|
if (field.type === "array") {
|
33206
|
-
return /* @__PURE__ */ (0,
|
33480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ArrayField, __spreadValues(__spreadValues({}, props), localProps));
|
33207
33481
|
}
|
33208
33482
|
if (field.type === "external") {
|
33209
|
-
return /* @__PURE__ */ (0,
|
33483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ExternalField, __spreadValues(__spreadValues({}, props), localProps));
|
33484
|
+
}
|
33485
|
+
if (field.type === "object") {
|
33486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ObjectField, __spreadValues(__spreadValues({}, props), localProps));
|
33210
33487
|
}
|
33211
33488
|
if (field.type === "select") {
|
33212
|
-
return /* @__PURE__ */ (0,
|
33489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectField, __spreadValues(__spreadValues({}, props), localProps));
|
33213
33490
|
}
|
33214
33491
|
if (field.type === "textarea") {
|
33215
|
-
return /* @__PURE__ */ (0,
|
33492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TextareaField, __spreadValues(__spreadValues({}, props), localProps));
|
33216
33493
|
}
|
33217
33494
|
if (field.type === "radio") {
|
33218
|
-
return /* @__PURE__ */ (0,
|
33495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(RadioField, __spreadValues(__spreadValues({}, props), localProps));
|
33219
33496
|
}
|
33220
33497
|
if (field.type === "custom") {
|
33221
33498
|
if (!field.render) {
|
33222
33499
|
return null;
|
33223
33500
|
}
|
33224
|
-
return /* @__PURE__ */ (0,
|
33501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassName15(), children: field.render(__spreadValues({
|
33225
33502
|
field,
|
33226
33503
|
name,
|
33227
33504
|
readOnly
|
33228
33505
|
}, localProps)) });
|
33229
33506
|
}
|
33230
|
-
return /* @__PURE__ */ (0,
|
33507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DefaultField, __spreadValues(__spreadValues({}, props), localProps));
|
33231
33508
|
};
|
33232
33509
|
|
33233
33510
|
// components/ComponentList/index.tsx
|
@@ -33236,28 +33513,28 @@ var import_dnd6 = require("@hello-pangea/dnd");
|
|
33236
33513
|
|
33237
33514
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ComponentList/styles.module.css#css-module
|
33238
33515
|
init_react_import();
|
33239
|
-
var
|
33516
|
+
var styles_module_default10 = { "ComponentList": "_ComponentList_1m8r5_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_1m8r5_6", "ComponentList-content": "_ComponentList-content_1m8r5_10", "ComponentList-title": "_ComponentList-title_1m8r5_18", "ComponentList-titleIcon": "_ComponentList-titleIcon_1m8r5_39", "ComponentListItem": "_ComponentListItem_1m8r5_43", "ComponentListItem-draggable": "_ComponentListItem-draggable_1m8r5_43", "ComponentListItem-name": "_ComponentListItem-name_1m8r5_60", "ComponentList--isDraggingFrom": "_ComponentList--isDraggingFrom_1m8r5_66" };
|
33240
33517
|
|
33241
33518
|
// components/ComponentList/index.tsx
|
33242
|
-
var
|
33243
|
-
var
|
33244
|
-
var
|
33519
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
33520
|
+
var getClassName16 = get_class_name_factory_default("ComponentList", styles_module_default10);
|
33521
|
+
var getClassNameItem3 = get_class_name_factory_default("ComponentListItem", styles_module_default10);
|
33245
33522
|
var ComponentListItem = ({
|
33246
33523
|
component,
|
33247
33524
|
index,
|
33248
33525
|
id
|
33249
33526
|
}) => {
|
33250
|
-
return /* @__PURE__ */ (0,
|
33527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassNameItem3(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
33251
33528
|
Draggable2,
|
33252
33529
|
{
|
33253
33530
|
id,
|
33254
33531
|
index,
|
33255
33532
|
showShadow: true,
|
33256
33533
|
disableAnimations: true,
|
33257
|
-
className: () =>
|
33258
|
-
children: () => /* @__PURE__ */ (0,
|
33259
|
-
/* @__PURE__ */ (0,
|
33260
|
-
/* @__PURE__ */ (0,
|
33534
|
+
className: () => getClassNameItem3("draggable"),
|
33535
|
+
children: () => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
33536
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassNameItem3("name"), children: component }),
|
33537
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassNameItem3("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DragIcon, {}) })
|
33261
33538
|
] })
|
33262
33539
|
},
|
33263
33540
|
component
|
@@ -33270,11 +33547,11 @@ var ComponentList = ({
|
|
33270
33547
|
}) => {
|
33271
33548
|
const { config, state, setUi } = useAppContext();
|
33272
33549
|
const { expanded = true } = state.ui.componentList[id] || {};
|
33273
|
-
return /* @__PURE__ */ (0,
|
33274
|
-
title && /* @__PURE__ */ (0,
|
33550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: getClassName16({ isExpanded: expanded }), children: [
|
33551
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
33275
33552
|
"div",
|
33276
33553
|
{
|
33277
|
-
className:
|
33554
|
+
className: getClassName16("title"),
|
33278
33555
|
onClick: () => setUi({
|
33279
33556
|
componentList: __spreadProps(__spreadValues({}, state.ui.componentList), {
|
33280
33557
|
[id]: __spreadProps(__spreadValues({}, state.ui.componentList[id]), {
|
@@ -33284,26 +33561,26 @@ var ComponentList = ({
|
|
33284
33561
|
}),
|
33285
33562
|
title: expanded ? `Collapse${title ? ` ${title}` : ""}` : `Expand${title ? ` ${title}` : ""}`,
|
33286
33563
|
children: [
|
33287
|
-
/* @__PURE__ */ (0,
|
33288
|
-
/* @__PURE__ */ (0,
|
33564
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: title }),
|
33565
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassName16("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(chevron_up_default, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(chevron_down_default, { size: 12 }) })
|
33289
33566
|
]
|
33290
33567
|
}
|
33291
33568
|
),
|
33292
|
-
/* @__PURE__ */ (0,
|
33569
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassName16("content"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
33293
33570
|
import_dnd6.Droppable,
|
33294
33571
|
{
|
33295
33572
|
droppableId: `component-list${title ? `:${title}` : ""}`,
|
33296
33573
|
isDropDisabled: true,
|
33297
|
-
children: (provided, snapshot) => /* @__PURE__ */ (0,
|
33574
|
+
children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
33298
33575
|
"div",
|
33299
33576
|
__spreadProps(__spreadValues({}, provided.droppableProps), {
|
33300
33577
|
ref: provided.innerRef,
|
33301
|
-
className:
|
33578
|
+
className: getClassName16({
|
33302
33579
|
isDraggingFrom: !!snapshot.draggingFromThisWith
|
33303
33580
|
}),
|
33304
33581
|
children: [
|
33305
33582
|
children || Object.keys(config.components).map((componentKey, i) => {
|
33306
|
-
return /* @__PURE__ */ (0,
|
33583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
33307
33584
|
ComponentListItem,
|
33308
33585
|
{
|
33309
33586
|
component: componentKey,
|
@@ -33313,7 +33590,7 @@ var ComponentList = ({
|
|
33313
33590
|
componentKey
|
33314
33591
|
);
|
33315
33592
|
}),
|
33316
|
-
/* @__PURE__ */ (0,
|
33593
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { style: { display: "none" }, children: provided.placeholder })
|
33317
33594
|
]
|
33318
33595
|
})
|
33319
33596
|
)
|
@@ -33325,10 +33602,10 @@ ComponentList.Item = ComponentListItem;
|
|
33325
33602
|
|
33326
33603
|
// lib/use-placeholder-style.ts
|
33327
33604
|
init_react_import();
|
33328
|
-
var
|
33605
|
+
var import_react34 = require("react");
|
33329
33606
|
var usePlaceholderStyle = () => {
|
33330
33607
|
const queryAttr = "data-rfd-drag-handle-draggable-id";
|
33331
|
-
const [placeholderStyle, setPlaceholderStyle] = (0,
|
33608
|
+
const [placeholderStyle, setPlaceholderStyle] = (0, import_react34.useState)();
|
33332
33609
|
const onDragStartOrUpdate = (draggedItem) => {
|
33333
33610
|
var _a;
|
33334
33611
|
const draggableId = draggedItem.draggableId;
|
@@ -33376,11 +33653,11 @@ init_react_import();
|
|
33376
33653
|
|
33377
33654
|
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
33378
33655
|
init_react_import();
|
33379
|
-
var
|
33656
|
+
var styles_module_default11 = { "SidebarSection": "_SidebarSection_1uyg2_1", "SidebarSection-title": "_SidebarSection-title_1uyg2_12", "SidebarSection-content": "_SidebarSection-content_1uyg2_19", "SidebarSection--noPadding": "_SidebarSection--noPadding_1uyg2_24", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_1uyg2_37", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_1uyg2_48", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_1uyg2_37", "SidebarSection-heading": "_SidebarSection-heading_1uyg2_60", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_1uyg2_64" };
|
33380
33657
|
|
33381
33658
|
// lib/use-breadcrumbs.ts
|
33382
33659
|
init_react_import();
|
33383
|
-
var
|
33660
|
+
var import_react35 = require("react");
|
33384
33661
|
var convertPathDataToBreadcrumbs = (selectedItem, pathData, data) => {
|
33385
33662
|
const id = selectedItem ? selectedItem == null ? void 0 : selectedItem.props.id : "";
|
33386
33663
|
const currentPathData = pathData && id && pathData[id] ? __spreadValues({}, pathData[id]) : { label: "Page", path: [] };
|
@@ -33430,8 +33707,8 @@ var useBreadcrumbs = (renderCount) => {
|
|
33430
33707
|
state: { data },
|
33431
33708
|
selectedItem
|
33432
33709
|
} = useAppContext();
|
33433
|
-
const dzContext = (0,
|
33434
|
-
return (0,
|
33710
|
+
const dzContext = (0, import_react35.useContext)(dropZoneContext);
|
33711
|
+
return (0, import_react35.useMemo)(() => {
|
33435
33712
|
const breadcrumbs = convertPathDataToBreadcrumbs(
|
33436
33713
|
selectedItem,
|
33437
33714
|
dzContext == null ? void 0 : dzContext.pathData,
|
@@ -33446,8 +33723,8 @@ var useBreadcrumbs = (renderCount) => {
|
|
33446
33723
|
|
33447
33724
|
// components/SidebarSection/index.tsx
|
33448
33725
|
var import_react_spinners5 = require("react-spinners");
|
33449
|
-
var
|
33450
|
-
var
|
33726
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
33727
|
+
var getClassName17 = get_class_name_factory_default("SidebarSection", styles_module_default11);
|
33451
33728
|
var SidebarSection = ({
|
33452
33729
|
children,
|
33453
33730
|
title,
|
@@ -33458,23 +33735,23 @@ var SidebarSection = ({
|
|
33458
33735
|
}) => {
|
33459
33736
|
const { setUi } = useAppContext();
|
33460
33737
|
const breadcrumbs = useBreadcrumbs(1);
|
33461
|
-
return /* @__PURE__ */ (0,
|
33462
|
-
/* @__PURE__ */ (0,
|
33463
|
-
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0,
|
33464
|
-
/* @__PURE__ */ (0,
|
33738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: getClassName17({ noPadding }), style: { background }, children: [
|
33739
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName17("title"), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: getClassName17("breadcrumbs"), children: [
|
33740
|
+
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: getClassName17("breadcrumb"), children: [
|
33741
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
33465
33742
|
"div",
|
33466
33743
|
{
|
33467
|
-
className:
|
33744
|
+
className: getClassName17("breadcrumbLabel"),
|
33468
33745
|
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
33469
33746
|
children: breadcrumb.label
|
33470
33747
|
}
|
33471
33748
|
),
|
33472
|
-
/* @__PURE__ */ (0,
|
33749
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(chevron_right_default, { size: 16 })
|
33473
33750
|
] }, i)) : null,
|
33474
|
-
/* @__PURE__ */ (0,
|
33751
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName17("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Heading, { rank: 2, size: "xs", children: title }) })
|
33475
33752
|
] }) }),
|
33476
|
-
/* @__PURE__ */ (0,
|
33477
|
-
isLoading && /* @__PURE__ */ (0,
|
33753
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName17("content"), children }),
|
33754
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName17("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_spinners5.ClipLoader, {}) })
|
33478
33755
|
] });
|
33479
33756
|
};
|
33480
33757
|
|
@@ -33483,11 +33760,11 @@ init_react_import();
|
|
33483
33760
|
|
33484
33761
|
// lib/use-puck-history.ts
|
33485
33762
|
init_react_import();
|
33486
|
-
var
|
33763
|
+
var import_react37 = require("react");
|
33487
33764
|
|
33488
33765
|
// lib/use-action-history.ts
|
33489
33766
|
init_react_import();
|
33490
|
-
var
|
33767
|
+
var import_react36 = require("react");
|
33491
33768
|
|
33492
33769
|
// lib/generate-id.ts
|
33493
33770
|
init_react_import();
|
@@ -33497,8 +33774,8 @@ var generateId = (type) => `${type}-${(0, import_crypto.randomBytes)(20).toStrin
|
|
33497
33774
|
// lib/use-action-history.ts
|
33498
33775
|
var EMPTY_HISTORY_INDEX = -1;
|
33499
33776
|
function useActionHistory() {
|
33500
|
-
const [histories, setHistories] = (0,
|
33501
|
-
const [currentHistoryIndex, setCurrentHistoryIndex] = (0,
|
33777
|
+
const [histories, setHistories] = (0, import_react36.useState)([]);
|
33778
|
+
const [currentHistoryIndex, setCurrentHistoryIndex] = (0, import_react36.useState)(EMPTY_HISTORY_INDEX);
|
33502
33779
|
const currentHistory = histories[currentHistoryIndex];
|
33503
33780
|
const canRewind = currentHistoryIndex > EMPTY_HISTORY_INDEX;
|
33504
33781
|
const canForward = currentHistoryIndex < histories.length - 1;
|
@@ -33577,7 +33854,7 @@ function usePuckHistory({
|
|
33577
33854
|
dispatch
|
33578
33855
|
});
|
33579
33856
|
}, DEBOUNCE_TIME);
|
33580
|
-
(0,
|
33857
|
+
(0, import_react37.useEffect)(() => {
|
33581
33858
|
historyEmitter.on(RECORD_DIFF, handleRecordDiff);
|
33582
33859
|
return () => {
|
33583
33860
|
historyEmitter.off(RECORD_DIFF, handleRecordDiff);
|
@@ -33925,7 +34202,7 @@ init_react_import();
|
|
33925
34202
|
|
33926
34203
|
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css#css-module
|
33927
34204
|
init_react_import();
|
33928
|
-
var
|
34205
|
+
var styles_module_default12 = { "LayerTree": "_LayerTree_o89yt_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_o89yt_11", "LayerTree-helper": "_LayerTree-helper_o89yt_17", "Layer": "_Layer_o89yt_1", "Layer-inner": "_Layer-inner_o89yt_29", "Layer--containsZone": "_Layer--containsZone_o89yt_35", "Layer-clickable": "_Layer-clickable_o89yt_39", "Layer--isSelected": "_Layer--isSelected_o89yt_48", "Layer--isHovering": "_Layer--isHovering_o89yt_49", "Layer-chevron": "_Layer-chevron_o89yt_65", "Layer--childIsSelected": "_Layer--childIsSelected_o89yt_66", "Layer-zones": "_Layer-zones_o89yt_70", "Layer-title": "_Layer-title_o89yt_84", "Layer-name": "_Layer-name_o89yt_93", "Layer-icon": "_Layer-icon_o89yt_99", "Layer-zoneIcon": "_Layer-zoneIcon_o89yt_104" };
|
33929
34206
|
|
33930
34207
|
// lib/scroll-into-view.ts
|
33931
34208
|
init_react_import();
|
@@ -33939,7 +34216,7 @@ var scrollIntoView = (el) => {
|
|
33939
34216
|
};
|
33940
34217
|
|
33941
34218
|
// components/LayerTree/index.tsx
|
33942
|
-
var
|
34219
|
+
var import_react38 = require("react");
|
33943
34220
|
|
33944
34221
|
// lib/find-zones-for-area.ts
|
33945
34222
|
init_react_import();
|
@@ -33965,9 +34242,9 @@ var isChildOfZone = (item, maybeChild, ctx) => {
|
|
33965
34242
|
};
|
33966
34243
|
|
33967
34244
|
// components/LayerTree/index.tsx
|
33968
|
-
var
|
33969
|
-
var
|
33970
|
-
var getClassNameLayer = get_class_name_factory_default("Layer",
|
34245
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
34246
|
+
var getClassName18 = get_class_name_factory_default("LayerTree", styles_module_default12);
|
34247
|
+
var getClassNameLayer = get_class_name_factory_default("Layer", styles_module_default12);
|
33971
34248
|
var LayerTree = ({
|
33972
34249
|
data,
|
33973
34250
|
zoneContent,
|
@@ -33977,15 +34254,15 @@ var LayerTree = ({
|
|
33977
34254
|
label
|
33978
34255
|
}) => {
|
33979
34256
|
const zones = data.zones || {};
|
33980
|
-
const ctx = (0,
|
33981
|
-
return /* @__PURE__ */ (0,
|
33982
|
-
label && /* @__PURE__ */ (0,
|
33983
|
-
/* @__PURE__ */ (0,
|
34257
|
+
const ctx = (0, import_react38.useContext)(dropZoneContext);
|
34258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
34259
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: getClassName18("zoneTitle"), children: [
|
34260
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName18("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(layers_default, { size: "16" }) }),
|
33984
34261
|
" ",
|
33985
34262
|
label
|
33986
34263
|
] }),
|
33987
|
-
/* @__PURE__ */ (0,
|
33988
|
-
zoneContent.length === 0 && /* @__PURE__ */ (0,
|
34264
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("ul", { className: getClassName18(), children: [
|
34265
|
+
zoneContent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName18("helper"), children: "No items" }),
|
33989
34266
|
zoneContent.map((item, i) => {
|
33990
34267
|
const isSelected = (itemSelector == null ? void 0 : itemSelector.index) === i && (itemSelector.zone === zone || itemSelector.zone === rootDroppableId && !zone);
|
33991
34268
|
const zonesForItem = findZonesForArea(data, item.props.id);
|
@@ -34000,7 +34277,7 @@ var LayerTree = ({
|
|
34000
34277
|
const selectedItem = itemSelector && data ? getItem(itemSelector, data) : null;
|
34001
34278
|
const isHovering = hoveringComponent === item.props.id;
|
34002
34279
|
const childIsSelected = isChildOfZone(item, selectedItem, ctx);
|
34003
|
-
return /* @__PURE__ */ (0,
|
34280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
34004
34281
|
"li",
|
34005
34282
|
{
|
34006
34283
|
className: getClassNameLayer({
|
@@ -34010,7 +34287,7 @@ var LayerTree = ({
|
|
34010
34287
|
childIsSelected
|
34011
34288
|
}),
|
34012
34289
|
children: [
|
34013
|
-
/* @__PURE__ */ (0,
|
34290
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
34014
34291
|
"div",
|
34015
34292
|
{
|
34016
34293
|
className: getClassNameLayer("clickable"),
|
@@ -34041,22 +34318,22 @@ var LayerTree = ({
|
|
34041
34318
|
setHoveringComponent(null);
|
34042
34319
|
},
|
34043
34320
|
children: [
|
34044
|
-
containsZone && /* @__PURE__ */ (0,
|
34321
|
+
containsZone && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
34045
34322
|
"div",
|
34046
34323
|
{
|
34047
34324
|
className: getClassNameLayer("chevron"),
|
34048
34325
|
title: isSelected ? "Collapse" : "Expand",
|
34049
|
-
children: /* @__PURE__ */ (0,
|
34326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(chevron_down_default, { size: "12" })
|
34050
34327
|
}
|
34051
34328
|
),
|
34052
|
-
/* @__PURE__ */ (0,
|
34053
|
-
/* @__PURE__ */ (0,
|
34054
|
-
/* @__PURE__ */ (0,
|
34329
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: getClassNameLayer("title"), children: [
|
34330
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(type_default, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(grid_default, { size: "16" }) }),
|
34331
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameLayer("name"), children: item.type })
|
34055
34332
|
] })
|
34056
34333
|
]
|
34057
34334
|
}
|
34058
34335
|
) }),
|
34059
|
-
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0,
|
34336
|
+
containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
34060
34337
|
LayerTree,
|
34061
34338
|
{
|
34062
34339
|
data,
|
@@ -34102,11 +34379,11 @@ var flushZones = (appState) => {
|
|
34102
34379
|
|
34103
34380
|
// lib/use-component-list.tsx
|
34104
34381
|
init_react_import();
|
34105
|
-
var
|
34106
|
-
var
|
34382
|
+
var import_react39 = require("react");
|
34383
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
34107
34384
|
var useComponentList = (config, ui) => {
|
34108
|
-
const [componentList, setComponentList] = (0,
|
34109
|
-
(0,
|
34385
|
+
const [componentList, setComponentList] = (0, import_react39.useState)();
|
34386
|
+
(0, import_react39.useEffect)(() => {
|
34110
34387
|
var _a, _b, _c;
|
34111
34388
|
if (Object.keys(ui.componentList).length > 0) {
|
34112
34389
|
const matchedComponents = [];
|
@@ -34116,14 +34393,14 @@ var useComponentList = (config, ui) => {
|
|
34116
34393
|
if (category.visible === false || !category.components) {
|
34117
34394
|
return null;
|
34118
34395
|
}
|
34119
|
-
return /* @__PURE__ */ (0,
|
34396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
34120
34397
|
ComponentList,
|
34121
34398
|
{
|
34122
34399
|
id: categoryKey,
|
34123
34400
|
title: category.title || categoryKey,
|
34124
34401
|
children: category.components.map((componentName, i) => {
|
34125
34402
|
matchedComponents.push(componentName);
|
34126
|
-
return /* @__PURE__ */ (0,
|
34403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
34127
34404
|
ComponentList.Item,
|
34128
34405
|
{
|
34129
34406
|
component: componentName,
|
@@ -34143,13 +34420,13 @@ var useComponentList = (config, ui) => {
|
|
34143
34420
|
);
|
34144
34421
|
if (remainingComponents.length > 0 && !((_a = ui.componentList.other) == null ? void 0 : _a.components) && ((_b = ui.componentList.other) == null ? void 0 : _b.visible) !== false) {
|
34145
34422
|
_componentList.push(
|
34146
|
-
/* @__PURE__ */ (0,
|
34423
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
34147
34424
|
ComponentList,
|
34148
34425
|
{
|
34149
34426
|
id: "other",
|
34150
34427
|
title: ((_c = ui.componentList.other) == null ? void 0 : _c.title) || "Other",
|
34151
34428
|
children: remainingComponents.map((componentName, i) => {
|
34152
|
-
return /* @__PURE__ */ (0,
|
34429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
34153
34430
|
ComponentList.Item,
|
34154
34431
|
{
|
34155
34432
|
component: componentName,
|
@@ -34172,7 +34449,7 @@ var useComponentList = (config, ui) => {
|
|
34172
34449
|
|
34173
34450
|
// lib/use-resolved-data.ts
|
34174
34451
|
init_react_import();
|
34175
|
-
var
|
34452
|
+
var import_react40 = require("react");
|
34176
34453
|
|
34177
34454
|
// lib/resolve-component-data.ts
|
34178
34455
|
init_react_import();
|
@@ -34287,13 +34564,13 @@ var resolveRootData = (data, config) => __async(void 0, null, function* () {
|
|
34287
34564
|
|
34288
34565
|
// lib/use-resolved-data.ts
|
34289
34566
|
var useResolvedData = (appState, config, dispatch) => {
|
34290
|
-
const [{ resolverKey, newAppState }, setResolverState] = (0,
|
34567
|
+
const [{ resolverKey, newAppState }, setResolverState] = (0, import_react40.useState)({
|
34291
34568
|
resolverKey: 0,
|
34292
34569
|
newAppState: appState
|
34293
34570
|
});
|
34294
|
-
const [componentState, setComponentState] = (0,
|
34571
|
+
const [componentState, setComponentState] = (0, import_react40.useState)({});
|
34295
34572
|
const deferredSetStates = {};
|
34296
|
-
const setComponentLoading = (0,
|
34573
|
+
const setComponentLoading = (0, import_react40.useCallback)(
|
34297
34574
|
(id, loading, defer = 0) => {
|
34298
34575
|
if (deferredSetStates[id]) {
|
34299
34576
|
clearTimeout(deferredSetStates[id]);
|
@@ -34324,7 +34601,7 @@ var useResolvedData = (appState, config, dispatch) => {
|
|
34324
34601
|
type: "set",
|
34325
34602
|
state: (prev) => __spreadProps(__spreadValues({}, prev), {
|
34326
34603
|
data: applyDynamicProps(prev.data, dynamicDataMap, dynamicRoot),
|
34327
|
-
ui: __spreadValues(__spreadValues({}, prev.ui), newAppState.ui)
|
34604
|
+
ui: resolverKey > 0 ? __spreadValues(__spreadValues({}, prev.ui), newAppState.ui) : prev.ui
|
34328
34605
|
}),
|
34329
34606
|
recordHistory: resolverKey > 0
|
34330
34607
|
});
|
@@ -34360,10 +34637,10 @@ var useResolvedData = (appState, config, dispatch) => {
|
|
34360
34637
|
});
|
34361
34638
|
yield Promise.all(promises);
|
34362
34639
|
});
|
34363
|
-
(0,
|
34640
|
+
(0, import_react40.useEffect)(() => {
|
34364
34641
|
runResolvers();
|
34365
34642
|
}, [resolverKey]);
|
34366
|
-
const resolveData = (0,
|
34643
|
+
const resolveData = (0, import_react40.useCallback)((newAppState2 = appState) => {
|
34367
34644
|
setResolverState((curr) => ({
|
34368
34645
|
resolverKey: curr.resolverKey + 1,
|
34369
34646
|
newAppState: newAppState2
|
@@ -34380,11 +34657,11 @@ init_react_import();
|
|
34380
34657
|
|
34381
34658
|
// css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css#css-module
|
34382
34659
|
init_react_import();
|
34383
|
-
var
|
34660
|
+
var styles_module_default13 = { "MenuBar": "_MenuBar_12sp7_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_12sp7_14", "MenuBar-inner": "_MenuBar-inner_12sp7_29", "MenuBar-history": "_MenuBar-history_12sp7_45" };
|
34384
34661
|
|
34385
34662
|
// components/MenuBar/index.tsx
|
34386
|
-
var
|
34387
|
-
var
|
34663
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
34664
|
+
var getClassName19 = get_class_name_factory_default("MenuBar", styles_module_default13);
|
34388
34665
|
var MenuBar = ({
|
34389
34666
|
appState,
|
34390
34667
|
data = { content: [], root: { props: { title: "" } } },
|
@@ -34398,10 +34675,10 @@ var MenuBar = ({
|
|
34398
34675
|
appState,
|
34399
34676
|
dispatch
|
34400
34677
|
});
|
34401
|
-
return /* @__PURE__ */ (0,
|
34678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
34402
34679
|
"div",
|
34403
34680
|
{
|
34404
|
-
className:
|
34681
|
+
className: getClassName19({ menuOpen }),
|
34405
34682
|
onClick: (event) => {
|
34406
34683
|
var _a;
|
34407
34684
|
const element = event.target;
|
@@ -34412,16 +34689,16 @@ var MenuBar = ({
|
|
34412
34689
|
setMenuOpen(false);
|
34413
34690
|
}
|
34414
34691
|
},
|
34415
|
-
children: /* @__PURE__ */ (0,
|
34416
|
-
/* @__PURE__ */ (0,
|
34417
|
-
/* @__PURE__ */ (0,
|
34692
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: getClassName19("inner"), children: [
|
34693
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: getClassName19("history"), children: [
|
34694
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconButton, { title: "undo", disabled: !canRewind, onClick: rewind, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
34418
34695
|
chevron_left_default,
|
34419
34696
|
{
|
34420
34697
|
size: 21,
|
34421
34698
|
stroke: canRewind ? "var(--puck-color-black)" : "var(--puck-color-grey-7)"
|
34422
34699
|
}
|
34423
34700
|
) }),
|
34424
|
-
/* @__PURE__ */ (0,
|
34701
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconButton, { title: "redo", disabled: !canForward, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
34425
34702
|
chevron_right_default,
|
34426
34703
|
{
|
34427
34704
|
size: 21,
|
@@ -34429,17 +34706,17 @@ var MenuBar = ({
|
|
34429
34706
|
}
|
34430
34707
|
) })
|
34431
34708
|
] }),
|
34432
|
-
/* @__PURE__ */ (0,
|
34709
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: renderHeaderActions && renderHeaderActions({
|
34433
34710
|
state: appState,
|
34434
34711
|
dispatch
|
34435
34712
|
}) }),
|
34436
|
-
/* @__PURE__ */ (0,
|
34713
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
34437
34714
|
Button,
|
34438
34715
|
{
|
34439
34716
|
onClick: () => {
|
34440
34717
|
onPublish(data);
|
34441
34718
|
},
|
34442
|
-
icon: /* @__PURE__ */ (0,
|
34719
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(globe_default, { size: "14px" }),
|
34443
34720
|
children: "Publish"
|
34444
34721
|
}
|
34445
34722
|
) })
|
@@ -34450,11 +34727,11 @@ var MenuBar = ({
|
|
34450
34727
|
|
34451
34728
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/styles.module.css#css-module
|
34452
34729
|
init_react_import();
|
34453
|
-
var
|
34730
|
+
var styles_module_default14 = { "Puck": "_Puck_103k9_19", "Puck--leftSideBarVisible": "_Puck--leftSideBarVisible_103k9_35", "Puck--rightSideBarVisible": "_Puck--rightSideBarVisible_103k9_41", "Puck-header": "_Puck-header_103k9_95", "Puck-headerInner": "_Puck-headerInner_103k9_104", "Puck-headerToggle": "_Puck-headerToggle_103k9_114", "Puck-rightSideBarToggle": "_Puck-rightSideBarToggle_103k9_121", "Puck-leftSideBarToggle": "_Puck-leftSideBarToggle_103k9_126", "Puck-headerTitle": "_Puck-headerTitle_103k9_130", "Puck-headerPath": "_Puck-headerPath_103k9_134", "Puck-headerTools": "_Puck-headerTools_103k9_141", "Puck-menuButton": "_Puck-menuButton_103k9_147", "Puck--menuOpen": "_Puck--menuOpen_103k9_152", "Puck-leftSideBar": "_Puck-leftSideBar_103k9_126", "Puck-frame": "_Puck-frame_103k9_171", "Puck-root": "_Puck-root_103k9_179", "Puck-page": "_Puck-page_103k9_192", "Puck-rightSideBar": "_Puck-rightSideBar_103k9_121" };
|
34454
34731
|
|
34455
34732
|
// components/Puck/index.tsx
|
34456
|
-
var
|
34457
|
-
var
|
34733
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
34734
|
+
var getClassName20 = get_class_name_factory_default("Puck", styles_module_default14);
|
34458
34735
|
var defaultPageFields = {
|
34459
34736
|
title: { type: "text" }
|
34460
34737
|
};
|
@@ -34466,7 +34743,7 @@ var PluginRenderer = ({
|
|
34466
34743
|
renderMethod
|
34467
34744
|
}) => {
|
34468
34745
|
return plugins.filter((item) => item[renderMethod]).map((item) => item[renderMethod]).reduce(
|
34469
|
-
(accChildren, Item) => /* @__PURE__ */ (0,
|
34746
|
+
(accChildren, Item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Item, { dispatch, state, children: accChildren }),
|
34470
34747
|
children
|
34471
34748
|
);
|
34472
34749
|
};
|
@@ -34483,8 +34760,8 @@ function Puck({
|
|
34483
34760
|
headerPath
|
34484
34761
|
}) {
|
34485
34762
|
var _a, _b;
|
34486
|
-
const [reducer] = (0,
|
34487
|
-
const [initialAppState] = (0,
|
34763
|
+
const [reducer] = (0, import_react41.useState)(() => createReducer({ config }));
|
34764
|
+
const [initialAppState] = (0, import_react41.useState)(__spreadProps(__spreadValues({}, defaultAppState), {
|
34488
34765
|
data: initialData,
|
34489
34766
|
ui: __spreadProps(__spreadValues({}, defaultAppState.ui), {
|
34490
34767
|
// Store categories under componentList on state to allow render functions and plugins to modify
|
@@ -34503,7 +34780,7 @@ function Puck({
|
|
34503
34780
|
) : {}
|
34504
34781
|
})
|
34505
34782
|
}));
|
34506
|
-
const [appState, dispatch] = (0,
|
34783
|
+
const [appState, dispatch] = (0, import_react41.useReducer)(
|
34507
34784
|
reducer,
|
34508
34785
|
flushZones(initialAppState)
|
34509
34786
|
);
|
@@ -34513,9 +34790,9 @@ function Puck({
|
|
34513
34790
|
config,
|
34514
34791
|
dispatch
|
34515
34792
|
);
|
34516
|
-
const [menuOpen, setMenuOpen] = (0,
|
34793
|
+
const [menuOpen, setMenuOpen] = (0, import_react41.useState)(false);
|
34517
34794
|
const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
|
34518
|
-
const setItemSelector = (0,
|
34795
|
+
const setItemSelector = (0, import_react41.useCallback)(
|
34519
34796
|
(newItemSelector) => {
|
34520
34797
|
dispatch({
|
34521
34798
|
type: "setUi",
|
@@ -34525,10 +34802,10 @@ function Puck({
|
|
34525
34802
|
[]
|
34526
34803
|
);
|
34527
34804
|
const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
|
34528
|
-
const Page = (0,
|
34805
|
+
const Page = (0, import_react41.useCallback)(
|
34529
34806
|
(pageProps) => {
|
34530
34807
|
var _a2, _b2;
|
34531
|
-
return /* @__PURE__ */ (0,
|
34808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34532
34809
|
PluginRenderer,
|
34533
34810
|
{
|
34534
34811
|
plugins,
|
@@ -34541,8 +34818,8 @@ function Puck({
|
|
34541
34818
|
},
|
34542
34819
|
[config.root]
|
34543
34820
|
);
|
34544
|
-
const PageFieldWrapper = (0,
|
34545
|
-
(props) => /* @__PURE__ */ (0,
|
34821
|
+
const PageFieldWrapper = (0, import_react41.useCallback)(
|
34822
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34546
34823
|
PluginRenderer,
|
34547
34824
|
{
|
34548
34825
|
plugins,
|
@@ -34554,8 +34831,8 @@ function Puck({
|
|
34554
34831
|
),
|
34555
34832
|
[]
|
34556
34833
|
);
|
34557
|
-
const ComponentFieldWrapper = (0,
|
34558
|
-
(props) => /* @__PURE__ */ (0,
|
34834
|
+
const ComponentFieldWrapper = (0, import_react41.useCallback)(
|
34835
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34559
34836
|
PluginRenderer,
|
34560
34837
|
{
|
34561
34838
|
plugins,
|
@@ -34567,8 +34844,8 @@ function Puck({
|
|
34567
34844
|
),
|
34568
34845
|
[]
|
34569
34846
|
);
|
34570
|
-
const ComponentListWrapper = (0,
|
34571
|
-
const children = /* @__PURE__ */ (0,
|
34847
|
+
const ComponentListWrapper = (0, import_react41.useCallback)((props) => {
|
34848
|
+
const children = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34572
34849
|
PluginRenderer,
|
34573
34850
|
{
|
34574
34851
|
plugins,
|
@@ -34587,22 +34864,22 @@ function Puck({
|
|
34587
34864
|
const FieldWrapper = itemSelector ? ComponentFieldWrapper : PageFieldWrapper;
|
34588
34865
|
const rootFields = ((_a = config.root) == null ? void 0 : _a.fields) || defaultPageFields;
|
34589
34866
|
let fields = selectedItem ? ((_b = config.components[selectedItem.type]) == null ? void 0 : _b.fields) || {} : rootFields;
|
34590
|
-
(0,
|
34867
|
+
(0, import_react41.useEffect)(() => {
|
34591
34868
|
if (onChange)
|
34592
34869
|
onChange(data);
|
34593
34870
|
}, [data]);
|
34594
34871
|
const { onDragStartOrUpdate, placeholderStyle } = usePlaceholderStyle();
|
34595
|
-
const [draggedItem, setDraggedItem] = (0,
|
34872
|
+
const [draggedItem, setDraggedItem] = (0, import_react41.useState)();
|
34596
34873
|
const componentList = useComponentList(config, appState.ui);
|
34597
34874
|
const rootProps = data.root.props || data.root;
|
34598
|
-
(0,
|
34875
|
+
(0, import_react41.useEffect)(() => {
|
34599
34876
|
if (Object.keys(data.root).length > 0 && !data.root.props) {
|
34600
34877
|
console.error(
|
34601
34878
|
"Warning: Defining props on `root` is deprecated. Please use `root.props`. This will be a breaking change in a future release."
|
34602
34879
|
);
|
34603
34880
|
}
|
34604
34881
|
}, []);
|
34605
|
-
const toggleSidebars = (0,
|
34882
|
+
const toggleSidebars = (0, import_react41.useCallback)(
|
34606
34883
|
(sidebar) => {
|
34607
34884
|
const widerViewport = window.matchMedia("(min-width: 638px)").matches;
|
34608
34885
|
const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
|
@@ -34616,7 +34893,7 @@ function Puck({
|
|
34616
34893
|
},
|
34617
34894
|
[dispatch, leftSideBarVisible, rightSideBarVisible]
|
34618
34895
|
);
|
34619
|
-
(0,
|
34896
|
+
(0, import_react41.useEffect)(() => {
|
34620
34897
|
if (!window.matchMedia("(min-width: 638px)").matches) {
|
34621
34898
|
dispatch({
|
34622
34899
|
type: "setUi",
|
@@ -34639,12 +34916,12 @@ function Puck({
|
|
34639
34916
|
window.removeEventListener("resize", handleResize);
|
34640
34917
|
};
|
34641
34918
|
}, []);
|
34642
|
-
return /* @__PURE__ */ (0,
|
34643
|
-
/* @__PURE__ */ (0,
|
34919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
34920
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34644
34921
|
AppProvider,
|
34645
34922
|
{
|
34646
34923
|
value: { state: appState, dispatch, config, componentState },
|
34647
|
-
children: /* @__PURE__ */ (0,
|
34924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34648
34925
|
import_dnd7.DragDropContext,
|
34649
34926
|
{
|
34650
34927
|
onDragUpdate: (update) => {
|
@@ -34697,7 +34974,7 @@ function Puck({
|
|
34697
34974
|
});
|
34698
34975
|
}
|
34699
34976
|
},
|
34700
|
-
children: /* @__PURE__ */ (0,
|
34977
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34701
34978
|
DropZoneProvider,
|
34702
34979
|
{
|
34703
34980
|
value: {
|
@@ -34711,72 +34988,72 @@ function Puck({
|
|
34711
34988
|
mode: "edit",
|
34712
34989
|
areaId: "root"
|
34713
34990
|
},
|
34714
|
-
children: /* @__PURE__ */ (0,
|
34991
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(dropZoneContext.Consumer, { children: (ctx) => {
|
34715
34992
|
var _a2, _b2;
|
34716
|
-
return /* @__PURE__ */ (0,
|
34993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
34717
34994
|
"div",
|
34718
34995
|
{
|
34719
|
-
className:
|
34996
|
+
className: getClassName20({
|
34720
34997
|
leftSideBarVisible,
|
34721
34998
|
menuOpen,
|
34722
34999
|
rightSideBarVisible
|
34723
35000
|
}),
|
34724
35001
|
children: [
|
34725
|
-
/* @__PURE__ */ (0,
|
34726
|
-
children: /* @__PURE__ */ (0,
|
35002
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("header", { className: getClassName20("header"), children: renderHeader ? renderHeader({
|
35003
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34727
35004
|
Button,
|
34728
35005
|
{
|
34729
35006
|
onClick: () => {
|
34730
35007
|
onPublish(data);
|
34731
35008
|
},
|
34732
|
-
icon: /* @__PURE__ */ (0,
|
35009
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(globe_default, { size: "14px" }),
|
34733
35010
|
children: "Publish"
|
34734
35011
|
}
|
34735
35012
|
),
|
34736
35013
|
dispatch,
|
34737
35014
|
state: appState
|
34738
|
-
}) : /* @__PURE__ */ (0,
|
34739
|
-
/* @__PURE__ */ (0,
|
34740
|
-
/* @__PURE__ */ (0,
|
35015
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName20("headerInner"), children: [
|
35016
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName20("headerToggle"), children: [
|
35017
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName20("leftSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34741
35018
|
IconButton,
|
34742
35019
|
{
|
34743
35020
|
onClick: () => {
|
34744
35021
|
toggleSidebars("left");
|
34745
35022
|
},
|
34746
35023
|
title: "Toggle left sidebar",
|
34747
|
-
children: /* @__PURE__ */ (0,
|
35024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(sidebar_default, { focusable: "false" })
|
34748
35025
|
}
|
34749
35026
|
) }),
|
34750
|
-
/* @__PURE__ */ (0,
|
35027
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName20("rightSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34751
35028
|
IconButton,
|
34752
35029
|
{
|
34753
35030
|
onClick: () => {
|
34754
35031
|
toggleSidebars("right");
|
34755
35032
|
},
|
34756
35033
|
title: "Toggle right sidebar",
|
34757
|
-
children: /* @__PURE__ */ (0,
|
35034
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(sidebar_default, { focusable: "false" })
|
34758
35035
|
}
|
34759
35036
|
) })
|
34760
35037
|
] }),
|
34761
|
-
/* @__PURE__ */ (0,
|
35038
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName20("headerTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Heading, { rank: 2, size: "xs", children: [
|
34762
35039
|
headerTitle || rootProps.title || "Page",
|
34763
|
-
headerPath && /* @__PURE__ */ (0,
|
35040
|
+
headerPath && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
34764
35041
|
" ",
|
34765
|
-
/* @__PURE__ */ (0,
|
35042
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { className: getClassName20("headerPath"), children: headerPath })
|
34766
35043
|
] })
|
34767
35044
|
] }) }),
|
34768
|
-
/* @__PURE__ */ (0,
|
34769
|
-
/* @__PURE__ */ (0,
|
35045
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName20("headerTools"), children: [
|
35046
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName20("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34770
35047
|
IconButton,
|
34771
35048
|
{
|
34772
35049
|
onClick: () => {
|
34773
35050
|
return setMenuOpen(!menuOpen);
|
34774
35051
|
},
|
34775
35052
|
title: "Toggle menu bar",
|
34776
|
-
children: menuOpen ? /* @__PURE__ */ (0,
|
35053
|
+
children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(chevron_up_default, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(chevron_down_default, { focusable: "false" })
|
34777
35054
|
}
|
34778
35055
|
) }),
|
34779
|
-
/* @__PURE__ */ (0,
|
35056
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34780
35057
|
MenuBar,
|
34781
35058
|
{
|
34782
35059
|
appState,
|
@@ -34790,10 +35067,10 @@ function Puck({
|
|
34790
35067
|
)
|
34791
35068
|
] })
|
34792
35069
|
] }) }),
|
34793
|
-
/* @__PURE__ */ (0,
|
34794
|
-
/* @__PURE__ */ (0,
|
34795
|
-
/* @__PURE__ */ (0,
|
34796
|
-
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0,
|
35070
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName20("leftSideBar"), children: [
|
35071
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SidebarSection, { title: "Components", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ComponentListWrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ComponentList, { id: "all" }) }) }),
|
35072
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(SidebarSection, { title: "Outline", children: [
|
35073
|
+
(ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34797
35074
|
LayerTree,
|
34798
35075
|
{
|
34799
35076
|
data,
|
@@ -34805,7 +35082,7 @@ function Puck({
|
|
34805
35082
|
),
|
34806
35083
|
Object.entries(findZonesForArea(data, "root")).map(
|
34807
35084
|
([zoneKey, zone]) => {
|
34808
|
-
return /* @__PURE__ */ (0,
|
35085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34809
35086
|
LayerTree,
|
34810
35087
|
{
|
34811
35088
|
data,
|
@@ -34821,23 +35098,23 @@ function Puck({
|
|
34821
35098
|
)
|
34822
35099
|
] })
|
34823
35100
|
] }),
|
34824
|
-
/* @__PURE__ */ (0,
|
35101
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
34825
35102
|
"div",
|
34826
35103
|
{
|
34827
|
-
className:
|
35104
|
+
className: getClassName20("frame"),
|
34828
35105
|
onClick: () => setItemSelector(null),
|
34829
35106
|
id: "puck-frame",
|
34830
35107
|
children: [
|
34831
|
-
/* @__PURE__ */ (0,
|
35108
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName20("root"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName20("page"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34832
35109
|
Page,
|
34833
35110
|
__spreadProps(__spreadValues({
|
34834
35111
|
dispatch,
|
34835
35112
|
state: appState
|
34836
35113
|
}, rootProps), {
|
34837
|
-
children: /* @__PURE__ */ (0,
|
35114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropZone, { zone: rootDroppableId })
|
34838
35115
|
})
|
34839
35116
|
) }) }),
|
34840
|
-
/* @__PURE__ */ (0,
|
35117
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34841
35118
|
"div",
|
34842
35119
|
{
|
34843
35120
|
style: {
|
@@ -34850,7 +35127,7 @@ function Puck({
|
|
34850
35127
|
]
|
34851
35128
|
}
|
34852
35129
|
),
|
34853
|
-
/* @__PURE__ */ (0,
|
35130
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName20("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FieldWrapper, { dispatch, state: appState, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34854
35131
|
SidebarSection,
|
34855
35132
|
{
|
34856
35133
|
noPadding: true,
|
@@ -34928,7 +35205,7 @@ function Puck({
|
|
34928
35205
|
};
|
34929
35206
|
if (selectedItem && itemSelector) {
|
34930
35207
|
const { readOnly = {} } = selectedItem;
|
34931
|
-
return /* @__PURE__ */ (0,
|
35208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34932
35209
|
InputOrGroup,
|
34933
35210
|
{
|
34934
35211
|
field,
|
@@ -34944,7 +35221,7 @@ function Puck({
|
|
34944
35221
|
);
|
34945
35222
|
} else {
|
34946
35223
|
const { readOnly = {} } = data.root;
|
34947
|
-
return /* @__PURE__ */ (0,
|
35224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
34948
35225
|
InputOrGroup,
|
34949
35226
|
{
|
34950
35227
|
field,
|
@@ -34972,13 +35249,13 @@ function Puck({
|
|
34972
35249
|
)
|
34973
35250
|
}
|
34974
35251
|
),
|
34975
|
-
/* @__PURE__ */ (0,
|
35252
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { id: "puck-portal-root" })
|
34976
35253
|
] });
|
34977
35254
|
}
|
34978
35255
|
|
34979
35256
|
// components/Render/index.tsx
|
34980
35257
|
init_react_import();
|
34981
|
-
var
|
35258
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
34982
35259
|
function Render({
|
34983
35260
|
config,
|
34984
35261
|
data
|
@@ -34987,7 +35264,7 @@ function Render({
|
|
34987
35264
|
const rootProps = data.root.props || data.root;
|
34988
35265
|
const title = rootProps.title || "";
|
34989
35266
|
if ((_a = config.root) == null ? void 0 : _a.render) {
|
34990
|
-
return /* @__PURE__ */ (0,
|
35267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
34991
35268
|
config.root.render,
|
34992
35269
|
__spreadProps(__spreadValues({}, rootProps), {
|
34993
35270
|
puck: {
|
@@ -34996,11 +35273,11 @@ function Render({
|
|
34996
35273
|
title,
|
34997
35274
|
editMode: false,
|
34998
35275
|
id: "puck-root",
|
34999
|
-
children: /* @__PURE__ */ (0,
|
35276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZone, { zone: rootDroppableId })
|
35000
35277
|
})
|
35001
35278
|
) });
|
35002
35279
|
}
|
35003
|
-
return /* @__PURE__ */ (0,
|
35280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZoneProvider, { value: { data, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZone, { zone: rootDroppableId }) });
|
35004
35281
|
}
|
35005
35282
|
|
35006
35283
|
// lib/resolve-all-data.ts
|