@measured/puck 0.14.0-canary.55740c4 → 0.14.0-canary.92750a2

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 { C as Config, D as Data, I as ItemSelector, U as UiState, A as AppState, F as Field, a as DefaultComponentProps, b as DefaultRootProps, M as MappedItem, R as RootDataWithProps, c as RootData } from './Config-1444273f.js';
2
- export { g as Adaptor, f as ArrayField, r as ArrayState, n as BaseData, B as BaseField, m as ComponentConfig, o as ComponentData, k as Content, i as CustomField, s as DropZone, h as ExternalField, E as ExternalFieldWithAdaptor, j as Fields, q as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, l as PuckContext, e as RadioField, p as RootDataWithoutProps, S as SelectField, T as TextField, d as TextareaField } from './Config-1444273f.js';
1
+ import { C as Config, D as Data, I as ItemSelector, U as UiState, A as AppState, F as Field, a as DefaultComponentProps, b as DefaultRootProps, M as MappedItem, R as RootDataWithProps, c as RootData } from './Config-ab049d49.js';
2
+ export { g as Adaptor, f as ArrayField, r as ArrayState, n as BaseData, B as BaseField, m as ComponentConfig, o as ComponentData, k as Content, i as CustomField, s as DropZone, h as ExternalField, E as ExternalFieldWithAdaptor, j as Fields, q as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, l as PuckContext, e as RadioField, p as RootDataWithoutProps, S as SelectField, T as TextField, d as TextareaField } from './Config-ab049d49.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, CSSProperties, ReactElement, SyntheticEvent } from 'react';
@@ -125,6 +125,7 @@ declare const Drawer: {
125
125
  name: string;
126
126
  children?: ((props: {
127
127
  children: ReactNode;
128
+ name: string;
128
129
  }) => ReactElement) | undefined;
129
130
  id?: string | undefined;
130
131
  index: number;
@@ -167,7 +168,7 @@ type RenderFunc<Props extends {
167
168
  [key: string]: any;
168
169
  } = {
169
170
  children: ReactNode;
170
- }> = React.FunctionComponent<Props>;
171
+ }> = (props: Props) => ReactElement;
171
172
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "components", "componentItem", "outline", "puck", "preview"];
172
173
  type OverrideKey = (typeof overrideKeys)[number];
173
174
  type OverridesGeneric<Shape extends {
@@ -197,7 +198,10 @@ type Overrides = OverridesGeneric<{
197
198
  className?: string;
198
199
  }>;
199
200
  components: RenderFunc;
200
- componentItem: RenderFunc;
201
+ componentItem: RenderFunc<{
202
+ children: ReactNode;
203
+ name: string;
204
+ }>;
201
205
  outline: RenderFunc;
202
206
  puck: RenderFunc;
203
207
  }>;
@@ -271,10 +275,34 @@ declare const resolveAllData: (data: Data, config: Config<any, any, any>, onReso
271
275
  zones: Record<string, MappedItem[]>;
272
276
  }>;
273
277
 
278
+ type History<D = any> = {
279
+ id: string;
280
+ data: D;
281
+ };
282
+ type HistoryStore<D = any> = {
283
+ index: number;
284
+ currentHistory: History;
285
+ hasPast: boolean;
286
+ hasFuture: boolean;
287
+ record: (data: D) => void;
288
+ back: VoidFunction;
289
+ forward: VoidFunction;
290
+ nextHistory: History<D> | null;
291
+ prevHistory: History<D> | null;
292
+ histories: History<D>[];
293
+ };
294
+
295
+ type PuckHistory = {
296
+ back: VoidFunction;
297
+ forward: VoidFunction;
298
+ historyStore: HistoryStore;
299
+ };
300
+
274
301
  declare const usePuck: () => {
275
302
  appState: AppState;
276
303
  config: Config<any, any, any>;
277
304
  dispatch: (action: PuckAction) => void;
305
+ history: Partial<PuckHistory>;
278
306
  };
279
307
 
280
308
  export { AppState, Button, Config, Data, DefaultComponentProps, DefaultRootProps, Drawer, DropZoneProvider, Field, FieldLabel, IconButton, MappedItem, Puck, PuckAction, Render, RootData, RootDataWithProps, UiState, dropZoneContext, migrate, resolveAllData, transformProps, usePuck };