@measured/puck 0.21.0-canary.c78dc826 → 0.21.0-canary.cbc526d1

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 (50) hide show
  1. package/dist/{Editor-N46HUQEC.mjs → Editor-32UYWE6W.mjs} +13 -10
  2. package/dist/{Editor-F2LSS6SE.css → Editor-IQP25PUX.css} +28 -27
  3. package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
  4. package/dist/{Render-Y567PGZ7.mjs → Render-FXZX6NFH.mjs} +6 -4
  5. package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-BkBoKAc5.d.mts} +26 -36
  6. package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-BkBoKAc5.d.ts} +26 -36
  7. package/dist/{chunk-3QHWXJEI.mjs → chunk-3VQHXASI.mjs} +2 -2
  8. package/dist/{chunk-K3V4LVUL.mjs → chunk-6KNQXLQR.mjs} +14 -10
  9. package/dist/chunk-AOEDIUVK.mjs +11 -0
  10. package/dist/{chunk-GQKMOYLG.mjs → chunk-GVKHZNTR.mjs} +2 -2
  11. package/dist/{chunk-7KY6RHEY.mjs → chunk-K562SEXI.mjs} +109 -526
  12. package/dist/chunk-KN3XDS7U.mjs +528 -0
  13. package/dist/{chunk-DCSQEDMK.mjs → chunk-M6W7YEVX.mjs} +1 -100
  14. package/dist/{chunk-DNF2EMM4.mjs → chunk-MEL7FUSF.mjs} +2 -2
  15. package/dist/{chunk-C2TVYIYC.mjs → chunk-NYGQH27S.mjs} +105 -75
  16. package/dist/{chunk-DJSH5REF.mjs → chunk-Q3TJ2VYO.mjs} +25 -126
  17. package/dist/chunk-REWRIUGR.mjs +156 -0
  18. package/dist/{chunk-FNWOH4R6.mjs → chunk-V2IQTPPK.mjs} +8 -6
  19. package/dist/{chunk-R6CVX2IY.mjs → chunk-V5I7CVLT.mjs} +1 -1
  20. package/dist/{chunk-TB3SSIAY.mjs → chunk-WD3LNSAC.mjs} +5258 -4424
  21. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  22. package/dist/{full-NLUNPJWS.mjs → full-4OS3O57Y.mjs} +10 -7
  23. package/dist/index-bqD1SEOb.d.mts +118 -0
  24. package/dist/index-lt1zf5WR.d.ts +118 -0
  25. package/dist/index.css +732 -341
  26. package/dist/index.d.mts +31 -120
  27. package/dist/index.d.ts +31 -120
  28. package/dist/index.js +3494 -2436
  29. package/dist/index.mjs +22 -16
  30. package/dist/internal.d.mts +27 -0
  31. package/dist/internal.d.ts +27 -0
  32. package/dist/internal.js +927 -0
  33. package/dist/internal.mjs +13 -0
  34. package/dist/{loaded-ZXOU6S6R.mjs → loaded-DCQVLO7I.mjs} +7 -4
  35. package/dist/{loaded-HMSPJUZM.mjs → loaded-JGRO7BH7.mjs} +7 -4
  36. package/dist/{loaded-EV34KGYJ.mjs → loaded-KKVJE5KH.mjs} +7 -4
  37. package/dist/no-external.css +870 -475
  38. package/dist/no-external.d.mts +4 -2
  39. package/dist/no-external.d.ts +4 -2
  40. package/dist/no-external.js +3412 -2351
  41. package/dist/no-external.mjs +22 -11
  42. package/dist/rsc.css +28 -27
  43. package/dist/rsc.d.mts +2 -2
  44. package/dist/rsc.d.ts +2 -2
  45. package/dist/rsc.js +146 -83
  46. package/dist/rsc.mjs +6 -4
  47. package/dist/walk-tree-CRRDqx6_.d.mts +29 -0
  48. package/dist/walk-tree-CS7sEpfG.d.ts +29 -0
  49. package/package.json +9 -4
  50. package/dist/chunk-WUWXFMEM.mjs +0 -11
