@mittwald/ext-bridge 0.2.0-alpha.793 → 0.2.0-alpha.795
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/integrations/i18next/modules/remoteLanguageDetectorModule.mjs +7 -4
- package/dist/js/integrations/i18next/modules/remoteLanguageDetectorModule.mjs.map +1 -1
- package/dist/js/lib/assertBrowserEnv.mjs +1 -1
- package/dist/js/lib/assertBrowserEnv.mjs.map +1 -1
- package/dist/types/integrations/i18next/modules/remoteLanguageDetectorModule.d.ts +1 -1
- package/dist/types/integrations/i18next/modules/remoteLanguageDetectorModule.d.ts.map +1 -1
- package/dist/types/lib/assertBrowserEnv.d.ts +1 -0
- package/dist/types/lib/assertBrowserEnv.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import '../../../global-browser.mjs';
|
|
2
2
|
import { getConfig } from '../../../config/getConfig.mjs';
|
|
3
|
+
import { isBrowser } from '../../../lib/assertBrowserEnv.mjs';
|
|
3
4
|
import 'i18next';
|
|
4
5
|
|
|
5
|
-
const remoteLanguageDetectorModule = {
|
|
6
|
+
const remoteLanguageDetectorModule = () => ({
|
|
6
7
|
type: "languageDetector",
|
|
7
8
|
async: true,
|
|
8
9
|
detect: async () => {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
if (isBrowser) {
|
|
11
|
+
const config = await getConfig();
|
|
12
|
+
return config.language;
|
|
13
|
+
}
|
|
11
14
|
}
|
|
12
|
-
};
|
|
15
|
+
});
|
|
13
16
|
|
|
14
17
|
export { remoteLanguageDetectorModule };
|
|
15
18
|
//# sourceMappingURL=remoteLanguageDetectorModule.mjs.map
|
|
@@ -1 +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
|
|
1
|
+
{"version":3,"file":"remoteLanguageDetectorModule.mjs","sources":["../../../../../src/integrations/i18next/modules/remoteLanguageDetectorModule.ts"],"sourcesContent":["import { getConfig } from \"@/index-browser\";\nimport { isBrowser } from \"@/lib/assertBrowserEnv\";\nimport { type LanguageDetectorAsyncModule } from \"i18next\";\n\nexport const remoteLanguageDetectorModule =\n (): LanguageDetectorAsyncModule => ({\n type: \"languageDetector\",\n async: true,\n detect: async () => {\n if (isBrowser) {\n const config = await getConfig();\n return config.language;\n }\n },\n });\n"],"names":[],"mappings":";;;;;AAIO,MAAM,+BACX,OAAoC;AAAA,EAClC,IAAA,EAAM,kBAAA;AAAA,EACN,KAAA,EAAO,IAAA;AAAA,EACP,QAAQ,YAAY;AAClB,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,MAAM,MAAA,GAAS,MAAM,SAAA,EAAU;AAC/B,MAAA,OAAO,MAAA,CAAO,QAAA;AAAA,IAChB;AAAA,EACF;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertBrowserEnv.mjs","sources":["../../../src/lib/assertBrowserEnv.ts"],"sourcesContent":["import { ExtBridgeError } from \"@/error\";\n\
|
|
1
|
+
{"version":3,"file":"assertBrowserEnv.mjs","sources":["../../../src/lib/assertBrowserEnv.ts"],"sourcesContent":["import { ExtBridgeError } from \"@/error\";\n\nexport const isBrowser: boolean =\n typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nexport const assertBrowserEnv = () => {\n if (!isBrowser) {\n throw new ExtBridgeError(\n \"Ext Bridge can only be used in a browser environment. To opt-out from SSR you can use <BrowserOnly> from '@mittwald/flow-remote-react-components'.\",\n );\n }\n};\n"],"names":[],"mappings":";;AAEO,MAAM,YACX,OAAO,MAAA,KAAW,WAAA,IAAe,OAAO,OAAO,QAAA,KAAa;AAEvD,MAAM,mBAAmB,MAAM;AACpC,EAAA,IAAI,CAAC,SAAA,EAAW;AACd,IAAA,MAAM,IAAI,cAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACF;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LanguageDetectorAsyncModule } from 'i18next';
|
|
2
|
-
export declare const remoteLanguageDetectorModule: LanguageDetectorAsyncModule;
|
|
2
|
+
export declare const remoteLanguageDetectorModule: () => LanguageDetectorAsyncModule;
|
|
3
3
|
//# sourceMappingURL=remoteLanguageDetectorModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteLanguageDetectorModule.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/i18next/modules/remoteLanguageDetectorModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remoteLanguageDetectorModule.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/i18next/modules/remoteLanguageDetectorModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,4BAA4B,QACnC,2BASF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertBrowserEnv.d.ts","sourceRoot":"","sources":["../../../src/lib/assertBrowserEnv.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assertBrowserEnv.d.ts","sourceRoot":"","sources":["../../../src/lib/assertBrowserEnv.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,EAAE,OACiD,CAAC;AAE1E,eAAO,MAAM,gBAAgB,YAM5B,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.795",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bridge for mStudio embedded frontend extensions",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"optional": true
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "79052ca8f0c2b19958b2bb349552abac72713ecb"
|
|
84
84
|
}
|