@measured/puck 0.14.0-canary.4932a6e → 0.14.0-canary.53b7937

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -8084,7 +8084,7 @@ var require_react_dom_development = __commonJS({
8084
8084
  var HostPortal = 4;
8085
8085
  var HostComponent = 5;
8086
8086
  var HostText = 6;
8087
- var Fragment14 = 7;
8087
+ var Fragment13 = 7;
8088
8088
  var Mode = 8;
8089
8089
  var ContextConsumer = 9;
8090
8090
  var ContextProvider = 10;
@@ -9240,7 +9240,7 @@ var require_react_dom_development = __commonJS({
9240
9240
  return "DehydratedFragment";
9241
9241
  case ForwardRef:
9242
9242
  return getWrappedName$1(type, type.render, "ForwardRef");
9243
- case Fragment14:
9243
+ case Fragment13:
9244
9244
  return "Fragment";
9245
9245
  case HostComponent:
9246
9246
  return type;
@@ -18911,7 +18911,7 @@ var require_react_dom_development = __commonJS({
18911
18911
  }
18912
18912
  }
18913
18913
  function updateFragment2(returnFiber, current2, fragment, lanes, key) {
18914
- if (current2 === null || current2.tag !== Fragment14) {
18914
+ if (current2 === null || current2.tag !== Fragment13) {
18915
18915
  var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
18916
18916
  created.return = returnFiber;
18917
18917
  return created;
@@ -19314,7 +19314,7 @@ var require_react_dom_development = __commonJS({
19314
19314
  if (child.key === key) {
19315
19315
  var elementType = element.type;
19316
19316
  if (elementType === REACT_FRAGMENT_TYPE) {
19317
- if (child.tag === Fragment14) {
19317
+ if (child.tag === Fragment13) {
19318
19318
  deleteRemainingChildren(returnFiber, child.sibling);
19319
19319
  var existing = useFiber(child, element.props.children);
19320
19320
  existing.return = returnFiber;
@@ -23489,7 +23489,7 @@ var require_react_dom_development = __commonJS({
23489
23489
  var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
23490
23490
  return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
23491
23491
  }
23492
- case Fragment14:
23492
+ case Fragment13:
23493
23493
  return updateFragment(current2, workInProgress2, renderLanes2);
23494
23494
  case Mode:
23495
23495
  return updateMode(current2, workInProgress2, renderLanes2);
@@ -23762,7 +23762,7 @@ var require_react_dom_development = __commonJS({
23762
23762
  case SimpleMemoComponent:
23763
23763
  case FunctionComponent:
23764
23764
  case ForwardRef:
23765
- case Fragment14:
23765
+ case Fragment13:
23766
23766
  case Mode:
23767
23767
  case Profiler:
23768
23768
  case ContextConsumer:
@@ -28021,7 +28021,7 @@ var require_react_dom_development = __commonJS({
28021
28021
  return fiber;
28022
28022
  }
28023
28023
  function createFiberFromFragment(elements, mode, lanes, key) {
28024
- var fiber = createFiber(Fragment14, elements, key, mode);
28024
+ var fiber = createFiber(Fragment13, elements, key, mode);
28025
28025
  fiber.lanes = lanes;
28026
28026
  return fiber;
28027
28027
  }
@@ -29173,7 +29173,7 @@ var import_react2 = require("react");
29173
29173
 
29174
29174
  // css-module:/home/runner/work/puck/puck/packages/core/components/Button/Button.module.css#css-module
29175
29175
  init_react_import();
29176
- var Button_module_default = { "Button": "_Button_1brfa_1", "Button--medium": "_Button--medium_1brfa_22", "Button--large": "_Button--large_1brfa_29", "Button-icon": "_Button-icon_1brfa_36", "Button--primary": "_Button--primary_1brfa_44", "Button--secondary": "_Button--secondary_1brfa_53", "Button--flush": "_Button--flush_1brfa_64", "Button--disabled": "_Button--disabled_1brfa_68", "Button--fullWidth": "_Button--fullWidth_1brfa_78" };
29176
+ var Button_module_default = { "Button": "_Button_8fn3a_1", "Button--medium": "_Button--medium_8fn3a_29", "Button--large": "_Button--large_8fn3a_37", "Button-icon": "_Button-icon_8fn3a_44", "Button--primary": "_Button--primary_8fn3a_48", "Button--secondary": "_Button--secondary_8fn3a_67", "Button--flush": "_Button--flush_8fn3a_82", "Button--disabled": "_Button--disabled_8fn3a_86", "Button--fullWidth": "_Button--fullWidth_8fn3a_93", "Button-spinner": "_Button-spinner_8fn3a_98" };
29177
29177
 
29178
29178
  // lib/get-class-name-factory.ts
29179
29179
  init_react_import();
@@ -29227,7 +29227,7 @@ var Button = ({
29227
29227
  }) => {
29228
29228
  const [loading, setLoading] = (0, import_react2.useState)(loadingProp);
29229
29229
  (0, import_react2.useEffect)(() => setLoading(loadingProp), [loadingProp]);
29230
- const ElementType = href ? "a" : onClick ? "button" : "div";
29230
+ const ElementType = href ? "a" : type ? "button" : "span";
29231
29231
  const el = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
29232
29232
  ElementType,
29233
29233
  {
@@ -29255,10 +29255,7 @@ var Button = ({
29255
29255
  children: [
29256
29256
  icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassName("icon"), children: icon }),
29257
29257
  children,
29258
- loading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
29259
- "\xA0\xA0",
29260
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spinners.ClipLoader, { "aria-label": "loading", color: "inherit", size: "14px" })
29261
- ] })
29258
+ loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassName("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spinners.ClipLoader, { "aria-label": "loading", color: "inherit", size: "14px" }) })
29262
29259
  ]
29263
29260
  }
29264
29261
  );
@@ -29271,7 +29268,7 @@ var import_dnd2 = require("@hello-pangea/dnd");
29271
29268
 
29272
29269
  // css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css#css-module
29273
29270
  init_react_import();
29274
- var styles_module_default = { "DrawerItem": "_DrawerItem_1qydx_1", "DrawerItem-default": "_DrawerItem-default_1qydx_1", "DrawerItem-draggableWrapper": "_DrawerItem-draggableWrapper_1qydx_1", "DrawerItem-draggable": "_DrawerItem-draggable_1qydx_1", "Drawer": "_Drawer_1qydx_1", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_1qydx_21", "DrawerItem-name": "_DrawerItem-name_1qydx_26" };
29271
+ var styles_module_default = { "Drawer": "_Drawer_6zh0b_1", "DrawerItem-default": "_DrawerItem-default_6zh0b_5", "DrawerItem-draggableWrapper": "_DrawerItem-draggableWrapper_6zh0b_5", "DrawerItem": "_DrawerItem_6zh0b_5", "DrawerItem-draggable": "_DrawerItem-draggable_6zh0b_5", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_6zh0b_31", "DrawerItem-name": "_DrawerItem-name_6zh0b_47" };
29275
29272
 
29276
29273
  // components/Draggable/index.tsx
29277
29274
  init_react_import();
@@ -29350,7 +29347,7 @@ var replace = (list, index, newItem) => {
29350
29347
 
29351
29348
  // css-module:/home/runner/work/puck/puck/packages/core/components/DragIcon/styles.module.css#css-module
29352
29349
  init_react_import();
29353
- var styles_module_default2 = { "DragIcon": "_DragIcon_o29on_1" };
29350
+ var styles_module_default2 = { "DragIcon": "_DragIcon_1p5wn_1" };
29354
29351
 
29355
29352
  // components/DragIcon/index.tsx
29356
29353
  var import_jsx_runtime3 = require("react/jsx-runtime");
@@ -29390,10 +29387,10 @@ var DrawerItem = ({
29390
29387
  const ctx = (0, import_react3.useContext)(drawerContext);
29391
29388
  const resolvedId = `${ctx.droppableId}::${id || name}`;
29392
29389
  const CustomInner = (0, import_react3.useMemo)(
29393
- () => children || (({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem("default"), children: children2 })),
29390
+ () => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem("default"), children: children2 })),
29394
29391
  [children]
29395
29392
  );
29396
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DrawerDraggable, { id: resolvedId, index, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CustomInner, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: getClassNameItem("draggable"), children: [
29393
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DrawerDraggable, { id: resolvedId, index, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CustomInner, { name, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: getClassNameItem("draggable"), children: [
29397
29394
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem("name"), children: name }),
29398
29395
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DragIcon, {}) })
29399
29396
  ] }) }) }) });
@@ -29430,7 +29427,7 @@ var import_dnd3 = require("@hello-pangea/dnd");
29430
29427
 
29431
29428
  // css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css#css-module
29432
29429
  init_react_import();
29433
- var styles_module_default3 = { "DraggableComponent": "_DraggableComponent_foluk_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_foluk_6", "DraggableComponent-contents": "_DraggableComponent-contents_foluk_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_foluk_25", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_foluk_39", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_foluk_55", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_foluk_61", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_foluk_66", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_foluk_71", "DraggableComponent-actions": "_DraggableComponent-actions_foluk_97", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_foluk_120", "DraggableComponent-action": "_DraggableComponent-action_foluk_97" };
29430
+ var styles_module_default3 = { "DraggableComponent": "_DraggableComponent_1vpvt_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_1vpvt_10", "DraggableComponent-contents": "_DraggableComponent-contents_1vpvt_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_1vpvt_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_1vpvt_42", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_1vpvt_58", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_1vpvt_64", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_1vpvt_69", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_1vpvt_74", "DraggableComponent-actions": "_DraggableComponent-actions_1vpvt_100", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_1vpvt_125", "DraggableComponent-action": "_DraggableComponent-action_1vpvt_100" };
29434
29431
 
29435
29432
  // ../../node_modules/lucide-react/dist/esm/lucide-react.js
29436
29433
  init_react_import();
@@ -29618,6 +29615,20 @@ var Search = createLucideIcon("Search", [
29618
29615
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
29619
29616
  ]);
29620
29617
 
29618
+ // ../../node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js
29619
+ init_react_import();
29620
+ var SlidersHorizontal = createLucideIcon("SlidersHorizontal", [
29621
+ ["line", { x1: "21", x2: "14", y1: "4", y2: "4", key: "obuewd" }],
29622
+ ["line", { x1: "10", x2: "3", y1: "4", y2: "4", key: "1q6298" }],
29623
+ ["line", { x1: "21", x2: "12", y1: "12", y2: "12", key: "1iu8h1" }],
29624
+ ["line", { x1: "8", x2: "3", y1: "12", y2: "12", key: "ntss68" }],
29625
+ ["line", { x1: "21", x2: "16", y1: "20", y2: "20", key: "14d8ph" }],
29626
+ ["line", { x1: "12", x2: "3", y1: "20", y2: "20", key: "m0wm8r" }],
29627
+ ["line", { x1: "14", x2: "14", y1: "2", y2: "6", key: "14e1ph" }],
29628
+ ["line", { x1: "8", x2: "8", y1: "10", y2: "14", key: "1i6ji0" }],
29629
+ ["line", { x1: "16", x2: "16", y1: "18", y2: "22", key: "1lctlv" }]
29630
+ ]);
29631
+
29621
29632
  // ../../node_modules/lucide-react/dist/esm/icons/trash.js
29622
29633
  init_react_import();
29623
29634
  var Trash = createLucideIcon("Trash", [
@@ -29773,7 +29784,7 @@ var getItem = (selector, data, dynamicProps = {}) => {
29773
29784
 
29774
29785
  // css-module:/home/runner/work/puck/puck/packages/core/components/DropZone/styles.module.css#css-module
29775
29786
  init_react_import();
29776
- var styles_module_default4 = { "DropZone": "_DropZone_i675d_1", "DropZone--zoomEnabled": "_DropZone--zoomEnabled_i675d_10", "DropZone-renderWrapper": "_DropZone-renderWrapper_i675d_14", "DropZone-content": "_DropZone-content_i675d_18", "DropZone--userIsDragging": "_DropZone--userIsDragging_i675d_23", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_i675d_27", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_i675d_28", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_i675d_34", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_i675d_35", "DropZone--isDisabled": "_DropZone--isDisabled_i675d_36", "DropZone--isRootZone": "_DropZone--isRootZone_i675d_37", "DropZone--hasChildren": "_DropZone--hasChildren_i675d_43", "DropZone--isDestination": "_DropZone--isDestination_i675d_48", "DropZone-item": "_DropZone-item_i675d_56", "DropZone-hitbox": "_DropZone-hitbox_i675d_60" };
29787
+ var styles_module_default4 = { "DropZone": "_DropZone_utidm_1", "DropZone--zoomEnabled": "_DropZone--zoomEnabled_utidm_10", "DropZone-renderWrapper": "_DropZone-renderWrapper_utidm_14", "DropZone-content": "_DropZone-content_utidm_18", "DropZone--userIsDragging": "_DropZone--userIsDragging_utidm_23", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_utidm_27", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_utidm_28", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_utidm_34", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_utidm_35", "DropZone--isDisabled": "_DropZone--isDisabled_utidm_36", "DropZone--isRootZone": "_DropZone--isRootZone_utidm_37", "DropZone--hasChildren": "_DropZone--hasChildren_utidm_43", "DropZone--isDestination": "_DropZone--isDestination_utidm_48", "DropZone-item": "_DropZone-item_utidm_56", "DropZone-hitbox": "_DropZone-hitbox_utidm_60" };
29777
29788
 
29778
29789
  // components/DropZone/context.tsx
29779
29790
  init_react_import();
@@ -30188,7 +30199,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
30188
30199
  {
30189
30200
  "data-puck-placeholder": true,
30190
30201
  style: __spreadProps(__spreadValues({}, placeholderStyle), {
30191
- background: "var(--puck-color-azure-5)",
30202
+ background: "var(--puck-color-azure-06)",
30192
30203
  opacity: 0.3,
30193
30204
  zIndex: 0
30194
30205
  })
@@ -30252,7 +30263,7 @@ var import_react10 = require("react");
30252
30263
 
30253
30264
  // css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css#css-module
30254
30265
  init_react_import();
30255
- var IconButton_module_default = { "IconButton": "_IconButton_38xdr_1", "IconButton-title": "_IconButton-title_38xdr_18" };
30266
+ var IconButton_module_default = { "IconButton": "_IconButton_1xqlg_1", "IconButton-title": "_IconButton-title_1xqlg_33" };
30256
30267
 
30257
30268
  // components/IconButton/IconButton.tsx
30258
30269
  var import_react_spinners3 = require("react-spinners");
@@ -30367,14 +30378,14 @@ init_react_import();
30367
30378
 
30368
30379
  // css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
30369
30380
  init_react_import();
30370
- var styles_module_default5 = { "SidebarSection": "_SidebarSection_170gs_1", "SidebarSection-title": "_SidebarSection-title_170gs_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_170gs_20", "SidebarSection-content": "_SidebarSection-content_170gs_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_170gs_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_170gs_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_170gs_52", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_170gs_41", "SidebarSection-heading": "_SidebarSection-heading_170gs_64", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_170gs_68" };
30381
+ var styles_module_default5 = { "SidebarSection": "_SidebarSection_125qe_1", "SidebarSection-title": "_SidebarSection-title_125qe_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_125qe_20", "SidebarSection-content": "_SidebarSection-content_125qe_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_125qe_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_125qe_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_125qe_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_125qe_41", "SidebarSection-heading": "_SidebarSection-heading_125qe_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_125qe_86" };
30371
30382
 
30372
30383
  // components/Heading/index.tsx
30373
30384
  init_react_import();
30374
30385
 
30375
30386
  // css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
30376
30387
  init_react_import();
30377
- var styles_module_default6 = { "Heading": "_Heading_1bvy5_1", "Heading--xxxxl": "_Heading--xxxxl_1bvy5_13", "Heading--xxxl": "_Heading--xxxl_1bvy5_19", "Heading--xxl": "_Heading--xxl_1bvy5_23", "Heading--xl": "_Heading--xl_1bvy5_27", "Heading--l": "_Heading--l_1bvy5_31", "Heading--m": "_Heading--m_1bvy5_35", "Heading--s": "_Heading--s_1bvy5_39", "Heading--xs": "_Heading--xs_1bvy5_43" };
30388
+ var styles_module_default6 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
30378
30389
 
30379
30390
  // components/Heading/index.tsx
30380
30391
  var import_jsx_runtime9 = require("react/jsx-runtime");
@@ -30482,7 +30493,7 @@ var SidebarSection = ({
30482
30493
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: getClassName8("title"), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: getClassName8("breadcrumbs"), children: [
30483
30494
  showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: getClassName8("breadcrumb"), children: [
30484
30495
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
30485
- "div",
30496
+ "button",
30486
30497
  {
30487
30498
  className: getClassName8("breadcrumbLabel"),
30488
30499
  onClick: () => setUi({ itemSelector: breadcrumb.selector }),
@@ -30527,8 +30538,8 @@ init_react_import();
30527
30538
 
30528
30539
  // lib/generate-id.ts
30529
30540
  init_react_import();
30530
- var import_crypto = require("crypto");
30531
- var generateId = (type) => `${type}-${(0, import_crypto.randomBytes)(20).toString("hex")}`;
30541
+ var import_uuid = require("uuid");
30542
+ var generateId = (type) => `${type}-${(0, import_uuid.v4)()}`;
30532
30543
 
30533
30544
  // lib/reduce-related-zones.ts
30534
30545
  var reduceRelatedZones = (item, data, fn) => {
@@ -31000,7 +31011,10 @@ var useResolvedData = (appState, config, dispatch) => {
31000
31011
  );
31001
31012
  const runResolvers = () => __async(void 0, null, function* () {
31002
31013
  const newData = newAppState.data;
31003
- const flatContent = Object.keys(newData.zones || {}).reduce((acc, zone) => [...acc, ...newData.zones[zone]], newData.content).filter((item) => !!config.components[item.type].resolveData);
31014
+ const flatContent = Object.keys(newData.zones || {}).reduce((acc, zone) => [...acc, ...newData.zones[zone]], newData.content).filter((item) => {
31015
+ var _a;
31016
+ return !!((_a = config.components[item.type]) == null ? void 0 : _a.resolveData);
31017
+ });
31004
31018
  const applyIfChange = (dynamicDataMap, dynamicRoot) => {
31005
31019
  const processed = applyDynamicProps(
31006
31020
  appState.data,
@@ -31070,7 +31084,7 @@ init_react_import();
31070
31084
 
31071
31085
  // css-module:/home/runner/work/puck/puck/packages/core/components/MenuBar/styles.module.css#css-module
31072
31086
  init_react_import();
31073
- var styles_module_default7 = { "MenuBar": "_MenuBar_12sp7_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_12sp7_14", "MenuBar-inner": "_MenuBar-inner_12sp7_29", "MenuBar-history": "_MenuBar-history_12sp7_45" };
31087
+ var styles_module_default7 = { "MenuBar": "_MenuBar_8pf8c_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_8pf8c_14", "MenuBar-inner": "_MenuBar-inner_8pf8c_29", "MenuBar-history": "_MenuBar-history_8pf8c_45" };
31074
31088
 
31075
31089
  // components/MenuBar/index.tsx
31076
31090
  var import_jsx_runtime11 = require("react/jsx-runtime");
@@ -31108,14 +31122,14 @@ var MenuBar = ({
31108
31122
  ChevronLeft,
31109
31123
  {
31110
31124
  size: 21,
31111
- stroke: hasPast ? "var(--puck-color-black)" : "var(--puck-color-grey-7)"
31125
+ stroke: hasPast ? "var(--puck-color-black)" : "var(--puck-color-grey-08)"
31112
31126
  }
31113
31127
  ) }),
31114
31128
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
31115
31129
  ChevronRight,
31116
31130
  {
31117
31131
  size: 21,
31118
- stroke: hasFuture ? "var(--puck-color-black)" : "var(--puck-color-grey-7)"
31132
+ stroke: hasFuture ? "var(--puck-color-black)" : "var(--puck-color-grey-08)"
31119
31133
  }
31120
31134
  ) })
31121
31135
  ] }),
@@ -31140,7 +31154,7 @@ var MenuBar = ({
31140
31154
 
31141
31155
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/styles.module.css#css-module
31142
31156
  init_react_import();
31143
- var styles_module_default8 = { "Puck": "_Puck_17hk3_19", "Puck--leftSideBarVisible": "_Puck--leftSideBarVisible_17hk3_35", "Puck--rightSideBarVisible": "_Puck--rightSideBarVisible_17hk3_41", "Puck-header": "_Puck-header_17hk3_95", "Puck-headerInner": "_Puck-headerInner_17hk3_104", "Puck-headerToggle": "_Puck-headerToggle_17hk3_114", "Puck-rightSideBarToggle": "_Puck-rightSideBarToggle_17hk3_121", "Puck-leftSideBarToggle": "_Puck-leftSideBarToggle_17hk3_122", "Puck-headerTitle": "_Puck-headerTitle_17hk3_126", "Puck-headerPath": "_Puck-headerPath_17hk3_130", "Puck-headerTools": "_Puck-headerTools_17hk3_137", "Puck-menuButton": "_Puck-menuButton_17hk3_143", "Puck--menuOpen": "_Puck--menuOpen_17hk3_148", "Puck-leftSideBar": "_Puck-leftSideBar_17hk3_122", "Puck-frame": "_Puck-frame_17hk3_167", "Puck-root": "_Puck-root_17hk3_175", "Puck-rightSideBar": "_Puck-rightSideBar_17hk3_121" };
31157
+ var styles_module_default8 = { "Puck": "_Puck_1mnww_19", "Puck--leftSideBarVisible": "_Puck--leftSideBarVisible_1mnww_36", "Puck--rightSideBarVisible": "_Puck--rightSideBarVisible_1mnww_42", "Puck-header": "_Puck-header_1mnww_96", "Puck-headerInner": "_Puck-headerInner_1mnww_105", "Puck-headerToggle": "_Puck-headerToggle_1mnww_115", "Puck-rightSideBarToggle": "_Puck-rightSideBarToggle_1mnww_122", "Puck-leftSideBarToggle": "_Puck-leftSideBarToggle_1mnww_123", "Puck-headerTitle": "_Puck-headerTitle_1mnww_127", "Puck-headerPath": "_Puck-headerPath_1mnww_131", "Puck-headerTools": "_Puck-headerTools_1mnww_138", "Puck-menuButton": "_Puck-menuButton_1mnww_144", "Puck--menuOpen": "_Puck--menuOpen_1mnww_149", "Puck-leftSideBar": "_Puck-leftSideBar_1mnww_123", "Puck-frame": "_Puck-frame_1mnww_168", "Puck-root": "_Puck-root_1mnww_176", "Puck-rightSideBar": "_Puck-rightSideBar_1mnww_122" };
31144
31158
 
31145
31159
  // components/Puck/components/Fields/index.tsx
31146
31160
  init_react_import();
@@ -31151,7 +31165,7 @@ init_react_import();
31151
31165
 
31152
31166
  // css-module:/home/runner/work/puck/puck/packages/core/components/InputOrGroup/styles.module.css#css-module
31153
31167
  init_react_import();
31154
- var styles_module_default9 = { "Input": "_Input_1v7zr_1", "Input-label": "_Input-label_1v7zr_27", "Input-labelIcon": "_Input-labelIcon_1v7zr_35", "Input-disabledIcon": "_Input-disabledIcon_1v7zr_41", "Input-input": "_Input-input_1v7zr_46", "Input--readOnly": "_Input--readOnly_1v7zr_69", "Input-radioGroupItems": "_Input-radioGroupItems_1v7zr_87", "Input-radio": "_Input-radio_1v7zr_87", "Input-radioInner": "_Input-radioInner_1v7zr_104", "Input-radioInput": "_Input-radioInput_1v7zr_126" };
31168
+ var styles_module_default9 = { "Input": "_Input_1qi5b_1", "Input-label": "_Input-label_1qi5b_26", "Input-labelIcon": "_Input-labelIcon_1qi5b_34", "Input-disabledIcon": "_Input-disabledIcon_1qi5b_41", "Input-input": "_Input-input_1qi5b_46", "Input--readOnly": "_Input--readOnly_1qi5b_90", "Input-radioGroupItems": "_Input-radioGroupItems_1qi5b_101", "Input-radio": "_Input-radio_1qi5b_101", "Input-radioInner": "_Input-radioInner_1qi5b_118", "Input-radioInput": "_Input-radioInput_1qi5b_163" };
31155
31169
 
31156
31170
  // components/InputOrGroup/index.tsx
31157
31171
  var import_react18 = require("react");
@@ -31164,7 +31178,7 @@ init_react_import();
31164
31178
 
31165
31179
  // css-module:/home/runner/work/puck/puck/packages/core/components/InputOrGroup/fields/ArrayField/styles.module.css#css-module
31166
31180
  init_react_import();
31167
- var styles_module_default10 = { "ArrayField": "_ArrayField_1auyc_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_1auyc_13", "ArrayField-addButton": "_ArrayField-addButton_1auyc_17", "ArrayField--hasItems": "_ArrayField--hasItems_1auyc_31", "ArrayFieldItem": "_ArrayFieldItem_1auyc_45", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_1auyc_53", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_1auyc_58", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_1auyc_73", "ArrayFieldItem--readOnly": "_ArrayFieldItem--readOnly_1auyc_86", "ArrayFieldItem-body": "_ArrayFieldItem-body_1auyc_107", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_1auyc_115", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_1auyc_122", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_1auyc_128", "ArrayFieldItem-action": "_ArrayFieldItem-action_1auyc_128" };
31181
+ var styles_module_default10 = { "ArrayField": "_ArrayField_1txra_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_1txra_13", "ArrayField-addButton": "_ArrayField-addButton_1txra_17", "ArrayField--hasItems": "_ArrayField--hasItems_1txra_32", "ArrayFieldItem": "_ArrayFieldItem_1txra_61", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_1txra_69", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_1txra_74", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_1txra_84", "ArrayFieldItem--readOnly": "_ArrayFieldItem--readOnly_1txra_108", "ArrayFieldItem-body": "_ArrayFieldItem-body_1txra_142", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_1txra_150", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_1txra_157", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_1txra_163" };
31168
31182
 
31169
31183
  // components/InputOrGroup/fields/ArrayField/index.tsx
31170
31184
  var import_dnd5 = require("@hello-pangea/dnd");
@@ -31332,6 +31346,7 @@ var ArrayField = ({
31332
31346
  !readOnly && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassNameItem2("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassNameItem2("action"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
31333
31347
  IconButton,
31334
31348
  {
31349
+ disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
31335
31350
  onClick: (e) => {
31336
31351
  e.stopPropagation();
31337
31352
  const existingValue = [
@@ -31396,6 +31411,7 @@ var ArrayField = ({
31396
31411
  "button",
31397
31412
  {
31398
31413
  className: getClassName10("addButton"),
31414
+ disabled: field.max !== void 0 && localState.arrayState.items.length >= field.max,
31399
31415
  onClick: () => {
31400
31416
  const existingValue = value || [];
31401
31417
  const newValue = [
@@ -31405,7 +31421,7 @@ var ArrayField = ({
31405
31421
  const newArrayState = regenerateArrayState(newValue);
31406
31422
  onChange(newValue, mapArrayStateToUi(newArrayState));
31407
31423
  },
31408
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Plus, { size: "21" })
31424
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Plus, { size: 21 })
31409
31425
  }
31410
31426
  )
31411
31427
  ]
@@ -31456,6 +31472,7 @@ var DefaultField = ({
31456
31472
  }
31457
31473
  },
31458
31474
  readOnly,
31475
+ tabIndex: readOnly ? -1 : void 0,
31459
31476
  id,
31460
31477
  min: field.type === "number" ? field.min : void 0,
31461
31478
  max: field.type === "number" ? field.max : void 0
@@ -31475,7 +31492,7 @@ var import_react16 = require("react");
31475
31492
 
31476
31493
  // css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
31477
31494
  init_react_import();
31478
- var styles_module_default11 = { "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" };
31495
+ var styles_module_default11 = { "ExternalInput-actions": "_ExternalInput-actions_q3l5a_1", "ExternalInput-button": "_ExternalInput-button_q3l5a_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_q3l5a_25", "ExternalInput-detachButton": "_ExternalInput-detachButton_q3l5a_32", "ExternalInputModal": "_ExternalInputModal_q3l5a_74", "ExternalInputModal-grid": "_ExternalInputModal-grid_q3l5a_84", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_q3l5a_95", "ExternalInputModal-filters": "_ExternalInputModal-filters_q3l5a_100", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_q3l5a_119", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_q3l5a_128", "ExternalInputModal-table": "_ExternalInputModal-table_q3l5a_128", "ExternalInputModal-thead": "_ExternalInputModal-thead_q3l5a_144", "ExternalInputModal-th": "_ExternalInputModal-th_q3l5a_144", "ExternalInputModal-td": "_ExternalInputModal-td_q3l5a_159", "ExternalInputModal-tr": "_ExternalInputModal-tr_q3l5a_164", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_q3l5a_171", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_q3l5a_197", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_q3l5a_201", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_q3l5a_218", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_q3l5a_222", "ExternalInputModal-search": "_ExternalInputModal-search_q3l5a_222", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_q3l5a_259", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_q3l5a_284", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_q3l5a_294", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_q3l5a_308", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_q3l5a_321", "ExternalInputModal-footer": "_ExternalInputModal-footer_q3l5a_325" };
31479
31496
 
31480
31497
  // components/Modal/index.tsx
31481
31498
  init_react_import();
@@ -31483,7 +31500,7 @@ var import_react15 = require("react");
31483
31500
 
31484
31501
  // css-module:/home/runner/work/puck/puck/packages/core/components/Modal/styles.module.css#css-module
31485
31502
  init_react_import();
31486
- var styles_module_default12 = { "Modal": "_Modal_hx2u6_1", "Modal--isOpen": "_Modal--isOpen_hx2u6_15", "Modal-inner": "_Modal-inner_hx2u6_19" };
31503
+ var styles_module_default12 = { "Modal": "_Modal_zud0i_1", "Modal--isOpen": "_Modal--isOpen_zud0i_15", "Modal-inner": "_Modal-inner_zud0i_19" };
31487
31504
 
31488
31505
  // components/Modal/index.tsx
31489
31506
  var import_react_dom = __toESM(require_react_dom());
@@ -31527,13 +31544,23 @@ var ExternalInput = ({
31527
31544
  name,
31528
31545
  id
31529
31546
  }) => {
31530
- const { mapProp = (val) => val } = field || {};
31547
+ const {
31548
+ mapProp = (val) => val,
31549
+ mapRow = (val) => val,
31550
+ filterFields
31551
+ } = field || {};
31531
31552
  const [data, setData] = (0, import_react16.useState)([]);
31532
31553
  const [isOpen, setOpen] = (0, import_react16.useState)(false);
31533
31554
  const [isLoading, setIsLoading] = (0, import_react16.useState)(true);
31555
+ const hasFilterFields = !!filterFields;
31556
+ const [filters, setFilters] = (0, import_react16.useState)(field.initialFilters || {});
31557
+ const [filtersToggled, setFiltersToggled] = (0, import_react16.useState)(hasFilterFields);
31558
+ const mappedData = (0, import_react16.useMemo)(() => {
31559
+ return data.map(mapRow);
31560
+ }, [data]);
31534
31561
  const keys = (0, import_react16.useMemo)(() => {
31535
31562
  const validKeys = /* @__PURE__ */ new Set();
31536
- for (const item of data) {
31563
+ for (const item of mappedData) {
31537
31564
  for (const key of Object.keys(item)) {
31538
31565
  if (typeof item[key] === "string" || typeof item[key] === "number") {
31539
31566
  validKeys.add(key);
@@ -31541,13 +31568,13 @@ var ExternalInput = ({
31541
31568
  }
31542
31569
  }
31543
31570
  return Array.from(validKeys);
31544
- }, [data]);
31571
+ }, [mappedData]);
31545
31572
  const [searchQuery, setSearchQuery] = (0, import_react16.useState)(field.initialQuery || "");
31546
31573
  const search = (0, import_react16.useCallback)(
31547
- (query) => __async(void 0, null, function* () {
31574
+ (query, filters2) => __async(void 0, null, function* () {
31548
31575
  setIsLoading(true);
31549
- const cacheKey = `${id}-${name}-${query}`;
31550
- const listData = dataCache[cacheKey] || (yield field.fetchList({ query }));
31576
+ const cacheKey = `${id}-${name}-${query}-${JSON.stringify(filters2)}`;
31577
+ const listData = dataCache[cacheKey] || (yield field.fetchList({ query, filters: filters2 }));
31551
31578
  if (listData) {
31552
31579
  setData(listData);
31553
31580
  setIsLoading(false);
@@ -31557,7 +31584,7 @@ var ExternalInput = ({
31557
31584
  [name, field]
31558
31585
  );
31559
31586
  (0, import_react16.useEffect)(() => {
31560
- search(searchQuery);
31587
+ search(searchQuery, filters);
31561
31588
  }, []);
31562
31589
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
31563
31590
  "div",
@@ -31592,78 +31619,109 @@ var ExternalInput = ({
31592
31619
  )
31593
31620
  ] }),
31594
31621
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Modal, { onClose: () => setOpen(false), isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
31595
- "div",
31622
+ "form",
31596
31623
  {
31597
31624
  className: getClassNameModal({
31598
31625
  isLoading,
31599
31626
  loaded: !isLoading,
31600
- hasData: data.length > 0
31627
+ hasData: mappedData.length > 0,
31628
+ filtersToggled
31601
31629
  }),
31630
+ onSubmit: (e) => {
31631
+ e.preventDefault();
31632
+ search(searchQuery, filters);
31633
+ },
31602
31634
  children: [
31603
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("masthead"), children: [
31604
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Heading, { rank: 2, size: "xxl", children: "Select content" }),
31605
- field.showSearch && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
31606
- "form",
31607
- {
31608
- className: getClassNameModal("searchForm"),
31609
- onSubmit: (e) => {
31610
- e.preventDefault();
31611
- search(searchQuery);
31612
- },
31613
- children: [
31614
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: getClassNameModal("search"), children: [
31615
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
31616
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Search, { size: "18" }) }),
31617
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
31618
- "input",
31619
- {
31620
- className: getClassNameModal("searchInput"),
31621
- name: "q",
31622
- type: "search",
31623
- placeholder: "Search",
31624
- onChange: (e) => {
31625
- setSearchQuery(e.currentTarget.value);
31626
- },
31627
- autoComplete: "off",
31628
- value: searchQuery
31629
- }
31630
- )
31631
- ] }),
31632
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { type: "submit", loading: isLoading, disabled: isLoading, children: "Search" })
31633
- ]
31634
- }
31635
- )
31636
- ] }),
31637
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
31638
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { className: getClassNameModal("table"), children: [
31639
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
31640
- "th",
31635
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
31636
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: getClassNameModal("search"), children: [
31637
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
31638
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Search, { size: "18" }) }),
31639
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
31640
+ "input",
31641
+ {
31642
+ className: getClassNameModal("searchInput"),
31643
+ name: "q",
31644
+ type: "search",
31645
+ placeholder: field.placeholder,
31646
+ onChange: (e) => {
31647
+ setSearchQuery(e.currentTarget.value);
31648
+ },
31649
+ autoComplete: "off",
31650
+ value: searchQuery
31651
+ }
31652
+ )
31653
+ ] }),
31654
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
31655
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
31656
+ hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
31657
+ IconButton,
31658
+ {
31659
+ title: "Toggle filters",
31660
+ onClick: (e) => {
31661
+ e.preventDefault();
31662
+ e.stopPropagation();
31663
+ setFiltersToggled(!filtersToggled);
31664
+ },
31665
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SlidersHorizontal, { size: 20 })
31666
+ }
31667
+ ) })
31668
+ ] })
31669
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Heading, { rank: 2, size: "xs", children: field.placeholder || "Select data" }) }),
31670
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("grid"), children: [
31671
+ hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
31672
+ const filterField = filterFields[fieldName];
31673
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
31674
+ InputOrGroup,
31641
31675
  {
31642
- className: getClassNameModal("th"),
31643
- style: { textAlign: "left" },
31644
- children: key
31676
+ field: filterField,
31677
+ name: fieldName,
31678
+ id: `external_field_${fieldName}_filter`,
31679
+ label: filterField.label || fieldName,
31680
+ value: filters[fieldName],
31681
+ onChange: (value2) => {
31682
+ const newFilters = __spreadProps(__spreadValues({}, filters), { [fieldName]: value2 });
31683
+ setFilters(newFilters);
31684
+ search(searchQuery, newFilters);
31685
+ }
31645
31686
  },
31646
- key
31647
- )) }) }),
31648
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tbody", { className: getClassNameModal("tbody"), children: data.map((item, i) => {
31649
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
31650
- "tr",
31687
+ fieldName
31688
+ );
31689
+ }) }),
31690
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
31691
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { className: getClassNameModal("table"), children: [
31692
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
31693
+ "th",
31651
31694
  {
31652
- style: { whiteSpace: "nowrap" },
31653
- className: getClassNameModal("tr"),
31654
- onClick: (e) => {
31655
- onChange(mapProp(item));
31656
- setOpen(false);
31657
- },
31658
- children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
31695
+ className: getClassNameModal("th"),
31696
+ style: { textAlign: "left" },
31697
+ children: key
31659
31698
  },
31660
- i
31661
- );
31662
- }) })
31663
- ] }),
31664
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_spinners5.ClipLoader, { size: 24, "aria-label": "Loading" }) })
31699
+ key
31700
+ )) }) }),
31701
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tbody", { className: getClassNameModal("tbody"), children: mappedData.map((item, i) => {
31702
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
31703
+ "tr",
31704
+ {
31705
+ style: { whiteSpace: "nowrap" },
31706
+ className: getClassNameModal("tr"),
31707
+ onClick: () => {
31708
+ onChange(mapProp(data[i]));
31709
+ setOpen(false);
31710
+ },
31711
+ children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
31712
+ },
31713
+ i
31714
+ );
31715
+ }) })
31716
+ ] }),
31717
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_spinners5.ClipLoader, { size: 24, "aria-label": "Loading" }) })
31718
+ ] })
31665
31719
  ] }),
