@mittwald/ext-bridge 0.2.0-alpha.784 → 0.2.0-alpha.785
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/js/config/schemas.mjs +2 -1
- package/dist/js/config/schemas.mjs.map +1 -1
- package/dist/js/i18next.mjs +2 -0
- package/dist/js/i18next.mjs.map +1 -0
- package/dist/js/integrations/i18next/modules/remoteLanguageDetectorModule.mjs +15 -0
- package/dist/js/integrations/i18next/modules/remoteLanguageDetectorModule.mjs.map +1 -0
- package/dist/js/react/hooks/useLanguage.mjs +6 -0
- package/dist/js/react/hooks/useLanguage.mjs.map +1 -0
- package/dist/js/react.mjs +1 -0
- package/dist/js/react.mjs.map +1 -1
- package/dist/types/config/getConfig.d.ts +1 -0
- package/dist/types/config/getConfig.d.ts.map +1 -1
- package/dist/types/config/parse.d.ts +1 -0
- package/dist/types/config/parse.d.ts.map +1 -1
- package/dist/types/config/schemas.d.ts +1 -0
- package/dist/types/config/schemas.d.ts.map +1 -1
- package/dist/types/integrations/i18next/index.d.ts +2 -0
- package/dist/types/integrations/i18next/index.d.ts.map +1 -0
- package/dist/types/integrations/i18next/modules/remoteLanguageDetectorModule.d.ts +3 -0
- package/dist/types/integrations/i18next/modules/remoteLanguageDetectorModule.d.ts.map +1 -0
- package/dist/types/react/hooks/index.d.ts +1 -0
- package/dist/types/react/hooks/index.d.ts.map +1 -1
- package/dist/types/react/hooks/useConfig.d.ts +1 -0
- package/dist/types/react/hooks/useConfig.d.ts.map +1 -1
- package/dist/types/react/hooks/useLanguage.d.ts +2 -0
- package/dist/types/react/hooks/useLanguage.d.ts.map +1 -0
- package/package.json +11 -2
|
@@ -5,7 +5,8 @@ const baseConfig = z.object({
|
|
|
5
5
|
userId: z.string(),
|
|
6
6
|
extensionId: z.string(),
|
|
7
7
|
extensionInstanceId: z.string(),
|
|
8
|
-
variantKey: z.string().optional().nullable()
|
|
8
|
+
variantKey: z.string().optional().nullable(),
|
|
9
|
+
language: z.string().default("de")
|
|
9
10
|
});
|
|
10
11
|
const contextParameters = z.object({
|
|
11
12
|
appInstallationId: z.string().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.mjs","sources":["../../../src/config/schemas.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst baseConfig = z.object({\n sessionId: z.string(),\n userId: z.string(),\n extensionId: z.string(),\n extensionInstanceId: z.string(),\n variantKey: z.string().optional().nullable(),\n});\n\nconst contextParameters = z.object({\n appInstallationId: z.string().optional(),\n projectId: z.string().optional(),\n customerId: z.string().optional(),\n});\n\nexport const config = baseConfig\n .extend(contextParameters.shape)\n .catchall(z.string().optional().nullable());\n"],"names":[],"mappings":";;AAEA,MAAM,UAAA,GAAa,EAAE,MAAA,CAAO;AAAA,EAC1B,SAAA,EAAW,EAAE,MAAA,EAAO;AAAA,EACpB,MAAA,EAAQ,EAAE,MAAA,EAAO;AAAA,EACjB,WAAA,EAAa,EAAE,MAAA,EAAO;AAAA,EACtB,mBAAA,EAAqB,EAAE,MAAA,EAAO;AAAA,EAC9B,YAAY,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA;
|
|
1
|
+
{"version":3,"file":"schemas.mjs","sources":["../../../src/config/schemas.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst baseConfig = z.object({\n sessionId: z.string(),\n userId: z.string(),\n extensionId: z.string(),\n extensionInstanceId: z.string(),\n variantKey: z.string().optional().nullable(),\n language: z.string().default(\"de\"),\n});\n\nconst contextParameters = z.object({\n appInstallationId: z.string().optional(),\n projectId: z.string().optional(),\n customerId: z.string().optional(),\n});\n\nexport const config = baseConfig\n .extend(contextParameters.shape)\n .catchall(z.string().optional().nullable());\n"],"names":[],"mappings":";;AAEA,MAAM,UAAA,GAAa,EAAE,MAAA,CAAO;AAAA,EAC1B,SAAA,EAAW,EAAE,MAAA,EAAO;AAAA,EACpB,MAAA,EAAQ,EAAE,MAAA,EAAO;AAAA,EACjB,WAAA,EAAa,EAAE,MAAA,EAAO;AAAA,EACtB,mBAAA,EAAqB,EAAE,MAAA,EAAO;AAAA,EAC9B,YAAY,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAAW,QAAA,EAAS;AAAA,EAC3C,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAQ,IAAI;AACnC,CAAC,CAAA;AAED,MAAM,iBAAA,GAAoB,EAAE,MAAA,CAAO;AAAA,EACjC,iBAAA,EAAmB,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EACvC,SAAA,EAAW,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC/B,UAAA,EAAY,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AACzB,CAAC,CAAA;AAEM,MAAM,MAAA,GAAS,UAAA,CACnB,MAAA,CAAO,iBAAA,CAAkB,KAAK,CAAA,CAC9B,QAAA,CAAS,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS,CAAE,UAAU;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18next.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import '../../../global-browser.mjs';
|
|
2
|
+
import { getConfig } from '../../../config/getConfig.mjs';
|
|
3
|
+
import 'i18next';
|
|
4
|
+
|
|
5
|
+
const remoteLanguageDetectorModule = {
|
|
6
|
+
type: "languageDetector",
|
|
7
|
+
async: true,
|
|
8
|
+
detect: async () => {
|
|
9
|
+
const config = await getConfig();
|
|
10
|
+
return config.language;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { remoteLanguageDetectorModule };
|
|
15
|
+
//# sourceMappingURL=remoteLanguageDetectorModule.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteLanguageDetectorModule.mjs","sources":["../../../../../src/integrations/i18next/modules/remoteLanguageDetectorModule.ts"],"sourcesContent":["import { getConfig } from \"@/index-browser\";\nimport { type LanguageDetectorAsyncModule } from \"i18next\";\n\nexport const remoteLanguageDetectorModule: LanguageDetectorAsyncModule = {\n type: \"languageDetector\",\n async: true,\n detect: async () => {\n const config = await getConfig();\n return config.language;\n },\n};\n"],"names":[],"mappings":";;;;AAGO,MAAM,4BAAA,GAA4D;AAAA,EACvE,IAAA,EAAM,kBAAA;AAAA,EACN,KAAA,EAAO,IAAA;AAAA,EACP,QAAQ,YAAY;AAClB,IAAA,MAAM,MAAA,GAAS,MAAM,SAAA,EAAU;AAC/B,IAAA,OAAO,MAAA,CAAO,QAAA;AAAA,EAChB;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLanguage.mjs","sources":["../../../../src/react/hooks/useLanguage.ts"],"sourcesContent":["import { useConfig } from \"./useConfig\";\n\nexport const useLanguage = () => useConfig().language;\n"],"names":[],"mappings":";;AAEO,MAAM,WAAA,GAAc,MAAM,SAAA,EAAU,CAAE;;;;"}
|
package/dist/js/react.mjs
CHANGED
package/dist/js/react.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfig.d.ts","sourceRoot":"","sources":["../../../src/config/getConfig.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"getConfig.d.ts","sourceRoot":"","sources":["../../../src/config/getConfig.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;EAGrB,CAAC"}
|
|
@@ -4,6 +4,7 @@ export declare const parseConfig: (something: unknown) => {
|
|
|
4
4
|
userId: string;
|
|
5
5
|
extensionId: string;
|
|
6
6
|
extensionInstanceId: string;
|
|
7
|
+
language: string;
|
|
7
8
|
variantKey?: string | null | undefined;
|
|
8
9
|
appInstallationId?: string | undefined;
|
|
9
10
|
projectId?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/config/parse.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,GAAI,WAAW,OAAO
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/config/parse.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,GAAI,WAAW,OAAO;;;;;;;;;;;CAM7C,CAAC"}
|
|
@@ -5,6 +5,7 @@ export declare const config: z.ZodObject<{
|
|
|
5
5
|
extensionId: z.ZodString;
|
|
6
6
|
extensionInstanceId: z.ZodString;
|
|
7
7
|
variantKey: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
language: z.ZodDefault<z.ZodString>;
|
|
8
9
|
appInstallationId: z.ZodOptional<z.ZodString>;
|
|
9
10
|
projectId: z.ZodOptional<z.ZodString>;
|
|
10
11
|
customerId: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/config/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/config/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,MAAM;;;;;;;;;;+DAE0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/i18next/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteLanguageDetectorModule.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/i18next/modules/remoteLanguageDetectorModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,4BAA4B,EAAE,2BAO1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfig.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/useConfig.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"useConfig.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/useConfig.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;CAErB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLanguage.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/useLanguage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,cAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/ext-bridge",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.785",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bridge for mStudio embedded frontend extensions",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"./react": {
|
|
21
21
|
"types": "./dist/types/react/index.d.ts",
|
|
22
22
|
"default": "./dist/js/react.mjs"
|
|
23
|
+
},
|
|
24
|
+
"./i18next": {
|
|
25
|
+
"types": "./dist/types/integrations/i18next/index.d.ts",
|
|
26
|
+
"default": "./dist/js/integrations/i18next.mjs"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"files": [
|
|
@@ -45,6 +49,7 @@
|
|
|
45
49
|
"@types/node": "^24.10.9",
|
|
46
50
|
"@types/react": "^19.2",
|
|
47
51
|
"@types/react-dom": "^19.2",
|
|
52
|
+
"i18next": "^26.0.3",
|
|
48
53
|
"nx": "^22.4.4",
|
|
49
54
|
"prettier": "^3.8.1",
|
|
50
55
|
"react": "^19.2.0",
|
|
@@ -59,6 +64,7 @@
|
|
|
59
64
|
"vitest": "^4.0.18"
|
|
60
65
|
},
|
|
61
66
|
"peerDependencies": {
|
|
67
|
+
"i18next": "^26.0.0",
|
|
62
68
|
"react": "^19.2.0",
|
|
63
69
|
"react-dom": "^19.2.0"
|
|
64
70
|
},
|
|
@@ -68,7 +74,10 @@
|
|
|
68
74
|
},
|
|
69
75
|
"react-dom": {
|
|
70
76
|
"optional": true
|
|
77
|
+
},
|
|
78
|
+
"i18next": {
|
|
79
|
+
"optional": true
|
|
71
80
|
}
|
|
72
81
|
},
|
|
73
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "1d5c6f9e7ca4758ab179250a39ee01ce6cbfa222"
|
|
74
83
|
}
|