@@ -0,0 +1,108 @@
1
+ import {
2
+ __commonJS,
3
+ __spreadValues,
4
+ __toESM,
5
+ init_react_import
6
+ } from "./chunk-M6W7YEVX.mjs";
7
+
8
+ // ../../node_modules/classnames/index.js
9
+ var require_classnames = __commonJS({
10
+ "../../node_modules/classnames/index.js"(exports, module) {
11
+ "use strict";
12
+ init_react_import();
13
+ (function() {
14
+ "use strict";
15
+ var hasOwn = {}.hasOwnProperty;
16
+ function classNames() {
17
+ var classes = "";
18
+ for (var i = 0; i < arguments.length; i++) {
19
+ var arg = arguments[i];
20
+ if (arg) {
21
+ classes = appendClass(classes, parseValue(arg));
22
+ }
23
+ }
24
+ return classes;
25
+ }
26
+ function parseValue(arg) {
27
+ if (typeof arg === "string" || typeof arg === "number") {
28
+ return arg;
29
+ }
30
+ if (typeof arg !== "object") {
31
+ return "";
32
+ }
33
+ if (Array.isArray(arg)) {
34
+ return classNames.apply(null, arg);
35
+ }
36
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
37
+ return arg.toString();
38
+ }
39
+ var classes = "";
40
+ for (var key in arg) {
41
+ if (hasOwn.call(arg, key) && arg[key]) {
42
+ classes = appendClass(classes, key);
43
+ }
44
+ }
45
+ return classes;
46
+ }
47
+ function appendClass(value, newClass) {
48
+ if (!newClass) {
49
+ return value;
50
+ }
51
+ if (value) {
52
+ return value + " " + newClass;
53
+ }
54
+ return value + newClass;
55
+ }
56
+ if (typeof module !== "undefined" && module.exports) {
57
+ classNames.default = classNames;
58
+ module.exports = classNames;
59
+ } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
60
+ define("classnames", [], function() {
61
+ return classNames;
62
+ });
63
+ } else {
64
+ window.classNames = classNames;
65
+ }
66
+ })();
67
+ }
68
+ });
69
+
70
+ // lib/get-class-name-factory.ts
71
+ init_react_import();
72
+ var import_classnames = __toESM(require_classnames());
73
+ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
74
+ if (typeof options === "string") {
75
+ const descendant = options;
76
+ const style = styles[`${rootClass}-${descendant}`];
77
+ if (style) {
78
+ return config.baseClass + styles[`${rootClass}-${descendant}`] || "";
79
+ }
80
+ return "";
81
+ } else if (typeof options === "object") {
82
+ const modifiers = options;
83
+ const prefixedModifiers = {};
84
+ for (let modifier in modifiers) {
85
+ prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
86
+ }
87
+ const c = styles[rootClass];
88
+ return config.baseClass + (0, import_classnames.default)(__spreadValues({
89
+ [c]: !!c
90
+ }, prefixedModifiers));
91
+ } else {
92
+ return config.baseClass + styles[rootClass] || "";
93
+ }
94
+ };
95
+ var get_class_name_factory_default = getClassNameFactory;
96
+
97
+ export {
98
+ get_class_name_factory_default
99
+ };
100
+ /*! Bundled license information:
101
+
102
+ classnames/index.js:
103
+ (*!
104
+ Copyright (c) 2018 Jed Watson.
105
+ Licensed under the MIT License (MIT), see
106
+ http://jedwatson.github.io/classnames
107
+ *)
108
+ */
@@ -1,15 +1,18 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-K3V4LVUL.mjs";
4
- import "./chunk-GQKMOYLG.mjs";
5
- import "./chunk-DNF2EMM4.mjs";
6
- import "./chunk-3QHWXJEI.mjs";
7
- import "./chunk-7KY6RHEY.mjs";
8
- import "./chunk-DJSH5REF.mjs";
3
+ } from "./chunk-6KNQXLQR.mjs";
4
+ import "./chunk-GVKHZNTR.mjs";
5
+ import "./chunk-MEL7FUSF.mjs";
6
+ import "./chunk-3VQHXASI.mjs";
7
+ import "./chunk-K562SEXI.mjs";
8
+ import "./chunk-KN3XDS7U.mjs";
9
+ import "./chunk-REWRIUGR.mjs";
10
+ import "./chunk-Y2EFNT5P.mjs";
11
+ import "./chunk-Q3TJ2VYO.mjs";
9
12
  import {
10
13
  __spreadValues,
11
14
  init_react_import
12
- } from "./chunk-DCSQEDMK.mjs";
15
+ } from "./chunk-M6W7YEVX.mjs";
13
16
 
14
17
  // components/RichTextMenu/full.tsx
