builder-settings-types 0.0.462 → 0.0.464
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/base/additional-settings/additonalSettings.d.ts +42 -0
- package/dist/base/additional-settings/repeatingSetting.d.ts +61 -0
- package/dist/base/drawable.d.ts +11 -0
- package/dist/base/pendingSettingsGroup.d.ts +0 -2
- package/dist/base/settings-group/settingsGroup.d.ts +30 -3
- package/dist/base/settings.d.ts +20 -2
- package/dist/builder-settings-types.cjs.js +218 -201
- package/dist/builder-settings-types.es.js +11727 -10618
- package/dist/components/actions/action.d.ts +8 -0
- package/dist/components/actions/actionFactory.d.ts +6 -0
- package/dist/components/actions/actionWrapper.d.ts +6 -0
- package/dist/components/actions/actionsCollection.d.ts +25 -0
- package/dist/components/button/button.d.ts +13 -0
- package/dist/components/draggable/draggable.d.ts +20 -0
- package/dist/components/popup/popup.d.ts +51 -0
- package/dist/components/select/select.d.ts +50 -0
- package/dist/groups/borderSettingsSet.d.ts +2 -0
- package/dist/groups/effectSettingsSet.d.ts +31 -0
- package/dist/groups/shadowSettingsSet.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/settings/axis-settings/axisSettings.d.ts +5 -16
- package/dist/settings/color-settings/colorSettings.d.ts +25 -1
- package/dist/settings/gradient-settings/GradientSetting.d.ts +0 -1
- package/dist/settings/gradient-settings/components/GlobalColorsDisplay.d.ts +23 -0
- package/dist/settings/gradient-settings/utils/types.d.ts +3 -0
- package/dist/settings/multi-settings/multiSettings.d.ts +8 -14
- package/dist/settings/number-settings/numberSettings.d.ts +1 -0
- package/dist/settings/select-api/select-api.d.ts +3 -0
- package/dist/settings/select-settings/selectSettings.d.ts +3 -23
- package/dist/types/index.d.ts +2 -11
- package/dist/utils/calculatePopupPosition.d.ts +4 -0
- package/package.json +1 -1
|
@@ -6,16 +6,40 @@ export interface ColorSettingProps extends StringSettingsProps {
|
|
|
6
6
|
export declare class ColorSetting extends StringSetting {
|
|
7
7
|
inputType: InputTypes;
|
|
8
8
|
detectChange?: (value: string | undefined) => void;
|
|
9
|
+
private static openInstance;
|
|
9
10
|
private element;
|
|
10
|
-
private
|
|
11
|
+
private previewEl;
|
|
11
12
|
private textInputEl;
|
|
13
|
+
private unlinkButton;
|
|
14
|
+
private popoverEl;
|
|
15
|
+
private backdropEl;
|
|
16
|
+
private isPopoverOpen;
|
|
17
|
+
private popoverPosition;
|
|
18
|
+
private linkedGlobalVariable;
|
|
19
|
+
private currentMode;
|
|
20
|
+
private globalLayoutMode;
|
|
21
|
+
private globalSearchQuery;
|
|
22
|
+
private boundHandleWindowBlur;
|
|
12
23
|
constructor(props: ColorSettingProps);
|
|
13
24
|
private static normalizeColorValue;
|
|
14
25
|
private static normalizeHexValue;
|
|
15
26
|
private static rgbToHexStatic;
|
|
16
27
|
setValue(newValue: string | undefined): void;
|
|
17
28
|
private hexToRgb;
|
|
29
|
+
private resolveGlobalVarColor;
|
|
30
|
+
private setLinkedGlobalVariableFrom;
|
|
31
|
+
private isBoundToGlobal;
|
|
32
|
+
private updateUnlinkButtonVisibility;
|
|
33
|
+
private breakGlobalBinding;
|
|
34
|
+
private updatePreview;
|
|
18
35
|
draw(): HTMLElement;
|
|
36
|
+
private createPopover;
|
|
37
|
+
private updatePopoverContent;
|
|
38
|
+
private openPopover;
|
|
39
|
+
private onBackgroundClick;
|
|
40
|
+
private handleWindowBlur;
|
|
41
|
+
private handlePopoverKeydown;
|
|
42
|
+
private closePopover;
|
|
19
43
|
getElement(): HTMLElement | null;
|
|
20
44
|
getNormalizedValue(): string;
|
|
21
45
|
isValidHex(): boolean;
|
|
@@ -52,7 +52,6 @@ export declare class GradientSetting extends Setting<GradientValue, SettingProps
|
|
|
52
52
|
private createTypeTabs;
|
|
53
53
|
private switchType;
|
|
54
54
|
private updatePopoverContent;
|
|
55
|
-
private renderGlobalColors;
|
|
56
55
|
private renderSolid;
|
|
57
56
|
private renderGradient;
|
|
58
57
|
private updateDegreeVisibility;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface GlobalColorsDisplayOptions {
|
|
2
|
+
globalVariables: Record<string, string>;
|
|
3
|
+
selectedVariable: string | null;
|
|
4
|
+
onSelect: (variableValue: string) => void;
|
|
5
|
+
resolveColor: (color: string) => string;
|
|
6
|
+
initialLayoutMode?: "list" | "grid";
|
|
7
|
+
initialSearchQuery?: string;
|
|
8
|
+
onLayoutModeChange?: (mode: "list" | "grid") => void;
|
|
9
|
+
onSearchChange?: (query: string) => void;
|
|
10
|
+
getSelectedVariable?: () => string | null;
|
|
11
|
+
}
|
|
12
|
+
export declare class GlobalColorsDisplay {
|
|
13
|
+
private element;
|
|
14
|
+
private listContainer;
|
|
15
|
+
private options;
|
|
16
|
+
private layoutMode;
|
|
17
|
+
private searchQuery;
|
|
18
|
+
constructor(options: GlobalColorsDisplayOptions);
|
|
19
|
+
private getSelectedVariable;
|
|
20
|
+
private build;
|
|
21
|
+
private renderList;
|
|
22
|
+
getElement(): HTMLElement;
|
|
23
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SettingAction } from '../../../components/actions/actionsCollection';
|
|
1
2
|
export interface GradientStop {
|
|
2
3
|
color: string;
|
|
3
4
|
position: number;
|
|
@@ -25,4 +26,6 @@ export interface GradientSettingProps {
|
|
|
25
26
|
includeGetJson?: boolean;
|
|
26
27
|
variant?: "default" | "global";
|
|
27
28
|
hideGlobalsTab?: boolean;
|
|
29
|
+
actions?: SettingAction[];
|
|
30
|
+
isAdditional?: boolean;
|
|
28
31
|
}
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
import { IChangable, IDrawable } from '../../base/drawable';
|
|
2
1
|
import { MultiConfig, MultiPresetDefaultKey } from './utils/enum';
|
|
2
|
+
import { Setting, SettingProps, InputTypes, Primitive } from '../../base/settings';
|
|
3
3
|
export type MultiSettingsValue<K extends string = string> = Record<K, number>;
|
|
4
|
-
export interface MultiSettingsProps<K extends string = MultiPresetDefaultKey> {
|
|
4
|
+
export interface MultiSettingsProps<K extends string = MultiPresetDefaultKey> extends Omit<SettingProps<MultiSettingsValue<K>>, 'default'> {
|
|
5
5
|
default?: Partial<MultiSettingsValue<K>> | number;
|
|
6
|
-
title?: string;
|
|
7
|
-
placeholder?: string;
|
|
8
6
|
collapsed?: boolean;
|
|
9
|
-
id?: string;
|
|
10
|
-
includeGetJson?: boolean;
|
|
11
7
|
config?: MultiConfig<K>;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private props;
|
|
9
|
+
type MultiSettingsPropsCompat<K extends string> = MultiSettingsProps<K> & {
|
|
10
|
+
default?: MultiSettingsValue<K>;
|
|
11
|
+
};
|
|
12
|
+
export declare class MultiSettings<K extends string = MultiPresetDefaultKey> extends Setting<MultiSettingsValue<K>, MultiSettingsPropsCompat<K>> {
|
|
13
|
+
inputType: MultiSettingsValue<K> extends Primitive ? InputTypes : Record<keyof MultiSettingsValue<K>, InputTypes>;
|
|
19
14
|
private config;
|
|
20
15
|
private isCollapsed;
|
|
21
16
|
private elementRef;
|
|
22
17
|
private mainInput;
|
|
23
18
|
private inputs;
|
|
24
|
-
private dataPropsPath;
|
|
25
19
|
private defaultValue;
|
|
26
20
|
constructor(props?: MultiSettingsProps<K>);
|
|
27
21
|
setOnChange(onChange: (value: MultiSettingsValue<K>) => void): MultiSettings<K>;
|
|
28
|
-
setDataPropsPath(path: string): void;
|
|
29
22
|
setComponentPath(_path: string): void;
|
|
30
23
|
setValue(newValue: Partial<MultiSettingsValue<K>>): void;
|
|
31
24
|
getValue(): MultiSettingsValue<K>;
|
|
@@ -39,3 +32,4 @@ export declare class MultiSettings<K extends string = MultiPresetDefaultKey> imp
|
|
|
39
32
|
private createInputWithIcon;
|
|
40
33
|
draw(): HTMLElement;
|
|
41
34
|
}
|
|
35
|
+
export {};
|
|
@@ -10,6 +10,7 @@ export interface NumberSettingsProps extends SettingProps<number> {
|
|
|
10
10
|
suffix?: NumberSuffix;
|
|
11
11
|
mobile?: number;
|
|
12
12
|
onBlur?: () => void;
|
|
13
|
+
debounceMs?: number;
|
|
13
14
|
}
|
|
14
15
|
export declare class NumberSetting extends Setting<number, NumberSettingsProps> {
|
|
15
16
|
inputType: InputTypes;
|
|
@@ -14,6 +14,9 @@ export interface SelectApiSettingProps<T = SettingsMap> extends SettingProps<T>
|
|
|
14
14
|
onChange?: (value: T) => void;
|
|
15
15
|
detectChange?: (value: T | undefined) => void;
|
|
16
16
|
getConfirmOptions?: (currentValue: T | undefined, nextValue: T) => ConfirmationOptions | undefined | null;
|
|
17
|
+
/** When true, if setValue() receives a value that doesn't match any available option,
|
|
18
|
+
* automatically fall back to the first option (or undefined if no options exist). */
|
|
19
|
+
fallbackToFirstOption?: boolean;
|
|
17
20
|
}
|
|
18
21
|
export declare class SelectApiSettings<T = SettingsMap> extends Setting<T, SelectApiSettingProps<T>> {
|
|
19
22
|
inputType: T extends Primitive ? InputTypes : Record<keyof T, InputTypes>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Setting, SettingProps, InputTypes, Primitive } from '../../base/settings';
|
|
2
|
+
import { SelectOption } from '../../components/select/select';
|
|
2
3
|
import { SettingsMap } from '../../types';
|
|
3
|
-
export
|
|
4
|
-
name: string;
|
|
5
|
-
value: string | object;
|
|
6
|
-
}
|
|
4
|
+
export type { SelectOption };
|
|
7
5
|
export interface SelectSettingProps<T = SettingsMap> extends SettingProps<T> {
|
|
8
6
|
options?: SelectOption[];
|
|
9
7
|
getOptions?: () => SelectOption[];
|
|
@@ -13,27 +11,9 @@ export interface SelectSettingProps<T = SettingsMap> extends SettingProps<T> {
|
|
|
13
11
|
}
|
|
14
12
|
export declare class SelectSetting<T = SettingsMap> extends Setting<T, SelectSettingProps<T>> {
|
|
15
13
|
inputType: T extends Primitive ? InputTypes : Record<keyof T, InputTypes>;
|
|
16
|
-
private
|
|
17
|
-
private isOpen;
|
|
18
|
-
private selectedOptionIndex;
|
|
19
|
-
private optionsListEl;
|
|
20
|
-
private svgContainer;
|
|
21
|
-
private buttonEl;
|
|
22
|
-
private isLoading;
|
|
23
|
-
private container;
|
|
24
|
-
private clickOutsideListener;
|
|
25
|
-
private resizeListener;
|
|
26
|
-
private scrollListener;
|
|
14
|
+
private selectComponent;
|
|
27
15
|
constructor(props?: SelectSettingProps<T>);
|
|
28
16
|
setValue(newValue: T): void;
|
|
29
|
-
private createOption;
|
|
30
17
|
draw(): HTMLElement;
|
|
31
|
-
private showDropdown;
|
|
32
|
-
private hideDropdown;
|
|
33
|
-
private checkDropdownPosition;
|
|
34
|
-
private selectOption;
|
|
35
|
-
private cleanupDropdownPosition;
|
|
36
|
-
private updateOptionsList;
|
|
37
|
-
private updateButtonText;
|
|
38
18
|
destroy(): void;
|
|
39
19
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { PendingSettingsGroup } from '../base/pendingSettingsGroup';
|
|
2
1
|
import { Setting, SettingProps } from '../base/settings';
|
|
3
2
|
import { RootSettingGroup, SettingGroup, TabSettingGroup } from '../base/settings-group/settingsGroup';
|
|
4
3
|
import { HeaderTypographySettingSet } from '../groups/headerTypographySettingsSet';
|
|
5
4
|
import { AlignValue } from '../settings/align-settings/alignSettings';
|
|
6
5
|
import { GradientSetting } from '../settings/gradient-settings';
|
|
7
6
|
import { MultiSettings } from '../settings/multi-settings';
|
|
7
|
+
export { isRepeatingSetting } from '../base/additional-settings/repeatingSetting';
|
|
8
|
+
export type { RepeatingSettingProps } from '../base/additional-settings/repeatingSetting';
|
|
8
9
|
export type SettingValue = string | number | boolean | null | undefined;
|
|
9
10
|
export type ComplexSettingValue = SettingValue | Record<string, SettingValue> | Array<SettingValue> | Date;
|
|
10
11
|
type StripUndefined<T> = [T] extends [undefined] ? undefined : Exclude<T, undefined>;
|
|
@@ -72,16 +73,6 @@ export type SettingsToProps<T> = T extends TabSettingGroup<infer S> ? {
|
|
|
72
73
|
} ? V : undefined;
|
|
73
74
|
} & {
|
|
74
75
|
activeTabId: string;
|
|
75
|
-
} : T extends PendingSettingsGroup<infer S> ? {
|
|
76
|
-
[K in keyof S]: S[K] extends GradientSetting ? GradientSettingValue<S[K]> : S[K] extends Setting<infer V, infer P> ? V : S[K] extends HeaderTypographySettingSet ? HeaderTypographyValue<S[K]> : S[K] extends SettingGroup<infer U> ? SettingsToProps<S[K]> : S[K] extends {
|
|
77
|
-
value: infer V;
|
|
78
|
-
} ? StripUndefined<V> : S[K] extends {
|
|
79
|
-
setValue(value: infer V | undefined): void;
|
|
80
|
-
} ? V : undefined;
|
|
81
|
-
} & {
|
|
82
|
-
$id: string;
|
|
83
|
-
isRootNode?: boolean;
|
|
84
|
-
isInitialized?: boolean;
|
|
85
76
|
} : T extends SettingGroup<infer S> ? {
|
|
86
77
|
[K in keyof S]: S[K] extends GradientSetting ? GradientSettingValue<S[K]> : S[K] extends Setting<infer V, infer P> ? V : S[K] extends HeaderTypographySettingSet ? HeaderTypographyValue<S[K]> : S[K] extends SettingGroup<infer U> ? SettingsToProps<S[K]> : S[K] extends {
|
|
87
78
|
value: infer V;
|
package/package.json
CHANGED