@measured/puck 0.21.0-canary.b818cb1f → 0.21.0-canary.c0db75c1
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/dist/{walk-tree-DkTSFbz_.d.mts → actions-CaYAKtsG.d.mts} +79 -81
- package/dist/{walk-tree-DkTSFbz_.d.ts → actions-CaYAKtsG.d.ts} +79 -81
- package/dist/{chunk-CBXRJMRZ.mjs → chunk-E4BOPJJV.mjs} +2771 -2922
- package/dist/chunk-J32NOAUF.mjs +524 -0
- package/dist/chunk-PJYARUPI.mjs +477 -0
- package/dist/chunk-S3RM5GHZ.mjs +503 -0
- package/dist/index-C6QwyW4B.d.ts +109 -0
- package/dist/index-IMRjDHZk.d.mts +109 -0
- package/dist/index.css +649 -270
- package/dist/index.d.mts +19 -109
- package/dist/index.d.ts +19 -109
- package/dist/index.js +2284 -1944
- package/dist/index.mjs +13 -4
- package/dist/internal.d.mts +12 -0
- package/dist/internal.d.ts +12 -0
- package/dist/internal.js +906 -0
- package/dist/internal.mjs +12 -0
- package/dist/no-external.css +649 -270
- package/dist/no-external.d.mts +4 -2
- package/dist/no-external.d.ts +4 -2
- package/dist/no-external.js +2281 -1941
- package/dist/no-external.mjs +13 -4
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +15 -12
- package/dist/rsc.mjs +7 -5
- package/dist/walk-tree-B-Q2gpMX.d.mts +29 -0
- package/dist/walk-tree-ksvZ7C4q.d.ts +29 -0
- package/package.json +7 -2
- package/dist/chunk-VBJEDLUM.mjs +0 -965
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms } from './actions-CaYAKtsG.mjs';
|
|
2
|
+
|
|
3
|
+
type HistorySlice<D = any> = {
|
|
4
|
+
index: number;
|
|
5
|
+
hasPast: () => boolean;
|
|
6
|
+
hasFuture: () => boolean;
|
|
7
|
+
histories: History<D>[];
|
|
8
|
+
record: (data: D) => void;
|
|
9
|
+
back: VoidFunction;
|
|
10
|
+
forward: VoidFunction;
|
|
11
|
+
currentHistory: () => History;
|
|
12
|
+
nextHistory: () => History<D> | null;
|
|
13
|
+
prevHistory: () => History<D> | null;
|
|
14
|
+
setHistories: (histories: History[]) => void;
|
|
15
|
+
setHistoryIndex: (index: number) => void;
|
|
16
|
+
initialAppState: D;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type NodeMethods = {
|
|
20
|
+
sync: () => void;
|
|
21
|
+
hideOverlay: () => void;
|
|
22
|
+
showOverlay: () => void;
|
|
23
|
+
};
|
|
24
|
+
type PuckNodeInstance = {
|
|
25
|
+
id: string;
|
|
26
|
+
methods: NodeMethods;
|
|
27
|
+
element: HTMLElement | null;
|
|
28
|
+
};
|
|
29
|
+
type NodesSlice = {
|
|
30
|
+
nodes: Record<string, PuckNodeInstance | undefined>;
|
|
31
|
+
registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
|
|
32
|
+
unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
36
|
+
item?: G["UserComponentData"] | null;
|
|
37
|
+
type?: keyof G["UserProps"];
|
|
38
|
+
root?: boolean;
|
|
39
|
+
};
|
|
40
|
+
type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
|
|
41
|
+
type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
|
|
42
|
+
type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
|
|
43
|
+
type Cache = Record<string, {
|
|
44
|
+
lastPermissions: Partial<Permissions>;
|
|
45
|
+
lastData: ComponentData | null;
|
|
46
|
+
lastParentId: string | null;
|
|
47
|
+
}>;
|
|
48
|
+
type PermissionsSlice = {
|
|
49
|
+
cache: Cache;
|
|
50
|
+
globalPermissions: Permissions;
|
|
51
|
+
resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
|
|
52
|
+
getPermissions: GetPermissions<Config>;
|
|
53
|
+
resolvePermissions: ResolvePermissions<Config>;
|
|
54
|
+
refreshPermissions: RefreshPermissions<Config>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
type ComponentOrRootData = Omit<ComponentData<any>, "type">;
|
|
58
|
+
type FieldsSlice = {
|
|
59
|
+
fields: Fields | Partial<Fields>;
|
|
60
|
+
loading: boolean;
|
|
61
|
+
lastResolvedData: Partial<ComponentOrRootData>;
|
|
62
|
+
id: string | undefined;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
type Status = "LOADING" | "MOUNTED" | "READY";
|
|
66
|
+
type ZoomConfig = {
|
|
67
|
+
autoZoom: number;
|
|
68
|
+
rootHeight: number;
|
|
69
|
+
zoom: number;
|
|
70
|
+
};
|
|
71
|
+
type ComponentState = Record<string, {
|
|
72
|
+
loadingCount: number;
|
|
73
|
+
}>;
|
|
74
|
+
type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
75
|
+
instanceId: string;
|
|
76
|
+
state: G["UserAppState"];
|
|
77
|
+
dispatch: (action: PuckAction) => void;
|
|
78
|
+
config: UserConfig;
|
|
79
|
+
componentState: ComponentState;
|
|
80
|
+
setComponentState: (componentState: ComponentState) => void;
|
|
81
|
+
setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
|
|
82
|
+
unsetComponentLoading: (id: string) => void;
|
|
83
|
+
pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
|
|
84
|
+
resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
|
|
85
|
+
node: T;
|
|
86
|
+
didChange: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
resolveAndCommitData: () => void;
|
|
89
|
+
plugins: Plugin[];
|
|
90
|
+
overrides: Partial<Overrides>;
|
|
91
|
+
viewports: Viewports;
|
|
92
|
+
zoomConfig: ZoomConfig;
|
|
93
|
+
setZoomConfig: (zoomConfig: ZoomConfig) => void;
|
|
94
|
+
status: Status;
|
|
95
|
+
setStatus: (status: Status) => void;
|
|
96
|
+
iframe: IframeConfig;
|
|
97
|
+
selectedItem?: G["UserData"]["content"][0] | null;
|
|
98
|
+
setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
|
|
99
|
+
getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
|
|
100
|
+
onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
|
|
101
|
+
metadata: Metadata;
|
|
102
|
+
fields: FieldsSlice;
|
|
103
|
+
history: HistorySlice;
|
|
104
|
+
nodes: NodesSlice;
|
|
105
|
+
permissions: PermissionsSlice;
|
|
106
|
+
fieldTransforms: FieldTransforms;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export type { AppStore as A, GetPermissions as G, HistorySlice as H, RefreshPermissions as R };
|