@measured/puck 0.16.0-canary.04fd6c5 → 0.16.0-canary.1beaf6b

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/dist/index.js +121 -105
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7536,7 +7536,7 @@ var require_react_dom_development = __commonJS({
7536
7536
  var HostPortal = 4;
7537
7537
  var HostComponent = 5;
7538
7538
  var HostText = 6;
7539
- var Fragment19 = 7;
7539
+ var Fragment20 = 7;
7540
7540
  var Mode = 8;
7541
7541
  var ContextConsumer = 9;
7542
7542
  var ContextProvider = 10;
@@ -8692,7 +8692,7 @@ var require_react_dom_development = __commonJS({
8692
8692
  return "DehydratedFragment";
8693
8693
  case ForwardRef:
8694
8694
  return getWrappedName$1(type, type.render, "ForwardRef");
8695
- case Fragment19:
8695
+ case Fragment20:
8696
8696
  return "Fragment";
8697
8697
  case HostComponent:
8698
8698
  return type;
@@ -18343,7 +18343,7 @@ var require_react_dom_development = __commonJS({
18343
18343
  }
18344
18344
  }
18345
18345
  function updateFragment2(returnFiber, current2, fragment, lanes, key) {
18346
- if (current2 === null || current2.tag !== Fragment19) {
18346
+ if (current2 === null || current2.tag !== Fragment20) {
18347
18347
  var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
18348
18348
  created.return = returnFiber;
18349
18349
  return created;
@@ -18746,7 +18746,7 @@ var require_react_dom_development = __commonJS({
18746
18746
  if (child.key === key) {
18747
18747
  var elementType = element.type;
18748
18748
  if (elementType === REACT_FRAGMENT_TYPE) {
18749
- if (child.tag === Fragment19) {
18749
+ if (child.tag === Fragment20) {
18750
18750
  deleteRemainingChildren(returnFiber, child.sibling);
18751
18751
  var existing = useFiber(child, element.props.children);
18752
18752
  existing.return = returnFiber;
@@ -22921,7 +22921,7 @@ var require_react_dom_development = __commonJS({
22921
22921
  var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
22922
22922
  return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
22923
22923
  }
22924
- case Fragment19:
22924
+ case Fragment20:
22925
22925
  return updateFragment(current2, workInProgress2, renderLanes2);
22926
22926
  case Mode:
22927
22927
  return updateMode(current2, workInProgress2, renderLanes2);
@@ -23193,7 +23193,7 @@ var require_react_dom_development = __commonJS({
23193
23193
  case SimpleMemoComponent:
23194
23194
  case FunctionComponent:
23195
23195
  case ForwardRef:
23196
- case Fragment19:
23196
+ case Fragment20:
23197
23197
  case Mode:
23198
23198
  case Profiler:
23199
23199
  case ContextConsumer:
@@ -27444,7 +27444,7 @@ var require_react_dom_development = __commonJS({
27444
27444
  return fiber;
27445
27445
  }
27446
27446
  function createFiberFromFragment(elements, mode, lanes, key) {
27447
- var fiber = createFiber(Fragment19, elements, key, mode);
27447
+ var fiber = createFiber(Fragment20, elements, key, mode);
27448
27448
  fiber.lanes = lanes;
27449
27449
  return fiber;
27450
27450
  }
@@ -31021,7 +31021,7 @@ function DropZone(props) {
31021
31021
 
31022
31022
  // components/Puck/index.tsx
31023
31023
  init_react_import();
31024
- var import_react30 = require("react");
31024
+ var import_react31 = require("react");
31025
31025
 
31026
31026
  // lib/use-placeholder-style.ts
31027
31027
  init_react_import();
@@ -32663,37 +32663,6 @@ var Outline = () => {
32663
32663
  ] }) }) });
32664
32664
  };
32665
32665
 
32666
- // lib/load-overrides.ts
32667
- init_react_import();
32668
- var loadOverrides = ({
32669
- overrides,
32670
- plugins
32671
- }) => {
32672
- const collected = __spreadValues({}, overrides);
32673
- plugins.forEach((plugin) => {
32674
- Object.keys(plugin.overrides).forEach((overridesType) => {
32675
- if (overridesType === "fieldTypes") {
32676
- const fieldTypes = plugin.overrides.fieldTypes;
32677
- Object.keys(fieldTypes).forEach((fieldType) => {
32678
- collected.fieldTypes = collected.fieldTypes || {};
32679
- const childNode2 = collected.fieldTypes[fieldType];
32680
- const Comp2 = (props) => fieldTypes[fieldType](__spreadProps(__spreadValues({}, props), {
32681
- children: childNode2 ? childNode2(props) : props.children
32682
- }));
32683
- collected.fieldTypes[fieldType] = Comp2;
32684
- });
32685
- return;
32686
- }
32687
- const childNode = collected[overridesType];
32688
- const Comp = (props) => plugin.overrides[overridesType](__spreadProps(__spreadValues({}, props), {
32689
- children: childNode ? childNode(props) : props.children
32690
- }));
32691
- collected[overridesType] = Comp;
32692
- });
32693
- });
32694
- return collected;
32695
- };
32696
-
32697
32666
  // lib/use-puck-history.ts
32698
32667
  init_react_import();
32699
32668
  var import_react_hotkeys_hook = require("react-hotkeys-hook");
@@ -33250,8 +33219,58 @@ var insertComponent = (componentType, zone, index, {
33250
33219
  });
33251
33220
  };
33252
33221
 
33253
- // components/Puck/index.tsx
33222
+ // lib/use-loaded-overrides.ts
33223
+ init_react_import();
33224
+ var import_react30 = require("react");
33225
+
33226
+ // lib/load-overrides.ts
33227
+ init_react_import();
33228
+ var loadOverrides = ({
33229
+ overrides,
33230
+ plugins
33231
+ }) => {
33232
+ const collected = __spreadValues({}, overrides);
33233
+ plugins.forEach((plugin) => {
33234
+ Object.keys(plugin.overrides).forEach((overridesType) => {
33235
+ if (overridesType === "fieldTypes") {
33236
+ const fieldTypes = plugin.overrides.fieldTypes;
33237
+ Object.keys(fieldTypes).forEach((fieldType) => {
33238
+ collected.fieldTypes = collected.fieldTypes || {};
33239
+ const childNode2 = collected.fieldTypes[fieldType];
33240
+ const Comp2 = (props) => fieldTypes[fieldType](__spreadProps(__spreadValues({}, props), {
33241
+ children: childNode2 ? childNode2(props) : props.children
33242
+ }));
33243
+ collected.fieldTypes[fieldType] = Comp2;
33244
+ });
33245
+ return;
33246
+ }
33247
+ const childNode = collected[overridesType];
33248
+ const Comp = (props) => plugin.overrides[overridesType](__spreadProps(__spreadValues({}, props), {
33249
+ children: childNode ? childNode(props) : props.children
33250
+ }));
33251
+ collected[overridesType] = Comp;
33252
+ });
33253
+ });
33254
+ return collected;
33255
+ };
33256
+
33257
+ // lib/use-loaded-overrides.ts
33258
+ var useLoadedOverrides = ({
33259
+ overrides,
33260
+ plugins
33261
+ }) => {
33262
+ return (0, import_react30.useMemo)(() => {
33263
+ return loadOverrides({ overrides, plugins });
33264
+ }, [plugins, overrides]);
33265
+ };
33266
+
33267
+ // components/DefaultOverride/index.tsx
33268
+ init_react_import();
33254
33269
  var import_jsx_runtime37 = require("react/jsx-runtime");
33270
+ var DefaultOverride = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children });
33271
+
33272
+ // components/Puck/index.tsx
33273
+ var import_jsx_runtime38 = require("react/jsx-runtime");
33255
33274
  var getClassName27 = get_class_name_factory_default("Puck", styles_module_default15);
33256
33275
  var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_module_default15);
33257
33276
  function Puck({
@@ -33277,10 +33296,10 @@ function Puck({
33277
33296
  }) {
33278
33297
  var _a;
33279
33298
  const historyStore = useHistoryStore(initialHistory);
33280
- const [reducer] = (0, import_react30.useState)(
33299
+ const [reducer] = (0, import_react31.useState)(
33281
33300
  () => createReducer({ config, record: historyStore.record, onAction })
33282
33301
  );
33283
- const [initialAppState] = (0, import_react30.useState)(() => {
33302
+ const [initialAppState] = (0, import_react31.useState)(() => {
33284
33303
  var _a2, _b, _c, _d, _e, _f, _g;
33285
33304
  const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
33286
33305
  let clientUiState = {};
@@ -33338,7 +33357,7 @@ function Puck({
33338
33357
  })
33339
33358
  });
33340
33359
  });
33341
- const [appState, dispatch] = (0, import_react30.useReducer)(
33360
+ const [appState, dispatch] = (0, import_react31.useReducer)(
33342
33361
  reducer,
33343
33362
  flushZones(initialAppState)
33344
33363
  );
@@ -33349,9 +33368,9 @@ function Puck({
33349
33368
  config,
33350
33369
  dispatch
33351
33370
  );
33352
- const [menuOpen, setMenuOpen] = (0, import_react30.useState)(false);
33371
+ const [menuOpen, setMenuOpen] = (0, import_react31.useState)(false);
33353
33372
  const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
33354
- const setItemSelector = (0, import_react30.useCallback)(
33373
+ const setItemSelector = (0, import_react31.useCallback)(
33355
33374
  (newItemSelector) => {
33356
33375
  if (newItemSelector === itemSelector) return;
33357
33376
  dispatch({
@@ -33363,13 +33382,13 @@ function Puck({
33363
33382
  [itemSelector]
33364
33383
  );
33365
33384
  const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
33366
- (0, import_react30.useEffect)(() => {
33385
+ (0, import_react31.useEffect)(() => {
33367
33386
  if (onChange) onChange(data);
33368
33387
  }, [data]);
33369
33388
  const { onDragStartOrUpdate, placeholderStyle } = usePlaceholderStyle();
33370
- const [draggedItem, setDraggedItem] = (0, import_react30.useState)();
33389
+ const [draggedItem, setDraggedItem] = (0, import_react31.useState)();
33371
33390
  const rootProps = data.root.props || data.root;
33372
- const toggleSidebars = (0, import_react30.useCallback)(
33391
+ const toggleSidebars = (0, import_react31.useCallback)(
33373
33392
  (sidebar) => {
33374
33393
  const widerViewport = window.matchMedia("(min-width: 638px)").matches;
33375
33394
  const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
@@ -33383,7 +33402,7 @@ function Puck({
33383
33402
  },
33384
33403
  [dispatch, leftSideBarVisible, rightSideBarVisible]
33385
33404
  );
33386
- (0, import_react30.useEffect)(() => {
33405
+ (0, import_react31.useEffect)(() => {
33387
33406
  if (!window.matchMedia("(min-width: 638px)").matches) {
33388
33407
  dispatch({
33389
33408
  type: "setUi",
@@ -33406,11 +33425,7 @@ function Puck({
33406
33425
  window.removeEventListener("resize", handleResize);
33407
33426
  };
33408
33427
  }, []);
33409
- const defaultRender = (0, import_react30.useMemo)(() => {
33410
- const PuckDefault = ({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: children2 });
33411
- return PuckDefault;
33412
- }, []);
33413
- const defaultHeaderRender = (0, import_react30.useMemo)(() => {
33428
+ const defaultHeaderRender = (0, import_react31.useMemo)(() => {
33414
33429
  if (renderHeader) {
33415
33430
  console.warn(
33416
33431
  "`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
@@ -33418,48 +33433,49 @@ function Puck({
33418
33433
  const RenderHeader = (_a2) => {
33419
33434
  var _b = _a2, { actions } = _b, props = __objRest(_b, ["actions"]);
33420
33435
  const Comp = renderHeader;
33421
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
33436
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
33422
33437
  };
33423
33438
  return RenderHeader;
33424
33439
  }
33425
- return defaultRender;
33440
+ return DefaultOverride;
33426
33441
  }, [renderHeader]);
33427
- const defaultHeaderActionsRender = (0, import_react30.useMemo)(() => {
33442
+ const defaultHeaderActionsRender = (0, import_react31.useMemo)(() => {
33428
33443
  if (renderHeaderActions) {
33429
33444
  console.warn(
33430
33445
  "`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
33431
33446
  );
33432
33447
  const RenderHeader = (props) => {
33433
33448
  const Comp = renderHeaderActions;
33434
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
33449
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
33435
33450
  };
33436
33451
  return RenderHeader;
33437
33452
  }
33438
- return defaultRender;
33453
+ return DefaultOverride;
33439
33454
  }, [renderHeader]);
33440
- const loadedOverrides = (0, import_react30.useMemo)(() => {
33441
- return loadOverrides({ overrides, plugins });
33442
- }, [plugins]);
33443
- const CustomPuck = (0, import_react30.useMemo)(
33444
- () => loadedOverrides.puck || defaultRender,
33455
+ const loadedOverrides = useLoadedOverrides({
33456
+ overrides,
33457
+ plugins
33458
+ });
33459
+ const CustomPuck = (0, import_react31.useMemo)(
33460
+ () => loadedOverrides.puck || DefaultOverride,
33445
33461
  [loadedOverrides]
33446
33462
  );
33447
- const CustomHeader = (0, import_react30.useMemo)(
33463
+ const CustomHeader = (0, import_react31.useMemo)(
33448
33464
  () => loadedOverrides.header || defaultHeaderRender,
33449
33465
  [loadedOverrides]
33450
33466
  );
33451
- const CustomHeaderActions = (0, import_react30.useMemo)(
33467
+ const CustomHeaderActions = (0, import_react31.useMemo)(
33452
33468
  () => loadedOverrides.headerActions || defaultHeaderActionsRender,
33453
33469
  [loadedOverrides]
33454
33470
  );
33455
- const [mounted, setMounted] = (0, import_react30.useState)(false);
33456
- (0, import_react30.useEffect)(() => {
33471
+ const [mounted, setMounted] = (0, import_react31.useState)(false);
33472
+ (0, import_react31.useEffect)(() => {
33457
33473
  setMounted(true);
33458
33474
  }, []);
33459
33475
  const selectedComponentConfig = selectedItem && config.components[selectedItem.type];
33460
33476
  const selectedComponentLabel = selectedItem ? (_a = selectedComponentConfig == null ? void 0 : selectedComponentConfig["label"]) != null ? _a : selectedItem.type.toString() : "";
33461
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: `Puck ${getClassName27()}`, children: [
33462
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33477
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: `Puck ${getClassName27()}`, children: [
33478
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33463
33479
  AppProvider,
33464
33480
  {
33465
33481
  value: {
@@ -33474,7 +33490,7 @@ function Puck({
33474
33490
  viewports,
33475
33491
  iframe
33476
33492
  },
33477
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33493
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33478
33494
  DragDropContext,
33479
33495
  {
33480
33496
  autoScrollerOptions: { disabled: dnd == null ? void 0 : dnd.disableAutoScroll },
@@ -33526,7 +33542,7 @@ function Puck({
33526
33542
  });
33527
33543
  }
33528
33544
  },
33529
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33545
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33530
33546
  DropZoneProvider,
33531
33547
  {
33532
33548
  value: {
@@ -33540,7 +33556,7 @@ function Puck({
33540
33556
  mode: "edit",
33541
33557
  areaId: "root"
33542
33558
  },
33543
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33559
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33544
33560
  "div",
33545
33561
  {
33546
33562
  className: getLayoutClassName({
@@ -33549,64 +33565,64 @@ function Puck({
33549
33565
  mounted,
33550
33566
  rightSideBarVisible
33551
33567
  }),
33552
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getLayoutClassName("inner"), children: [
33553
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33568
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("inner"), children: [
33569
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33554
33570
  CustomHeader,
33555
33571
  {
33556
- actions: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33572
+ actions: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33557
33573
  Button,
33558
33574
  {
33559
33575
  onClick: () => {
33560
33576
  onPublish && onPublish(data);
33561
33577
  },
33562
- icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Globe, { size: "14px" }),
33578
+ icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Globe, { size: "14px" }),
33563
33579
  children: "Publish"
33564
33580
  }
33565
33581
  ) }) }),
33566
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("header", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getLayoutClassName("headerInner"), children: [
33567
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getLayoutClassName("headerToggle"), children: [
33568
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33582
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("header", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerInner"), children: [
33583
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerToggle"), children: [
33584
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33569
33585
  "div",
33570
33586
  {
33571
33587
  className: getLayoutClassName(
33572
33588
  "leftSideBarToggle"
33573
33589
  ),
33574
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33590
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33575
33591
  IconButton,
33576
33592
  {
33577
33593
  onClick: () => {
33578
33594
  toggleSidebars("left");
33579
33595
  },
33580
33596
  title: "Toggle left sidebar",
33581
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PanelLeft, { focusable: "false" })
33597
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelLeft, { focusable: "false" })
33582
33598
  }
33583
33599
  )
33584
33600
  }
33585
33601
  ),
33586
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33602
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33587
33603
  "div",
33588
33604
  {
33589
33605
  className: getLayoutClassName(
33590
33606
  "rightSideBarToggle"
33591
33607
  ),
33592
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33608
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33593
33609
  IconButton,
33594
33610
  {
33595
33611
  onClick: () => {
33596
33612
  toggleSidebars("right");
33597
33613
  },
33598
33614
  title: "Toggle right sidebar",
33599
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PanelRight, { focusable: "false" })
33615
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelRight, { focusable: "false" })
33600
33616
  }
33601
33617
  )
33602
33618
  }
33603
33619
  )
33604
33620
  ] }),
33605
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getLayoutClassName("headerTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Heading, { rank: 2, size: "xs", children: [
33621
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("headerTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Heading, { rank: 2, size: "xs", children: [
33606
33622
  headerTitle || rootProps.title || "Page",
33607
- headerPath && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
33623
+ headerPath && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
33608
33624
  " ",
33609
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33625
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33610
33626
  "code",
33611
33627
  {
33612
33628
  className: getLayoutClassName("headerPath"),
@@ -33615,18 +33631,18 @@ function Puck({
33615
33631
  )
33616
33632
  ] })
33617
33633
  ] }) }),
33618
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getLayoutClassName("headerTools"), children: [
33619
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getLayoutClassName("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33634
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerTools"), children: [
33635
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33620
33636
  IconButton,
33621
33637
  {
33622
33638
  onClick: () => {
33623
33639
  return setMenuOpen(!menuOpen);
33624
33640
  },
33625
33641
  title: "Toggle menu bar",
33626
- children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChevronDown, { focusable: "false" })
33642
+ children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronDown, { focusable: "false" })
33627
33643
  }
33628
33644
  ) }),
33629
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33645
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33630
33646
  MenuBar,
33631
33647
  {
33632
33648
  appState,
@@ -33634,13 +33650,13 @@ function Puck({
33634
33650
  dispatch,
33635
33651
  onPublish,
33636
33652
  menuOpen,
33637
- renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33653
+ renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33638
33654
  Button,
33639
33655
  {
33640
33656
  onClick: () => {
33641
33657
  onPublish && onPublish(data);
33642
33658
  },
33643
- icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Globe, { size: "14px" }),
33659
+ icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Globe, { size: "14px" }),
33644
33660
  children: "Publish"
33645
33661
  }
33646
33662
  ) }),
@@ -33651,19 +33667,19 @@ function Puck({
33651
33667
  ] }) })
33652
33668
  }
33653
33669
  ),
33654
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getLayoutClassName("leftSideBar"), children: [
33655
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Components, {}) }),
33656
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Outline, {}) })
33670
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("leftSideBar"), children: [
33671
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Components, {}) }),
33672
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Outline, {}) })
33657
33673
  ] }),
33658
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Canvas, {}),
33659
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getLayoutClassName("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
33674
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Canvas, {}),
33675
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33660
33676
  SidebarSection,
33661
33677
  {
33662
33678
  noPadding: true,
33663
33679
  noBorderTop: true,
33664
33680
  showBreadcrumbs: true,
33665
33681
  title: selectedItem ? selectedComponentLabel : "Page",
33666
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Fields, {})
33682
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Fields, {})
33667
33683
  }
33668
33684
  ) })
33669
33685
  ] })
@@ -33675,7 +33691,7 @@ function Puck({
33675
33691
  )
33676
33692
  }
33677
33693
  ),
33678
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { id: "puck-portal-root", className: getClassName27("portal") })
33694
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { id: "puck-portal-root", className: getClassName27("portal") })
33679
33695
  ] });
