@measured/puck 0.18.1-canary.f077a37 → 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/README.md +2 -2
- package/dist/index.css +236 -230
- package/dist/index.d.mts +3 -45
- package/dist/index.d.ts +3 -45
- package/dist/index.js +91 -45
- package/dist/index.mjs +91 -43
- 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.d.mts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import { F as FieldProps, a as Field,
|
2
|
-
export {
|
1
|
+
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, j as ExtractRootPropsFromConfig, k as ComponentDataMap } from './resolve-all-data-C-cc7ftj.mjs';
|
2
|
+
export { Q as Adaptor, K as ArrayField, s as ArrayState, a3 as AsFieldProps, B as BaseData, z as BaseField, u as ComponentConfig, x as ComponentData, y as Content, Y as CustomField, a0 as DefaultRootProps, $ as DefaultRootRenderProps, l as Direction, m as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, q as FieldRenderFunctions, Z as Fields, r as ItemWithId, M as MappedItem, N as NumberField, L as ObjectField, p as OverrideKey, t as PuckComponent, _ as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, n as Viewport, a4 as WithChildren, a1 as WithId, a2 as WithPuckProps, o as overrideKeys, a5 as resolveAllData } from './resolve-all-data-C-cc7ftj.mjs';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
6
|
-
import { UniqueIdentifier } from '@dnd-kit/abstract';
|
7
6
|
|
8
7
|
declare const ActionBar: {
|
9
8
|
({ label, children, }: {
|
@@ -79,47 +78,6 @@ declare const Drawer: {
|
|
79
78
|
}) => react_jsx_runtime.JSX.Element;
|
80
79
|
};
|
81
80
|
|
82
|
-
type PathData = Record<string, {
|
83
|
-
path: string[];
|
84
|
-
label: string;
|
85
|
-
}>;
|
86
|
-
type DropZoneContext<UserConfig extends Config = Config> = {
|
87
|
-
data: Data;
|
88
|
-
config: UserConfig;
|
89
|
-
componentState?: Record<string, any>;
|
90
|
-
itemSelector?: ItemSelector | null;
|
91
|
-
setItemSelector?: (newIndex: ItemSelector | null) => void;
|
92
|
-
areaId?: string;
|
93
|
-
zoneCompound?: string;
|
94
|
-
index?: number;
|
95
|
-
hoveringComponent?: string | null;
|
96
|
-
setHoveringComponent?: (id: string | null) => void;
|
97
|
-
registerZoneArea?: (areaId: string) => void;
|
98
|
-
areasWithZones?: Record<string, boolean>;
|
99
|
-
registerZone?: (zoneCompound: string) => void;
|
100
|
-
unregisterZone?: (zoneCompound: string) => void;
|
101
|
-
activeZones?: Record<string, boolean>;
|
102
|
-
pathData?: PathData;
|
103
|
-
registerPath?: (id: string, selector: ItemSelector, label: string) => void;
|
104
|
-
unregisterPath?: (id: string) => void;
|
105
|
-
mode?: "edit" | "render";
|
106
|
-
depth: number;
|
107
|
-
registerLocalZone?: (zone: string, active: boolean) => void;
|
108
|
-
unregisterLocalZone?: (zone: string) => void;
|
109
|
-
path: string[];
|
110
|
-
} | null;
|
111
|
-
declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
|
112
|
-
declare const DropZoneProvider: ({ children, value, }: {
|
113
|
-
children: ReactNode;
|
114
|
-
value: DropZoneContext;
|
115
|
-
}) => react_jsx_runtime.JSX.Element;
|
116
|
-
|
117
|
-
type DropZoneDndData = {
|
118
|
-
areaId?: string;
|
119
|
-
depth: number;
|
120
|
-
path: UniqueIdentifier[];
|
121
|
-
isDroppableTarget: boolean;
|
122
|
-
};
|
123
81
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
124
82
|
|
125
83
|
declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
@@ -236,4 +194,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
|
|
236
194
|
selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
|
237
195
|
};
|
238
196
|
|
239
|
-
export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone,
|
197
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, migrate, transformProps, usePuck };
|
package/dist/index.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import { F as FieldProps, a as Field,
|
2
|
-
export {
|
1
|
+
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, j as ExtractRootPropsFromConfig, k as ComponentDataMap } from './resolve-all-data-C-cc7ftj.js';
|
2
|
+
export { Q as Adaptor, K as ArrayField, s as ArrayState, a3 as AsFieldProps, B as BaseData, z as BaseField, u as ComponentConfig, x as ComponentData, y as Content, Y as CustomField, a0 as DefaultRootProps, $ as DefaultRootRenderProps, l as Direction, m as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, q as FieldRenderFunctions, Z as Fields, r as ItemWithId, M as MappedItem, N as NumberField, L as ObjectField, p as OverrideKey, t as PuckComponent, _ as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, n as Viewport, a4 as WithChildren, a1 as WithId, a2 as WithPuckProps, o as overrideKeys, a5 as resolveAllData } from './resolve-all-data-C-cc7ftj.js';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
6
|
-
import { UniqueIdentifier } from '@dnd-kit/abstract';
|
7
6
|
|
8
7
|
declare const ActionBar: {
|
9
8
|
({ label, children, }: {
|
@@ -79,47 +78,6 @@ declare const Drawer: {
|
|
79
78
|
}) => react_jsx_runtime.JSX.Element;
|
80
79
|
};
|
81
80
|
|
82
|
-
type PathData = Record<string, {
|
83
|
-
path: string[];
|
84
|
-
label: string;
|
85
|
-
}>;
|
86
|
-
type DropZoneContext<UserConfig extends Config = Config> = {
|
87
|
-
data: Data;
|
88
|
-
config: UserConfig;
|
89
|
-
componentState?: Record<string, any>;
|
90
|
-
itemSelector?: ItemSelector | null;
|
91
|
-
setItemSelector?: (newIndex: ItemSelector | null) => void;
|
92
|
-
areaId?: string;
|
93
|
-
zoneCompound?: string;
|
94
|
-
index?: number;
|
95
|
-
hoveringComponent?: string | null;
|
96
|
-
setHoveringComponent?: (id: string | null) => void;
|
97
|
-
registerZoneArea?: (areaId: string) => void;
|
98
|
-
areasWithZones?: Record<string, boolean>;
|
99
|
-
registerZone?: (zoneCompound: string) => void;
|
100
|
-
unregisterZone?: (zoneCompound: string) => void;
|
101
|
-
activeZones?: Record<string, boolean>;
|
102
|
-
pathData?: PathData;
|
103
|
-
registerPath?: (id: string, selector: ItemSelector, label: string) => void;
|
104
|
-
unregisterPath?: (id: string) => void;
|
105
|
-
mode?: "edit" | "render";
|
106
|
-
depth: number;
|
107
|
-
registerLocalZone?: (zone: string, active: boolean) => void;
|
108
|
-
unregisterLocalZone?: (zone: string) => void;
|
109
|
-
path: string[];
|
110
|
-
} | null;
|
111
|
-
declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
|
112
|
-
declare const DropZoneProvider: ({ children, value, }: {
|
113
|
-
children: ReactNode;
|
114
|
-
value: DropZoneContext;
|
115
|
-
}) => react_jsx_runtime.JSX.Element;
|
116
|
-
|
117
|
-
type DropZoneDndData = {
|
118
|
-
areaId?: string;
|
119
|
-
depth: number;
|
120
|
-
path: UniqueIdentifier[];
|
121
|
-
isDroppableTarget: boolean;
|
122
|
-
};
|
123
81
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
124
82
|
|
125
83
|
declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
@@ -236,4 +194,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
|
|
236
194
|
selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
|
237
195
|
};
|
238
196
|
|
239
|
-
export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone,
|
197
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, migrate, transformProps, usePuck };
|
package/dist/index.js
CHANGED
@@ -169,14 +169,12 @@ __export(core_exports, {
|
|
169
169
|
Button: () => Button,
|
170
170
|
Drawer: () => Drawer,
|
171
171
|
DropZone: () => DropZone,
|
172
|
-
DropZoneProvider: () => DropZoneProvider,
|
173
172
|
FieldLabel: () => FieldLabel,
|
174
173
|
Group: () => Group,
|
175
174
|
IconButton: () => IconButton,
|
176
175
|
Label: () => Label,
|
177
176
|
Puck: () => Puck,
|
178
177
|
Render: () => Render,
|
179
|
-
dropZoneContext: () => dropZoneContext,
|
180
178
|
migrate: () => migrate,
|
181
179
|
overrideKeys: () => overrideKeys,
|
182
180
|
resolveAllData: () => resolveAllData,
|
@@ -262,7 +260,7 @@ var get_class_name_factory_default = getClassNameFactory;
|
|
262
260
|
|
263
261
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css#css-module
|
264
262
|
init_react_import();
|
265
|
-
var styles_module_default = { "ActionBar": "
|
263
|
+
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" };
|
266
264
|
|
267
265
|
// components/ActionBar/index.tsx
|
268
266
|
var import_jsx_runtime = require("react/jsx-runtime");
|
@@ -308,7 +306,7 @@ init_react_import();
|
|
308
306
|
|
309
307
|
// css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/styles.module.css#css-module
|
310
308
|
init_react_import();
|
311
|
-
var styles_module_default2 = { "InputWrapper": "
|
309
|
+
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" };
|
312
310
|
|
313
311
|
// components/AutoField/index.tsx
|
314
312
|
var import_react20 = require("react");
|
@@ -1757,7 +1755,7 @@ var import_react15 = require("react");
|
|
1757
1755
|
|
1758
1756
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
|
1759
1757
|
init_react_import();
|
1760
|
-
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-
|
1758
|
+
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" };
|
1761
1759
|
|
1762
1760
|
// components/Modal/index.tsx
|
1763
1761
|
init_react_import();
|
@@ -1828,7 +1826,7 @@ var import_react14 = require("react");
|
|
1828
1826
|
|
1829
1827
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Button/Button.module.css#css-module
|
1830
1828
|
init_react_import();
|
1831
|
-
var Button_module_default = { "Button": "
|
1829
|
+
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" };
|
1832
1830
|
|
1833
1831
|
// lib/filter-data-attrs.ts
|
1834
1832
|
init_react_import();
|
@@ -3247,14 +3245,14 @@ var DraggableComponent = ({
|
|
3247
3245
|
setStyle(getStyle());
|
3248
3246
|
}, [ref.current, iframe]);
|
3249
3247
|
(0, import_react23.useEffect)(() => {
|
3250
|
-
if (ref.current) {
|
3248
|
+
if (ref.current && !userIsDragging) {
|
3251
3249
|
const observer = new ResizeObserver(sync);
|
3252
3250
|
observer.observe(ref.current);
|
3253
3251
|
return () => {
|
3254
3252
|
observer.disconnect();
|
3255
3253
|
};
|
3256
3254
|
}
|
3257
|
-
}, [ref.current]);
|
3255
|
+
}, [ref.current, userIsDragging]);
|
3258
3256
|
(0, import_react23.useEffect)(() => {
|
3259
3257
|
ctx == null ? void 0 : ctx.registerPath(
|
3260
3258
|
id,
|
@@ -3961,6 +3959,7 @@ var DropZoneRender = (0, import_react29.forwardRef)(
|
|
3961
3959
|
}) });
|
3962
3960
|
}
|
3963
3961
|
);
|
3962
|
+
var DropZonePure = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropZone, __spreadValues({}, props));
|
3964
3963
|
var DropZone = (0, import_react29.forwardRef)(
|
3965
3964
|
function DropZone2(props, ref) {
|
3966
3965
|
const ctx = (0, import_react29.useContext)(dropZoneContext);
|
@@ -4067,6 +4066,25 @@ var GlobalPosition = class {
|
|
4067
4066
|
}
|
4068
4067
|
};
|
4069
4068
|
|
4069
|
+
// lib/bubble-pointer-event.ts
|
4070
|
+
init_react_import();
|
4071
|
+
var BaseEvent = typeof PointerEvent !== "undefined" ? PointerEvent : Event;
|
4072
|
+
var BubbledPointerEvent = class extends BaseEvent {
|
4073
|
+
constructor(type, data) {
|
4074
|
+
super(type, data);
|
4075
|
+
this._originalTarget = null;
|
4076
|
+
this.originalTarget = data.originalTarget;
|
4077
|
+
}
|
4078
|
+
// Necessary for Firefox
|
4079
|
+
set originalTarget(target) {
|
4080
|
+
this._originalTarget = target;
|
4081
|
+
}
|
4082
|
+
// Necessary for Firefox
|
4083
|
+
get originalTarget() {
|
4084
|
+
return this._originalTarget;
|
4085
|
+
}
|
4086
|
+
};
|
4087
|
+
|
4070
4088
|
// lib/dnd/NestedDroppablePlugin.ts
|
4071
4089
|
var depthSort = (candidates) => {
|
4072
4090
|
return candidates.sort((a, b) => {
|
@@ -4191,7 +4209,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
4191
4209
|
}
|
4192
4210
|
const cleanupEffect = (0, import_state.effects)(() => {
|
4193
4211
|
const handleMove = (event) => {
|
4194
|
-
const target = event.originalTarget || event.target;
|
4212
|
+
const target = event instanceof BubbledPointerEvent ? event.originalTarget || event.target : event.target;
|
4195
4213
|
const position = new GlobalPosition(target, {
|
4196
4214
|
x: event.clientX,
|
4197
4215
|
y: event.clientY
|
@@ -4891,6 +4909,19 @@ function patchWindow(window2) {
|
|
4891
4909
|
|
4892
4910
|
// components/DragDropContext/index.tsx
|
4893
4911
|
var import_zustand3 = require("zustand");
|
4912
|
+
|
4913
|
+
// lib/get-deep-dir.ts
|
4914
|
+
init_react_import();
|
4915
|
+
function getDeepDir(el) {
|
4916
|
+
function findDir(node) {
|
4917
|
+
if (!node) return "ltr";
|
4918
|
+
const d = node.getAttribute("dir");
|
4919
|
+
return d || findDir(node.parentElement);
|
4920
|
+
}
|
4921
|
+
return el ? findDir(el) : "ltr";
|
4922
|
+
}
|
4923
|
+
|
4924
|
+
// components/DragDropContext/index.tsx
|
4894
4925
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
4895
4926
|
var DEBUG3 = false;
|
4896
4927
|
var dragListenerContext = (0, import_react31.createContext)({
|
@@ -5184,7 +5215,8 @@ var DragDropContextClient = ({
|
|
5184
5215
|
targetZone = targetData.zone;
|
5185
5216
|
targetIndex = targetData.index;
|
5186
5217
|
const collisionData = (_c = (_b = manager.dragOperation.data) == null ? void 0 : _b.collisionMap) == null ? void 0 : _c[targetId];
|
5187
|
-
const
|
5218
|
+
const dir = getDeepDir(target.element);
|
5219
|
+
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";
|
5188
5220
|
if (targetIndex >= sourceIndex && sourceZone === targetZone) {
|
5189
5221
|
targetIndex = targetIndex - 1;
|
5190
5222
|
}
|
@@ -5448,7 +5480,7 @@ init_react_import();
|
|
5448
5480
|
|
5449
5481
|
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
5450
5482
|
init_react_import();
|
5451
|
-
var styles_module_default13 = { "SidebarSection": "
|
5483
|
+
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" };
|
5452
5484
|
|
5453
5485
|
// lib/use-breadcrumbs.ts
|
5454
5486
|
init_react_import();
|
@@ -5627,7 +5659,7 @@ function MenuBar({
|
|
5627
5659
|
|
5628
5660
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Puck/styles.module.css#css-module
|
5629
5661
|
init_react_import();
|
5630
|
-
var styles_module_default15 = { "Puck": "
|
5662
|
+
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" };
|
5631
5663
|
|
5632
5664
|
// components/Puck/components/Fields/index.tsx
|
5633
5665
|
init_react_import();
|
@@ -5689,7 +5721,10 @@ var selectorIs = (a, b) => (a == null ? void 0 : a.zone) === (b == null ? void 0
|
|
5689
5721
|
var defaultPageFields = {
|
5690
5722
|
title: { type: "text" }
|
5691
5723
|
};
|
5692
|
-
var useResolvedFields = (
|
5724
|
+
var useResolvedFields = ({
|
5725
|
+
_skipValueCheck,
|
5726
|
+
_skipIdCheck
|
5727
|
+
} = {}) => {
|
5693
5728
|
var _a, _b;
|
5694
5729
|
const { selectedItem, state, config } = useAppContext();
|
5695
5730
|
const parent = useParent();
|
@@ -5702,11 +5737,17 @@ var useResolvedFields = () => {
|
|
5702
5737
|
);
|
5703
5738
|
const rootProps = data.root.props || data.root;
|
5704
5739
|
const [lastSelectedData, setLastSelectedData] = (0, import_react36.useState)({});
|
5705
|
-
const [resolvedFields, setResolvedFields] = (0, import_react36.useState)(
|
5740
|
+
const [resolvedFields, setResolvedFields] = (0, import_react36.useState)({
|
5741
|
+
fields: defaultFields,
|
5742
|
+
id: selectedItem == null ? void 0 : selectedItem.props.id
|
5743
|
+
});
|
5706
5744
|
const [fieldsLoading, setFieldsLoading] = (0, import_react36.useState)(false);
|
5707
5745
|
const lastFields = (0, import_react36.useRef)(defaultFields);
|
5708
5746
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
5709
|
-
const componentData =
|
5747
|
+
const componentData = (0, import_react36.useMemo)(
|
5748
|
+
() => selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly || {} },
|
5749
|
+
[selectedItem, rootProps, data.root.readOnly]
|
5750
|
+
);
|
5710
5751
|
const hasComponentResolver = selectedItem && (componentConfig == null ? void 0 : componentConfig.resolveFields);
|
5711
5752
|
const hasRootResolver = !selectedItem && ((_b = config.root) == null ? void 0 : _b.resolveFields);
|
5712
5753
|
const hasResolver = hasComponentResolver || hasRootResolver;
|
@@ -5754,15 +5795,25 @@ var useResolvedFields = () => {
|
|
5754
5795
|
if (hasResolver) {
|
5755
5796
|
setFieldsLoading(true);
|
5756
5797
|
resolveFields(defaultFields).then((fields) => {
|
5757
|
-
setResolvedFields(
|
5798
|
+
setResolvedFields({
|
5799
|
+
fields: fields || {},
|
5800
|
+
id: selectedItem == null ? void 0 : selectedItem.props.id
|
5801
|
+
});
|
5758
5802
|
lastFields.current = fields;
|
5759
5803
|
setFieldsLoading(false);
|
5760
5804
|
});
|
5761
5805
|
return;
|
5762
5806
|
}
|
5763
5807
|
}
|
5764
|
-
setResolvedFields(defaultFields);
|
5765
|
-
}, [
|
5808
|
+
setResolvedFields({ fields: defaultFields, id: selectedItem == null ? void 0 : selectedItem.props.id });
|
5809
|
+
}, [
|
5810
|
+
defaultFields,
|
5811
|
+
state.ui.itemSelector,
|
5812
|
+
selectedItem,
|
5813
|
+
hasResolver,
|
5814
|
+
parent,
|
5815
|
+
resolveFields
|
5816
|
+
]);
|
5766
5817
|
useOnValueChange(
|
5767
5818
|
state.ui.itemSelector,
|
5768
5819
|
() => {
|
@@ -5773,6 +5824,7 @@ var useResolvedFields = () => {
|
|
5773
5824
|
useOnValueChange(
|
5774
5825
|
{ data, parent, itemSelector: state.ui.itemSelector },
|
5775
5826
|
() => {
|
5827
|
+
if (_skipValueCheck) return;
|
5776
5828
|
triggerResolver();
|
5777
5829
|
},
|
5778
5830
|
(a, b) => JSON.stringify(a) === JSON.stringify(b)
|
@@ -5780,7 +5832,10 @@ var useResolvedFields = () => {
|
|
5780
5832
|
(0, import_react36.useEffect)(() => {
|
5781
5833
|
triggerResolver();
|
5782
5834
|
}, []);
|
5783
|
-
|
5835
|
+
if (resolvedFields.id !== (selectedItem == null ? void 0 : selectedItem.props.id) && !_skipIdCheck) {
|
5836
|
+
return [defaultFields, fieldsLoading];
|
5837
|
+
}
|
5838
|
+
return [resolvedFields.fields, fieldsLoading];
|
5784
5839
|
};
|
5785
5840
|
|
5786
5841
|
// components/Puck/components/Fields/index.tsx
|
@@ -5832,7 +5887,7 @@ var Fields = ({ wrapFields = true }) => {
|
|
5832
5887
|
const newProps = __spreadProps(__spreadValues({}, currentProps), {
|
5833
5888
|
[fieldName]: value
|
5834
5889
|
});
|
5835
|
-
if (itemSelector) {
|
5890
|
+
if (selectedItem && itemSelector) {
|
5836
5891
|
const replaceActionData = {
|
5837
5892
|
type: "replace",
|
5838
5893
|
destinationIndex: itemSelector.index,
|
@@ -5937,7 +5992,7 @@ init_react_import();
|
|
5937
5992
|
|
5938
5993
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ComponentList/styles.module.css#css-module
|
5939
5994
|
init_react_import();
|
5940
|
-
var styles_module_default17 = { "ComponentList": "
|
5995
|
+
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" };
|
5941
5996
|
|
5942
5997
|
// components/ComponentList/index.tsx
|
5943
5998
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
@@ -6370,13 +6425,14 @@ function Render({
|
|
6370
6425
|
config.root.render,
|
6371
6426
|
__spreadProps(__spreadValues({}, rootProps), {
|
6372
6427
|
puck: {
|
6373
|
-
renderDropZone:
|
6374
|
-
isEditing: false
|
6428
|
+
renderDropZone: DropZonePure,
|
6429
|
+
isEditing: false,
|
6430
|
+
dragRef: null
|
6375
6431
|
},
|
6376
6432
|
title,
|
6377
6433
|
editMode: false,
|
6378
6434
|
id: "puck-root",
|
6379
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
6435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DropZonePure, { zone: rootDroppableId })
|
6380
6436
|
})
|
6381
6437
|
)
|
6382
6438
|
}
|
@@ -6392,7 +6448,7 @@ function Render({
|
|
6392
6448
|
depth: 0,
|
6393
6449
|
path: []
|
6394
6450
|
},
|
6395
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
6451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DropZonePure, { zone: rootDroppableId })
|
6396
6452
|
}
|
6397
6453
|
);
|
6398
6454
|
}
|
@@ -6406,21 +6462,8 @@ var useBubbleIframeEvents = (ref) => {
|
|
6406
6462
|
var _a;
|
6407
6463
|
if (ref.current && status === "READY") {
|
6408
6464
|
const iframe = ref.current;
|
6409
|
-
class BubbledPointerEventClass extends PointerEvent {
|
6410
|
-
constructor(type, data) {
|
6411
|
-
super(type, data);
|
6412
|
-
this._originalTarget = null;
|
6413
|
-
this.originalTarget = data.originalTarget;
|
6414
|
-
}
|
6415
|
-
set originalTarget(target) {
|
6416
|
-
this._originalTarget = target;
|
6417
|
-
}
|
6418
|
-
get originalTarget() {
|
6419
|
-
return this._originalTarget;
|
6420
|
-
}
|
6421
|
-
}
|
6422
6465
|
const handlePointerMove = (event) => {
|
6423
|
-
const evt = new
|
6466
|
+
const evt = new BubbledPointerEvent("pointermove", __spreadProps(__spreadValues({}, event), {
|
6424
6467
|
bubbles: true,
|
6425
6468
|
cancelable: false,
|
6426
6469
|
clientX: event.clientX,
|
@@ -6465,12 +6508,12 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
6465
6508
|
Page,
|
6466
6509
|
__spreadProps(__spreadValues({}, rootProps), {
|
6467
6510
|
puck: {
|
6468
|
-
renderDropZone:
|
6511
|
+
renderDropZone: DropZonePure,
|
6469
6512
|
isEditing: true,
|
6470
6513
|
dragRef: null
|
6471
6514
|
},
|
6472
6515
|
editMode: true,
|
6473
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
6516
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DropZonePure, { zone: rootDroppableId })
|
6474
6517
|
})
|
6475
6518
|
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Render, { data: state.data, config });
|
6476
6519
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
@@ -6542,7 +6585,7 @@ init_react_import();
|
|
6542
6585
|
|
6543
6586
|
// css-module:/home/runner/work/puck/puck/packages/core/components/LayerTree/styles.module.css#css-module
|
6544
6587
|
init_react_import();
|
6545
|
-
var styles_module_default19 = { "LayerTree": "
|
6588
|
+
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" };
|
6546
6589
|
|
6547
6590
|
// lib/scroll-into-view.ts
|
6548
6591
|
init_react_import();
|
@@ -7018,7 +7061,7 @@ var import_react45 = require("react");
|
|
7018
7061
|
|
7019
7062
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
|
7020
7063
|
init_react_import();
|
7021
|
-
var styles_module_default20 = { "ViewportControls": "
|
7064
|
+
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" };
|
7022
7065
|
|
7023
7066
|
// components/ViewportControls/index.tsx
|
7024
7067
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
@@ -7433,6 +7476,11 @@ var usePreviewModeHotkeys = (dispatch, iframeEnabled) => {
|
|
7433
7476
|
preventDefault: true,
|
7434
7477
|
document: resolvedFrame
|
7435
7478
|
});
|
7479
|
+
(0, import_react_hotkeys_hook2.useHotkeys)("ctrl+i", toggleInteractive, { preventDefault: true });
|
7480
|
+
(0, import_react_hotkeys_hook2.useHotkeys)("ctrl+i", toggleInteractiveIframe, {
|
7481
|
+
preventDefault: true,
|
7482
|
+
document: resolvedFrame
|
7483
|
+
});
|
7436
7484
|
};
|
7437
7485
|
|
7438
7486
|
// components/Puck/index.tsx
|
@@ -7948,14 +7996,12 @@ var usePuck = () => {
|
|
7948
7996
|
Button,
|
7949
7997
|
Drawer,
|
7950
7998
|
DropZone,
|
7951
|
-
DropZoneProvider,
|
7952
7999
|
FieldLabel,
|
7953
8000
|
Group,
|
7954
8001
|
IconButton,
|
7955
8002
|
Label,
|
7956
8003
|
Puck,
|
7957
8004
|
Render,
|
7958
|
-
dropZoneContext,
|
7959
8005
|
migrate,
|
7960
8006
|
overrideKeys,
|
7961
8007
|
resolveAllData,
|