@measured/puck 0.16.1-canary.ed282b9 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.css +13 -11
- package/dist/index.js +42 -18
- package/dist/index.mjs +47 -22
- package/package.json +1 -1
package/dist/index.css
CHANGED
@@ -1741,7 +1741,7 @@ textarea._Input-input_3pq3z_47 {
|
|
1741
1741
|
}
|
1742
1742
|
|
1743
1743
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css/#css-module-data */
|
1744
|
-
.
|
1744
|
+
._PuckCanvas_avf1c_1 {
|
1745
1745
|
background: var(--puck-color-grey-11);
|
1746
1746
|
display: flex;
|
1747
1747
|
grid-area: editor;
|
@@ -1750,15 +1750,15 @@ textarea._Input-input_3pq3z_47 {
|
|
1750
1750
|
overflow: auto;
|
1751
1751
|
}
|
1752
1752
|
@media (min-width: 1198px) {
|
1753
|
-
.
|
1753
|
+
._PuckCanvas_avf1c_1 {
|
1754
1754
|
padding: calc(var(--puck-space-px) * 1.5);
|
1755
1755
|
padding-top: var(--puck-space-px);
|
1756
1756
|
}
|
1757
|
-
.
|
1757
|
+
._PuckCanvas_avf1c_1:not(._PuckCanvas_avf1c_1:has(._PuckCanvas-controls_avf1c_16)) {
|
1758
1758
|
padding-top: calc(var(--puck-space-px) * 1.5);
|
1759
1759
|
}
|
1760
1760
|
}
|
1761
|
-
._PuckCanvas-
|
1761
|
+
._PuckCanvas-inner_avf1c_21 {
|
1762
1762
|
box-sizing: border-box;
|
1763
1763
|
display: flex;
|
1764
1764
|
height: 100%;
|
@@ -1768,31 +1768,33 @@ textarea._Input-input_3pq3z_47 {
|
|
1768
1768
|
position: relative;
|
1769
1769
|
width: 100%;
|
1770
1770
|
}
|
1771
|
-
._PuckCanvas-
|
1771
|
+
._PuckCanvas-root_avf1c_32 {
|
1772
1772
|
background: white;
|
1773
1773
|
border: 1px solid var(--puck-color-grey-09);
|
1774
1774
|
box-sizing: border-box;
|
1775
1775
|
min-width: 321px;
|
1776
1776
|
position: absolute;
|
1777
|
+
pointer-events: none;
|
1777
1778
|
transform-origin: top;
|
1778
1779
|
top: 0;
|
1779
1780
|
bottom: 0;
|
1780
1781
|
opacity: 0;
|
1781
1782
|
}
|
1782
1783
|
@media (min-width: 1198px) {
|
1783
|
-
._PuckCanvas-
|
1784
|
+
._PuckCanvas-root_avf1c_32 {
|
1784
1785
|
min-width: unset;
|
1785
1786
|
}
|
1786
1787
|
}
|
1787
1788
|
@media (prefers-reduced-motion: reduce) {
|
1788
|
-
._PuckCanvas-
|
1789
|
+
._PuckCanvas-root_avf1c_32 {
|
1789
1790
|
transition: none !important;
|
1790
1791
|
}
|
1791
1792
|
}
|
1792
|
-
._PuckCanvas--
|
1793
|
+
._PuckCanvas--ready_avf1c_57 ._PuckCanvas-root_avf1c_32 {
|
1794
|
+
pointer-events: unset;
|
1793
1795
|
opacity: 1;
|
1794
1796
|
}
|
1795
|
-
._PuckCanvas-
|
1797
|
+
._PuckCanvas-loader_avf1c_62 {
|
1796
1798
|
align-items: center;
|
1797
1799
|
color: var(--puck-color-grey-06);
|
1798
1800
|
display: flex;
|
@@ -1801,10 +1803,10 @@ textarea._Input-input_3pq3z_47 {
|
|
1801
1803
|
transition: opacity 250ms ease-out;
|
1802
1804
|
opacity: 0;
|
1803
1805
|
}
|
1804
|
-
._PuckCanvas--
|
1806
|
+
._PuckCanvas--showLoader_avf1c_72 ._PuckCanvas-loader_avf1c_62 {
|
1805
1807
|
opacity: 1;
|
1806
1808
|
}
|
1807
|
-
._PuckCanvas--
|
1809
|
+
._PuckCanvas--showLoader_avf1c_72._PuckCanvas--ready_avf1c_57 ._PuckCanvas-loader_avf1c_62 {
|
1808
1810
|
opacity: 0;
|
1809
1811
|
height: 0;
|
1810
1812
|
transition: none;
|
package/dist/index.js
CHANGED
@@ -764,16 +764,15 @@ var useResolvedPermissions = (config, appState, globalPermissions, setComponentL
|
|
764
764
|
const resolveDataForItem = (0, import_react4.useCallback)(
|
765
765
|
(item, force = false) => __async(void 0, null, function* () {
|
766
766
|
var _a, _b, _c;
|
767
|
-
setComponentLoading == null ? void 0 : setComponentLoading(item.props.id);
|
768
767
|
const componentConfig = item.type === "root" ? config.root : config.components[item.type];
|
769
768
|
if (!componentConfig) {
|
770
|
-
unsetComponentLoading == null ? void 0 : unsetComponentLoading(item.props.id);
|
771
769
|
return;
|
772
770
|
}
|
773
771
|
const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig.permissions);
|
774
772
|
if (componentConfig.resolvePermissions) {
|
775
773
|
const changed = getChanged(item, (_a = cache3[item.props.id]) == null ? void 0 : _a.lastData);
|
776
774
|
if (Object.values(changed).some((el) => el === true) || force) {
|
775
|
+
setComponentLoading == null ? void 0 : setComponentLoading(item.props.id);
|
777
776
|
const resolvedPermissions2 = yield componentConfig.resolvePermissions(
|
778
777
|
item,
|
779
778
|
{
|
@@ -793,9 +792,9 @@ var useResolvedPermissions = (config, appState, globalPermissions, setComponentL
|
|
793
792
|
setResolvedPermissions((p) => __spreadProps(__spreadValues({}, p), {
|
794
793
|
[item.props.id]: resolvedPermissions2
|
795
794
|
}));
|
795
|
+
unsetComponentLoading == null ? void 0 : unsetComponentLoading(item.props.id);
|
796
796
|
}
|
797
797
|
}
|
798
|
-
unsetComponentLoading == null ? void 0 : unsetComponentLoading(item.props.id);
|
799
798
|
}),
|
800
799
|
[config, globalPermissions, appState, cache3]
|
801
800
|
);
|
@@ -2328,9 +2327,12 @@ function AutoFieldInternal(props) {
|
|
2328
2327
|
const Render2 = render[field.type];
|
2329
2328
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }));
|
2330
2329
|
}
|
2330
|
+
var RECENT_CHANGE_TIMEOUT = 200;
|
2331
2331
|
function AutoFieldPrivate(props) {
|
2332
2332
|
const { value, onChange } = props;
|
2333
2333
|
const [localValue, setLocalValue] = (0, import_react13.useState)(value);
|
2334
|
+
const [recentlyChanged, setRecentlyChanged] = (0, import_react13.useState)(false);
|
2335
|
+
const timeoutRef = (0, import_react13.useRef)();
|
2334
2336
|
const onChangeDb = (0, import_use_debounce.useDebouncedCallback)(
|
2335
2337
|
(val, ui) => {
|
2336
2338
|
onChange(val, ui);
|
@@ -2340,10 +2342,17 @@ function AutoFieldPrivate(props) {
|
|
2340
2342
|
);
|
2341
2343
|
const onChangeLocal = (0, import_react13.useCallback)((val, ui) => {
|
2342
2344
|
setLocalValue(val);
|
2345
|
+
setRecentlyChanged(true);
|
2346
|
+
clearTimeout(timeoutRef.current);
|
2347
|
+
timeoutRef.current = setTimeout(() => {
|
2348
|
+
setRecentlyChanged(false);
|
2349
|
+
}, RECENT_CHANGE_TIMEOUT);
|
2343
2350
|
onChangeDb(val, ui);
|
2344
2351
|
}, []);
|
2345
2352
|
(0, import_react13.useEffect)(() => {
|
2346
|
-
|
2353
|
+
if (!recentlyChanged) {
|
2354
|
+
setLocalValue(value);
|
2355
|
+
}
|
2347
2356
|
}, [value]);
|
2348
2357
|
const localProps = {
|
2349
2358
|
value: localValue,
|
@@ -2351,8 +2360,16 @@ function AutoFieldPrivate(props) {
|
|
2351
2360
|
};
|
2352
2361
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
|
2353
2362
|
}
|
2354
|
-
var DefaultLabel = (props) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", __spreadValues({}, props));
|
2355
2363
|
function AutoField(props) {
|
2364
|
+
const DefaultLabel = (0, import_react13.useMemo)(() => {
|
2365
|
+
const DefaultLabel2 = (labelProps) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
2366
|
+
"div",
|
2367
|
+
__spreadProps(__spreadValues({}, labelProps), {
|
2368
|
+
className: getClassName15({ readOnly: props.readOnly })
|
2369
|
+
})
|
2370
|
+
);
|
2371
|
+
return DefaultLabel2;
|
2372
|
+
}, [props.readOnly]);
|
2356
2373
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadProps(__spreadValues({}, props), { Label: DefaultLabel }));
|
2357
2374
|
}
|
2358
2375
|
|
@@ -3677,7 +3694,7 @@ var DefaultFields = ({
|
|
3677
3694
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children });
|
3678
3695
|
};
|
3679
3696
|
var useResolvedFields = () => {
|
3680
|
-
var _a;
|
3697
|
+
var _a, _b;
|
3681
3698
|
const { selectedItem, state, config } = useAppContext();
|
3682
3699
|
const { data } = state;
|
3683
3700
|
const rootFields = ((_a = config.root) == null ? void 0 : _a.fields) || defaultPageFields;
|
@@ -3689,14 +3706,17 @@ var useResolvedFields = () => {
|
|
3689
3706
|
const [fieldsLoading, setFieldsLoading] = (0, import_react21.useState)(false);
|
3690
3707
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
3691
3708
|
const componentData = selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly };
|
3709
|
+
const hasComponentResolver = selectedItem && (componentConfig == null ? void 0 : componentConfig.resolveFields);
|
3710
|
+
const hasRootResolver = !selectedItem && ((_b = config.root) == null ? void 0 : _b.resolveFields);
|
3711
|
+
const hasResolver = hasComponentResolver || hasRootResolver;
|
3692
3712
|
const resolveFields = (0, import_react21.useCallback)(
|
3693
3713
|
(..._0) => __async(void 0, [..._0], function* (fields = {}) {
|
3694
|
-
var _a2
|
3714
|
+
var _a2;
|
3695
3715
|
const lastData = ((_a2 = lastSelectedData.props) == null ? void 0 : _a2.id) === componentData.props.id ? lastSelectedData : null;
|
3696
3716
|
const changed = getChanged(componentData, lastData);
|
3697
3717
|
setLastSelectedData(componentData);
|
3698
|
-
if (
|
3699
|
-
return yield componentConfig
|
3718
|
+
if (hasComponentResolver) {
|
3719
|
+
return yield componentConfig.resolveFields(
|
3700
3720
|
componentData,
|
3701
3721
|
{
|
3702
3722
|
changed,
|
@@ -3707,8 +3727,8 @@ var useResolvedFields = () => {
|
|
3707
3727
|
}
|
3708
3728
|
);
|
3709
3729
|
}
|
3710
|
-
if (
|
3711
|
-
return yield
|
3730
|
+
if (hasRootResolver) {
|
3731
|
+
return yield config.root.resolveFields(componentData, {
|
3712
3732
|
changed,
|
3713
3733
|
fields,
|
3714
3734
|
lastFields: resolvedFields,
|
@@ -3726,12 +3746,16 @@ var useResolvedFields = () => {
|
|
3726
3746
|
[data, config, componentData, selectedItem, resolvedFields, state]
|
3727
3747
|
);
|
3728
3748
|
(0, import_react21.useEffect)(() => {
|
3729
|
-
|
3730
|
-
|
3731
|
-
|
3732
|
-
|
3733
|
-
|
3734
|
-
|
3749
|
+
if (hasResolver) {
|
3750
|
+
setFieldsLoading(true);
|
3751
|
+
resolveFields(defaultFields).then((fields) => {
|
3752
|
+
setResolvedFields(fields || {});
|
3753
|
+
setFieldsLoading(false);
|
3754
|
+
});
|
3755
|
+
} else {
|
3756
|
+
setResolvedFields(defaultFields);
|
3757
|
+
}
|
3758
|
+
}, [data, defaultFields, state.ui.itemSelector, hasResolver]);
|
3735
3759
|
return [resolvedFields, fieldsLoading];
|
3736
3760
|
};
|
3737
3761
|
var Fields = () => {
|
@@ -4951,7 +4975,7 @@ var ViewportControls = ({
|
|
4951
4975
|
|
4952
4976
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
|
4953
4977
|
init_react_import();
|
4954
|
-
var styles_module_default21 = { "PuckCanvas": "
|
4978
|
+
var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_avf1c_1", "PuckCanvas-controls": "_PuckCanvas-controls_avf1c_16", "PuckCanvas-inner": "_PuckCanvas-inner_avf1c_21", "PuckCanvas-root": "_PuckCanvas-root_avf1c_32", "PuckCanvas--ready": "_PuckCanvas--ready_avf1c_57", "PuckCanvas-loader": "_PuckCanvas-loader_avf1c_62", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_avf1c_72" };
|
4955
4979
|
|
4956
4980
|
// lib/get-zoom-config.ts
|
4957
4981
|
init_react_import();
|
package/dist/index.mjs
CHANGED
@@ -180,6 +180,7 @@ import {
|
|
180
180
|
useCallback as useCallback5,
|
181
181
|
useEffect as useEffect9,
|
182
182
|
useMemo as useMemo2,
|
183
|
+
useRef as useRef2,
|
183
184
|
useState as useState10
|
184
185
|
} from "react";
|
185
186
|
|
@@ -652,16 +653,15 @@ var useResolvedPermissions = (config, appState, globalPermissions, setComponentL
|
|
652
653
|
const resolveDataForItem = useCallback(
|
653
654
|
(item, force = false) => __async(void 0, null, function* () {
|
654
655
|
var _a, _b, _c;
|
655
|
-
setComponentLoading == null ? void 0 : setComponentLoading(item.props.id);
|
656
656
|
const componentConfig = item.type === "root" ? config.root : config.components[item.type];
|
657
657
|
if (!componentConfig) {
|
658
|
-
unsetComponentLoading == null ? void 0 : unsetComponentLoading(item.props.id);
|
659
658
|
return;
|
660
659
|
}
|
661
660
|
const initialPermissions = __spreadValues(__spreadValues({}, globalPermissions), componentConfig.permissions);
|
662
661
|
if (componentConfig.resolvePermissions) {
|
663
662
|
const changed = getChanged(item, (_a = cache3[item.props.id]) == null ? void 0 : _a.lastData);
|
664
663
|
if (Object.values(changed).some((el) => el === true) || force) {
|
664
|
+
setComponentLoading == null ? void 0 : setComponentLoading(item.props.id);
|
665
665
|
const resolvedPermissions2 = yield componentConfig.resolvePermissions(
|
666
666
|
item,
|
667
667
|
{
|
@@ -681,9 +681,9 @@ var useResolvedPermissions = (config, appState, globalPermissions, setComponentL
|
|
681
681
|
setResolvedPermissions((p) => __spreadProps(__spreadValues({}, p), {
|
682
682
|
[item.props.id]: resolvedPermissions2
|
683
683
|
}));
|
684
|
+
unsetComponentLoading == null ? void 0 : unsetComponentLoading(item.props.id);
|
684
685
|
}
|
685
686
|
}
|
686
|
-
unsetComponentLoading == null ? void 0 : unsetComponentLoading(item.props.id);
|
687
687
|
}),
|
688
688
|
[config, globalPermissions, appState, cache3]
|
689
689
|
);
|
@@ -2220,9 +2220,12 @@ function AutoFieldInternal(props) {
|
|
2220
2220
|
const Render2 = render[field.type];
|
2221
2221
|
return /* @__PURE__ */ jsx20(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }));
|
2222
2222
|
}
|
2223
|
+
var RECENT_CHANGE_TIMEOUT = 200;
|
2223
2224
|
function AutoFieldPrivate(props) {
|
2224
2225
|
const { value, onChange } = props;
|
2225
2226
|
const [localValue, setLocalValue] = useState10(value);
|
2227
|
+
const [recentlyChanged, setRecentlyChanged] = useState10(false);
|
2228
|
+
const timeoutRef = useRef2();
|
2226
2229
|
const onChangeDb = useDebouncedCallback(
|
2227
2230
|
(val, ui) => {
|
2228
2231
|
onChange(val, ui);
|
@@ -2232,10 +2235,17 @@ function AutoFieldPrivate(props) {
|
|
2232
2235
|
);
|
2233
2236
|
const onChangeLocal = useCallback5((val, ui) => {
|
2234
2237
|
setLocalValue(val);
|
2238
|
+
setRecentlyChanged(true);
|
2239
|
+
clearTimeout(timeoutRef.current);
|
2240
|
+
timeoutRef.current = setTimeout(() => {
|
2241
|
+
setRecentlyChanged(false);
|
2242
|
+
}, RECENT_CHANGE_TIMEOUT);
|
2235
2243
|
onChangeDb(val, ui);
|
2236
2244
|
}, []);
|
2237
2245
|
useEffect9(() => {
|
2238
|
-
|
2246
|
+
if (!recentlyChanged) {
|
2247
|
+
setLocalValue(value);
|
2248
|
+
}
|
2239
2249
|
}, [value]);
|
2240
2250
|
const localProps = {
|
2241
2251
|
value: localValue,
|
@@ -2243,8 +2253,16 @@ function AutoFieldPrivate(props) {
|
|
2243
2253
|
};
|
2244
2254
|
return /* @__PURE__ */ jsx20(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
|
2245
2255
|
}
|
2246
|
-
var DefaultLabel = (props) => /* @__PURE__ */ jsx20("div", __spreadValues({}, props));
|
2247
2256
|
function AutoField(props) {
|
2257
|
+
const DefaultLabel = useMemo2(() => {
|
2258
|
+
const DefaultLabel2 = (labelProps) => /* @__PURE__ */ jsx20(
|
2259
|
+
"div",
|
2260
|
+
__spreadProps(__spreadValues({}, labelProps), {
|
2261
|
+
className: getClassName15({ readOnly: props.readOnly })
|
2262
|
+
})
|
2263
|
+
);
|
2264
|
+
return DefaultLabel2;
|
2265
|
+
}, [props.readOnly]);
|
2248
2266
|
return /* @__PURE__ */ jsx20(AutoFieldInternal, __spreadProps(__spreadValues({}, props), { Label: DefaultLabel }));
|
2249
2267
|
}
|
2250
2268
|
|
@@ -3587,7 +3605,7 @@ var DefaultFields = ({
|
|
3587
3605
|
return /* @__PURE__ */ jsx27(Fragment12, { children });
|
3588
3606
|
};
|
3589
3607
|
var useResolvedFields = () => {
|
3590
|
-
var _a;
|
3608
|
+
var _a, _b;
|
3591
3609
|
const { selectedItem, state, config } = useAppContext();
|
3592
3610
|
const { data } = state;
|
3593
3611
|
const rootFields = ((_a = config.root) == null ? void 0 : _a.fields) || defaultPageFields;
|
@@ -3599,14 +3617,17 @@ var useResolvedFields = () => {
|
|
3599
3617
|
const [fieldsLoading, setFieldsLoading] = useState15(false);
|
3600
3618
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
3601
3619
|
const componentData = selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly };
|
3620
|
+
const hasComponentResolver = selectedItem && (componentConfig == null ? void 0 : componentConfig.resolveFields);
|
3621
|
+
const hasRootResolver = !selectedItem && ((_b = config.root) == null ? void 0 : _b.resolveFields);
|
3622
|
+
const hasResolver = hasComponentResolver || hasRootResolver;
|
3602
3623
|
const resolveFields = useCallback7(
|
3603
3624
|
(..._0) => __async(void 0, [..._0], function* (fields = {}) {
|
3604
|
-
var _a2
|
3625
|
+
var _a2;
|
3605
3626
|
const lastData = ((_a2 = lastSelectedData.props) == null ? void 0 : _a2.id) === componentData.props.id ? lastSelectedData : null;
|
3606
3627
|
const changed = getChanged(componentData, lastData);
|
3607
3628
|
setLastSelectedData(componentData);
|
3608
|
-
if (
|
3609
|
-
return yield componentConfig
|
3629
|
+
if (hasComponentResolver) {
|
3630
|
+
return yield componentConfig.resolveFields(
|
3610
3631
|
componentData,
|
3611
3632
|
{
|
3612
3633
|
changed,
|
@@ -3617,8 +3638,8 @@ var useResolvedFields = () => {
|
|
3617
3638
|
}
|
3618
3639
|
);
|
3619
3640
|
}
|
3620
|
-
if (
|
3621
|
-
return yield
|
3641
|
+
if (hasRootResolver) {
|
3642
|
+
return yield config.root.resolveFields(componentData, {
|
3622
3643
|
changed,
|
3623
3644
|
fields,
|
3624
3645
|
lastFields: resolvedFields,
|
@@ -3636,12 +3657,16 @@ var useResolvedFields = () => {
|
|
3636
3657
|
[data, config, componentData, selectedItem, resolvedFields, state]
|
3637
3658
|
);
|
3638
3659
|
useEffect13(() => {
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
3644
|
-
|
3660
|
+
if (hasResolver) {
|
3661
|
+
setFieldsLoading(true);
|
3662
|
+
resolveFields(defaultFields).then((fields) => {
|
3663
|
+
setResolvedFields(fields || {});
|
3664
|
+
setFieldsLoading(false);
|
3665
|
+
});
|
3666
|
+
} else {
|
3667
|
+
setResolvedFields(defaultFields);
|
3668
|
+
}
|
3669
|
+
}, [data, defaultFields, state.ui.itemSelector, hasResolver]);
|
3645
3670
|
return [resolvedFields, fieldsLoading];
|
3646
3671
|
};
|
3647
3672
|
var Fields = () => {
|
@@ -3950,7 +3975,7 @@ import {
|
|
3950
3975
|
createContext as createContext4,
|
3951
3976
|
useContext as useContext5,
|
3952
3977
|
useEffect as useEffect15,
|
3953
|
-
useRef as
|
3978
|
+
useRef as useRef3,
|
3954
3979
|
useState as useState17
|
3955
3980
|
} from "react";
|
3956
3981
|
import hash from "object-hash";
|
@@ -4175,7 +4200,7 @@ function AutoFrame(_a) {
|
|
4175
4200
|
]);
|
4176
4201
|
const [loaded, setLoaded] = useState17(false);
|
4177
4202
|
const [ctx, setCtx] = useState17({});
|
4178
|
-
const ref =
|
4203
|
+
const ref = useRef3(null);
|
4179
4204
|
const [mountTarget, setMountTarget] = useState17();
|
4180
4205
|
useEffect15(() => {
|
4181
4206
|
var _a2;
|
@@ -4724,7 +4749,7 @@ import {
|
|
4724
4749
|
useCallback as useCallback10,
|
4725
4750
|
useEffect as useEffect17,
|
4726
4751
|
useMemo as useMemo11,
|
4727
|
-
useRef as
|
4752
|
+
useRef as useRef4,
|
4728
4753
|
useState as useState20
|
4729
4754
|
} from "react";
|
4730
4755
|
|
@@ -4873,7 +4898,7 @@ var ViewportControls = ({
|
|
4873
4898
|
|
4874
4899
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
|
4875
4900
|
init_react_import();
|
4876
|
-
var styles_module_default21 = { "PuckCanvas": "
|
4901
|
+
var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_avf1c_1", "PuckCanvas-controls": "_PuckCanvas-controls_avf1c_16", "PuckCanvas-inner": "_PuckCanvas-inner_avf1c_21", "PuckCanvas-root": "_PuckCanvas-root_avf1c_32", "PuckCanvas--ready": "_PuckCanvas--ready_avf1c_57", "PuckCanvas-loader": "_PuckCanvas-loader_avf1c_62", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_avf1c_72" };
|
4877
4902
|
|
4878
4903
|
// lib/get-zoom-config.ts
|
4879
4904
|
init_react_import();
|
@@ -4913,7 +4938,7 @@ var Canvas = () => {
|
|
4913
4938
|
const { status, iframe } = useAppContext();
|
4914
4939
|
const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext();
|
4915
4940
|
const { ui } = state;
|
4916
|
-
const frameRef =
|
4941
|
+
const frameRef = useRef4(null);
|
4917
4942
|
const [showTransition, setShowTransition] = useState20(false);
|
4918
4943
|
const defaultRender = useMemo11(() => {
|
4919
4944
|
const PuckDefault = ({ children }) => /* @__PURE__ */ jsx36(Fragment17, { children });
|
package/package.json
CHANGED