33680
33696
  }
33681
33697
  Puck.Components = Components;
@@ -33685,7 +33701,7 @@ Puck.Preview = Preview;
33685
33701
 
33686
33702
  // components/Render/index.tsx
33687
33703
  init_react_import();
33688
- var import_jsx_runtime38 = require("react/jsx-runtime");
33704
+ var import_jsx_runtime39 = require("react/jsx-runtime");
33689
33705
  function Render({
33690
33706
  config,
33691
33707
  data
@@ -33698,7 +33714,7 @@ function Render({
33698
33714
  const rootProps = defaultedData.root.props || defaultedData.root;
33699
33715
  const title = (rootProps == null ? void 0 : rootProps.title) || "";
33700
33716
  if ((_a = config.root) == null ? void 0 : _a.render) {
33701
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
33717
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
33702
33718
  config.root.render,
33703
33719
  __spreadProps(__spreadValues({}, rootProps), {
33704
33720
  puck: {
@@ -33708,11 +33724,11 @@ function Render({
33708
33724
  title,
33709
33725
  editMode: false,
33710
33726
  id: "puck-root",
33711
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DropZone, { zone: rootDroppableId })
33727
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZone, { zone: rootDroppableId })
33712
33728
  })
33713
33729
  ) });
33714
33730
  }
33715
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DropZone, { zone: rootDroppableId }) });
33731
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZone, { zone: rootDroppableId }) });
33716
33732
  }
33717
33733
 
33718
33734
  // lib/migrate.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.16.0-canary.04fd6c5",
3
+ "version": "0.16.0-canary.1beaf6b",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",