@measured/puck 0.15.0-canary.dd7051e → 0.15.0-canary.e2cd445

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as UiState, D as Data, A as AppState, C as Config, a as DefaultRootProps, I as ItemSelector, b as DropZoneProps, F as Field, V as Viewports, c as DefaultComponentProps, M as MappedItem, R as RootDataWithProps, d as RootData, e as ComponentData } from './Config-25917005.js';
2
- export { i as Adaptor, h as ArrayField, s as ArrayState, p as BaseData, B as BaseField, o as ComponentConfig, m as Content, k as CustomField, j as ExternalField, E as ExternalFieldWithAdaptor, l as Fields, r as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, n as PuckContext, g as RadioField, q as RootDataWithoutProps, S as SelectField, T as TextField, f as TextareaField } from './Config-25917005.js';
1
+ import { U as UiState, D as Data, A as AppState, F as Field, a as FieldProps, C as Config, b as DefaultRootProps, I as ItemSelector, c as DropZoneProps, V as Viewports, d as DefaultComponentProps, M as MappedItem, R as RootDataWithProps, e as RootData, f as ComponentData } from './Config-a4123ba2.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-a4123ba2.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, ReactElement, CSSProperties, SyntheticEvent } from 'react';
@@ -64,6 +64,38 @@ type PuckAction = {
64
64
  recordHistory?: boolean;
65
65
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
66
66
 
67
+ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
68
+ children?: ReactNode;
69
+ icon?: ReactNode;
70
+ label: string;
71
+ el?: "label" | "div" | undefined;
72
+ readOnly?: boolean | undefined;
73
+ className?: string | undefined;
74
+ }) => react_jsx_runtime.JSX.Element;
75
+ type FieldLabelPropsInternal = {
76
+ children?: ReactNode;
77
+ icon?: ReactNode;
78
+ label?: string;
79
+ el?: "label" | "div";
80
+ readOnly?: boolean;
81
+ };
82
+ declare const FieldLabelInternal: ({ children, icon, label, el, readOnly, }: FieldLabelPropsInternal) => react_jsx_runtime.JSX.Element;
83
+ type FieldPropsInternalOptional<ValueType = any, F = Field<any>> = FieldProps<ValueType, F> & {
84
+ Label?: React.FC<FieldLabelPropsInternal>;
85
+ label?: string;
86
+ name?: string;
87
+ };
88
+ type FieldPropsInternal<ValueType = any, F = Field<any>> = FieldProps<ValueType, F> & {
89
+ Label: React.FC<FieldLabelPropsInternal>;
90
+ label?: string;
91
+ id: string;
92
+ name?: string;
93
+ };
94
+ declare function AutoFieldPrivate<ValueType = any, FieldType extends Field<ValueType> = Field<ValueType>>(props: FieldPropsInternalOptional<ValueType, FieldType> & {
95
+ Label?: React.FC<FieldLabelPropsInternal>;
96
+ }): react_jsx_runtime.JSX.Element;
97
+ declare function AutoField<ValueType = any, FieldType extends Field<ValueType> = Field<ValueType>>(props: FieldProps<ValueType, FieldType>): react_jsx_runtime.JSX.Element;
98
+
67
99
  declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, }: {
68
100
  children: ReactNode;
69
101
  href?: string | undefined;
@@ -80,7 +112,7 @@ declare const Button: ({ children, href, onClick, variant, type, disabled, tabIn
80
112
  }) => react_jsx_runtime.JSX.Element;
81
113
 
82
114
  declare const Drawer: {
83
- ({ children, droppableId, direction, }: {
115
+ ({ children, droppableId: _droppableId, direction, }: {
84
116
  children: ReactNode;
85
117
  droppableId?: string | undefined;
86
118
  direction?: "vertical" | "horizontal" | undefined;
@@ -149,25 +181,6 @@ declare const IconButton: ({ children, href, onClick, variant, type, disabled, t
149
181
  title: string;
150
182
  }) => react_jsx_runtime.JSX.Element;
151
183
 
152
- declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
153
- children?: ReactNode;
154
- icon?: ReactNode;
155
- label: string;
156
- el?: "label" | "div" | undefined;
157
- readOnly?: boolean | undefined;
158
- className?: string | undefined;
159
- }) => react_jsx_runtime.JSX.Element;
160
- type InputProps<F = Field<any>> = {
161
- name: string;
162
- field: F;
163
- value: any;
164
- id: string;
165
- label?: string;
166
- onChange: (value: any, uiState?: Partial<UiState>) => void;
167
- readOnly?: boolean;
168
- readOnlyFields?: Record<string, boolean | undefined>;
169
- };
170
-
171
184
  type RenderFunc<Props extends {
172
185
  [key: string]: any;
173
186
  } = {
@@ -210,14 +223,16 @@ type Overrides = OverridesGeneric<{
210
223
  puck: RenderFunc;
211
224
  }>;
212
225
  type FieldRenderFunctions = Omit<{
213
- [Type in Field["type"]]: React.FunctionComponent<InputProps<Extract<Field, {
226
+ [Type in Field["type"]]: React.FunctionComponent<FieldProps<Extract<Field, {
214
227
  type: Type;
215
228
  }>> & {
216
229
  children: ReactNode;
230
+ name: string;
217
231
  }>;
218
232
  }, "custom"> & {
219
- [key: string]: React.FunctionComponent<InputProps<any> & {
233
+ [key: string]: React.FunctionComponent<FieldProps<any> & {
220
234
  children: ReactNode;
235
+ name: string;
221
236
  }>;
222
237
  };
223
238
 
@@ -321,4 +336,4 @@ declare const usePuck: () => {
321
336
  }> | null;
322
337
  };
323
338
 
324
- export { AppState, Button, ComponentData, Config, Data, DefaultComponentProps, DefaultRootProps, Drawer, DropZone, DropZoneProvider, Field, FieldLabel, IconButton, MappedItem, Puck, PuckAction, Render, RootData, RootDataWithProps, UiState, dropZoneContext, migrate, resolveAllData, transformProps, usePuck };
339
+ export { AppState, AutoField, AutoFieldPrivate, Button, ComponentData, Config, Data, DefaultComponentProps, DefaultRootProps, Drawer, DropZone, DropZoneProvider, Field, FieldLabel, FieldLabelInternal, FieldProps, FieldPropsInternal, IconButton, MappedItem, Puck, PuckAction, Render, RootData, RootDataWithProps, UiState, dropZoneContext, migrate, resolveAllData, transformProps, usePuck };