@saasicat/ui-vue 0.15.0 → 0.16.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/README.md CHANGED
@@ -92,8 +92,10 @@ createSuperAdminApp({
92
92
  });
93
93
  ```
94
94
 
95
- Pass a `Ref<SaLocale>` instead of a literal to switch at runtime, and
96
- `i18n.overrides` to replace individual strings per locale. Components read the
95
+ Users switch languages themselves through the shell's `LocaleSwitcher` (header
96
+ and login page); the pick is remembered. `i18n.switcher: false` removes it for a
97
+ single-language deployment, a `Ref<SaLocale>` hands the value to the app, and
98
+ `i18n.overrides` replaces individual strings per locale. Components read the
97
99
  catalog via `useSaMessages('<namespace>')` / `useSuperAdminI18n()`.
98
100
  See [handbook §8.6](https://github.com/uelker70/saasicat/blob/main/docs/handbook.md#86-ui-language-i18n).
99
101
 
@@ -3,7 +3,7 @@ import {
3
3
  defaultHttpClient,
4
4
  defaultKvStore,
5
5
  navMessages
6
- } from "./chunk-TBLXKSTR.js";
6
+ } from "./chunk-TZ2NGQXK.js";
7
7
 
8
8
  // src/client/version.ts
9
9
  var ADMIN_UI_VERSION = "1.2.0";
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  DEFAULT_SA_LOCALE,
3
3
  SA_INTL_LOCALES,
4
+ defaultKvStore,
5
+ isSaLocale,
4
6
  resolveMessages
5
- } from "./chunk-TBLXKSTR.js";
7
+ } from "./chunk-TZ2NGQXK.js";
6
8
 
7
9
  // src/vue/super-admin-context.ts
8
10
  var SUPER_ADMIN_BRAND_KEY = /* @__PURE__ */ Symbol.for(
@@ -57,23 +59,47 @@ var SUPER_ADMIN_NOTIFY_KEY = /* @__PURE__ */ Symbol.for(
57
59
  );
58
60
 
59
61
  // src/vue/use-super-admin-i18n.ts
60
- import { computed, inject, isRef, ref } from "vue";
62
+ import {
63
+ computed,
64
+ inject,
65
+ isReadonly,
66
+ isRef,
67
+ ref,
68
+ watch
69
+ } from "vue";
70
+ var SA_LOCALE_STORAGE_KEY = "sa:locale";
61
71
  var SUPER_ADMIN_I18N_KEY = /* @__PURE__ */ Symbol.for(
62
72
  "@saasicat/ui-vue/SUPER_ADMIN_I18N"
63
73
  );
64
74
  function createSuperAdminI18n(options = {}) {
65
- const locale = isRef(options.locale) ? options.locale : ref(options.locale ?? DEFAULT_SA_LOCALE);
75
+ const locale = isRef(options.locale) ? options.locale : createOwnedLocale(options);
66
76
  const messages = computed(
67
77
  () => resolveMessages(locale.value, options.overrides?.[locale.value])
68
78
  );
69
79
  const intlLocale = computed(() => SA_INTL_LOCALES[locale.value]);
70
- return { locale, messages, intlLocale };
80
+ const writable = !isReadonly(locale);
81
+ return {
82
+ locale,
83
+ messages,
84
+ intlLocale,
85
+ switcherEnabled: (options.switcher ?? true) && writable
86
+ };
87
+ }
88
+ function createOwnedLocale(options) {
89
+ if (options.persist === false) {
90
+ return ref(options.locale ?? DEFAULT_SA_LOCALE);
91
+ }
92
+ const storage = options.storage ?? defaultKvStore();
93
+ const stored = storage.get(SA_LOCALE_STORAGE_KEY);
94
+ const locale = ref(isSaLocale(stored) ? stored : options.locale ?? DEFAULT_SA_LOCALE);
95
+ watch(locale, (next) => storage.set(SA_LOCALE_STORAGE_KEY, next));
96
+ return locale;
71
97
  }
72
98
  var fallbackI18n = null;
73
99
  function useSuperAdminI18n() {
74
100
  const injected = inject(SUPER_ADMIN_I18N_KEY, null);
75
101
  if (injected) return injected;
76
- fallbackI18n ??= createSuperAdminI18n();
102
+ fallbackI18n ??= createSuperAdminI18n({ persist: false });
77
103
  return fallbackI18n;
78
104
  }
79
105
  function useSaMessages(namespace) {
@@ -91,6 +117,7 @@ export {
91
117
  SUPER_ADMIN_HTTP_KEY,
92
118
  buildNavigationGuard,
93
119
  SUPER_ADMIN_NOTIFY_KEY,
120
+ SA_LOCALE_STORAGE_KEY,
94
121
  SUPER_ADMIN_I18N_KEY,
95
122
  createSuperAdminI18n,
96
123
  useSuperAdminI18n,
@@ -1,21 +1,43 @@
1
1
  // src/client/types.ts
2
- function defaultKvStore() {
3
- if (typeof globalThis.localStorage === "undefined") {
4
- return {
5
- get: () => null,
6
- set: () => {
7
- },
8
- remove: () => {
9
- }
10
- };
2
+ var NOOP_KV_STORE = {
3
+ get: () => null,
4
+ set: () => {
5
+ },
6
+ remove: () => {
11
7
  }
12
- const ls = globalThis.localStorage;
8
+ };
9
+ function defaultKvStore() {
10
+ const ls = resolveLocalStorage();
11
+ if (!ls) return NOOP_KV_STORE;
13
12
  return {
14
- get: (k) => ls.getItem(k),
15
- set: (k, v) => ls.setItem(k, v),
16
- remove: (k) => ls.removeItem(k)
13
+ get: (k) => {
14
+ try {
15
+ return ls.getItem(k);
16
+ } catch {
17
+ return null;
18
+ }
19
+ },
20
+ set: (k, v) => {
21
+ try {
22
+ ls.setItem(k, v);
23
+ } catch {
24
+ }
25
+ },
26
+ remove: (k) => {
27
+ try {
28
+ ls.removeItem(k);
29
+ } catch {
30
+ }
31
+ }
17
32
  };
18
33
  }
34
+ function resolveLocalStorage() {
35
+ try {
36
+ return globalThis.localStorage ?? null;
37
+ } catch {
38
+ return null;
39
+ }
40
+ }
19
41
  function defaultHttpClient() {
20
42
  return (url, init) => fetch(url, init);
21
43
  }
@@ -27,6 +49,13 @@ var SA_INTL_LOCALES = {
27
49
  de: "de-DE",
28
50
  en: "en-US"
29
51
  };
52
+ var SA_LOCALE_LABELS = {
53
+ de: "Deutsch",
54
+ en: "English"
55
+ };
56
+ function isSaLocale(value) {
57
+ return typeof value === "string" && SA_LOCALES.includes(value);
58
+ }
30
59
 
31
60
  // src/client/i18n/define.ts
32
61
  function defineMessages(de, en) {
@@ -2737,7 +2766,8 @@ var shellMessages = defineMessages(
2737
2766
  productionWarning: "Aktionen wirken sich sofort auf alle Mandanten aus.",
2738
2767
  subtitle: "SuperAdmin \xB7 Plattform-Verwaltung",
2739
2768
  roleBadge: "SUPER ADMIN",
2740
- logout: "Abmelden"
2769
+ logout: "Abmelden",
2770
+ language: "Sprache"
2741
2771
  },
2742
2772
  drawer: {
2743
2773
  docs: "Doku \xF6ffnen"
@@ -2805,7 +2835,8 @@ var shellMessages = defineMessages(
2805
2835
  productionWarning: "Actions take effect immediately for all tenants.",
2806
2836
  subtitle: "SuperAdmin \xB7 Platform administration",
2807
2837
  roleBadge: "SUPER ADMIN",
2808
- logout: "Sign out"
2838
+ logout: "Sign out",
2839
+ language: "Language"
2809
2840
  },
2810
2841
  drawer: {
2811
2842
  docs: "Open documentation"
@@ -3084,6 +3115,8 @@ export {
3084
3115
  SA_LOCALES,
3085
3116
  DEFAULT_SA_LOCALE,
3086
3117
  SA_INTL_LOCALES,
3118
+ SA_LOCALE_LABELS,
3119
+ isSaLocale,
3087
3120
  defineMessages,
3088
3121
  mergeMessages,
3089
3122
  navMessages,
@@ -35,6 +35,7 @@ __export(client_exports, {
35
35
  MissingHandlerError: () => MissingHandlerError,
36
36
  SA_INTL_LOCALES: () => SA_INTL_LOCALES,
37
37
  SA_LOCALES: () => SA_LOCALES,
38
+ SA_LOCALE_LABELS: () => SA_LOCALE_LABELS,
38
39
  SA_MESSAGES: () => SA_MESSAGES,
39
40
  buildRoutes: () => buildRoutes,
40
41
  buildSidebar: () => buildSidebar,
@@ -46,6 +47,7 @@ __export(client_exports, {
46
47
  formatCurrency: () => formatCurrency,
47
48
  formatMessage: () => formatMessage,
48
49
  getJson: () => getJson,
50
+ isSaLocale: () => isSaLocale,
49
51
  mergeMessages: () => mergeMessages,
50
52
  postJson: () => postJson,
51
53
  resolveExtension: () => resolveExtension,
@@ -58,23 +60,45 @@ module.exports = __toCommonJS(client_exports);
58
60
  var ADMIN_UI_VERSION = "1.2.0";
59
61
 
60
62
  // src/client/types.ts
61
- function defaultKvStore() {
62
- if (typeof globalThis.localStorage === "undefined") {
63
- return {
64
- get: () => null,
65
- set: () => {
66
- },
67
- remove: () => {
68
- }
69
- };
63
+ var NOOP_KV_STORE = {
64
+ get: () => null,
65
+ set: () => {
66
+ },
67
+ remove: () => {
70
68
  }
71
- const ls = globalThis.localStorage;
69
+ };
70
+ function defaultKvStore() {
71
+ const ls = resolveLocalStorage();
72
+ if (!ls) return NOOP_KV_STORE;
72
73
  return {
73
- get: (k) => ls.getItem(k),
74
- set: (k, v) => ls.setItem(k, v),
75
- remove: (k) => ls.removeItem(k)
74
+ get: (k) => {
75
+ try {
76
+ return ls.getItem(k);
77
+ } catch {
78
+ return null;
79
+ }
80
+ },
81
+ set: (k, v) => {
82
+ try {
83
+ ls.setItem(k, v);
84
+ } catch {
85
+ }
86
+ },
87
+ remove: (k) => {
88
+ try {
89
+ ls.removeItem(k);
90
+ } catch {
91
+ }
92
+ }
76
93
  };
77
94
  }
95
+ function resolveLocalStorage() {
96
+ try {
97
+ return globalThis.localStorage ?? null;
98
+ } catch {
99
+ return null;
100
+ }
101
+ }
78
102
  function defaultHttpClient() {
79
103
  return (url, init) => fetch(url, init);
80
104
  }
@@ -242,6 +266,13 @@ var SA_INTL_LOCALES = {
242
266
  de: "de-DE",
243
267
  en: "en-US"
244
268
  };
269
+ var SA_LOCALE_LABELS = {
270
+ de: "Deutsch",
271
+ en: "English"
272
+ };
273
+ function isSaLocale(value) {
274
+ return typeof value === "string" && SA_LOCALES.includes(value);
275
+ }
245
276
 
246
277
  // src/client/i18n/define.ts
247
278
  function defineMessages(de, en) {
@@ -3329,7 +3360,8 @@ var shellMessages = defineMessages(
3329
3360
  productionWarning: "Aktionen wirken sich sofort auf alle Mandanten aus.",
3330
3361
  subtitle: "SuperAdmin \xB7 Plattform-Verwaltung",
3331
3362
  roleBadge: "SUPER ADMIN",
3332
- logout: "Abmelden"
3363
+ logout: "Abmelden",
3364
+ language: "Sprache"
3333
3365
  },
3334
3366
  drawer: {
3335
3367
  docs: "Doku \xF6ffnen"
@@ -3397,7 +3429,8 @@ var shellMessages = defineMessages(
3397
3429
  productionWarning: "Actions take effect immediately for all tenants.",
3398
3430
  subtitle: "SuperAdmin \xB7 Platform administration",
3399
3431
  roleBadge: "SUPER ADMIN",
3400
- logout: "Sign out"
3432
+ logout: "Sign out",
3433
+ language: "Language"
3401
3434
  },
3402
3435
  drawer: {
3403
3436
  docs: "Open documentation"
@@ -3686,6 +3719,7 @@ function resolveMessages(locale, overrides) {
3686
3719
  MissingHandlerError,
3687
3720
  SA_INTL_LOCALES,
3688
3721
  SA_LOCALES,
3722
+ SA_LOCALE_LABELS,
3689
3723
  SA_MESSAGES,
3690
3724
  buildRoutes,
3691
3725
  buildSidebar,
@@ -3697,6 +3731,7 @@ function resolveMessages(locale, overrides) {
3697
3731
  formatCurrency,
3698
3732
  formatMessage,
3699
3733
  getJson,
3734
+ isSaLocale,
3700
3735
  mergeMessages,
3701
3736
  postJson,
3702
3737
  resolveExtension,
@@ -1,5 +1,5 @@
1
- import { H as HttpClient, K as KvStore, S as SaLocale } from '../messages-BIYw32u1.cjs';
2
- export { d as ActionDefNotInManifestError, A as ActionHandler, c as ActionRegistry, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, j as defaultHttpClient, k as defaultKvStore, l as defineMessages, m as mergeMessages, r as resolveMessages } from '../messages-BIYw32u1.cjs';
1
+ import { H as HttpClient, K as KvStore, S as SaLocale } from '../messages-DetB75lX.cjs';
2
+ export { d as ActionDefNotInManifestError, A as ActionHandler, c as ActionRegistry, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_LOCALE_LABELS, j as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, k as defaultHttpClient, l as defaultKvStore, m as defineMessages, n as isSaLocale, o as mergeMessages, r as resolveMessages } from '../messages-DetB75lX.cjs';
3
3
  import { PublicBootResponse, AdminManifest, StandardPageKey, TenantColumnDef, PromoCodeRecord, AdminTenantDetail, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow } from '@saasicat/types';
4
4
 
5
5
  declare const ADMIN_UI_VERSION = "1.2.0";
@@ -1,5 +1,5 @@
1
- import { H as HttpClient, K as KvStore, S as SaLocale } from '../messages-BIYw32u1.js';
2
- export { d as ActionDefNotInManifestError, A as ActionHandler, c as ActionRegistry, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, j as defaultHttpClient, k as defaultKvStore, l as defineMessages, m as mergeMessages, r as resolveMessages } from '../messages-BIYw32u1.js';
1
+ import { H as HttpClient, K as KvStore, S as SaLocale } from '../messages-DetB75lX.js';
2
+ export { d as ActionDefNotInManifestError, A as ActionHandler, c as ActionRegistry, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_LOCALE_LABELS, j as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, k as defaultHttpClient, l as defaultKvStore, m as defineMessages, n as isSaLocale, o as mergeMessages, r as resolveMessages } from '../messages-DetB75lX.js';
3
3
  import { PublicBootResponse, AdminManifest, StandardPageKey, TenantColumnDef, PromoCodeRecord, AdminTenantDetail, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow } from '@saasicat/types';
4
4
 
5
5
  declare const ADMIN_UI_VERSION = "1.2.0";
@@ -19,20 +19,22 @@ import {
19
19
  postJson,
20
20
  resolveExtension,
21
21
  trimTrailingSlashes
22
- } from "../chunk-66BUSVC5.js";
22
+ } from "../chunk-CRUUZMMN.js";
23
23
  import {
24
24
  DEFAULT_SA_LOCALE,
25
25
  SA_INTL_LOCALES,
26
26
  SA_LOCALES,
27
+ SA_LOCALE_LABELS,
27
28
  SA_MESSAGES,
28
29
  defaultHttpClient,
29
30
  defaultKvStore,
30
31
  defineMessages,
31
32
  formatCurrency,
32
33
  formatMessage,
34
+ isSaLocale,
33
35
  mergeMessages,
34
36
  resolveMessages
35
- } from "../chunk-TBLXKSTR.js";
37
+ } from "../chunk-TZ2NGQXK.js";
36
38
  export {
37
39
  ADMIN_UI_VERSION,
38
40
  ActionDefNotInManifestError,
@@ -49,6 +51,7 @@ export {
49
51
  MissingHandlerError,
50
52
  SA_INTL_LOCALES,
51
53
  SA_LOCALES,
54
+ SA_LOCALE_LABELS,
52
55
  SA_MESSAGES,
53
56
  buildRoutes,
54
57
  buildSidebar,
@@ -60,6 +63,7 @@ export {
60
63
  formatCurrency,
61
64
  formatMessage,
62
65
  getJson,
66
+ isSaLocale,
63
67
  mergeMessages,
64
68
  postJson,
65
69
  resolveExtension,
package/dist/index.cjs CHANGED
@@ -48,6 +48,8 @@ __export(src_exports, {
48
48
  PromotionsApiError: () => PromotionsApiError,
49
49
  SA_INTL_LOCALES: () => SA_INTL_LOCALES,
50
50
  SA_LOCALES: () => SA_LOCALES,
51
+ SA_LOCALE_LABELS: () => SA_LOCALE_LABELS,
52
+ SA_LOCALE_STORAGE_KEY: () => SA_LOCALE_STORAGE_KEY,
51
53
  SA_MESSAGES: () => SA_MESSAGES,
52
54
  SUPER_ADMIN_ACTIONS_KEY: () => SUPER_ADMIN_ACTIONS_KEY,
53
55
  SUPER_ADMIN_BRAND_KEY: () => SUPER_ADMIN_BRAND_KEY,
@@ -81,6 +83,7 @@ __export(src_exports, {
81
83
  formatCurrency: () => formatCurrency,
82
84
  formatMessage: () => formatMessage,
83
85
  getJson: () => getJson,
86
+ isSaLocale: () => isSaLocale,
84
87
  mergeMessages: () => mergeMessages,
85
88
  postJson: () => postJson,
86
89
  provideEntitlement: () => provideEntitlement,
@@ -132,23 +135,45 @@ module.exports = __toCommonJS(src_exports);
132
135
  var ADMIN_UI_VERSION = "1.2.0";
133
136
 
134
137
  // src/client/types.ts
135
- function defaultKvStore() {
136
- if (typeof globalThis.localStorage === "undefined") {
137
- return {
138
- get: () => null,
139
- set: () => {
140
- },
141
- remove: () => {
142
- }
143
- };
138
+ var NOOP_KV_STORE = {
139
+ get: () => null,
140
+ set: () => {
141
+ },
142
+ remove: () => {
144
143
  }
145
- const ls = globalThis.localStorage;
144
+ };
145
+ function defaultKvStore() {
146
+ const ls = resolveLocalStorage();
147
+ if (!ls) return NOOP_KV_STORE;
146
148
  return {
147
- get: (k) => ls.getItem(k),
148
- set: (k, v) => ls.setItem(k, v),
149
- remove: (k) => ls.removeItem(k)
149
+ get: (k) => {
150
+ try {
151
+ return ls.getItem(k);
152
+ } catch {
153
+ return null;
154
+ }
155
+ },
156
+ set: (k, v) => {
157
+ try {
158
+ ls.setItem(k, v);
159
+ } catch {
160
+ }
161
+ },
162
+ remove: (k) => {
163
+ try {
164
+ ls.removeItem(k);
165
+ } catch {
166
+ }
167
+ }
150
168
  };
151
169
  }
170
+ function resolveLocalStorage() {
171
+ try {
172
+ return globalThis.localStorage ?? null;
173
+ } catch {
174
+ return null;
175
+ }
176
+ }
152
177
  function defaultHttpClient() {
153
178
  return (url, init) => fetch(url, init);
154
179
  }
@@ -316,6 +341,13 @@ var SA_INTL_LOCALES = {
316
341
  de: "de-DE",
317
342
  en: "en-US"
318
343
  };
344
+ var SA_LOCALE_LABELS = {
345
+ de: "Deutsch",
346
+ en: "English"
347
+ };
348
+ function isSaLocale(value) {
349
+ return typeof value === "string" && SA_LOCALES.includes(value);
350
+ }
319
351
 
320
352
  // src/client/i18n/define.ts
321
353
  function defineMessages(de, en) {
@@ -3403,7 +3435,8 @@ var shellMessages = defineMessages(
3403
3435
  productionWarning: "Aktionen wirken sich sofort auf alle Mandanten aus.",
3404
3436
  subtitle: "SuperAdmin \xB7 Plattform-Verwaltung",
3405
3437
  roleBadge: "SUPER ADMIN",
3406
- logout: "Abmelden"
3438
+ logout: "Abmelden",
3439
+ language: "Sprache"
3407
3440
  },
3408
3441
  drawer: {
3409
3442
  docs: "Doku \xF6ffnen"
@@ -3471,7 +3504,8 @@ var shellMessages = defineMessages(
3471
3504
  productionWarning: "Actions take effect immediately for all tenants.",
3472
3505
  subtitle: "SuperAdmin \xB7 Platform administration",
3473
3506
  roleBadge: "SUPER ADMIN",
3474
- logout: "Sign out"
3507
+ logout: "Sign out",
3508
+ language: "Language"
3475
3509
  },
3476
3510
  drawer: {
3477
3511
  docs: "Open documentation"
@@ -3841,22 +3875,39 @@ function useSuperAdminHttp() {
3841
3875
 
3842
3876
  // src/vue/use-super-admin-i18n.ts
3843
3877
  var import_vue2 = require("vue");
3878
+ var SA_LOCALE_STORAGE_KEY = "sa:locale";
3844
3879
  var SUPER_ADMIN_I18N_KEY = /* @__PURE__ */ Symbol.for(
3845
3880
  "@saasicat/ui-vue/SUPER_ADMIN_I18N"
3846
3881
  );
3847
3882
  function createSuperAdminI18n(options = {}) {
3848
- const locale = (0, import_vue2.isRef)(options.locale) ? options.locale : (0, import_vue2.ref)(options.locale ?? DEFAULT_SA_LOCALE);
3883
+ const locale = (0, import_vue2.isRef)(options.locale) ? options.locale : createOwnedLocale(options);
3849
3884
  const messages = (0, import_vue2.computed)(
3850
3885
  () => resolveMessages(locale.value, options.overrides?.[locale.value])
3851
3886
  );
3852
3887
  const intlLocale = (0, import_vue2.computed)(() => SA_INTL_LOCALES[locale.value]);
3853
- return { locale, messages, intlLocale };
3888
+ const writable = !(0, import_vue2.isReadonly)(locale);
3889
+ return {
3890
+ locale,
3891
+ messages,
3892
+ intlLocale,
3893
+ switcherEnabled: (options.switcher ?? true) && writable
3894
+ };
3895
+ }
3896
+ function createOwnedLocale(options) {
3897
+ if (options.persist === false) {
3898
+ return (0, import_vue2.ref)(options.locale ?? DEFAULT_SA_LOCALE);
3899
+ }
3900
+ const storage = options.storage ?? defaultKvStore();
3901
+ const stored = storage.get(SA_LOCALE_STORAGE_KEY);
3902
+ const locale = (0, import_vue2.ref)(isSaLocale(stored) ? stored : options.locale ?? DEFAULT_SA_LOCALE);
3903
+ (0, import_vue2.watch)(locale, (next) => storage.set(SA_LOCALE_STORAGE_KEY, next));
3904
+ return locale;
3854
3905
  }
3855
3906
  var fallbackI18n = null;
3856
3907
  function useSuperAdminI18n() {
3857
3908
  const injected = (0, import_vue2.inject)(SUPER_ADMIN_I18N_KEY, null);
3858
3909
  if (injected) return injected;
3859
- fallbackI18n ??= createSuperAdminI18n();
3910
+ fallbackI18n ??= createSuperAdminI18n({ persist: false });
3860
3911
  return fallbackI18n;
3861
3912
  }
3862
3913
  function useSaMessages(namespace) {
@@ -4404,7 +4455,7 @@ function useTenantBilling(options = {}) {
4404
4455
 
4405
4456
  // src/vue/use-subscription-draft.ts
4406
4457
  var import_vue12 = require("vue");
4407
- var import_types10 = require("@saasicat/types");
4458
+ var import_types11 = require("@saasicat/types");
4408
4459
  var DEFAULT_YEARLY_FACTOR = 10;
4409
4460
  function unwrap(source) {
4410
4461
  if (source && typeof source === "object" && "value" in source) {
@@ -4444,7 +4495,7 @@ function useSubscriptionDraft(options) {
4444
4495
  const planFeatures = selectedPlan.value?.features ?? [];
4445
4496
  const selected = selectedBundles.value;
4446
4497
  const keptIds = new Set(
4447
- (0, import_types10.selectChargeableBundles)(planFeatures, selected).map((b) => b.bundleVersionId)
4498
+ (0, import_types11.selectChargeableBundles)(planFeatures, selected).map((b) => b.bundleVersionId)
4448
4499
  );
4449
4500
  return selected.filter((b) => keptIds.has(b.bundleVersionId));
4450
4501
  });
@@ -6586,6 +6637,8 @@ function defaultTenantPlanSectionI18n(locale) {
6586
6637
  PromotionsApiError,
6587
6638
  SA_INTL_LOCALES,
6588
6639
  SA_LOCALES,
6640
+ SA_LOCALE_LABELS,
6641
+ SA_LOCALE_STORAGE_KEY,
6589
6642
  SA_MESSAGES,
6590
6643
  SUPER_ADMIN_ACTIONS_KEY,
6591
6644
  SUPER_ADMIN_BRAND_KEY,
@@ -6619,6 +6672,7 @@ function defaultTenantPlanSectionI18n(locale) {
6619
6672
  formatCurrency,
6620
6673
  formatMessage,
6621
6674
  getJson,
6675
+ isSaLocale,
6622
6676
  mergeMessages,
6623
6677
  postJson,
6624
6678
  provideEntitlement,
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { BootLoaderOptions, ManifestLoaderOptions, BuildRouteEntry, SidebarSection, NavBuilderOptions, BatchColumnData, BatchColumnFetcherOptions, BootLoader, ManifestLoader } from './client/index.cjs';
2
2
  export { ADMIN_UI_VERSION, AdminPromoListFilter, AdminPromoListRow, AdminResourceClientOptions, BatchColumnDriftError, BatchColumnFetcher, BatchColumnRow, BatchColumnValue, BootLoadError, CachedManifestEntry, DEFAULT_STANDARD_PAGE_ROUTES, HttpJsonError, ManifestLoadError, MessageParams, ParamStyle, SidebarItem, buildRoutes, buildSidebar, createAdminResourceClient, defaultSectionOrder, formatCurrency, formatMessage, getJson, postJson, resolveExtension, trimTrailingSlashes } from './client/index.cjs';
3
- import { H as HttpClient, c as ActionRegistry, A as ActionHandler, K as KvStore, S as SaLocale } from './messages-BIYw32u1.cjs';
4
- export { d as ActionDefNotInManifestError, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, j as defaultHttpClient, k as defaultKvStore, l as defineMessages, m as mergeMessages, r as resolveMessages } from './messages-BIYw32u1.cjs';
5
- import { A as ActionsMap, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, c as SuperAdminLoginAdapter } from './use-super-admin-i18n-DL_qI1BY.cjs';
6
- export { f as ExtensionLoader, I as InstallPlugin, g as SUPER_ADMIN_ACTIONS_KEY, h as SUPER_ADMIN_BRAND_KEY, i as SUPER_ADMIN_ENDPOINTS_KEY, j as SUPER_ADMIN_EXTENSIONS_KEY, k as SUPER_ADMIN_HTTP_KEY, l as SUPER_ADMIN_I18N_KEY, m as SUPER_ADMIN_LOGIN_ADAPTER_KEY, n as SUPER_ADMIN_MANIFEST_KEY, o as SUPER_ADMIN_NOTIFY_KEY, p as SuperAdminAuthGuardOptions, S as SuperAdminGuardOptions, e as SuperAdminI18n, d as SuperAdminI18nOptions, q as SuperAdminLoginResult, r as SuperAdminManifestGuardOptions, U as UiNotify, s as UiNotifyKind, t as UiNotifyOptions, u as buildNavigationGuard, v as createSuperAdminI18n, w as useSaMessages, x as useSuperAdminI18n } from './use-super-admin-i18n-DL_qI1BY.cjs';
3
+ import { H as HttpClient, c as ActionRegistry, A as ActionHandler, K as KvStore, S as SaLocale } from './messages-DetB75lX.cjs';
4
+ export { d as ActionDefNotInManifestError, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_LOCALE_LABELS, j as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, k as defaultHttpClient, l as defaultKvStore, m as defineMessages, n as isSaLocale, o as mergeMessages, r as resolveMessages } from './messages-DetB75lX.cjs';
5
+ import { A as ActionsMap, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, c as SuperAdminLoginAdapter } from './use-super-admin-i18n-DokHhkS_.cjs';
6
+ export { f as ExtensionLoader, I as InstallPlugin, g as SA_LOCALE_STORAGE_KEY, h as SUPER_ADMIN_ACTIONS_KEY, i as SUPER_ADMIN_BRAND_KEY, j as SUPER_ADMIN_ENDPOINTS_KEY, k as SUPER_ADMIN_EXTENSIONS_KEY, l as SUPER_ADMIN_HTTP_KEY, m as SUPER_ADMIN_I18N_KEY, n as SUPER_ADMIN_LOGIN_ADAPTER_KEY, o as SUPER_ADMIN_MANIFEST_KEY, p as SUPER_ADMIN_NOTIFY_KEY, q as SuperAdminAuthGuardOptions, S as SuperAdminGuardOptions, e as SuperAdminI18n, d as SuperAdminI18nOptions, r as SuperAdminLoginResult, s as SuperAdminManifestGuardOptions, U as UiNotify, t as UiNotifyKind, u as UiNotifyOptions, v as buildNavigationGuard, w as createSuperAdminI18n, x as useSaMessages, y as useSuperAdminI18n } from './use-super-admin-i18n-DokHhkS_.cjs';
7
7
  import { AdminManifest, TenantListFilter, TenantDto, AuditQuery, AuditEntry, FeatureUiRegistry, PromoPreviewResponse, OnboardingSelectionRequest, PublicMarketingBundle, FeatureDef, FeatureKey, PublicBootResponse, DiscoverySnapshot, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, ReviewCatalogEntryData, CatalogEntryI18n, UpdateCatalogEntryBaseData, SyncDiscoveryResult, BundleVersionRow, CreateBundleVersionDraftData, BundleVersionMutationResult, UpdateBundleVersionDraftData, BundleRow, CreateBundleData, UpdateBundleData, SubscriptionBundleRecord, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, PromotionRow, CreatePromotionData, UpdatePromotionData, PlanVersionRow, CreatePlanVersionDraftData, PlanVersionMutationResult, UpdatePlanVersionDraftData, PlanRow, CreatePlanData, UpdatePlanData, TenantActionDef } from '@saasicat/types';
8
8
  import { RouteRecordRaw, NavigationGuardWithThis } from 'vue-router';
9
9
  import * as vue from 'vue';
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { BootLoaderOptions, ManifestLoaderOptions, BuildRouteEntry, SidebarSection, NavBuilderOptions, BatchColumnData, BatchColumnFetcherOptions, BootLoader, ManifestLoader } from './client/index.js';
2
2
  export { ADMIN_UI_VERSION, AdminPromoListFilter, AdminPromoListRow, AdminResourceClientOptions, BatchColumnDriftError, BatchColumnFetcher, BatchColumnRow, BatchColumnValue, BootLoadError, CachedManifestEntry, DEFAULT_STANDARD_PAGE_ROUTES, HttpJsonError, ManifestLoadError, MessageParams, ParamStyle, SidebarItem, buildRoutes, buildSidebar, createAdminResourceClient, defaultSectionOrder, formatCurrency, formatMessage, getJson, postJson, resolveExtension, trimTrailingSlashes } from './client/index.js';
3
- import { H as HttpClient, c as ActionRegistry, A as ActionHandler, K as KvStore, S as SaLocale } from './messages-BIYw32u1.js';
4
- export { d as ActionDefNotInManifestError, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, j as defaultHttpClient, k as defaultKvStore, l as defineMessages, m as mergeMessages, r as resolveMessages } from './messages-BIYw32u1.js';
5
- import { A as ActionsMap, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, c as SuperAdminLoginAdapter } from './use-super-admin-i18n-CWNu_W3u.js';
6
- export { f as ExtensionLoader, I as InstallPlugin, g as SUPER_ADMIN_ACTIONS_KEY, h as SUPER_ADMIN_BRAND_KEY, i as SUPER_ADMIN_ENDPOINTS_KEY, j as SUPER_ADMIN_EXTENSIONS_KEY, k as SUPER_ADMIN_HTTP_KEY, l as SUPER_ADMIN_I18N_KEY, m as SUPER_ADMIN_LOGIN_ADAPTER_KEY, n as SUPER_ADMIN_MANIFEST_KEY, o as SUPER_ADMIN_NOTIFY_KEY, p as SuperAdminAuthGuardOptions, S as SuperAdminGuardOptions, e as SuperAdminI18n, d as SuperAdminI18nOptions, q as SuperAdminLoginResult, r as SuperAdminManifestGuardOptions, U as UiNotify, s as UiNotifyKind, t as UiNotifyOptions, u as buildNavigationGuard, v as createSuperAdminI18n, w as useSaMessages, x as useSuperAdminI18n } from './use-super-admin-i18n-CWNu_W3u.js';
3
+ import { H as HttpClient, c as ActionRegistry, A as ActionHandler, K as KvStore, S as SaLocale } from './messages-DetB75lX.js';
4
+ export { d as ActionDefNotInManifestError, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_LOCALE_LABELS, j as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, k as defaultHttpClient, l as defaultKvStore, m as defineMessages, n as isSaLocale, o as mergeMessages, r as resolveMessages } from './messages-DetB75lX.js';
5
+ import { A as ActionsMap, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, c as SuperAdminLoginAdapter } from './use-super-admin-i18n-BPC-H9jz.js';
6
+ export { f as ExtensionLoader, I as InstallPlugin, g as SA_LOCALE_STORAGE_KEY, h as SUPER_ADMIN_ACTIONS_KEY, i as SUPER_ADMIN_BRAND_KEY, j as SUPER_ADMIN_ENDPOINTS_KEY, k as SUPER_ADMIN_EXTENSIONS_KEY, l as SUPER_ADMIN_HTTP_KEY, m as SUPER_ADMIN_I18N_KEY, n as SUPER_ADMIN_LOGIN_ADAPTER_KEY, o as SUPER_ADMIN_MANIFEST_KEY, p as SUPER_ADMIN_NOTIFY_KEY, q as SuperAdminAuthGuardOptions, S as SuperAdminGuardOptions, e as SuperAdminI18n, d as SuperAdminI18nOptions, r as SuperAdminLoginResult, s as SuperAdminManifestGuardOptions, U as UiNotify, t as UiNotifyKind, u as UiNotifyOptions, v as buildNavigationGuard, w as createSuperAdminI18n, x as useSaMessages, y as useSuperAdminI18n } from './use-super-admin-i18n-BPC-H9jz.js';
7
7
  import { AdminManifest, TenantListFilter, TenantDto, AuditQuery, AuditEntry, FeatureUiRegistry, PromoPreviewResponse, OnboardingSelectionRequest, PublicMarketingBundle, FeatureDef, FeatureKey, PublicBootResponse, DiscoverySnapshot, CapabilityCatalogEntryRow, FeatureCatalogEntryRow, QuotaCatalogEntryRow, ReviewCatalogEntryData, CatalogEntryI18n, UpdateCatalogEntryBaseData, SyncDiscoveryResult, BundleVersionRow, CreateBundleVersionDraftData, BundleVersionMutationResult, UpdateBundleVersionDraftData, BundleRow, CreateBundleData, UpdateBundleData, SubscriptionBundleRecord, MarketingProjectionFilter, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, PromotionRow, CreatePromotionData, UpdatePromotionData, PlanVersionRow, CreatePlanVersionDraftData, PlanVersionMutationResult, UpdatePlanVersionDraftData, PlanRow, CreatePlanData, UpdatePlanData, TenantActionDef } from '@saasicat/types';
8
8
  import { RouteRecordRaw, NavigationGuardWithThis } from 'vue-router';
9
9
  import * as vue from 'vue';
package/dist/index.js CHANGED
@@ -19,8 +19,9 @@ import {
19
19
  postJson,
20
20
  resolveExtension,
21
21
  trimTrailingSlashes
22
- } from "./chunk-66BUSVC5.js";
22
+ } from "./chunk-CRUUZMMN.js";
23
23
  import {
24
+ SA_LOCALE_STORAGE_KEY,
24
25
  SUPER_ADMIN_ACTIONS_KEY,
25
26
  SUPER_ADMIN_BRAND_KEY,
26
27
  SUPER_ADMIN_ENDPOINTS_KEY,
@@ -34,20 +35,22 @@ import {
34
35
  createSuperAdminI18n,
35
36
  useSaMessages,
36
37
  useSuperAdminI18n
37
- } from "./chunk-TY2WYKME.js";
38
+ } from "./chunk-MGKJCVDU.js";
38
39
  import {
39
40
  DEFAULT_SA_LOCALE,
40
41
  SA_INTL_LOCALES,
41
42
  SA_LOCALES,
43
+ SA_LOCALE_LABELS,
42
44
  SA_MESSAGES,
43
45
  defaultHttpClient,
44
46
  defaultKvStore,
45
47
  defineMessages,
46
48
  formatCurrency,
47
49
  formatMessage,
50
+ isSaLocale,
48
51
  mergeMessages,
49
52
  resolveMessages
50
- } from "./chunk-TBLXKSTR.js";
53
+ } from "./chunk-TZ2NGQXK.js";
51
54
 
52
55
  // src/vue/use-super-admin-context.ts
53
56
  import { inject } from "vue";
@@ -2815,6 +2818,8 @@ export {
2815
2818
  PromotionsApiError,
2816
2819
  SA_INTL_LOCALES,
2817
2820
  SA_LOCALES,
2821
+ SA_LOCALE_LABELS,
2822
+ SA_LOCALE_STORAGE_KEY,
2818
2823
  SA_MESSAGES,
2819
2824
  SUPER_ADMIN_ACTIONS_KEY,
2820
2825
  SUPER_ADMIN_BRAND_KEY,
@@ -2848,6 +2853,7 @@ export {
2848
2853
  formatCurrency,
2849
2854
  formatMessage,
2850
2855
  getJson,
2856
+ isSaLocale,
2851
2857
  mergeMessages,
2852
2858
  postJson,
2853
2859
  provideEntitlement,