@measured/puck 0.19.2-canary.37d387bd → 0.19.2-canary.5f6f6d8e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3971,6 +3971,7 @@ var ExternalInput = ({
3971
3971
  hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3972
3972
  IconButton,
3973
3973
  {
3974
+ type: "button",
3974
3975
  title: "Toggle filters",
3975
3976
  onClick: (e) => {
3976
3977
  e.preventDefault();
@@ -7644,7 +7645,6 @@ var Layer = ({
7644
7645
  zoneCompound
7645
7646
  }) => {
7646
7647
  var _a;
7647
- const ctx = (0, import_react47.useContext)(dropZoneContext);
7648
7648
  const config = useAppStore((s) => s.config);
7649
7649
  const itemSelector = useAppStore((s) => s.state.ui.itemSelector);
7650
7650
  const dispatch = useAppStore((s) => s.dispatch);
@@ -7755,7 +7755,15 @@ var LayerTree = ({
7755
7755
  label: _label,
7756
7756
  zoneCompound
7757
7757
  }) => {
7758
- const label = _label != null ? _label : zoneCompound.split(":")[1];
7758
+ const label = useAppStore((s) => {
7759
+ var _a, _b, _c, _d;
7760
+ if (_label) return _label;
7761
+ if (zoneCompound === rootDroppableId) return;
7762
+ const [componentId, slotId] = zoneCompound.split(":");
7763
+ const componentType = (_a = s.state.indexes.nodes[componentId]) == null ? void 0 : _a.data.type;
7764
+ const configForComponent = componentType && componentType !== rootAreaId ? s.config.components[componentType] : s.config.root;
7765
+ return (_d = (_c = (_b = configForComponent == null ? void 0 : configForComponent.fields) == null ? void 0 : _b[slotId]) == null ? void 0 : _c.label) != null ? _d : slotId;
7766
+ });
7759
7767
  const contentIds = useAppStore(
7760
7768
  (0, import_shallow6.useShallow)(
7761
7769
  (s) => {
@@ -7973,6 +7981,7 @@ var ViewportButton = ({
7973
7981
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: getClassNameButton({ isActive }), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
7974
7982
  IconButton,
7975
7983
  {
7984
+ type: "button",
7976
7985
  title,
7977
7986
  disabled: isActive,
7978
7987
  onClick: (e) => {
@@ -8031,6 +8040,7 @@ var ViewportControls = ({
8031
8040
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
8032
8041
  IconButton,
8033
8042
  {
8043
+ type: "button",
8034
8044
  title: "Zoom viewport out",
8035
8045
  disabled: zoom <= ((_a = zoomOptions[0]) == null ? void 0 : _a.value),
8036
8046
  onClick: (e) => {
@@ -8048,6 +8058,7 @@ var ViewportControls = ({
8048
8058
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
8049
8059
  IconButton,
8050
8060
  {
8061
+ type: "button",
8051
8062
  title: "Zoom viewport in",
8052
8063
  disabled: zoom >= ((_b = zoomOptions[zoomOptions.length - 1]) == null ? void 0 : _b.value),
8053
8064
  onClick: (e) => {
@@ -8519,8 +8530,26 @@ function MenuBar({
8519
8530
  },
8520
8531
  children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: getClassName26("inner"), children: [
8521
8532
  /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: getClassName26("history"), children: [
8522
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Undo2, { size: 21 }) }),
8523
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Redo2, { size: 21 }) })
8533
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
8534
+ IconButton,
8535
+ {
8536
+ type: "button",
8537
+ title: "undo",
8538
+ disabled: !hasPast,
8539
+ onClick: back,
8540
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Undo2, { size: 21 })
8541
+ }
8542
+ ),
8543
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
8544
+ IconButton,
8545
+ {
8546
+ type: "button",
8547
+ title: "redo",
8548
+ disabled: !hasFuture,
8549
+ onClick: forward,
8550
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Redo2, { size: 21 })
8551
+ }
8552
+ )
8524
8553
  ] }),
8525
8554
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: renderHeaderActions && renderHeaderActions() })
8526
8555
  ] })
@@ -8628,6 +8657,7 @@ var HeaderInner = () => {
8628
8657
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: getClassName27("leftSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
8629
8658
  IconButton,
8630
8659
  {
8660
+ type: "button",
8631
8661
  onClick: () => {
8632
8662
  toggleSidebars("left");
8633
8663
  },
@@ -8638,6 +8668,7 @@ var HeaderInner = () => {
8638
8668
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: getClassName27("rightSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
8639
8669
  IconButton,
8640
8670
  {
8671
+ type: "button",
8641
8672
  onClick: () => {
8642
8673
  toggleSidebars("right");
8643
8674
  },
@@ -8657,6 +8688,7 @@ var HeaderInner = () => {
8657
8688
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: getClassName27("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
8658
8689
  IconButton,
8659
8690
  {
8691
+ type: "button",
8660
8692
  onClick: () => {
8661
8693
  return setMenuOpen(!menuOpen);
8662
8694
  },
package/dist/index.mjs CHANGED
@@ -3094,6 +3094,7 @@ var ExternalInput = ({
3094
3094
  hasFilterFields && /* @__PURE__ */ jsx12("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ jsx12(
3095
3095
  IconButton,
3096
3096
  {
3097
+ type: "button",
3097
3098
  title: "Toggle filters",
3098
3099
  onClick: (e) => {
3099
3100
  e.preventDefault();
@@ -6808,7 +6809,6 @@ var Layer = ({
6808
6809
  zoneCompound
6809
6810
  }) => {
6810
6811
  var _a;
6811
- const ctx = useContext10(dropZoneContext);
6812
6812
  const config = useAppStore((s) => s.config);
6813
6813
  const itemSelector = useAppStore((s) => s.state.ui.itemSelector);
6814
6814
  const dispatch = useAppStore((s) => s.dispatch);
@@ -6919,7 +6919,15 @@ var LayerTree = ({
6919
6919
  label: _label,
6920
6920
  zoneCompound
6921
6921
  }) => {
6922
- const label = _label != null ? _label : zoneCompound.split(":")[1];
6922
+ const label = useAppStore((s) => {
6923
+ var _a, _b, _c, _d;
6924
+ if (_label) return _label;
6925
+ if (zoneCompound === rootDroppableId) return;
6926
+ const [componentId, slotId] = zoneCompound.split(":");
6927
+ const componentType = (_a = s.state.indexes.nodes[componentId]) == null ? void 0 : _a.data.type;
6928
+ const configForComponent = componentType && componentType !== rootAreaId ? s.config.components[componentType] : s.config.root;
6929
+ return (_d = (_c = (_b = configForComponent == null ? void 0 : configForComponent.fields) == null ? void 0 : _b[slotId]) == null ? void 0 : _c.label) != null ? _d : slotId;
6930
+ });
6923
6931
  const contentIds = useAppStore(
6924
6932
  useShallow6(
6925
6933
  (s) => {
@@ -7143,6 +7151,7 @@ var ViewportButton = ({
7143
7151
  return /* @__PURE__ */ jsx35("span", { className: getClassNameButton({ isActive }), children: /* @__PURE__ */ jsx35(
7144
7152
  IconButton,
7145
7153
  {
7154
+ type: "button",
7146
7155
  title,
7147
7156
  disabled: isActive,
7148
7157
  onClick: (e) => {
@@ -7201,6 +7210,7 @@ var ViewportControls = ({
7201
7210
  /* @__PURE__ */ jsx35(
7202
7211
  IconButton,
7203
7212
  {
7213
+ type: "button",
7204
7214
  title: "Zoom viewport out",
7205
7215
  disabled: zoom <= ((_a = zoomOptions[0]) == null ? void 0 : _a.value),
7206
7216
  onClick: (e) => {
@@ -7218,6 +7228,7 @@ var ViewportControls = ({
7218
7228
  /* @__PURE__ */ jsx35(
7219
7229
  IconButton,
7220
7230
  {
7231
+ type: "button",
7221
7232
  title: "Zoom viewport in",
7222
7233
  disabled: zoom >= ((_b = zoomOptions[zoomOptions.length - 1]) == null ? void 0 : _b.value),
7223
7234
  onClick: (e) => {
@@ -7689,8 +7700,26 @@ function MenuBar({
7689
7700
  },
7690
7701
  children: /* @__PURE__ */ jsxs18("div", { className: getClassName26("inner"), children: [
7691
7702
  /* @__PURE__ */ jsxs18("div", { className: getClassName26("history"), children: [
7692
- /* @__PURE__ */ jsx38(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ jsx38(Undo2, { size: 21 }) }),
7693
- /* @__PURE__ */ jsx38(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ jsx38(Redo2, { size: 21 }) })
7703
+ /* @__PURE__ */ jsx38(
7704
+ IconButton,
7705
+ {
7706
+ type: "button",
7707
+ title: "undo",
7708
+ disabled: !hasPast,
7709
+ onClick: back,
7710
+ children: /* @__PURE__ */ jsx38(Undo2, { size: 21 })
7711
+ }
7712
+ ),
7713
+ /* @__PURE__ */ jsx38(
7714
+ IconButton,
7715
+ {
7716
+ type: "button",
7717
+ title: "redo",
7718
+ disabled: !hasFuture,
7719
+ onClick: forward,
7720
+ children: /* @__PURE__ */ jsx38(Redo2, { size: 21 })
7721
+ }
7722
+ )
7694
7723
  ] }),
7695
7724
  /* @__PURE__ */ jsx38(Fragment13, { children: renderHeaderActions && renderHeaderActions() })
7696
7725
  ] })
@@ -7798,6 +7827,7 @@ var HeaderInner = () => {
7798
7827
  /* @__PURE__ */ jsx39("div", { className: getClassName27("leftSideBarToggle"), children: /* @__PURE__ */ jsx39(
7799
7828
  IconButton,
7800
7829
  {
7830
+ type: "button",
7801
7831
  onClick: () => {
7802
7832
  toggleSidebars("left");
7803
7833
  },
@@ -7808,6 +7838,7 @@ var HeaderInner = () => {
7808
7838
  /* @__PURE__ */ jsx39("div", { className: getClassName27("rightSideBarToggle"), children: /* @__PURE__ */ jsx39(
7809
7839
  IconButton,
7810
7840
  {
7841
+ type: "button",
7811
7842
  onClick: () => {
7812
7843
  toggleSidebars("right");
7813
7844
  },
@@ -7827,6 +7858,7 @@ var HeaderInner = () => {
7827
7858
  /* @__PURE__ */ jsx39("div", { className: getClassName27("menuButton"), children: /* @__PURE__ */ jsx39(
7828
7859
  IconButton,
7829
7860
  {
7861
+ type: "button",
7830
7862
  onClick: () => {
7831
7863
  return setMenuOpen(!menuOpen);
7832
7864
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.19.2-canary.37d387bd",
3
+ "version": "0.19.2-canary.5f6f6d8e",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",