@measured/puck 0.21.0-canary.e310a175 → 0.21.0-canary.e491598a

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 CHANGED
@@ -1,8 +1,8 @@
1
- import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-DkTSFbz_.mjs';
2
- export { a7 as Adaptor, a5 as ArrayField, B as ArrayState, al as AsFieldProps, N as BaseData, $ as BaseField, a9 as CacheOpts, Z as ComponentDataMap, X as ComponentDataOptionalId, _ as Content, ac as CustomField, ab as CustomFieldRender, ai as DefaultComponentProps, K as DefaultComponents, af as DefaultRootFieldProps, ah as DefaultRootProps, ag as DefaultRootRenderProps, o as Direction, p as DragAxis, aa as ExternalField, a8 as ExternalFieldWithAdaptor, L as ExtractConfigParams, an as ExtractField, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, Y as MappedItem, a1 as NumberField, a6 as ObjectField, x as OverrideKey, G as PuckComponent, ae as PuckContext, a4 as RadioField, J as RootConfig, T as RootData, Q as RootDataWithoutProps, a3 as SelectField, S as Slot, E as SlotComponent, ad as SlotField, a0 as TextField, a2 as TextareaField, q as Viewport, am as WithChildren, aj as WithId, ak as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DkTSFbz_.mjs';
1
+ import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, D as Data, h as OnAction, i as PrivateAppState, j as Field, k as FieldProps, l as DropZoneProps, n as InitialHistory, o as ItemSelector, p as PluginInternal } from './walk-tree-CL-j099F.mjs';
2
+ export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CL-j099F.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
5
+ import react__default, { Reducer, ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
6
6
 
7
7
  type HistorySlice<D = any> = {
8
8
  index: number;
@@ -75,6 +75,7 @@ type ComponentState = Record<string, {
75
75
  loadingCount: number;
76
76
  }>;
77
77
  type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
78
+ instanceId: string;
78
79
  state: G["UserAppState"];
79
80
  dispatch: (action: PuckAction) => void;
80
81
  config: UserConfig;
@@ -108,6 +109,13 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
108
109
  fieldTransforms: FieldTransforms;
109
110
  };
110
111
 
112
+ type StateReducer<UserData extends Data = Data> = Reducer<PrivateAppState<UserData>, PuckAction>;
113
+ declare function createReducer<UserData extends Data>({ record, onAction, appStore, }: {
114
+ record?: (appState: AppState<UserData>) => void;
115
+ onAction?: OnAction<UserData>;
116
+ appStore: AppStore;
117
+ }): StateReducer<UserData>;
118
+
111
119
  declare const ActionBar: {
112
120
  ({ label, children, }: {
113
121
  label?: string;
@@ -184,7 +192,7 @@ declare const Drawer: {
184
192
 
185
193
  declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
186
194
 
187
- declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
195
+ declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
188
196
  children: ReactNode;
189
197
  href?: string;
190
198
  onClick?: (e: SyntheticEvent) => void | Promise<void>;
@@ -195,6 +203,7 @@ declare const IconButton: ({ children, href, onClick, variant, type, disabled, t
195
203
  newTab?: boolean;
196
204
  fullWidth?: boolean;
197
205
  title: string;
206
+ suppressHydrationWarning?: boolean;
198
207
  }) => react_jsx_runtime.JSX.Element;
199
208
 
200
209
  type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
@@ -227,6 +236,8 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
227
236
  };
228
237
  initialHistory?: InitialHistory;
229
238
  metadata?: Metadata;
239
+ height?: CSSProperties["height"];
240
+ _experimentalFullScreenCanvas?: boolean;
230
241
  };
231
242
  declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
232
243
  declare namespace Puck {
@@ -302,4 +313,12 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
302
313
  */
303
314
  declare function useGetPuck(): () => UsePuckStore<Config>;
304
315
 
305
- export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
316
+ declare const blocksPlugin: () => Plugin;
317
+
318
+ declare const fieldsPlugin: (params?: {
319
+ mobileOnly?: boolean;
320
+ }) => PluginInternal;
321
+
322
+ declare const outlinePlugin: () => Plugin;
323
+
324
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createReducer, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-DkTSFbz_.js';
2
- export { a7 as Adaptor, a5 as ArrayField, B as ArrayState, al as AsFieldProps, N as BaseData, $ as BaseField, a9 as CacheOpts, Z as ComponentDataMap, X as ComponentDataOptionalId, _ as Content, ac as CustomField, ab as CustomFieldRender, ai as DefaultComponentProps, K as DefaultComponents, af as DefaultRootFieldProps, ah as DefaultRootProps, ag as DefaultRootRenderProps, o as Direction, p as DragAxis, aa as ExternalField, a8 as ExternalFieldWithAdaptor, L as ExtractConfigParams, an as ExtractField, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, Y as MappedItem, a1 as NumberField, a6 as ObjectField, x as OverrideKey, G as PuckComponent, ae as PuckContext, a4 as RadioField, J as RootConfig, T as RootData, Q as RootDataWithoutProps, a3 as SelectField, S as Slot, E as SlotComponent, ad as SlotField, a0 as TextField, a2 as TextareaField, q as Viewport, am as WithChildren, aj as WithId, ak as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DkTSFbz_.js';
1
+ import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, D as Data, h as OnAction, i as PrivateAppState, j as Field, k as FieldProps, l as DropZoneProps, n as InitialHistory, o as ItemSelector, p as PluginInternal } from './walk-tree-CL-j099F.js';
2
+ export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CL-j099F.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
5
+ import react__default, { Reducer, ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
6
6
 
7
7
  type HistorySlice<D = any> = {
8
8
  index: number;
@@ -75,6 +75,7 @@ type ComponentState = Record<string, {
75
75
  loadingCount: number;
76
76
  }>;
77
77
  type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
78
+ instanceId: string;
78
79
  state: G["UserAppState"];
79
80
  dispatch: (action: PuckAction) => void;
80
81
  config: UserConfig;
@@ -108,6 +109,13 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
108
109
  fieldTransforms: FieldTransforms;
109
110
  };
110
111
 
112
+ type StateReducer<UserData extends Data = Data> = Reducer<PrivateAppState<UserData>, PuckAction>;
113
+ declare function createReducer<UserData extends Data>({ record, onAction, appStore, }: {
114
+ record?: (appState: AppState<UserData>) => void;
115
+ onAction?: OnAction<UserData>;
116
+ appStore: AppStore;
117
+ }): StateReducer<UserData>;
118
+
111
119
  declare const ActionBar: {
112
120
  ({ label, children, }: {
113
121
  label?: string;
@@ -184,7 +192,7 @@ declare const Drawer: {
184
192
 
185
193
  declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
186
194
 
187
- declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
195
+ declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
188
196
  children: ReactNode;
189
197
  href?: string;
190
198
  onClick?: (e: SyntheticEvent) => void | Promise<void>;
@@ -195,6 +203,7 @@ declare const IconButton: ({ children, href, onClick, variant, type, disabled, t
195
203
  newTab?: boolean;
196
204
  fullWidth?: boolean;
197
205
  title: string;
206
+ suppressHydrationWarning?: boolean;
198
207
  }) => react_jsx_runtime.JSX.Element;
199
208
 
200
209
  type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
@@ -227,6 +236,8 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
227
236
  };
228
237
  initialHistory?: InitialHistory;
229
238
  metadata?: Metadata;
239
+ height?: CSSProperties["height"];
240
+ _experimentalFullScreenCanvas?: boolean;
230
241
  };
231
242
  declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
232
243
  declare namespace Puck {
@@ -302,4 +313,12 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
302
313
  */
303
314
  declare function useGetPuck(): () => UsePuckStore<Config>;
304
315
 
305
- export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
316
+ declare const blocksPlugin: () => Plugin;
317
+
318
+ declare const fieldsPlugin: (params?: {
319
+ mobileOnly?: boolean;
320
+ }) => PluginInternal;
321
+
322
+ declare const outlinePlugin: () => Plugin;
323
+
324
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createReducer, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };