builder-settings-types 0.0.410 → 0.0.412
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.
|
@@ -32,6 +32,7 @@ export declare class MultiLanguageSetting extends Setting<MultiLanguageValue, Mu
|
|
|
32
32
|
static getAllInstances(): Map<string, MultiLanguageSetting>;
|
|
33
33
|
static clearRegistry(): void;
|
|
34
34
|
private static findInstanceByLeaf;
|
|
35
|
+
private static findInstanceByComponentAndTitle;
|
|
35
36
|
setComponentPath(path: string): void;
|
|
36
37
|
getComponentPath(): string;
|
|
37
38
|
cleanup(): void;
|
|
@@ -10,8 +10,14 @@ export interface ComponentInstanceData {
|
|
|
10
10
|
component: string;
|
|
11
11
|
currentSettings: Record<string, unknown>;
|
|
12
12
|
}
|
|
13
|
+
export type TitleLookupFn = (fullPath: string) => string | undefined;
|
|
13
14
|
export declare class ExcelTranslationService {
|
|
14
15
|
static exportToExcel(translations: TranslationRow[], languages: string[], filename?: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Extract the setting key from a nested path
|
|
18
|
+
* e.g., "textSettings > text" -> "textSettings.text"
|
|
19
|
+
*/
|
|
20
|
+
private static extractSettingKey;
|
|
15
21
|
static importFromExcel(file: File, languages: string[]): Promise<TranslationRow[]>;
|
|
16
22
|
/**
|
|
17
23
|
* Check if an object is a MultiLanguageValue (has language codes as keys)
|
|
@@ -22,13 +28,15 @@ export declare class ExcelTranslationService {
|
|
|
22
28
|
* Returns rows with:
|
|
23
29
|
* - id: full path including component name (e.g., "button1 > textSettings > text")
|
|
24
30
|
* - title: nested path WITHOUT component name (e.g., "textSettings > text") - needed for import matching
|
|
31
|
+
* - settingTitle: human-readable title from props.title or key formatted with dots
|
|
25
32
|
*/
|
|
26
33
|
private static extractMultiLanguageValues;
|
|
27
34
|
/**
|
|
28
35
|
* Export translations from component instances data directly
|
|
29
36
|
* This exports only the translations from the provided components, not from global registry
|
|
37
|
+
* @param titleLookup - Optional function to get human-readable titles from registered instances
|
|
30
38
|
*/
|
|
31
|
-
static exportFromComponentInstances(componentInstances: ComponentInstanceData[], filename?: string): void;
|
|
39
|
+
static exportFromComponentInstances(componentInstances: ComponentInstanceData[], filename?: string, titleLookup?: TitleLookupFn): void;
|
|
32
40
|
static importToComponentInstances(file: File, componentInstances: ComponentInstanceData[]): Promise<ComponentInstanceData[]>;
|
|
33
41
|
/**
|
|
34
42
|
* Recursively update settings with imported translations
|
package/package.json
CHANGED