@measured/puck 0.21.0-canary.3aa27d1d → 0.21.0-canary.501341c5

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.
Files changed (52) hide show
  1. package/dist/Editor-F2LSS6SE.css +403 -0
  2. package/dist/Editor-O447AVCX.mjs +204 -0
  3. package/dist/Render-OFE6QLI2.mjs +55 -0
  4. package/dist/Render-QEMDIDQC.css +101 -0
  5. package/dist/{walk-tree-16XYcbNo.d.mts → actions-CJibIB0m.d.mts} +8 -33
  6. package/dist/{walk-tree-16XYcbNo.d.ts → actions-CJibIB0m.d.ts} +8 -33
  7. package/dist/chunk-2Q4PACDA.mjs +111 -0
  8. package/dist/chunk-62AAYNXG.mjs +63 -0
  9. package/dist/chunk-BSDEIOEK.mjs +706 -0
  10. package/dist/chunk-CSSRLPHM.mjs +11 -0
  11. package/dist/chunk-DAQLMM2T.mjs +1722 -0
  12. package/dist/chunk-M6W7YEVX.mjs +95 -0
  13. package/dist/chunk-NLUHDYVR.mjs +416 -0
  14. package/dist/chunk-PLXSMBAA.mjs +53 -0
  15. package/dist/chunk-QAWJTCV5.mjs +33 -0
  16. package/dist/chunk-QBGM4ELA.mjs +528 -0
  17. package/dist/chunk-T3WX7XJ6.mjs +132 -0
  18. package/dist/chunk-V5I7CVLT.mjs +103 -0
  19. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  20. package/dist/chunk-Y656T6AQ.mjs +419 -0
  21. package/dist/{chunk-GFIVKP2H.mjs → chunk-Z476VA6G.mjs} +1164 -4159
  22. package/dist/full-2GJTAAZE.css +301 -0
  23. package/dist/full-BEMDJKDS.mjs +93 -0
  24. package/dist/index-Bss1jupB.d.ts +116 -0
  25. package/dist/index-DOcD_H3b.d.mts +116 -0
  26. package/dist/index.css +102 -94
  27. package/dist/index.d.mts +10 -126
  28. package/dist/index.d.ts +10 -126
  29. package/dist/index.js +6864 -5123
  30. package/dist/index.mjs +26 -11
  31. package/dist/internal.d.mts +27 -0
  32. package/dist/internal.d.ts +27 -0
  33. package/dist/internal.js +908 -0
  34. package/dist/internal.mjs +13 -0
  35. package/dist/loaded-JU3A7Y4L.mjs +57 -0
  36. package/dist/loaded-N3FYGF2Y.mjs +57 -0
  37. package/dist/loaded-OBY7OMS6.mjs +60 -0
  38. package/dist/loaded-RVWBFK7L.css +87 -0
  39. package/dist/no-external.css +102 -94
  40. package/dist/no-external.d.mts +3 -1
  41. package/dist/no-external.d.ts +3 -1
  42. package/dist/no-external.js +6864 -5123
  43. package/dist/no-external.mjs +26 -11
  44. package/dist/rsc.css +34 -26
  45. package/dist/rsc.d.mts +2 -2
  46. package/dist/rsc.d.ts +2 -2
  47. package/dist/rsc.js +245 -187
  48. package/dist/rsc.mjs +18 -9
  49. package/dist/walk-tree-BL55zQ9b.d.ts +29 -0
  50. package/dist/walk-tree-BYuI81Ik.d.mts +29 -0
  51. package/package.json +9 -4
  52. package/dist/chunk-SRDLYODX.mjs +0 -1245
package/dist/index.css CHANGED
@@ -1098,100 +1098,6 @@ textarea._Input-input_bsxfo_26 {
1098
1098
  padding-inline-start: 8px;
1099
1099
  }
1100
1100
 
