@measured/puck 0.21.0-canary.a62292fd → 0.21.0-canary.a7a65997
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/{Editor-O447AVCX.mjs → Editor-HG76DBFU.mjs} +9 -9
- package/dist/{actions-ONhOkrvf.d.mts → actions-tsxxcX1z.d.mts} +24 -9
- package/dist/{actions-ONhOkrvf.d.ts → actions-tsxxcX1z.d.ts} +24 -9
- package/dist/{chunk-QBGM4ELA.mjs → chunk-23IZFPL7.mjs} +1 -1
- package/dist/{chunk-T3WX7XJ6.mjs → chunk-45I5SDOI.mjs} +5 -3
- package/dist/{chunk-62AAYNXG.mjs → chunk-5ZZVX2Z3.mjs} +1 -1
- package/dist/{chunk-NLUHDYVR.mjs → chunk-B7REOAA7.mjs} +22 -3
- package/dist/{chunk-BSDEIOEK.mjs → chunk-BXQQARCR.mjs} +10 -8
- package/dist/{chunk-DAQLMM2T.mjs → chunk-D2SRL6YA.mjs} +89 -4
- package/dist/{chunk-Y656T6AQ.mjs → chunk-IQKX6A5D.mjs} +49 -39
- package/dist/{chunk-PLXSMBAA.mjs → chunk-LJEGWHDD.mjs} +1 -1
- package/dist/{chunk-2Q4PACDA.mjs → chunk-LR6HIXPR.mjs} +3 -3
- package/dist/{chunk-7GESFTRA.mjs → chunk-Q6MNES6D.mjs} +4315 -3693
- package/dist/{chunk-QAWJTCV5.mjs → chunk-U4VSQKO3.mjs} +1 -1
- package/dist/{full-BEMDJKDS.mjs → full-L7DWVNTZ.mjs} +8 -8
- package/dist/{index-BEoNHRI1.d.ts → index-Ca6V6NQD.d.ts} +3 -1
- package/dist/{index-DfxZ7tZF.d.mts → index-mQvUCH3C.d.mts} +3 -1
- package/dist/index.css +704 -314
- package/dist/index.d.mts +28 -9
- package/dist/index.d.ts +28 -9
- package/dist/index.js +2975 -2181
- package/dist/index.mjs +20 -17
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +22 -3
- package/dist/internal.mjs +2 -2
- package/dist/{loaded-N3FYGF2Y.mjs → loaded-2HLHDP2G.mjs} +5 -5
- package/dist/{loaded-OBY7OMS6.mjs → loaded-LZUXYAGW.mjs} +5 -5
- package/dist/{loaded-JU3A7Y4L.mjs → loaded-UHVTB6OD.mjs} +5 -5
- package/dist/no-external.css +842 -448
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +2972 -2175
- package/dist/no-external.mjs +19 -11
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +55 -28
- package/dist/rsc.mjs +3 -3
- package/dist/{walk-tree-DHbAZ4wF.d.ts → walk-tree-Bh85NMeo.d.ts} +1 -1
- package/dist/{walk-tree-CdriEzFJ.d.mts → walk-tree-CDA3K5S3.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
EditorInner,
|
|
6
6
|
LoadedRichTextMenu
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LR6HIXPR.mjs";
|
|
8
8
|
import "./chunk-CSSRLPHM.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-BXQQARCR.mjs";
|
|
10
|
+
import "./chunk-LJEGWHDD.mjs";
|
|
11
|
+
import "./chunk-5ZZVX2Z3.mjs";
|
|
12
|
+
import "./chunk-U4VSQKO3.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-D2SRL6YA.mjs";
|
|
17
|
+
import "./chunk-23IZFPL7.mjs";
|
|
18
|
+
import "./chunk-45I5SDOI.mjs";
|
|
19
19
|
import "./chunk-Y2EFNT5P.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-B7REOAA7.mjs";
|
|
21
21
|
import {
|
|
22
22
|
__spreadProps,
|
|
23
23
|
__spreadValues,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
|
|
1
|
+
import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
|
|
2
2
|
import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
|
|
3
3
|
import { BlockquoteOptions } from '@tiptap/extension-blockquote';
|
|
4
4
|
import { BoldOptions } from '@tiptap/extension-bold';
|
|
@@ -347,6 +347,7 @@ type DropZoneProps = {
|
|
|
347
347
|
className?: string;
|
|
348
348
|
collisionAxis?: DragAxis;
|
|
349
349
|
as?: ElementType;
|
|
350
|
+
ref?: Ref<any>;
|
|
350
351
|
};
|
|
351
352
|
|
|
352
353
|
type PuckContext = {
|
|
@@ -531,6 +532,7 @@ interface FieldMetadata extends Metadata {
|
|
|
531
532
|
type ItemWithId = {
|
|
532
533
|
_arrayId: string;
|
|
533
534
|
_originalIndex: number;
|
|
535
|
+
_currentIndex: number;
|
|
534
536
|
};
|
|
535
537
|
type ArrayState = {
|
|
536
538
|
items: ItemWithId[];
|
|
@@ -541,6 +543,7 @@ type UiState = {
|
|
|
541
543
|
rightSideBarVisible: boolean;
|
|
542
544
|
leftSideBarWidth?: number | null;
|
|
543
545
|
rightSideBarWidth?: number | null;
|
|
546
|
+
mobilePanelExpanded?: boolean;
|
|
544
547
|
itemSelector: ItemSelector | null;
|
|
545
548
|
arrayState: Record<string, ArrayState | undefined>;
|
|
546
549
|
previewMode: "interactive" | "edit";
|
|
@@ -553,7 +556,7 @@ type UiState = {
|
|
|
553
556
|
isDragging: boolean;
|
|
554
557
|
viewports: {
|
|
555
558
|
current: {
|
|
556
|
-
width: number;
|
|
559
|
+
width: number | "100%";
|
|
557
560
|
height: number | "auto";
|
|
558
561
|
};
|
|
559
562
|
controlsVisible: boolean;
|
|
@@ -563,6 +566,9 @@ type UiState = {
|
|
|
563
566
|
focus?: string | null;
|
|
564
567
|
metadata?: Record<string, any>;
|
|
565
568
|
};
|
|
569
|
+
plugin: {
|
|
570
|
+
current: string | null;
|
|
571
|
+
};
|
|
566
572
|
};
|
|
567
573
|
type AppState<UserData extends Data = Data> = {
|
|
568
574
|
data: UserData;
|
|
@@ -606,6 +612,15 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
|
|
|
606
612
|
type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
|
|
607
613
|
never
|
|
608
614
|
] ? False : True;
|
|
615
|
+
type RenderFunc<Props extends {
|
|
616
|
+
[key: string]: any;
|
|
617
|
+
} = {
|
|
618
|
+
children: ReactNode;
|
|
619
|
+
}> = (props: Props) => ReactElement;
|
|
620
|
+
type PluginInternal = Plugin & {
|
|
621
|
+
mobileOnly?: boolean;
|
|
622
|
+
desktopOnly?: boolean;
|
|
623
|
+
};
|
|
609
624
|
|
|
610
625
|
type MapFnParams<ThisField = Field> = {
|
|
611
626
|
value: any;
|
|
@@ -629,11 +644,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
|
|
|
629
644
|
[Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
|
|
630
645
|
}>;
|
|
631
646
|
|
|
632
|
-
type RenderFunc<Props extends {
|
|
633
|
-
[key: string]: any;
|
|
634
|
-
} = {
|
|
635
|
-
children: ReactNode;
|
|
636
|
-
}> = (props: Props) => ReactElement;
|
|
637
647
|
declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
|
|
638
648
|
type OverrideKey = (typeof overrideKeys)[number];
|
|
639
649
|
type OverridesGeneric<Shape extends {
|
|
@@ -705,7 +715,7 @@ type DragAxis = "dynamic" | "y" | "x";
|
|
|
705
715
|
|
|
706
716
|
type iconTypes = "Smartphone" | "Monitor" | "Tablet";
|
|
707
717
|
type Viewport = {
|
|
708
|
-
width: number;
|
|
718
|
+
width: number | "100%";
|
|
709
719
|
height?: number | "auto";
|
|
710
720
|
label?: string;
|
|
711
721
|
icon?: iconTypes | ReactNode;
|
|
@@ -725,8 +735,13 @@ type IframeConfig = {
|
|
|
725
735
|
};
|
|
726
736
|
type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
|
|
727
737
|
type Plugin<UserConfig extends Config = Config> = {
|
|
738
|
+
name?: string;
|
|
739
|
+
label?: string;
|
|
740
|
+
icon?: ReactNode;
|
|
741
|
+
render?: () => ReactElement;
|
|
728
742
|
overrides?: Partial<Overrides<UserConfig>>;
|
|
729
743
|
fieldTransforms?: FieldTransforms<UserConfig>;
|
|
744
|
+
mobilePanelHeight?: "toggle" | "min-content";
|
|
730
745
|
};
|
|
731
746
|
type History<D = any> = {
|
|
732
747
|
state: D;
|
|
@@ -819,4 +834,4 @@ type PuckAction = {
|
|
|
819
834
|
recordHistory?: boolean;
|
|
820
835
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
821
836
|
|
|
822
|
-
export { type
|
|
837
|
+
export { type ComponentConfigParams as $, type AppState as A, type FieldTransformFnParams as B, type Config as C, type Data as D, type FieldTransformFn as E, type Fields as F, overrideKeys as G, type History as H, type IframeConfig as I, type OverrideKey as J, type FieldRenderFunctions as K, type ItemWithId as L, type Metadata as M, type ArrayState as N, type OnAction as O, type PrivateAppState as P, type SlotComponent as Q, type RootData as R, type Slot as S, type PuckComponent as T, type UserGenerics as U, type Viewports as V, type WithId as W, type ComponentConfigExtensions as X, type RootConfig as Y, type ExtractConfigParams as Z, type ConfigParams as _, type PuckAction as a, type BaseData as a0, type RootDataWithoutProps as a1, type ComponentDataOptionalId as a2, type MappedItem as a3, type ComponentDataMap as a4, type PuckMetadata as a5, type ComponentMetadata as a6, type FieldMetadata as a7, type BaseField as a8, type TextField as a9, type NumberField as aa, type TextareaField as ab, type SelectField as ac, type RadioField as ad, type ArrayField as ae, type ObjectField as af, type Adaptor as ag, type ExternalFieldWithAdaptor as ah, type CacheOpts as ai, type ExternalField as aj, type CustomFieldRender as ak, type CustomField as al, type SlotField as am, type PuckContext as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField as at, type Content as b, type ComponentData as c, type DefaultComponents as d, type DefaultComponentProps as e, type DefaultRootFieldProps as f, type Permissions as g, type RootDataWithProps as h, type ResolveDataTrigger as i, type Plugin as j, type Overrides as k, type UiState as l, type ComponentConfig as m, type FieldTransforms as n, type RichtextField as o, type Field as p, type FieldProps as q, type DropZoneProps as r, type InitialHistory as s, type ItemSelector as t, type PluginInternal as u, type WithSlotProps as v, type RichText as w, type Direction as x, type DragAxis as y, type Viewport as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
|
|
1
|
+
import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
|
|
2
2
|
import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
|
|
3
3
|
import { BlockquoteOptions } from '@tiptap/extension-blockquote';
|
|
4
4
|
import { BoldOptions } from '@tiptap/extension-bold';
|
|
@@ -347,6 +347,7 @@ type DropZoneProps = {
|
|
|
347
347
|
className?: string;
|
|
348
348
|
collisionAxis?: DragAxis;
|
|
349
349
|
as?: ElementType;
|
|
350
|
+
ref?: Ref<any>;
|
|
350
351
|
};
|
|
351
352
|
|
|
352
353
|
type PuckContext = {
|
|
@@ -531,6 +532,7 @@ interface FieldMetadata extends Metadata {
|
|
|
531
532
|
type ItemWithId = {
|
|
532
533
|
_arrayId: string;
|
|
533
534
|
_originalIndex: number;
|
|
535
|
+
_currentIndex: number;
|
|
534
536
|
};
|
|
535
537
|
type ArrayState = {
|
|
536
538
|
items: ItemWithId[];
|
|
@@ -541,6 +543,7 @@ type UiState = {
|
|
|
541
543
|
rightSideBarVisible: boolean;
|
|
542
544
|
leftSideBarWidth?: number | null;
|
|
543
545
|
rightSideBarWidth?: number | null;
|
|
546
|
+
mobilePanelExpanded?: boolean;
|
|
544
547
|
itemSelector: ItemSelector | null;
|
|
545
548
|
arrayState: Record<string, ArrayState | undefined>;
|
|
546
549
|
previewMode: "interactive" | "edit";
|
|
@@ -553,7 +556,7 @@ type UiState = {
|
|
|
553
556
|
isDragging: boolean;
|
|
554
557
|
viewports: {
|
|
555
558
|
current: {
|
|
556
|
-
width: number;
|
|
559
|
+
width: number | "100%";
|
|
557
560
|
height: number | "auto";
|
|
558
561
|
};
|
|
559
562
|
controlsVisible: boolean;
|
|
@@ -563,6 +566,9 @@ type UiState = {
|
|
|
563
566
|
focus?: string | null;
|
|
564
567
|
metadata?: Record<string, any>;
|
|
565
568
|
};
|
|
569
|
+
plugin: {
|
|
570
|
+
current: string | null;
|
|
571
|
+
};
|
|
566
572
|
};
|
|
567
573
|
type AppState<UserData extends Data = Data> = {
|
|
568
574
|
data: UserData;
|
|
@@ -606,6 +612,15 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
|
|
|
606
612
|
type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
|
|
607
613
|
never
|
|
608
614
|
] ? False : True;
|
|
615
|
+
type RenderFunc<Props extends {
|
|
616
|
+
[key: string]: any;
|
|
617
|
+
} = {
|
|
618
|
+
children: ReactNode;
|
|
619
|
+
}> = (props: Props) => ReactElement;
|
|
620
|
+
type PluginInternal = Plugin & {
|
|
621
|
+
mobileOnly?: boolean;
|
|
622
|
+
desktopOnly?: boolean;
|
|
623
|
+
};
|
|
609
624
|
|
|
610
625
|
type MapFnParams<ThisField = Field> = {
|
|
611
626
|
value: any;
|
|
@@ -629,11 +644,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
|
|
|
629
644
|
[Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
|
|
630
645
|
}>;
|
|
631
646
|
|
|
632
|
-
type RenderFunc<Props extends {
|
|
633
|
-
[key: string]: any;
|
|
634
|
-
} = {
|
|
635
|
-
children: ReactNode;
|
|
636
|
-
}> = (props: Props) => ReactElement;
|
|
637
647
|
declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
|
|
638
648
|
type OverrideKey = (typeof overrideKeys)[number];
|
|
639
649
|
type OverridesGeneric<Shape extends {
|
|
@@ -705,7 +715,7 @@ type DragAxis = "dynamic" | "y" | "x";
|
|
|
705
715
|
|
|
706
716
|
type iconTypes = "Smartphone" | "Monitor" | "Tablet";
|
|
707
717
|
type Viewport = {
|
|
708
|
-
width: number;
|
|
718
|
+
width: number | "100%";
|
|
709
719
|
height?: number | "auto";
|
|
710
720
|
label?: string;
|
|
711
721
|
icon?: iconTypes | ReactNode;
|
|
@@ -725,8 +735,13 @@ type IframeConfig = {
|
|
|
725
735
|
};
|
|
726
736
|
type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
|
|
727
737
|
type Plugin<UserConfig extends Config = Config> = {
|
|
738
|
+
name?: string;
|
|
739
|
+
label?: string;
|
|
740
|
+
icon?: ReactNode;
|
|
741
|
+
render?: () => ReactElement;
|
|
728
742
|
overrides?: Partial<Overrides<UserConfig>>;
|
|
729
743
|
fieldTransforms?: FieldTransforms<UserConfig>;
|
|
744
|
+
mobilePanelHeight?: "toggle" | "min-content";
|
|
730
745
|
};
|
|
731
746
|
type History<D = any> = {
|
|
732
747
|
state: D;
|
|
@@ -819,4 +834,4 @@ type PuckAction = {
|
|
|
819
834
|
recordHistory?: boolean;
|
|
820
835
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
821
836
|
|
|
822
|
-
export { type
|
|
837
|
+
export { type ComponentConfigParams as $, type AppState as A, type FieldTransformFnParams as B, type Config as C, type Data as D, type FieldTransformFn as E, type Fields as F, overrideKeys as G, type History as H, type IframeConfig as I, type OverrideKey as J, type FieldRenderFunctions as K, type ItemWithId as L, type Metadata as M, type ArrayState as N, type OnAction as O, type PrivateAppState as P, type SlotComponent as Q, type RootData as R, type Slot as S, type PuckComponent as T, type UserGenerics as U, type Viewports as V, type WithId as W, type ComponentConfigExtensions as X, type RootConfig as Y, type ExtractConfigParams as Z, type ConfigParams as _, type PuckAction as a, type BaseData as a0, type RootDataWithoutProps as a1, type ComponentDataOptionalId as a2, type MappedItem as a3, type ComponentDataMap as a4, type PuckMetadata as a5, type ComponentMetadata as a6, type FieldMetadata as a7, type BaseField as a8, type TextField as a9, type NumberField as aa, type TextareaField as ab, type SelectField as ac, type RadioField as ad, type ArrayField as ae, type ObjectField as af, type Adaptor as ag, type ExternalFieldWithAdaptor as ah, type CacheOpts as ai, type ExternalField as aj, type CustomFieldRender as ak, type CustomField as al, type SlotField as am, type PuckContext as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField as at, type Content as b, type ComponentData as c, type DefaultComponents as d, type DefaultComponentProps as e, type DefaultRootFieldProps as f, type Permissions as g, type RootDataWithProps as h, type ResolveDataTrigger as i, type Plugin as j, type Overrides as k, type UiState as l, type ComponentConfig as m, type FieldTransforms as n, type RichtextField as o, type Field as p, type FieldProps as q, type DropZoneProps as r, type InitialHistory as s, type ItemSelector as t, type PluginInternal as u, type WithSlotProps as v, type RichText as w, type Direction as x, type DragAxis as y, type Viewport as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mapFields
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B7REOAA7.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__async,
|
|
6
6
|
__spreadProps,
|
|
@@ -13,7 +13,8 @@ init_react_import();
|
|
|
13
13
|
var defaultViewports = [
|
|
14
14
|
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
|
15
15
|
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
|
16
|
-
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
16
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" },
|
|
17
|
+
{ width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
|
|
17
18
|
];
|
|
18
19
|
|
|
19
20
|
// lib/resolve-component-data.ts
|
|
@@ -116,7 +117,8 @@ var defaultAppState = {
|
|
|
116
117
|
options: [],
|
|
117
118
|
controlsVisible: true
|
|
118
119
|
},
|
|
119
|
-
field: { focus: null }
|
|
120
|
+
field: { focus: null },
|
|
121
|
+
plugin: { current: null }
|
|
120
122
|
},
|
|
121
123
|
indexes: {
|
|
122
124
|
nodes: {},
|
|
@@ -143,12 +143,12 @@ var walkObject = ({
|
|
|
143
143
|
}
|
|
144
144
|
return flatten(newProps);
|
|
145
145
|
};
|
|
146
|
-
function mapFields(item, mappers, config, recurseSlots = false) {
|
|
146
|
+
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
|
|
147
147
|
var _a, _b, _c, _d, _e;
|
|
148
148
|
const itemType = "type" in item ? item.type : "root";
|
|
149
149
|
const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
|
|
150
150
|
const newProps = walkObject({
|
|
151
|
-
value: defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}),
|
|
151
|
+
value: shouldDefaultSlots ? defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}) : item.props,
|
|
152
152
|
fields: (_d = componentConfig == null ? void 0 : componentConfig.fields) != null ? _d : {},
|
|
153
153
|
mappers,
|
|
154
154
|
id: item.props ? (_e = item.props.id) != null ? _e : "root" : "root",
|
|
@@ -222,9 +222,28 @@ var stripSlots = (data, config) => {
|
|
|
222
222
|
|
|
223
223
|
// lib/data/flatten-node.ts
|
|
224
224
|
var { flatten: flatten2, unflatten } = flat;
|
|
225
|
+
function isEmptyArrayOrObject(val) {
|
|
226
|
+
if (Array.isArray(val)) {
|
|
227
|
+
return val.length === 0;
|
|
228
|
+
}
|
|
229
|
+
if (val != null && Object.prototype.toString.call(val) === "[object Object]") {
|
|
230
|
+
return Object.keys(val).length === 0;
|
|
231
|
+
}
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
function stripEmptyObjects(props) {
|
|
235
|
+
const result = {};
|
|
236
|
+
for (const key in props) {
|
|
237
|
+
if (!Object.prototype.hasOwnProperty.call(props, key)) continue;
|
|
238
|
+
const val = props[key];
|
|
239
|
+
if (isEmptyArrayOrObject(val)) continue;
|
|
240
|
+
result[key] = val;
|
|
241
|
+
}
|
|
242
|
+
return result;
|
|
243
|
+
}
|
|
225
244
|
var flattenNode = (node, config) => {
|
|
226
245
|
return __spreadProps(__spreadValues({}, node), {
|
|
227
|
-
props: flatten2(stripSlots(node, config).props)
|
|
246
|
+
props: stripEmptyObjects(flatten2(stripSlots(node, config).props))
|
|
228
247
|
});
|
|
229
248
|
};
|
|
230
249
|
var expandNode = (node) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAlignOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LJEGWHDD.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useHeadingOptions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5ZZVX2Z3.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useListOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-U4VSQKO3.mjs";
|
|
10
10
|
import {
|
|
11
11
|
AlignCenter,
|
|
12
12
|
AlignJustify,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
Strikethrough,
|
|
27
27
|
Underline,
|
|
28
28
|
useControlContext
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-D2SRL6YA.mjs";
|
|
30
30
|
import {
|
|
31
31
|
get_class_name_factory_default
|
|
32
32
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -142,7 +142,8 @@ var IconButton = ({
|
|
|
142
142
|
tabIndex,
|
|
143
143
|
newTab,
|
|
144
144
|
fullWidth,
|
|
145
|
-
title
|
|
145
|
+
title,
|
|
146
|
+
suppressHydrationWarning
|
|
146
147
|
}) => {
|
|
147
148
|
const [loading, setLoading] = useState(false);
|
|
148
149
|
const ElementType = href ? "a" : "button";
|
|
@@ -168,6 +169,7 @@ var IconButton = ({
|
|
|
168
169
|
rel: newTab ? "noreferrer" : void 0,
|
|
169
170
|
href,
|
|
170
171
|
title,
|
|
172
|
+
suppressHydrationWarning,
|
|
171
173
|
children: [
|
|
172
174
|
/* @__PURE__ */ jsx3("span", { className: getClassName3("title"), children: title }),
|
|
173
175
|
children,
|
|
@@ -347,7 +349,7 @@ function AlignSelectFallback() {
|
|
|
347
349
|
// components/RichTextMenu/controls/AlignSelect/index.tsx
|
|
348
350
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
349
351
|
var AlignSelectLoaded = lazy(
|
|
350
|
-
() => import("./loaded-
|
|
352
|
+
() => import("./loaded-UHVTB6OD.mjs").then((m) => ({
|
|
351
353
|
default: m.AlignSelectLoaded
|
|
352
354
|
}))
|
|
353
355
|
);
|
|
@@ -578,7 +580,7 @@ function HeadingSelectFallback() {
|
|
|
578
580
|
// components/RichTextMenu/controls/HeadingSelect/index.tsx
|
|
579
581
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
580
582
|
var HeadingSelectLoaded = lazy2(
|
|
581
|
-
() => import("./loaded-
|
|
583
|
+
() => import("./loaded-LZUXYAGW.mjs").then((m) => ({
|
|
582
584
|
default: m.HeadingSelectLoaded
|
|
583
585
|
}))
|
|
584
586
|
);
|
|
@@ -610,7 +612,7 @@ function ListSelectFallback() {
|
|
|
610
612
|
// components/RichTextMenu/controls/ListSelect/index.tsx
|
|
611
613
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
612
614
|
var ListSelectLoaded = lazy3(
|
|
613
|
-
() => import("./loaded-
|
|
615
|
+
() => import("./loaded-2HLHDP2G.mjs").then((m) => ({
|
|
614
616
|
default: m.ListSelectLoaded
|
|
615
617
|
}))
|
|
616
618
|
);
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
generateId,
|
|
4
4
|
getItem,
|
|
5
5
|
makeStatePublic
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-23IZFPL7.mjs";
|
|
7
7
|
import {
|
|
8
8
|
defaultAppState,
|
|
9
9
|
defaultViewports,
|
|
10
10
|
getChanged,
|
|
11
11
|
resolveComponentData
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-45I5SDOI.mjs";
|
|
13
13
|
import {
|
|
14
14
|
get_class_name_factory_default
|
|
15
15
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
16
16
|
import {
|
|
17
17
|
walkAppState
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B7REOAA7.mjs";
|
|
19
19
|
import {
|
|
20
20
|
__async,
|
|
21
21
|
__objRest,
|
|
@@ -225,6 +225,15 @@ var EllipsisVertical = createLucideIcon("EllipsisVertical", [
|
|
|
225
225
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
226
226
|
]);
|
|
227
227
|
|
|
228
|
+
// ../../node_modules/lucide-react/dist/esm/icons/expand.js
|
|
229
|
+
init_react_import();
|
|
230
|
+
var Expand = createLucideIcon("Expand", [
|
|
231
|
+
["path", { d: "m21 21-6-6m6 6v-4.8m0 4.8h-4.8", key: "1c15vz" }],
|
|
232
|
+
["path", { d: "M3 16.2V21m0 0h4.8M3 21l6-6", key: "1fsnz2" }],
|
|
233
|
+
["path", { d: "M21 7.8V3m0 0h-4.8M21 3l-6 6", key: "hawz9i" }],
|
|
234
|
+
["path", { d: "M3 7.8V3m0 0h4.8M3 3l6 6", key: "u9ee12" }]
|
|
235
|
+
]);
|
|
236
|
+
|
|
228
237
|
// ../../node_modules/lucide-react/dist/esm/icons/globe.js
|
|
229
238
|
init_react_import();
|
|
230
239
|
var Globe = createLucideIcon("Globe", [
|
|
@@ -233,6 +242,20 @@ var Globe = createLucideIcon("Globe", [
|
|
|
233
242
|
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
234
243
|
]);
|
|
235
244
|
|
|
245
|
+
// ../../node_modules/lucide-react/dist/esm/icons/hammer.js
|
|
246
|
+
init_react_import();
|
|
247
|
+
var Hammer = createLucideIcon("Hammer", [
|
|
248
|
+
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
249
|
+
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
250
|
+
[
|
|
251
|
+
"path",
|
|
252
|
+
{
|
|
253
|
+
d: "m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",
|
|
254
|
+
key: "b7pghm"
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
]);
|
|
258
|
+
|
|
236
259
|
// ../../node_modules/lucide-react/dist/esm/icons/hash.js
|
|
237
260
|
init_react_import();
|
|
238
261
|
var Hash = createLucideIcon("Hash", [
|
|
@@ -378,6 +401,24 @@ var Lock = createLucideIcon("Lock", [
|
|
|
378
401
|
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
|
|
379
402
|
]);
|
|
380
403
|
|
|
404
|
+
// ../../node_modules/lucide-react/dist/esm/icons/maximize-2.js
|
|
405
|
+
init_react_import();
|
|
406
|
+
var Maximize2 = createLucideIcon("Maximize2", [
|
|
407
|
+
["polyline", { points: "15 3 21 3 21 9", key: "mznyad" }],
|
|
408
|
+
["polyline", { points: "9 21 3 21 3 15", key: "1avn1i" }],
|
|
409
|
+
["line", { x1: "21", x2: "14", y1: "3", y2: "10", key: "ota7mn" }],
|
|
410
|
+
["line", { x1: "3", x2: "10", y1: "21", y2: "14", key: "1atl0r" }]
|
|
411
|
+
]);
|
|
412
|
+
|
|
413
|
+
// ../../node_modules/lucide-react/dist/esm/icons/minimize-2.js
|
|
414
|
+
init_react_import();
|
|
415
|
+
var Minimize2 = createLucideIcon("Minimize2", [
|
|
416
|
+
["polyline", { points: "4 14 10 14 10 20", key: "11kfnr" }],
|
|
417
|
+
["polyline", { points: "20 10 14 10 14 4", key: "rlmsce" }],
|
|
418
|
+
["line", { x1: "14", x2: "21", y1: "10", y2: "3", key: "o5lafz" }],
|
|
419
|
+
["line", { x1: "3", x2: "10", y1: "21", y2: "14", key: "1atl0r" }]
|
|
420
|
+
]);
|
|
421
|
+
|
|
381
422
|
// ../../node_modules/lucide-react/dist/esm/icons/minus.js
|
|
382
423
|
init_react_import();
|
|
383
424
|
var Minus = createLucideIcon("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
|
|
@@ -430,6 +471,15 @@ var Quote = createLucideIcon("Quote", [
|
|
|
430
471
|
]
|
|
431
472
|
]);
|
|
432
473
|
|
|
474
|
+
// ../../node_modules/lucide-react/dist/esm/icons/rectangle-ellipsis.js
|
|
475
|
+
init_react_import();
|
|
476
|
+
var RectangleEllipsis = createLucideIcon("RectangleEllipsis", [
|
|
477
|
+
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }],
|
|
478
|
+
["path", { d: "M12 12h.01", key: "1mp3jc" }],
|
|
479
|
+
["path", { d: "M17 12h.01", key: "1m0b6t" }],
|
|
480
|
+
["path", { d: "M7 12h.01", key: "eqddd0" }]
|
|
481
|
+
]);
|
|
482
|
+
|
|
433
483
|
// ../../node_modules/lucide-react/dist/esm/icons/redo-2.js
|
|
434
484
|
init_react_import();
|
|
435
485
|
var Redo2 = createLucideIcon("Redo2", [
|
|
@@ -488,6 +538,14 @@ var Tablet = createLucideIcon("Tablet", [
|
|
|
488
538
|
["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
|
|
489
539
|
]);
|
|
490
540
|
|
|
541
|
+
// ../../node_modules/lucide-react/dist/esm/icons/toy-brick.js
|
|
542
|
+
init_react_import();
|
|
543
|
+
var ToyBrick = createLucideIcon("ToyBrick", [
|
|
544
|
+
["rect", { width: "18", height: "12", x: "3", y: "8", rx: "1", key: "158fvp" }],
|
|
545
|
+
["path", { d: "M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3", key: "s0042v" }],
|
|
546
|
+
["path", { d: "M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3", key: "9wmeh2" }]
|
|
547
|
+
]);
|
|
548
|
+
|
|
491
549
|
// ../../node_modules/lucide-react/dist/esm/icons/trash.js
|
|
492
550
|
init_react_import();
|
|
493
551
|
var Trash = createLucideIcon("Trash", [
|
|
@@ -518,6 +576,13 @@ var Undo2 = createLucideIcon("Undo2", [
|
|
|
518
576
|
["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
|
|
519
577
|
]);
|
|
520
578
|
|
|
579
|
+
// ../../node_modules/lucide-react/dist/esm/icons/x.js
|
|
580
|
+
init_react_import();
|
|
581
|
+
var X = createLucideIcon("X", [
|
|
582
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
583
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
584
|
+
]);
|
|
585
|
+
|
|
521
586
|
// ../../node_modules/lucide-react/dist/esm/icons/zoom-in.js
|
|
522
587
|
init_react_import();
|
|
523
588
|
var ZoomIn = createLucideIcon("ZoomIn", [
|
|
@@ -1094,6 +1159,7 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1094
1159
|
subscribeWithSelector2((set, get) => {
|
|
1095
1160
|
var _a, _b;
|
|
1096
1161
|
return __spreadProps(__spreadValues({
|
|
1162
|
+
instanceId: generateId(),
|
|
1097
1163
|
state: defaultAppState,
|
|
1098
1164
|
config: { components: {} },
|
|
1099
1165
|
componentState: {},
|
|
@@ -1114,6 +1180,11 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1114
1180
|
history: createHistorySlice(set, get),
|
|
1115
1181
|
nodes: createNodesSlice(set, get),
|
|
1116
1182
|
permissions: createPermissionsSlice(set, get),
|
|
1183
|
+
getCurrentData: () => {
|
|
1184
|
+
var _a2;
|
|
1185
|
+
const s = get();
|
|
1186
|
+
return (_a2 = s.selectedItem) != null ? _a2 : s.state.data.root;
|
|
1187
|
+
},
|
|
1117
1188
|
getComponentConfig: (type) => {
|
|
1118
1189
|
var _a2;
|
|
1119
1190
|
const { config, selectedItem } = get();
|
|
@@ -1457,7 +1528,7 @@ var getZoomConfig = (uiViewport, frame, zoom) => {
|
|
|
1457
1528
|
const viewportHeight = uiViewport.height === "auto" ? frameHeight : uiViewport.height;
|
|
1458
1529
|
let rootHeight = 0;
|
|
1459
1530
|
let autoZoom = 1;
|
|
1460
|
-
if (uiViewport.width > frameWidth || viewportHeight > frameHeight) {
|
|
1531
|
+
if (typeof uiViewport.width === "number" && (uiViewport.width > frameWidth || viewportHeight > frameHeight)) {
|
|
1461
1532
|
const widthZoom = Math.min(frameWidth / uiViewport.width, 1);
|
|
1462
1533
|
const heightZoom = Math.min(frameHeight / viewportHeight, 1);
|
|
1463
1534
|
zoom = widthZoom;
|
|
@@ -1603,7 +1674,9 @@ export {
|
|
|
1603
1674
|
Copy,
|
|
1604
1675
|
CornerLeftUp,
|
|
1605
1676
|
EllipsisVertical,
|
|
1677
|
+
Expand,
|
|
1606
1678
|
Globe,
|
|
1679
|
+
Hammer,
|
|
1607
1680
|
Hash,
|
|
1608
1681
|
Heading1,
|
|
1609
1682
|
Heading2,
|
|
@@ -1620,12 +1693,15 @@ export {
|
|
|
1620
1693
|
List,
|
|
1621
1694
|
LockOpen,
|
|
1622
1695
|
Lock,
|
|
1696
|
+
Maximize2,
|
|
1697
|
+
Minimize2,
|
|
1623
1698
|
Minus,
|
|
1624
1699
|
Monitor,
|
|
1625
1700
|
PanelLeft,
|
|
1626
1701
|
PanelRight,
|
|
1627
1702
|
Plus,
|
|
1628
1703
|
Quote,
|
|
1704
|
+
RectangleEllipsis,
|
|
1629
1705
|
Redo2,
|
|
1630
1706
|
Search,
|
|
1631
1707
|
SlidersHorizontal,
|
|
@@ -1633,10 +1709,12 @@ export {
|
|
|
1633
1709
|
SquareCode,
|
|
1634
1710
|
Strikethrough,
|
|
1635
1711
|
Tablet,
|
|
1712
|
+
ToyBrick,
|
|
1636
1713
|
Trash,
|
|
1637
1714
|
Type,
|
|
1638
1715
|
Underline,
|
|
1639
1716
|
Undo2,
|
|
1717
|
+
X,
|
|
1640
1718
|
ZoomIn,
|
|
1641
1719
|
ZoomOut,
|
|
1642
1720
|
reorder,
|
|
@@ -1678,7 +1756,9 @@ lucide-react/dist/esm/icons/code.js:
|
|
|
1678
1756
|
lucide-react/dist/esm/icons/copy.js:
|
|
1679
1757
|
lucide-react/dist/esm/icons/corner-left-up.js:
|
|
1680
1758
|
lucide-react/dist/esm/icons/ellipsis-vertical.js:
|
|
1759
|
+
lucide-react/dist/esm/icons/expand.js:
|
|
1681
1760
|
lucide-react/dist/esm/icons/globe.js:
|
|
1761
|
+
lucide-react/dist/esm/icons/hammer.js:
|
|
1682
1762
|
lucide-react/dist/esm/icons/hash.js:
|
|
1683
1763
|
lucide-react/dist/esm/icons/heading-1.js:
|
|
1684
1764
|
lucide-react/dist/esm/icons/heading-2.js:
|
|
@@ -1693,12 +1773,15 @@ lucide-react/dist/esm/icons/link.js:
|
|
|
1693
1773
|
lucide-react/dist/esm/icons/list-ordered.js:
|
|
1694
1774
|
lucide-react/dist/esm/icons/lock-open.js:
|
|
1695
1775
|
lucide-react/dist/esm/icons/lock.js:
|
|
1776
|
+
lucide-react/dist/esm/icons/maximize-2.js:
|
|
1777
|
+
lucide-react/dist/esm/icons/minimize-2.js:
|
|
1696
1778
|
lucide-react/dist/esm/icons/minus.js:
|
|
1697
1779
|
lucide-react/dist/esm/icons/monitor.js:
|
|
1698
1780
|
lucide-react/dist/esm/icons/panel-left.js:
|
|
1699
1781
|
lucide-react/dist/esm/icons/panel-right.js:
|
|
1700
1782
|
lucide-react/dist/esm/icons/plus.js:
|
|
1701
1783
|
lucide-react/dist/esm/icons/quote.js:
|
|
1784
|
+
lucide-react/dist/esm/icons/rectangle-ellipsis.js:
|
|
1702
1785
|
lucide-react/dist/esm/icons/redo-2.js:
|
|
1703
1786
|
lucide-react/dist/esm/icons/search.js:
|
|
1704
1787
|
lucide-react/dist/esm/icons/sliders-horizontal.js:
|
|
@@ -1706,10 +1789,12 @@ lucide-react/dist/esm/icons/smartphone.js:
|
|
|
1706
1789
|
lucide-react/dist/esm/icons/square-code.js:
|
|
1707
1790
|
lucide-react/dist/esm/icons/strikethrough.js:
|
|
1708
1791
|
lucide-react/dist/esm/icons/tablet.js:
|
|
1792
|
+
lucide-react/dist/esm/icons/toy-brick.js:
|
|
1709
1793
|
lucide-react/dist/esm/icons/trash.js:
|
|
1710
1794
|
lucide-react/dist/esm/icons/type.js:
|
|
1711
1795
|
lucide-react/dist/esm/icons/underline.js:
|
|
1712
1796
|
lucide-react/dist/esm/icons/undo-2.js:
|
|
1797
|
+
lucide-react/dist/esm/icons/x.js:
|
|
1713
1798
|
lucide-react/dist/esm/icons/zoom-in.js:
|
|
1714
1799
|
lucide-react/dist/esm/icons/zoom-out.js:
|
|
1715
1800
|
lucide-react/dist/esm/lucide-react.js:
|