@measured/puck 0.20.0-canary.3badc0ce → 0.20.0-canary.3d781f5a

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.
@@ -13,10 +13,11 @@ import {
13
13
  Render,
14
14
  createUsePuck,
15
15
  overrideKeys,
16
+ registerOverlayPortal,
16
17
  renderContext,
17
18
  useGetPuck,
18
19
  usePuck
19
- } from "./chunk-H4AGHNLK.mjs";
20
+ } from "./chunk-5HI4IJHF.mjs";
20
21
  import {
21
22
  init_react_import,
22
23
  migrate,
@@ -43,6 +44,7 @@ export {
43
44
  createUsePuck,
44
45
  migrate,
45
46
  overrideKeys,
47
+ registerOverlayPortal,
46
48
  renderContext,
47
49
  resolveAllData,
48
50
  transformProps,
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-6p9XnDIV.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-6p9XnDIV.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-mCPqBAls.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-mCPqBAls.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-6p9XnDIV.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-6p9XnDIV.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-mCPqBAls.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-mCPqBAls.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, }: {
@@ -17,7 +17,7 @@ type DropZoneProps = {
17
17
 
18
18
  type FieldOption = {
19
19
  label: string;
20
- value: string | number | boolean;
20
+ value: string | number | boolean | undefined | null | object;
21
21
  };
22
22
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
23
23
  type BaseField = {
@@ -209,12 +209,13 @@ type WithChildren<Props> = Props & {
209
209
  };
210
210
  type ExtractPropsFromConfig<UserConfig> = UserConfig extends Config<infer P, any, any> ? P : never;
211
211
  type ExtractRootPropsFromConfig<UserConfig> = UserConfig extends Config<any, infer P, any> ? P : never;
212
- 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]> = {
212
+ 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>, UserPublicAppState extends AppState<UserData> = AppState<UserData>, UserComponentData extends ComponentData = UserData["content"][0]> = {
213
213
  UserConfig: UserConfig;
214
214
  UserProps: UserProps;
215
215
  UserRootProps: UserRootProps;
216
216
  UserData: UserData;
217
217
  UserAppState: UserAppState;
218
+ UserPublicAppState: UserPublicAppState;
218
219
  UserComponentData: UserComponentData;
219
220
  };
220
221
 
@@ -285,6 +286,8 @@ type ArrayState = {
285
286
  type UiState = {
286
287
  leftSideBarVisible: boolean;
287
288
  rightSideBarVisible: boolean;
289
+ leftSideBarWidth?: number | null;
290
+ rightSideBarWidth?: number | null;
288
291
  itemSelector: ItemSelector | null;
289
292
  arrayState: Record<string, ArrayState | undefined>;
290
293
  previewMode: "interactive" | "edit";
@@ -346,7 +349,7 @@ type RenderFunc<Props extends {
346
349
  } = {
347
350
  children: ReactNode;
348
351
  }> = (props: Props) => ReactElement;
349
- declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "components", "componentItem", "outline", "puck", "preview"];
352
+ declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
350
353
  type OverrideKey = (typeof overrideKeys)[number];
351
354
  type OverridesGeneric<Shape extends {
352
355
  [key in OverrideKey]: any;
@@ -384,11 +387,23 @@ type Overrides = OverridesGeneric<{
384
387
  children: ReactNode;
385
388
  name: string;
386
389
  }>;
390
+ drawer: RenderFunc;
391
+ drawerItem: RenderFunc<{
392
+ children: ReactNode;
393
+ name: string;
394
+ }>;
387
395
  iframe: RenderFunc<{
388
396
  children: ReactNode;
389
397
  document?: Document;
390
398
  }>;
391
399
  outline: RenderFunc;
400
+ componentOverlay: RenderFunc<{
401
+ children: ReactNode;
402
+ hover: boolean;
403
+ isSelected: boolean;
404
+ componentId: string;
405
+ componentType: string;
406
+ }>;
392
407
  puck: RenderFunc;
393
408
  }>;
394
409
  type FieldRenderFunctions = Omit<{
@@ -548,4 +563,4 @@ type WalkTreeOptions = {
548
563
  };
549
564
  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;
550
565
 
551
- export { type ArrayField as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type RootDataWithoutProps as E, type Fields as F, type RootData as G, type History as H, type IframeConfig as I, type ComponentDataOptionalId as J, type MappedItem as K, type ComponentDataMap as L, type Metadata as M, type Content as N, type Overrides as O, type Permissions as P, type BaseField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type NumberField as X, type TextareaField as Y, type SelectField as Z, type RadioField as _, type ComponentData as a, type ObjectField as a0, type Adaptor as a1, type ExternalFieldWithAdaptor as a2, type ExternalField as a3, type CustomFieldRender as a4, type CustomField as a5, type SlotField as a6, type PuckContext as a7, type DefaultRootFieldProps as a8, type DefaultRootRenderProps as a9, type DefaultRootProps as aa, type DefaultComponentProps as ab, type WithId as ac, type WithPuckProps as ad, type AsFieldProps as ae, type WithChildren as af, type ExtractPropsFromConfig as ag, type ExtractRootPropsFromConfig as ah, 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 ItemSelector as l, migrate as m, type Direction as n, type DragAxis as o, type Viewport as p, overrideKeys as q, resolveAllData as r, type OverrideKey as s, transformProps as t, type FieldRenderFunctions as u, type ItemWithId as v, walkTree as w, type ArrayState as x, type PuckComponent as y, type RootConfig as z };
566
+ export { type RadioField as $, type AppState as A, type RootConfig as B, type Config as C, type DropZoneProps as D, type BaseData as E, type Fields as F, type RootDataWithoutProps as G, type History as H, type IframeConfig as I, type RootData as J, type ComponentDataOptionalId as K, type MappedItem as L, type Metadata as M, type ComponentDataMap as N, type Overrides as O, type Permissions as P, type Content as Q, type RootDataWithProps as R, type Slot as S, type BaseField as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type TextField as X, type NumberField as Y, type TextareaField as Z, type SelectField as _, type ComponentData as a, type ArrayField as a0, type ObjectField as a1, type Adaptor as a2, type ExternalFieldWithAdaptor as a3, type ExternalField as a4, type CustomFieldRender as a5, type CustomField as a6, type SlotField as a7, type PuckContext as a8, type DefaultRootFieldProps as a9, type DefaultRootRenderProps as aa, type DefaultRootProps as ab, type DefaultComponentProps as ac, type WithId as ad, type WithPuckProps as ae, type AsFieldProps as af, type WithChildren as ag, type ExtractPropsFromConfig as ah, type ExtractRootPropsFromConfig as ai, 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 ItemSelector as l, migrate as m, type Direction as n, type DragAxis as o, type Viewport as p, overrideKeys as q, resolveAllData as r, type OverrideKey as s, transformProps as t, type FieldRenderFunctions as u, type ItemWithId as v, walkTree as w, type ArrayState as x, type SlotComponent as y, type PuckComponent as z };
@@ -17,7 +17,7 @@ type DropZoneProps = {
17
17
 
18
18
  type FieldOption = {
19
19
  label: string;
20
- value: string | number | boolean;
20
+ value: string | number | boolean | undefined | null | object;
21
21
  };
22
22
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
23
23
  type BaseField = {
@@ -209,12 +209,13 @@ type WithChildren<Props> = Props & {
209
209
  };
210
210
  type ExtractPropsFromConfig<UserConfig> = UserConfig extends Config<infer P, any, any> ? P : never;
211
211
  type ExtractRootPropsFromConfig<UserConfig> = UserConfig extends Config<any, infer P, any> ? P : never;
212
- 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]> = {
212
+ 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>, UserPublicAppState extends AppState<UserData> = AppState<UserData>, UserComponentData extends ComponentData = UserData["content"][0]> = {
213
213
  UserConfig: UserConfig;
214
214
  UserProps: UserProps;
215
215
  UserRootProps: UserRootProps;
216
216
  UserData: UserData;
217
217
  UserAppState: UserAppState;
218
+ UserPublicAppState: UserPublicAppState;
218
219
  UserComponentData: UserComponentData;
219
220
  };
220
221
 
@@ -285,6 +286,8 @@ type ArrayState = {
285
286
  type UiState = {
286
287
  leftSideBarVisible: boolean;
287
288
  rightSideBarVisible: boolean;
289
+ leftSideBarWidth?: number | null;
290
+ rightSideBarWidth?: number | null;
288
291
  itemSelector: ItemSelector | null;
289
292
  arrayState: Record<string, ArrayState | undefined>;
290
293
  previewMode: "interactive" | "edit";
@@ -346,7 +349,7 @@ type RenderFunc<Props extends {
346
349
  } = {
347
350
  children: ReactNode;
348
351
  }> = (props: Props) => ReactElement;
349
- declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "components", "componentItem", "outline", "puck", "preview"];
352
+ declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
350
353
  type OverrideKey = (typeof overrideKeys)[number];
351
354
  type OverridesGeneric<Shape extends {
352
355
  [key in OverrideKey]: any;
@@ -384,11 +387,23 @@ type Overrides = OverridesGeneric<{
384
387
  children: ReactNode;
385
388
  name: string;
386
389
  }>;
390
+ drawer: RenderFunc;
391
+ drawerItem: RenderFunc<{
392
+ children: ReactNode;
393
+ name: string;
394
+ }>;
387
395
  iframe: RenderFunc<{
388
396
  children: ReactNode;
389
397
  document?: Document;
390
398
  }>;
391
399
  outline: RenderFunc;
400
+ componentOverlay: RenderFunc<{
401
+ children: ReactNode;
402
+ hover: boolean;
403
+ isSelected: boolean;
404
+ componentId: string;
405
+ componentType: string;
406
+ }>;
392
407
  puck: RenderFunc;
393
408
  }>;
394
409
  type FieldRenderFunctions = Omit<{
@@ -548,4 +563,4 @@ type WalkTreeOptions = {
548
563
  };
549
564
  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;
550
565
 
551
- export { type ArrayField as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type RootDataWithoutProps as E, type Fields as F, type RootData as G, type History as H, type IframeConfig as I, type ComponentDataOptionalId as J, type MappedItem as K, type ComponentDataMap as L, type Metadata as M, type Content as N, type Overrides as O, type Permissions as P, type BaseField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type NumberField as X, type TextareaField as Y, type SelectField as Z, type RadioField as _, type ComponentData as a, type ObjectField as a0, type Adaptor as a1, type ExternalFieldWithAdaptor as a2, type ExternalField as a3, type CustomFieldRender as a4, type CustomField as a5, type SlotField as a6, type PuckContext as a7, type DefaultRootFieldProps as a8, type DefaultRootRenderProps as a9, type DefaultRootProps as aa, type DefaultComponentProps as ab, type WithId as ac, type WithPuckProps as ad, type AsFieldProps as ae, type WithChildren as af, type ExtractPropsFromConfig as ag, type ExtractRootPropsFromConfig as ah, 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 ItemSelector as l, migrate as m, type Direction as n, type DragAxis as o, type Viewport as p, overrideKeys as q, resolveAllData as r, type OverrideKey as s, transformProps as t, type FieldRenderFunctions as u, type ItemWithId as v, walkTree as w, type ArrayState as x, type PuckComponent as y, type RootConfig as z };
566
+ export { type RadioField as $, type AppState as A, type RootConfig as B, type Config as C, type DropZoneProps as D, type BaseData as E, type Fields as F, type RootDataWithoutProps as G, type History as H, type IframeConfig as I, type RootData as J, type ComponentDataOptionalId as K, type MappedItem as L, type Metadata as M, type ComponentDataMap as N, type Overrides as O, type Permissions as P, type Content as Q, type RootDataWithProps as R, type Slot as S, type BaseField as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type TextField as X, type NumberField as Y, type TextareaField as Z, type SelectField as _, type ComponentData as a, type ArrayField as a0, type ObjectField as a1, type Adaptor as a2, type ExternalFieldWithAdaptor as a3, type ExternalField as a4, type CustomFieldRender as a5, type CustomField as a6, type SlotField as a7, type PuckContext as a8, type DefaultRootFieldProps as a9, type DefaultRootRenderProps as aa, type DefaultRootProps as ab, type DefaultComponentProps as ac, type WithId as ad, type WithPuckProps as ae, type AsFieldProps as af, type WithChildren as ag, type ExtractPropsFromConfig as ah, type ExtractRootPropsFromConfig as ai, 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 ItemSelector as l, migrate as m, type Direction as n, type DragAxis as o, type Viewport as p, overrideKeys as q, resolveAllData as r, type OverrideKey as s, transformProps as t, type FieldRenderFunctions as u, type ItemWithId as v, walkTree as w, type ArrayState as x, type SlotComponent as y, type PuckComponent as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.20.0-canary.3badc0ce",
3
+ "version": "0.20.0-canary.3d781f5a",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",