builder-settings-types 0.0.461 → 0.0.463

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.
Files changed (33) hide show
  1. package/dist/base/additional-settings/additonalSettings.d.ts +32 -0
  2. package/dist/base/drawable.d.ts +11 -0
  3. package/dist/base/pendingSettingsGroup.d.ts +0 -2
  4. package/dist/base/settings-group/settingsGroup.d.ts +30 -3
  5. package/dist/base/settings.d.ts +20 -2
  6. package/dist/builder-settings-types.cjs.js +201 -184
  7. package/dist/builder-settings-types.es.js +10480 -9614
  8. package/dist/components/actions/action.d.ts +8 -0
  9. package/dist/components/actions/actionFactory.d.ts +6 -0
  10. package/dist/components/actions/actionWrapper.d.ts +6 -0
  11. package/dist/components/actions/actionsCollection.d.ts +25 -0
  12. package/dist/components/button/button.d.ts +13 -0
  13. package/dist/components/draggable/draggable.d.ts +20 -0
  14. package/dist/components/popup/popup.d.ts +51 -0
  15. package/dist/components/select/select.d.ts +53 -0
  16. package/dist/groups/borderSettingsSet.d.ts +2 -0
  17. package/dist/groups/effectSettingsSet.d.ts +29 -0
  18. package/dist/groups/shadowSettingsSet.d.ts +1 -0
  19. package/dist/index.css +1 -1
  20. package/dist/index.d.ts +5 -0
  21. package/dist/settings/axis-settings/axisSettings.d.ts +5 -16
  22. package/dist/settings/color-settings/colorSettings.d.ts +25 -1
  23. package/dist/settings/gradient-settings/GradientSetting.d.ts +0 -1
  24. package/dist/settings/gradient-settings/components/GlobalColorsDisplay.d.ts +23 -0
  25. package/dist/settings/gradient-settings/utils/types.d.ts +3 -0
  26. package/dist/settings/multi-settings/multiSettings.d.ts +8 -14
  27. package/dist/settings/number-settings/numberSettings.d.ts +2 -0
  28. package/dist/settings/select-api/select-api.d.ts +3 -0
  29. package/dist/settings/select-settings/selectSettings.d.ts +3 -23
  30. package/dist/types/index.d.ts +0 -11
  31. package/dist/utils/calculatePopupPosition.d.ts +4 -0
  32. package/dist/utils/debounce.d.ts +23 -0
  33. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { IDrawable } from '../../base/drawable';
