@measured/puck 0.19.0-canary.1fc19b5 → 0.19.0-canary.2c1db862

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.
@@ -22,6 +22,8 @@ type FieldOption = {
22
22
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
23
23
  type BaseField = {
24
24
  label?: string;
25
+ labelIcon?: ReactElement;
26
+ metadata?: Metadata;
25
27
  };
26
28
  type TextField = BaseField & {
27
29
  type: "text";
@@ -119,6 +121,11 @@ type CustomField<Props extends any = {}> = BaseField & {
119
121
  readOnly?: boolean;
120
122
  }) => ReactElement;
121
123
  };
124
+ type SlotField = BaseField & {
125
+ type: "slot";
126
+ allow?: string[];
127
+ disallow?: string[];
128
+ };
122
129
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
123
130
  [key: string]: any;
124
131
  } ? Props : any> | ObjectField<Props extends {
@@ -127,7 +134,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
127
134
  [key: string]: any;
128
135
  } ? Props : any> | ExternalFieldWithAdaptor<Props extends {
129
136
  [key: string]: any;
130
- } ? Props : any> | CustomField<Props>;
137
+ } ? Props : any> | CustomField<Props> | SlotField;
131
138
  type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps> = {
132
139
  [PropName in keyof Omit<ComponentProps, "editMode">]: Field<ComponentProps[PropName]>;
133
140
  };
@@ -140,15 +147,20 @@ type FieldProps<F = Field<any>, ValueType = any> = {
140
147
  };
141
148
 
142
149
  type PuckComponent<Props> = (props: WithId<WithPuckProps<Props>>) => JSX.Element;
150
+ type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
143
151
  type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponentProps, FieldProps extends DefaultComponentProps = RenderProps, DataShape = Omit<ComponentData<FieldProps>, "type">> = {
144
- render: PuckComponent<RenderProps>;
152
+ render: PuckComponent<{
153
+ [PropName in keyof RenderProps]: RenderProps[PropName] extends Slot ? (props?: Omit<DropZoneProps, "zone">) => ReactNode : RenderProps[PropName];
154
+ }>;
145
155
  label?: string;
146
156
  defaultProps?: FieldProps;
147
157
  fields?: Fields<FieldProps>;
148
158
  permissions?: Partial<Permissions>;
149
159
  inline?: boolean;
150
160
  resolveFields?: (data: DataShape, params: {
151
- changed: Partial<Record<keyof FieldProps, boolean>>;
161
+ changed: Partial<Record<keyof FieldProps, boolean> & {
162
+ id: string;
163
+ }>;
152
164
  fields: Fields<FieldProps>;
153
165
  lastFields: Fields<FieldProps>;
154
166
  lastData: DataShape | null;
@@ -156,9 +168,12 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
156
168
  parent: ComponentData | null;
157
169
  }) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
158
170
  resolveData?: (data: DataShape, params: {
159
- changed: Partial<Record<keyof FieldProps, boolean>>;
171
+ changed: Partial<Record<keyof FieldProps, boolean> & {
172
+ id: string;
173
+ }>;
160
174
  lastData: DataShape | null;
161
175
  metadata: Metadata;
176
+ trigger: ResolveDataTrigger;
162
177
  }) => Promise<{
163
178
  props?: Partial<FieldProps>;
164
179
  readOnly?: Partial<Record<keyof FieldProps, boolean>>;
@@ -167,13 +182,17 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
167
182
  readOnly?: Partial<Record<keyof FieldProps, boolean>>;
168
183
  };
169
184
  resolvePermissions?: (data: DataShape, params: {
170
- changed: Partial<Record<keyof FieldProps, boolean>>;
185
+ changed: Partial<Record<keyof FieldProps, boolean> & {
186
+ id: string;
187
+ }>;
171
188
  lastPermissions: Partial<Permissions>;
172
189
  permissions: Partial<Permissions>;
173
190
  appState: AppState;
174
191
  lastData: DataShape | null;
175
192
  }) => Promise<Partial<Permissions>> | Partial<Permissions>;
193
+ metadata?: Metadata;
176
194
  };