15
18
  init_react_import();
@@ -0,0 +1,118 @@
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, o as RichtextField } from './actions-BkBoKAc5.mjs';
2
+ import { Editor } from '@tiptap/react';
3
+
4
+ type HistorySlice<D = any> = {
5
+ index: number;
6
+ hasPast: () => boolean;
7
+ hasFuture: () => boolean;
8
+ histories: History<D>[];
9
+ record: (data: D) => void;
10
+ back: VoidFunction;
11
+ forward: VoidFunction;
12
+ currentHistory: () => History;
13
+ nextHistory: () => History<D> | null;
14
+ prevHistory: () => History<D> | null;
15
+ setHistories: (histories: History[]) => void;
16
+ setHistoryIndex: (index: number) => void;
17
+ initialAppState: D;
18
+ };
19
+
20
+ type NodeMethods = {
21
+ sync: () => void;
22
+ hideOverlay: () => void;
23
+ showOverlay: () => void;
24
+ };
25
+ type PuckNodeInstance = {
26
+ id: string;
27
+ methods: NodeMethods;
28
+ element: HTMLElement | null;
29
+ };
30
+ type NodesSlice = {
31
+ nodes: Record<string, PuckNodeInstance | undefined>;
32
+ registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
33
+ unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
34
+ };
35
+
36
+ type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
37
+ item?: G["UserComponentData"] | null;
38
+ type?: keyof G["UserProps"];
39
+ root?: boolean;
40
+ };
41
+ type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
42
+ type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
43
+ type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
44
+ type Cache = Record<string, {
45
+ lastPermissions: Partial<Permissions>;
46
+ lastData: ComponentData | null;
47
+ lastParentId: string | null;
48
+ }>;
49
+ type PermissionsSlice = {
50
+ cache: Cache;
51
+ globalPermissions: Permissions;
52
+ resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
53
+ getPermissions: GetPermissions<Config>;
54
+ resolvePermissions: ResolvePermissions<Config>;
55
+ refreshPermissions: RefreshPermissions<Config>;
56
+ };
57
+
58
+ type ComponentOrRootData = Omit<ComponentData<any>, "type">;
59
+ type FieldsSlice = {
60
+ fields: Fields | Partial<Fields>;
61
+ loading: boolean;
62
+ lastResolvedData: Partial<ComponentOrRootData>;
63
+ id: string | undefined;
64
+ };
65
+
66
+ type Status = "LOADING" | "MOUNTED" | "READY";
67
+ type ZoomConfig = {
68
+ autoZoom: number;
69
+ rootHeight: number;
70
+ zoom: number;
71
+ };
72
+ type ComponentState = Record<string, {
73
+ loadingCount: number;
74
+ }>;
75
+ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
76
+ instanceId: string;
77
+ state: G["UserAppState"];
78
+ dispatch: (action: PuckAction) => void;
79
+ config: UserConfig;
80
+ componentState: ComponentState;
81
+ setComponentState: (componentState: ComponentState) => void;
82
+ setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
83
+ unsetComponentLoading: (id: string) => void;
84
+ pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
85
+ resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
86
+ node: T;
87
+ didChange: boolean;
88
+ }>;
89
+ resolveAndCommitData: () => void;
90
+ plugins: Plugin[];
91
+ overrides: Partial<Overrides>;
92
+ viewports: Viewports;
93
+ zoomConfig: ZoomConfig;
94
+ setZoomConfig: (zoomConfig: ZoomConfig) => void;
95
+ status: Status;
96
+ setStatus: (status: Status) => void;
97
+ iframe: IframeConfig;
98
+ selectedItem?: G["UserData"]["content"][0] | null;
99
+ getCurrentData: () => G["UserData"]["content"][0] | G["UserData"]["root"];
100
+ setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
101
+ getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
102
+ onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
103
+ metadata: Metadata;
104
+ fields: FieldsSlice;
105
+ history: HistorySlice;
106
+ nodes: NodesSlice;
107
+ permissions: PermissionsSlice;
108
+ fieldTransforms: FieldTransforms;
109
+ currentRichText?: {
110
+ inlineComponentId?: string;
111
+ inline: boolean;
112
+ field: RichtextField;
113
+ editor: Editor;
114
+ id: string;
115
+ } | null;
116
+ };
117
+
118
+ export type { AppStore as A, GetPermissions as G, HistorySlice as H, RefreshPermissions as R };
@@ -0,0 +1,118 @@
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, o as RichtextField } from './actions-BkBoKAc5.js';
2
+ import { Editor } from '@tiptap/react';
3
+
4
+ type HistorySlice<D = any> = {
5
+ index: number;
6
+ hasPast: () => boolean;
7
+ hasFuture: () => boolean;
8
+ histories: History<D>[];
9
+ record: (data: D) => void;
10
+ back: VoidFunction;
11
+ forward: VoidFunction;
12
+ currentHistory: () => History;
13
+ nextHistory: () => History<D> | null;
14
+ prevHistory: () => History<D> | null;
15
+ setHistories: (histories: History[]) => void;
16
+ setHistoryIndex: (index: number) => void;
17
+ initialAppState: D;
18
+ };
19
+
20
+ type NodeMethods = {
21
+ sync: () => void;
22
+ hideOverlay: () => void;
23
+ showOverlay: () => void;
24
+ };
25
+ type PuckNodeInstance = {
26
+ id: string;
27
+ methods: NodeMethods;
28
+ element: HTMLElement | null;
29
+ };
30
+ type NodesSlice = {
31
+ nodes: Record<string, PuckNodeInstance | undefined>;
32
+ registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
33
+ unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
34
+ };
35
+
36
+ type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
37
+ item?: G["UserComponentData"] | null;
38
+ type?: keyof G["UserProps"];
39
+ root?: boolean;
40
+ };
41
+ type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
42
+ type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
43
+ type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
44
+ type Cache = Record<string, {
45
+ lastPermissions: Partial<Permissions>;
46
+ lastData: ComponentData | null;
47
+ lastParentId: string | null;
48
+ }>;
49
+ type PermissionsSlice = {
50
+ cache: Cache;
51
+ globalPermissions: Permissions;
52
+ resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
53
+ getPermissions: GetPermissions<Config>;
54
+ resolvePermissions: ResolvePermissions<Config>;
55
+ refreshPermissions: RefreshPermissions<Config>;
56
+ };
57
+
58
+ type ComponentOrRootData = Omit<ComponentData<any>, "type">;
59
+ type FieldsSlice = {
60
+ fields: Fields | Partial<Fields>;
61
+ loading: boolean;
62
+ lastResolvedData: Partial<ComponentOrRootData>;
63
+ id: string | undefined;
64
+ };
65
+
66
+ type Status = "LOADING" | "MOUNTED" | "READY";
67
+ type ZoomConfig = {
68
+ autoZoom: number;
69
+ rootHeight: number;
70
+ zoom: number;
71
+ };
72
+ type ComponentState = Record<string, {
73
+ loadingCount: number;
74
+ }>;
75
+ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
76
+ instanceId: string;
77
+ state: G["UserAppState"];
78
+ dispatch: (action: PuckAction) => void;
79
+ config: UserConfig;
80
+ componentState: ComponentState;
81
+ setComponentState: (componentState: ComponentState) => void;
82
+ setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
83
+ unsetComponentLoading: (id: string) => void;
84
+ pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
85
+ resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
86
+ node: T;
87
+ didChange: boolean;
88
+ }>;
89
+ resolveAndCommitData: () => void;
90
+ plugins: Plugin[];
91
+ overrides: Partial<Overrides>;
92
+ viewports: Viewports;
93
+ zoomConfig: ZoomConfig;
94
+ setZoomConfig: (zoomConfig: ZoomConfig) => void;
95
+ status: Status;
96
+ setStatus: (status: Status) => void;
97
+ iframe: IframeConfig;
98
+ selectedItem?: G["UserData"]["content"][0] | null;
99
+ getCurrentData: () => G["UserData"]["content"][0] | G["UserData"]["root"];
100
+ setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
101
+ getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
102
+ onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
103
+ metadata: Metadata;
104
+ fields: FieldsSlice;
105
+ history: HistorySlice;
106
+ nodes: NodesSlice;
107
+ permissions: PermissionsSlice;
108
+ fieldTransforms: FieldTransforms;
109
+ currentRichText?: {
110
+ inlineComponentId?: string;
111
+ inline: boolean;
112
+ field: RichtextField;
113
+ editor: Editor;
114
+ id: string;
115
+ } | null;
116
+ };
117
+
118
+ export type { AppStore as A, GetPermissions as G, HistorySlice as H, RefreshPermissions as R };