@measured/puck 0.20.0-canary.5780043 → 0.20.0-canary.5cc56415

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,5 +1,5 @@
1
- import { H as History, P as Permissions, C as ComponentData, a 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 Field, h as FieldProps, D as DropZoneProps, i as Data, j as OnAction, k as InitialHistory, l as ItemSelector } from './walk-tree-BDO40vbf.mjs';
2
- export { $ as Adaptor, Z as ArrayField, t as ArrayState, ac as AsFieldProps, B as BaseData, L as BaseField, J as ComponentDataMap, E as ComponentDataOptionalId, K as Content, a3 as CustomField, a2 as CustomFieldRender, a9 as DefaultComponentProps, a6 as DefaultRootFieldProps, a8 as DefaultRootProps, a7 as DefaultRootRenderProps, m as Direction, n as DragAxis, a1 as ExternalField, a0 as ExternalFieldWithAdaptor, ae as ExtractPropsFromConfig, af as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, G as MappedItem, N as NumberField, _ as ObjectField, q as OverrideKey, v as PuckComponent, a5 as PuckContext, Y as RadioField, x as RootConfig, z as RootData, y as RootDataWithoutProps, X as SelectField, S as Slot, u as SlotComponent, a4 as SlotField, T as TextField, Q as TextareaField, o as Viewport, ad as WithChildren, aa as WithId, ab as WithPuckProps, W as WithSlotProps, ag as migrate, p as overrideKeys, ai as resolveAllData, ah as transformProps, w as walkTree } from './walk-tree-BDO40vbf.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, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-yh0Fsxem.mjs';
2
+ export { a5 as Adaptor, a3 as ArrayField, B as ArrayState, ai as AsFieldProps, K as BaseData, Z as BaseField, X as ComponentDataMap, Q as ComponentDataOptionalId, Y as Content, a9 as CustomField, a8 as CustomFieldRender, af as DefaultComponentProps, ac as DefaultRootFieldProps, ae as DefaultRootProps, ad as DefaultRootRenderProps, o as Direction, p as DragAxis, a7 as ExternalField, a6 as ExternalFieldWithAdaptor, am as ExtractField, ak as ExtractPropsFromConfig, al as ExtractRootPropsFromConfig, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, T as MappedItem, $ as NumberField, a4 as ObjectField, x as OverrideKey, G as PuckComponent, ab as PuckContext, a2 as RadioField, J as RootConfig, N as RootData, L as RootDataWithoutProps, a1 as SelectField, S as Slot, E as SlotComponent, aa as SlotField, _ as TextField, a0 as TextareaField, q as Viewport, aj as WithChildren, ag as WithId, ah as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-yh0Fsxem.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
@@ -105,6 +105,7 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
105
105
  history: HistorySlice;
106
106
  nodes: NodesSlice;
107
107
  permissions: PermissionsSlice;
108
+ fieldTransforms: FieldTransforms;
108
109
  };
109
110
 
110
111
  declare const ActionBar: {
@@ -207,6 +208,7 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
207
208
  permissions?: Partial<Permissions>;
208
209
  plugins?: Plugin[];
209
210
  overrides?: Partial<Overrides>;
211
+ fieldTransforms?: FieldTransforms;
210
212
  renderHeader?: (props: {
211
213
  children: ReactNode;
212
214
  dispatch: (action: PuckAction) => void;
@@ -249,8 +251,18 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
249
251
  metadata?: Metadata;
250
252
  }): react_jsx_runtime.JSX.Element;
251
253
 
254
+ declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
255
+ disableDrag?: boolean;
256
+ disableDragOnFocus?: boolean;
257
+ }) => (() => void) | undefined;
258
+
259
+ /**
260
+ * Helper function to set a value based on a dot-notated path
261
+ */
262
+ declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
263
+
252
264
  type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
253
- appState: AppState;
265
+ appState: G["UserPublicAppState"];
254
266
  config: UserConfig;
255
267
  dispatch: AppStore["dispatch"];
256
268
  getPermissions: GetPermissions<UserConfig>;
@@ -290,4 +302,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
290
302
  */
291
303
  declare function useGetPuck(): () => UsePuckStore<Config>;
292
304
 
