@measured/puck 0.17.0-canary.8ea38c3 → 0.17.0-canary.c3557ab

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 = {
@@ -94,6 +98,9 @@ type ExternalField<Props extends {
94
98
  mapRow?: (value: any) => Record<string, string | number | ReactElement>;
95
99
  getItemSummary?: (item: Props, index?: number) => string;
96
100
  showSearch?: boolean;
101
+ renderFooter?: (props: {
102
+ items: any[];
103
+ }) => ReactElement;
97
104
  initialQuery?: string;
98
105
  filterFields?: Record<string, Field>;
99
106
  initialFilters?: Record<string, any>;
@@ -136,12 +143,14 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
136
143
  defaultProps?: FieldProps;
137
144
  fields?: Fields<FieldProps>;
138
145
  permissions?: Partial<Permissions>;
146
+ inline?: boolean;
139
147
  resolveFields?: (data: DataShape, params: {
140
148
  changed: Partial<Record<keyof FieldProps, boolean>>;
141
149
  fields: Fields<FieldProps>;
142
150
  lastFields: Fields<FieldProps>;
143
151
  lastData: DataShape | null;
144
152
  appState: AppState;
153
+ parent: ComponentData | null;
145
154
  }) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
146
155
  resolveData?: (data: DataShape, params: {
147
156
  changed: Partial<Record<keyof FieldProps, boolean>>;
@@ -202,6 +211,7 @@ type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractP
202
211
  type PuckContext = {
203
212
  renderDropZone: React.FC<DropZoneProps>;
204
213
  isEditing: boolean;
214
+ dragRef: ((element: Element | null) => void) | null;
205
215
  };
206
216
  type DefaultRootFieldProps = {
207
217
  title?: string;
@@ -271,6 +281,9 @@ type UiState = {
271
281
  controlsVisible: boolean;
272
282
  options: Viewport[];
273
283
  };
284
+ field: {
285
+ focus?: string | null;
286
+ };
274
287
  };
275
288
  type AppState<UserData extends Data = Data> = {
276
289
  data: UserData;
@@ -340,6 +353,9 @@ type FieldRenderFunctions = Omit<{
340
353
  }>;
341
354
  };
342
355
 
356
+ type Direction = "left" | "right" | "up" | "down" | null;
357
+ type DragAxis = "dynamic" | "y" | "x";
358
+
343
359
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
344
360
  type Viewport = {
345
361
  width: number;
@@ -442,4 +458,4 @@ type PuckAction = {
442
458
 
443
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>>;
444
460
 
445
- 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 = {
@@ -94,6 +98,9 @@ type ExternalField<Props extends {
94
98
  mapRow?: (value: any) => Record<string, string | number | ReactElement>;
95
99
  getItemSummary?: (item: Props, index?: number) => string;
96
100
  showSearch?: boolean;
101
+ renderFooter?: (props: {
102
+ items: any[];
103
+ }) => ReactElement;
97
104
  initialQuery?: string;
98
105
  filterFields?: Record<string, Field>;
99
106
  initialFilters?: Record<string, any>;
@@ -136,12 +143,14 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
136
143
  defaultProps?: FieldProps;
137
144
  fields?: Fields<FieldProps>;
138
145
  permissions?: Partial<Permissions>;
146
+ inline?: boolean;
139
147
  resolveFields?: (data: DataShape, params: {
140
148
  changed: Partial<Record<keyof FieldProps, boolean>>;
141
149
  fields: Fields<FieldProps>;
142
150
  lastFields: Fields<FieldProps>;
143
151
  lastData: DataShape | null;
144
152
  appState: AppState;
153
+ parent: ComponentData | null;
145
154
  }) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
146
155
  resolveData?: (data: DataShape, params: {
147
156
  changed: Partial<Record<keyof FieldProps, boolean>>;
@@ -202,6 +211,7 @@ type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractP
202
211
  type PuckContext = {
203
212
  renderDropZone: React.FC<DropZoneProps>;
204
213
  isEditing: boolean;
214
+ dragRef: ((element: Element | null) => void) | null;
205
215
  };
206
216
  type DefaultRootFieldProps = {
207
217
  title?: string;
@@ -271,6 +281,9 @@ type UiState = {
271
281
  controlsVisible: boolean;
272
282
  options: Viewport[];
273
283
  };
284
+ field: {
285
+ focus?: string | null;
286
+ };
274
287
  };
275
288
  type AppState<UserData extends Data = Data> = {
276
289
  data: UserData;
@@ -340,6 +353,9 @@ type FieldRenderFunctions = Omit<{
340
353
  }>;
341
354
  };
342
355
 
356
+ type Direction = "left" | "right" | "up" | "down" | null;
357
+ type DragAxis = "dynamic" | "y" | "x";
358
+
343
359
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
344
360
  type Viewport = {
345
361
  width: number;
@@ -442,4 +458,4 @@ type PuckAction = {
442
458
 
443
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>>;
444
460
 
445
- 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-CaVk1fIL.mjs';
3
- export { a4 as resolveAllData } from './resolve-all-data-CaVk1fIL.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-CaVk1fIL.js';
3
- export { a4 as resolveAllData } from './resolve-all-data-CaVk1fIL.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.8ea38c3",
3
+ "version": "0.17.0-canary.c3557ab",
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"