@measured/puck 0.16.1-canary.16a7d11 → 0.16.1-canary.20d7309
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.css +13 -11
- package/dist/index.js +45 -18
- package/dist/index.mjs +50 -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
|
);
|
@@ -1447,6 +1446,9 @@ var ArrayField = ({
|
|
1447
1446
|
e.stopPropagation();
|
1448
1447
|
setHovering(false);
|
1449
1448
|
},
|
1449
|
+
onClick: (e) => {
|
1450
|
+
e.preventDefault();
|
1451
|
+
},
|
1450
1452
|
children: [
|
1451
1453
|
localState.arrayState.items.map((item, i) => {
|
1452
1454
|
const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
|
@@ -2325,9 +2327,12 @@ function AutoFieldInternal(props) {
|
|
2325
2327
|
const Render2 = render[field.type];
|
2326
2328
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }));
|
2327
2329
|
}
|
2330
|
+
var RECENT_CHANGE_TIMEOUT = 200;
|
2328
2331
|
function AutoFieldPrivate(props) {
|
2329
2332
|
const { value, onChange } = props;
|
2330
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)();
|
2331
2336
|
const onChangeDb = (0, import_use_debounce.useDebouncedCallback)(
|
2332
2337
|
(val, ui) => {
|
2333
2338
|
onChange(val, ui);
|
@@ -2337,10 +2342,17 @@ function AutoFieldPrivate(props) {
|
|
2337
2342
|
);
|
2338
2343
|
const onChangeLocal = (0, import_react13.useCallback)((val, ui) => {
|
2339
2344
|
setLocalValue(val);
|
2345
|
+
setRecentlyChanged(true);
|
2346
|
+
clearTimeout(timeoutRef.current);
|
2347
|
+
timeoutRef.current = setTimeout(() => {
|
2348
|
+
setRecentlyChanged(false);
|
2349
|
+
}, RECENT_CHANGE_TIMEOUT);
|
2340
2350
|
onChangeDb(val, ui);
|
2341
2351
|
}, []);
|
2342
2352
|
(0, import_react13.useEffect)(() => {
|
2343
|
-
|
2353
|
+
if (!recentlyChanged) {
|
2354
|
+
setLocalValue(value);
|
2355
|
+
}
|
2344
2356
|
}, [value]);
|
2345
2357
|
const localProps = {
|
2346
2358
|
value: localValue,
|
@@ -2348,8 +2360,16 @@ function AutoFieldPrivate(props) {
|
|
2348
2360
|
};
|
2349
2361
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
|
2350
2362
|
}
|
2351
|
-
var DefaultLabel = (props) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", __spreadValues({}, props));
|
2352
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]);
|
2353
2373
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadProps(__spreadValues({}, props), { Label: DefaultLabel }));
|
2354
2374
|
}
|
2355
2375
|
|
@@ -3674,7 +3694,7 @@ var DefaultFields = ({
|
|
3674
3694
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children });
|
3675
3695
|
};
|
3676
3696
|
var useResolvedFields = () => {
|
3677
|
-
var _a;
|
3697
|
+
var _a, _b;
|
3678
3698
|
const { selectedItem, state, config } = useAppContext();
|
3679
3699
|
const { data } = state;
|
3680
3700
|
const rootFields = ((_a = config.root) == null ? void 0 : _a.fields) || defaultPageFields;
|
@@ -3686,14 +3706,17 @@ var useResolvedFields = () => {
|
|
3686
3706
|
const [fieldsLoading, setFieldsLoading] = (0, import_react21.useState)(false);
|
3687
3707
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
3688
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;
|
3689
3712
|
const resolveFields = (0, import_react21.useCallback)(
|
3690
3713
|
(..._0) => __async(void 0, [..._0], function* (fields = {}) {
|
3691
|
-
var _a2
|
3714
|
+
var _a2;
|
3692
3715
|
const lastData = ((_a2 = lastSelectedData.props) == null ? void 0 : _a2.id) === componentData.props.id ? lastSelectedData : null;
|
3693
3716
|
const changed = getChanged(componentData, lastData);
|
3694
3717
|
setLastSelectedData(componentData);
|
3695
|
-
if (
|
3696
|
-
return yield componentConfig
|
3718
|
+
if (hasComponentResolver) {
|
3719
|
+
return yield componentConfig.resolveFields(
|
3697
3720
|
componentData,
|
3698
3721
|
{
|
3699
3722
|
changed,
|
@@ -3704,8 +3727,8 @@ var useResolvedFields = () => {
|
|
3704
3727
|
}
|
3705
3728
|
);
|
3706
3729
|
}
|
3707
|
-
if (
|
3708
|
-
return yield
|
3730
|
+
if (hasRootResolver) {
|
3731
|
+
return yield config.root.resolveFields(componentData, {
|
3709
3732
|
changed,
|
3710
3733
|
fields,
|
3711
3734
|
lastFields: resolvedFields,
|
@@ -3723,12 +3746,16 @@ var useResolvedFields = () => {
|
|
3723
3746
|
[data, config, componentData, selectedItem, resolvedFields, state]
|
3724
3747
|
);
|
3725
3748
|
(0, import_react21.useEffect)(() => {
|
3726
|
-
|
3727
|
-
|
3728
|
-
|
3729
|
-
|
3730
|
-
|
3731
|
-
|
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]);
|
3732
3759
|
return [resolvedFields, fieldsLoading];
|
3733
3760
|
};
|
3734
3761
|
var Fields = () => {
|
@@ -4948,7 +4975,7 @@ var ViewportControls = ({
|
|
4948
4975
|
|
4949
4976
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
|
4950
4977
|
init_react_import();
|
4951
|
-
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" };
|
4952
4979
|
|
4953
4980
|
// lib/get-zoom-config.ts
|
4954
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
|
);
|
@@ -1339,6 +1339,9 @@ var ArrayField = ({
|
|
1339
1339
|
e.stopPropagation();
|
1340
1340
|
setHovering(false);
|
1341
1341
|
},
|
1342
|
+
onClick: (e) => {
|
1343
|
+
e.preventDefault();
|
1344
|
+
},
|
1342
1345
|
children: [
|
1343
1346
|
localState.arrayState.items.map((item, i) => {
|
1344
1347
|
const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
|
@@ -2217,9 +2220,12 @@ function AutoFieldInternal(props) {
|
|
2217
2220
|
const Render2 = render[field.type];
|
2218
2221
|
return /* @__PURE__ */ jsx20(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }));
|
2219
2222
|
}
|
2223
|
+
var RECENT_CHANGE_TIMEOUT = 200;
|
2220
2224
|
function AutoFieldPrivate(props) {
|
2221
2225
|
const { value, onChange } = props;
|
2222
2226
|
const [localValue, setLocalValue] = useState10(value);
|
2227
|
+
const [recentlyChanged, setRecentlyChanged] = useState10(false);
|
2228
|
+
const timeoutRef = useRef2();
|
2223
2229
|
const onChangeDb = useDebouncedCallback(
|
2224
2230
|
(val, ui) => {
|
2225
2231
|
onChange(val, ui);
|
@@ -2229,10 +2235,17 @@ function AutoFieldPrivate(props) {
|
|
2229
2235
|
);
|
2230
2236
|
const onChangeLocal = useCallback5((val, ui) => {
|
2231
2237
|
setLocalValue(val);
|
2238
|
+
setRecentlyChanged(true);
|
2239
|
+
clearTimeout(timeoutRef.current);
|
2240
|
+
timeoutRef.current = setTimeout(() => {
|
2241
|
+
setRecentlyChanged(false);
|
2242
|
+
}, RECENT_CHANGE_TIMEOUT);
|
2232
2243
|
onChangeDb(val, ui);
|
2233
2244
|
}, []);
|
2234
2245
|
useEffect9(() => {
|
2235
|
-
|
2246
|
+
if (!recentlyChanged) {
|
2247
|
+
setLocalValue(value);
|
2248
|
+
}
|
2236
2249
|
}, [value]);
|
2237
2250
|
const localProps = {
|
2238
2251
|
value: localValue,
|
@@ -2240,8 +2253,16 @@ function AutoFieldPrivate(props) {
|
|
2240
2253
|
};
|
2241
2254
|
return /* @__PURE__ */ jsx20(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
|
2242
2255
|
}
|
2243
|
-
var DefaultLabel = (props) => /* @__PURE__ */ jsx20("div", __spreadValues({}, props));
|
2244
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]);
|
2245
2266
|
return /* @__PURE__ */ jsx20(AutoFieldInternal, __spreadProps(__spreadValues({}, props), { Label: DefaultLabel }));
|
2246
2267
|
}
|
2247
2268
|
|
@@ -3584,7 +3605,7 @@ var DefaultFields = ({
|
|
3584
3605
|
return /* @__PURE__ */ jsx27(Fragment12, { children });
|
3585
3606
|
};
|
3586
3607
|
var useResolvedFields = () => {
|
3587
|
-
var _a;
|
3608
|
+
var _a, _b;
|
3588
3609
|
const { selectedItem, state, config } = useAppContext();
|
3589
3610
|
const { data } = state;
|
3590
3611
|
const rootFields = ((_a = config.root) == null ? void 0 : _a.fields) || defaultPageFields;
|
@@ -3596,14 +3617,17 @@ var useResolvedFields = () => {
|
|
3596
3617
|
const [fieldsLoading, setFieldsLoading] = useState15(false);
|
3597
3618
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
3598
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;
|
3599
3623
|
const resolveFields = useCallback7(
|
3600
3624
|
(..._0) => __async(void 0, [..._0], function* (fields = {}) {
|
3601
|
-
var _a2
|
3625
|
+
var _a2;
|
3602
3626
|
const lastData = ((_a2 = lastSelectedData.props) == null ? void 0 : _a2.id) === componentData.props.id ? lastSelectedData : null;
|
3603
3627
|
const changed = getChanged(componentData, lastData);
|
3604
3628
|
setLastSelectedData(componentData);
|
3605
|
-
if (
|
3606
|
-
return yield componentConfig
|
3629
|
+
if (hasComponentResolver) {
|
3630
|
+
return yield componentConfig.resolveFields(
|
3607
3631
|
componentData,
|
3608
3632
|
{
|
3609
3633
|
changed,
|
@@ -3614,8 +3638,8 @@ var useResolvedFields = () => {
|
|
3614
3638
|
}
|
3615
3639
|
);
|
3616
3640
|
}
|
3617
|
-
if (
|
3618
|
-
return yield
|
3641
|
+
if (hasRootResolver) {
|
3642
|
+
return yield config.root.resolveFields(componentData, {
|
3619
3643
|
changed,
|
3620
3644
|
fields,
|
3621
3645
|
lastFields: resolvedFields,
|
@@ -3633,12 +3657,16 @@ var useResolvedFields = () => {
|
|
3633
3657
|
[data, config, componentData, selectedItem, resolvedFields, state]
|
3634
3658
|
);
|
3635
3659
|
useEffect13(() => {
|
3636
|
-
|
3637
|
-
|
3638
|
-
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
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]);
|
3642
3670
|
return [resolvedFields, fieldsLoading];
|
3643
3671
|
};
|
3644
3672
|
var Fields = () => {
|
@@ -3947,7 +3975,7 @@ import {
|
|
3947
3975
|
createContext as createContext4,
|
3948
3976
|
useContext as useContext5,
|
3949
3977
|
useEffect as useEffect15,
|
3950
|
-
useRef as
|
3978
|
+
useRef as useRef3,
|
3951
3979
|
useState as useState17
|
3952
3980
|
} from "react";
|
3953
3981
|
import hash from "object-hash";
|
@@ -4172,7 +4200,7 @@ function AutoFrame(_a) {
|
|
4172
4200
|
]);
|
4173
4201
|
const [loaded, setLoaded] = useState17(false);
|
4174
4202
|
const [ctx, setCtx] = useState17({});
|
4175
|
-
const ref =
|
4203
|
+
const ref = useRef3(null);
|
4176
4204
|
const [mountTarget, setMountTarget] = useState17();
|
4177
4205
|
useEffect15(() => {
|
4178
4206
|
var _a2;
|
@@ -4721,7 +4749,7 @@ import {
|
|
4721
4749
|
useCallback as useCallback10,
|
4722
4750
|
useEffect as useEffect17,
|
4723
4751
|
useMemo as useMemo11,
|
4724
|
-
useRef as
|
4752
|
+
useRef as useRef4,
|
4725
4753
|
useState as useState20
|
4726
4754
|
} from "react";
|
4727
4755
|
|
@@ -4870,7 +4898,7 @@ var ViewportControls = ({
|
|
4870
4898
|
|
4871
4899
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
|
4872
4900
|
init_react_import();
|
4873
|
-
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" };
|
4874
4902
|
|
4875
4903
|
// lib/get-zoom-config.ts
|
4876
4904
|
init_react_import();
|
@@ -4910,7 +4938,7 @@ var Canvas = () => {
|
|
4910
4938
|
const { status, iframe } = useAppContext();
|
4911
4939
|
const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext();
|
4912
4940
|
const { ui } = state;
|
4913
|
-
const frameRef =
|
4941
|
+
const frameRef = useRef4(null);
|
4914
4942
|
const [showTransition, setShowTransition] = useState20(false);
|
4915
4943
|
const defaultRender = useMemo11(() => {
|
4916
4944
|
const PuckDefault = ({ children }) => /* @__PURE__ */ jsx36(Fragment17, { children });
|
package/package.json
CHANGED