@crediblemark/build 0.22.0
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/LICENSE +21 -0
- package/dist/Editor-XZF6CWVW.css +404 -0
- package/dist/Editor-ZC67OU2A.mjs +205 -0
- package/dist/Render-JBFI6HYN.mjs +55 -0
- package/dist/Render-WCX4AXOX.css +102 -0
- package/dist/actions-CEH_5LMY.d.mts +838 -0
- package/dist/actions-CEH_5LMY.d.ts +838 -0
- package/dist/chunk-3AJBFQU4.mjs +560 -0
- package/dist/chunk-4SQOX3ZQ.mjs +476 -0
- package/dist/chunk-B4BOBGYB.mjs +42 -0
- package/dist/chunk-CDMESQDA.mjs +148 -0
- package/dist/chunk-DSXRK4QJ.mjs +704 -0
- package/dist/chunk-GUJDGRSM.mjs +469 -0
- package/dist/chunk-HHBUU7WF.mjs +35 -0
- package/dist/chunk-IJHL7BIR.mjs +11 -0
- package/dist/chunk-PHGC6QYB.mjs +105 -0
- package/dist/chunk-QF3GD5WQ.mjs +65 -0
- package/dist/chunk-U2NVBXAC.mjs +2064 -0
- package/dist/chunk-VFD76OD5.mjs +55 -0
- package/dist/chunk-VGDMWS44.mjs +107 -0
- package/dist/chunk-VKBVSWU3.mjs +8538 -0
- package/dist/chunk-YH7AXYKP.mjs +109 -0
- package/dist/full-ABQQRJAO.css +301 -0
- package/dist/full-LJRK5736.mjs +94 -0
- package/dist/index-CkSfgrvw.d.ts +117 -0
- package/dist/index-Cxwg4vUV.d.mts +117 -0
- package/dist/index.css +2576 -0
- package/dist/index.d.mts +310 -0
- package/dist/index.d.ts +310 -0
- package/dist/index.js +15012 -0
- package/dist/index.mjs +83 -0
- package/dist/internal.d.mts +27 -0
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +960 -0
- package/dist/internal.mjs +13 -0
- package/dist/loaded-DWCENJKQ.mjs +55 -0
- package/dist/loaded-N7VXUR4O.mjs +59 -0
- package/dist/loaded-NE2PIHUQ.mjs +56 -0
- package/dist/loaded-SMEIWWHS.css +87 -0
- package/dist/no-external.css +2574 -0
- package/dist/no-external.d.mts +21 -0
- package/dist/no-external.d.ts +21 -0
- package/dist/no-external.js +15012 -0
- package/dist/no-external.mjs +83 -0
- package/dist/rsc.css +102 -0
- package/dist/rsc.d.mts +27 -0
- package/dist/rsc.d.ts +27 -0
- package/dist/rsc.js +1466 -0
- package/dist/rsc.mjs +147 -0
- package/dist/walk-tree-B4ZvMfxS.d.ts +29 -0
- package/dist/walk-tree-C78ZVz19.d.mts +29 -0
- package/package.json +145 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { p as Field, q as FieldProps, r as DropZoneProps, a as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, C as CredBuildAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, i as ResolveDataTrigger, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-CEH_5LMY.mjs';
|
|
2
|
+
export { v as Adaptor, A as AppState, w as ArrayField, x as ArrayState, y as AsFieldProps, B as BaseData, z as BaseField, E as CacheOpts, m as ComponentConfig, G as ComponentConfigExtensions, J as ComponentConfigParams, K as ComponentDataMap, L as ComponentDataOptionalId, N as ComponentMetadata, Q as ConfigParams, b as Content, S as CredBuildComponent, T as CredBuildContext, X as CredBuildMetadata, Y as CustomField, Z as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, _ as DefaultRootProps, $ as DefaultRootRenderProps, a0 as Direction, a1 as DragAxis, a2 as ExternalField, a3 as ExternalFieldWithAdaptor, a4 as ExtractConfigParams, a5 as ExtractField, a6 as FieldMetadata, a7 as FieldRenderFunctions, a8 as FieldTransformFn, a9 as FieldTransformFnParams, F as Fields, H as History, aa as ItemWithId, ab as MappedItem, ac as NumberField, ad as ObjectField, ae as OverrideKey, af as RadioField, ag as RichText, o as RichtextField, ah as RootConfig, R as RootData, h as RootDataWithProps, ai as RootDataWithoutProps, aj as SelectField, ak as Slot, al as SlotComponent, am as SlotField, an as TextField, ao as TextareaField, ap as Viewport, aq as WithChildren, ar as WithCredBuildProps, W as WithId, as as WithSlotProps, at as overrideKeys } from './actions-CEH_5LMY.mjs';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-C78ZVz19.mjs';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
|
|
7
|
+
import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-Cxwg4vUV.mjs';
|
|
8
|
+
import '@tiptap/react';
|
|
9
|
+
import '@tiptap/extension-blockquote';
|
|
10
|
+
import '@tiptap/extension-bold';
|
|
11
|
+
import '@tiptap/extension-code';
|
|
12
|
+
import '@tiptap/extension-code-block';
|
|
13
|
+
import '@tiptap/extension-hard-break';
|
|
14
|
+
import '@tiptap/extension-heading';
|
|
15
|
+
import '@tiptap/extension-horizontal-rule';
|
|
16
|
+
import '@tiptap/extension-italic';
|
|
17
|
+
import '@tiptap/extension-link';
|
|
18
|
+
import '@tiptap/extension-list';
|
|
19
|
+
import '@tiptap/extension-paragraph';
|
|
20
|
+
import '@tiptap/extension-strike';
|
|
21
|
+
import '@tiptap/extension-text-align';
|
|
22
|
+
import '@tiptap/extension-underline';
|
|
23
|
+
|
|
24
|
+
declare const ActionBar: {
|
|
25
|
+
({ label, children, }: {
|
|
26
|
+
label?: string;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}): react_jsx_runtime.JSX.Element;
|
|
29
|
+
Action: ({ children, label, onClick, active, disabled, }: {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
label?: string;
|
|
32
|
+
onClick: (e: SyntheticEvent) => void;
|
|
33
|
+
active?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
Label: ({ label }: {
|
|
37
|
+
label: string;
|
|
38
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
39
|
+
Group: ({ children }: {
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
Separator: () => react_jsx_runtime.JSX.Element;
|
|
43
|
+
};
|
|
44
|
+
declare const Action: ({ children, label, onClick, active, disabled, }: {
|
|
45
|
+
children: ReactNode;
|
|
46
|
+
label?: string;
|
|
47
|
+
onClick: (e: SyntheticEvent) => void;
|
|
48
|
+
active?: boolean;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare const Group: ({ children }: {
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
declare const Label: ({ label }: {
|
|
55
|
+
label: string;
|
|
56
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
declare const Separator: () => react_jsx_runtime.JSX.Element;
|
|
58
|
+
|
|
59
|
+
declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
|
|
60
|
+
children?: ReactNode;
|
|
61
|
+
icon?: ReactNode;
|
|
62
|
+
label: string;
|
|
63
|
+
el?: "label" | "div";
|
|
64
|
+
readOnly?: boolean;
|
|
65
|
+
className?: string;
|
|
66
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
|
|
69
|
+
declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<FieldType, ValueType> & {
|
|
70
|
+
value: any;
|
|
71
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
72
|
+
|
|
73
|
+
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: {
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
href?: string;
|
|
76
|
+
onClick?: (e: any) => void | Promise<void>;
|
|
77
|
+
variant?: "primary" | "secondary";
|
|
78
|
+
type?: "button" | "submit" | "reset";
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
tabIndex?: number;
|
|
81
|
+
newTab?: boolean;
|
|
82
|
+
fullWidth?: boolean;
|
|
83
|
+
icon?: ReactNode;
|
|
84
|
+
size?: "medium" | "large";
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
declare const Drawer: {
|
|
89
|
+
({ children, droppableId, direction, }: {
|
|
90
|
+
children: ReactNode;
|
|
91
|
+
droppableId?: string;
|
|
92
|
+
direction?: "vertical" | "horizontal";
|
|
93
|
+
}): react_jsx_runtime.JSX.Element;
|
|
94
|
+
Item: ({ name, children, id, label, index, isDragDisabled, }: {
|
|
95
|
+
name: string;
|
|
96
|
+
children?: (props: {
|
|
97
|
+
children: ReactNode;
|
|
98
|
+
name: string;
|
|
99
|
+
}) => ReactElement;
|
|
100
|
+
id?: string;
|
|
101
|
+
label?: string;
|
|
102
|
+
index?: number;
|
|
103
|
+
isDragDisabled?: boolean;
|
|
104
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
108
|
+
|
|
109
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
|
|
110
|
+
active?: boolean;
|
|
111
|
+
children: ReactNode;
|
|
112
|
+
href?: string;
|
|
113
|
+
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
|
114
|
+
type?: "button" | "submit" | "reset";
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
tabIndex?: number;
|
|
117
|
+
newTab?: boolean;
|
|
118
|
+
fullWidth?: boolean;
|
|
119
|
+
title: string;
|
|
120
|
+
suppressHydrationWarning?: boolean;
|
|
121
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
type CredBuildProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
124
|
+
children?: ReactNode;
|
|
125
|
+
config: UserConfig;
|
|
126
|
+
data: Partial<G["UserData"] | Data>;
|
|
127
|
+
ui?: Partial<UiState>;
|
|
128
|
+
onChange?: (data: G["UserData"]) => void;
|
|
129
|
+
onPublish?: (data: G["UserData"]) => void;
|
|
130
|
+
onAction?: OnAction<G["UserData"]>;
|
|
131
|
+
permissions?: Partial<Permissions>;
|
|
132
|
+
plugins?: Plugin<UserConfig>[];
|
|
133
|
+
overrides?: Partial<Overrides<UserConfig>>;
|
|
134
|
+
fieldTransforms?: FieldTransforms<UserConfig>;
|
|
135
|
+
renderHeader?: (props: {
|
|
136
|
+
children: ReactNode;
|
|
137
|
+
dispatch: (action: CredBuildAction) => void;
|
|
138
|
+
state: G["UserAppState"];
|
|
139
|
+
}) => ReactElement;
|
|
140
|
+
renderHeaderActions?: (props: {
|
|
141
|
+
state: G["UserAppState"];
|
|
142
|
+
dispatch: (action: CredBuildAction) => void;
|
|
143
|
+
}) => ReactElement;
|
|
144
|
+
headerTitle?: string;
|
|
145
|
+
headerPath?: string;
|
|
146
|
+
viewports?: Viewports;
|
|
147
|
+
iframe?: IframeConfig;
|
|
148
|
+
dnd?: {
|
|
149
|
+
disableAutoScroll?: boolean;
|
|
150
|
+
};
|
|
151
|
+
initialHistory?: InitialHistory;
|
|
152
|
+
metadata?: Metadata;
|
|
153
|
+
height?: CSSProperties["height"];
|
|
154
|
+
_experimentalFullScreenCanvas?: boolean;
|
|
155
|
+
_experimentalVirtualization?: boolean;
|
|
156
|
+
};
|
|
157
|
+
declare function CredBuild<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: CredBuildProps<UserConfig>): react_jsx_runtime.JSX.Element;
|
|
158
|
+
declare namespace CredBuild {
|
|
159
|
+
var Components: () => react_jsx_runtime.JSX.Element;
|
|
160
|
+
var Fields: react.MemoExoticComponent<({ wrapFields }: {
|
|
161
|
+
wrapFields?: boolean;
|
|
162
|
+
}) => react_jsx_runtime.JSX.Element>;
|
|
163
|
+
var Layout: ({ children }: {
|
|
164
|
+
children?: ReactNode;
|
|
165
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
166
|
+
var Outline: () => react_jsx_runtime.JSX.Element;
|
|
167
|
+
var Preview: ({ id }: {
|
|
168
|
+
id?: string;
|
|
169
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
declare const renderContext: react__default.Context<{
|
|
173
|
+
config: Config;
|
|
174
|
+
data: Data;
|
|
175
|
+
metadata: Metadata;
|
|
176
|
+
}>;
|
|
177
|
+
declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
|
|
178
|
+
config: UserConfig;
|
|
179
|
+
data: Partial<G["UserData"] | Data>;
|
|
180
|
+
metadata?: Metadata;
|
|
181
|
+
}): react_jsx_runtime.JSX.Element;
|
|
182
|
+
|
|
183
|
+
declare function AlignLeft(): react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
declare function AlignCenter(): react_jsx_runtime.JSX.Element;
|
|
186
|
+
|
|
187
|
+
declare function AlignRight(): react_jsx_runtime.JSX.Element;
|
|
188
|
+
|
|
189
|
+
declare function AlignJustify(): react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare function Bold(): react_jsx_runtime.JSX.Element;
|
|
192
|
+
|
|
193
|
+
declare function Italic(): react_jsx_runtime.JSX.Element;
|
|
194
|
+
|
|
195
|
+
declare function Underline(): react_jsx_runtime.JSX.Element;
|
|
196
|
+
|
|
197
|
+
declare function Strikethrough(): react_jsx_runtime.JSX.Element;
|
|
198
|
+
|
|
199
|
+
declare function InlineCode(): react_jsx_runtime.JSX.Element;
|
|
200
|
+
|
|
201
|
+
declare function BulletList(): react_jsx_runtime.JSX.Element;
|
|
202
|
+
|
|
203
|
+
declare function OrderedList(): react_jsx_runtime.JSX.Element;
|
|
204
|
+
|
|
205
|
+
declare function CodeBlock(): react_jsx_runtime.JSX.Element;
|
|
206
|
+
|
|
207
|
+
declare function Blockquote(): react_jsx_runtime.JSX.Element;
|
|
208
|
+
|
|
209
|
+
declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
|
|
210
|
+
|
|
211
|
+
declare function Control({ icon, disabled, active, onClick, title, }: {
|
|
212
|
+
icon: ReactNode;
|
|
213
|
+
disabled?: boolean;
|
|
214
|
+
active?: boolean;
|
|
215
|
+
onClick: (e: SyntheticEvent) => any;
|
|
216
|
+
title: string;
|
|
217
|
+
}): react_jsx_runtime.JSX.Element;
|
|
218
|
+
|
|
219
|
+
declare const RichTextMenu: {
|
|
220
|
+
({ children }: {
|
|
221
|
+
children: ReactNode;
|
|
222
|
+
}): react_jsx_runtime.JSX.Element;
|
|
223
|
+
Group: ({ children }: {
|
|
224
|
+
children: ReactNode;
|
|
225
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
226
|
+
Control: typeof Control;
|
|
227
|
+
AlignCenter: typeof AlignCenter;
|
|
228
|
+
AlignJustify: typeof AlignJustify;
|
|
229
|
+
AlignLeft: typeof AlignLeft;
|
|
230
|
+
AlignRight: typeof AlignRight;
|
|
231
|
+
AlignSelect: () => react_jsx_runtime.JSX.Element;
|
|
232
|
+
Blockquote: typeof Blockquote;
|
|
233
|
+
Bold: typeof Bold;
|
|
234
|
+
BulletList: typeof BulletList;
|
|
235
|
+
CodeBlock: typeof CodeBlock;
|
|
236
|
+
HeadingSelect: () => react_jsx_runtime.JSX.Element;
|
|
237
|
+
HorizontalRule: typeof HorizontalRule;
|
|
238
|
+
InlineCode: typeof InlineCode;
|
|
239
|
+
Italic: typeof Italic;
|
|
240
|
+
ListSelect: () => react_jsx_runtime.JSX.Element;
|
|
241
|
+
OrderedList: typeof OrderedList;
|
|
242
|
+
Strikethrough: typeof Strikethrough;
|
|
243
|
+
Underline: typeof Underline;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
247
|
+
disableDrag?: boolean;
|
|
248
|
+
disableDragOnFocus?: boolean;
|
|
249
|
+
}) => (() => void) | undefined;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Helper function to set a value based on a dot-notated path
|
|
253
|
+
*/
|
|
254
|
+
declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
|
|
255
|
+
|
|
256
|
+
type UseCredBuildData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
257
|
+
appState: G["UserPublicAppState"];
|
|
258
|
+
config: UserConfig;
|
|
259
|
+
dispatch: AppStore["dispatch"];
|
|
260
|
+
getPermissions: GetPermissions<UserConfig>;
|
|
261
|
+
refreshPermissions: RefreshPermissions<UserConfig>;
|
|
262
|
+
resolveDataById: (id: string, trigger?: ResolveDataTrigger) => void;
|
|
263
|
+
resolveDataBySelector: (selector: ItemSelector, trigger?: ResolveDataTrigger) => void;
|
|
264
|
+
selectedItem: G["UserComponentData"] | null;
|
|
265
|
+
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
266
|
+
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
267
|
+
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
268
|
+
getParentById: (id: string) => ComponentData | undefined;
|
|
269
|
+
history: {
|
|
270
|
+
back: HistorySlice["back"];
|
|
271
|
+
forward: HistorySlice["forward"];
|
|
272
|
+
setHistories: HistorySlice["setHistories"];
|
|
273
|
+
setHistoryIndex: HistorySlice["setHistoryIndex"];
|
|
274
|
+
histories: HistorySlice["histories"];
|
|
275
|
+
index: HistorySlice["index"];
|
|
276
|
+
hasPast: boolean;
|
|
277
|
+
hasFuture: boolean;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
type CredBuildApi<UserConfig extends Config = Config> = UseCredBuildData<UserConfig>;
|
|
281
|
+
type UseCredBuildStore<UserConfig extends Config = Config> = CredBuildApi<UserConfig>;
|
|
282
|
+
/**
|
|
283
|
+
* createUseCredBuild
|
|
284
|
+
*
|
|
285
|
+
* Create a typed useCredBuild hook, which is necessary because the user may provide a generic type but not
|
|
286
|
+
* a selector type, and TS does not currently support partial inference.
|
|
287
|
+
* Related: https://github.com/microsoft/TypeScript/issues/26242
|
|
288
|
+
*
|
|
289
|
+
* @returns a typed useCredBuild function
|
|
290
|
+
*/
|
|
291
|
+
declare function createUseCredBuild<UserConfig extends Config = Config>(): <T = CredBuildApi<UserConfig>>(selector: (state: UseCredBuildStore<UserConfig>) => T) => T;
|
|
292
|
+
declare function useCredBuild<UserConfig extends Config = Config>(): UseCredBuildStore<UserConfig>;
|
|
293
|
+
/**
|
|
294
|
+
* Get the latest state without relying on a render
|
|
295
|
+
*
|
|
296
|
+
* @returns CredBuildApi
|
|
297
|
+
*/
|
|
298
|
+
declare function useGetCredBuild(): () => UseCredBuildStore<Config>;
|
|
299
|
+
|
|
300
|
+
declare const blocksPlugin: () => Plugin;
|
|
301
|
+
|
|
302
|
+
declare const fieldsPlugin: (params?: {
|
|
303
|
+
desktopSideBar?: "left" | "right";
|
|
304
|
+
}) => PluginInternal;
|
|
305
|
+
|
|
306
|
+
declare const outlinePlugin: () => Plugin;
|
|
307
|
+
|
|
308
|
+
declare const legacySideBarPlugin: () => Plugin;
|
|
309
|
+
|
|
310
|
+
export { Action, ActionBar, AutoField, Button, ComponentData, Config, CredBuild, CredBuildAction, type CredBuildApi, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, Separator, UiState, type UseCredBuildData, UserGenerics, Viewports, blocksPlugin, createUseCredBuild, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useCredBuild, useGetCredBuild };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { p as Field, q as FieldProps, r as DropZoneProps, a as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, C as CredBuildAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, i as ResolveDataTrigger, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-CEH_5LMY.js';
|
|
2
|
+
export { v as Adaptor, A as AppState, w as ArrayField, x as ArrayState, y as AsFieldProps, B as BaseData, z as BaseField, E as CacheOpts, m as ComponentConfig, G as ComponentConfigExtensions, J as ComponentConfigParams, K as ComponentDataMap, L as ComponentDataOptionalId, N as ComponentMetadata, Q as ConfigParams, b as Content, S as CredBuildComponent, T as CredBuildContext, X as CredBuildMetadata, Y as CustomField, Z as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, _ as DefaultRootProps, $ as DefaultRootRenderProps, a0 as Direction, a1 as DragAxis, a2 as ExternalField, a3 as ExternalFieldWithAdaptor, a4 as ExtractConfigParams, a5 as ExtractField, a6 as FieldMetadata, a7 as FieldRenderFunctions, a8 as FieldTransformFn, a9 as FieldTransformFnParams, F as Fields, H as History, aa as ItemWithId, ab as MappedItem, ac as NumberField, ad as ObjectField, ae as OverrideKey, af as RadioField, ag as RichText, o as RichtextField, ah as RootConfig, R as RootData, h as RootDataWithProps, ai as RootDataWithoutProps, aj as SelectField, ak as Slot, al as SlotComponent, am as SlotField, an as TextField, ao as TextareaField, ap as Viewport, aq as WithChildren, ar as WithCredBuildProps, W as WithId, as as WithSlotProps, at as overrideKeys } from './actions-CEH_5LMY.js';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-B4ZvMfxS.js';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
|
|
7
|
+
import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-CkSfgrvw.js';
|
|
8
|
+
import '@tiptap/react';
|
|
9
|
+
import '@tiptap/extension-blockquote';
|
|
10
|
+
import '@tiptap/extension-bold';
|
|
11
|
+
import '@tiptap/extension-code';
|
|
12
|
+
import '@tiptap/extension-code-block';
|
|
13
|
+
import '@tiptap/extension-hard-break';
|
|
14
|
+
import '@tiptap/extension-heading';
|
|
15
|
+
import '@tiptap/extension-horizontal-rule';
|
|
16
|
+
import '@tiptap/extension-italic';
|
|
17
|
+
import '@tiptap/extension-link';
|
|
18
|
+
import '@tiptap/extension-list';
|
|
19
|
+
import '@tiptap/extension-paragraph';
|
|
20
|
+
import '@tiptap/extension-strike';
|
|
21
|
+
import '@tiptap/extension-text-align';
|
|
22
|
+
import '@tiptap/extension-underline';
|
|
23
|
+
|
|
24
|
+
declare const ActionBar: {
|
|
25
|
+
({ label, children, }: {
|
|
26
|
+
label?: string;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}): react_jsx_runtime.JSX.Element;
|
|
29
|
+
Action: ({ children, label, onClick, active, disabled, }: {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
label?: string;
|
|
32
|
+
onClick: (e: SyntheticEvent) => void;
|
|
33
|
+
active?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
Label: ({ label }: {
|
|
37
|
+
label: string;
|
|
38
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
39
|
+
Group: ({ children }: {
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
Separator: () => react_jsx_runtime.JSX.Element;
|
|
43
|
+
};
|
|
44
|
+
declare const Action: ({ children, label, onClick, active, disabled, }: {
|
|
45
|
+
children: ReactNode;
|
|
46
|
+
label?: string;
|
|
47
|
+
onClick: (e: SyntheticEvent) => void;
|
|
48
|
+
active?: boolean;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare const Group: ({ children }: {
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
declare const Label: ({ label }: {
|
|
55
|
+
label: string;
|
|
56
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
declare const Separator: () => react_jsx_runtime.JSX.Element;
|
|
58
|
+
|
|
59
|
+
declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
|
|
60
|
+
children?: ReactNode;
|
|
61
|
+
icon?: ReactNode;
|
|
62
|
+
label: string;
|
|
63
|
+
el?: "label" | "div";
|
|
64
|
+
readOnly?: boolean;
|
|
65
|
+
className?: string;
|
|
66
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
|
|
69
|
+
declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<FieldType, ValueType> & {
|
|
70
|
+
value: any;
|
|
71
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
72
|
+
|
|
73
|
+
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: {
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
href?: string;
|
|
76
|
+
onClick?: (e: any) => void | Promise<void>;
|
|
77
|
+
variant?: "primary" | "secondary";
|
|
78
|
+
type?: "button" | "submit" | "reset";
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
tabIndex?: number;
|
|
81
|
+
newTab?: boolean;
|
|
82
|
+
fullWidth?: boolean;
|
|
83
|
+
icon?: ReactNode;
|
|
84
|
+
size?: "medium" | "large";
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
declare const Drawer: {
|
|
89
|
+
({ children, droppableId, direction, }: {
|
|
90
|
+
children: ReactNode;
|
|
91
|
+
droppableId?: string;
|
|
92
|
+
direction?: "vertical" | "horizontal";
|
|
93
|
+
}): react_jsx_runtime.JSX.Element;
|
|
94
|
+
Item: ({ name, children, id, label, index, isDragDisabled, }: {
|
|
95
|
+
name: string;
|
|
96
|
+
children?: (props: {
|
|
97
|
+
children: ReactNode;
|
|
98
|
+
name: string;
|
|
99
|
+
}) => ReactElement;
|
|
100
|
+
id?: string;
|
|
101
|
+
label?: string;
|
|
102
|
+
index?: number;
|
|
103
|
+
isDragDisabled?: boolean;
|
|
104
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
108
|
+
|
|
109
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
|
|
110
|
+
active?: boolean;
|
|
111
|
+
children: ReactNode;
|
|
112
|
+
href?: string;
|
|
113
|
+
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
|
114
|
+
type?: "button" | "submit" | "reset";
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
tabIndex?: number;
|
|
117
|
+
newTab?: boolean;
|
|
118
|
+
fullWidth?: boolean;
|
|
119
|
+
title: string;
|
|
120
|
+
suppressHydrationWarning?: boolean;
|
|
121
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
type CredBuildProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
124
|
+
children?: ReactNode;
|
|
125
|
+
config: UserConfig;
|
|
126
|
+
data: Partial<G["UserData"] | Data>;
|
|
127
|
+
ui?: Partial<UiState>;
|
|
128
|
+
onChange?: (data: G["UserData"]) => void;
|
|
129
|
+
onPublish?: (data: G["UserData"]) => void;
|
|
130
|
+
onAction?: OnAction<G["UserData"]>;
|
|
131
|
+
permissions?: Partial<Permissions>;
|
|
132
|
+
plugins?: Plugin<UserConfig>[];
|
|
133
|
+
overrides?: Partial<Overrides<UserConfig>>;
|
|
134
|
+
fieldTransforms?: FieldTransforms<UserConfig>;
|
|
135
|
+
renderHeader?: (props: {
|
|
136
|
+
children: ReactNode;
|
|
137
|
+
dispatch: (action: CredBuildAction) => void;
|
|
138
|
+
state: G["UserAppState"];
|
|
139
|
+
}) => ReactElement;
|
|
140
|
+
renderHeaderActions?: (props: {
|
|
141
|
+
state: G["UserAppState"];
|
|
142
|
+
dispatch: (action: CredBuildAction) => void;
|
|
143
|
+
}) => ReactElement;
|
|
144
|
+
headerTitle?: string;
|
|
145
|
+
headerPath?: string;
|
|
146
|
+
viewports?: Viewports;
|
|
147
|
+
iframe?: IframeConfig;
|
|
148
|
+
dnd?: {
|
|
149
|
+
disableAutoScroll?: boolean;
|
|
150
|
+
};
|
|
151
|
+
initialHistory?: InitialHistory;
|
|
152
|
+
metadata?: Metadata;
|
|
153
|
+
height?: CSSProperties["height"];
|
|
154
|
+
_experimentalFullScreenCanvas?: boolean;
|
|
155
|
+
_experimentalVirtualization?: boolean;
|
|
156
|
+
};
|
|
157
|
+
declare function CredBuild<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: CredBuildProps<UserConfig>): react_jsx_runtime.JSX.Element;
|
|
158
|
+
declare namespace CredBuild {
|
|
159
|
+
var Components: () => react_jsx_runtime.JSX.Element;
|
|
160
|
+
var Fields: react.MemoExoticComponent<({ wrapFields }: {
|
|
161
|
+
wrapFields?: boolean;
|
|
162
|
+
}) => react_jsx_runtime.JSX.Element>;
|
|
163
|
+
var Layout: ({ children }: {
|
|
164
|
+
children?: ReactNode;
|
|
165
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
166
|
+
var Outline: () => react_jsx_runtime.JSX.Element;
|
|
167
|
+
var Preview: ({ id }: {
|
|
168
|
+
id?: string;
|
|
169
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
declare const renderContext: react__default.Context<{
|
|
173
|
+
config: Config;
|
|
174
|
+
data: Data;
|
|
175
|
+
metadata: Metadata;
|
|
176
|
+
}>;
|
|
177
|
+
declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
|
|
178
|
+
config: UserConfig;
|
|
179
|
+
data: Partial<G["UserData"] | Data>;
|
|
180
|
+
metadata?: Metadata;
|
|
181
|
+
}): react_jsx_runtime.JSX.Element;
|
|
182
|
+
|
|
183
|
+
declare function AlignLeft(): react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
declare function AlignCenter(): react_jsx_runtime.JSX.Element;
|
|
186
|
+
|
|
187
|
+
declare function AlignRight(): react_jsx_runtime.JSX.Element;
|
|
188
|
+
|
|
189
|
+
declare function AlignJustify(): react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare function Bold(): react_jsx_runtime.JSX.Element;
|
|
192
|
+
|
|
193
|
+
declare function Italic(): react_jsx_runtime.JSX.Element;
|
|
194
|
+
|
|
195
|
+
declare function Underline(): react_jsx_runtime.JSX.Element;
|
|
196
|
+
|
|
197
|
+
declare function Strikethrough(): react_jsx_runtime.JSX.Element;
|
|
198
|
+
|
|
199
|
+
declare function InlineCode(): react_jsx_runtime.JSX.Element;
|
|
200
|
+
|
|
201
|
+
declare function BulletList(): react_jsx_runtime.JSX.Element;
|
|
202
|
+
|
|
203
|
+
declare function OrderedList(): react_jsx_runtime.JSX.Element;
|
|
204
|
+
|
|
205
|
+
declare function CodeBlock(): react_jsx_runtime.JSX.Element;
|
|
206
|
+
|
|
207
|
+
declare function Blockquote(): react_jsx_runtime.JSX.Element;
|
|
208
|
+
|
|
209
|
+
declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
|
|
210
|
+
|
|
211
|
+
declare function Control({ icon, disabled, active, onClick, title, }: {
|
|
212
|
+
icon: ReactNode;
|
|
213
|
+
disabled?: boolean;
|
|
214
|
+
active?: boolean;
|
|
215
|
+
onClick: (e: SyntheticEvent) => any;
|
|
216
|
+
title: string;
|
|
217
|
+
}): react_jsx_runtime.JSX.Element;
|
|
218
|
+
|
|
219
|
+
declare const RichTextMenu: {
|
|
220
|
+
({ children }: {
|
|
221
|
+
children: ReactNode;
|
|
222
|
+
}): react_jsx_runtime.JSX.Element;
|
|
223
|
+
Group: ({ children }: {
|
|
224
|
+
children: ReactNode;
|
|
225
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
226
|
+
Control: typeof Control;
|
|
227
|
+
AlignCenter: typeof AlignCenter;
|
|
228
|
+
AlignJustify: typeof AlignJustify;
|
|
229
|
+
AlignLeft: typeof AlignLeft;
|
|
230
|
+
AlignRight: typeof AlignRight;
|
|
231
|
+
AlignSelect: () => react_jsx_runtime.JSX.Element;
|
|
232
|
+
Blockquote: typeof Blockquote;
|
|
233
|
+
Bold: typeof Bold;
|
|
234
|
+
BulletList: typeof BulletList;
|
|
235
|
+
CodeBlock: typeof CodeBlock;
|
|
236
|
+
HeadingSelect: () => react_jsx_runtime.JSX.Element;
|
|
237
|
+
HorizontalRule: typeof HorizontalRule;
|
|
238
|
+
InlineCode: typeof InlineCode;
|
|
239
|
+
Italic: typeof Italic;
|
|
240
|
+
ListSelect: () => react_jsx_runtime.JSX.Element;
|
|
241
|
+
OrderedList: typeof OrderedList;
|
|
242
|
+
Strikethrough: typeof Strikethrough;
|
|
243
|
+
Underline: typeof Underline;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
247
|
+
disableDrag?: boolean;
|
|
248
|
+
disableDragOnFocus?: boolean;
|
|
249
|
+
}) => (() => void) | undefined;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Helper function to set a value based on a dot-notated path
|
|
253
|
+
*/
|
|
254
|
+
declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
|
|
255
|
+
|
|
256
|
+
type UseCredBuildData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
257
|
+
appState: G["UserPublicAppState"];
|
|
258
|
+
config: UserConfig;
|
|
259
|
+
dispatch: AppStore["dispatch"];
|
|
260
|
+
getPermissions: GetPermissions<UserConfig>;
|
|
261
|
+
refreshPermissions: RefreshPermissions<UserConfig>;
|
|
262
|
+
resolveDataById: (id: string, trigger?: ResolveDataTrigger) => void;
|
|
263
|
+
resolveDataBySelector: (selector: ItemSelector, trigger?: ResolveDataTrigger) => void;
|
|
264
|
+
selectedItem: G["UserComponentData"] | null;
|
|
265
|
+
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
266
|
+
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
267
|
+
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
268
|
+
getParentById: (id: string) => ComponentData | undefined;
|
|
269
|
+
history: {
|
|
270
|
+
back: HistorySlice["back"];
|
|
271
|
+
forward: HistorySlice["forward"];
|
|
272
|
+
setHistories: HistorySlice["setHistories"];
|
|
273
|
+
setHistoryIndex: HistorySlice["setHistoryIndex"];
|
|
274
|
+
histories: HistorySlice["histories"];
|
|
275
|
+
index: HistorySlice["index"];
|
|
276
|
+
hasPast: boolean;
|
|
277
|
+
hasFuture: boolean;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
type CredBuildApi<UserConfig extends Config = Config> = UseCredBuildData<UserConfig>;
|
|
281
|
+
type UseCredBuildStore<UserConfig extends Config = Config> = CredBuildApi<UserConfig>;
|
|
282
|
+
/**
|
|
283
|
+
* createUseCredBuild
|
|
284
|
+
*
|
|
285
|
+
* Create a typed useCredBuild hook, which is necessary because the user may provide a generic type but not
|
|
286
|
+
* a selector type, and TS does not currently support partial inference.
|
|
287
|
+
* Related: https://github.com/microsoft/TypeScript/issues/26242
|
|
288
|
+
*
|
|
289
|
+
* @returns a typed useCredBuild function
|
|
290
|
+
*/
|
|
291
|
+
declare function createUseCredBuild<UserConfig extends Config = Config>(): <T = CredBuildApi<UserConfig>>(selector: (state: UseCredBuildStore<UserConfig>) => T) => T;
|
|
292
|
+
declare function useCredBuild<UserConfig extends Config = Config>(): UseCredBuildStore<UserConfig>;
|
|
293
|
+
/**
|
|
294
|
+
* Get the latest state without relying on a render
|
|
295
|
+
*
|
|
296
|
+
* @returns CredBuildApi
|
|
297
|
+
*/
|
|
298
|
+
declare function useGetCredBuild(): () => UseCredBuildStore<Config>;
|
|
299
|
+
|
|
300
|
+
declare const blocksPlugin: () => Plugin;
|
|
301
|
+
|
|
302
|
+
declare const fieldsPlugin: (params?: {
|
|
303
|
+
desktopSideBar?: "left" | "right";
|
|
304
|
+
}) => PluginInternal;
|
|
305
|
+
|
|
306
|
+
declare const outlinePlugin: () => Plugin;
|
|
307
|
+
|
|
308
|
+
declare const legacySideBarPlugin: () => Plugin;
|
|
309
|
+
|
|
310
|
+
export { Action, ActionBar, AutoField, Button, ComponentData, Config, CredBuild, CredBuildAction, type CredBuildApi, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, Separator, UiState, type UseCredBuildData, UserGenerics, Viewports, blocksPlugin, createUseCredBuild, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useCredBuild, useGetCredBuild };
|