mage-obsidian 1.1.2 → 2.1.0
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/LICENSE +1 -1
- package/README.md +1 -0
- package/dist/cli/buildThemes.d.ts +3 -0
- package/dist/cli/buildThemes.d.ts.map +1 -0
- package/dist/cli/buildThemes.js +219 -0
- package/dist/cli/buildThemes.js.map +1 -0
- package/dist/config/default.d.ts +16 -0
- package/dist/config/default.d.ts.map +1 -0
- package/dist/config/default.js +22 -0
- package/dist/config/default.js.map +1 -0
- package/dist/config/eslint.js +60 -0
- package/dist/core/configResolver.d.ts +38 -0
- package/dist/core/configResolver.d.ts.map +1 -0
- package/dist/core/configResolver.js +102 -0
- package/dist/core/configResolver.js.map +1 -0
- package/dist/core/contractValidator.d.ts +16 -0
- package/dist/core/contractValidator.d.ts.map +1 -0
- package/dist/core/contractValidator.js +49 -0
- package/dist/core/contractValidator.js.map +1 -0
- package/dist/core/cssResolver.d.ts +5 -0
- package/dist/core/cssResolver.d.ts.map +1 -0
- package/dist/core/cssResolver.js +126 -0
- package/dist/core/cssResolver.js.map +1 -0
- package/dist/core/generateInterceptors.d.ts +10 -0
- package/dist/core/generateInterceptors.d.ts.map +1 -0
- package/{src/service → dist/core}/generateInterceptors.js +72 -93
- package/dist/core/generateInterceptors.js.map +1 -0
- package/dist/core/generateJsconfig.d.ts +45 -0
- package/dist/core/generateJsconfig.d.ts.map +1 -0
- package/dist/core/generateJsconfig.js +145 -0
- package/dist/core/generateJsconfig.js.map +1 -0
- package/dist/core/moduleResolver.d.ts +22 -0
- package/dist/core/moduleResolver.d.ts.map +1 -0
- package/dist/core/moduleResolver.js +177 -0
- package/dist/core/moduleResolver.js.map +1 -0
- package/dist/core/preCompileFiles.d.ts +6 -0
- package/dist/core/preCompileFiles.d.ts.map +1 -0
- package/dist/core/preCompileFiles.js +79 -0
- package/dist/core/preCompileFiles.js.map +1 -0
- package/dist/core/preCompileMagentoFiles.d.ts +3 -0
- package/dist/core/preCompileMagentoFiles.d.ts.map +1 -0
- package/dist/core/preCompileMagentoFiles.js +28 -0
- package/dist/core/preCompileMagentoFiles.js.map +1 -0
- package/dist/core/themeResolverSync.d.ts +6 -0
- package/dist/core/themeResolverSync.d.ts.map +1 -0
- package/dist/core/themeResolverSync.js +65 -0
- package/dist/core/themeResolverSync.js.map +1 -0
- package/dist/runtime/i18nCore.d.ts +55 -0
- package/dist/runtime/i18nCore.d.ts.map +1 -0
- package/dist/runtime/i18nCore.js +77 -0
- package/dist/runtime/i18nCore.js.map +1 -0
- package/dist/runtime/interceptorManager.d.ts +45 -0
- package/dist/runtime/interceptorManager.d.ts.map +1 -0
- package/{src/service → dist/runtime}/interceptorManager.js +43 -52
- package/dist/runtime/interceptorManager.js.map +1 -0
- package/dist/runtime/islands.d.ts +45 -0
- package/dist/runtime/islands.d.ts.map +1 -0
- package/dist/runtime/islands.js +59 -0
- package/dist/runtime/islands.js.map +1 -0
- package/dist/runtime/sectionStoreCore.d.ts +108 -0
- package/dist/runtime/sectionStoreCore.d.ts.map +1 -0
- package/dist/runtime/sectionStoreCore.js +189 -0
- package/dist/runtime/sectionStoreCore.js.map +1 -0
- package/dist/utils/findComponents.d.ts +17 -0
- package/dist/utils/findComponents.d.ts.map +1 -0
- package/dist/utils/findComponents.js +66 -0
- package/dist/utils/findComponents.js.map +1 -0
- package/dist/utils/runWithConcurrency.d.ts +10 -0
- package/dist/utils/runWithConcurrency.d.ts.map +1 -0
- package/dist/utils/runWithConcurrency.js +29 -0
- package/dist/utils/runWithConcurrency.js.map +1 -0
- package/dist/vite/defaultNodeResolver.d.ts +9 -0
- package/dist/vite/defaultNodeResolver.d.ts.map +1 -0
- package/dist/vite/defaultNodeResolver.js +19 -0
- package/dist/vite/defaultNodeResolver.js.map +1 -0
- package/dist/vite/inheritAssetsModuleResolver.d.ts +8 -0
- package/dist/vite/inheritAssetsModuleResolver.d.ts.map +1 -0
- package/{src/service → dist/vite}/inheritAssetsModuleResolver.js +10 -20
- package/dist/vite/inheritAssetsModuleResolver.js.map +1 -0
- package/dist/vite/inheritModuleResolver.d.ts +8 -0
- package/dist/vite/inheritModuleResolver.d.ts.map +1 -0
- package/{src/service → dist/vite}/inheritModuleResolver.js +8 -17
- package/dist/vite/inheritModuleResolver.js.map +1 -0
- package/dist/vite/interceptorsPlugin.d.ts +10 -0
- package/dist/vite/interceptorsPlugin.d.ts.map +1 -0
- package/{src/service → dist/vite}/interceptorsPlugin.js +17 -28
- package/dist/vite/interceptorsPlugin.js.map +1 -0
- package/dist/vite/magentoHrmRewrite.d.ts +6 -0
- package/dist/vite/magentoHrmRewrite.d.ts.map +1 -0
- package/dist/vite/magentoHrmRewrite.js +45 -0
- package/dist/vite/magentoHrmRewrite.js.map +1 -0
- package/dist/vite/sharedPlugins.d.ts +35 -0
- package/dist/vite/sharedPlugins.d.ts.map +1 -0
- package/dist/vite/sharedPlugins.js +52 -0
- package/dist/vite/sharedPlugins.js.map +1 -0
- package/dist/vite/themeSourceWatcher.d.ts +16 -0
- package/dist/vite/themeSourceWatcher.d.ts.map +1 -0
- package/dist/vite/themeSourceWatcher.js +91 -0
- package/dist/vite/themeSourceWatcher.js.map +1 -0
- package/dist/vite/unresolvedModuleGuard.d.ts +17 -0
- package/dist/vite/unresolvedModuleGuard.d.ts.map +1 -0
- package/dist/vite/unresolvedModuleGuard.js +87 -0
- package/dist/vite/unresolvedModuleGuard.js.map +1 -0
- package/package.json +89 -13
- package/.github/workflows/publish.yml +0 -35
- package/jest.config.js +0 -5
- package/src/__tests__/__mocks__/configResolver.js +0 -35
- package/src/__tests__/fixtures/interceptors/emptyTarget.js +0 -2
- package/src/__tests__/fixtures/interceptors/pluginForNonFunction.js +0 -7
- package/src/__tests__/fixtures/interceptors/pluginModule.js +0 -13
- package/src/__tests__/fixtures/interceptors/targetModule.js +0 -12
- package/src/__tests__/fixtures/interceptors/targetNonFunction.js +0 -7
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameA/view/frontend/web/components/ComponentA.vue +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameA/view/frontend/web/components/ComponentB.vue +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameA/view/frontend/web/css/module.extend.css +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameA/view/frontend/web/js/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameA/view/frontend/web/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameA/view/frontend/web/module.config.js +0 -9
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameB/view/frontend/web/components/ComponentA.vue +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameB/view/frontend/web/components/ComponentB.vue +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameB/view/frontend/web/css/module.extend.css +0 -2
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameB/view/frontend/web/js/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameB/view/frontend/web/module.config.js +0 -7
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameC/view/frontend/web/components/ComponentA.vue +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameC/view/frontend/web/components/ComponentB.vue +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameC/view/frontend/web/css/module.extend.css +0 -2
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameC/view/frontend/web/js/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/code/Vendor/ModuleNameC/view/frontend/web/module.config.js +0 -7
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameA/web/components/ComponentA.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameA/web/components/ComponentB.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameA/web/css/module.extend.css +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameA/web/js/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameA/web/module.config.js +0 -2
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameB/web/components/ComponentA.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameB/web/components/ComponentB.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameB/web/css/module.extend.css +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameB/web/js/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameB/web/module.config.js +0 -2
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameNoConfig/web/components/ComponentA.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameNoConfig/web/components/ComponentB.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameNoConfig/web/css/module.extend.css +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameNoConfig/web/js/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/Vendor_ModuleNameNoConfig/web/module.config.js +0 -2
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/web/components/ComponentA.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/web/components/ComponentB.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/web/css/theme.source.css +0 -6
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/web/js/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-a/web/theme.config.js +0 -5
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-b/web/css/theme.source.css +0 -6
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-b/web/theme.config.js +0 -5
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-c/Vendor_ModuleNameB/web/components/ComponentA.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-c/Vendor_ModuleNameB/web/components/ComponentB.vue +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-c/Vendor_ModuleNameB/web/css/module.extend.css +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-c/Vendor_ModuleNameB/web/js/main.js +0 -0
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-c/Vendor_ModuleNameB/web/module.config.js +0 -2
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-c/web/css/theme.source.css +0 -6
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-c/web/theme.config.js +0 -2
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-d/web/css/theme.source.css +0 -6
- package/src/__tests__/magento_scenarios/app/design/frontend/Vendor/theme-d/web/theme.config.js +0 -3
- package/src/__tests__/magento_scenarios/app/etc/mage_obsidian_frontend_modules_a.json +0 -53
- package/src/__tests__/magento_scenarios/app/etc/mage_obsidian_frontend_modules_b.json +0 -50
- package/src/__tests__/service/generateInterceptors.test.js +0 -196
- package/src/__tests__/service/inheritModuleResolver.test.js +0 -61
- package/src/__tests__/service/interceptorManager_magento_behavior.test.js +0 -137
- package/src/__tests__/service/moduleResolver.test.js +0 -194
- package/src/__tests__/service/themeResolverSync.test.js +0 -97
- package/src/__tests__/vite-plugins/interceptorsPlugin.test.js +0 -121
- package/src/config/default.js +0 -27
- package/src/scripts/buildThemes.js +0 -132
- package/src/service/configResolver.js +0 -63
- package/src/service/cssResolver.js +0 -73
- package/src/service/defaultNodeResolver.js +0 -16
- package/src/service/magentoHrmRewrite.js +0 -43
- package/src/service/moduleResolver.js +0 -178
- package/src/service/preCompileFiles.js +0 -37
- package/src/service/preCompileMagentoFiles.js +0 -16
- package/src/service/setupGlobals.js +0 -19
- package/src/service/themeResolverSync.js +0 -67
- package/src/utils/findComponents.js +0 -70
- /package/{src → dist}/templates/base_main_js_file.js +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework i18n core — Magento-parity phrase translation for the Vue/ESM side.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors Magento's `$t` / `$.mage.__`: a phrase is looked up in the dictionary
|
|
5
|
+
* (the per-locale `js-translation.json` Magento already generates during static
|
|
6
|
+
* deploy) and falls back to the original phrase when absent; then `%1`, `%2`, …
|
|
7
|
+
* placeholders are substituted positionally.
|
|
8
|
+
*
|
|
9
|
+
* Kept free of Vue and the DOM so it is unit-testable in isolation — the Vue
|
|
10
|
+
* plugin (shipped as a module web asset) wraps these primitives.
|
|
11
|
+
*/
|
|
12
|
+
export interface I18nConfig {
|
|
13
|
+
locale?: string;
|
|
14
|
+
dictionaryUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
interface I18nScope {
|
|
17
|
+
__MAGE_OBSIDIAN_I18N__?: I18nConfig;
|
|
18
|
+
}
|
|
19
|
+
export type Dictionary = Record<string, string>;
|
|
20
|
+
declare global {
|
|
21
|
+
interface Window {
|
|
22
|
+
__MAGE_OBSIDIAN_I18N__?: I18nConfig;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Replace `%1`, `%2`, … with positional args. An out-of-range placeholder is
|
|
27
|
+
* left untouched so a malformed phrase never throws or yields "undefined".
|
|
28
|
+
*/
|
|
29
|
+
export declare function interpolate(text: string, args?: unknown[]): string;
|
|
30
|
+
/**
|
|
31
|
+
* Translate a phrase against a dictionary, falling back to the phrase itself,
|
|
32
|
+
* then interpolate placeholders.
|
|
33
|
+
*/
|
|
34
|
+
export declare function translatePhrase(dictionary: Dictionary | null | undefined, phrase: string, args?: unknown[]): string;
|
|
35
|
+
/**
|
|
36
|
+
* Read the runtime i18n config published by PHP as `window.__MAGE_OBSIDIAN_I18N__`.
|
|
37
|
+
* Returns sane defaults when absent so the layer degrades to passthrough.
|
|
38
|
+
*/
|
|
39
|
+
export declare function readI18nConfig(scope?: I18nScope | undefined): {
|
|
40
|
+
locale: string;
|
|
41
|
+
dictionaryUrl: string | null;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Fetch and cache a dictionary by URL. The fetch happens at most once per URL
|
|
45
|
+
* regardless of how many Vue apps request it. Magento emits `[]` for an empty
|
|
46
|
+
* dictionary, which is normalized to `{}`; any failure degrades to `{}` so the
|
|
47
|
+
* UI keeps rendering original phrases.
|
|
48
|
+
*/
|
|
49
|
+
export declare function loadDictionary(url: string | null | undefined, fetchImpl?: typeof fetch | undefined): Promise<Dictionary>;
|
|
50
|
+
/**
|
|
51
|
+
* Test-only: clear the dictionary cache between cases.
|
|
52
|
+
*/
|
|
53
|
+
export declare function _resetDictionaryCache(): void;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=i18nCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nCore.d.ts","sourceRoot":"","sources":["../../src/runtime/i18nCore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,UAAU,SAAS;IACf,sBAAsB,CAAC,EAAE,UAAU,CAAC;CACvC;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAGhD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,sBAAsB,CAAC,EAAE,UAAU,CAAC;KACvC;CACJ;AAID;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,OAAO,EAAO,GAAG,MAAM,CAQtE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,EACzC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,OAAO,EAAO,GACrB,MAAM,CAIR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC1B,KAAK,GAAE,SAAS,GAAG,SAA8D,GAClF;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAMlD;AAID;;;;;GAKG;AACH,wBAAgB,cAAc,CAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC9B,SAAS,GAAE,OAAO,KAAK,GAAG,SAA4D,GACvF,OAAO,CAAC,UAAU,CAAC,CAoBrB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework i18n core — Magento-parity phrase translation for the Vue/ESM side.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors Magento's `$t` / `$.mage.__`: a phrase is looked up in the dictionary
|
|
5
|
+
* (the per-locale `js-translation.json` Magento already generates during static
|
|
6
|
+
* deploy) and falls back to the original phrase when absent; then `%1`, `%2`, …
|
|
7
|
+
* placeholders are substituted positionally.
|
|
8
|
+
*
|
|
9
|
+
* Kept free of Vue and the DOM so it is unit-testable in isolation — the Vue
|
|
10
|
+
* plugin (shipped as a module web asset) wraps these primitives.
|
|
11
|
+
*/
|
|
12
|
+
const PLACEHOLDER = /%(\d+)/g;
|
|
13
|
+
/**
|
|
14
|
+
* Replace `%1`, `%2`, … with positional args. An out-of-range placeholder is
|
|
15
|
+
* left untouched so a malformed phrase never throws or yields "undefined".
|
|
16
|
+
*/
|
|
17
|
+
export function interpolate(text, args = []) {
|
|
18
|
+
if (typeof text !== "string" || !args || args.length === 0) {
|
|
19
|
+
return text;
|
|
20
|
+
}
|
|
21
|
+
return text.replace(PLACEHOLDER, (match, index) => {
|
|
22
|
+
const value = args[Number(index) - 1];
|
|
23
|
+
return value === undefined ? match : String(value);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Translate a phrase against a dictionary, falling back to the phrase itself,
|
|
28
|
+
* then interpolate placeholders.
|
|
29
|
+
*/
|
|
30
|
+
export function translatePhrase(dictionary, phrase, args = []) {
|
|
31
|
+
const dict = dictionary && typeof dictionary === "object" ? dictionary : {};
|
|
32
|
+
const translated = Object.prototype.hasOwnProperty.call(dict, phrase) ? dict[phrase] : phrase;
|
|
33
|
+
return interpolate(translated, args);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Read the runtime i18n config published by PHP as `window.__MAGE_OBSIDIAN_I18N__`.
|
|
37
|
+
* Returns sane defaults when absent so the layer degrades to passthrough.
|
|
38
|
+
*/
|
|
39
|
+
export function readI18nConfig(scope = typeof window !== "undefined" ? window : undefined) {
|
|
40
|
+
const config = scope && scope.__MAGE_OBSIDIAN_I18N__;
|
|
41
|
+
return {
|
|
42
|
+
locale: (config && config.locale) || "en_US",
|
|
43
|
+
dictionaryUrl: (config && config.dictionaryUrl) || null,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const dictionaryCache = new Map();
|
|
47
|
+
/**
|
|
48
|
+
* Fetch and cache a dictionary by URL. The fetch happens at most once per URL
|
|
49
|
+
* regardless of how many Vue apps request it. Magento emits `[]` for an empty
|
|
50
|
+
* dictionary, which is normalized to `{}`; any failure degrades to `{}` so the
|
|
51
|
+
* UI keeps rendering original phrases.
|
|
52
|
+
*/
|
|
53
|
+
export function loadDictionary(url, fetchImpl = typeof fetch !== "undefined" ? fetch : undefined) {
|
|
54
|
+
if (!url) {
|
|
55
|
+
return Promise.resolve({});
|
|
56
|
+
}
|
|
57
|
+
if (!dictionaryCache.has(url)) {
|
|
58
|
+
if (typeof fetchImpl !== "function") {
|
|
59
|
+
return Promise.resolve({});
|
|
60
|
+
}
|
|
61
|
+
const promise = fetchImpl(url)
|
|
62
|
+
.then((res) => (res && res.ok ? res.json() : {}))
|
|
63
|
+
.then((data) => data && typeof data === "object" && !Array.isArray(data)
|
|
64
|
+
? data
|
|
65
|
+
: {})
|
|
66
|
+
.catch(() => ({}));
|
|
67
|
+
dictionaryCache.set(url, promise);
|
|
68
|
+
}
|
|
69
|
+
return dictionaryCache.get(url);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Test-only: clear the dictionary cache between cases.
|
|
73
|
+
*/
|
|
74
|
+
export function _resetDictionaryCache() {
|
|
75
|
+
dictionaryCache.clear();
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=i18nCore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nCore.js","sourceRoot":"","sources":["../../src/runtime/i18nCore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAoBH,MAAM,WAAW,GAAG,SAAS,CAAC;AAE9B;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,OAAkB,EAAE;IAC1D,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACtC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC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,EAAE,CAAC;YAClC,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC/B,CAAC;QACD,MAAM,OAAO,GAAwB,SAAS,CAAC,GAAG,CAAC;aAC9C,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aAChD,IAAI,CACD,CAAC,IAAa,EAAc,EAAE,CAC1B,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YACpD,CAAC,CAAE,IAAmB;YACtB,CAAC,CAAC,EAAE,CACf;aACA,KAAK,CAAC,GAAe,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACnC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,eAAe,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACjC,eAAe,CAAC,KAAK,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type InterceptorType = "before" | "around" | "after";
|
|
2
|
+
export type InterceptorHandler = (subject: any, ...rest: any[]) => any;
|
|
3
|
+
export interface InterceptorEntry {
|
|
4
|
+
name: string;
|
|
5
|
+
handler: InterceptorHandler;
|
|
6
|
+
sortOrder: number;
|
|
7
|
+
}
|
|
8
|
+
type InterceptorBuckets = Record<InterceptorType, InterceptorEntry[]>;
|
|
9
|
+
declare class InterceptorManager {
|
|
10
|
+
interceptors: Record<string, InterceptorBuckets>;
|
|
11
|
+
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* Register an interceptor. `target` is the function/method name to wrap;
|
|
14
|
+
* `name` is a unique id; `sortOrder` controls execution order.
|
|
15
|
+
*/
|
|
16
|
+
addInterceptor(target: string, name: string, type: InterceptorType, handler: InterceptorHandler, sortOrder?: number): void;
|
|
17
|
+
/**
|
|
18
|
+
* Execute the intercepted method chain synchronously.
|
|
19
|
+
*
|
|
20
|
+
* Handlers receive the intercepted module exports as an explicit `subject`
|
|
21
|
+
* first argument (Magento plugin parity): before(subject, ...args),
|
|
22
|
+
* around(subject, proceed, ...args), after(subject, result, ...args).
|
|
23
|
+
* `this` is still bound to the same object, so handlers written against the
|
|
24
|
+
* legacy `this`-based access keep working (arrow functions now have a path
|
|
25
|
+
* to the subject they could not reach via `this`).
|
|
26
|
+
*/
|
|
27
|
+
executeSync(target: string, originalMethod: (...args: any[]) => any, context: any, ...args: any[]): any;
|
|
28
|
+
/**
|
|
29
|
+
* Execute the intercepted method chain.
|
|
30
|
+
*
|
|
31
|
+
* Same `subject`-first contract as {@link executeSync}: before(subject,
|
|
32
|
+
* ...args), around(subject, proceed, ...args), after(subject, result,
|
|
33
|
+
* ...args), with `this` still bound to the subject for backward compat.
|
|
34
|
+
*/
|
|
35
|
+
execute(target: string, originalMethod: (...args: any[]) => any, context: any, ...args: any[]): Promise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* Create a proxy that intercepts method calls on an object (e.g. module
|
|
38
|
+
* exports). `namespace` scopes the interceptor keys; `useAsync` picks the
|
|
39
|
+
* async or sync chain.
|
|
40
|
+
*/
|
|
41
|
+
intercept(target: object, namespace: string, useAsync?: boolean): any;
|
|
42
|
+
}
|
|
43
|
+
declare const _default: InterceptorManager;
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=interceptorManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interceptorManager.d.ts","sourceRoot":"","sources":["../../src/runtime/interceptorManager.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAI5D,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,KAAK,kBAAkB,GAAG,MAAM,CAAC,eAAe,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAQtE,cAAM,kBAAkB;IAGZ,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;;IAMzD;;;OAGG;IACH,cAAc,CACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,kBAAkB,EAC3B,SAAS,GAAE,MAAW;IAY1B;;;;;;;;;OASG;IACH,WAAW,CACP,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACvC,OAAO,EAAE,GAAG,EACZ,GAAG,IAAI,EAAE,GAAG,EAAE,GACf,GAAG;IAoCN;;;;;;OAMG;IACG,OAAO,CACT,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACvC,OAAO,EAAE,GAAG,EACZ,GAAG,IAAI,EAAE,GAAG,EAAE,GACf,OAAO,CAAC,GAAG,CAAC;IA6Cf;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAc;CAoBxE;;AAED,wBAAwC"}
|
|
@@ -1,137 +1,128 @@
|
|
|
1
|
+
const TYPES = ["before", "around", "after"];
|
|
2
|
+
function emptyBuckets() {
|
|
3
|
+
return { before: [], around: [], after: [] };
|
|
4
|
+
}
|
|
1
5
|
class InterceptorManager {
|
|
2
6
|
constructor() {
|
|
3
7
|
this.interceptors = {};
|
|
4
8
|
}
|
|
5
|
-
|
|
6
9
|
/**
|
|
7
|
-
* Register an interceptor
|
|
8
|
-
*
|
|
9
|
-
* @param {string} name - Unique name for the interceptor
|
|
10
|
-
* @param {string} type - 'before', 'around', 'after'
|
|
11
|
-
* @param {Function} handler - The function to execute
|
|
12
|
-
* @param {number} sortOrder - Order of execution
|
|
10
|
+
* Register an interceptor. `target` is the function/method name to wrap;
|
|
11
|
+
* `name` is a unique id; `sortOrder` controls execution order.
|
|
13
12
|
*/
|
|
14
13
|
addInterceptor(target, name, type, handler, sortOrder = 10) {
|
|
15
14
|
if (!this.interceptors[target]) {
|
|
16
|
-
this.interceptors[target] =
|
|
15
|
+
this.interceptors[target] = emptyBuckets();
|
|
17
16
|
}
|
|
18
|
-
if (!
|
|
17
|
+
if (!TYPES.includes(type)) {
|
|
19
18
|
throw new Error(`Invalid interceptor type: ${type}`);
|
|
20
19
|
}
|
|
21
20
|
this.interceptors[target][type].push({ name, handler, sortOrder });
|
|
22
21
|
this.interceptors[target][type].sort((a, b) => a.sortOrder - b.sortOrder);
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
/**
|
|
26
|
-
* Execute the intercepted method chain synchronously
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
24
|
+
* Execute the intercepted method chain synchronously.
|
|
25
|
+
*
|
|
26
|
+
* Handlers receive the intercepted module exports as an explicit `subject`
|
|
27
|
+
* first argument (Magento plugin parity): before(subject, ...args),
|
|
28
|
+
* around(subject, proceed, ...args), after(subject, result, ...args).
|
|
29
|
+
* `this` is still bound to the same object, so handlers written against the
|
|
30
|
+
* legacy `this`-based access keep working (arrow functions now have a path
|
|
31
|
+
* to the subject they could not reach via `this`).
|
|
31
32
|
*/
|
|
32
33
|
executeSync(target, originalMethod, context, ...args) {
|
|
33
|
-
const interceptors = this.interceptors[target] ||
|
|
34
|
-
|
|
34
|
+
const interceptors = this.interceptors[target] || emptyBuckets();
|
|
35
35
|
// Execute 'before' interceptors
|
|
36
36
|
for (const interceptor of interceptors.before) {
|
|
37
|
-
const result = interceptor.handler.apply(context, args);
|
|
37
|
+
const result = interceptor.handler.apply(context, [context, ...args]);
|
|
38
38
|
if (Array.isArray(result)) {
|
|
39
39
|
args = result;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
43
42
|
// Execute 'around' interceptors
|
|
44
43
|
let methodToExecute = (...currentArgs) => {
|
|
45
44
|
return originalMethod.apply(context, currentArgs);
|
|
46
45
|
};
|
|
47
|
-
|
|
48
46
|
if (interceptors.around.length > 0) {
|
|
49
47
|
const aroundInterceptors = [...interceptors.around].reverse();
|
|
50
48
|
for (const interceptor of aroundInterceptors) {
|
|
51
49
|
const next = methodToExecute;
|
|
52
50
|
methodToExecute = (...currentArgs) => {
|
|
53
|
-
return interceptor.handler.apply(context, [next, ...currentArgs]);
|
|
51
|
+
return interceptor.handler.apply(context, [context, next, ...currentArgs]);
|
|
54
52
|
};
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
|
-
|
|
58
55
|
let result = methodToExecute(...args);
|
|
59
|
-
|
|
60
56
|
// Execute 'after' interceptors
|
|
61
57
|
for (const interceptor of interceptors.after) {
|
|
62
|
-
result = interceptor.handler.apply(context, [result, ...args]);
|
|
58
|
+
result = interceptor.handler.apply(context, [context, result, ...args]);
|
|
63
59
|
}
|
|
64
|
-
|
|
65
60
|
return result;
|
|
66
61
|
}
|
|
67
|
-
|
|
68
62
|
/**
|
|
69
|
-
* Execute the intercepted method chain
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
63
|
+
* Execute the intercepted method chain.
|
|
64
|
+
*
|
|
65
|
+
* Same `subject`-first contract as {@link executeSync}: before(subject,
|
|
66
|
+
* ...args), around(subject, proceed, ...args), after(subject, result,
|
|
67
|
+
* ...args), with `this` still bound to the subject for backward compat.
|
|
74
68
|
*/
|
|
75
69
|
async execute(target, originalMethod, context, ...args) {
|
|
76
|
-
const interceptors = this.interceptors[target] ||
|
|
77
|
-
|
|
70
|
+
const interceptors = this.interceptors[target] || emptyBuckets();
|
|
78
71
|
// Execute 'before' interceptors
|
|
79
|
-
// Before interceptors can modify args by
|
|
72
|
+
// Before interceptors receive (subject, ...args) and can modify args by
|
|
73
|
+
// returning an array of the (subject-less) args.
|
|
80
74
|
for (const interceptor of interceptors.before) {
|
|
81
|
-
const result = await interceptor.handler.apply(context, args);
|
|
75
|
+
const result = await interceptor.handler.apply(context, [context, ...args]);
|
|
82
76
|
if (Array.isArray(result)) {
|
|
83
77
|
args = result;
|
|
84
78
|
}
|
|
85
79
|
}
|
|
86
|
-
|
|
87
80
|
// Execute 'around' interceptors
|
|
88
|
-
// Around interceptors receive (proceed, ...args)
|
|
81
|
+
// Around interceptors receive (subject, proceed, ...args)
|
|
89
82
|
let methodToExecute = async (...currentArgs) => {
|
|
90
83
|
return await originalMethod.apply(context, currentArgs);
|
|
91
84
|
};
|
|
92
|
-
|
|
93
85
|
// Wrap around interceptors: first registered is outer-most
|
|
94
86
|
if (interceptors.around.length > 0) {
|
|
95
87
|
const aroundInterceptors = [...interceptors.around].reverse();
|
|
96
88
|
for (const interceptor of aroundInterceptors) {
|
|
97
89
|
const next = methodToExecute;
|
|
98
90
|
methodToExecute = async (...currentArgs) => {
|
|
99
|
-
return await interceptor.handler.apply(context, [
|
|
91
|
+
return await interceptor.handler.apply(context, [
|
|
92
|
+
context,
|
|
93
|
+
next,
|
|
94
|
+
...currentArgs,
|
|
95
|
+
]);
|
|
100
96
|
};
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
|
-
|
|
104
99
|
let result = await methodToExecute(...args);
|
|
105
|
-
|
|
106
100
|
// Execute 'after' interceptors
|
|
107
|
-
// After interceptors receive (result, ...args) and must return result
|
|
101
|
+
// After interceptors receive (subject, result, ...args) and must return result
|
|
108
102
|
for (const interceptor of interceptors.after) {
|
|
109
|
-
result = await interceptor.handler.apply(context, [result, ...args]);
|
|
103
|
+
result = await interceptor.handler.apply(context, [context, result, ...args]);
|
|
110
104
|
}
|
|
111
|
-
|
|
112
105
|
return result;
|
|
113
106
|
}
|
|
114
|
-
|
|
115
107
|
/**
|
|
116
|
-
* Create a proxy
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* @param {boolean} useAsync - Whether to use async execution
|
|
108
|
+
* Create a proxy that intercepts method calls on an object (e.g. module
|
|
109
|
+
* exports). `namespace` scopes the interceptor keys; `useAsync` picks the
|
|
110
|
+
* async or sync chain.
|
|
120
111
|
*/
|
|
121
112
|
intercept(target, namespace, useAsync = true) {
|
|
122
113
|
return new Proxy(target, {
|
|
123
114
|
get: (obj, prop) => {
|
|
124
115
|
const value = obj[prop];
|
|
125
|
-
if (typeof value ===
|
|
116
|
+
if (typeof value === "function") {
|
|
126
117
|
return (...args) => {
|
|
127
118
|
const method = useAsync ? this.execute : this.executeSync;
|
|
128
119
|
return method.call(this, `${namespace}::${String(prop)}`, value, obj, ...args);
|
|
129
120
|
};
|
|
130
121
|
}
|
|
131
122
|
return value;
|
|
132
|
-
}
|
|
123
|
+
},
|
|
133
124
|
});
|
|
134
125
|
}
|
|
135
126
|
}
|
|
136
|
-
|
|
137
127
|
export default new InterceptorManager();
|
|
128
|
+
//# sourceMappingURL=interceptorManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interceptorManager.js","sourceRoot":"","sources":["../../src/runtime/interceptorManager.ts"],"names":[],"mappings":"AAcA,MAAM,KAAK,GAA+B,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAExE,SAAS,YAAY;IACjB,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,kBAAkB;IAKpB;QACI,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,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AAO,IAAI,KAAK,CAAC,MAAM,EAAE;YACrB,GAAG,EAAE,CAAC,GAAQ,EAAE,IAAI,EAAE,EAAE;gBACpB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;gBACxB,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;oBAC9B,OAAO,CAAC,GAAG,IAAW,EAAE,EAAE;wBACtB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;wBAC1D,OAAO,MAAM,CAAC,IAAI,CACd,IAAI,EACJ,GAAG,SAAS,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE,EAC/B,KAAK,EACL,GAAG,EACH,GAAG,IAAI,CACV,CAAC;oBACN,CAAC,CAAC;gBACN,CAAC;gBACD,OAAO,KAAK,CAAC;YACjB,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;CACJ;AAED,eAAe,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework island runtime — the browser side of `renderVueComponent`.
|
|
3
|
+
*
|
|
4
|
+
* PHP emits an inert marker per component
|
|
5
|
+
* (`<div data-mage-island data-component data-props data-strategy>`); this
|
|
6
|
+
* module turns each marker into a mounted Vue app. Every island is its own app
|
|
7
|
+
* (preserving isolation), but the Vue runtime and the i18n plugin are loaded
|
|
8
|
+
* once per page and shared, and "visible" islands hydrate only when they enter
|
|
9
|
+
* the viewport — so below-the-fold components cost nothing until scrolled to.
|
|
10
|
+
*
|
|
11
|
+
* All side effects (dynamic import, app creation, plugin wiring, viewport
|
|
12
|
+
* observation) are injected, so the discovery/hydration logic is unit-testable
|
|
13
|
+
* in Node without a DOM, a bundler, or Vue. The concrete wiring lives in the
|
|
14
|
+
* module's `web/js/islands.js`.
|
|
15
|
+
*/
|
|
16
|
+
interface IslandElement {
|
|
17
|
+
dataset: Record<string, string | undefined>;
|
|
18
|
+
}
|
|
19
|
+
interface AppLike {
|
|
20
|
+
mount(el: unknown): unknown;
|
|
21
|
+
}
|
|
22
|
+
interface HydrateDeps {
|
|
23
|
+
importComponent(source: string): Promise<{
|
|
24
|
+
default?: unknown;
|
|
25
|
+
}>;
|
|
26
|
+
createApp(component: unknown, props?: Record<string, unknown>): AppLike;
|
|
27
|
+
configureApp(app: AppLike): void;
|
|
28
|
+
}
|
|
29
|
+
interface DiscoverDeps extends HydrateDeps {
|
|
30
|
+
observe(element: IslandElement, onVisible: () => void): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Mount a single island. Idempotent: the first call claims the element and
|
|
34
|
+
* later calls return immediately, so re-observation never double-mounts.
|
|
35
|
+
*
|
|
36
|
+
* @throws Error When the marker has no `data-component`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function hydrateIsland(element: IslandElement, deps: HydrateDeps): Promise<AppLike | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Hydrate every marker. `eager` markers mount now; the rest mount when the
|
|
41
|
+
* injected observer reports them visible.
|
|
42
|
+
*/
|
|
43
|
+
export declare function hydrateAll(elements: Iterable<IslandElement>, deps: DiscoverDeps): void;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=islands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"islands.d.ts","sourceRoot":"","sources":["../../src/runtime/islands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,UAAU,aAAa;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC/C;AAED,UAAU,OAAO;IACb,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC;CAC/B;AAED,UAAU,WAAW;IACjB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAChE,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IACxE,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;CACpC;AAED,UAAU,YAAa,SAAQ,WAAW;IACtC,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAChE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAC/B,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,WAAW,GAClB,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAmB9B;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAWtF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework island runtime — the browser side of `renderVueComponent`.
|
|
3
|
+
*
|
|
4
|
+
* PHP emits an inert marker per component
|
|
5
|
+
* (`<div data-mage-island data-component data-props data-strategy>`); this
|
|
6
|
+
* module turns each marker into a mounted Vue app. Every island is its own app
|
|
7
|
+
* (preserving isolation), but the Vue runtime and the i18n plugin are loaded
|
|
8
|
+
* once per page and shared, and "visible" islands hydrate only when they enter
|
|
9
|
+
* the viewport — so below-the-fold components cost nothing until scrolled to.
|
|
10
|
+
*
|
|
11
|
+
* All side effects (dynamic import, app creation, plugin wiring, viewport
|
|
12
|
+
* observation) are injected, so the discovery/hydration logic is unit-testable
|
|
13
|
+
* in Node without a DOM, a bundler, or Vue. The concrete wiring lives in the
|
|
14
|
+
* module's `web/js/islands.js`.
|
|
15
|
+
*/
|
|
16
|
+
// Set synchronously before the async import so a second observer callback for
|
|
17
|
+
// the same element is a no-op (dataset key for `data-mage-island-mounted`).
|
|
18
|
+
const MOUNTED_FLAG = "mageIslandMounted";
|
|
19
|
+
/**
|
|
20
|
+
* Mount a single island. Idempotent: the first call claims the element and
|
|
21
|
+
* later calls return immediately, so re-observation never double-mounts.
|
|
22
|
+
*
|
|
23
|
+
* @throws Error When the marker has no `data-component`.
|
|
24
|
+
*/
|
|
25
|
+
export async function hydrateIsland(element, deps) {
|
|
26
|
+
if (element.dataset[MOUNTED_FLAG]) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
element.dataset[MOUNTED_FLAG] = "1";
|
|
30
|
+
const source = element.dataset.component;
|
|
31
|
+
if (!source) {
|
|
32
|
+
throw new Error("Island marker is missing data-component.");
|
|
33
|
+
}
|
|
34
|
+
const module = await deps.importComponent(source);
|
|
35
|
+
const component = module.default ?? module;
|
|
36
|
+
const props = element.dataset.props ? JSON.parse(element.dataset.props) : {};
|
|
37
|
+
const app = deps.createApp(component, props);
|
|
38
|
+
deps.configureApp(app);
|
|
39
|
+
app.mount(element);
|
|
40
|
+
return app;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Hydrate every marker. `eager` markers mount now; the rest mount when the
|
|
44
|
+
* injected observer reports them visible.
|
|
45
|
+
*/
|
|
46
|
+
export function hydrateAll(elements, deps) {
|
|
47
|
+
for (const element of elements) {
|
|
48
|
+
const strategy = element.dataset.strategy ?? "visible";
|
|
49
|
+
if (strategy === "eager") {
|
|
50
|
+
void hydrateIsland(element, deps);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
deps.observe(element, () => {
|
|
54
|
+
void hydrateIsland(element, deps);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=islands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"islands.js","sourceRoot":"","sources":["../../src/runtime/islands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,4EAA4E;AAC5E,MAAM,YAAY,G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;YACJ,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE;gBACvB,KAAK,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACP,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section store core — pure helpers for mirroring a set of server-pushed,
|
|
3
|
+
* versioned "sections" into a reactive store backed by localStorage.
|
|
4
|
+
*
|
|
5
|
+
* This is the GENERIC mechanism, deliberately domain-agnostic: it knows how to
|
|
6
|
+
* parse/merge/select sections, decide staleness, read a version cookie and
|
|
7
|
+
* decide when to hydrate — but nothing about WHICH endpoint, cookie or storage
|
|
8
|
+
* key a given integration uses. A binding (e.g. the Magento customer-data
|
|
9
|
+
* adapter) supplies those and wraps these primitives with Vue/Pinia reactivity.
|
|
10
|
+
*
|
|
11
|
+
* Kept free of Vue, Pinia and the DOM so the parsing/merge/staleness rules are
|
|
12
|
+
* unit-testable in isolation.
|
|
13
|
+
*/
|
|
14
|
+
export type SectionData = Record<string, unknown>;
|
|
15
|
+
export type SectionMap = Record<string, SectionData>;
|
|
16
|
+
export interface SectionLoadOptions {
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
forceNewTimestamp?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface SectionRuntimeConfig {
|
|
21
|
+
lifetimeSeconds: number;
|
|
22
|
+
expirableSections: string[];
|
|
23
|
+
}
|
|
24
|
+
interface SectionRuntimeScope {
|
|
25
|
+
__MAGE_OBSIDIAN_SECTIONS__?: {
|
|
26
|
+
lifetime?: unknown;
|
|
27
|
+
expirable?: unknown;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface Window {
|
|
32
|
+
__MAGE_OBSIDIAN_SECTIONS__?: {
|
|
33
|
+
lifetime?: unknown;
|
|
34
|
+
expirable?: unknown;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse the raw section-storage JSON into a map of section objects. Tolerates
|
|
40
|
+
* missing/corrupt input and drops non-object section values so the caller
|
|
41
|
+
* always gets a clean `{ [section]: object }` map.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseSectionStorage(raw: string | null | undefined): SectionMap;
|
|
44
|
+
/**
|
|
45
|
+
* Return a single section, or null when it is absent or not an object.
|
|
46
|
+
*/
|
|
47
|
+
export declare function selectSection(sections: SectionMap | null | undefined, name: string): SectionData | null;
|
|
48
|
+
/**
|
|
49
|
+
* Overlay freshly loaded sections onto the current map (a section-load response
|
|
50
|
+
* merges per section; non-object values are ignored).
|
|
51
|
+
*/
|
|
52
|
+
export declare function mergeSections(current: SectionMap | null | undefined, incoming: SectionMap | null | undefined): SectionMap;
|
|
53
|
+
/**
|
|
54
|
+
* Whether a section should be (re)fetched. A missing section is stale; a
|
|
55
|
+
* section without a positive `data_id` is a client-side section that never
|
|
56
|
+
* expires; with no positive lifetime nothing expires either. Otherwise it is
|
|
57
|
+
* stale once `data_id + lifetime` has passed.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isSectionStale(section: SectionData | null | undefined, lifetimeSeconds: number, nowSeconds: number): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Build the section-load URL a binding uses to (re)load sections. `endpoint` is
|
|
62
|
+
* supplied by the binding (this core is endpoint-agnostic). An empty name list
|
|
63
|
+
* requests ALL sections by omitting the `sections` param — Magento's protocol
|
|
64
|
+
* returns every section then and rejects a literal `sections=*` with 400.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildSectionLoadUrl(endpoint: string, sectionNames: string[], options?: SectionLoadOptions): string;
|
|
67
|
+
/**
|
|
68
|
+
* Read a single cookie value from a `document.cookie` string. Returns "" when
|
|
69
|
+
* the cookie is absent. Kept pure (the binding passes `document.cookie` in) so
|
|
70
|
+
* the version lookup is testable without a DOM.
|
|
71
|
+
*/
|
|
72
|
+
export declare function readCookie(cookieString: string | null | undefined, name: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the store must hydrate sections from the server on init.
|
|
75
|
+
*
|
|
76
|
+
* A binding bumps a version (e.g. Magento's `private_content_version` cookie)
|
|
77
|
+
* whenever the server's pushed content changes. When nothing is cached yet, or
|
|
78
|
+
* the current version has moved past the last synced version, the cached
|
|
79
|
+
* sections are stale.
|
|
80
|
+
*/
|
|
81
|
+
export declare function needsHydration(sections: SectionMap | null | undefined, syncedVersion: string, currentVersion: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* True when the session marker cookie is gone. Magento's login/logout controllers
|
|
84
|
+
* delete it server-side, so its absence means cached sections are stale (the
|
|
85
|
+
* version cookie doesn't move on logout). False when no marker is configured.
|
|
86
|
+
*/
|
|
87
|
+
export declare function sessionInvalidated(cookieString: string | null | undefined, sessionCookieName: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The expirable sections that have aged out and must be re-fetched, mirroring the
|
|
90
|
+
* lifetime branch of Magento's native `getExpiredSectionNames`: a section listed
|
|
91
|
+
* in `expirableNames` expires once `data_id + lifetimeSeconds <= now`.
|
|
92
|
+
*
|
|
93
|
+
* This is the backstop the version cookie cannot provide: `private_content_version`
|
|
94
|
+
* only moves on POST, so a section whose server data changed through a non-POST
|
|
95
|
+
* path the browser took — most commonly the PHP session/quote expiring while
|
|
96
|
+
* localStorage lives on — is otherwise never re-fetched, leaving a stale snapshot
|
|
97
|
+
* (e.g. a cart badge that outlives its quote). Absent sections are skipped here,
|
|
98
|
+
* exactly like native (they reload via the version/empty-cache path instead).
|
|
99
|
+
*/
|
|
100
|
+
export declare function expiredSectionNames(sections: SectionMap | null | undefined, lifetimeSeconds: number, expirableNames: string[], nowSeconds: number): string[];
|
|
101
|
+
/**
|
|
102
|
+
* Read the runtime section config a binding's host page publishes (lifetime +
|
|
103
|
+
* which sections expire by lifetime). Kept pure — the binding passes the scope
|
|
104
|
+
* (e.g. `window`) — so it is testable without a DOM, like `readI18nConfig`.
|
|
105
|
+
*/
|
|
106
|
+
export declare function readSectionRuntimeConfig(scope?: SectionRuntimeScope | undefined): SectionRuntimeConfig;
|
|
107
|
+
export {};
|
|
108
|
+
//# sourceMappingURL=sectionStoreCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sectionStoreCore.d.ts","sourceRoot":"","sources":["../../src/runtime/sectionStoreCore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAClD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAErD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,UAAU,mBAAmB;IACzB,0BAA0B,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC5E;AAGD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,0BAA0B,CAAC,EAAE;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;YAAC,SAAS,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC;KAC5E;CACJ;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAa9E;AAED;;GAEG;AACH,wBAAgB,aAAa,CACzB,QAAQ,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,EACvC,IAAI,EAAE,MAAM,GACb,WAAW,GAAG,IAAI,CAQpB;AAED;;;GAGG;AACH,wBAAgB,aAAa,C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