2
+ export type ActionType = "remove" | "show-hide" | "expand-collapse";
3
+ export declare abstract class Action<T = any> implements IDrawable {
4
+ abstract readonly type: ActionType;
5
+ onChange?: (value: T) => void;
6
+ abstract draw(): HTMLElement;
7
+ setOnChange(onChange: (value: T) => void): void;
8
+ }
@@ -0,0 +1,6 @@
1
+ import { Action, ActionType } from './action';
2
+ export type ActionInitContext = {
3
+ onShowHide?: (hidden: boolean) => void;
4
+ onExpandCollapse?: (collapsed: boolean) => void;
5
+ };
6
+ export declare function createActions(types: ActionType[], context: ActionInitContext): Map<ActionType, Action>;
@@ -0,0 +1,6 @@
1
+ import { Action } from './action';
2
+ export declare class ActionWrapper {
3
+ private actions;
4
+ constructor(actions: Action[]);
5
+ wrapSetting(settingElement: HTMLElement): HTMLElement;
6
+ }
@@ -0,0 +1,25 @@
1
+ import { Action, ActionType } from './action';
2
+ export type SettingAction = "show-hide";
3
+ export type SettingGroupAction = Exclude<ActionType, "remove">;
4
+ export declare class RemoveAction extends Action<void> {
5
+ readonly type: "remove";
6
+ draw(): HTMLElement;
7
+ }
8
+ export declare class ShowHideAction extends Action<boolean> {
9
+ readonly type: "show-hide";
10
+ private button;
11
+ hide: boolean;
12
+ /** Syncs visual state from the parent. Does not fire onChange to avoid circular calls. */
13
+ setHide(hide: boolean): void;
14
+ private updateIcon;
15
+ draw(): HTMLElement;
16
+ }
17
+ export declare class ExpandCollapseAction extends Action<boolean> {
18
+ readonly type: "expand-collapse";
19
+ private button;
20
+ isCollapsed: boolean;
21
+ /** Syncs visual state from the parent. Does not fire onChange to avoid circular calls. */
22
+ setIsCollapsed(collapsed: boolean): void;
23
+ private updateIcon;
24
+ draw(): HTMLElement;
25
+ }
@@ -0,0 +1,13 @@
1
+ export interface ButtonProps {
2
+ icon?: string;
3
+ label?: string;
4
+ onClick?: () => void;
5
+ }
6
+ export declare class Button {
7
+ private buttonElement;
8
+ constructor(props: ButtonProps);
9
+ getElement(): HTMLButtonElement;
10
+ setIcon(icon: string): void;
11
+ setLabel(label: string): void;
12
+ setOnClick(onClick: () => void): void;
13
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Makes an element draggable (mouse + touch/pointer), clamped to viewport so it
3
+ * can't be dragged out of view.
4
+ *
5
+ * Notes:
6
+ * - The element should be positioned (`position: fixed` or `absolute`).
7
+ * - Uses Pointer Events so it works for mouse, touch, pen.
8
+ * - Clamps using the element's bounding box and the visual viewport when available.
9
+ */
10
+ export declare function makeDraggableWithinViewport(element: HTMLElement, opts?: {
11
+ /** Leave this many pixels visible at minimum (prevents fully hiding the element). */
12
+ margin?: number;
13
+ /**
14
+ * If true, use `position: fixed` coordinates. If false, uses element's offsetParent.
15
+ * Default: auto (fixed if computed position is fixed; otherwise absolute).
16
+ */
17
+ coordinateSpace?: "auto" | "fixed" | "offsetParent";
18
+ /** Optional handle; if omitted, the element itself is the handle. */
19
+ handle?: HTMLElement;
20
+ }): () => void;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Minimal reusable popup that:
3
+ * - renders into document.body (overlay optional)
4
+ * - accepts arbitrary content (string | Node | (() => Node))
5
+ * - optionally draggable by its header using makeDraggableWithinViewport()
6
+ */
7
+ export type PopupContent = string | Node | (() => Node);
8
+ export interface PopupOptions {
9
+ title?: string;
10
+ content: PopupContent;
11
+ /** Show a dim overlay behind the popup. Default: 'transparent' */
12
+ overlay?: 'transparent' | 'solid';
13
+ /** Close on overlay click. Default: true */
14
+ closeOnOverlayClick?: boolean;
15
+ /** Close on Escape. Default: true */
16
+ closeOnEscape?: boolean;
17
+ /** Enable dragging by header. Default: true */
18
+ draggable?: boolean;
19
+ /** Margin from viewport edges when clamping/dragging (min distance in px). Default: 16 */
20
+ margin?: number;
21
+ /** Initial position in viewport pixels, or a function called when opening (popup is in DOM). Default: centered with margin */
22
+ initialPosition?: {
23
+ x: number;
24
+ y: number;
25
+ } | ((popupEl: HTMLElement) => {
26
+ x: number;
27
+ y: number;
28
+ });
29
+ /** Width in px (or CSS width string). Default: 420 */
30
+ width?: number | string;
31
+ /** Additional class on the popup root. */
32
+ className?: string;
33
+ /** Called when popup closes */
34
+ onClose?: () => void;
35
+ }
36
+ export declare class Popup {
37
+ private options;
38
+ private overlayEl?;
39
+ private rootEl;
40
+ private headerEl;
41
+ private bodyEl;
42
+ private cleanupDrag?;
43
+ private onKeyDownBound;
44
+ constructor(options: PopupOptions);
45
+ open(): this;
46
+ close(): void;
47
+ setContent(content: PopupContent): void;
48
+ setTitle(title: string): void;
49
+ get element(): HTMLDivElement;
50
+ private clampIntoView;
51
+ }
@@ -0,0 +1,53 @@
1
+ export interface SelectOption {
2
+ name: string;
3
+ value: string | object;
4
+ }
5
+ export interface SelectProps {
6
+ options?: SelectOption[];
7
+ getOptions?: () => SelectOption[];
8
+ getOptionsAsync?: () => Promise<SelectOption[]>;
9
+ placeholder?: string;
10
+ loadingText?: string;
11
+ preserveButtonContent?: boolean;
12
+ value?: string | object;
13
+ dataTestId?: string;
14
+ leftColumn?: HTMLElement;
15
+ button?: HTMLButtonElement;
16
+ onChange?: (value: string | object, option: SelectOption) => void;
17
+ }
18
+ export declare class Select {
19
+ private props;
20
+ private container;
21
+ private buttonEl;
22
+ private optionsListEl;
23
+ private svgContainer;
24
+ private options;
25
+ private isOpen;
26
+ private isLoading;
27
+ private selectedIndex;
28
+ private clickOutsideListener;
29
+ private resizeListener;
30
+ private scrollListener;
31
+ private mutationObserver;
32
+ constructor(props?: SelectProps);
33
+ draw(): HTMLElement;
34
+ open(): void;
35
+ close(): void;
36
+ setOptions(options: SelectOption[], preserveSelection?: boolean): void;
37
+ setValue(value: string | object): void;
38
+ setSelectedIndex(index: number | null, { emitChange }?: {
39
+ emitChange?: boolean;
40
+ }): void;
41
+ getSelectedOption(): SelectOption | null;
42
+ destroy(): void;
43
+ private createOptionElement;
44
+ private handleOptionSelect;
45
+ private showDropdown;
46
+ private hideDropdown;
47
+ private updateDropdownPosition;
48
+ private refreshOptionsList;
49
+ private updateButtonText;
50
+ private fetchAsyncOptions;
51
+ private attachGlobalListeners;
52
+ private setupMutationObserver;
53
+ }
@@ -2,6 +2,7 @@ import { SettingGroup } from '../base/settings-group/settingsGroup';
2
2
  import { CornerSettings, SideSettings } from '../settings/multi-settings';
3
3
  import { CORNER, DEFAULT_KEY } from '../settings/multi-settings/utils/enum';
4
4
  import { GradientSetting } from '../settings/gradient-settings/GradientSetting';
5
+ import { SettingGroupAction } from '../components/actions/actionsCollection';
5
6
  export declare class BorderSettingSet extends SettingGroup<{
6
7
  color: GradientSetting;
7
8
  radius: CornerSettings;
@@ -12,6 +13,7 @@ export declare class BorderSettingSet extends SettingGroup<{
12
13
  radius?: number | Partial<Record<CORNER, number>>;
13
14
  size?: number | Partial<Record<DEFAULT_KEY, number>>;
14
15
  collapsed?: boolean;
16
+ actions?: SettingGroupAction[];
15
17
  });
16
18
  getValues(): {
17
19
  color: unknown;
@@ -0,0 +1,29 @@
1
+ import { InputTypes } from '../base/settings';
2
+ import { SettingGroup, SettingGroupProps } from '../base/settings-group/settingsGroup';
3
+ import { ExtractSettingValues } from '../types';
4
+ export declare class EffectSettings extends SettingGroup<{}> {
5
+ inputType: InputTypes;
6
+ private selectComponent;
7
+ private triggerButton;
8
+ private popup;
9
+ private icons;
10
+ private options;
11
+ constructor(props: SettingGroupProps<{}>);
12
+ private onChangeSetting;
13
+ private createTriggerButton;
14
+ private getPopupPosition;
15
+ private getSettingContentWithoutTitle;
16
+ private createPopup;
17
+ private changeContent;
18
+ private getSettingValue;
19
+ resetActionStates({ includeInTree, hide, collapsed }?: {
20
+ includeInTree?: boolean;
21
+ hide?: boolean;
22
+ collapsed?: boolean;
23
+ }): void;
24
+ drawWithActions(baseEl: HTMLElement): HTMLElement;
25
+ draw(): HTMLElement;
26
+ getValues(): ExtractSettingValues<{}>;
27
+ setIncludeInTree(includeInTree: boolean): void;
28
+ destroy(): void;
29
+ }
@@ -1,6 +1,7 @@
1
1
  import { SettingGroup } from '../base/settings-group/settingsGroup';
2
2
  import { GradientSetting } from '../settings/gradient-settings/GradientSetting';
3
3
  import { NumberSetting } from '../settings/number-settings/numberSettings';
4
+ export declare const shadowIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"17\" height=\"17\" viewBox=\"0 0 17 17\" fill=\"none\">\n<rect x=\"3.4115\" y=\"3.44287\" width=\"12.9308\" height=\"12.9308\" rx=\"1.5\" fill=\"#B7BFC5\"/>\n<path d=\"M0.834106 2.78764C0.834106 1.71642 1.7025 0.848022 2.77372 0.848022L11.8252 0.848022C12.8965 0.848022 13.7649 1.71642 13.7649 2.78764L13.7649 11.8392C13.7649 12.9104 12.8965 13.7788 11.8252 13.7788L2.77372 13.7788C1.7025 13.7788 0.834106 12.9104 0.834106 11.8392L0.834106 2.78764Z\" fill=\"white\"/>\n<path d=\"M12.5866 2.70661C12.5866 2.11574 12.1081 1.63724 11.5172 1.63724L2.70661 1.63724C2.11574 1.63724 1.63724 2.11574 1.63724 2.70661L1.63724 11.5172C1.63724 12.1081 2.11574 12.5866 2.70661 12.5866L11.5172 12.5866C12.1081 12.5866 12.5866 12.1081 12.5866 11.5172L12.5866 2.70661ZM14.2238 11.5172C14.2238 13.0118 13.0118 14.2238 11.5172 14.2238L2.70661 14.2238C1.21206 14.2238 4.05377e-08 13.0118 0 11.5172L0 2.70661C0 1.21206 1.21206 4.05377e-08 2.70661 0L11.5172 0C13.0118 0 14.2238 1.21206 14.2238 2.70661L14.2238 11.5172Z\" fill=\"#637381\"/>\n</svg>";
4
5
  export declare class ShadowSetting extends SettingGroup<{
5
6
  x: NumberSetting;
6
7
  y: NumberSetting;