@measured/puck 0.20.0-canary.68dd73b8 → 0.20.0-canary.6aefde61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/chunk-5X2PB4G7.mjs +9519 -0
- package/dist/{chunk-H6KSTNLT.mjs → chunk-BNXRZWNI.mjs} +355 -295
- package/dist/index.css +651 -313
- package/dist/index.d.mts +24 -6
- package/dist/index.d.ts +24 -6
- package/dist/index.js +5264 -4151
- package/dist/index.mjs +35 -8436
- package/dist/no-external.css +2231 -0
- package/dist/no-external.d.mts +4 -0
- package/dist/no-external.d.ts +4 -0
- package/dist/no-external.js +10449 -0
- package/dist/no-external.mjs +62 -0
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +141 -72
- package/dist/rsc.mjs +5 -1
- package/dist/{walk-tree-BOSl1o0G.d.mts → walk-tree-CU8Fq-KC.d.mts} +56 -6
- package/dist/{walk-tree-BOSl1o0G.d.ts → walk-tree-CU8Fq-KC.d.ts} +56 -6
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as History, P as Permissions,
|
|
2
|
-
export {
|
|
1
|
+
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector, o as PluginInternal } from './walk-tree-CU8Fq-KC.mjs';
|
|
2
|
+
export { a6 as Adaptor, a4 as ArrayField, E as ArrayState, aj as AsFieldProps, L as BaseData, _ as BaseField, Y as ComponentDataMap, T as ComponentDataOptionalId, Z as Content, aa as CustomField, a9 as CustomFieldRender, ag as DefaultComponentProps, ad as DefaultRootFieldProps, af as DefaultRootProps, ae as DefaultRootRenderProps, p as Direction, q as DragAxis, a8 as ExternalField, a7 as ExternalFieldWithAdaptor, an as ExtractField, al as ExtractPropsFromConfig, am as ExtractRootPropsFromConfig, z as FieldRenderFunctions, v as FieldTransformFn, u as FieldTransformFnParams, B as ItemWithId, X as MappedItem, a0 as NumberField, a5 as ObjectField, y as OverrideKey, J as PuckComponent, ac as PuckContext, a3 as RadioField, K as RootConfig, Q as RootData, N as RootDataWithoutProps, a2 as SelectField, S as Slot, G as SlotComponent, ab as SlotField, $ as TextField, a1 as TextareaField, s as Viewport, ak as WithChildren, ah as WithId, ai as WithPuckProps, W as WithSlotProps, m as migrate, x as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CU8Fq-KC.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
|
@@ -105,6 +105,7 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
|
|
|
105
105
|
history: HistorySlice;
|
|
106
106
|
nodes: NodesSlice;
|
|
107
107
|
permissions: PermissionsSlice;
|
|
108
|
+
fieldTransforms: FieldTransforms;
|
|
108
109
|
};
|
|
109
110
|
|
|
110
111
|
declare const ActionBar: {
|
|
@@ -207,6 +208,7 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
207
208
|
permissions?: Partial<Permissions>;
|
|
208
209
|
plugins?: Plugin[];
|
|
209
210
|
overrides?: Partial<Overrides>;
|
|
211
|
+
fieldTransforms?: FieldTransforms;
|
|
210
212
|
renderHeader?: (props: {
|
|
211
213
|
children: ReactNode;
|
|
212
214
|
dispatch: (action: PuckAction) => void;
|
|
@@ -249,15 +251,25 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
|
249
251
|
metadata?: Metadata;
|
|
250
252
|
}): react_jsx_runtime.JSX.Element;
|
|
251
253
|
|
|
254
|
+
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
255
|
+
disableDrag?: boolean;
|
|
256
|
+
disableDragOnFocus?: boolean;
|
|
257
|
+
}) => (() => void) | undefined;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Helper function to set a value based on a dot-notated path
|
|
261
|
+
*/
|
|
262
|
+
declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
|
|
263
|
+
|
|
252
264
|
type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
253
|
-
appState:
|
|
265
|
+
appState: G["UserPublicAppState"];
|
|
254
266
|
config: UserConfig;
|
|
255
267
|
dispatch: AppStore["dispatch"];
|
|
256
268
|
getPermissions: GetPermissions<UserConfig>;
|
|
257
269
|
refreshPermissions: RefreshPermissions<UserConfig>;
|
|
258
270
|
selectedItem: G["UserComponentData"] | null;
|
|
259
|
-
getItemBySelector: (selector: ItemSelector) =>
|
|
260
|
-
getItemById: (id: string) =>
|
|
271
|
+
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
272
|
+
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
261
273
|
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
262
274
|
history: {
|
|
263
275
|
back: HistorySlice["back"];
|
|
@@ -290,4 +302,10 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
290
302
|
*/
|
|
291
303
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
292
304
|
|
|
293
|
-
|
|
305
|
+
declare const blocksPlugin: () => Plugin;
|
|
306
|
+
declare const outlinePlugin: () => Plugin;
|
|
307
|
+
declare const fieldsPlugin: (params?: {
|
|
308
|
+
mobileOnly?: boolean;
|
|
309
|
+
}) => PluginInternal;
|
|
310
|
+
|
|
311
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as History, P as Permissions,
|
|
2
|
-
export {
|
|
1
|
+
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector, o as PluginInternal } from './walk-tree-CU8Fq-KC.js';
|
|
2
|
+
export { a6 as Adaptor, a4 as ArrayField, E as ArrayState, aj as AsFieldProps, L as BaseData, _ as BaseField, Y as ComponentDataMap, T as ComponentDataOptionalId, Z as Content, aa as CustomField, a9 as CustomFieldRender, ag as DefaultComponentProps, ad as DefaultRootFieldProps, af as DefaultRootProps, ae as DefaultRootRenderProps, p as Direction, q as DragAxis, a8 as ExternalField, a7 as ExternalFieldWithAdaptor, an as ExtractField, al as ExtractPropsFromConfig, am as ExtractRootPropsFromConfig, z as FieldRenderFunctions, v as FieldTransformFn, u as FieldTransformFnParams, B as ItemWithId, X as MappedItem, a0 as NumberField, a5 as ObjectField, y as OverrideKey, J as PuckComponent, ac as PuckContext, a3 as RadioField, K as RootConfig, Q as RootData, N as RootDataWithoutProps, a2 as SelectField, S as Slot, G as SlotComponent, ab as SlotField, $ as TextField, a1 as TextareaField, s as Viewport, ak as WithChildren, ah as WithId, ai as WithPuckProps, W as WithSlotProps, m as migrate, x as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CU8Fq-KC.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
|
@@ -105,6 +105,7 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
|
|
|
105
105
|
history: HistorySlice;
|
|
106
106
|
nodes: NodesSlice;
|
|
107
107
|
permissions: PermissionsSlice;
|
|
108
|
+
fieldTransforms: FieldTransforms;
|
|
108
109
|
};
|
|
109
110
|
|
|
110
111
|
declare const ActionBar: {
|
|
@@ -207,6 +208,7 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
207
208
|
permissions?: Partial<Permissions>;
|
|
208
209
|
plugins?: Plugin[];
|
|
209
210
|
overrides?: Partial<Overrides>;
|
|
211
|
+
fieldTransforms?: FieldTransforms;
|
|
210
212
|
renderHeader?: (props: {
|
|
211
213
|
children: ReactNode;
|
|
212
214
|
dispatch: (action: PuckAction) => void;
|
|
@@ -249,15 +251,25 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
|
249
251
|
metadata?: Metadata;
|
|
250
252
|
}): react_jsx_runtime.JSX.Element;
|
|
251
253
|
|
|
254
|
+
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
255
|
+
disableDrag?: boolean;
|
|
256
|
+
disableDragOnFocus?: boolean;
|
|
257
|
+
}) => (() => void) | undefined;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Helper function to set a value based on a dot-notated path
|
|
261
|
+
*/
|
|
262
|
+
declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
|
|
263
|
+
|
|
252
264
|
type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
253
|
-
appState:
|
|
265
|
+
appState: G["UserPublicAppState"];
|
|
254
266
|
config: UserConfig;
|
|
255
267
|
dispatch: AppStore["dispatch"];
|
|
256
268
|
getPermissions: GetPermissions<UserConfig>;
|
|
257
269
|
refreshPermissions: RefreshPermissions<UserConfig>;
|
|
258
270
|
selectedItem: G["UserComponentData"] | null;
|
|
259
|
-
getItemBySelector: (selector: ItemSelector) =>
|
|
260
|
-
getItemById: (id: string) =>
|
|
271
|
+
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
272
|
+
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
261
273
|
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
262
274
|
history: {
|
|
263
275
|
back: HistorySlice["back"];
|
|
@@ -290,4 +302,10 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
290
302
|
*/
|
|
291
303
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
292
304
|
|
|
293
|
-
|
|
305
|
+
declare const blocksPlugin: () => Plugin;
|
|
306
|
+
declare const outlinePlugin: () => Plugin;
|
|
307
|
+
declare const fieldsPlugin: (params?: {
|
|
308
|
+
mobileOnly?: boolean;
|
|
309
|
+
}) => PluginInternal;
|
|
310
|
+
|
|
311
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|