@puckeditor/core 0.23.0-canary.fb9392de → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Editor-V2RQPQAL.mjs → Editor-44C53YAG.mjs} +9 -9
- package/dist/{Editor-ZZW3KF2T.css → Editor-T7TKW6NT.css} +7 -7
- package/dist/{actions-Csn3gOP8.d.mts → actions-DA1J5F56.d.mts} +24 -3
- package/dist/{actions-Csn3gOP8.d.ts → actions-DA1J5F56.d.ts} +24 -3
- package/dist/{chunk-X4NMPUXH.mjs → chunk-4P4VZS4P.mjs} +1 -1
- package/dist/{chunk-D6RLJXOY.mjs → chunk-55V3NZVF.mjs} +3297 -1310
- package/dist/{chunk-G3YMTKUD.mjs → chunk-67Y7M4OJ.mjs} +1 -1
- package/dist/{chunk-OI2LQGRV.mjs → chunk-GNR2HNTB.mjs} +7 -7
- package/dist/{chunk-74HKFKJU.mjs → chunk-H65MT2JK.mjs} +8 -5
- package/dist/{chunk-2KHLVDRT.mjs → chunk-K2LNXU54.mjs} +32 -9
- package/dist/{chunk-EQADD6J2.mjs → chunk-NJTGWYYH.mjs} +1 -1
- package/dist/{chunk-WABMBXFK.mjs → chunk-WF6I3XOL.mjs} +3 -3
- package/dist/{chunk-FKYOVZNF.mjs → chunk-YQWFSBOU.mjs} +17 -20
- package/dist/{chunk-HRNJ42TO.mjs → chunk-Z2MS6UIF.mjs} +42 -19
- package/dist/{chunk-GR7NLT4T.mjs → chunk-ZRAERXB4.mjs} +2 -1
- package/dist/{full-GSJGH3OO.mjs → full-7ZJV44EE.mjs} +8 -8
- package/dist/{full-S3QQ2IBQ.css → full-AAZK6KLI.css} +7 -7
- package/dist/{index-t7c1w81O.d.ts → index-DIZKfHDN.d.ts} +8 -3
- package/dist/{index-De5Tn61v.d.mts → index-n9eR_SWx.d.mts} +8 -3
- package/dist/index.css +343 -129
- package/dist/index.d.mts +11 -9
- package/dist/index.d.ts +11 -9
- package/dist/index.js +3443 -1366
- package/dist/index.mjs +11 -11
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +48 -23
- package/dist/internal.mjs +2 -2
- package/dist/{loaded-QAIOZVXW.mjs → loaded-36WRJPBT.mjs} +5 -5
- package/dist/{loaded-FVWRAJR3.css → loaded-CA3Q7UHH.css} +7 -7
- package/dist/{loaded-7EVGM4NA.mjs → loaded-JKA25A3T.mjs} +5 -5
- package/dist/{loaded-A7IXFU7M.mjs → loaded-SMPR6KZF.mjs} +5 -5
- package/dist/no-external.css +343 -129
- package/dist/no-external.d.mts +3 -3
- package/dist/no-external.d.ts +3 -3
- package/dist/no-external.js +3443 -1366
- package/dist/no-external.mjs +11 -11
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +24 -23
- package/dist/rsc.mjs +3 -3
- package/dist/{walk-tree-BrW9VQ_t.d.mts → walk-tree-DHP1pWEM.d.mts} +1 -1
- package/dist/{walk-tree-CWrsBHHe.d.ts → walk-tree-DbY5zG2K.d.ts} +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-WF6I3XOL.mjs";
|
|
8
8
|
import "./chunk-H635BA2V.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-GNR2HNTB.mjs";
|
|
10
|
+
import "./chunk-67Y7M4OJ.mjs";
|
|
11
|
+
import "./chunk-4P4VZS4P.mjs";
|
|
12
|
+
import "./chunk-NJTGWYYH.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-K2LNXU54.mjs";
|
|
17
|
+
import "./chunk-Z2MS6UIF.mjs";
|
|
18
|
+
import "./chunk-ZRAERXB4.mjs";
|
|
19
19
|
import "./chunk-Y2EFNT5P.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-H65MT2JK.mjs";
|
|
21
21
|
import {
|
|
22
22
|
__spreadProps,
|
|
23
23
|
__spreadValues,
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
|
|
44
|
-
.
|
|
44
|
+
._IconButton_1pxxt_1 {
|
|
45
45
|
align-items: center;
|
|
46
46
|
background: var(--puck-iconbutton-color-bg, transparent);
|
|
47
47
|
border: none;
|
|
@@ -53,26 +53,26 @@
|
|
|
53
53
|
padding: var(--puck-iconbutton-space, var(--puck-space-1));
|
|
54
54
|
transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);
|
|
55
55
|
}
|
|
56
|
-
._IconButton--
|
|
56
|
+
._IconButton--active_1pxxt_15 {
|
|
57
57
|
color: var( --puck-iconbutton-color-icon-active, var(--puck-color-interactive) );
|
|
58
58
|
}
|
|
59
|
-
.
|
|
59
|
+
._IconButton_1pxxt_1:focus-visible {
|
|
60
60
|
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
61
61
|
outline-offset: calc(var(--puck-border-width-focus) * -1);
|
|
62
62
|
}
|
|
63
63
|
@media (hover: hover) and (pointer: fine) {
|
|
64
|
-
.
|
|
65
|
-
background: var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) );
|
|
64
|
+
._IconButton_1pxxt_1:hover:not(._IconButton--disabled_1pxxt_28) {
|
|
65
|
+
background: var( --_puck-iconbutton-color-bg-hover, var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) ) );
|
|
66
66
|
color: var( --puck-iconbutton-color-icon-hover, var(--puck-color-interactive) );
|
|
67
67
|
cursor: pointer;
|
|
68
68
|
transition: none;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
.
|
|
71
|
+
._IconButton_1pxxt_1:active {
|
|
72
72
|
background: var( --puck-iconbutton-color-bg-active, var(--puck-color-interactive-soft) );
|
|
73
73
|
transition: none;
|
|
74
74
|
}
|
|
75
|
-
._IconButton--
|
|
75
|
+
._IconButton--disabled_1pxxt_28 {
|
|
76
76
|
color: var( --puck-iconbutton-color-icon-disabled, var(--puck-color-text-subtle) );
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -359,6 +359,12 @@ type PuckContext = {
|
|
|
359
359
|
type DefaultRootFieldProps = {
|
|
360
360
|
title?: string;
|
|
361
361
|
};
|
|
362
|
+
/**
|
|
363
|
+
* Merge the default root field props into user-provided root props, letting
|
|
364
|
+
* the user's props take precedence. Using a plain intersection would turn an
|
|
365
|
+
* overridden `title` (e.g. `number`) into `never` (`number & string`).
|
|
366
|
+
*/
|
|
367
|
+
type WithDefaultRootFieldProps<RootProps> = RootProps & Omit<DefaultRootFieldProps, keyof RootProps>;
|
|
362
368
|
type DefaultRootRenderProps<Props extends DefaultComponentProps = DefaultRootFieldProps> = WithPuckProps<WithChildren<Props>>;
|
|
363
369
|
type DefaultRootProps = DefaultRootRenderProps;
|
|
364
370
|
type DefaultComponentProps = {
|
|
@@ -380,7 +386,7 @@ type UserGenerics<UserConfig extends Config = Config, UserParams extends Extract
|
|
|
380
386
|
UserConfig: UserConfig;
|
|
381
387
|
UserParams: UserParams;
|
|
382
388
|
UserProps: UserParams["props"];
|
|
383
|
-
UserRootProps: UserParams["rootProps"]
|
|
389
|
+
UserRootProps: WithDefaultRootFieldProps<UserParams["rootProps"]>;
|
|
384
390
|
UserData: UserData;
|
|
385
391
|
UserAppState: UserAppState;
|
|
386
392
|
UserPublicAppState: UserPublicAppState;
|
|
@@ -468,7 +474,7 @@ type DefaultComponents = Record<string, any>;
|
|
|
468
474
|
type Config<PropsOrParams extends LeftOrExactRight<PropsOrParams, DefaultComponents, ConfigParams> = DefaultComponents | ConfigParams, RootProps extends DefaultComponentProps = any, CategoryName extends string = string> = PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, never> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number]> : PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, infer ParamFields> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number], ParamFields[keyof ParamFields] & BaseField> : PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, any> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number], {}> : ConfigInternal<PropsOrParams, RootProps, CategoryName>;
|
|
469
475
|
type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends ConfigInternal<infer PropsOrParams, infer RootProps, infer CategoryName, infer UserField> ? {
|
|
470
476
|
props: PropsOrParams;
|
|
471
|
-
rootProps: RootProps
|
|
477
|
+
rootProps: WithDefaultRootFieldProps<RootProps>;
|
|
472
478
|
categoryNames: CategoryName;
|
|
473
479
|
field: UserField extends {
|
|
474
480
|
type: string;
|
|
@@ -556,6 +562,8 @@ type UiState = {
|
|
|
556
562
|
expanded?: boolean;
|
|
557
563
|
}>;
|
|
558
564
|
isDragging: boolean;
|
|
565
|
+
/** Outline items whose children are shown, keyed by item id */
|
|
566
|
+
itemExpanded?: Record<string, boolean>;
|
|
559
567
|
viewports: {
|
|
560
568
|
current: {
|
|
561
569
|
width: number | "100%";
|
|
@@ -736,6 +744,19 @@ type IframeConfig = {
|
|
|
736
744
|
waitForStyles?: boolean;
|
|
737
745
|
syncHostStyles?: boolean;
|
|
738
746
|
};
|
|
747
|
+
type DndBehavior = "auto" | "fluid" | "static";
|
|
748
|
+
type DndConfig = {
|
|
749
|
+
disableAutoScroll?: boolean;
|
|
750
|
+
disableOutlineDrag?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* - `auto` (default): fluid drags within a slot, switching to a static
|
|
753
|
+
* line placeholder when dragging between slots or inserting a new item
|
|
754
|
+
* - `fluid`: always animate sibling items during a drag
|
|
755
|
+
* - `static`: always show a line placeholder during a drag, only
|
|
756
|
+
* animating sibling items on drop
|
|
757
|
+
*/
|
|
758
|
+
behavior?: DndBehavior;
|
|
759
|
+
};
|
|
739
760
|
type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
|
|
740
761
|
type Plugin<UserConfig extends Config = Config> = {
|
|
741
762
|
name?: string;
|
|
@@ -837,4 +858,4 @@ type PuckAction = {
|
|
|
837
858
|
recordHistory?: boolean;
|
|
838
859
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
839
860
|
|
|
840
|
-
export { type
|
|
861
|
+
export { type OverrideKey as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type DropZoneProps as E, type ExternalField as F, type ExternalFieldWithAdaptor as G, type ExtractConfigParams as H, type ExtractField as I, type Field as J, type FieldMetadata as K, type FieldProps as L, type FieldRenderFunctions as M, type FieldTransformFn as N, type FieldTransformFnParams as O, type FieldTransforms as P, type Fields as Q, type History as R, type IframeConfig as S, type InitialHistory as T, type ItemSelector as U, type ItemWithId as V, type MappedItem as W, type Metadata as X, type NumberField as Y, type ObjectField as Z, type OnAction as _, type AppState as a, type Overrides as a0, type Permissions as a1, type Plugin as a2, type PluginInternal as a3, type PrivateAppState as a4, type PuckAction as a5, type PuckComponent as a6, type PuckContext as a7, type PuckMetadata as a8, type RadioField as a9, type ResolveDataTrigger as aa, type RichText as ab, type RichtextField as ac, type RootConfig as ad, type RootData as ae, type RootDataWithProps as af, type RootDataWithoutProps as ag, type SelectField as ah, type Slot as ai, type SlotComponent as aj, type SlotField as ak, type TextField as al, type TextareaField as am, type UiState as an, type UserGenerics as ao, type Viewport as ap, type Viewports as aq, type WithChildren as ar, type WithDefaultRootFieldProps as as, type WithId as at, type WithPuckProps as au, type WithSlotProps as av, overrideKeys as aw, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DndBehavior as x, type DndConfig as y, type DragAxis as z };
|
|
@@ -359,6 +359,12 @@ type PuckContext = {
|
|
|
359
359
|
type DefaultRootFieldProps = {
|
|
360
360
|
title?: string;
|
|
361
361
|
};
|
|
362
|
+
/**
|
|
363
|
+
* Merge the default root field props into user-provided root props, letting
|
|
364
|
+
* the user's props take precedence. Using a plain intersection would turn an
|
|
365
|
+
* overridden `title` (e.g. `number`) into `never` (`number & string`).
|
|
366
|
+
*/
|
|
367
|
+
type WithDefaultRootFieldProps<RootProps> = RootProps & Omit<DefaultRootFieldProps, keyof RootProps>;
|
|
362
368
|
type DefaultRootRenderProps<Props extends DefaultComponentProps = DefaultRootFieldProps> = WithPuckProps<WithChildren<Props>>;
|
|
363
369
|
type DefaultRootProps = DefaultRootRenderProps;
|
|
364
370
|
type DefaultComponentProps = {
|
|
@@ -380,7 +386,7 @@ type UserGenerics<UserConfig extends Config = Config, UserParams extends Extract
|
|
|
380
386
|
UserConfig: UserConfig;
|
|
381
387
|
UserParams: UserParams;
|
|
382
388
|
UserProps: UserParams["props"];
|
|
383
|
-
UserRootProps: UserParams["rootProps"]
|
|
389
|
+
UserRootProps: WithDefaultRootFieldProps<UserParams["rootProps"]>;
|
|
384
390
|
UserData: UserData;
|
|
385
391
|
UserAppState: UserAppState;
|
|
386
392
|
UserPublicAppState: UserPublicAppState;
|
|
@@ -468,7 +474,7 @@ type DefaultComponents = Record<string, any>;
|
|
|
468
474
|
type Config<PropsOrParams extends LeftOrExactRight<PropsOrParams, DefaultComponents, ConfigParams> = DefaultComponents | ConfigParams, RootProps extends DefaultComponentProps = any, CategoryName extends string = string> = PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, never> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number]> : PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, infer ParamFields> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number], ParamFields[keyof ParamFields] & BaseField> : PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, any> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number], {}> : ConfigInternal<PropsOrParams, RootProps, CategoryName>;
|
|
469
475
|
type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends ConfigInternal<infer PropsOrParams, infer RootProps, infer CategoryName, infer UserField> ? {
|
|
470
476
|
props: PropsOrParams;
|
|
471
|
-
rootProps: RootProps
|
|
477
|
+
rootProps: WithDefaultRootFieldProps<RootProps>;
|
|
472
478
|
categoryNames: CategoryName;
|
|
473
479
|
field: UserField extends {
|
|
474
480
|
type: string;
|
|
@@ -556,6 +562,8 @@ type UiState = {
|
|
|
556
562
|
expanded?: boolean;
|
|
557
563
|
}>;
|
|
558
564
|
isDragging: boolean;
|
|
565
|
+
/** Outline items whose children are shown, keyed by item id */
|
|
566
|
+
itemExpanded?: Record<string, boolean>;
|
|
559
567
|
viewports: {
|
|
560
568
|
current: {
|
|
561
569
|
width: number | "100%";
|
|
@@ -736,6 +744,19 @@ type IframeConfig = {
|
|
|
736
744
|
waitForStyles?: boolean;
|
|
737
745
|
syncHostStyles?: boolean;
|
|
738
746
|
};
|
|
747
|
+
type DndBehavior = "auto" | "fluid" | "static";
|
|
748
|
+
type DndConfig = {
|
|
749
|
+
disableAutoScroll?: boolean;
|
|
750
|
+
disableOutlineDrag?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* - `auto` (default): fluid drags within a slot, switching to a static
|
|
753
|
+
* line placeholder when dragging between slots or inserting a new item
|
|
754
|
+
* - `fluid`: always animate sibling items during a drag
|
|
755
|
+
* - `static`: always show a line placeholder during a drag, only
|
|
756
|
+
* animating sibling items on drop
|
|
757
|
+
*/
|
|
758
|
+
behavior?: DndBehavior;
|
|
759
|
+
};
|
|
739
760
|
type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
|
|
740
761
|
type Plugin<UserConfig extends Config = Config> = {
|
|
741
762
|
name?: string;
|
|
@@ -837,4 +858,4 @@ type PuckAction = {
|
|
|
837
858
|
recordHistory?: boolean;
|
|
838
859
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
839
860
|
|
|
840
|
-
export { type
|
|
861
|
+
export { type OverrideKey as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type DropZoneProps as E, type ExternalField as F, type ExternalFieldWithAdaptor as G, type ExtractConfigParams as H, type ExtractField as I, type Field as J, type FieldMetadata as K, type FieldProps as L, type FieldRenderFunctions as M, type FieldTransformFn as N, type FieldTransformFnParams as O, type FieldTransforms as P, type Fields as Q, type History as R, type IframeConfig as S, type InitialHistory as T, type ItemSelector as U, type ItemWithId as V, type MappedItem as W, type Metadata as X, type NumberField as Y, type ObjectField as Z, type OnAction as _, type AppState as a, type Overrides as a0, type Permissions as a1, type Plugin as a2, type PluginInternal as a3, type PrivateAppState as a4, type PuckAction as a5, type PuckComponent as a6, type PuckContext as a7, type PuckMetadata as a8, type RadioField as a9, type ResolveDataTrigger as aa, type RichText as ab, type RichtextField as ac, type RootConfig as ad, type RootData as ae, type RootDataWithProps as af, type RootDataWithoutProps as ag, type SelectField as ah, type Slot as ai, type SlotComponent as aj, type SlotField as ak, type TextField as al, type TextareaField as am, type UiState as an, type UserGenerics as ao, type Viewport as ap, type Viewports as aq, type WithChildren as ar, type WithDefaultRootFieldProps as as, type WithId as at, type WithPuckProps as au, type WithSlotProps as av, overrideKeys as aw, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DndBehavior as x, type DndConfig as y, type DragAxis as z };
|