31666
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("noContentBanner"), children: "No results." })
31720
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("footer"), children: [
31721
+ mappedData.length,
31722
+ " result",
31723
+ mappedData.length === 1 ? "" : "s"
31724
+ ] })
31667
31725
  ]
31668
31726
  }
31669
31727
  ) })
@@ -31709,6 +31767,7 @@ var ExternalField = ({
31709
31767
  // DEPRECATED
31710
31768
  placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
31711
31769
  mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
31770
+ mapRow: validField.mapRow,
31712
31771
  fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(void 0, null, function* () {
31713
31772
  return yield deprecatedField.adaptor.fetchList(
31714
31773
  deprecatedField.adaptorParams
@@ -31857,6 +31916,7 @@ var TextareaField = ({
31857
31916
  value: typeof value === "undefined" ? "" : value,
31858
31917
  onChange: (e) => onChange(e.currentTarget.value),
31859
31918
  readOnly,
31919
+ tabIndex: readOnly ? -1 : void 0,
31860
31920
  rows: 5
31861
31921
  }
31862
31922
  )
@@ -31872,7 +31932,7 @@ init_react_import();
31872
31932
 
31873
31933
  // css-module:/home/runner/work/puck/puck/packages/core/components/InputOrGroup/fields/ObjectField/styles.module.css#css-module
31874
31934
  init_react_import();
31875
- var styles_module_default13 = { "ObjectField": "_ObjectField_56z4t_5", "ObjectField-fieldset": "_ObjectField-fieldset_56z4t_13" };
31935
+ var styles_module_default13 = { "ObjectField": "_ObjectField_15j63_5", "ObjectField-fieldset": "_ObjectField-fieldset_15j63_13" };
31876
31936
 
31877
31937
  // components/InputOrGroup/fields/ObjectField/index.tsx
31878
31938
  var import_jsx_runtime20 = require("react/jsx-runtime");
@@ -32036,7 +32096,7 @@ var InputOrGroup = (_a) => {
32036
32096
 
32037
32097
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Fields/styles.module.css#css-module
32038
32098
  init_react_import();
32039
- var styles_module_default14 = { "PuckFields": "_PuckFields_1276r_1", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_1276r_5" };
32099
+ var styles_module_default14 = { "PuckFields": "_PuckFields_17k3p_1", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_17k3p_6" };
32040
32100
 
32041
32101
  // components/Puck/components/Fields/index.tsx
32042
32102
  var import_react19 = require("react");
@@ -32193,7 +32253,7 @@ init_react_import();
32193
32253
 
32194
32254
  // css-module:/home/runner/work/puck/puck/packages/core/components/ComponentList/styles.module.css#css-module
32195
32255
  init_react_import();
32196
- var styles_module_default15 = { "ComponentList": "_ComponentList_1di93_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_1di93_6", "ComponentList-content": "_ComponentList-content_1di93_10", "ComponentList-title": "_ComponentList-title_1di93_18", "ComponentList-titleIcon": "_ComponentList-titleIcon_1di93_39" };
32256
+ var styles_module_default15 = { "ComponentList": "_ComponentList_odh9d_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_odh9d_5", "ComponentList-content": "_ComponentList-content_odh9d_9", "ComponentList-title": "_ComponentList-title_odh9d_17", "ComponentList-titleIcon": "_ComponentList-titleIcon_odh9d_53" };
32197
32257
 
32198
32258
  // components/ComponentList/index.tsx
32199
32259
  var import_jsx_runtime23 = require("react/jsx-runtime");
@@ -32214,7 +32274,7 @@ var ComponentList = ({
32214
32274
  const { expanded = true } = state.ui.componentList[id] || {};
32215
32275
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: getClassName20({ isExpanded: expanded }), children: [
32216
32276
  title && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
32217
- "div",
32277
+ "button",
32218
32278
  {
32219
32279
  className: getClassName20("title"),
32220
32280
  onClick: () => setUi({
@@ -32378,7 +32438,7 @@ init_react_import();
32378
32438
 
32379
32439
  // css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css#css-module
32380
32440
  init_react_import();
32381
- var styles_module_default16 = { "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" };
32441
+ var styles_module_default16 = { "LayerTree": "_LayerTree_1pgw8_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_1pgw8_11", "LayerTree-helper": "_LayerTree-helper_1pgw8_17", "Layer": "_Layer_1pgw8_1", "Layer-inner": "_Layer-inner_1pgw8_29", "Layer--containsZone": "_Layer--containsZone_1pgw8_35", "Layer-clickable": "_Layer-clickable_1pgw8_39", "Layer--isSelected": "_Layer--isSelected_1pgw8_61", "Layer-chevron": "_Layer-chevron_1pgw8_77", "Layer--childIsSelected": "_Layer--childIsSelected_1pgw8_78", "Layer-zones": "_Layer-zones_1pgw8_82", "Layer-title": "_Layer-title_1pgw8_96", "Layer-name": "_Layer-name_1pgw8_105", "Layer-icon": "_Layer-icon_1pgw8_111", "Layer-zoneIcon": "_Layer-zoneIcon_1pgw8_116" };
32382
32442
 
32383
32443
  // lib/scroll-into-view.ts
32384
32444
  init_react_import();
@@ -32452,7 +32512,7 @@ var LayerTree = ({
32452
32512
  }),
32453
32513
  children: [
32454
32514
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
32455
- "div",
32515
+ "button",
32456
32516
  {
32457
32517
  className: getClassNameLayer("clickable"),
32458
32518
  onClick: () => {
@@ -32570,7 +32630,7 @@ var loadOverrides = ({
32570
32630
  overrides,
32571
32631
  plugins
32572
32632
  }) => {
32573
- const collected = overrides;
32633
+ const collected = __spreadValues({}, overrides);
32574
32634
  plugins.forEach((plugin) => {
32575
32635
  Object.keys(plugin.overrides).forEach((overridesType) => {
32576
32636
  if (overridesType === "fieldTypes") {
@@ -33023,7 +33083,7 @@ function Puck({
33023
33083
  "div",
33024
33084
  {
33025
33085
  style: {
33026
- background: "var(--puck-color-grey-10)",
33086
+ background: "var(--puck-color-grey-11)",
33027
33087
  height: "100%",
33028
33088
  flexGrow: 1
33029
33089
  }
@@ -33170,8 +33230,8 @@ var resolveAllData = (data, config, onResolveStart, onResolveEnd) => __async(voi
33170
33230
  // lib/use-puck.ts
33171
33231
  init_react_import();
33172
33232
  var usePuck = () => {
33173
- const { state: appState, config, dispatch } = useAppContext();
33174
- return { appState, config, dispatch };
33233
+ const { state: appState, config, history, dispatch } = useAppContext();
33234
+ return { appState, config, dispatch, history };
33175
33235
  };
33176
33236
  // Annotate the CommonJS export names for ESM import in node:
33177
33237
  0 && (module.exports = {
@@ -33415,6 +33475,14 @@ lucide-react/dist/esm/icons/search.js:
33415
33475
  * See the LICENSE file in the root directory of this source tree.
33416
33476
  *)
33417
33477
 
33478
+ lucide-react/dist/esm/icons/sliders-horizontal.js:
33479
+ (**
33480
+ * @license lucide-react v0.298.0 - ISC
33481
+ *
33482
+ * This source code is licensed under the ISC license.
33483
+ * See the LICENSE file in the root directory of this source tree.
33484
+ *)
33485
+
33418
33486
  lucide-react/dist/esm/icons/trash.js:
33419
33487
  (**
33420
33488
  * @license lucide-react v0.298.0 - ISC