@ankhorage/studio 0.0.9 → 0.0.10
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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface StudioLocalizationConfig {
|
|
2
|
+
locales?: string[];
|
|
3
|
+
}
|
|
4
|
+
export declare function isStringArray(value: unknown): value is string[];
|
|
5
|
+
export declare function isStringRecord(value: unknown): value is Record<string, string>;
|
|
6
|
+
export declare function readLocalizationConfig(value: unknown): StudioLocalizationConfig | null;
|
|
7
|
+
//# sourceMappingURL=localizationConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localizationConfig.d.ts","sourceRoot":"","sources":["../src/localizationConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAMD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,EAAE,CAE/D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE9E;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,GAAG,IAAI,CAUtF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function isRecord(value) {
|
|
2
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
3
|
+
}
|
|
4
|
+
export function isStringArray(value) {
|
|
5
|
+
return Array.isArray(value) && value.every((item) => typeof item === 'string');
|
|
6
|
+
}
|
|
7
|
+
export function isStringRecord(value) {
|
|
8
|
+
return isRecord(value) && Object.values(value).every((item) => typeof item === 'string');
|
|
9
|
+
}
|
|
10
|
+
export function readLocalizationConfig(value) {
|
|
11
|
+
if (!isRecord(value)) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (value.locales === undefined) {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
return isStringArray(value.locales) ? { locales: value.locales } : null;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=localizationConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localizationConfig.js","sourceRoot":"","sources":["../src/localizationConfig.ts"],"names":[],"mappings":"AAIA,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/studio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Studio authoring package for Ankhorage apps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/studio#readme",
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"types": "./dist/canvasDropZones.d.ts",
|
|
33
33
|
"import": "./dist/canvasDropZones.js"
|
|
34
34
|
},
|
|
35
|
+
"./localizationConfig": {
|
|
36
|
+
"types": "./dist/localizationConfig.d.ts",
|
|
37
|
+
"import": "./dist/localizationConfig.js"
|
|
38
|
+
},
|
|
35
39
|
"./manifestNavigatorPreviewModel": {
|
|
36
40
|
"types": "./dist/manifestNavigatorPreviewModel.d.ts",
|
|
37
41
|
"import": "./dist/manifestNavigatorPreviewModel.js"
|