@measured/puck 0.16.0-canary.937bb92 → 0.16.0-canary.94f16b2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.css CHANGED
@@ -1732,7 +1732,7 @@ textarea._Input-input_3pq3z_47 {
1732
1732
  }
1733
1733
 
1734
1734
  /* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css/#css-module-data */
1735
- ._PuckCanvas_6zd4y_1 {
1735
+ ._PuckCanvas_esbg1_1 {
1736
1736
  background: var(--puck-color-grey-11);
1737
1737
  display: flex;
1738
1738
  grid-area: editor;
@@ -1741,15 +1741,15 @@ textarea._Input-input_3pq3z_47 {
1741
1741
  overflow: auto;
1742
1742
  }
1743
1743
  @media (min-width: 1198px) {
1744
- ._PuckCanvas_6zd4y_1 {
1744
+ ._PuckCanvas_esbg1_1 {
1745
1745
  padding: calc(var(--puck-space-px) * 1.5);
1746
1746
  padding-top: var(--puck-space-px);
1747
1747
  }
1748
- ._PuckCanvas_6zd4y_1:not(._PuckCanvas_6zd4y_1:has(._PuckCanvas-controls_6zd4y_16)) {
1748
+ ._PuckCanvas_esbg1_1:not(._PuckCanvas_esbg1_1:has(._PuckCanvas-controls_esbg1_16)) {
1749
1749
  padding-top: calc(var(--puck-space-px) * 1.5);
1750
1750
  }
1751
1751
  }
1752
- ._PuckCanvas-inner_6zd4y_21 {
1752
+ ._PuckCanvas-inner_esbg1_21 {
1753
1753
  box-sizing: border-box;
1754
1754
  display: flex;
1755
1755
  height: 100%;
@@ -1759,7 +1759,7 @@ textarea._Input-input_3pq3z_47 {
1759
1759
  position: relative;
1760
1760
  width: 100%;
1761
1761
  }
1762
- ._PuckCanvas-root_6zd4y_32 {
1762
+ ._PuckCanvas-root_esbg1_32 {
1763
1763
  background: white;
1764
1764
  border: 1px solid var(--puck-color-grey-09);
1765
1765
  box-sizing: border-box;
@@ -1771,16 +1771,32 @@ textarea._Input-input_3pq3z_47 {
1771
1771
  opacity: 0;
1772
1772
  }
1773
1773
  @media (min-width: 1198px) {
1774
- ._PuckCanvas-root_6zd4y_32 {
1774
+ ._PuckCanvas-root_esbg1_32 {
1775
1775
  min-width: unset;
1776
1776
  }
1777
1777
  }
1778
1778
  @media (prefers-reduced-motion: reduce) {
1779
- ._PuckCanvas-root_6zd4y_32 {
1779
+ ._PuckCanvas-root_esbg1_32 {
1780
1780
  transition: none !important;
1781
1781
  }
1782
1782
  }
1783
- ._PuckCanvas--ready_6zd4y_56 ._PuckCanvas-root_6zd4y_32 {
1783
+ ._PuckCanvas--ready_esbg1_56 ._PuckCanvas-root_esbg1_32 {
1784
1784
  opacity: 1;
1785
- transition: opacity 150ms ease-out;
1785
+ }
1786
+ ._PuckCanvas-loader_esbg1_60 {
1787
+ align-items: center;
1788
+ color: var(--puck-color-grey-06);
1789
+ display: flex;
1790
+ height: 100%;
1791
+ justify-content: center;
1792
+ transition: opacity 250ms ease-out;
1793
+ opacity: 0;
1794
+ }
1795
+ ._PuckCanvas--showLoader_esbg1_70 ._PuckCanvas-loader_esbg1_60 {
1796
+ opacity: 1;
1797
+ }
1798
+ ._PuckCanvas--showLoader_esbg1_70._PuckCanvas--ready_esbg1_56 ._PuckCanvas-loader_esbg1_60 {
1799
+ opacity: 0;
1800
+ height: 0;
1801
+ transition: none;
1786
1802
  }
package/dist/index.js CHANGED
@@ -258,7 +258,16 @@ var Action = ({
258
258
  children,
259
259
  label,
260
260
  onClick
261
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: getClassName("action"), onClick, title: label, children });
261
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
262
+ "button",
263
+ {
264
+ type: "button",
265
+ className: getClassName("action"),
266
+ onClick,
267
+ title: label,
268
+ children
269
+ }
270
+ );
262
271
  ActionBar.Action = Action;
263
272
 
264
273
  // components/AutoField/index.tsx
@@ -1456,6 +1465,7 @@ var ExternalInput = ({
1456
1465
  value && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1457
1466
  "button",
1458
1467
  {
1468
+ type: "button",
1459
1469
  className: getClassName10("detachButton"),
1460
1470
  onClick: () => {
1461
1471
  onChange(null);
@@ -2927,6 +2937,7 @@ var SidebarSection = ({
2927
2937
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2928
2938
  "button",
2929
2939
  {
2940
+ type: "button",
2930
2941
  className: getClassName19("breadcrumbLabel"),
2931
2942
  onClick: () => setUi({ itemSelector: breadcrumb.selector }),
2932
2943
  children: breadcrumb.label
@@ -3816,6 +3827,7 @@ var ComponentList = ({
3816
3827
  title && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3817
3828
  "button",
3818
3829
  {
3830
+ type: "button",
3819
3831
  className: getClassName22("title"),
3820
3832
  onClick: () => setUi({
3821
3833
  componentList: __spreadProps(__spreadValues({}, state.ui.componentList), {
@@ -4360,6 +4372,7 @@ var LayerTree = ({
4360
4372
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
4361
4373
  "button",
4362
4374
  {
4375
+ type: "button",
4363
4376
  className: getClassNameLayer("clickable"),
4364
4377
  onClick: () => {
4365
4378
  if (isSelected) {
@@ -4849,7 +4862,7 @@ var ViewportControls = ({
4849
4862
 
4850
4863
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
4851
4864
  init_react_import();
4852
- var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_6zd4y_1", "PuckCanvas-controls": "_PuckCanvas-controls_6zd4y_16", "PuckCanvas-inner": "_PuckCanvas-inner_6zd4y_21", "PuckCanvas-root": "_PuckCanvas-root_6zd4y_32", "PuckCanvas--ready": "_PuckCanvas--ready_6zd4y_56" };
4865
+ var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_esbg1_1", "PuckCanvas-controls": "_PuckCanvas-controls_esbg1_16", "PuckCanvas-inner": "_PuckCanvas-inner_esbg1_21", "PuckCanvas-root": "_PuckCanvas-root_esbg1_32", "PuckCanvas--ready": "_PuckCanvas--ready_esbg1_56", "PuckCanvas-loader": "_PuckCanvas-loader_esbg1_60", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_esbg1_70" };
4853
4866
 
4854
4867
  // lib/get-zoom-config.ts
4855
4868
  init_react_import();
@@ -4941,11 +4954,18 @@ var Canvas = () => {
4941
4954
  observer.disconnect();
4942
4955
  };
4943
4956
  }, []);
4957
+ const [showLoader, setShowLoader] = (0, import_react29.useState)(false);
4958
+ (0, import_react29.useEffect)(() => {
4959
+ setTimeout(() => {
4960
+ setShowLoader(true);
4961
+ }, 500);
4962
+ }, []);
4944
4963
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
4945
4964
  "div",
4946
4965
  {
4947
4966
  className: getClassName26({
4948
- ready: status === "READY" || !iframe.enabled
4967
+ ready: status === "READY" || !iframe.enabled,
4968
+ showLoader
4949
4969
  }),
4950
4970
  onClick: () => dispatch({
4951
4971
  type: "setUi",
@@ -4978,21 +4998,24 @@ var Canvas = () => {
4978
4998
  }
4979
4999
  }
4980
5000
  ) }),
4981
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getClassName26("inner"), ref: frameRef, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4982
- "div",
4983
- {
4984
- className: getClassName26("root"),
4985
- style: {
4986
- width: iframe.enabled ? ui.viewports.current.width : "100%",
4987
- height: zoomConfig.rootHeight,
4988
- transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
4989
- transition: showTransition ? "width 150ms ease-out, height 150ms ease-out, transform 150ms ease-out" : "",
4990
- overflow: iframe.enabled ? void 0 : "auto"
4991
- },
4992
- suppressHydrationWarning: true,
4993
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Preview, {}) })
4994
- }
4995
- ) })
5001
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getClassName26("inner"), ref: frameRef, children: [
5002
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5003
+ "div",
5004
+ {
5005
+ className: getClassName26("root"),
5006
+ style: {
5007
+ width: iframe.enabled ? ui.viewports.current.width : "100%",
5008
+ height: zoomConfig.rootHeight,
5009
+ transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
5010
+ transition: showTransition ? "width 150ms ease-out, height 150ms ease-out, transform 150ms ease-out" : "",
5011
+ overflow: iframe.enabled ? void 0 : "auto"
5012
+ },
5013
+ suppressHydrationWarning: true,
5014
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Preview, {}) })
5015
+ }
5016
+ ),
5017
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getClassName26("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Loader, { size: 24 }) })
5018
+ ] })
4996
5019
  ]
4997
5020
  }
4998
5021
  );
package/dist/index.mjs CHANGED
@@ -154,7 +154,16 @@ var Action = ({
154
154
  children,
155
155
  label,
156
156
  onClick
157
- }) => /* @__PURE__ */ jsx("button", { className: getClassName("action"), onClick, title: label, children });
157
+ }) => /* @__PURE__ */ jsx(
158
+ "button",
159
+ {
160
+ type: "button",
161
+ className: getClassName("action"),
162
+ onClick,
163
+ title: label,
164
+ children
165
+ }
166
+ );
158
167
  ActionBar.Action = Action;
159
168
 
160
169
  // components/AutoField/index.tsx
@@ -1349,6 +1358,7 @@ var ExternalInput = ({
1349
1358
  value && /* @__PURE__ */ jsx14(
1350
1359
  "button",
1351
1360
  {
1361
+ type: "button",
1352
1362
  className: getClassName10("detachButton"),
1353
1363
  onClick: () => {
1354
1364
  onChange(null);
@@ -2838,6 +2848,7 @@ var SidebarSection = ({
2838
2848
  /* @__PURE__ */ jsx26(
2839
2849
  "button",
2840
2850
  {
2851
+ type: "button",
2841
2852
  className: getClassName19("breadcrumbLabel"),
2842
2853
  onClick: () => setUi({ itemSelector: breadcrumb.selector }),
2843
2854
  children: breadcrumb.label
@@ -3727,6 +3738,7 @@ var ComponentList = ({
3727
3738
  title && /* @__PURE__ */ jsxs16(
3728
3739
  "button",
3729
3740
  {
3741
+ type: "button",
3730
3742
  className: getClassName22("title"),
3731
3743
  onClick: () => setUi({
3732
3744
  componentList: __spreadProps(__spreadValues({}, state.ui.componentList), {
@@ -4277,6 +4289,7 @@ var LayerTree = ({
4277
4289
  /* @__PURE__ */ jsx34("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ jsxs17(
4278
4290
  "button",
4279
4291
  {
4292
+ type: "button",
4280
4293
  className: getClassNameLayer("clickable"),
4281
4294
  onClick: () => {
4282
4295
  if (isSelected) {
@@ -4772,7 +4785,7 @@ var ViewportControls = ({
4772
4785
 
4773
4786
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
4774
4787
  init_react_import();
4775
- var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_6zd4y_1", "PuckCanvas-controls": "_PuckCanvas-controls_6zd4y_16", "PuckCanvas-inner": "_PuckCanvas-inner_6zd4y_21", "PuckCanvas-root": "_PuckCanvas-root_6zd4y_32", "PuckCanvas--ready": "_PuckCanvas--ready_6zd4y_56" };
4788
+ var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_esbg1_1", "PuckCanvas-controls": "_PuckCanvas-controls_esbg1_16", "PuckCanvas-inner": "_PuckCanvas-inner_esbg1_21", "PuckCanvas-root": "_PuckCanvas-root_esbg1_32", "PuckCanvas--ready": "_PuckCanvas--ready_esbg1_56", "PuckCanvas-loader": "_PuckCanvas-loader_esbg1_60", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_esbg1_70" };
4776
4789
 
4777
4790
  // lib/get-zoom-config.ts
4778
4791
  init_react_import();
@@ -4864,11 +4877,18 @@ var Canvas = () => {
4864
4877
  observer.disconnect();
4865
4878
  };
4866
4879
  }, []);
4880
+ const [showLoader, setShowLoader] = useState19(false);
4881
+ useEffect16(() => {
4882
+ setTimeout(() => {
4883
+ setShowLoader(true);
4884
+ }, 500);
4885
+ }, []);
4867
4886
  return /* @__PURE__ */ jsxs20(
4868
4887
  "div",
4869
4888
  {
4870
4889
  className: getClassName26({
4871
- ready: status === "READY" || !iframe.enabled
4890
+ ready: status === "READY" || !iframe.enabled,
4891
+ showLoader
4872
4892
  }),
4873
4893
  onClick: () => dispatch({
4874
4894
  type: "setUi",
@@ -4901,21 +4921,24 @@ var Canvas = () => {
4901
4921
  }
4902
4922
  }
4903
4923
  ) }),
4904
- /* @__PURE__ */ jsx37("div", { className: getClassName26("inner"), ref: frameRef, children: /* @__PURE__ */ jsx37(
4905
- "div",
4906
- {
4907
- className: getClassName26("root"),
4908
- style: {
4909
- width: iframe.enabled ? ui.viewports.current.width : "100%",
4910
- height: zoomConfig.rootHeight,
4911
- transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
4912
- transition: showTransition ? "width 150ms ease-out, height 150ms ease-out, transform 150ms ease-out" : "",
4913
- overflow: iframe.enabled ? void 0 : "auto"
4914
- },
4915
- suppressHydrationWarning: true,
4916
- children: /* @__PURE__ */ jsx37(CustomPreview, { children: /* @__PURE__ */ jsx37(Preview, {}) })
4917
- }
4918
- ) })
4924
+ /* @__PURE__ */ jsxs20("div", { className: getClassName26("inner"), ref: frameRef, children: [
4925
+ /* @__PURE__ */ jsx37(
4926
+ "div",
4927
+ {
4928
+ className: getClassName26("root"),
4929
+ style: {
4930
+ width: iframe.enabled ? ui.viewports.current.width : "100%",
4931
+ height: zoomConfig.rootHeight,
4932
+ transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
4933
+ transition: showTransition ? "width 150ms ease-out, height 150ms ease-out, transform 150ms ease-out" : "",
4934
+ overflow: iframe.enabled ? void 0 : "auto"
4935
+ },
4936
+ suppressHydrationWarning: true,
4937
+ children: /* @__PURE__ */ jsx37(CustomPreview, { children: /* @__PURE__ */ jsx37(Preview, {}) })
4938
+ }
4939
+ ),
4940
+ /* @__PURE__ */ jsx37("div", { className: getClassName26("loader"), children: /* @__PURE__ */ jsx37(Loader, { size: 24 }) })
4941
+ ] })
4919
4942
  ]
4920
4943
  }
4921
4944
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.16.0-canary.937bb92",
3
+ "version": "0.16.0-canary.94f16b2",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",