builder-settings-types 0.0.463 → 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 +10 -0
- package/dist/base/additional-settings/repeatingSetting.d.ts +61 -0
- package/dist/builder-settings-types.cjs.js +201 -201
- package/dist/builder-settings-types.es.js +8661 -8427
- package/dist/components/select/select.d.ts +1 -4
- package/dist/groups/effectSettingsSet.d.ts +7 -5
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare class AdditionalSettings<TSettings extends SettingsMap> implement
|
|
|
8
8
|
title: string;
|
|
9
9
|
private settings;
|
|
10
10
|
private selectedKeys;
|
|
11
|
+
private repeatingInstances;
|
|
11
12
|
private rootElement;
|
|
12
13
|
private contentElement;
|
|
13
14
|
private addButton;
|
|
@@ -19,10 +20,19 @@ export declare class AdditionalSettings<TSettings extends SettingsMap> implement
|
|
|
19
20
|
setSelectedKeys(keys: (keyof TSettings)[]): void;
|
|
20
21
|
removeSettingKey(key: keyof TSettings): void;
|
|
21
22
|
addSettingKey(key: keyof TSettings): void;
|
|
23
|
+
/**
|
|
24
|
+
* Restore visible repeating instances for a key from serialized values.
|
|
25
|
+
* Clears existing instances for that key and re-creates from the array.
|
|
26
|
+
*/
|
|
27
|
+
restoreRepeatingInstances(key: keyof TSettings, values: unknown[]): void;
|
|
22
28
|
private createHeader;
|
|
23
29
|
private createContentContainer;
|
|
24
30
|
private getRemainingKeys;
|
|
25
31
|
private selectSetting;
|
|
32
|
+
private addRepeatingInstance;
|
|
33
|
+
private removeRepeatingInstance;
|
|
34
|
+
private renderRepeatingInstance;
|
|
35
|
+
private clearRegularElements;
|
|
26
36
|
private removeSetting;
|
|
27
37
|
private renderSelectedSetting;
|
|
28
38
|
private getSettingTitle;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type RepeatingSettingProps<T extends object> = {
|
|
2
|
+
title: string;
|
|
3
|
+
factory: () => T;
|
|
4
|
+
max?: number;
|
|
5
|
+
};
|
|
6
|
+
/** Sentinel wrapper written into getInstanceValues() for hidden instances. */
|
|
7
|
+
export type RepeatingHiddenSentinel = {
|
|
8
|
+
__hidden: true;
|
|
9
|
+
value: unknown;
|
|
10
|
+
};
|
|
11
|
+
export declare function isRepeatingHiddenSentinel(v: unknown): v is RepeatingHiddenSentinel;
|
|
12
|
+
export declare class RepeatingSetting<T extends object> {
|
|
13
|
+
readonly isRepeating: true;
|
|
14
|
+
readonly isAdditional: true;
|
|
15
|
+
title: string;
|
|
16
|
+
readonly factory: () => T;
|
|
17
|
+
readonly max: number;
|
|
18
|
+
private instances;
|
|
19
|
+
private onChangeCb?;
|
|
20
|
+
private restoreCallback?;
|
|
21
|
+
constructor(props: RepeatingSettingProps<T>);
|
|
22
|
+
canAddMore(): boolean;
|
|
23
|
+
createInstance(hidden?: boolean): {
|
|
24
|
+
id: string;
|
|
25
|
+
instance: T;
|
|
26
|
+
};
|
|
27
|
+
removeInstance(id: string): void;
|
|
28
|
+
/** Returns all instances (visible and hidden) in insertion order. */
|
|
29
|
+
getInstances(): {
|
|
30
|
+
id: string;
|
|
31
|
+
instance: T;
|
|
32
|
+
}[];
|
|
33
|
+
clearInstances(): void;
|
|
34
|
+
setInstanceHidden(id: string, hidden: boolean): void;
|
|
35
|
+
getInstanceHidden(id: string): boolean;
|
|
36
|
+
private extractInstanceValue;
|
|
37
|
+
private extractInstanceValueForJson;
|
|
38
|
+
/**
|
|
39
|
+
* Returns ALL instances in order, preserving hidden state.
|
|
40
|
+
* Hidden instances are wrapped: { __hidden: true, value: <instanceValue> }.
|
|
41
|
+
* This lets restoreFromValues reconstruct exact order + hidden state.
|
|
42
|
+
*/
|
|
43
|
+
getInstanceValues(): unknown[];
|
|
44
|
+
/**
|
|
45
|
+
* Returns values for ALL instances.
|
|
46
|
+
* Hidden instances are wrapped: { __hidden: true, value: <instanceValue> }.
|
|
47
|
+
* This lets restoreFromValues reconstruct exact order + hidden state.
|
|
48
|
+
*/
|
|
49
|
+
getInstanceValuesForJson(): unknown[];
|
|
50
|
+
setOnChange(cb: () => void): void;
|
|
51
|
+
setRestoreCallback(cb: (values: unknown[]) => void): void;
|
|
52
|
+
setValue(newValues: unknown[]): void;
|
|
53
|
+
notifyChange(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Clears all instances and restores from values.
|
|
56
|
+
* Handles both plain values (visible) and sentinel-wrapped values (hidden),
|
|
57
|
+
* preserving the original order.
|
|
58
|
+
*/
|
|
59
|
+
restoreFromValues(values: unknown[]): void;
|
|
60
|
+
}
|
|
61
|
+
export declare function isRepeatingSetting(value: unknown): value is RepeatingSetting<object>;
|