293
- export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, 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, renderContext, useGetPuck, usePuck };
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 };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as History, P as Permissions, C as ComponentData, a 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 Field, h as FieldProps, D as DropZoneProps, i as Data, j as OnAction, k as InitialHistory, l as ItemSelector } from './walk-tree-BDO40vbf.js';
2
- export { $ as Adaptor, Z as ArrayField, t as ArrayState, ac as AsFieldProps, B as BaseData, L as BaseField, J as ComponentDataMap, E as ComponentDataOptionalId, K as Content, a3 as CustomField, a2 as CustomFieldRender, a9 as DefaultComponentProps, a6 as DefaultRootFieldProps, a8 as DefaultRootProps, a7 as DefaultRootRenderProps, m as Direction, n as DragAxis, a1 as ExternalField, a0 as ExternalFieldWithAdaptor, ae as ExtractPropsFromConfig, af as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, G as MappedItem, N as NumberField, _ as ObjectField, q as OverrideKey, v as PuckComponent, a5 as PuckContext, Y as RadioField, x as RootConfig, z as RootData, y as RootDataWithoutProps, X as SelectField, S as Slot, u as SlotComponent, a4 as SlotField, T as TextField, Q as TextareaField, o as Viewport, ad as WithChildren, aa as WithId, ab as WithPuckProps, W as WithSlotProps, ag as migrate, p as overrideKeys, ai as resolveAllData, ah as transformProps, w as walkTree } from './walk-tree-BDO40vbf.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, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-yh0Fsxem.js';
2
+ export { a5 as Adaptor, a3 as ArrayField, B as ArrayState, ai as AsFieldProps, K as BaseData, Z as BaseField, X as ComponentDataMap, Q as ComponentDataOptionalId, Y as Content, a9 as CustomField, a8 as CustomFieldRender, af as DefaultComponentProps, ac as DefaultRootFieldProps, ae as DefaultRootProps, ad as DefaultRootRenderProps, o as Direction, p as DragAxis, a7 as ExternalField, a6 as ExternalFieldWithAdaptor, am as ExtractField, ak as ExtractPropsFromConfig, al as ExtractRootPropsFromConfig, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, T as MappedItem, $ as NumberField, a4 as ObjectField, x as OverrideKey, G as PuckComponent, ab as PuckContext, a2 as RadioField, J as RootConfig, N as RootData, L as RootDataWithoutProps, a1 as SelectField, S as Slot, E as SlotComponent, aa as SlotField, _ as TextField, a0 as TextareaField, q as Viewport, aj as WithChildren, ag as WithId, ah as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-yh0Fsxem.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
@@ -105,6 +105,7 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
105
105
  history: HistorySlice;
106
106
  nodes: NodesSlice;
107
107
  permissions: PermissionsSlice;
108
+ fieldTransforms: FieldTransforms;
108
109
  };
109
110
 
110
111
  declare const ActionBar: {
@@ -207,6 +208,7 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
207
208
  permissions?: Partial<Permissions>;
208
209
  plugins?: Plugin[];
209
210
  overrides?: Partial<Overrides>;
211
+ fieldTransforms?: FieldTransforms;
210
212
  renderHeader?: (props: {
211
213
  children: ReactNode;
212
214
  dispatch: (action: PuckAction) => void;
@@ -249,8 +251,18 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
249
251
  metadata?: Metadata;
250
252
  }): react_jsx_runtime.JSX.Element;
251
253
 
254
+ declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
255
+ disableDrag?: boolean;
256
+ disableDragOnFocus?: boolean;
257
+ }) => (() => void) | undefined;
258
+
259
+ /**
260
+ * Helper function to set a value based on a dot-notated path
261
+ */
262
+ declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
263
+
252
264
  type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
253
- appState: AppState;
265
+ appState: G["UserPublicAppState"];
254
266
  config: UserConfig;
255
267
  dispatch: AppStore["dispatch"];
256
268
  getPermissions: GetPermissions<UserConfig>;
@@ -290,4 +302,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
290
302
  */
291
303
  declare function useGetPuck(): () => UsePuckStore<Config>;
292
304
 
293
- export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, 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, renderContext, useGetPuck, usePuck };
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 };