@measured/puck 0.14.0-canary.cc7d391 → 0.14.0-canary.d944288

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ReactElement, ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode, ReactElement } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  type ItemSelector = {
@@ -14,6 +14,15 @@ type DropZoneProps = {
14
14
  };
15
15
  declare function DropZone(props: DropZoneProps): react_jsx_runtime.JSX.Element;
16
16
 
17
+ type iconTypes = "Smartphone" | "Monitor" | "Tablet";
18
+ type Viewport = {
19
+ width: number;
20
+ height?: number | "auto";
21
+ label?: string;
22
+ icon?: iconTypes | ReactNode;
23
+ };
24
+ type Viewports = Viewport[];
25
+
17
26
  type WithPuckProps<Props> = Props & {
18
27
  id: string;
19
28
  };
@@ -55,6 +64,8 @@ type ArrayField<Props extends {
55
64
  };
56
65
  defaultItemProps?: Props[0];
57
66
  getItemSummary?: (item: Props[0], index?: number) => string;
67
+ max?: number;
68
+ min?: number;
58
69
  };
59
70
  type ObjectField<Props extends {
60
71
  [key: string]: any;
@@ -63,7 +74,7 @@ type ObjectField<Props extends {
63
74
  }> = BaseField & {
64
75
  type: "object";
65
76
  objectFields: {
66
- [SubPropName in keyof Props[0]]: Field<Props[0][SubPropName]>;
77
+ [SubPropName in keyof Props]: Field<Props[SubPropName]>;
67
78
  };
68
79
  };
69
80
  type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, PropShape = TableShape> = {
@@ -144,6 +155,7 @@ type PuckContext = {
144
155
  };
145
156
  type ComponentConfig<ComponentProps extends DefaultComponentProps = DefaultComponentProps, DefaultProps = ComponentProps, DataShape = ComponentData<ComponentProps>> = {
146
157
  render: PuckComponent<ComponentProps>;
158
+ label?: string;
147
159
  defaultProps?: DefaultProps;
148
160
  fields?: Fields<ComponentProps>;
149
161
  resolveData?: (data: DataShape, params: {
@@ -222,10 +234,18 @@ type UiState = {
222
234
  expanded?: boolean;
223
235
  }>;
224
236
  isDragging: boolean;
237
+ viewports: {
238
+ current: {
239
+ width: number;
240
+ height: number | "auto";
241
+ };
242
+ controlsVisible: boolean;
243
+ options: Viewport[];
244
+ };
225
245
  };
226
246
  type AppState = {
227
247
  data: Data;
228
248
  ui: UiState;
229
249
  };
230
250
 
231
- export { AppState as A, BaseField as B, Config as C, Data as D, ExternalFieldWithAdaptor as E, Field as F, ItemSelector as I, MappedItem as M, NumberField as N, ObjectField as O, PuckComponent as P, RootDataWithProps as R, SelectField as S, TextField as T, UiState as U, DefaultComponentProps as a, DefaultRootProps as b, RootData as c, TextareaField as d, RadioField as e, ArrayField as f, Adaptor as g, ExternalField as h, CustomField as i, Fields as j, Content as k, PuckContext as l, ComponentConfig as m, BaseData as n, ComponentData as o, RootDataWithoutProps as p, ItemWithId as q, ArrayState as r, DropZone as s };
251
+ export { type AppState as A, type BaseField as B, type Config as C, type Data as D, type ExternalFieldWithAdaptor as E, type Field as F, type ItemSelector as I, type MappedItem as M, type NumberField as N, type ObjectField as O, type PuckComponent as P, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UiState as U, type Viewports as V, type DefaultComponentProps as a, type DefaultRootProps as b, type RootData as c, type TextareaField as d, type RadioField as e, type ArrayField as f, type Adaptor as g, type ExternalField as h, type CustomField as i, type Fields as j, type Content as k, type PuckContext as l, type ComponentConfig as m, type BaseData as n, type ComponentData as o, type RootDataWithoutProps as p, type ItemWithId as q, type ArrayState as r, DropZone as s };