@measured/puck 0.21.0-canary.ece26d91 → 0.21.0-canary.ed351ce5
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-CYTATURR.mjs} +7 -7
- 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-T3WX7XJ6.mjs → chunk-72SA22GI.mjs} +4 -2
- package/dist/{chunk-2Q4PACDA.mjs → chunk-M4QBB3JM.mjs} +3 -3
- package/dist/{chunk-62AAYNXG.mjs → chunk-MLTVJA2A.mjs} +1 -1
- package/dist/{chunk-Y656T6AQ.mjs → chunk-MVJKIFF6.mjs} +1 -1
- package/dist/{chunk-QAWJTCV5.mjs → chunk-NOJQSXRU.mjs} +1 -1
- package/dist/{chunk-QBJ2LDJB.mjs → chunk-RVZLI2KP.mjs} +5109 -4487
- package/dist/{chunk-PLXSMBAA.mjs → chunk-UNQOU2OI.mjs} +1 -1
- package/dist/{chunk-DAQLMM2T.mjs → chunk-UUOBSXZR.mjs} +87 -2
- package/dist/{chunk-BSDEIOEK.mjs → chunk-V7333LON.mjs} +10 -8
- package/dist/{full-BEMDJKDS.mjs → full-GZ4L3XCF.mjs} +6 -6
- 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 +696 -306
- package/dist/index.d.mts +28 -9
- package/dist/index.d.ts +28 -9
- package/dist/index.js +2910 -2143
- package/dist/index.mjs +18 -15
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/{loaded-N3FYGF2Y.mjs → loaded-2MNXXPJP.mjs} +3 -3
- package/dist/{loaded-JU3A7Y4L.mjs → loaded-6QT4HD2O.mjs} +3 -3
- package/dist/{loaded-OBY7OMS6.mjs → loaded-ZVPBQVNE.mjs} +3 -3
- package/dist/no-external.css +841 -447
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +2912 -2142
- package/dist/no-external.mjs +17 -9
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +4 -2
- package/dist/rsc.mjs +2 -2
- 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 +3 -3
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
EditorInner,
|
|
6
6
|
LoadedRichTextMenu
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-M4QBB3JM.mjs";
|
|
8
8
|
import "./chunk-CSSRLPHM.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-V7333LON.mjs";
|
|
10
|
+
import "./chunk-UNQOU2OI.mjs";
|
|
11
|
+
import "./chunk-MLTVJA2A.mjs";
|
|
12
|
+
import "./chunk-NOJQSXRU.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UUOBSXZR.mjs";
|
|
17
17
|
import "./chunk-QBGM4ELA.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-72SA22GI.mjs";
|
|
19
19
|
import "./chunk-Y2EFNT5P.mjs";
|
|
20
20
|
import "./chunk-NLUHDYVR.mjs";
|
|
21
21
|
import {
|
|
@@ -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 };
|
|
@@ -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: {},
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-CSSRLPHM.mjs";
|
|
4
4
|
import {
|
|
5
5
|
LoadedRichTextMenuInner
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-V7333LON.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useAppStore,
|
|
9
9
|
useAppStoreApi
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UUOBSXZR.mjs";
|
|
11
11
|
import {
|
|
12
12
|
get_class_name_factory_default
|
|
13
13
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -97,7 +97,7 @@ init_react_import();
|
|
|
97
97
|
import { lazy, Suspense } from "react";
|
|
98
98
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
99
99
|
var LoadedRichTextMenuFull = lazy(
|
|
100
|
-
() => import("./full-
|
|
100
|
+
() => import("./full-GZ4L3XCF.mjs").then((m) => ({
|
|
101
101
|
default: m.LoadedRichTextMenuFull
|
|
102
102
|
}))
|
|
103
103
|
);
|