From bce557cc2dc767628bed6aac87301a1be7c5431b Mon Sep 17 00:00:00 2001 From: rxliuli Date: Tue, 4 Nov 2025 05:03:50 +0800 Subject: init commit --- .../dependencies/locale/locale-from-bag.js | 41 ++++++++++++++++++++++ .../src/foundation/dependencies/locale/locale.js | 3 ++ 2 files changed, 44 insertions(+) create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js (limited to 'node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale') diff --git a/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js b/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js new file mode 100644 index 0000000..7790008 --- /dev/null +++ b/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js @@ -0,0 +1,41 @@ +export class LocaleFromBag { + constructor(objectGraph) { + this.objectGraph = objectGraph; + } + /** + * The current {@link NormalizedStorefront | storefront} for the client + * + * This reads directly from the `Bag`, as that is the source of truth + * for locale information in the "native" clients + */ + get activeStorefront() { + // The type-cast here reflects the implicit assumption that any values + // belonging to the `Bag` have already been normalized + return this.objectGraph.bag.mediaCountryCode; + } + /** + * The current {@link NormalizedLanguage | language} for the client + * + * This reads directly from the `Bag`, as that is the source of truth + * for locale information in the "native" clients + */ + get activeLanguage() { + // The type-cast here reflects the implicit assumption that any values + // belonging to the `Bag` have already been normalized + return this.objectGraph.bag.language; + } + setActiveLocale(_locale) { + // Intentional no-op; "native" clients that use the `Bag` as the source + // of "locale" information do not allow for mutation of the "locale" + } + normalize(_unnormalizedLocale) { + return { + storefront: this.activeStorefront, + language: this.activeLanguage, + }; + } + deriveLocaleForUrl(locale) { + return locale; + } +} +//# sourceMappingURL=locale-from-bag.js.map \ No newline at end of file diff --git a/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js b/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js new file mode 100644 index 0000000..d00bacc --- /dev/null +++ b/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js @@ -0,0 +1,3 @@ +import { makeMetatype } from "@jet/environment/util/metatype"; +export const LocaleMetaType = makeMetatype("app-store:locale"); +//# sourceMappingURL=locale.js.map \ No newline at end of file -- cgit v1.2.3