@puckeditor/plugin-heading-analyzer 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/index.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +12 -1871
- package/dist/index.mjs +12 -1871
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -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 DefaultComponentProps = {
|
|
363
369
|
[key: string]: any;
|
|
364
370
|
};
|
|
@@ -378,7 +384,7 @@ type UserGenerics<UserConfig extends Config = Config, UserParams extends Extract
|
|
|
378
384
|
UserConfig: UserConfig;
|
|
379
385
|
UserParams: UserParams;
|
|
380
386
|
UserProps: UserParams["props"];
|
|
381
|
-
UserRootProps: UserParams["rootProps"]
|
|
387
|
+
UserRootProps: WithDefaultRootFieldProps<UserParams["rootProps"]>;
|
|
382
388
|
UserData: UserData;
|
|
383
389
|
UserAppState: UserAppState;
|
|
384
390
|
UserPublicAppState: UserPublicAppState;
|
|
@@ -462,7 +468,7 @@ type DefaultComponents = Record<string, any>;
|
|
|
462
468
|
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>;
|
|
463
469
|
type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends ConfigInternal<infer PropsOrParams, infer RootProps, infer CategoryName, infer UserField> ? {
|
|
464
470
|
props: PropsOrParams;
|
|
465
|
-
rootProps: RootProps
|
|
471
|
+
rootProps: WithDefaultRootFieldProps<RootProps>;
|
|
466
472
|
categoryNames: CategoryName;
|
|
467
473
|
field: UserField extends {
|
|
468
474
|
type: string;
|
|
@@ -545,6 +551,8 @@ type UiState = {
|
|
|
545
551
|
expanded?: boolean;
|
|
546
552
|
}>;
|
|
547
553
|
isDragging: boolean;
|
|
554
|
+
/** Outline items whose children are shown, keyed by item id */
|
|
555
|
+
itemExpanded?: Record<string, boolean>;
|
|
548
556
|
viewports: {
|
|
549
557
|
current: {
|
|
550
558
|
width: number | "100%";
|
package/dist/index.d.ts
CHANGED
|
@@ -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 DefaultComponentProps = {
|
|
363
369
|
[key: string]: any;
|
|
364
370
|
};
|
|
@@ -378,7 +384,7 @@ type UserGenerics<UserConfig extends Config = Config, UserParams extends Extract
|
|
|
378
384
|
UserConfig: UserConfig;
|
|
379
385
|
UserParams: UserParams;
|
|
380
386
|
UserProps: UserParams["props"];
|
|
381
|
-
UserRootProps: UserParams["rootProps"]
|
|
387
|
+
UserRootProps: WithDefaultRootFieldProps<UserParams["rootProps"]>;
|
|
382
388
|
UserData: UserData;
|
|
383
389
|
UserAppState: UserAppState;
|
|
384
390
|
UserPublicAppState: UserPublicAppState;
|
|
@@ -462,7 +468,7 @@ type DefaultComponents = Record<string, any>;
|
|
|
462
468
|
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>;
|
|
463
469
|
type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends ConfigInternal<infer PropsOrParams, infer RootProps, infer CategoryName, infer UserField> ? {
|
|
464
470
|
props: PropsOrParams;
|
|
465
|
-
rootProps: RootProps
|
|
471
|
+
rootProps: WithDefaultRootFieldProps<RootProps>;
|
|
466
472
|
categoryNames: CategoryName;
|
|
467
473
|
field: UserField extends {
|
|
468
474
|
type: string;
|
|
@@ -545,6 +551,8 @@ type UiState = {
|
|
|
545
551
|
expanded?: boolean;
|
|
546
552
|
}>;
|
|
547
553
|
isDragging: boolean;
|
|
554
|
+
/** Outline items whose children are shown, keyed by item id */
|
|
555
|
+
itemExpanded?: Record<string, boolean>;
|
|
548
556
|
viewports: {
|
|
549
557
|
current: {
|
|
550
558
|
width: number | "100%";
|