@measured/puck 0.16.0-canary.538cb05 → 0.16.0-canary.60fe631
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{Config-041c35a2.d.ts → Config-VOJqVbHe.d.ts} +2 -2
- package/dist/index.d.ts +37 -37
- package/dist/index.js +1591 -2177
- package/dist/rsc.d.ts +1 -1
- package/package.json +4 -4
@@ -68,7 +68,7 @@ type ObjectField<Props extends {
|
|
68
68
|
[key: string]: any;
|
69
69
|
}> = BaseField & {
|
70
70
|
type: "object";
|
71
|
-
objectFields: {
|
71
|
+
objectFields: Props extends any[] ? never : {
|
72
72
|
[SubPropName in keyof Props]: Field<Props[SubPropName]>;
|
73
73
|
};
|
74
74
|
};
|
@@ -259,4 +259,4 @@ type AppState = {
|
|
259
259
|
ui: UiState;
|
260
260
|
};
|
261
261
|
|
262
|
-
export { AppState as A, BaseData 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,
|
262
|
+
export type { AppState as A, BaseData 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, RootData as R, SelectField as S, TextField as T, UiState as U, Viewports as V, FieldProps as a, DropZoneProps as b, DefaultComponentProps as c, DefaultRootProps as d, RootDataWithProps as e, ComponentData as f, Content as g, PuckContext as h, ComponentConfig as i, RootDataWithoutProps as j, ItemWithId as k, ArrayState as l, BaseField as m, TextareaField as n, RadioField as o, ArrayField as p, Adaptor as q, ExternalField as r, CustomField as s, Fields as t };
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { U as UiState, D as Data, A as AppState, I as ItemSelector, F as Field, a as FieldProps, C as Config, b as
|
2
|
-
export { q as Adaptor, p as ArrayField, l as ArrayState, B as BaseData, m as BaseField, i as ComponentConfig, g as Content, s as CustomField, r as ExternalField, E as ExternalFieldWithAdaptor, t as Fields, k as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, h as PuckContext, o as RadioField, j as RootDataWithoutProps, S as SelectField, T as TextField, n as TextareaField } from './Config-
|
1
|
+
import { U as UiState, D as Data, A as AppState, I as ItemSelector, F as Field, a as FieldProps, C as Config, b as DropZoneProps, V as Viewports, c as DefaultComponentProps, d as DefaultRootProps, M as MappedItem, R as RootData, e as RootDataWithProps, f as ComponentData } from './Config-VOJqVbHe.js';
|
2
|
+
export { q as Adaptor, p as ArrayField, l as ArrayState, B as BaseData, m as BaseField, i as ComponentConfig, g as Content, s as CustomField, r as ExternalField, E as ExternalFieldWithAdaptor, t as Fields, k as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, h as PuckContext, o as RadioField, j as RootDataWithoutProps, S as SelectField, T as TextField, n as TextareaField } from './Config-VOJqVbHe.js';
|
3
3
|
import * as react from 'react';
|
4
4
|
import { ReactNode, ReactElement, CSSProperties, SyntheticEvent } from 'react';
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
@@ -127,9 +127,9 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
|
|
127
127
|
children?: ReactNode;
|
128
128
|
icon?: ReactNode;
|
129
129
|
label: string;
|
130
|
-
el?: "label" | "div"
|
131
|
-
readOnly?: boolean
|
132
|
-
className?: string
|
130
|
+
el?: "label" | "div";
|
131
|
+
readOnly?: boolean;
|
132
|
+
className?: string;
|
133
133
|
}) => react_jsx_runtime.JSX.Element;
|
134
134
|
type FieldLabelPropsInternal = {
|
135
135
|
children?: ReactNode;
|
@@ -157,33 +157,33 @@ declare function AutoField<ValueType = any, FieldType extends Field<ValueType> =
|
|
157
157
|
|
158
158
|
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, }: {
|
159
159
|
children: ReactNode;
|
160
|
-
href?: string
|
161
|
-
onClick?: (
|
162
|
-
variant?: "primary" | "secondary"
|
163
|
-
type?: "button" | "submit" | "reset"
|
164
|
-
disabled?: boolean
|
165
|
-
tabIndex?: number
|
166
|
-
newTab?: boolean
|
167
|
-
fullWidth?: boolean
|
160
|
+
href?: string;
|
161
|
+
onClick?: (e: any) => void | Promise<void>;
|
162
|
+
variant?: "primary" | "secondary";
|
163
|
+
type?: "button" | "submit" | "reset";
|
164
|
+
disabled?: boolean;
|
165
|
+
tabIndex?: number;
|
166
|
+
newTab?: boolean;
|
167
|
+
fullWidth?: boolean;
|
168
168
|
icon?: ReactNode;
|
169
|
-
size?: "medium" | "large"
|
170
|
-
loading?: boolean
|
169
|
+
size?: "medium" | "large";
|
170
|
+
loading?: boolean;
|
171
171
|
}) => react_jsx_runtime.JSX.Element;
|
172
172
|
|
173
173
|
declare const Drawer: {
|
174
174
|
({ children, droppableId: _droppableId, direction, }: {
|
175
175
|
children: ReactNode;
|
176
|
-
droppableId?: string
|
177
|
-
direction?: "vertical" | "horizontal"
|
176
|
+
droppableId?: string;
|
177
|
+
direction?: "vertical" | "horizontal";
|
178
178
|
}): react_jsx_runtime.JSX.Element;
|
179
179
|
Item: ({ name, children, id, label, index, }: {
|
180
180
|
name: string;
|
181
|
-
children?: (
|
181
|
+
children?: (props: {
|
182
182
|
children: ReactNode;
|
183
183
|
name: string;
|
184
|
-
}) => ReactElement
|
185
|
-
id?: string
|
186
|
-
label?: string
|
184
|
+
}) => ReactElement;
|
185
|
+
id?: string;
|
186
|
+
label?: string;
|
187
187
|
index: number;
|
188
188
|
}) => react_jsx_runtime.JSX.Element;
|
189
189
|
};
|
@@ -238,7 +238,7 @@ type DropZoneContext<UserConfig extends Config = Config> = {
|
|
238
238
|
zoneWillDrag?: string;
|
239
239
|
setZoneWillDrag?: (zone: string) => void;
|
240
240
|
} | null;
|
241
|
-
declare const dropZoneContext: react.Context<DropZoneContext<Config
|
241
|
+
declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
|
242
242
|
declare const DropZoneProvider: ({ children, value, }: {
|
243
243
|
children: ReactNode;
|
244
244
|
value: DropZoneContext;
|
@@ -248,14 +248,14 @@ declare function DropZone(props: DropZoneProps): react_jsx_runtime.JSX.Element;
|
|
248
248
|
|
249
249
|
declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
250
250
|
children: ReactNode;
|
251
|
-
href?: string
|
252
|
-
onClick?: (
|
253
|
-
variant?: "primary" | "secondary"
|
254
|
-
type?: "button" | "submit" | "reset"
|
255
|
-
disabled?: boolean
|
256
|
-
tabIndex?: number
|
257
|
-
newTab?: boolean
|
258
|
-
fullWidth?: boolean
|
251
|
+
href?: string;
|
252
|
+
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
253
|
+
variant?: "primary" | "secondary";
|
254
|
+
type?: "button" | "submit" | "reset";
|
255
|
+
disabled?: boolean;
|
256
|
+
tabIndex?: number;
|
257
|
+
newTab?: boolean;
|
258
|
+
fullWidth?: boolean;
|
259
259
|
title: string;
|
260
260
|
}) => react_jsx_runtime.JSX.Element;
|
261
261
|
|
@@ -298,7 +298,7 @@ declare namespace Puck {
|
|
298
298
|
var Fields: () => react_jsx_runtime.JSX.Element;
|
299
299
|
var Outline: () => react_jsx_runtime.JSX.Element;
|
300
300
|
var Preview: ({ id }: {
|
301
|
-
id?: string
|
301
|
+
id?: string;
|
302
302
|
}) => react_jsx_runtime.JSX.Element;
|
303
303
|
}
|
304
304
|
|
@@ -321,29 +321,29 @@ type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps,
|
|
321
321
|
declare function transformProps<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultComponentProps>(data: Partial<Data>, propTransforms: PropTransform<Props, RootProps>): Data;
|
322
322
|
|
323
323
|
declare function resolveAllData(data: Partial<Data>, config: Config, onResolveStart?: (item: MappedItem) => void, onResolveEnd?: (item: MappedItem) => void): Promise<{
|
324
|
-
root:
|
325
|
-
content: any
|
324
|
+
root: RootData<DefaultRootProps> | RootDataWithProps;
|
325
|
+
content: any;
|
326
326
|
zones: Record<string, MappedItem[]>;
|
327
327
|
}>;
|
328
328
|
|
329
329
|
declare const usePuck: () => {
|
330
330
|
appState: AppState;
|
331
|
-
config: Config
|
331
|
+
config: Config;
|
332
332
|
dispatch: (action: PuckAction) => void;
|
333
333
|
history: {
|
334
334
|
back: VoidFunction;
|
335
335
|
forward: VoidFunction;
|
336
|
-
setHistories: (histories: History
|
336
|
+
setHistories: (histories: History[]) => void;
|
337
337
|
setHistoryIndex: (index: number) => void;
|
338
338
|
hasPast: boolean;
|
339
339
|
hasFuture: boolean;
|
340
340
|
histories: History<any>[];
|
341
341
|
index: number;
|
342
|
-
historyStore: HistoryStore
|
342
|
+
historyStore: HistoryStore | undefined;
|
343
343
|
};
|
344
344
|
selectedItem: ComponentData<DefaultComponentProps & {
|
345
345
|
id: string;
|
346
346
|
}> | null;
|
347
347
|
};
|
348
348
|
|
349
|
-
export { AppState, AutoField, AutoFieldPrivate, Button, ComponentData, Config, Data, DefaultComponentProps, DefaultRootProps, Drawer, DropZone, DropZoneProvider, Field, FieldLabel, FieldLabelInternal, FieldProps, FieldPropsInternal, History, IconButton, MappedItem, Plugin, Puck, PuckAction, Render, RootData, RootDataWithProps, UiState, dropZoneContext, migrate, resolveAllData, transformProps, usePuck };
|
349
|
+
export { AppState, AutoField, AutoFieldPrivate, Button, ComponentData, Config, Data, DefaultComponentProps, DefaultRootProps, Drawer, DropZone, DropZoneProvider, Field, FieldLabel, FieldLabelInternal, FieldProps, type FieldPropsInternal, type History, IconButton, MappedItem, type Plugin, Puck, type PuckAction, Render, RootData, RootDataWithProps, UiState, dropZoneContext, migrate, resolveAllData, transformProps, usePuck };
|