@measured/puck 0.14.0-canary.3df6d96 → 0.14.0-canary.4c77ac5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{Config-ab049d49.d.ts → Config-29dc2731.d.ts} +23 -3
- package/dist/index.css +218 -153
- package/dist/index.d.ts +9 -6
- package/dist/index.js +1026 -437
- package/dist/rsc.d.ts +1 -1
- package/package.json +4 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CSSProperties,
|
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
|
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 { 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, Viewports as V, 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 };
|