@measured/puck 0.18.1 → 0.18.2-canary.23c8dda
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 +236 -230
- package/dist/index.d.mts +3 -45
- package/dist/index.d.ts +3 -45
- package/dist/index.js +88 -42
- package/dist/index.mjs +88 -40
- package/dist/{resolve-all-data-DzJEE28m.d.mts → resolve-all-data-C-cc7ftj.d.mts} +2 -2
- package/dist/{resolve-all-data-DzJEE28m.d.ts → resolve-all-data-C-cc7ftj.d.ts} +2 -2
- package/dist/rsc.d.mts +4 -4
- package/dist/rsc.d.ts +4 -4
- package/dist/rsc.js +3 -5
- package/dist/rsc.mjs +3 -5
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
@@ -159,7 +159,7 @@ var get_class_name_factory_default = getClassNameFactory;
|
|
159
159
|
|
160
160
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css#css-module
|
161
161
|
init_react_import();
|
162
|
-
var styles_module_default = { "ActionBar": "
|
162
|
+
var styles_module_default = { "ActionBar": "_ActionBar_rvadt_1", "ActionBar-label": "_ActionBar-label_rvadt_18", "ActionBar-action": "_ActionBar-action_rvadt_30", "ActionBar-group": "_ActionBar-group_rvadt_38" };
|
163
163
|
|
164
164
|
// components/ActionBar/index.tsx
|
165
165
|
import { jsx, jsxs } from "react/jsx-runtime";
|
@@ -205,7 +205,7 @@ init_react_import();
|
|
205
205
|
|
206
206
|
// css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/styles.module.css#css-module
|
207
207
|
init_react_import();
|
208
|
-
var styles_module_default2 = { "InputWrapper": "
|
208
|
+
var styles_module_default2 = { "InputWrapper": "_InputWrapper_g5w3n_1", "Input-label": "_Input-label_g5w3n_5", "Input-labelIcon": "_Input-labelIcon_g5w3n_14", "Input-disabledIcon": "_Input-disabledIcon_g5w3n_21", "Input-input": "_Input-input_g5w3n_26", "Input": "_Input_g5w3n_1", "Input--readOnly": "_Input--readOnly_g5w3n_74", "Input-radioGroupItems": "_Input-radioGroupItems_g5w3n_85", "Input-radio": "_Input-radio_g5w3n_85", "Input-radioInner": "_Input-radioInner_g5w3n_102", "Input-radioInput": "_Input-radioInput_g5w3n_147" };
|
209
209
|
|
210
210
|
// components/AutoField/index.tsx
|
211
211
|
import {
|
@@ -1570,7 +1570,7 @@ import {
|
|
1570
1570
|
|
1571
1571
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
|
1572
1572
|
init_react_import();
|
1573
|
-
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-
|
1573
|
+
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_1ibts_1", "ExternalInput-button": "_ExternalInput-button_1ibts_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_1ibts_24", "ExternalInput--readOnly": "_ExternalInput--readOnly_1ibts_31", "ExternalInput-detachButton": "_ExternalInput-detachButton_1ibts_35", "ExternalInput": "_ExternalInput_1ibts_1", "ExternalInputModal": "_ExternalInputModal_1ibts_79", "ExternalInputModal-grid": "_ExternalInputModal-grid_1ibts_89", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_1ibts_100", "ExternalInputModal-filters": "_ExternalInputModal-filters_1ibts_105", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_1ibts_124", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_1ibts_133", "ExternalInputModal-table": "_ExternalInputModal-table_1ibts_133", "ExternalInputModal-thead": "_ExternalInputModal-thead_1ibts_149", "ExternalInputModal-th": "_ExternalInputModal-th_1ibts_149", "ExternalInputModal-td": "_ExternalInputModal-td_1ibts_164", "ExternalInputModal-tr": "_ExternalInputModal-tr_1ibts_169", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_1ibts_176", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_1ibts_202", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_1ibts_206", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_1ibts_223", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_1ibts_227", "ExternalInputModal-search": "_ExternalInputModal-search_1ibts_227", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_1ibts_264", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_1ibts_289", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_1ibts_299", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_1ibts_313", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_1ibts_326", "ExternalInputModal-footerContainer": "_ExternalInputModal-footerContainer_1ibts_330", "ExternalInputModal-footer": "_ExternalInputModal-footer_1ibts_330" };
|
1574
1574
|
|
1575
1575
|
// components/Modal/index.tsx
|
1576
1576
|
init_react_import();
|
@@ -1641,7 +1641,7 @@ import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
1641
1641
|
|
1642
1642
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Button/Button.module.css#css-module
|
1643
1643
|
init_react_import();
|
1644
|
-
var Button_module_default = { "Button": "
|
1644
|
+
var Button_module_default = { "Button": "_Button_10byl_1", "Button--medium": "_Button--medium_10byl_29", "Button--large": "_Button--large_10byl_37", "Button-icon": "_Button-icon_10byl_44", "Button--primary": "_Button--primary_10byl_48", "Button--secondary": "_Button--secondary_10byl_67", "Button--flush": "_Button--flush_10byl_84", "Button--disabled": "_Button--disabled_10byl_88", "Button--fullWidth": "_Button--fullWidth_10byl_95", "Button-spinner": "_Button-spinner_10byl_100" };
|
1645
1645
|
|
1646
1646
|
// lib/filter-data-attrs.ts
|
1647
1647
|
init_react_import();
|
@@ -3804,6 +3804,7 @@ var DropZoneRender = forwardRef3(
|
|
3804
3804
|
}) });
|
3805
3805
|
}
|
3806
3806
|
);
|
3807
|
+
var DropZonePure = (props) => /* @__PURE__ */ jsx22(DropZone, __spreadValues({}, props));
|
3807
3808
|
var DropZone = forwardRef3(
|
3808
3809
|
function DropZone2(props, ref) {
|
3809
3810
|
const ctx = useContext6(dropZoneContext);
|
@@ -3910,6 +3911,25 @@ var GlobalPosition = class {
|
|
3910
3911
|
}
|
3911
3912
|
};
|
3912
3913
|
|
3914
|
+
// lib/bubble-pointer-event.ts
|
3915
|
+
init_react_import();
|
3916
|
+
var BaseEvent = typeof PointerEvent !== "undefined" ? PointerEvent : Event;
|
3917
|
+
var BubbledPointerEvent = class extends BaseEvent {
|
3918
|
+
constructor(type, data) {
|
3919
|
+
super(type, data);
|
3920
|
+
this._originalTarget = null;
|
3921
|
+
this.originalTarget = data.originalTarget;
|
3922
|
+
}
|
3923
|
+
// Necessary for Firefox
|
3924
|
+
set originalTarget(target) {
|
3925
|
+
this._originalTarget = target;
|
3926
|
+
}
|
3927
|
+
// Necessary for Firefox
|
3928
|
+
get originalTarget() {
|
3929
|
+
return this._originalTarget;
|
3930
|
+
}
|
3931
|
+
};
|
3932
|
+
|
3913
3933
|
// lib/dnd/NestedDroppablePlugin.ts
|
3914
3934
|
var depthSort = (candidates) => {
|
3915
3935
|
return candidates.sort((a, b) => {
|
@@ -4034,7 +4054,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
4034
4054
|
}
|
4035
4055
|
const cleanupEffect = effects(() => {
|
4036
4056
|
const handleMove = (event) => {
|
4037
|
-
const target = event.originalTarget || event.target;
|
4057
|
+
const target = event instanceof BubbledPointerEvent ? event.originalTarget || event.target : event.target;
|
4038
4058
|
const position = new GlobalPosition(target, {
|
4039
4059
|
x: event.clientX,
|
4040
4060
|
y: event.clientY
|
@@ -4743,6 +4763,19 @@ function patchWindow(window2) {
|
|
4743
4763
|
|
4744
4764
|
// components/DragDropContext/index.tsx
|
4745
4765
|
import { createStore as createStore3 } from "zustand";
|
4766
|
+
|
4767
|
+
// lib/get-deep-dir.ts
|
4768
|
+
init_react_import();
|
4769
|
+
function getDeepDir(el) {
|
4770
|
+
function findDir(node) {
|
4771
|
+
if (!node) return "ltr";
|
4772
|
+
const d = node.getAttribute("dir");
|
4773
|
+
return d || findDir(node.parentElement);
|
4774
|
+
}
|
4775
|
+
return el ? findDir(el) : "ltr";
|
4776
|
+
}
|
4777
|
+
|
4778
|
+
// components/DragDropContext/index.tsx
|
4746
4779
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
4747
4780
|
var DEBUG3 = false;
|
4748
4781
|
var dragListenerContext = createContext4({
|
@@ -5036,7 +5069,8 @@ var DragDropContextClient = ({
|
|
5036
5069
|
targetZone = targetData.zone;
|
5037
5070
|
targetIndex = targetData.index;
|
5038
5071
|
const collisionData = (_c = (_b = manager.dragOperation.data) == null ? void 0 : _b.collisionMap) == null ? void 0 : _c[targetId];
|
5039
|
-
const
|
5072
|
+
const dir = getDeepDir(target.element);
|
5073
|
+
const collisionPosition = (collisionData == null ? void 0 : collisionData.direction) === "up" || dir === "ltr" && (collisionData == null ? void 0 : collisionData.direction) === "left" || dir === "rtl" && (collisionData == null ? void 0 : collisionData.direction) === "right" ? "before" : "after";
|
5040
5074
|
if (targetIndex >= sourceIndex && sourceZone === targetZone) {
|
5041
5075
|
targetIndex = targetIndex - 1;
|
5042
5076
|
}
|
@@ -5306,7 +5340,7 @@ init_react_import();
|
|
5306
5340
|
|
5307
5341
|
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
5308
5342
|
init_react_import();
|
5309
|
-
var styles_module_default13 = { "SidebarSection": "
|
5343
|
+
var styles_module_default13 = { "SidebarSection": "_SidebarSection_8boj8_1", "SidebarSection-title": "_SidebarSection-title_8boj8_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_8boj8_20", "SidebarSection-content": "_SidebarSection-content_8boj8_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_8boj8_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_8boj8_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_8boj8_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_8boj8_41", "SidebarSection-heading": "_SidebarSection-heading_8boj8_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_8boj8_86" };
|
5310
5344
|
|
5311
5345
|
// lib/use-breadcrumbs.ts
|
5312
5346
|
init_react_import();
|
@@ -5485,7 +5519,7 @@ function MenuBar({
|
|
5485
5519
|
|
5486
5520
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/styles.module.css#css-module
|
5487
5521
|
init_react_import();
|
5488
|
-
var styles_module_default15 = { "Puck": "
|
5522
|
+
var styles_module_default15 = { "Puck": "_Puck_11o75_19", "Puck-portal": "_Puck-portal_11o75_24", "PuckLayout-inner": "_PuckLayout-inner_11o75_31", "PuckLayout--mounted": "_PuckLayout--mounted_11o75_43", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_11o75_47", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_11o75_53", "PuckLayout-mounted": "_PuckLayout-mounted_11o75_67", "PuckLayout": "_PuckLayout_11o75_31", "PuckLayout-header": "_PuckLayout-header_11o75_108", "PuckLayout-headerInner": "_PuckLayout-headerInner_11o75_117", "PuckLayout-headerToggle": "_PuckLayout-headerToggle_11o75_127", "PuckLayout-rightSideBarToggle": "_PuckLayout-rightSideBarToggle_11o75_134", "PuckLayout-leftSideBarToggle": "_PuckLayout-leftSideBarToggle_11o75_135", "PuckLayout-headerTitle": "_PuckLayout-headerTitle_11o75_139", "PuckLayout-headerPath": "_PuckLayout-headerPath_11o75_143", "PuckLayout-headerTools": "_PuckLayout-headerTools_11o75_150", "PuckLayout-menuButton": "_PuckLayout-menuButton_11o75_156", "PuckLayout--menuOpen": "_PuckLayout--menuOpen_11o75_161", "PuckLayout-leftSideBar": "_PuckLayout-leftSideBar_11o75_135", "PuckLayout-rightSideBar": "_PuckLayout-rightSideBar_11o75_134" };
|
5489
5523
|
|
5490
5524
|
// components/Puck/components/Fields/index.tsx
|
5491
5525
|
init_react_import();
|
@@ -5547,7 +5581,10 @@ var selectorIs = (a, b) => (a == null ? void 0 : a.zone) === (b == null ? void 0
|
|
5547
5581
|
var defaultPageFields = {
|
5548
5582
|
title: { type: "text" }
|
5549
5583
|
};
|
5550
|
-
var useResolvedFields = (
|
5584
|
+
var useResolvedFields = ({
|
5585
|
+
_skipValueCheck,
|
5586
|
+
_skipIdCheck
|
5587
|
+
} = {}) => {
|
5551
5588
|
var _a, _b;
|
5552
5589
|
const { selectedItem, state, config } = useAppContext();
|
5553
5590
|
const parent = useParent();
|
@@ -5560,11 +5597,17 @@ var useResolvedFields = () => {
|
|
5560
5597
|
);
|
5561
5598
|
const rootProps = data.root.props || data.root;
|
5562
5599
|
const [lastSelectedData, setLastSelectedData] = useState19({});
|
5563
|
-
const [resolvedFields, setResolvedFields] = useState19(
|
5600
|
+
const [resolvedFields, setResolvedFields] = useState19({
|
5601
|
+
fields: defaultFields,
|
5602
|
+
id: selectedItem == null ? void 0 : selectedItem.props.id
|
5603
|
+
});
|
5564
5604
|
const [fieldsLoading, setFieldsLoading] = useState19(false);
|
5565
5605
|
const lastFields = useRef5(defaultFields);
|
5566
5606
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
5567
|
-
const componentData =
|
5607
|
+
const componentData = useMemo11(
|
5608
|
+
() => selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly || {} },
|
5609
|
+
[selectedItem, rootProps, data.root.readOnly]
|
5610
|
+
);
|
5568
5611
|
const hasComponentResolver = selectedItem && (componentConfig == null ? void 0 : componentConfig.resolveFields);
|
5569
5612
|
const hasRootResolver = !selectedItem && ((_b = config.root) == null ? void 0 : _b.resolveFields);
|
5570
5613
|
const hasResolver = hasComponentResolver || hasRootResolver;
|
@@ -5612,15 +5655,25 @@ var useResolvedFields = () => {
|
|
5612
5655
|
if (hasResolver) {
|
5613
5656
|
setFieldsLoading(true);
|
5614
5657
|
resolveFields(defaultFields).then((fields) => {
|
5615
|
-
setResolvedFields(
|
5658
|
+
setResolvedFields({
|
5659
|
+
fields: fields || {},
|
5660
|
+
id: selectedItem == null ? void 0 : selectedItem.props.id
|
5661
|
+
});
|
5616
5662
|
lastFields.current = fields;
|
5617
5663
|
setFieldsLoading(false);
|
5618
5664
|
});
|
5619
5665
|
return;
|
5620
5666
|
}
|
5621
5667
|
}
|
5622
|
-
setResolvedFields(defaultFields);
|
5623
|
-
}, [
|
5668
|
+
setResolvedFields({ fields: defaultFields, id: selectedItem == null ? void 0 : selectedItem.props.id });
|
5669
|
+
}, [
|
5670
|
+
defaultFields,
|
5671
|
+
state.ui.itemSelector,
|
5672
|
+
selectedItem,
|
5673
|
+
hasResolver,
|
5674
|
+
parent,
|
5675
|
+
resolveFields
|
5676
|
+
]);
|
5624
5677
|
useOnValueChange(
|
5625
5678
|
state.ui.itemSelector,
|
5626
5679
|
() => {
|
@@ -5631,6 +5684,7 @@ var useResolvedFields = () => {
|
|
5631
5684
|
useOnValueChange(
|
5632
5685
|
{ data, parent, itemSelector: state.ui.itemSelector },
|
5633
5686
|
() => {
|
5687
|
+
if (_skipValueCheck) return;
|
5634
5688
|
triggerResolver();
|
5635
5689
|
},
|
5636
5690
|
(a, b) => JSON.stringify(a) === JSON.stringify(b)
|
@@ -5638,7 +5692,10 @@ var useResolvedFields = () => {
|
|
5638
5692
|
useEffect17(() => {
|
5639
5693
|
triggerResolver();
|
5640
5694
|
}, []);
|
5641
|
-
|
5695
|
+
if (resolvedFields.id !== (selectedItem == null ? void 0 : selectedItem.props.id) && !_skipIdCheck) {
|
5696
|
+
return [defaultFields, fieldsLoading];
|
5697
|
+
}
|
5698
|
+
return [resolvedFields.fields, fieldsLoading];
|
5642
5699
|
};
|
5643
5700
|
|
5644
5701
|
// components/Puck/components/Fields/index.tsx
|
@@ -5795,7 +5852,7 @@ init_react_import();
|
|
5795
5852
|
|
5796
5853
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ComponentList/styles.module.css#css-module
|
5797
5854
|
init_react_import();
|
5798
|
-
var styles_module_default17 = { "ComponentList": "
|
5855
|
+
var styles_module_default17 = { "ComponentList": "_ComponentList_1rrlt_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_1rrlt_5", "ComponentList-content": "_ComponentList-content_1rrlt_9", "ComponentList-title": "_ComponentList-title_1rrlt_17", "ComponentList-titleIcon": "_ComponentList-titleIcon_1rrlt_53" };
|
5799
5856
|
|
5800
5857
|
// components/ComponentList/index.tsx
|
5801
5858
|
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
@@ -6233,13 +6290,14 @@ function Render({
|
|
6233
6290
|
config.root.render,
|
6234
6291
|
__spreadProps(__spreadValues({}, rootProps), {
|
6235
6292
|
puck: {
|
6236
|
-
renderDropZone:
|
6237
|
-
isEditing: false
|
6293
|
+
renderDropZone: DropZonePure,
|
6294
|
+
isEditing: false,
|
6295
|
+
dragRef: null
|
6238
6296
|
},
|
6239
6297
|
title,
|
6240
6298
|
editMode: false,
|
6241
6299
|
id: "puck-root",
|
6242
|
-
children: /* @__PURE__ */ jsx32(
|
6300
|
+
children: /* @__PURE__ */ jsx32(DropZonePure, { zone: rootDroppableId })
|
6243
6301
|
})
|
6244
6302
|
)
|
6245
6303
|
}
|
@@ -6255,7 +6313,7 @@ function Render({
|
|
6255
6313
|
depth: 0,
|
6256
6314
|
path: []
|
6257
6315
|
},
|
6258
|
-
children: /* @__PURE__ */ jsx32(
|
6316
|
+
children: /* @__PURE__ */ jsx32(DropZonePure, { zone: rootDroppableId })
|
6259
6317
|
}
|
6260
6318
|
);
|
6261
6319
|
}
|
@@ -6269,21 +6327,8 @@ var useBubbleIframeEvents = (ref) => {
|
|
6269
6327
|
var _a;
|
6270
6328
|
if (ref.current && status === "READY") {
|
6271
6329
|
const iframe = ref.current;
|
6272
|
-
class BubbledPointerEventClass extends PointerEvent {
|
6273
|
-
constructor(type, data) {
|
6274
|
-
super(type, data);
|
6275
|
-
this._originalTarget = null;
|
6276
|
-
this.originalTarget = data.originalTarget;
|
6277
|
-
}
|
6278
|
-
set originalTarget(target) {
|
6279
|
-
this._originalTarget = target;
|
6280
|
-
}
|
6281
|
-
get originalTarget() {
|
6282
|
-
return this._originalTarget;
|
6283
|
-
}
|
6284
|
-
}
|
6285
6330
|
const handlePointerMove = (event) => {
|
6286
|
-
const evt = new
|
6331
|
+
const evt = new BubbledPointerEvent("pointermove", __spreadProps(__spreadValues({}, event), {
|
6287
6332
|
bubbles: true,
|
6288
6333
|
cancelable: false,
|
6289
6334
|
clientX: event.clientX,
|
@@ -6328,12 +6373,12 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
6328
6373
|
Page,
|
6329
6374
|
__spreadProps(__spreadValues({}, rootProps), {
|
6330
6375
|
puck: {
|
6331
|
-
renderDropZone:
|
6376
|
+
renderDropZone: DropZonePure,
|
6332
6377
|
isEditing: true,
|
6333
6378
|
dragRef: null
|
6334
6379
|
},
|
6335
6380
|
editMode: true,
|
6336
|
-
children: /* @__PURE__ */ jsx33(
|
6381
|
+
children: /* @__PURE__ */ jsx33(DropZonePure, { zone: rootDroppableId })
|
6337
6382
|
})
|
6338
6383
|
) : /* @__PURE__ */ jsx33(Render, { data: state.data, config });
|
6339
6384
|
return /* @__PURE__ */ jsx33(
|
@@ -6405,7 +6450,7 @@ init_react_import();
|
|
6405
6450
|
|
6406
6451
|
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css#css-module
|
6407
6452
|
init_react_import();
|
6408
|
-
var styles_module_default19 = { "LayerTree": "
|
6453
|
+
var styles_module_default19 = { "LayerTree": "_LayerTree_7rx04_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_7rx04_11", "LayerTree-helper": "_LayerTree-helper_7rx04_17", "Layer": "_Layer_7rx04_1", "Layer-inner": "_Layer-inner_7rx04_29", "Layer--containsZone": "_Layer--containsZone_7rx04_35", "Layer-clickable": "_Layer-clickable_7rx04_39", "Layer--isSelected": "_Layer--isSelected_7rx04_61", "Layer-chevron": "_Layer-chevron_7rx04_77", "Layer--childIsSelected": "_Layer--childIsSelected_7rx04_78", "Layer-zones": "_Layer-zones_7rx04_82", "Layer-title": "_Layer-title_7rx04_96", "Layer-name": "_Layer-name_7rx04_105", "Layer-icon": "_Layer-icon_7rx04_111", "Layer-zoneIcon": "_Layer-zoneIcon_7rx04_116" };
|
6409
6454
|
|
6410
6455
|
// lib/scroll-into-view.ts
|
6411
6456
|
init_react_import();
|
@@ -6887,7 +6932,7 @@ import { useEffect as useEffect21, useMemo as useMemo16, useState as useState23
|
|
6887
6932
|
|
6888
6933
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
|
6889
6934
|
init_react_import();
|
6890
|
-
var styles_module_default20 = { "ViewportControls": "
|
6935
|
+
var styles_module_default20 = { "ViewportControls": "_ViewportControls_gejzr_1", "ViewportControls-divider": "_ViewportControls-divider_gejzr_15", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_gejzr_21", "ViewportButton--isActive": "_ViewportButton--isActive_gejzr_38", "ViewportButton-inner": "_ViewportButton-inner_gejzr_38" };
|
6891
6936
|
|
6892
6937
|
// components/ViewportControls/index.tsx
|
6893
6938
|
import { jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
@@ -7302,6 +7347,11 @@ var usePreviewModeHotkeys = (dispatch, iframeEnabled) => {
|
|
7302
7347
|
preventDefault: true,
|
7303
7348
|
document: resolvedFrame
|
7304
7349
|
});
|
7350
|
+
useHotkeys2("ctrl+i", toggleInteractive, { preventDefault: true });
|
7351
|
+
useHotkeys2("ctrl+i", toggleInteractiveIframe, {
|
7352
|
+
preventDefault: true,
|
7353
|
+
document: resolvedFrame
|
7354
|
+
});
|
7305
7355
|
};
|
7306
7356
|
|
7307
7357
|
// components/Puck/index.tsx
|
@@ -7776,14 +7826,12 @@ export {
|
|
7776
7826
|
Button,
|
7777
7827
|
Drawer,
|
7778
7828
|
DropZone,
|
7779
|
-
DropZoneProvider,
|
7780
7829
|
FieldLabel,
|
7781
7830
|
Group,
|
7782
7831
|
IconButton,
|
7783
7832
|
Label,
|
7784
7833
|
Puck,
|
7785
7834
|
Render,
|
7786
|
-
dropZoneContext,
|
7787
7835
|
migrate,
|
7788
7836
|
overrideKeys,
|
7789
7837
|
resolveAllData,
|
@@ -182,7 +182,7 @@ type Config<Props extends DefaultComponentProps = DefaultComponentProps, RootPro
|
|
182
182
|
components: {
|
183
183
|
[ComponentName in keyof Props]: Omit<ComponentConfig<Props[ComponentName], Props[ComponentName]>, "type">;
|
184
184
|
};
|
185
|
-
root?: Partial<ComponentConfig<
|
185
|
+
root?: Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
|
186
186
|
};
|
187
187
|
|
188
188
|
type WithId<Props> = Props & {
|
@@ -459,4 +459,4 @@ type PuckAction = {
|
|
459
459
|
|
460
460
|
declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
|
461
461
|
|
462
|
-
export { type
|
462
|
+
export { type DefaultRootRenderProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type ExtractPropsFromConfig as E, type FieldProps as F, type TextareaField as G, type History as H, type IframeConfig as I, type RadioField as J, type ArrayField as K, type ObjectField as L, type MappedItem as M, type NumberField as N, type OnAction as O, type Permissions as P, type Adaptor as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ExternalFieldWithAdaptor as W, type ExternalField as X, type CustomField as Y, type Fields as Z, type PuckContext as _, type Field as a, type DefaultRootProps as a0, type WithId as a1, type WithPuckProps as a2, type AsFieldProps as a3, type WithChildren as a4, resolveAllData as a5, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type DefaultComponentProps as h, type DefaultRootFieldProps as i, type ExtractRootPropsFromConfig as j, type ComponentDataMap as k, type Direction as l, type DragAxis as m, type Viewport as n, overrideKeys as o, type OverrideKey as p, type FieldRenderFunctions as q, type ItemWithId as r, type ArrayState as s, type PuckComponent as t, type ComponentConfig as u, type RootDataWithoutProps as v, type RootData as w, type ComponentData as x, type Content as y, type BaseField as z };
|
@@ -182,7 +182,7 @@ type Config<Props extends DefaultComponentProps = DefaultComponentProps, RootPro
|
|
182
182
|
components: {
|
183
183
|
[ComponentName in keyof Props]: Omit<ComponentConfig<Props[ComponentName], Props[ComponentName]>, "type">;
|
184
184
|
};
|
185
|
-
root?: Partial<ComponentConfig<
|
185
|
+
root?: Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
|
186
186
|
};
|
187
187
|
|
188
188
|
type WithId<Props> = Props & {
|
@@ -459,4 +459,4 @@ type PuckAction = {
|
|
459
459
|
|
460
460
|
declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
|
461
461
|
|
462
|
-
export { type
|
462
|
+
export { type DefaultRootRenderProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type ExtractPropsFromConfig as E, type FieldProps as F, type TextareaField as G, type History as H, type IframeConfig as I, type RadioField as J, type ArrayField as K, type ObjectField as L, type MappedItem as M, type NumberField as N, type OnAction as O, type Permissions as P, type Adaptor as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ExternalFieldWithAdaptor as W, type ExternalField as X, type CustomField as Y, type Fields as Z, type PuckContext as _, type Field as a, type DefaultRootProps as a0, type WithId as a1, type WithPuckProps as a2, type AsFieldProps as a3, type WithChildren as a4, resolveAllData as a5, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type DefaultComponentProps as h, type DefaultRootFieldProps as i, type ExtractRootPropsFromConfig as j, type ComponentDataMap as k, type Direction as l, type DragAxis as m, type Viewport as n, overrideKeys as o, type OverrideKey as p, type FieldRenderFunctions as q, type ItemWithId as r, type ArrayState as s, type PuckComponent as t, type ComponentConfig as u, type RootDataWithoutProps as v, type RootData as w, type ComponentData as x, type Content as y, type BaseField as z };
|
package/dist/rsc.d.mts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import { C as Config,
|
3
|
-
export {
|
2
|
+
import { C as Config, U as UserGenerics } from './resolve-all-data-C-cc7ftj.mjs';
|
3
|
+
export { a5 as resolveAllData } from './resolve-all-data-C-cc7ftj.mjs';
|
4
4
|
import 'react';
|
5
5
|
|
6
|
-
declare function Render<UserConfig extends Config = Config>({ config, data
|
6
|
+
declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data }: {
|
7
7
|
config: UserConfig;
|
8
|
-
data:
|
8
|
+
data: G["UserData"];
|
9
9
|
}): react_jsx_runtime.JSX.Element;
|
10
10
|
|
11
11
|
export { Render };
|
package/dist/rsc.d.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import { C as Config,
|
3
|
-
export {
|
2
|
+
import { C as Config, U as UserGenerics } from './resolve-all-data-C-cc7ftj.js';
|
3
|
+
export { a5 as resolveAllData } from './resolve-all-data-C-cc7ftj.js';
|
4
4
|
import 'react';
|
5
5
|
|
6
|
-
declare function Render<UserConfig extends Config = Config>({ config, data
|
6
|
+
declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data }: {
|
7
7
|
config: UserConfig;
|
8
|
-
data:
|
8
|
+
data: G["UserData"];
|
9
9
|
}): react_jsx_runtime.JSX.Element;
|
10
10
|
|
11
11
|
export { Render };
|
package/dist/rsc.js
CHANGED
@@ -131,10 +131,7 @@ function DropZoneRender({
|
|
131
131
|
return null;
|
132
132
|
}) });
|
133
133
|
}
|
134
|
-
function Render({
|
135
|
-
config,
|
136
|
-
data
|
137
|
-
}) {
|
134
|
+
function Render({ config, data }) {
|
138
135
|
var _a;
|
139
136
|
if ((_a = config.root) == null ? void 0 : _a.render) {
|
140
137
|
const rootProps = data.root.props || data.root;
|
@@ -144,7 +141,8 @@ function Render({
|
|
144
141
|
__spreadProps(__spreadValues({}, rootProps), {
|
145
142
|
puck: {
|
146
143
|
renderDropZone: ({ zone }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropZoneRender, { zone, data, config }),
|
147
|
-
isEditing: false
|
144
|
+
isEditing: false,
|
145
|
+
dragRef: null
|
148
146
|
},
|
149
147
|
title,
|
150
148
|
editMode: false,
|
package/dist/rsc.mjs
CHANGED
@@ -52,10 +52,7 @@ function DropZoneRender({
|
|
52
52
|
return null;
|
53
53
|
}) });
|
54
54
|
}
|
55
|
-
function Render({
|
56
|
-
config,
|
57
|
-
data
|
58
|
-
}) {
|
55
|
+
function Render({ config, data }) {
|
59
56
|
var _a;
|
60
57
|
if ((_a = config.root) == null ? void 0 : _a.render) {
|
61
58
|
const rootProps = data.root.props || data.root;
|
@@ -65,7 +62,8 @@ function Render({
|
|
65
62
|
__spreadProps(__spreadValues({}, rootProps), {
|
66
63
|
puck: {
|
67
64
|
renderDropZone: ({ zone }) => /* @__PURE__ */ jsx(DropZoneRender, { zone, data, config }),
|
68
|
-
isEditing: false
|
65
|
+
isEditing: false,
|
66
|
+
dragRef: null
|
69
67
|
},
|
70
68
|
title,
|
71
69
|
editMode: false,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck",
|
3
|
-
"version": "0.18.
|
3
|
+
"version": "0.18.2-canary.23c8dda",
|
4
4
|
"author": "Measured Corporation Ltd <hello@measured.co>",
|
5
5
|
"repository": "measuredco/puck",
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
@@ -68,8 +68,8 @@
|
|
68
68
|
"typescript": "^5.5.4"
|
69
69
|
},
|
70
70
|
"dependencies": {
|
71
|
-
"@dnd-kit/helpers": "0.0.
|
72
|
-
"@dnd-kit/react": "0.0.
|
71
|
+
"@dnd-kit/helpers": "0.0.7-beta-20250130032138",
|
72
|
+
"@dnd-kit/react": "0.0.7-beta-20250130032138",
|
73
73
|
"deep-diff": "^1.0.2",
|
74
74
|
"object-hash": "^3.0.0",
|
75
75
|
"react-hotkeys-hook": "^4.6.1",
|