@measured/puck 0.18.2-canary.b9ce5b7 → 0.18.2-canary.c22b3a9
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.d.mts +45 -3
- package/dist/index.d.ts +45 -3
- package/dist/index.js +12 -19
- package/dist/index.mjs +10 -19
- package/dist/{resolve-all-data-C-cc7ftj.d.mts → resolve-all-data-DzJEE28m.d.mts} +2 -2
- package/dist/{resolve-all-data-C-cc7ftj.d.ts → resolve-all-data-DzJEE28m.d.ts} +2 -2
- package/dist/rsc.d.mts +4 -4
- package/dist/rsc.d.ts +4 -4
- package/dist/rsc.js +5 -3
- package/dist/rsc.mjs +5 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
import { F as FieldProps, a as Field,
|
2
|
-
export {
|
1
|
+
import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-DzJEE28m.mjs';
|
2
|
+
export { W as Adaptor, L as ArrayField, t as ArrayState, a4 as AsFieldProps, B as BaseData, G as BaseField, v as ComponentConfig, y as ComponentData, z as Content, Z as CustomField, a1 as DefaultRootProps, a0 as DefaultRootRenderProps, m as Direction, n as DragAxis, Y as ExternalField, X as ExternalFieldWithAdaptor, r as FieldRenderFunctions, _ as Fields, s as ItemWithId, M as MappedItem, N as NumberField, Q as ObjectField, q as OverrideKey, u as PuckComponent, $ as PuckContext, K as RadioField, x as RootData, R as RootDataWithProps, w as RootDataWithoutProps, S as SelectField, T as TextField, J as TextareaField, o as Viewport, a5 as WithChildren, a2 as WithId, a3 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-DzJEE28m.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';
|
6
7
|
|
7
8
|
declare const ActionBar: {
|
8
9
|
({ label, children, }: {
|
@@ -78,6 +79,47 @@ declare const Drawer: {
|
|
78
79
|
}) => react_jsx_runtime.JSX.Element;
|
79
80
|
};
|
80
81
|
|
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
|
+
};
|
81
123
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
82
124
|
|
83
125
|
declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
@@ -194,4 +236,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
|
|
194
236
|
selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
|
195
237
|
};
|
196
238
|
|
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 };
|
239
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, type DropZoneDndData, DropZoneProvider, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, dropZoneContext, migrate, transformProps, usePuck };
|
package/dist/index.d.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
import { F as FieldProps, a as Field,
|
2
|
-
export {
|
1
|
+
import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-DzJEE28m.js';
|
2
|
+
export { W as Adaptor, L as ArrayField, t as ArrayState, a4 as AsFieldProps, B as BaseData, G as BaseField, v as ComponentConfig, y as ComponentData, z as Content, Z as CustomField, a1 as DefaultRootProps, a0 as DefaultRootRenderProps, m as Direction, n as DragAxis, Y as ExternalField, X as ExternalFieldWithAdaptor, r as FieldRenderFunctions, _ as Fields, s as ItemWithId, M as MappedItem, N as NumberField, Q as ObjectField, q as OverrideKey, u as PuckComponent, $ as PuckContext, K as RadioField, x as RootData, R as RootDataWithProps, w as RootDataWithoutProps, S as SelectField, T as TextField, J as TextareaField, o as Viewport, a5 as WithChildren, a2 as WithId, a3 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-DzJEE28m.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';
|
6
7
|
|
7
8
|
declare const ActionBar: {
|
8
9
|
({ label, children, }: {
|
@@ -78,6 +79,47 @@ declare const Drawer: {
|
|
78
79
|
}) => react_jsx_runtime.JSX.Element;
|
79
80
|
};
|
80
81
|
|
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
|
+
};
|
81
123
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
82
124
|
|
83
125
|
declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
@@ -194,4 +236,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
|
|
194
236
|
selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
|
195
237
|
};
|
196
238
|
|
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 };
|
239
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, type DropZoneDndData, DropZoneProvider, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, dropZoneContext, migrate, transformProps, usePuck };
|
package/dist/index.js
CHANGED
@@ -169,12 +169,14 @@ __export(core_exports, {
|
|
169
169
|
Button: () => Button,
|
170
170
|
Drawer: () => Drawer,
|
171
171
|
DropZone: () => DropZone,
|
172
|
+
DropZoneProvider: () => DropZoneProvider,
|
172
173
|
FieldLabel: () => FieldLabel,
|
173
174
|
Group: () => Group,
|
174
175
|
IconButton: () => IconButton,
|
175
176
|
Label: () => Label,
|
176
177
|
Puck: () => Puck,
|
177
178
|
Render: () => Render,
|
179
|
+
dropZoneContext: () => dropZoneContext,
|
178
180
|
migrate: () => migrate,
|
179
181
|
overrideKeys: () => overrideKeys,
|
180
182
|
resolveAllData: () => resolveAllData,
|
@@ -3959,7 +3961,6 @@ var DropZoneRender = (0, import_react29.forwardRef)(
|
|
3959
3961
|
}) });
|
3960
3962
|
}
|
3961
3963
|
);
|
3962
|
-
var DropZonePure = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropZone, __spreadValues({}, props));
|
3963
3964
|
var DropZone = (0, import_react29.forwardRef)(
|
3964
3965
|
function DropZone2(props, ref) {
|
3965
3966
|
const ctx = (0, import_react29.useContext)(dropZoneContext);
|
@@ -5724,10 +5725,7 @@ var useResolvedFields = () => {
|
|
5724
5725
|
const [fieldsLoading, setFieldsLoading] = (0, import_react36.useState)(false);
|
5725
5726
|
const lastFields = (0, import_react36.useRef)(defaultFields);
|
5726
5727
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
5727
|
-
const componentData =
|
5728
|
-
() => selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly || {} },
|
5729
|
-
[selectedItem, rootProps, data.root.readOnly]
|
5730
|
-
);
|
5728
|
+
const componentData = selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly };
|
5731
5729
|
const hasComponentResolver = selectedItem && (componentConfig == null ? void 0 : componentConfig.resolveFields);
|
5732
5730
|
const hasRootResolver = !selectedItem && ((_b = config.root) == null ? void 0 : _b.resolveFields);
|
5733
5731
|
const hasResolver = hasComponentResolver || hasRootResolver;
|
@@ -5783,13 +5781,7 @@ var useResolvedFields = () => {
|
|
5783
5781
|
}
|
5784
5782
|
}
|
5785
5783
|
setResolvedFields(defaultFields);
|
5786
|
-
}, [
|
5787
|
-
defaultFields,
|
5788
|
-
state.ui.itemSelector,
|
5789
|
-
hasResolver,
|
5790
|
-
parent,
|
5791
|
-
resolveFields
|
5792
|
-
]);
|
5784
|
+
}, [defaultFields, state.ui.itemSelector, hasResolver, parent]);
|
5793
5785
|
useOnValueChange(
|
5794
5786
|
state.ui.itemSelector,
|
5795
5787
|
() => {
|
@@ -6397,14 +6389,13 @@ function Render({
|
|
6397
6389
|
config.root.render,
|
6398
6390
|
__spreadProps(__spreadValues({}, rootProps), {
|
6399
6391
|
puck: {
|
6400
|
-
renderDropZone:
|
6401
|
-
isEditing: false
|
6402
|
-
dragRef: null
|
6392
|
+
renderDropZone: DropZone,
|
6393
|
+
isEditing: false
|
6403
6394
|
},
|
6404
6395
|
title,
|
6405
6396
|
editMode: false,
|
6406
6397
|
id: "puck-root",
|
6407
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
6398
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DropZone, { zone: rootDroppableId })
|
6408
6399
|
})
|
6409
6400
|
)
|
6410
6401
|
}
|
@@ -6420,7 +6411,7 @@ function Render({
|
|
6420
6411
|
depth: 0,
|
6421
6412
|
path: []
|
6422
6413
|
},
|
6423
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
6414
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DropZone, { zone: rootDroppableId })
|
6424
6415
|
}
|
6425
6416
|
);
|
6426
6417
|
}
|
@@ -6480,12 +6471,12 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
6480
6471
|
Page,
|
6481
6472
|
__spreadProps(__spreadValues({}, rootProps), {
|
6482
6473
|
puck: {
|
6483
|
-
renderDropZone:
|
6474
|
+
renderDropZone: DropZone,
|
6484
6475
|
isEditing: true,
|
6485
6476
|
dragRef: null
|
6486
6477
|
},
|
6487
6478
|
editMode: true,
|
6488
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
6479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DropZone, { zone: rootDroppableId })
|
6489
6480
|
})
|
6490
6481
|
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Render, { data: state.data, config });
|
6491
6482
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
@@ -7968,12 +7959,14 @@ var usePuck = () => {
|
|
7968
7959
|
Button,
|
7969
7960
|
Drawer,
|
7970
7961
|
DropZone,
|
7962
|
+
DropZoneProvider,
|
7971
7963
|
FieldLabel,
|
7972
7964
|
Group,
|
7973
7965
|
IconButton,
|
7974
7966
|
Label,
|
7975
7967
|
Puck,
|
7976
7968
|
Render,
|
7969
|
+
dropZoneContext,
|
7977
7970
|
migrate,
|
7978
7971
|
overrideKeys,
|
7979
7972
|
resolveAllData,
|
package/dist/index.mjs
CHANGED
@@ -3804,7 +3804,6 @@ var DropZoneRender = forwardRef3(
|
|
3804
3804
|
}) });
|
3805
3805
|
}
|
3806
3806
|
);
|
3807
|
-
var DropZonePure = (props) => /* @__PURE__ */ jsx22(DropZone, __spreadValues({}, props));
|
3808
3807
|
var DropZone = forwardRef3(
|
3809
3808
|
function DropZone2(props, ref) {
|
3810
3809
|
const ctx = useContext6(dropZoneContext);
|
@@ -5584,10 +5583,7 @@ var useResolvedFields = () => {
|
|
5584
5583
|
const [fieldsLoading, setFieldsLoading] = useState19(false);
|
5585
5584
|
const lastFields = useRef5(defaultFields);
|
5586
5585
|
const defaultResolveFields = (_componentData, _params) => defaultFields;
|
5587
|
-
const componentData =
|
5588
|
-
() => selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly || {} },
|
5589
|
-
[selectedItem, rootProps, data.root.readOnly]
|
5590
|
-
);
|
5586
|
+
const componentData = selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly };
|
5591
5587
|
const hasComponentResolver = selectedItem && (componentConfig == null ? void 0 : componentConfig.resolveFields);
|
5592
5588
|
const hasRootResolver = !selectedItem && ((_b = config.root) == null ? void 0 : _b.resolveFields);
|
5593
5589
|
const hasResolver = hasComponentResolver || hasRootResolver;
|
@@ -5643,13 +5639,7 @@ var useResolvedFields = () => {
|
|
5643
5639
|
}
|
5644
5640
|
}
|
5645
5641
|
setResolvedFields(defaultFields);
|
5646
|
-
}, [
|
5647
|
-
defaultFields,
|
5648
|
-
state.ui.itemSelector,
|
5649
|
-
hasResolver,
|
5650
|
-
parent,
|
5651
|
-
resolveFields
|
5652
|
-
]);
|
5642
|
+
}, [defaultFields, state.ui.itemSelector, hasResolver, parent]);
|
5653
5643
|
useOnValueChange(
|
5654
5644
|
state.ui.itemSelector,
|
5655
5645
|
() => {
|
@@ -6262,14 +6252,13 @@ function Render({
|
|
6262
6252
|
config.root.render,
|
6263
6253
|
__spreadProps(__spreadValues({}, rootProps), {
|
6264
6254
|
puck: {
|
6265
|
-
renderDropZone:
|
6266
|
-
isEditing: false
|
6267
|
-
dragRef: null
|
6255
|
+
renderDropZone: DropZone,
|
6256
|
+
isEditing: false
|
6268
6257
|
},
|
6269
6258
|
title,
|
6270
6259
|
editMode: false,
|
6271
6260
|
id: "puck-root",
|
6272
|
-
children: /* @__PURE__ */ jsx32(
|
6261
|
+
children: /* @__PURE__ */ jsx32(DropZone, { zone: rootDroppableId })
|
6273
6262
|
})
|
6274
6263
|
)
|
6275
6264
|
}
|
@@ -6285,7 +6274,7 @@ function Render({
|
|
6285
6274
|
depth: 0,
|
6286
6275
|
path: []
|
6287
6276
|
},
|
6288
|
-
children: /* @__PURE__ */ jsx32(
|
6277
|
+
children: /* @__PURE__ */ jsx32(DropZone, { zone: rootDroppableId })
|
6289
6278
|
}
|
6290
6279
|
);
|
6291
6280
|
}
|
@@ -6345,12 +6334,12 @@ var Preview2 = ({ id = "puck-preview" }) => {
|
|
6345
6334
|
Page,
|
6346
6335
|
__spreadProps(__spreadValues({}, rootProps), {
|
6347
6336
|
puck: {
|
6348
|
-
renderDropZone:
|
6337
|
+
renderDropZone: DropZone,
|
6349
6338
|
isEditing: true,
|
6350
6339
|
dragRef: null
|
6351
6340
|
},
|
6352
6341
|
editMode: true,
|
6353
|
-
children: /* @__PURE__ */ jsx33(
|
6342
|
+
children: /* @__PURE__ */ jsx33(DropZone, { zone: rootDroppableId })
|
6354
6343
|
})
|
6355
6344
|
) : /* @__PURE__ */ jsx33(Render, { data: state.data, config });
|
6356
6345
|
return /* @__PURE__ */ jsx33(
|
@@ -7798,12 +7787,14 @@ export {
|
|
7798
7787
|
Button,
|
7799
7788
|
Drawer,
|
7800
7789
|
DropZone,
|
7790
|
+
DropZoneProvider,
|
7801
7791
|
FieldLabel,
|
7802
7792
|
Group,
|
7803
7793
|
IconButton,
|
7804
7794
|
Label,
|
7805
7795
|
Puck,
|
7806
7796
|
Render,
|
7797
|
+
dropZoneContext,
|
7807
7798
|
migrate,
|
7808
7799
|
overrideKeys,
|
7809
7800
|
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<DefaultRootRenderProps<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 PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type ExtractPropsFromConfig as E, type FieldProps as F, type BaseField as G, type History as H, type ItemSelector as I, type TextareaField as J, type RadioField as K, type ArrayField as L, type MappedItem as M, type NumberField as N, type OnAction as O, type Permissions as P, type ObjectField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type Fields as _, type Field as a, type DefaultRootRenderProps as a0, type DefaultRootProps as a1, type WithId as a2, type WithPuckProps as a3, type AsFieldProps as a4, type WithChildren as a5, resolveAllData as a6, type DropZoneProps as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type IframeConfig as g, type InitialHistory as h, type DefaultComponentProps as i, type DefaultRootFieldProps as j, type ExtractRootPropsFromConfig as k, type ComponentDataMap as l, type Direction as m, type DragAxis as n, type Viewport as o, overrideKeys as p, type OverrideKey as q, type FieldRenderFunctions as r, type ItemWithId as s, type ArrayState as t, type PuckComponent as u, type ComponentConfig as v, type RootDataWithoutProps as w, type RootData as x, type ComponentData as y, type Content 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<DefaultRootRenderProps<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 PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type ExtractPropsFromConfig as E, type FieldProps as F, type BaseField as G, type History as H, type ItemSelector as I, type TextareaField as J, type RadioField as K, type ArrayField as L, type MappedItem as M, type NumberField as N, type OnAction as O, type Permissions as P, type ObjectField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type Fields as _, type Field as a, type DefaultRootRenderProps as a0, type DefaultRootProps as a1, type WithId as a2, type WithPuckProps as a3, type AsFieldProps as a4, type WithChildren as a5, resolveAllData as a6, type DropZoneProps as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type IframeConfig as g, type InitialHistory as h, type DefaultComponentProps as i, type DefaultRootFieldProps as j, type ExtractRootPropsFromConfig as k, type ComponentDataMap as l, type Direction as m, type DragAxis as n, type Viewport as o, overrideKeys as p, type OverrideKey as q, type FieldRenderFunctions as r, type ItemWithId as s, type ArrayState as t, type PuckComponent as u, type ComponentConfig as v, type RootDataWithoutProps as w, type RootData as x, type ComponentData as y, type Content 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, D as Data } from './resolve-all-data-DzJEE28m.mjs';
|
3
|
+
export { a6 as resolveAllData } from './resolve-all-data-DzJEE28m.mjs';
|
4
4
|
import 'react';
|
5
5
|
|
6
|
-
declare function Render<UserConfig extends Config = Config
|
6
|
+
declare function Render<UserConfig extends Config = Config>({ config, data, }: {
|
7
7
|
config: UserConfig;
|
8
|
-
data:
|
8
|
+
data: Data;
|
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, D as Data } from './resolve-all-data-DzJEE28m.js';
|
3
|
+
export { a6 as resolveAllData } from './resolve-all-data-DzJEE28m.js';
|
4
4
|
import 'react';
|
5
5
|
|
6
|
-
declare function Render<UserConfig extends Config = Config
|
6
|
+
declare function Render<UserConfig extends Config = Config>({ config, data, }: {
|
7
7
|
config: UserConfig;
|
8
|
-
data:
|
8
|
+
data: Data;
|
9
9
|
}): react_jsx_runtime.JSX.Element;
|
10
10
|
|
11
11
|
export { Render };
|
package/dist/rsc.js
CHANGED
@@ -131,7 +131,10 @@ function DropZoneRender({
|
|
131
131
|
return null;
|
132
132
|
}) });
|
133
133
|
}
|
134
|
-
function Render({
|
134
|
+
function Render({
|
135
|
+
config,
|
136
|
+
data
|
137
|
+
}) {
|
135
138
|
var _a;
|
136
139
|
if ((_a = config.root) == null ? void 0 : _a.render) {
|
137
140
|
const rootProps = data.root.props || data.root;
|
@@ -141,8 +144,7 @@ function Render({ config, data }) {
|
|
141
144
|
__spreadProps(__spreadValues({}, rootProps), {
|
142
145
|
puck: {
|
143
146
|
renderDropZone: ({ zone }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropZoneRender, { zone, data, config }),
|
144
|
-
isEditing: false
|
145
|
-
dragRef: null
|
147
|
+
isEditing: false
|
146
148
|
},
|
147
149
|
title,
|
148
150
|
editMode: false,
|
package/dist/rsc.mjs
CHANGED
@@ -52,7 +52,10 @@ function DropZoneRender({
|
|
52
52
|
return null;
|
53
53
|
}) });
|
54
54
|
}
|
55
|
-
function Render({
|
55
|
+
function Render({
|
56
|
+
config,
|
57
|
+
data
|
58
|
+
}) {
|
56
59
|
var _a;
|
57
60
|
if ((_a = config.root) == null ? void 0 : _a.render) {
|
58
61
|
const rootProps = data.root.props || data.root;
|
@@ -62,8 +65,7 @@ function Render({ config, data }) {
|
|
62
65
|
__spreadProps(__spreadValues({}, rootProps), {
|
63
66
|
puck: {
|
64
67
|
renderDropZone: ({ zone }) => /* @__PURE__ */ jsx(DropZoneRender, { zone, data, config }),
|
65
|
-
isEditing: false
|
66
|
-
dragRef: null
|
68
|
+
isEditing: false
|
67
69
|
},
|
68
70
|
title,
|
69
71
|
editMode: false,
|
package/package.json
CHANGED