@puckeditor/core 0.21.1 → 0.21.2-canary.4cf30273

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.
@@ -868,9 +868,10 @@ var ArrayFieldItemInternal = ({
868
868
  {
869
869
  ref: handleRef,
870
870
  onClick: (e) => {
871
- if (isDragging || !hasVisibleFields) return;
871
+ if (isDragging) return;
872
872
  e.preventDefault();
873
873
  e.stopPropagation();
874
+ if (!hasVisibleFields) return;
874
875
  onToggleExpand(id, isExpanded);
875
876
  },
876
877
  className: getClassNameItem("summary"),
@@ -6978,11 +6979,13 @@ var getClassName27 = get_class_name_factory_default("PuckCanvas", styles_module_
6978
6979
  var ZOOM_ON_CHANGE = true;
6979
6980
  var TRANSITION_DURATION = 150;
6980
6981
  var Canvas = () => {
6982
+ var _a;
6981
6983
  const { frameRef } = useCanvasFrame();
6982
6984
  const resetAutoZoom = useResetAutoZoom(frameRef);
6983
6985
  const {
6984
6986
  _experimentalFullScreenCanvas,
6985
- viewports: viewportOptions = defaultViewports
6987
+ viewports: viewportOptions = defaultViewports,
6988
+ ui: uiProp
6986
6989
  } = usePropsContext();
6987
6990
  const {
6988
6991
  dispatch,
@@ -7079,10 +7082,11 @@ var Canvas = () => {
7079
7082
  }, []);
7080
7083
  const appStoreApi = useAppStoreApi();
7081
7084
  useEffect25(() => {
7082
- var _a;
7085
+ var _a2, _b;
7083
7086
  if (typeof window === "undefined") return;
7087
+ if ((_a2 = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a2.current) return;
7084
7088
  const viewportWidth = window.innerWidth;
7085
- const frameWidth = (_a = frameRef.current) == null ? void 0 : _a.getBoundingClientRect().width;
7089
+ const frameWidth = (_b = frameRef.current) == null ? void 0 : _b.getBoundingClientRect().width;
7086
7090
  if (!viewportWidth) return;
7087
7091
  if (!frameWidth) return;
7088
7092
  if (viewportOptions.length === 0) return;
@@ -7121,7 +7125,13 @@ var Canvas = () => {
7121
7125
  }
7122
7126
  appStoreApi.setState(__spreadProps(__spreadValues({}, appState), { history }));
7123
7127
  }
7124
- }, [viewportOptions, frameRef.current, iframe, appStoreApi]);
7128
+ }, [
7129
+ viewportOptions,
7130
+ frameRef.current,
7131
+ iframe,
7132
+ appStoreApi,
7133
+ (_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
7134
+ ]);
7125
7135
  return /* @__PURE__ */ jsxs18(
7126
7136
  "div",
7127
7137
  {
package/dist/index.js CHANGED
@@ -6365,9 +6365,10 @@ var ArrayFieldItemInternal = ({
6365
6365
  {
6366
6366
  ref: handleRef,
6367
6367
  onClick: (e) => {
6368
- if (isDragging || !hasVisibleFields) return;
6368
+ if (isDragging) return;
6369
6369
  e.preventDefault();
6370
6370
  e.stopPropagation();
6371
+ if (!hasVisibleFields) return;
6371
6372
  onToggleExpand(id, isExpanded);
6372
6373
  },
6373
6374
  className: getClassNameItem("summary"),
@@ -12773,11 +12774,13 @@ var getClassName36 = get_class_name_factory_default("PuckCanvas", styles_module_
12773
12774
  var ZOOM_ON_CHANGE = true;
12774
12775
  var TRANSITION_DURATION = 150;
12775
12776
  var Canvas = () => {
12777
+ var _a;
12776
12778
  const { frameRef } = useCanvasFrame();
12777
12779
  const resetAutoZoom = useResetAutoZoom(frameRef);
12778
12780
  const {
12779
12781
  _experimentalFullScreenCanvas,
12780
- viewports: viewportOptions = defaultViewports
12782
+ viewports: viewportOptions = defaultViewports,
12783
+ ui: uiProp
12781
12784
  } = usePropsContext();
12782
12785
  const {
12783
12786
  dispatch,
@@ -12874,10 +12877,11 @@ var Canvas = () => {
12874
12877
  }, []);
12875
12878
  const appStoreApi = useAppStoreApi();
12876
12879
  (0, import_react88.useEffect)(() => {
12877
- var _a;
12880
+ var _a2, _b;
12878
12881
  if (typeof window === "undefined") return;
12882
+ if ((_a2 = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a2.current) return;
12879
12883
  const viewportWidth = window.innerWidth;
12880
- const frameWidth = (_a = frameRef.current) == null ? void 0 : _a.getBoundingClientRect().width;
12884
+ const frameWidth = (_b = frameRef.current) == null ? void 0 : _b.getBoundingClientRect().width;
12881
12885
  if (!viewportWidth) return;
12882
12886
  if (!frameWidth) return;
12883
12887
  if (viewportOptions.length === 0) return;
@@ -12916,7 +12920,13 @@ var Canvas = () => {
12916
12920
  }
12917
12921
  appStoreApi.setState(__spreadProps(__spreadValues({}, appState), { history }));
12918
12922
  }
12919
- }, [viewportOptions, frameRef.current, iframe, appStoreApi]);
12923
+ }, [
12924
+ viewportOptions,
12925
+ frameRef.current,
12926
+ iframe,
12927
+ appStoreApi,
12928
+ (_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
12929
+ ]);
12920
12930
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
12921
12931
  "div",
12922
12932
  {
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  setDeep,
18
18
  useGetPuck,
19
19
  usePuck
20
- } from "./chunk-EBISZQTK.mjs";
20
+ } from "./chunk-5OW6KNWG.mjs";
21
21
  import "./chunk-RHVK562Z.mjs";
22
22
  import {
23
23
  migrate,
@@ -6368,9 +6368,10 @@ var ArrayFieldItemInternal = ({
6368
6368
  {
6369
6369
  ref: handleRef,
6370
6370
  onClick: (e) => {
6371
- if (isDragging || !hasVisibleFields) return;
6371
+ if (isDragging) return;
6372
6372
  e.preventDefault();
6373
6373
  e.stopPropagation();
6374
+ if (!hasVisibleFields) return;
6374
6375
  onToggleExpand(id, isExpanded);
6375
6376
  },
6376
6377
  className: getClassNameItem("summary"),
@@ -12776,11 +12777,13 @@ var getClassName36 = get_class_name_factory_default("PuckCanvas", styles_module_
12776
12777
  var ZOOM_ON_CHANGE = true;
12777
12778
  var TRANSITION_DURATION = 150;
12778
12779
  var Canvas = () => {
12780
+ var _a;
12779
12781
  const { frameRef } = useCanvasFrame();
12780
12782
  const resetAutoZoom = useResetAutoZoom(frameRef);
12781
12783
  const {
12782
12784
  _experimentalFullScreenCanvas,
12783
- viewports: viewportOptions = defaultViewports
12785
+ viewports: viewportOptions = defaultViewports,
12786
+ ui: uiProp
12784
12787
  } = usePropsContext();
12785
12788
  const {
12786
12789
  dispatch,
@@ -12877,10 +12880,11 @@ var Canvas = () => {
12877
12880
  }, []);
12878
12881
  const appStoreApi = useAppStoreApi();
12879
12882
  (0, import_react88.useEffect)(() => {
12880
- var _a;
12883
+ var _a2, _b;
12881
12884
  if (typeof window === "undefined") return;
12885
+ if ((_a2 = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a2.current) return;
12882
12886
  const viewportWidth = window.innerWidth;
12883
- const frameWidth = (_a = frameRef.current) == null ? void 0 : _a.getBoundingClientRect().width;
12887
+ const frameWidth = (_b = frameRef.current) == null ? void 0 : _b.getBoundingClientRect().width;
12884
12888
  if (!viewportWidth) return;
12885
12889
  if (!frameWidth) return;
12886
12890
  if (viewportOptions.length === 0) return;
@@ -12919,7 +12923,13 @@ var Canvas = () => {
12919
12923
  }
12920
12924
  appStoreApi.setState(__spreadProps(__spreadValues({}, appState), { history }));
12921
12925
  }
12922
- }, [viewportOptions, frameRef.current, iframe, appStoreApi]);
12926
+ }, [
12927
+ viewportOptions,
12928
+ frameRef.current,
12929
+ iframe,
12930
+ appStoreApi,
12931
+ (_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
12932
+ ]);
12923
12933
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
12924
12934
  "div",
12925
12935
  {
@@ -17,7 +17,7 @@ import {
17
17
  setDeep,
18
18
  useGetPuck,
19
19
  usePuck
20
- } from "./chunk-EBISZQTK.mjs";
20
+ } from "./chunk-5OW6KNWG.mjs";
21
21
  import "./chunk-RHVK562Z.mjs";
22
22
  import {
23
23
  migrate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/core",
3
- "version": "0.21.1",
3
+ "version": "0.21.2-canary.4cf30273",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": "puckeditor/puck",