195
+ type RootConfig<RootProps extends DefaultComponentProps = any> = Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
177
196
  type Category<ComponentName> = {
178
197
  components?: ComponentName[];
179
198
  title?: string;
@@ -187,7 +206,7 @@ type Config<Props extends DefaultComponentProps = DefaultComponentProps, RootPro
187
206
  components: {
188
207
  [ComponentName in keyof Props]: Omit<ComponentConfig<Props[ComponentName], Props[ComponentName]>, "type">;
189
208
  };
190
- root?: Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
209
+ root?: RootConfig<RootProps>;
191
210
  };
192
211
 
193
212
  type WithId<Props> = Props & {
@@ -203,7 +222,7 @@ type WithChildren<Props> = Props & {
203
222
  };
204
223
  type ExtractPropsFromConfig<UserConfig> = UserConfig extends Config<infer P, any, any> ? P : never;
205
224
  type ExtractRootPropsFromConfig<UserConfig> = UserConfig extends Config<any, infer P, any> ? P : never;
206
- type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>, UserAppState extends AppState<UserData> = AppState<UserData>, UserComponentData extends ComponentData = UserData["content"][0]> = {
225
+ type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>, UserAppState extends PrivateAppState<UserData> = PrivateAppState<UserData>, UserComponentData extends ComponentData = UserData["content"][0]> = {
207
226
  UserConfig: UserConfig;
208
227
  UserProps: UserProps;
209
228
  UserRootProps: UserRootProps;
@@ -299,6 +318,27 @@ type AppState<UserData extends Data = Data> = {
299
318
  ui: UiState;
300
319
  };
301
320
 
321
+ type ZoneType = "root" | "dropzone" | "slot";
322
+ type PuckNodeData = {
323
+ data: ComponentData;
324
+ flatData: ComponentData;
325
+ parentId: string | null;
326
+ zone: string;
327
+ path: string[];
328
+ };
329
+ type PuckZoneData = {
330
+ contentIds: string[];
331
+ type: ZoneType;
332
+ };
333
+ type NodeIndex = Record<string, PuckNodeData>;
334
+ type ZoneIndex = Record<string, PuckZoneData>;
335
+ type PrivateAppState<UserData extends Data = Data> = AppState<UserData> & {
336
+ indexes: {
337
+ nodes: NodeIndex;
338
+ zones: ZoneIndex;
339
+ };
340
+ };
341
+
302
342
  type RenderFunc<Props extends {
303
343
  [key: string]: any;
304
344
  } = {
@@ -405,6 +445,7 @@ type InitialHistoryNoAppend<AS = Partial<AppState>> = {
405
445
  appendData?: false;
406
446
  };
407
447
  type InitialHistory<AS = Partial<AppState>> = InitialHistoryAppend<AS> | InitialHistoryNoAppend<AS>;
448
+ type Slot = Content;
408
449
 
409
450
  type InsertAction = {
410
451
  type: "insert";
@@ -418,11 +459,17 @@ type DuplicateAction = {
418
459
  sourceIndex: number;
419
460
  sourceZone: string;
420
461
  };
421
- type ReplaceAction = {
462
+ type ReplaceAction<UserData extends Data = Data> = {
422
463
  type: "replace";
423
464
  destinationIndex: number;
424
465
  destinationZone: string;
425
- data: any;
466
+ data: ComponentData;
467
+ ui?: Partial<AppState<UserData>["ui"]>;
468
+ };
469
+ type ReplaceRootAction<UserData extends Data = Data> = {
470
+ type: "replaceRoot";
471
+ root: RootData;
472
+ ui?: Partial<AppState<UserData>["ui"]>;
426
473
  };
427
474
  type ReorderAction = {
428
475
  type: "reorder";
@@ -452,7 +499,7 @@ type SetDataAction = {
452
499
  };
453
500
  type SetAction<UserData extends Data = Data> = {
454
501
  type: "set";
455
- state: Partial<AppState<UserData>> | ((previous: AppState<UserData>) => Partial<AppState<UserData>>);
502
+ state: Partial<PrivateAppState<UserData>> | ((previous: PrivateAppState<UserData>) => Partial<PrivateAppState<UserData>>);
456
503
  };
457
504
  type RegisterZoneAction = {
458
505
  type: "registerZone";
@@ -464,8 +511,19 @@ type UnregisterZoneAction = {
464
511
  };
465
512
  type PuckAction = {
466
513
  recordHistory?: boolean;
467
- } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
514
+ } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
515
+
516
+ type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
517
+ [ComponentName in keyof Props]: (props: Props[ComponentName] & {
518
+ [key: string]: any;
519
+ }) => Props[ComponentName];
520
+ } & {
521
+ root: (props: RootProps & {
522
+ [key: string]: any;
523
+ }) => RootProps;
524
+ }>;
525
+ declare function transformProps<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Props, RootProps>): Data;
468
526
 
469
527
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
470
528
 
471
- export { type DefaultRootProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type BaseField 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 Metadata 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 PuckContext as Z, type DefaultRootRenderProps as _, type Field as a, type WithId as a0, type WithPuckProps as a1, type AsFieldProps as a2, type WithChildren as a3, type ExtractPropsFromConfig as a4, type ExtractRootPropsFromConfig as a5, resolveAllData as a6, 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 ComponentData as j, type Fields as k, type ComponentConfig 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 RootDataWithoutProps as v, type RootData as w, type MappedItem as x, type ComponentDataMap as y, type Content as z };
529
+ export { type SlotField as $, type AppState as A, type BaseData as B, type ComponentData as C, type DropZoneProps as D, type ComponentDataMap as E, type Fields as F, type BaseField as G, type History as H, type IframeConfig as I, type TextareaField as J, type SelectField as K, type RadioField as L, type Metadata as M, type NumberField as N, type Overrides as O, type Permissions as P, type ArrayField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ObjectField as W, type Adaptor as X, type ExternalFieldWithAdaptor as Y, type ExternalField as Z, type CustomField as _, type Config as a, type PuckContext as a0, type DefaultRootFieldProps as a1, type DefaultRootRenderProps as a2, type DefaultRootProps as a3, type DefaultComponentProps as a4, type WithId as a5, type WithPuckProps as a6, type AsFieldProps as a7, type WithChildren as a8, type ExtractPropsFromConfig as a9, type ExtractRootPropsFromConfig as aa, transformProps as ab, resolveAllData as ac, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type Field as g, type FieldProps as h, type Data as i, type OnAction as j, type InitialHistory as k, type RootData as l, type Content as m, type ItemSelector as n, type Direction as o, type DragAxis as p, type Viewport as q, overrideKeys as r, type OverrideKey as s, type FieldRenderFunctions as t, type ItemWithId as u, type ArrayState as v, type PuckComponent as w, type RootConfig as x, type RootDataWithoutProps as y, type MappedItem as z };
@@ -22,6 +22,8 @@ type FieldOption = {
22
22
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
23
23
  type BaseField = {
24
24
  label?: string;
25
+ labelIcon?: ReactElement;
26
+ metadata?: Metadata;
25
27
  };
26
28
  type TextField = BaseField & {
27
29
  type: "text";
@@ -119,6 +121,11 @@ type CustomField<Props extends any = {}> = BaseField & {
119
121
  readOnly?: boolean;
120
122
  }) => ReactElement;
121
123
  };
124
+ type SlotField = BaseField & {
125
+ type: "slot";
126
+ allow?: string[];
127
+ disallow?: string[];
128
+ };
122
129
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
123
130
  [key: string]: any;
124
131
  } ? Props : any> | ObjectField<Props extends {
@@ -127,7 +134,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
127
134
  [key: string]: any;
128
135
  } ? Props : any> | ExternalFieldWithAdaptor<Props extends {
129
136
  [key: string]: any;
130
- } ? Props : any> | CustomField<Props>;
137
+ } ? Props : any> | CustomField<Props> | SlotField;
131
138
  type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps> = {
132
139
  [PropName in keyof Omit<ComponentProps, "editMode">]: Field<ComponentProps[PropName]>;
133
140
  };
@@ -140,15 +147,20 @@ type FieldProps<F = Field<any>, ValueType = any> = {
140
147
  };
141
148
 
142
149
  type PuckComponent<Props> = (props: WithId<WithPuckProps<Props>>) => JSX.Element;
150
+ type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
143
151
  type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponentProps, FieldProps extends DefaultComponentProps = RenderProps, DataShape = Omit<ComponentData<FieldProps>, "type">> = {
144
- render: PuckComponent<RenderProps>;
152
+ render: PuckComponent<{
153
+ [PropName in keyof RenderProps]: RenderProps[PropName] extends Slot ? (props?: Omit<DropZoneProps, "zone">) => ReactNode : RenderProps[PropName];
154
+ }>;
145
155
  label?: string;
146
156
  defaultProps?: FieldProps;
147
157
  fields?: Fields<FieldProps>;
148
158
  permissions?: Partial<Permissions>;
149
159
  inline?: boolean;
150
160
  resolveFields?: (data: DataShape, params: {
151
- changed: Partial<Record<keyof FieldProps, boolean>>;
161
+ changed: Partial<Record<keyof FieldProps, boolean> & {
162
+ id: string;
163
+ }>;
152
164
  fields: Fields<FieldProps>;
153
165
  lastFields: Fields<FieldProps>;
154
166
  lastData: DataShape | null;
@@ -156,9 +168,12 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
156
168
  parent: ComponentData | null;
157
169
  }) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
158
170
  resolveData?: (data: DataShape, params: {
159
- changed: Partial<Record<keyof FieldProps, boolean>>;
171
+ changed: Partial<Record<keyof FieldProps, boolean> & {
172
+ id: string;
173
+ }>;
160
174
  lastData: DataShape | null;
161
175
  metadata: Metadata;
176
+ trigger: ResolveDataTrigger;
162
177
  }) => Promise<{
163
178
  props?: Partial<FieldProps>;
164
179
  readOnly?: Partial<Record<keyof FieldProps, boolean>>;
@@ -167,13 +182,17 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
167
182
  readOnly?: Partial<Record<keyof FieldProps, boolean>>;
168
183
  };
169
184
  resolvePermissions?: (data: DataShape, params: {
170
- changed: Partial<Record<keyof FieldProps, boolean>>;
185
+ changed: Partial<Record<keyof FieldProps, boolean> & {
186
+ id: string;
187
+ }>;
171
188
  lastPermissions: Partial<Permissions>;
172
189
  permissions: Partial<Permissions>;
173
190
  appState: AppState;
174
191
  lastData: DataShape | null;
175
192
  }) => Promise<Partial<Permissions>> | Partial<Permissions>;
193
+ metadata?: Metadata;
176
194
  };
195
+ type RootConfig<RootProps extends DefaultComponentProps = any> = Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
177
196
  type Category<ComponentName> = {
178
197
  components?: ComponentName[];
179
198
  title?: string;
@@ -187,7 +206,7 @@ type Config<Props extends DefaultComponentProps = DefaultComponentProps, RootPro
187
206
  components: {
188
207
  [ComponentName in keyof Props]: Omit<ComponentConfig<Props[ComponentName], Props[ComponentName]>, "type">;
189
208
  };
190
- root?: Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
209
+ root?: RootConfig<RootProps>;
191
210
  };
192
211
 
193
212
  type WithId<Props> = Props & {
@@ -203,7 +222,7 @@ type WithChildren<Props> = Props & {
203
222
  };
204
223
  type ExtractPropsFromConfig<UserConfig> = UserConfig extends Config<infer P, any, any> ? P : never;
205
224
  type ExtractRootPropsFromConfig<UserConfig> = UserConfig extends Config<any, infer P, any> ? P : never;
206
- type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>, UserAppState extends AppState<UserData> = AppState<UserData>, UserComponentData extends ComponentData = UserData["content"][0]> = {
225
+ type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>, UserAppState extends PrivateAppState<UserData> = PrivateAppState<UserData>, UserComponentData extends ComponentData = UserData["content"][0]> = {
207
226
  UserConfig: UserConfig;
208
227
  UserProps: UserProps;
209
228
  UserRootProps: UserRootProps;
@@ -299,6 +318,27 @@ type AppState<UserData extends Data = Data> = {
299
318
  ui: UiState;
300
319
  };
301
320
 
321
+ type ZoneType = "root" | "dropzone" | "slot";
322
+ type PuckNodeData = {
323
+ data: ComponentData;
324
+ flatData: ComponentData;
325
+ parentId: string | null;
326
+ zone: string;
327
+ path: string[];
328
+ };
329
+ type PuckZoneData = {
330
+ contentIds: string[];
331
+ type: ZoneType;
332
+ };
333
+ type NodeIndex = Record<string, PuckNodeData>;
334
+ type ZoneIndex = Record<string, PuckZoneData>;
335
+ type PrivateAppState<UserData extends Data = Data> = AppState<UserData> & {
336
+ indexes: {
337
+ nodes: NodeIndex;
338
+ zones: ZoneIndex;
339
+ };
340
+ };
341
+
302
342
  type RenderFunc<Props extends {
303
343
  [key: string]: any;
304
344
  } = {
@@ -405,6 +445,7 @@ type InitialHistoryNoAppend<AS = Partial<AppState>> = {
405
445
  appendData?: false;
406
446
  };
407
447
  type InitialHistory<AS = Partial<AppState>> = InitialHistoryAppend<AS> | InitialHistoryNoAppend<AS>;
448
+ type Slot = Content;
408
449
 
409
450
  type InsertAction = {
410
451
  type: "insert";
@@ -418,11 +459,17 @@ type DuplicateAction = {
418
459
  sourceIndex: number;
419
460
  sourceZone: string;
420
461
  };
421
- type ReplaceAction = {
462
+ type ReplaceAction<UserData extends Data = Data> = {
422
463
  type: "replace";
423
464
  destinationIndex: number;
424
465
  destinationZone: string;
425
- data: any;
466
+ data: ComponentData;
467
+ ui?: Partial<AppState<UserData>["ui"]>;
468
+ };
469
+ type ReplaceRootAction<UserData extends Data = Data> = {
470
+ type: "replaceRoot";
471
+ root: RootData;
472
+ ui?: Partial<AppState<UserData>["ui"]>;
426
473
  };
427
474
  type ReorderAction = {
428
475
  type: "reorder";
@@ -452,7 +499,7 @@ type SetDataAction = {
452
499
  };
453
500
  type SetAction<UserData extends Data = Data> = {
454
501
  type: "set";
455
- state: Partial<AppState<UserData>> | ((previous: AppState<UserData>) => Partial<AppState<UserData>>);
502
+ state: Partial<PrivateAppState<UserData>> | ((previous: PrivateAppState<UserData>) => Partial<PrivateAppState<UserData>>);
456
503
  };
457
504
  type RegisterZoneAction = {
458
505
  type: "registerZone";
@@ -464,8 +511,19 @@ type UnregisterZoneAction = {
464
511
  };
465
512
  type PuckAction = {
466
513
  recordHistory?: boolean;
467
- } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
514
+ } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
515
+
516
+ type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
517
+ [ComponentName in keyof Props]: (props: Props[ComponentName] & {
518
+ [key: string]: any;
519
+ }) => Props[ComponentName];
520
+ } & {
521
+ root: (props: RootProps & {
522
+ [key: string]: any;
523
+ }) => RootProps;
524
+ }>;
525
+ declare function transformProps<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Props, RootProps>): Data;
468
526
 
469
527
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
470
528
 
471
- export { type DefaultRootProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type BaseField 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 Metadata 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 PuckContext as Z, type DefaultRootRenderProps as _, type Field as a, type WithId as a0, type WithPuckProps as a1, type AsFieldProps as a2, type WithChildren as a3, type ExtractPropsFromConfig as a4, type ExtractRootPropsFromConfig as a5, resolveAllData as a6, 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 ComponentData as j, type Fields as k, type ComponentConfig 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 RootDataWithoutProps as v, type RootData as w, type MappedItem as x, type ComponentDataMap as y, type Content as z };
529
+ export { type SlotField as $, type AppState as A, type BaseData as B, type ComponentData as C, type DropZoneProps as D, type ComponentDataMap as E, type Fields as F, type BaseField as G, type History as H, type IframeConfig as I, type TextareaField as J, type SelectField as K, type RadioField as L, type Metadata as M, type NumberField as N, type Overrides as O, type Permissions as P, type ArrayField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ObjectField as W, type Adaptor as X, type ExternalFieldWithAdaptor as Y, type ExternalField as Z, type CustomField as _, type Config as a, type PuckContext as a0, type DefaultRootFieldProps as a1, type DefaultRootRenderProps as a2, type DefaultRootProps as a3, type DefaultComponentProps as a4, type WithId as a5, type WithPuckProps as a6, type AsFieldProps as a7, type WithChildren as a8, type ExtractPropsFromConfig as a9, type ExtractRootPropsFromConfig as aa, transformProps as ab, resolveAllData as ac, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type Field as g, type FieldProps as h, type Data as i, type OnAction as j, type InitialHistory as k, type RootData as l, type Content as m, type ItemSelector as n, type Direction as o, type DragAxis as p, type Viewport as q, overrideKeys as r, type OverrideKey as s, type FieldRenderFunctions as t, type ItemWithId as u, type ArrayState as v, type PuckComponent as w, type RootConfig as x, type RootDataWithoutProps as y, type MappedItem as z };