1101
- /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
1102
- ._RichTextEditor_1819a_1 .ProseMirror {
1103
- white-space: pre-wrap;
1104
- word-wrap: break-word;
1105
- cursor: text;
1106
- outline: none;
1107
- position: relative;
1108
- }
1109
- ._RichTextEditor_1819a_1 .rich-text * {
1110
- white-space: pre-wrap;
1111
- }
1112
- ._RichTextEditor_1819a_1 .rich-text blockquote {
1113
- margin: 1em 0;
1114
- padding: 0 1em;
1115
- border-left: 4px solid var(--puck-color-grey-09);
1116
- }
1117
- ._RichTextEditor_1819a_1 .rich-text code {
1118
- background-color: var(--puck-color-grey-11);
1119
- padding: 4px 8px;
1120
- border-radius: 4px;
1121
- }
1122
- ._RichTextEditor_1819a_1 .rich-text p:empty::before {
1123
- content: "\a0";
1124
- }
1125
- ._RichTextEditor_1819a_1 .rich-text pre code {
1126
- display: block;
1127
- padding: 8px 12px;
1128
- }
1129
- ._RichTextEditor_1819a_1 .rich-text > *:first-child,
1130
- ._RichTextEditor_1819a_1 .ProseMirror > *:first-child,
1131
- ._RichTextEditor_1819a_1 .rich-text * p:first-of-type {
1132
- margin-top: 0;
1133
- }
1134
- ._RichTextEditor_1819a_1 .rich-text > *:last-child,
1135
- ._RichTextEditor_1819a_1 .ProseMirror > *:last-child,
1136
- ._RichTextEditor_1819a_1 .rich-text * p:last-of-type {
1137
- margin-bottom: 0;
1138
- }
1139
- ._RichTextEditor--editor_1819a_46 {
1140
- background: var(--puck-color-white);
1141
- border-width: 1px;
1142
- border-style: solid;
1143
- border-color: var(--puck-color-grey-09);
1144
- border-radius: 4px;
1145
- box-sizing: border-box;
1146
- font-family: inherit;
1147
- font-size: var(--puck-font-size-xxs);
1148
- resize: vertical;
1149
- transition: border-color 50ms ease-in;
1150
- width: 100%;
1151
- max-width: 100%;
1152
- min-height: 128px;
1153
- }
1154
- ._RichTextEditor--editor_1819a_46 .rich-text:not(:has(.ProseMirror)),
1155
- ._RichTextEditor--editor_1819a_46 .rich-text .ProseMirror {
1156
- padding: 12px 15px;
1157
- }
1158
- ._RichTextEditor--editor_1819a_46 .rich-text ul,
1159
- ._RichTextEditor--editor_1819a_46 .rich-text ol {
1160
- padding-left: 24px;
1161
- }
1162
- ._RichTextEditor--editor_1819a_46 .rich-text li {
1163
- line-height: 1.5;
1164
- }
1165
- ._RichTextEditor--editor_1819a_46 .rich-text p {
1166
- margin-block: 12px;
1167
- }
1168
- ._RichTextEditor--editor_1819a_46 .rich-text ul {
1169
- list-style: disc;
1170
- }
1171
- ._RichTextEditor--editor_1819a_46 .rich-text ol {
1172
- list-style: decimal;
1173
- }
1174
- ._RichTextEditor--editor_1819a_46:focus-within {
1175
- border-color: var(--puck-color-grey-05);
1176
- outline: 2px solid var(--puck-color-azure-05);
1177
- transition: none;
1178
- }
1179
- ._RichTextEditor--editor_1819a_46._RichTextEditor--disabled_1819a_95 {
1180
- background: var(--puck-color-grey-11);
1181
- }
1182
- ._RichTextEditor_1819a_1:not(:focus-within):not(._RichTextEditor--isActive_1819a_99) .ProseMirror ::selection {
1183
- background-color: transparent;
1184
- }
1185
- ._RichTextEditor-menu_1819a_105 {
1186
- border-bottom: 1px solid var(--puck-color-grey-10);
1187
- position: sticky;
1188
- top: 0;
1189
- z-index: 1;
1190
- }
1191
- ._RichTextEditor--disabled_1819a_95 ._RichTextEditor-menu_1819a_105 {
1192
- border-bottom: 1px solid var(--puck-color-grey-09);
1193
- }
1194
-
1195
1101
  /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css/#css-module-data */
