@measured/puck 0.21.0-canary.a3dabae1 → 0.21.0-canary.ace4c8b3

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.
@@ -11,24 +11,21 @@ import {
11
11
  Label,
12
12
  Puck,
13
13
  Render,
14
- blocksPlugin,
15
14
  createUsePuck,
16
- fieldsPlugin,
17
- outlinePlugin,
18
15
  overrideKeys,
19
16
  registerOverlayPortal,
20
17
  renderContext,
21
18
  setDeep,
22
19
  useGetPuck,
23
20
  usePuck
24
- } from "./chunk-V2FU5KB6.mjs";
21
+ } from "./chunk-AIFI2M23.mjs";
25
22
  import {
26
23
  init_react_import,
27
24
  migrate,
28
25
  resolveAllData,
29
26
  transformProps,
30
27
  walkTree
31
- } from "./chunk-C24EBUN6.mjs";
28
+ } from "./chunk-TC25DCTQ.mjs";
32
29
 
33
30
  // bundle/no-external.ts
34
31
  init_react_import();
@@ -45,11 +42,8 @@ export {
45
42
  Label,
46
43
  Puck,
47
44
  Render,
48
- blocksPlugin,
49
45
  createUsePuck,
50
- fieldsPlugin,
51
46
  migrate,
52
- outlinePlugin,
53
47
  overrideKeys,
54
48
  registerOverlayPortal,
55
49
  renderContext,
package/dist/rsc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-Cvtjzg9C.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Cvtjzg9C.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-CkSoNBF7.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CkSoNBF7.mjs';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
package/dist/rsc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-Cvtjzg9C.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Cvtjzg9C.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-CkSoNBF7.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CkSoNBF7.js';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
package/dist/rsc.js CHANGED
@@ -130,32 +130,27 @@ var walkField = ({
130
130
  config,
131
131
  recurseSlots = false
132
132
  }) => {
133
- var _a, _b, _c, _d, _e;
133
+ var _a, _b, _c;
134
134
  const fieldType = (_a = fields[propKey]) == null ? void 0 : _a.type;
135
135
  const map = mappers[fieldType];
136
136
  if (map && fieldType === "slot") {
137
137
  const content = value || [];
138
- let mappedContent = content;
139
- if (recurseSlots) {
140
- for (let i = 0; i < content.length; i++) {
141
- const el = content[i];
142
- const componentConfig = config.components[el.type];
143
- if (!componentConfig || !((_b = el.props) == null ? void 0 : _b.id)) {
144
- continue;
145
- }
146
- const fields2 = (_c = componentConfig.fields) != null ? _c : {};
147
- mappedContent.push(
148
- walkField({
149
- value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
150
- fields: fields2,
151
- mappers,
152
- id: el.props.id,
153
- config,
154
- recurseSlots
155
- })
156
- );
138
+ const mappedContent = recurseSlots ? content.map((el) => {
139
+ var _a2;
140
+ const componentConfig = config.components[el.type];
141
+ if (!componentConfig) {
142
+ throw new Error(`Could not find component config for ${el.type}`);
157
143
  }
158
- }
144
+ const fields2 = (_a2 = componentConfig.fields) != null ? _a2 : {};
145
+ return walkField({
146
+ value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
147
+ fields: fields2,
148
+ mappers,
149
+ id: el.props.id,
150
+ config,
151
+ recurseSlots
152
+ });
153
+ }) : content;
159
154
  if (containsPromise(mappedContent)) {
160
155
  return Promise.all(mappedContent);
161
156
  }
@@ -177,7 +172,7 @@ var walkField = ({
177
172
  }
178
173
  if (value && typeof value === "object") {
179
174
  if (Array.isArray(value)) {
180
- const arrayFields = ((_d = fields[propKey]) == null ? void 0 : _d.type) === "array" ? fields[propKey].arrayFields : null;
175
+ const arrayFields = ((_b = fields[propKey]) == null ? void 0 : _b.type) === "array" ? fields[propKey].arrayFields : null;
181
176
  if (!arrayFields) return value;
182
177
  const newValue = value.map(
183
178
  (el, idx) => walkField({
@@ -198,7 +193,7 @@ var walkField = ({
198
193
  } else if ("$$typeof" in value) {
199
194
  return value;
200
195
  } else {
201
- const objectFields = ((_e = fields[propKey]) == null ? void 0 : _e.type) === "object" ? fields[propKey].objectFields : fields;
196
+ const objectFields = ((_c = fields[propKey]) == null ? void 0 : _c.type) === "object" ? fields[propKey].objectFields : fields;
202
197
  return walkObject({
203
198
  value,
204
199
  fields: objectFields,
@@ -479,7 +474,7 @@ var getChanged = (newItem, oldItem) => {
479
474
  // lib/resolve-component-data.ts
480
475
  var import_fast_equals2 = require("fast-equals");
481
476
  var cache = { lastChange: {} };
482
- var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
477
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
483
478
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
484
479
  const resolvedItem = __spreadValues({}, item);
485
480
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
@@ -507,11 +502,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
507
502
  let itemWithResolvedChildren = yield mapFields(
508
503
  resolvedItem,
509
504
  {
510
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
505
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
511
506
  const content = value;
512
507
  return yield Promise.all(
513
508
  content.map(
514
- (childItem) => __async(void 0, null, function* () {
509
+ (childItem) => __async(null, null, function* () {
515
510
  return (yield resolveComponentData(
516
511
  childItem,
517
512
  config,
@@ -559,7 +554,7 @@ function resolveAllData(_0, _1) {
559
554
  return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
560
555
  var _a;
561
556
  const defaultedData = defaultData(data);
562
- const resolveNode = (_node) => __async(this, null, function* () {
557
+ const resolveNode = (_node) => __async(null, null, function* () {
563
558
  const node = toComponent(_node);
564
559
  onResolveStart == null ? void 0 : onResolveStart(node);
565
560
  const resolved = (yield resolveComponentData(
@@ -580,13 +575,13 @@ function resolveAllData(_0, _1) {
580
575
  onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
581
576
  return resolvedDeep;
582
577
  });
583
- const processContent = (content) => __async(this, null, function* () {
578
+ const processContent = (content) => __async(null, null, function* () {
584
579
  return Promise.all(content.map(resolveNode));
585
580
  });
586
- const processZones = () => __async(this, null, function* () {
581
+ const processZones = () => __async(null, null, function* () {
587
582
  var _a2;
588
583
  const zones = (_a2 = data.zones) != null ? _a2 : {};
589
- Object.entries(zones).forEach((_02) => __async(this, [_02], function* ([zoneKey, content]) {
584
+ Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
590
585
  zones[zoneKey] = yield Promise.all(content.map(resolveNode));
591
586
  }));
592
587
  return zones;
@@ -596,7 +591,7 @@ function resolveAllData(_0, _1) {
596
591
  content: yield processContent(defaultedData.content),
597
592
  zones: yield processZones()
598
593
  };
599
- Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(this, null, function* () {
594
+ Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
600
595
  const content = defaultedData.zones[zoneKey];
601
596
  dynamic.zones[zoneKey] = yield processContent(content);
602
597
  }), {});
@@ -676,8 +671,7 @@ function transformProps(data, propTransforms, config = { components: {} }) {
676
671
  var defaultViewports = [
677
672
  { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
678
673
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
679
- { width: 1280, height: "auto", icon: "Monitor", label: "Large" },
680
- { width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
674
+ { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
681
675
  ];
682
676
 
683
677
  // store/default-app-state.ts
@@ -699,8 +693,7 @@ var defaultAppState = {
699
693
  options: [],
700
694
  controlsVisible: true
701
695
  },
702
- field: { focus: null },
703
- plugin: { current: null }
696
+ field: { focus: null }
704
697
  },
705
698
  indexes: {
706
699
  nodes: {},
package/dist/rsc.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  transformProps,
13
13
  useSlots,
14
14
  walkTree
15
- } from "./chunk-C24EBUN6.mjs";
15
+ } from "./chunk-TC25DCTQ.mjs";
16
16
 
17
17
  // bundle/rsc.tsx
18
18
  init_react_import();
@@ -10,63 +10,63 @@ type FieldOption = {
10
10
  value: string | number | boolean | undefined | null | object;
11
11
  };
12
12
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
13
- type BaseField = {
13
+ interface BaseField {
14
14
  label?: string;
15
15
  labelIcon?: ReactElement;
16
- metadata?: Metadata;
16
+ metadata?: FieldMetadata;
17
17
  visible?: boolean;
18
- };
19
- type TextField = BaseField & {
18
+ }
19
+ interface TextField extends BaseField {
20
20
  type: "text";
21
21
  placeholder?: string;
22
22
  contentEditable?: boolean;
23
- };
24
- type NumberField = BaseField & {
23
+ }
24
+ interface NumberField extends BaseField {
25
25
  type: "number";
26
26
  placeholder?: string;
27
27
  min?: number;
28
28
  max?: number;
29
29
  step?: number;
30
- };
31
- type TextareaField = BaseField & {
30
+ }
31
+ interface TextareaField extends BaseField {
32
32
  type: "textarea";
33
33
  placeholder?: string;
34
34
  contentEditable?: boolean;
35
- };
36
- type SelectField = BaseField & {
35
+ }
36
+ interface SelectField extends BaseField {
37
37
  type: "select";
38
38
  options: FieldOptions;
39
- };
40
- type RadioField = BaseField & {
39
+ }
40
+ interface RadioField extends BaseField {
41
41
  type: "radio";
42
42
  options: FieldOptions;
43
- };
44
- type ArrayField<Props extends {
43
+ }
44
+ interface ArrayField<Props extends {
45
45
  [key: string]: any;
46
46
  }[] = {
47
47
  [key: string]: any;
48
- }[], UserField extends {} = {}> = BaseField & {
48
+ }[], UserField extends {} = {}> extends BaseField {
49
49
  type: "array";
50
50
  arrayFields: {
51
51
  [SubPropName in keyof Props[0]]: UserField extends {
52
52
  type: PropertyKey;
53
53
  } ? Field<Props[0][SubPropName], UserField> | UserField : Field<Props[0][SubPropName], UserField>;
54
54
  };
55
- defaultItemProps?: Props[0];
55
+ defaultItemProps?: Props[0] | ((index: number) => Props[0]);
56
56
  getItemSummary?: (item: Props[0], index?: number) => string;
57
57
  max?: number;
58
58
  min?: number;
59
- };
60
- type ObjectField<Props extends any = {
59
+ }
60
+ interface ObjectField<Props extends any = {
61
61
  [key: string]: any;
62
- }, UserField extends {} = {}> = BaseField & {
62
+ }, UserField extends {} = {}> extends BaseField {
63
63
  type: "object";
64
64
  objectFields: {
65
65
  [SubPropName in keyof Props]: UserField extends {
66
66
  type: PropertyKey;
67
67
  } ? Field<Props[SubPropName]> | UserField : Field<Props[SubPropName]>;
68
68
  };
69
- };
69
+ }
70
70
  type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, PropShape = TableShape> = {
71
71
  name: string;
72
72
  fetchList: (adaptorParams?: AdaptorParams) => Promise<TableShape[] | null>;
@@ -82,10 +82,14 @@ type ExternalFieldWithAdaptor<Props extends any = {
82
82
  adaptorParams?: object;
83
83
  getItemSummary: (item: NotUndefined<Props>, index?: number) => string;
84
84
  };
85
- type ExternalField<Props extends any = {
85
+ type CacheOpts = {
86
+ enabled?: boolean;
87
+ };
88
+ interface ExternalField<Props extends any = {
86
89
  [key: string]: any;
87
- }> = BaseField & {
90
+ }> extends BaseField {
88
91
  type: "external";
92
+ cache?: CacheOpts;
89
93
  placeholder?: string;
90
94
  fetchList: (params: {
91
95
  query: string;
@@ -101,7 +105,7 @@ type ExternalField<Props extends any = {
101
105
  initialQuery?: string;
102
106
  filterFields?: Record<string, Field>;
103
107
  initialFilters?: Record<string, any>;
104
- };
108
+ }
105
109
  type CustomFieldRender<Value extends any> = (props: {
106
110
  field: CustomField<Value>;
107
111
  name: string;
@@ -110,16 +114,17 @@ type CustomFieldRender<Value extends any> = (props: {
110
114
  onChange: (value: Value) => void;
111
115
  readOnly?: boolean;
112
116
  }) => ReactElement;
113
- type CustomField<Value extends any> = BaseField & {
117
+ interface CustomField<Value extends any> extends BaseField {
114
118
  type: "custom";
115
119
  render: CustomFieldRender<Value>;
116
120
  contentEditable?: boolean;
117
- };
118
- type SlotField = BaseField & {
121
+ key?: string;
122
+ }
123
+ interface SlotField extends BaseField {
119
124
  type: "slot";
120
125
  allow?: string[];
121
126
  disallow?: string[];
122
- };
127
+ }
123
128
  type Field<ValueType = any, UserField extends {} = {}> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
124
129
  [key: string]: any;
125
130
  }[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
@@ -147,7 +152,7 @@ type DropZoneProps = {
147
152
  };
148
153
 
149
154
  type PuckContext = {
150
- renderDropZone: React.FC<DropZoneProps>;
155
+ renderDropZone: (props: DropZoneProps) => React.ReactNode;
151
156
  metadata: Metadata;
152
157
  isEditing: boolean;
153
158
  dragRef: ((element: Element | null) => void) | null;
@@ -197,6 +202,8 @@ type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
197
202
  type WithPartialProps<T, Props extends DefaultComponentProps> = Omit<T, "props"> & {
198
203
  props?: Partial<Props>;
199
204
  };
205
+ interface ComponentConfigExtensions {
206
+ }
200
207
  type ComponentConfigInternal<RenderProps extends DefaultComponentProps, FieldProps extends DefaultComponentProps, DataShape = Omit<ComponentData<FieldProps>, "type">, // NB this doesn't include AllProps, so types will not contain deep slot types. To fix, we require a breaking change.
201
208
  UserField extends BaseField = {}> = {
202
209
  render: PuckComponent<RenderProps>;
@@ -212,7 +219,7 @@ UserField extends BaseField = {}> = {
212
219
  fields: Fields<FieldProps>;
213
220
  lastFields: Fields<FieldProps>;
214
221
  lastData: DataShape | null;
215
- metadata: Metadata;
222
+ metadata: ComponentMetadata;
216
223
  appState: AppState;
217
224
  parent: ComponentData | null;
218
225
  }) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
@@ -221,7 +228,7 @@ UserField extends BaseField = {}> = {
221
228
  id: string;
222
229
  }>;
223
230
  lastData: DataShape | null;
224
- metadata: Metadata;
231
+ metadata: ComponentMetadata;
225
232
  trigger: ResolveDataTrigger;
226
233
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
227
234
  resolvePermissions?: (data: DataShape, params: {
@@ -233,8 +240,8 @@ UserField extends BaseField = {}> = {
233
240
  appState: AppState;
234
241
  lastData: DataShape | null;
235
242
  }) => Promise<Partial<Permissions>> | Partial<Permissions>;
236
- metadata?: Metadata;
237
- };
243
+ metadata?: ComponentMetadata;
244
+ } & ComponentConfigExtensions;
238
245
  type ComponentConfig<RenderPropsOrParams extends LeftOrExactRight<RenderPropsOrParams, DefaultComponentProps, ComponentConfigParams> = DefaultComponentProps, FieldProps extends DefaultComponentProps = RenderPropsOrParams extends {
239
246
  props: any;
240
247
  } ? RenderPropsOrParams["props"] : RenderPropsOrParams, DataShape = Omit<ComponentData<FieldProps>, "type">> = RenderPropsOrParams extends ComponentConfigParams<infer ParamsRenderProps, never> ? ComponentConfigInternal<ParamsRenderProps, FieldProps, DataShape, {}> : RenderPropsOrParams extends ComponentConfigParams<infer ParamsRenderProps, infer ParamsFields> ? ComponentConfigInternal<ParamsRenderProps, FieldProps, DataShape, ParamsFields[keyof ParamsFields] & BaseField> : ComponentConfigInternal<RenderPropsOrParams, FieldProps, DataShape>;
@@ -265,6 +272,16 @@ type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends
265
272
  type: string;
266
273
  } ? UserField : Field;
267
274
  } : never;
275
+ type ConfigParams<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = any, CategoryNames extends string[] = string[], UserFields extends FieldsExtension = FieldsExtension> = {
276
+ components?: Components;
277
+ root?: RootProps;
278
+ categories?: CategoryNames;
279
+ fields?: AssertHasValue<UserFields>;
280
+ };
281
+ type ComponentConfigParams<Props extends DefaultComponentProps = DefaultComponentProps, UserFields extends FieldsExtension = never> = {
282
+ props: Props;
283
+ fields?: AssertHasValue<UserFields>;
284
+ };
268
285
 
269
286
  type BaseData<Props extends {
270
287
  [key: string]: any;
@@ -305,11 +322,16 @@ type Data<Components extends DefaultComponents = DefaultComponents, RootProps ex
305
322
  type Metadata = {
306
323
  [key: string]: any;
307
324
  };
325
+ interface PuckMetadata extends Metadata {
326
+ }
327
+ interface ComponentMetadata extends PuckMetadata {
328
+ }
329
+ interface FieldMetadata extends Metadata {
330
+ }
308
331
 
309
332
  type ItemWithId = {
310
333
  _arrayId: string;
311
334
  _originalIndex: number;
312
- _currentIndex: number;
313
335
  };
314
336
  type ArrayState = {
315
337
  items: ItemWithId[];
@@ -320,7 +342,6 @@ type UiState = {
320
342
  rightSideBarVisible: boolean;
321
343
  leftSideBarWidth?: number | null;
322
344
  rightSideBarWidth?: number | null;
323
- mobilePanelExpanded?: boolean;
324
345
  itemSelector: ItemSelector | null;
325
346
  arrayState: Record<string, ArrayState | undefined>;
326
347
  previewMode: "interactive" | "edit";
@@ -333,7 +354,7 @@ type UiState = {
333
354
  isDragging: boolean;
334
355
  viewports: {
335
356
  current: {
336
- width: number | "100%";
357
+ width: number;
337
358
  height: number | "auto";
338
359
  };
339
360
  controlsVisible: boolean;
@@ -342,9 +363,6 @@ type UiState = {
342
363
  field: {
343
364
  focus?: string | null;
344
365
  };
345
- plugin: {
346
- current: string | null;
347
- };
348
366
  };
349
367
  type AppState<UserData extends Data = Data> = {
350
368
  data: UserData;
@@ -378,34 +396,16 @@ type BuiltinTypes = Date | RegExp | Error | Function | symbol | null | undefined
378
396
  type WithDeepSlots<T, SlotType = T> = T extends Slot ? SlotType : T extends (infer U)[] ? Array<WithDeepSlots<U, SlotType>> : T extends (infer U)[] ? WithDeepSlots<U, SlotType>[] : T extends BuiltinTypes ? T : T extends object ? {
379
397
  [K in keyof T]: WithDeepSlots<T[K], SlotType>;
380
398
  } : T;
381
- type ConfigParams<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = any, CategoryNames extends string[] = string[], UserFields extends FieldsExtension = FieldsExtension> = {
382
- components?: Components;
383
- root?: RootProps;
384
- categories?: CategoryNames;
385
- fields?: AssertHasValue<UserFields>;
386
- };
387
399
  type FieldsExtension = {
388
400
  [Type in string]: {
389
401
  type: Type;
390
402
  };
391
403
  };
392
- type ComponentConfigParams<Props extends DefaultComponentProps = DefaultComponentProps, UserFields extends FieldsExtension = never> = {
393
- props: Props;
394
- fields?: AssertHasValue<UserFields>;
395
- };
396
404
  type Exact<T, Target> = Record<Exclude<keyof T, keyof Target>, never>;
397
405
  type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<Union, Right> : Left) | (Right & Exact<Union, Right>);
398
406
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
399
407
  never
400
408
  ] ? False : True;
401
- type RenderFunc<Props extends {
402
- [key: string]: any;
403
- } = {
404
- children: ReactNode;
405
- }> = (props: Props) => ReactElement;
406
- type PluginInternal = Plugin & {
407
- mobileOnly?: boolean;
408
- };
409
409
 
410
410
  type MapFnParams<ThisField = Field> = {
411
411
  value: any;
@@ -429,6 +429,11 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
429
429
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
430
430
  }>;
431
431
 
432
+ type RenderFunc<Props extends {
433
+ [key: string]: any;
434
+ } = {
435
+ children: ReactNode;
436
+ }> = (props: Props) => ReactElement;
432
437
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
433
438
  type OverrideKey = (typeof overrideKeys)[number];
434
439
  type OverridesGeneric<Shape extends {
@@ -500,7 +505,7 @@ type DragAxis = "dynamic" | "y" | "x";
500
505
 
501
506
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
502
507
  type Viewport = {
503
- width: number | "100%";
508
+ width: number;
504
509
  height?: number | "auto";
505
510
  label?: string;
506
511
  icon?: iconTypes | ReactNode;
@@ -520,13 +525,8 @@ type IframeConfig = {
520
525
  };
521
526
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
522
527
  type Plugin<UserConfig extends Config = Config> = {
523
- name?: string;
524
- label?: string;
525
- icon?: ReactNode;
526
- render?: () => ReactElement;
527
528
  overrides?: Partial<Overrides<UserConfig>>;
528
529
  fieldTransforms?: FieldTransforms<UserConfig>;
529
- mobilePanelHeight?: "toggle" | "min-content";
530
530
  };
531
531
  type History<D = any> = {
532
532
  state: D;
@@ -644,4 +644,4 @@ type WalkTreeOptions = {
644
644
  };
645
645
  declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
646
646
 
647
- export { type Content as $, type AppState as A, type ItemWithId as B, type Config as C, type DropZoneProps as D, type ArrayState as E, type Fields as F, type SlotComponent as G, type History as H, type IframeConfig as I, type PuckComponent as J, type RootConfig as K, type DefaultComponents as L, type Metadata as M, type ExtractConfigParams as N, type Overrides as O, type Permissions as P, type BaseData as Q, type RootDataWithProps as R, type Slot as S, type RootDataWithoutProps as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type RootData as X, type ComponentDataOptionalId as Y, type MappedItem as Z, type ComponentDataMap as _, type ComponentData as a, type BaseField as a0, type TextField as a1, type NumberField as a2, type TextareaField as a3, type SelectField as a4, type RadioField as a5, type ArrayField as a6, type ObjectField as a7, type Adaptor as a8, type ExternalFieldWithAdaptor as a9, type ExternalField as aa, type CustomFieldRender as ab, type CustomField as ac, type SlotField as ad, type PuckContext as ae, type DefaultRootFieldProps as af, type DefaultRootRenderProps as ag, type DefaultRootProps as ah, type DefaultComponentProps as ai, type WithId as aj, type WithPuckProps as ak, type AsFieldProps as al, type WithChildren as am, type ExtractField as an, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type Field as h, type FieldProps as i, type Data as j, type OnAction as k, type InitialHistory as l, migrate as m, type ItemSelector as n, type PluginInternal as o, type Direction as p, type DragAxis as q, resolveAllData as r, type Viewport as s, transformProps as t, type FieldTransformFnParams as u, type FieldTransformFn as v, walkTree as w, overrideKeys as x, type OverrideKey as y, type FieldRenderFunctions as z };
647
+ export { type MappedItem as $, type AppState as A, type ArrayState as B, type Config as C, type DropZoneProps as D, type SlotComponent as E, type Fields as F, type PuckComponent as G, type History as H, type IframeConfig as I, type ComponentConfigExtensions as J, type RootConfig as K, type DefaultComponents as L, type Metadata as M, type ExtractConfigParams as N, type Overrides as O, type Permissions as P, type ConfigParams as Q, type RootDataWithProps as R, type Slot as S, type ComponentConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type BaseData as X, type RootDataWithoutProps as Y, type RootData as Z, type ComponentDataOptionalId as _, type ComponentData as a, type ComponentDataMap as a0, type Content as a1, type PuckMetadata as a2, type ComponentMetadata as a3, type FieldMetadata as a4, type BaseField as a5, type TextField as a6, type NumberField as a7, type TextareaField as a8, type SelectField as a9, type RadioField as aa, type ArrayField as ab, type ObjectField as ac, type Adaptor as ad, type ExternalFieldWithAdaptor as ae, type CacheOpts as af, type ExternalField as ag, type CustomFieldRender as ah, type CustomField as ai, type SlotField as aj, type PuckContext as ak, type DefaultRootFieldProps as al, type DefaultRootRenderProps as am, type DefaultRootProps as an, type DefaultComponentProps as ao, type WithId as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField as at, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type Field as h, type FieldProps as i, type Data as j, type OnAction as k, type InitialHistory as l, migrate as m, type ItemSelector as n, type Direction as o, type DragAxis as p, type Viewport as q, resolveAllData as r, type FieldTransformFnParams as s, transformProps as t, type FieldTransformFn as u, overrideKeys as v, walkTree as w, type OverrideKey as x, type FieldRenderFunctions as y, type ItemWithId as z };