@measured/puck 0.17.0-canary.35170f8 → 0.17.0-canary.858bfe7

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,10 @@ type DropZoneProps = {
10
10
  allow?: string[];
11
11
  disallow?: string[];
12
12
  style?: CSSProperties;
13
+ minEmptyHeight?: number;
14
+ className?: string;
15
+ dragRef?: ((element: Element | null) => void) | null;
16
+ collisionAxis?: DragAxis;
13
17
  };
14
18
 
15
19
  type FieldOption = {
@@ -139,12 +143,14 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
139
143
  defaultProps?: FieldProps;
140
144
  fields?: Fields<FieldProps>;
141
145
  permissions?: Partial<Permissions>;
146
+ inline?: boolean;
142
147
  resolveFields?: (data: DataShape, params: {
143
148
  changed: Partial<Record<keyof FieldProps, boolean>>;
144
149
  fields: Fields<FieldProps>;
145
150
  lastFields: Fields<FieldProps>;
146
151
  lastData: DataShape | null;
147
152
  appState: AppState;
153
+ parent: ComponentData | null;
148
154
  }) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
149
155
  resolveData?: (data: DataShape, params: {
150
156
  changed: Partial<Record<keyof FieldProps, boolean>>;
@@ -205,6 +211,7 @@ type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractP
205
211
  type PuckContext = {
206
212
  renderDropZone: React.FC<DropZoneProps>;
207
213
  isEditing: boolean;
214
+ dragRef: ((element: Element | null) => void) | null;
208
215
  };
209
216
  type DefaultRootFieldProps = {
210
217
  title?: string;
@@ -346,6 +353,9 @@ type FieldRenderFunctions = Omit<{
346
353
  }>;
347
354
  };
348
355
 
356
+ type Direction = "left" | "right" | "up" | "down" | null;
357
+ type DragAxis = "dynamic" | "y" | "x";
358
+
349
359
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
350
360
  type Viewport = {
351
361
  width: number;
@@ -448,4 +458,4 @@ type PuckAction = {
448
458
 
449
459
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
450
460
 
451
- export { type DefaultRootProps as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type ExtractPropsFromConfig as E, type FieldProps as F, type RadioField as G, type History as H, type ItemSelector as I, type ArrayField as J, type ObjectField as K, type Adaptor as L, type MappedItem as M, type NumberField as N, type OnAction as O, type PuckAction as P, type ExternalFieldWithAdaptor as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ExternalField as W, type CustomField as X, type Fields 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, resolveAllData as a4, type DropZoneProps as b, type UiState as c, type Permissions as d, type Plugin as e, type Overrides as f, type IframeConfig as g, type InitialHistory as h, type DefaultComponentProps as i, type DefaultRootFieldProps as j, type ExtractRootPropsFromConfig as k, type ComponentDataMap as l, type Viewport as m, type OverrideKey as n, overrideKeys as o, type FieldRenderFunctions as p, type ItemWithId as q, type ArrayState as r, type PuckComponent as s, type ComponentConfig as t, type RootDataWithoutProps as u, type RootData as v, type ComponentData as w, type Content as x, type BaseField as y, type TextareaField as z };
461
+ export { type PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type ExtractPropsFromConfig as E, type FieldProps as F, type BaseField as G, type History as H, type ItemSelector as I, type TextareaField as J, type RadioField as K, type ArrayField as L, type MappedItem as M, type NumberField as N, type OnAction as O, type PuckAction as P, type ObjectField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type Fields as _, type Field as a, type DefaultRootRenderProps as a0, type DefaultRootProps as a1, type WithId as a2, type WithPuckProps as a3, type AsFieldProps as a4, type WithChildren as a5, resolveAllData as a6, type DropZoneProps as b, type UiState as c, type Permissions as d, type Plugin as e, type Overrides as f, type IframeConfig as g, type InitialHistory as h, type DefaultComponentProps as i, type DefaultRootFieldProps as j, type ExtractRootPropsFromConfig as k, type ComponentDataMap 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 ComponentConfig as v, type RootDataWithoutProps as w, type RootData as x, type ComponentData as y, type Content as z };
@@ -10,6 +10,10 @@ type DropZoneProps = {
10
10
  allow?: string[];
11
11
  disallow?: string[];
12
12
  style?: CSSProperties;
13
+ minEmptyHeight?: number;
14
+ className?: string;
15
+ dragRef?: ((element: Element | null) => void) | null;
16
+ collisionAxis?: DragAxis;
13
17
  };
14
18
 
15
19
  type FieldOption = {
@@ -139,12 +143,14 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
139
143
  defaultProps?: FieldProps;
140
144
  fields?: Fields<FieldProps>;
141
145
  permissions?: Partial<Permissions>;
146
+ inline?: boolean;
142
147
  resolveFields?: (data: DataShape, params: {
143
148
  changed: Partial<Record<keyof FieldProps, boolean>>;
144
149
  fields: Fields<FieldProps>;
145
150
  lastFields: Fields<FieldProps>;
146
151
  lastData: DataShape | null;
147
152
  appState: AppState;
153
+ parent: ComponentData | null;
148
154
  }) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
149
155
  resolveData?: (data: DataShape, params: {
150
156
  changed: Partial<Record<keyof FieldProps, boolean>>;
@@ -205,6 +211,7 @@ type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractP
205
211
  type PuckContext = {
206
212
  renderDropZone: React.FC<DropZoneProps>;
207
213
  isEditing: boolean;
214
+ dragRef: ((element: Element | null) => void) | null;
208
215
  };
209
216
  type DefaultRootFieldProps = {
210
217
  title?: string;
@@ -346,6 +353,9 @@ type FieldRenderFunctions = Omit<{
346
353
  }>;
347
354
  };
348
355
 
356
+ type Direction = "left" | "right" | "up" | "down" | null;
357
+ type DragAxis = "dynamic" | "y" | "x";
358
+
349
359
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
350
360
  type Viewport = {
351
361
  width: number;
@@ -448,4 +458,4 @@ type PuckAction = {
448
458
 
449
459
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
450
460
 
451
- export { type DefaultRootProps as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type ExtractPropsFromConfig as E, type FieldProps as F, type RadioField as G, type History as H, type ItemSelector as I, type ArrayField as J, type ObjectField as K, type Adaptor as L, type MappedItem as M, type NumberField as N, type OnAction as O, type PuckAction as P, type ExternalFieldWithAdaptor as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ExternalField as W, type CustomField as X, type Fields 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, resolveAllData as a4, type DropZoneProps as b, type UiState as c, type Permissions as d, type Plugin as e, type Overrides as f, type IframeConfig as g, type InitialHistory as h, type DefaultComponentProps as i, type DefaultRootFieldProps as j, type ExtractRootPropsFromConfig as k, type ComponentDataMap as l, type Viewport as m, type OverrideKey as n, overrideKeys as o, type FieldRenderFunctions as p, type ItemWithId as q, type ArrayState as r, type PuckComponent as s, type ComponentConfig as t, type RootDataWithoutProps as u, type RootData as v, type ComponentData as w, type Content as x, type BaseField as y, type TextareaField as z };
461
+ export { type PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type ExtractPropsFromConfig as E, type FieldProps as F, type BaseField as G, type History as H, type ItemSelector as I, type TextareaField as J, type RadioField as K, type ArrayField as L, type MappedItem as M, type NumberField as N, type OnAction as O, type PuckAction as P, type ObjectField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type Fields as _, type Field as a, type DefaultRootRenderProps as a0, type DefaultRootProps as a1, type WithId as a2, type WithPuckProps as a3, type AsFieldProps as a4, type WithChildren as a5, resolveAllData as a6, type DropZoneProps as b, type UiState as c, type Permissions as d, type Plugin as e, type Overrides as f, type IframeConfig as g, type InitialHistory as h, type DefaultComponentProps as i, type DefaultRootFieldProps as j, type ExtractRootPropsFromConfig as k, type ComponentDataMap 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 ComponentConfig as v, type RootDataWithoutProps as w, type RootData as x, type ComponentData as y, type Content as z };
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, D as Data } from './resolve-all-data-Ch-Pcasj.mjs';
3
- export { a4 as resolveAllData } from './resolve-all-data-Ch-Pcasj.mjs';
2
+ import { C as Config, D as Data } from './resolve-all-data-Fx9YY5bj.mjs';
3
+ export { a6 as resolveAllData } from './resolve-all-data-Fx9YY5bj.mjs';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config>({ config, data, }: {
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, D as Data } from './resolve-all-data-Ch-Pcasj.js';
3
- export { a4 as resolveAllData } from './resolve-all-data-Ch-Pcasj.js';
2
+ import { C as Config, D as Data } from './resolve-all-data-Fx9YY5bj.js';
3
+ export { a6 as resolveAllData } from './resolve-all-data-Fx9YY5bj.js';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config>({ config, data, }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.17.0-canary.35170f8",
3
+ "version": "0.17.0-canary.858bfe7",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",
@@ -69,10 +69,12 @@
69
69
  "typescript": "^5.5.4"
70
70
  },
71
71
  "dependencies": {
72
+ "@dnd-kit/helpers": "0.0.6-beta-20241121223708",
73
+ "@dnd-kit/react": "0.0.6-beta-20241121223708",
72
74
  "@measured/dnd": "16.6.0-canary.4cba1d1",
73
75
  "deep-diff": "^1.0.2",
74
76
  "object-hash": "^3.0.0",
75
- "react-hotkeys-hook": "^4.4.1",
77
+ "react-hotkeys-hook": "^4.6.1",
76
78
  "ua-parser-js": "^1.0.37",
77
79
  "use-debounce": "^9.0.4",
78
80
  "uuid": "^9.0.1"