1196
1102
  ._RichTextMenu_k97eh_1 {
1197
1103
  display: flex;
@@ -1332,6 +1238,108 @@ textarea._Input-input_bsxfo_26 {
1332
1238
  color: var(--puck-color-azure-04);
1333
1239
  }
1334
1240
 
1241
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
1242
+ ._RichTextEditor_1elol_1 .ProseMirror {
1243
+ white-space: pre-wrap;
1244
+ word-wrap: break-word;
1245
+ cursor: text;
1246
+ outline: none;
1247
+ position: relative;
1248
+ }
1249
+ ._RichTextEditor_1elol_1 .rich-text * {
1250
+ white-space: pre-wrap;
1251
+ user-select: auto;
1252
+ -webkit-user-select: auto;
1253
+ }
1254
+ ._RichTextEditor_1elol_1 .rich-text blockquote {
1255
+ margin: 1em 0;
1256
+ padding: 0 1em;
1257
+ border-left: 4px solid var(--puck-color-grey-09);
1258
+ }
1259
+ ._RichTextEditor_1elol_1 .rich-text code {
1260
+ background-color: var(--puck-color-grey-11);
1261
+ padding: 4px 8px;
1262
+ border-radius: 4px;
1263
+ }
1264
+ ._RichTextEditor_1elol_1 .rich-text p:empty::before {
1265
+ content: "\a0";
1266
+ }
1267
+ ._RichTextEditor_1elol_1 .rich-text pre code {
1268
+ display: block;
1269
+ padding: 8px 12px;
1270
+ }
1271
+ ._RichTextEditor_1elol_1 .rich-text > *:first-child,
1272
+ ._RichTextEditor_1elol_1 .ProseMirror > *:first-child,
1273
+ ._RichTextEditor_1elol_1 .rich-text * p:first-of-type {
1274
+ margin-top: 0;
1275
+ }
1276
+ ._RichTextEditor_1elol_1 .rich-text > *:last-child,
1277
+ ._RichTextEditor_1elol_1 .ProseMirror > *:last-child,
1278
+ ._RichTextEditor_1elol_1 .rich-text * p:last-of-type {
1279
+ margin-bottom: 0;
1280
+ }
1281
+ ._RichTextEditor--editor_1elol_50 {
1282
+ background: var(--puck-color-white);
1283
+ border-width: 1px;
1284
+ border-style: solid;
1285
+ border-color: var(--puck-color-grey-09);
1286
+ border-radius: 4px;
1287
+ box-sizing: border-box;
1288
+ display: flex;
1289
+ flex-direction: column;
1290
+ font-family: inherit;
1291
+ font-size: var(--puck-font-size-xxs);
1292
+ resize: vertical;
1293
+ transition: border-color 50ms ease-in;
1294
+ width: 100%;
1295
+ max-width: 100%;
1296
+ min-height: 128px;
1297
+ }
1298
+ ._RichTextEditor--editor_1elol_50 .rich-text {
1299
+ flex-grow: 1;
1300
+ }
1301
+ ._RichTextEditor--editor_1elol_50 .rich-text:not(:has(.ProseMirror)),
1302
+ ._RichTextEditor--editor_1elol_50 .rich-text .ProseMirror {
1303
+ height: 100%;
1304
+ padding: 12px 15px;
1305
+ }
1306
+ ._RichTextEditor--editor_1elol_50 .rich-text ul,
1307
+ ._RichTextEditor--editor_1elol_50 .rich-text ol {
1308
+ padding-left: 24px;
1309
+ }
1310
+ ._RichTextEditor--editor_1elol_50 .rich-text li {
1311
+ line-height: 1.5;
1312
+ }
1313
+ ._RichTextEditor--editor_1elol_50 .rich-text p {
1314
+ margin-block: 12px;
1315
+ }
1316
+ ._RichTextEditor--editor_1elol_50 .rich-text ul {
1317
+ list-style: disc;
1318
+ }
1319
+ ._RichTextEditor--editor_1elol_50 .rich-text ol {
1320
+ list-style: decimal;
1321
+ }
1322
+ ._RichTextEditor--editor_1elol_50:focus-within {
1323
+ border-color: var(--puck-color-grey-05);
1324
+ outline: 2px solid var(--puck-color-azure-05);
1325
+ transition: none;
1326
+ }
1327
+ ._RichTextEditor--editor_1elol_50._RichTextEditor--disabled_1elol_106 {
1328
+ background: var(--puck-color-grey-11);
1329
+ }
1330
+ ._RichTextEditor_1elol_1:not(:focus-within):not(._RichTextEditor--isActive_1elol_110) .ProseMirror ::selection {
1331
+ background-color: transparent;
1332
+ }
1333
+ ._RichTextEditor-menu_1elol_116 {
1334
+ border-bottom: 1px solid var(--puck-color-grey-10);
1335
+ position: sticky;
1336
+ top: 0;
1337
+ z-index: 1;
1338
+ }
1339
+ ._RichTextEditor--disabled_1elol_106 ._RichTextEditor-menu_1elol_116 {
1340
+ border-bottom: 1px solid var(--puck-color-grey-09);
1341
+ }
1342
+
1335
1343
  /* css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/fields/ObjectField/styles.module.css/#css-module-data */
1336
1344
  ._ObjectField_1ua3y_5 {
1337
1345
  display: flex;
package/dist/index.d.mts CHANGED
@@ -1,9 +1,11 @@
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 RichtextField, i as Field, j as FieldProps, D as DropZoneProps, k as Data, l as OnAction, n as InitialHistory, o as ItemSelector } from './walk-tree-16XYcbNo.mjs';
2
- export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, p as RichText, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-16XYcbNo.mjs';
1
+ import { p as Field, q as FieldProps, r as DropZoneProps, C 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, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, t as ItemSelector, c as ComponentData } from './actions-CJibIB0m.mjs';
2
+ export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, a6 as FieldMetadata, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, F as Fields, H as History, K as ItemWithId, a2 as MappedItem, a9 as NumberField, ae as ObjectField, G as OverrideKey, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, y as Viewport, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-CJibIB0m.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BYuI81Ik.mjs';
3
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
5
  import * as react from 'react';
5
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
6
- import { Editor } from '@tiptap/react';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-DOcD_H3b.mjs';
8
+ import '@tiptap/react';
7
9
  import '@tiptap/extension-blockquote';
8
10
  import '@tiptap/extension-bold';
9
11
  import '@tiptap/extension-code';
@@ -19,118 +21,6 @@ import '@tiptap/extension-strike';
19
21
  import '@tiptap/extension-text-align';
20
22
  import '@tiptap/extension-underline';
21
23
 
22
- type HistorySlice<D = any> = {
23
- index: number;
24
- hasPast: () => boolean;
25
- hasFuture: () => boolean;
26
- histories: History<D>[];
27
- record: (data: D) => void;
28
- back: VoidFunction;
29
- forward: VoidFunction;
30
- currentHistory: () => History;
31
- nextHistory: () => History<D> | null;
32
- prevHistory: () => History<D> | null;
33
- setHistories: (histories: History[]) => void;
34
- setHistoryIndex: (index: number) => void;
35
- initialAppState: D;
36
- };
37
-
38
- type NodeMethods = {
39
- sync: () => void;
40
- hideOverlay: () => void;
41
- showOverlay: () => void;
42
- };
43
- type PuckNodeInstance = {
44
- id: string;
45
- methods: NodeMethods;
46
- element: HTMLElement | null;
47
- };
48
- type NodesSlice = {
49
- nodes: Record<string, PuckNodeInstance | undefined>;
50
- registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
51
- unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
52
- };
53
-
54
- type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
55
- item?: G["UserComponentData"] | null;
56
- type?: keyof G["UserProps"];
57
- root?: boolean;
58
- };
59
- type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
60
- type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
61
- type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
62
- type Cache = Record<string, {
63
- lastPermissions: Partial<Permissions>;
64
- lastData: ComponentData | null;
65
- lastParentId: string | null;
66
- }>;
67
- type PermissionsSlice = {
68
- cache: Cache;
69
- globalPermissions: Permissions;
70
- resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
71
- getPermissions: GetPermissions<Config>;
72
- resolvePermissions: ResolvePermissions<Config>;
73
- refreshPermissions: RefreshPermissions<Config>;
74
- };
75
-
76
- type ComponentOrRootData = Omit<ComponentData<any>, "type">;
77
- type FieldsSlice = {
78
- fields: Fields | Partial<Fields>;
79
- loading: boolean;
80
- lastResolvedData: Partial<ComponentOrRootData>;
81
- id: string | undefined;
82
- };
83
-
84
- type Status = "LOADING" | "MOUNTED" | "READY";
85
- type ZoomConfig = {
86
- autoZoom: number;
87
- rootHeight: number;
88
- zoom: number;
89
- };
90
- type ComponentState = Record<string, {
91
- loadingCount: number;
92
- }>;
93
- type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
94
- state: G["UserAppState"];
95
- dispatch: (action: PuckAction) => void;
96
- config: UserConfig;
97
- componentState: ComponentState;
98
- setComponentState: (componentState: ComponentState) => void;
99
- setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
100
- unsetComponentLoading: (id: string) => void;
101
- pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
102
- resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
103
- node: T;
104
- didChange: boolean;
105
- }>;
106
- resolveAndCommitData: () => void;
107
- plugins: Plugin[];
108
- overrides: Partial<Overrides>;
109
- viewports: Viewports;
110
- zoomConfig: ZoomConfig;
111
- setZoomConfig: (zoomConfig: ZoomConfig) => void;
112
- status: Status;
113
- setStatus: (status: Status) => void;
114
- iframe: IframeConfig;
115
- selectedItem?: G["UserData"]["content"][0] | null;
116
- setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
117
- getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
118
- onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
119
- metadata: Metadata;
120
- fields: FieldsSlice;
121
- history: HistorySlice;
122
- nodes: NodesSlice;
123
- permissions: PermissionsSlice;
124
- fieldTransforms: FieldTransforms;
125
- currentRichText?: {
126
- inlineComponentId?: string;
127
- inline: boolean;
128
- field: RichtextField;
129
- editor: Editor;
130
- id: string;
131
- } | null;
132
- };
133
-
134
24
  declare const ActionBar: {
135
25
  ({ label, children, }: {
136
26
  label?: string;
@@ -211,7 +101,7 @@ declare const Drawer: {
211
101
  }) => react_jsx_runtime.JSX.Element;
212
102
  };
213
103
 
214
- declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
104
+ declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
215
105
 
216
106
  declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
217
107
  active?: boolean;
@@ -288,8 +178,6 @@ declare function AlignRight(): react_jsx_runtime.JSX.Element;
288
178
 
289
179
  declare function AlignJustify(): react_jsx_runtime.JSX.Element;
290
180
 
291
- declare function AlignSelect(): react_jsx_runtime.JSX.Element;
292
-
293
181
  declare function Bold(): react_jsx_runtime.JSX.Element;
294
182
 
295
183
  declare function Italic(): react_jsx_runtime.JSX.Element;
@@ -310,10 +198,6 @@ declare function Blockquote(): react_jsx_runtime.JSX.Element;
310
198
 
311
199
  declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
312
200
 
313
- declare function HeadingSelect(): react_jsx_runtime.JSX.Element;
314
-
315
- declare function ListSelect(): react_jsx_runtime.JSX.Element;
316
-
317
201
  declare function Control({ icon, disabled, active, onClick, title, }: {
318
202
  icon: ReactNode;
319
203
  disabled?: boolean;
@@ -334,16 +218,16 @@ declare const RichTextMenu: {
334
218
  AlignJustify: typeof AlignJustify;
335
219
  AlignLeft: typeof AlignLeft;
336
220
  AlignRight: typeof AlignRight;
337
- AlignSelect: typeof AlignSelect;
221
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
338
222
  Blockquote: typeof Blockquote;
339
223
  Bold: typeof Bold;
340
224
  BulletList: typeof BulletList;
341
225
  CodeBlock: typeof CodeBlock;
342
- HeadingSelect: typeof HeadingSelect;
226
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
343
227
  HorizontalRule: typeof HorizontalRule;
344
228
  InlineCode: typeof InlineCode;
345
229
  Italic: typeof Italic;
346
- ListSelect: typeof ListSelect;
230
+ ListSelect: () => react_jsx_runtime.JSX.Element;
347
231
  OrderedList: typeof OrderedList;
348
232
  Strikethrough: typeof Strikethrough;
349
233
  Underline: typeof Underline;
@@ -401,4 +285,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
401
285
  */
402
286
  declare function useGetPuck(): () => UsePuckStore<Config>;
403
287
 
404
- 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, RichTextMenu, RichtextField, RootDataWithProps, Separator, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
288
+ export { Action, ActionBar, AutoField, Button, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, RichTextMenu, Separator, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
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 RichtextField, i as Field, j as FieldProps, D as DropZoneProps, k as Data, l as OnAction, n as InitialHistory, o as ItemSelector } from './walk-tree-16XYcbNo.js';
2
- export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, p as RichText, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-16XYcbNo.js';
1
+ import { p as Field, q as FieldProps, r as DropZoneProps, C 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, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, t as ItemSelector, c as ComponentData } from './actions-CJibIB0m.js';
2
+ export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, a6 as FieldMetadata, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, F as Fields, H as History, K as ItemWithId, a2 as MappedItem, a9 as NumberField, ae as ObjectField, G as OverrideKey, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, y as Viewport, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-CJibIB0m.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BL55zQ9b.js';
3
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
5
  import * as react from 'react';
5
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
6
- import { Editor } from '@tiptap/react';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-Bss1jupB.js';
8
+ import '@tiptap/react';
7
9
  import '@tiptap/extension-blockquote';
8
10
  import '@tiptap/extension-bold';
9
11
  import '@tiptap/extension-code';
@@ -19,118 +21,6 @@ import '@tiptap/extension-strike';
19
21
  import '@tiptap/extension-text-align';
20
22
  import '@tiptap/extension-underline';
21
23
 
22
- type HistorySlice<D = any> = {
23
- index: number;
24
- hasPast: () => boolean;
25
- hasFuture: () => boolean;
26
- histories: History<D>[];
27
- record: (data: D) => void;
28
- back: VoidFunction;
29
- forward: VoidFunction;
30
- currentHistory: () => History;
31
- nextHistory: () => History<D> | null;
32
- prevHistory: () => History<D> | null;
33
- setHistories: (histories: History[]) => void;
34
- setHistoryIndex: (index: number) => void;
35
- initialAppState: D;
36
- };
37
-
38
- type NodeMethods = {
39
- sync: () => void;
40
- hideOverlay: () => void;
41
- showOverlay: () => void;
42
- };
43
- type PuckNodeInstance = {
44
- id: string;
45
- methods: NodeMethods;
46
- element: HTMLElement | null;
47
- };
48
- type NodesSlice = {
49
- nodes: Record<string, PuckNodeInstance | undefined>;
50
- registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
51
- unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
52
- };
53
-
54
- type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
55
- item?: G["UserComponentData"] | null;
56
- type?: keyof G["UserProps"];
57
- root?: boolean;
58
- };
59
- type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
60
- type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
61
- type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
62
- type Cache = Record<string, {
63
- lastPermissions: Partial<Permissions>;
64
- lastData: ComponentData | null;
65
- lastParentId: string | null;
66
- }>;
67
- type PermissionsSlice = {
68
- cache: Cache;
69
- globalPermissions: Permissions;
70
- resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
71
- getPermissions: GetPermissions<Config>;
72
- resolvePermissions: ResolvePermissions<Config>;
73
- refreshPermissions: RefreshPermissions<Config>;
74
- };
75
-
76
- type ComponentOrRootData = Omit<ComponentData<any>, "type">;
77
- type FieldsSlice = {
78
- fields: Fields | Partial<Fields>;
79
- loading: boolean;
80
- lastResolvedData: Partial<ComponentOrRootData>;
81
- id: string | undefined;
82
- };
83
-
84
- type Status = "LOADING" | "MOUNTED" | "READY";
85
- type ZoomConfig = {
86
- autoZoom: number;
87
- rootHeight: number;
88
- zoom: number;
89
- };
90
- type ComponentState = Record<string, {
91
- loadingCount: number;
92
- }>;
93
- type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
94
- state: G["UserAppState"];
95
- dispatch: (action: PuckAction) => void;
96
- config: UserConfig;
97
- componentState: ComponentState;
98
- setComponentState: (componentState: ComponentState) => void;
99
- setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
100
- unsetComponentLoading: (id: string) => void;
101
- pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
102
- resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
103
- node: T;
104
- didChange: boolean;
105
- }>;
106
- resolveAndCommitData: () => void;
107
- plugins: Plugin[];
108
- overrides: Partial<Overrides>;
109
- viewports: Viewports;
110
- zoomConfig: ZoomConfig;
111
- setZoomConfig: (zoomConfig: ZoomConfig) => void;
112
- status: Status;
113
- setStatus: (status: Status) => void;
114
- iframe: IframeConfig;
115
- selectedItem?: G["UserData"]["content"][0] | null;
116
- setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
117
- getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
118
- onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
119
- metadata: Metadata;
120
- fields: FieldsSlice;
121
- history: HistorySlice;
122
- nodes: NodesSlice;
123
- permissions: PermissionsSlice;
124
- fieldTransforms: FieldTransforms;
125
- currentRichText?: {
126
- inlineComponentId?: string;
127
- inline: boolean;
128
- field: RichtextField;
129
- editor: Editor;
130
- id: string;
131
- } | null;
132
- };
133
-
134
24
  declare const ActionBar: {
135
25
  ({ label, children, }: {
136
26
  label?: string;
@@ -211,7 +101,7 @@ declare const Drawer: {
211
101
  }) => react_jsx_runtime.JSX.Element;
212
102
  };
213
103
 
214
- declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
104
+ declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
215
105
 
216
106
  declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
217
107
  active?: boolean;
@@ -288,8 +178,6 @@ declare function AlignRight(): react_jsx_runtime.JSX.Element;
288
178
 
289
179
  declare function AlignJustify(): react_jsx_runtime.JSX.Element;
290
180
 
291
- declare function AlignSelect(): react_jsx_runtime.JSX.Element;
292
-
293
181
  declare function Bold(): react_jsx_runtime.JSX.Element;
294
182
 
295
183
  declare function Italic(): react_jsx_runtime.JSX.Element;
@@ -310,10 +198,6 @@ declare function Blockquote(): react_jsx_runtime.JSX.Element;
310
198
 
311
199
  declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
312
200
 
313
- declare function HeadingSelect(): react_jsx_runtime.JSX.Element;
314
-
315
- declare function ListSelect(): react_jsx_runtime.JSX.Element;
316
-
317
201
  declare function Control({ icon, disabled, active, onClick, title, }: {
318
202
  icon: ReactNode;
319
203
  disabled?: boolean;
@@ -334,16 +218,16 @@ declare const RichTextMenu: {
334
218
  AlignJustify: typeof AlignJustify;
335
219
  AlignLeft: typeof AlignLeft;
336
220
  AlignRight: typeof AlignRight;
337
- AlignSelect: typeof AlignSelect;
221
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
338
222
  Blockquote: typeof Blockquote;
339
223
  Bold: typeof Bold;
340
224
  BulletList: typeof BulletList;
341
225
  CodeBlock: typeof CodeBlock;
342
- HeadingSelect: typeof HeadingSelect;
226
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
343
227
  HorizontalRule: typeof HorizontalRule;
344
228
  InlineCode: typeof InlineCode;
345
229
  Italic: typeof Italic;
346
- ListSelect: typeof ListSelect;
230
+ ListSelect: () => react_jsx_runtime.JSX.Element;
347
231
  OrderedList: typeof OrderedList;
348
232
  Strikethrough: typeof Strikethrough;
349
233
  Underline: typeof Underline;
@@ -401,4 +285,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
401
285
  */
402
286
  declare function useGetPuck(): () => UsePuckStore<Config>;
403
287
 
404
- 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, RichTextMenu, RichtextField, RootDataWithProps, Separator, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
288
+ export { Action, ActionBar, AutoField, Button, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, RichTextMenu, Separator, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };