@imgly/plugin-ai-generation-web 0.2.14 → 0.2.16
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/CHANGELOG.md +25 -0
- package/README.md +112 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/__tests__/actionLabelTranslation.test.d.ts +1 -0
- package/dist/core/ActionRegistry.d.ts +4 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +4 -4
- package/dist/utils/translationHelpers.d.ts +23 -0
- package/package.json +1 -1
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
2
|
+
type TranslationDefinition = Partial<Record<string, Partial<Record<string, string>>>>;
|
|
3
|
+
/**
|
|
4
|
+
* Sets default translations only for keys that don't already exist.
|
|
5
|
+
*
|
|
6
|
+
* This allows integrators to set custom translations BEFORE plugins load,
|
|
7
|
+
* and the plugins won't override those custom values with their defaults.
|
|
8
|
+
*
|
|
9
|
+
* @param cesdk - The CE.SDK instance
|
|
10
|
+
* @param definition - The translations to set (same format as setTranslations)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Integrator sets custom translation BEFORE plugin loads
|
|
15
|
+
* cesdk.i18n.setTranslations({ en: { 'my.key': 'Custom Value' } });
|
|
16
|
+
*
|
|
17
|
+
* // Plugin uses setDefaultTranslations - won't override 'my.key'
|
|
18
|
+
* setDefaultTranslations(cesdk, { en: { 'my.key': 'Default Value', 'other.key': 'Other' } });
|
|
19
|
+
*
|
|
20
|
+
* // Result: 'my.key' = 'Custom Value', 'other.key' = 'Other'
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function setDefaultTranslations(cesdk: CreativeEditorSDK, definition: TranslationDefinition): void;
|
|
2
24
|
/**
|
|
3
25
|
* Creates a translation callback function for AI asset sources
|
|
4
26
|
* @param cesdk - The CE.SDK instance
|
|
@@ -17,3 +39,4 @@ export declare function createTranslationCallback(cesdk: CreativeEditorSDK, mode
|
|
|
17
39
|
* @returns Array of translation keys in fallback order
|
|
18
40
|
*/
|
|
19
41
|
export declare function buildTranslationKeys(modelKey: string, propertyName: string, value: string, pluginType?: string): string[];
|
|
42
|
+
export {};
|