@saasicat/ui-vue 0.17.0 → 0.18.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.
Files changed (29) hide show
  1. package/dist/{catalog-C4Gv2_KM.d.cts → catalog-JXdKdIqG.d.cts} +1 -12
  2. package/dist/{catalog-C4Gv2_KM.d.ts → catalog-JXdKdIqG.d.ts} +1 -12
  3. package/dist/{chunk-IZGFS5RS.js → chunk-CC4WK3DC.js} +0 -4
  4. package/dist/{chunk-XPSD5HKG.js → chunk-VRCVJTY4.js} +1 -1
  5. package/dist/{chunk-247RJPU4.js → chunk-Y5MWMWMD.js} +1 -1
  6. package/dist/client/index.cjs +0 -5
  7. package/dist/client/index.d.cts +2 -2
  8. package/dist/client/index.d.ts +2 -2
  9. package/dist/client/index.js +2 -4
  10. package/dist/index.cjs +0 -5
  11. package/dist/index.d.cts +4 -4
  12. package/dist/index.d.ts +4 -4
  13. package/dist/index.js +3 -5
  14. package/dist/quasar/index.d.cts +2 -2
  15. package/dist/quasar/index.d.ts +2 -2
  16. package/dist/quasar/index.js +2 -2
  17. package/dist/{use-super-admin-i18n-BdPqeTHl.d.cts → use-super-admin-i18n-1nCOkvgi.d.cts} +1 -1
  18. package/dist/{use-super-admin-i18n-uteRCL9q.d.ts → use-super-admin-i18n-BlqcD0N7.d.ts} +1 -1
  19. package/package.json +2 -2
  20. package/src/client/i18n/locale.ts +0 -17
  21. package/src/components/bundle-editor/BundleVersionStrip.vue +1 -1
  22. package/src/components/bundle-editor/bundle-version-status.ts +9 -10
  23. package/src/pages-standard/DiscoveryPage.vue +1 -1
  24. package/src/pages-standard/bundles-page/BundleAccordionList.vue +2 -3
  25. package/src/pages-standard/discovery-page/CatalogEntryTransPanel.vue +4 -4
  26. package/src/pages-standard/discovery-page/DiscoveryStatusControl.vue +7 -7
  27. package/src/pages-standard/discovery-page/discovery-ui.ts +24 -15
  28. package/src/pages-standard/plan-versions/PlanVersionsTimeline.vue +2 -3
  29. package/src/pages-standard/plan-versions/format.ts +7 -8
@@ -59,17 +59,6 @@ declare const SA_INTL_LOCALES: Record<SaBuiltinLocale, string>;
59
59
  declare const SA_LOCALE_LABELS: Record<SaBuiltinLocale, string>;
60
60
  /** Narrows untrusted input to a locale the platform ships a catalog for. */
61
61
  declare function isSaBuiltinLocale(value: unknown): value is SaBuiltinLocale;
62
- /**
63
- * The built-in catalog a locale reads from. Helper modules that index the raw
64
- * catalogs (rather than the resolved one from `useSaMessages`) need this: a
65
- * language an app added has no entry there, and indexing it would yield
66
- * `undefined` and take the page down.
67
- *
68
- * Strings resolved this way stay in the fallback language for an app-supplied
69
- * locale — migrating those helpers to the resolved catalog is tracked
70
- * separately.
71
- */
72
- declare function builtinLocaleOf(locale: SaLocale | undefined, fallback?: SaBuiltinLocale): SaBuiltinLocale;
73
62
 
74
63
  type SaNavMessages = {
75
64
  readonly pages: Record<StandardPageKey, string>;
@@ -1669,4 +1658,4 @@ interface SaCatalog {
1669
1658
  */
1670
1659
  declare function createSaCatalog(options?: SaCatalogOptions): SaCatalog;
1671
1660
 
1672
- export { type ActionHandler as A, DEFAULT_SA_LOCALE as D, type HttpClient as H, type KvStore as K, type MessageTree as M, type PartialMessages as P, type ResolvedAction as R, type SaLocale as S, type TranslationOf as T, type SaMessages as a, type SaLocaleOption as b, type SaLocaleDefinition as c, type SaMessagesOverrides as d, ActionRegistry as e, ActionDefNotInManifestError as f, type HttpResponse as g, MissingHandlerError as h, SA_INTL_LOCALES as i, SA_LOCALES as j, SA_LOCALE_LABELS as k, SA_MESSAGES as l, type SaBuiltinLocale as m, type SaCatalog as n, type SaCatalogOptions as o, builtinLocaleOf as p, createSaCatalog as q, defaultHttpClient as r, defaultKvStore as s, defineMessages as t, isSaBuiltinLocale as u, mergeMessages as v, resolveMessages as w, type SaNavMessages as x };
1661
+ export { type ActionHandler as A, DEFAULT_SA_LOCALE as D, type HttpClient as H, type KvStore as K, type MessageTree as M, type PartialMessages as P, type ResolvedAction as R, type SaLocale as S, type TranslationOf as T, type SaMessages as a, type SaLocaleOption as b, type SaLocaleDefinition as c, type SaMessagesOverrides as d, ActionRegistry as e, ActionDefNotInManifestError as f, type HttpResponse as g, MissingHandlerError as h, SA_INTL_LOCALES as i, SA_LOCALES as j, SA_LOCALE_LABELS as k, SA_MESSAGES as l, type SaBuiltinLocale as m, type SaCatalog as n, type SaCatalogOptions as o, createSaCatalog as p, defaultHttpClient as q, defaultKvStore as r, defineMessages as s, isSaBuiltinLocale as t, mergeMessages as u, resolveMessages as v, type SaNavMessages as w };
@@ -59,17 +59,6 @@ declare const SA_INTL_LOCALES: Record<SaBuiltinLocale, string>;
59
59
  declare const SA_LOCALE_LABELS: Record<SaBuiltinLocale, string>;
60
60
  /** Narrows untrusted input to a locale the platform ships a catalog for. */
61
61
  declare function isSaBuiltinLocale(value: unknown): value is SaBuiltinLocale;
62
- /**
63
- * The built-in catalog a locale reads from. Helper modules that index the raw
64
- * catalogs (rather than the resolved one from `useSaMessages`) need this: a
65
- * language an app added has no entry there, and indexing it would yield
66
- * `undefined` and take the page down.
67
- *
68
- * Strings resolved this way stay in the fallback language for an app-supplied
69
- * locale — migrating those helpers to the resolved catalog is tracked
70
- * separately.
71
- */
72
- declare function builtinLocaleOf(locale: SaLocale | undefined, fallback?: SaBuiltinLocale): SaBuiltinLocale;
73
62
 
74
63
  type SaNavMessages = {
75
64
  readonly pages: Record<StandardPageKey, string>;
@@ -1669,4 +1658,4 @@ interface SaCatalog {
1669
1658
  */
1670
1659
  declare function createSaCatalog(options?: SaCatalogOptions): SaCatalog;
1671
1660
 
1672
- export { type ActionHandler as A, DEFAULT_SA_LOCALE as D, type HttpClient as H, type KvStore as K, type MessageTree as M, type PartialMessages as P, type ResolvedAction as R, type SaLocale as S, type TranslationOf as T, type SaMessages as a, type SaLocaleOption as b, type SaLocaleDefinition as c, type SaMessagesOverrides as d, ActionRegistry as e, ActionDefNotInManifestError as f, type HttpResponse as g, MissingHandlerError as h, SA_INTL_LOCALES as i, SA_LOCALES as j, SA_LOCALE_LABELS as k, SA_MESSAGES as l, type SaBuiltinLocale as m, type SaCatalog as n, type SaCatalogOptions as o, builtinLocaleOf as p, createSaCatalog as q, defaultHttpClient as r, defaultKvStore as s, defineMessages as t, isSaBuiltinLocale as u, mergeMessages as v, resolveMessages as w, type SaNavMessages as x };
1661
+ export { type ActionHandler as A, DEFAULT_SA_LOCALE as D, type HttpClient as H, type KvStore as K, type MessageTree as M, type PartialMessages as P, type ResolvedAction as R, type SaLocale as S, type TranslationOf as T, type SaMessages as a, type SaLocaleOption as b, type SaLocaleDefinition as c, type SaMessagesOverrides as d, ActionRegistry as e, ActionDefNotInManifestError as f, type HttpResponse as g, MissingHandlerError as h, SA_INTL_LOCALES as i, SA_LOCALES as j, SA_LOCALE_LABELS as k, SA_MESSAGES as l, type SaBuiltinLocale as m, type SaCatalog as n, type SaCatalogOptions as o, createSaCatalog as p, defaultHttpClient as q, defaultKvStore as r, defineMessages as s, isSaBuiltinLocale as t, mergeMessages as u, resolveMessages as v, type SaNavMessages as w };
@@ -56,9 +56,6 @@ var SA_LOCALE_LABELS = {
56
56
  function isSaBuiltinLocale(value) {
57
57
  return typeof value === "string" && SA_LOCALES.includes(value);
58
58
  }
59
- function builtinLocaleOf(locale, fallback = DEFAULT_SA_LOCALE) {
60
- return isSaBuiltinLocale(locale) ? locale : fallback;
61
- }
62
59
 
63
60
  // src/client/i18n/define.ts
64
61
  function defineMessages(de, en) {
@@ -3151,7 +3148,6 @@ export {
3151
3148
  SA_INTL_LOCALES,
3152
3149
  SA_LOCALE_LABELS,
3153
3150
  isSaBuiltinLocale,
3154
- builtinLocaleOf,
3155
3151
  defineMessages,
3156
3152
  mergeMessages,
3157
3153
  navMessages,
@@ -4,7 +4,7 @@ import {
4
4
  defaultKvStore,
5
5
  isSaBuiltinLocale,
6
6
  navMessages
7
- } from "./chunk-IZGFS5RS.js";
7
+ } from "./chunk-CC4WK3DC.js";
8
8
 
9
9
  // src/client/version.ts
10
10
  var ADMIN_UI_VERSION = "1.2.0";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createSaCatalog,
3
3
  defaultKvStore
4
- } from "./chunk-IZGFS5RS.js";
4
+ } from "./chunk-CC4WK3DC.js";
5
5
 
6
6
  // src/vue/super-admin-context.ts
7
7
  var SUPER_ADMIN_BRAND_KEY = /* @__PURE__ */ Symbol.for(
@@ -39,7 +39,6 @@ __export(client_exports, {
39
39
  SA_MESSAGES: () => SA_MESSAGES,
40
40
  buildRoutes: () => buildRoutes,
41
41
  buildSidebar: () => buildSidebar,
42
- builtinLocaleOf: () => builtinLocaleOf,
43
42
  createAdminResourceClient: () => createAdminResourceClient,
44
43
  createSaCatalog: () => createSaCatalog,
45
44
  defaultHttpClient: () => defaultHttpClient,
@@ -277,9 +276,6 @@ var SA_LOCALE_LABELS = {
277
276
  function isSaBuiltinLocale(value) {
278
277
  return typeof value === "string" && SA_LOCALES.includes(value);
279
278
  }
280
- function builtinLocaleOf(locale, fallback = DEFAULT_SA_LOCALE) {
281
- return isSaBuiltinLocale(locale) ? locale : fallback;
282
- }
283
279
 
284
280
  // src/client/i18n/define.ts
285
281
  function defineMessages(de, en) {
@@ -3784,7 +3780,6 @@ function isProductionBoot(boot) {
3784
3780
  SA_MESSAGES,
3785
3781
  buildRoutes,
3786
3782
  buildSidebar,
3787
- builtinLocaleOf,
3788
3783
  createAdminResourceClient,
3789
3784
  createSaCatalog,
3790
3785
  defaultHttpClient,
@@ -1,5 +1,5 @@
1
- import { H as HttpClient, K as KvStore, S as SaLocale, x as SaNavMessages } from '../catalog-C4Gv2_KM.cjs';
2
- export { f as ActionDefNotInManifestError, A as ActionHandler, e as ActionRegistry, D as DEFAULT_SA_LOCALE, g as HttpResponse, M as MessageTree, h as MissingHandlerError, P as PartialMessages, R as ResolvedAction, i as SA_INTL_LOCALES, j as SA_LOCALES, k as SA_LOCALE_LABELS, l as SA_MESSAGES, m as SaBuiltinLocale, n as SaCatalog, o as SaCatalogOptions, c as SaLocaleDefinition, b as SaLocaleOption, a as SaMessages, d as SaMessagesOverrides, T as TranslationOf, p as builtinLocaleOf, q as createSaCatalog, r as defaultHttpClient, s as defaultKvStore, t as defineMessages, u as isSaBuiltinLocale, v as mergeMessages, w as resolveMessages } from '../catalog-C4Gv2_KM.cjs';
1
+ import { H as HttpClient, K as KvStore, S as SaLocale, w as SaNavMessages } from '../catalog-JXdKdIqG.cjs';
2
+ export { f as ActionDefNotInManifestError, A as ActionHandler, e as ActionRegistry, D as DEFAULT_SA_LOCALE, g as HttpResponse, M as MessageTree, h as MissingHandlerError, P as PartialMessages, R as ResolvedAction, i as SA_INTL_LOCALES, j as SA_LOCALES, k as SA_LOCALE_LABELS, l as SA_MESSAGES, m as SaBuiltinLocale, n as SaCatalog, o as SaCatalogOptions, c as SaLocaleDefinition, b as SaLocaleOption, a as SaMessages, d as SaMessagesOverrides, T as TranslationOf, p as createSaCatalog, q as defaultHttpClient, r as defaultKvStore, s as defineMessages, t as isSaBuiltinLocale, u as mergeMessages, v as resolveMessages } from '../catalog-JXdKdIqG.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, x as SaNavMessages } from '../catalog-C4Gv2_KM.js';
2
- export { f as ActionDefNotInManifestError, A as ActionHandler, e as ActionRegistry, D as DEFAULT_SA_LOCALE, g as HttpResponse, M as MessageTree, h as MissingHandlerError, P as PartialMessages, R as ResolvedAction, i as SA_INTL_LOCALES, j as SA_LOCALES, k as SA_LOCALE_LABELS, l as SA_MESSAGES, m as SaBuiltinLocale, n as SaCatalog, o as SaCatalogOptions, c as SaLocaleDefinition, b as SaLocaleOption, a as SaMessages, d as SaMessagesOverrides, T as TranslationOf, p as builtinLocaleOf, q as createSaCatalog, r as defaultHttpClient, s as defaultKvStore, t as defineMessages, u as isSaBuiltinLocale, v as mergeMessages, w as resolveMessages } from '../catalog-C4Gv2_KM.js';
1
+ import { H as HttpClient, K as KvStore, S as SaLocale, w as SaNavMessages } from '../catalog-JXdKdIqG.js';
2
+ export { f as ActionDefNotInManifestError, A as ActionHandler, e as ActionRegistry, D as DEFAULT_SA_LOCALE, g as HttpResponse, M as MessageTree, h as MissingHandlerError, P as PartialMessages, R as ResolvedAction, i as SA_INTL_LOCALES, j as SA_LOCALES, k as SA_LOCALE_LABELS, l as SA_MESSAGES, m as SaBuiltinLocale, n as SaCatalog, o as SaCatalogOptions, c as SaLocaleDefinition, b as SaLocaleOption, a as SaMessages, d as SaMessagesOverrides, T as TranslationOf, p as createSaCatalog, q as defaultHttpClient, r as defaultKvStore, s as defineMessages, t as isSaBuiltinLocale, u as mergeMessages, v as resolveMessages } from '../catalog-JXdKdIqG.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";
@@ -21,14 +21,13 @@ import {
21
21
  resolveExtension,
22
22
  resolveLoginBranding,
23
23
  trimTrailingSlashes
24
- } from "../chunk-XPSD5HKG.js";
24
+ } from "../chunk-VRCVJTY4.js";
25
25
  import {
26
26
  DEFAULT_SA_LOCALE,
27
27
  SA_INTL_LOCALES,
28
28
  SA_LOCALES,
29
29
  SA_LOCALE_LABELS,
30
30
  SA_MESSAGES,
31
- builtinLocaleOf,
32
31
  createSaCatalog,
33
32
  defaultHttpClient,
34
33
  defaultKvStore,
@@ -38,7 +37,7 @@ import {
38
37
  isSaBuiltinLocale,
39
38
  mergeMessages,
40
39
  resolveMessages
41
- } from "../chunk-IZGFS5RS.js";
40
+ } from "../chunk-CC4WK3DC.js";
42
41
  export {
43
42
  ADMIN_UI_VERSION,
44
43
  ActionDefNotInManifestError,
@@ -59,7 +58,6 @@ export {
59
58
  SA_MESSAGES,
60
59
  buildRoutes,
61
60
  buildSidebar,
62
- builtinLocaleOf,
63
61
  createAdminResourceClient,
64
62
  createSaCatalog,
65
63
  defaultHttpClient,
package/dist/index.cjs CHANGED
@@ -67,7 +67,6 @@ __export(src_exports, {
67
67
  buildQuotaRegistry: () => buildQuotaRegistry,
68
68
  buildRoutes: () => buildRoutes,
69
69
  buildSidebar: () => buildSidebar,
70
- builtinLocaleOf: () => builtinLocaleOf,
71
70
  createAdminResourceClient: () => createAdminResourceClient,
72
71
  createAdminRoutes: () => createAdminRoutes,
73
72
  createManifestStore: () => createManifestStore,
@@ -352,9 +351,6 @@ var SA_LOCALE_LABELS = {
352
351
  function isSaBuiltinLocale(value) {
353
352
  return typeof value === "string" && SA_LOCALES.includes(value);
354
353
  }
355
- function builtinLocaleOf(locale, fallback = DEFAULT_SA_LOCALE) {
356
- return isSaBuiltinLocale(locale) ? locale : fallback;
357
- }
358
354
 
359
355
  // src/client/i18n/define.ts
360
356
  function defineMessages(de, en) {
@@ -6720,7 +6716,6 @@ function defaultTenantPlanSectionI18n(locale) {
6720
6716
  buildQuotaRegistry,
6721
6717
  buildRoutes,
6722
6718
  buildSidebar,
6723
- builtinLocaleOf,
6724
6719
  createAdminResourceClient,
6725
6720
  createAdminRoutes,
6726
6721
  createManifestStore,
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, LoginBootProject, LoginBrandFallback, LoginBranding, ManifestLoadError, MessageParams, ParamStyle, SidebarItem, buildRoutes, buildSidebar, createAdminResourceClient, defaultSectionOrder, formatCurrency, formatMessage, getJson, isProductionBoot, postJson, resolveExtension, resolveLoginBranding, trimTrailingSlashes } from './client/index.cjs';
3
- import { H as HttpClient, e as ActionRegistry, A as ActionHandler, K as KvStore, S as SaLocale } from './catalog-C4Gv2_KM.cjs';
4
- export { f as ActionDefNotInManifestError, D as DEFAULT_SA_LOCALE, g as HttpResponse, M as MessageTree, h as MissingHandlerError, P as PartialMessages, R as ResolvedAction, i as SA_INTL_LOCALES, j as SA_LOCALES, k as SA_LOCALE_LABELS, l as SA_MESSAGES, m as SaBuiltinLocale, n as SaCatalog, o as SaCatalogOptions, c as SaLocaleDefinition, b as SaLocaleOption, a as SaMessages, d as SaMessagesOverrides, T as TranslationOf, p as builtinLocaleOf, q as createSaCatalog, r as defaultHttpClient, s as defaultKvStore, t as defineMessages, u as isSaBuiltinLocale, v as mergeMessages, w as resolveMessages } from './catalog-C4Gv2_KM.cjs';
5
- import { A as ActionsMap, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, c as SuperAdminLoginAdapter } from './use-super-admin-i18n-BdPqeTHl.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-BdPqeTHl.cjs';
3
+ import { H as HttpClient, e as ActionRegistry, A as ActionHandler, K as KvStore, S as SaLocale } from './catalog-JXdKdIqG.cjs';
4
+ export { f as ActionDefNotInManifestError, D as DEFAULT_SA_LOCALE, g as HttpResponse, M as MessageTree, h as MissingHandlerError, P as PartialMessages, R as ResolvedAction, i as SA_INTL_LOCALES, j as SA_LOCALES, k as SA_LOCALE_LABELS, l as SA_MESSAGES, m as SaBuiltinLocale, n as SaCatalog, o as SaCatalogOptions, c as SaLocaleDefinition, b as SaLocaleOption, a as SaMessages, d as SaMessagesOverrides, T as TranslationOf, p as createSaCatalog, q as defaultHttpClient, r as defaultKvStore, s as defineMessages, t as isSaBuiltinLocale, u as mergeMessages, v as resolveMessages } from './catalog-JXdKdIqG.cjs';
5
+ import { A as ActionsMap, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, c as SuperAdminLoginAdapter } from './use-super-admin-i18n-1nCOkvgi.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-1nCOkvgi.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, LoginBootProject, LoginBrandFallback, LoginBranding, ManifestLoadError, MessageParams, ParamStyle, SidebarItem, buildRoutes, buildSidebar, createAdminResourceClient, defaultSectionOrder, formatCurrency, formatMessage, getJson, isProductionBoot, postJson, resolveExtension, resolveLoginBranding, trimTrailingSlashes } from './client/index.js';
3
- import { H as HttpClient, e as ActionRegistry, A as ActionHandler, K as KvStore, S as SaLocale } from './catalog-C4Gv2_KM.js';
4
- export { f as ActionDefNotInManifestError, D as DEFAULT_SA_LOCALE, g as HttpResponse, M as MessageTree, h as MissingHandlerError, P as PartialMessages, R as ResolvedAction, i as SA_INTL_LOCALES, j as SA_LOCALES, k as SA_LOCALE_LABELS, l as SA_MESSAGES, m as SaBuiltinLocale, n as SaCatalog, o as SaCatalogOptions, c as SaLocaleDefinition, b as SaLocaleOption, a as SaMessages, d as SaMessagesOverrides, T as TranslationOf, p as builtinLocaleOf, q as createSaCatalog, r as defaultHttpClient, s as defaultKvStore, t as defineMessages, u as isSaBuiltinLocale, v as mergeMessages, w as resolveMessages } from './catalog-C4Gv2_KM.js';
5
- import { A as ActionsMap, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, c as SuperAdminLoginAdapter } from './use-super-admin-i18n-uteRCL9q.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-uteRCL9q.js';
3
+ import { H as HttpClient, e as ActionRegistry, A as ActionHandler, K as KvStore, S as SaLocale } from './catalog-JXdKdIqG.js';
4
+ export { f as ActionDefNotInManifestError, D as DEFAULT_SA_LOCALE, g as HttpResponse, M as MessageTree, h as MissingHandlerError, P as PartialMessages, R as ResolvedAction, i as SA_INTL_LOCALES, j as SA_LOCALES, k as SA_LOCALE_LABELS, l as SA_MESSAGES, m as SaBuiltinLocale, n as SaCatalog, o as SaCatalogOptions, c as SaLocaleDefinition, b as SaLocaleOption, a as SaMessages, d as SaMessagesOverrides, T as TranslationOf, p as createSaCatalog, q as defaultHttpClient, r as defaultKvStore, s as defineMessages, t as isSaBuiltinLocale, u as mergeMessages, v as resolveMessages } from './catalog-JXdKdIqG.js';
5
+ import { A as ActionsMap, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, c as SuperAdminLoginAdapter } from './use-super-admin-i18n-BlqcD0N7.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-BlqcD0N7.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
@@ -21,7 +21,7 @@ import {
21
21
  resolveExtension,
22
22
  resolveLoginBranding,
23
23
  trimTrailingSlashes
24
- } from "./chunk-XPSD5HKG.js";
24
+ } from "./chunk-VRCVJTY4.js";
25
25
  import {
26
26
  SA_LOCALE_STORAGE_KEY,
27
27
  SUPER_ADMIN_ACTIONS_KEY,
@@ -37,14 +37,13 @@ import {
37
37
  createSuperAdminI18n,
38
38
  useSaMessages,
39
39
  useSuperAdminI18n
40
- } from "./chunk-247RJPU4.js";
40
+ } from "./chunk-Y5MWMWMD.js";
41
41
  import {
42
42
  DEFAULT_SA_LOCALE,
43
43
  SA_INTL_LOCALES,
44
44
  SA_LOCALES,
45
45
  SA_LOCALE_LABELS,
46
46
  SA_MESSAGES,
47
- builtinLocaleOf,
48
47
  createSaCatalog,
49
48
  defaultHttpClient,
50
49
  defaultKvStore,
@@ -54,7 +53,7 @@ import {
54
53
  isSaBuiltinLocale,
55
54
  mergeMessages,
56
55
  resolveMessages
57
- } from "./chunk-IZGFS5RS.js";
56
+ } from "./chunk-CC4WK3DC.js";
58
57
 
59
58
  // src/vue/use-super-admin-context.ts
60
59
  import { inject } from "vue";
@@ -2841,7 +2840,6 @@ export {
2841
2840
  buildQuotaRegistry,
2842
2841
  buildRoutes,
2843
2842
  buildSidebar,
2844
- builtinLocaleOf,
2845
2843
  createAdminResourceClient,
2846
2844
  createAdminRoutes,
2847
2845
  createManifestStore,
@@ -2,8 +2,8 @@ import { Component, App } from 'vue';
2
2
  import { QuasarPluginOptions } from 'quasar';
3
3
  import { Pinia } from 'pinia';
4
4
  import { RouteRecordRaw, RouterHistory, Router } from 'vue-router';
5
- import { H as HttpClient } from '../catalog-C4Gv2_KM.cjs';
6
- import { S as SuperAdminGuardOptions, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, A as ActionsMap, c as SuperAdminLoginAdapter, U as UiNotify, I as InstallPlugin, d as SuperAdminI18nOptions, e as SuperAdminI18n } from '../use-super-admin-i18n-BdPqeTHl.cjs';
5
+ import { H as HttpClient } from '../catalog-JXdKdIqG.cjs';
6
+ import { S as SuperAdminGuardOptions, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, A as ActionsMap, c as SuperAdminLoginAdapter, U as UiNotify, I as InstallPlugin, d as SuperAdminI18nOptions, e as SuperAdminI18n } from '../use-super-admin-i18n-1nCOkvgi.cjs';
7
7
  import '@saasicat/types';
8
8
 
9
9
  interface CreateSuperAdminAppOptions extends SuperAdminGuardOptions {
@@ -2,8 +2,8 @@ import { Component, App } from 'vue';
2
2
  import { QuasarPluginOptions } from 'quasar';
3
3
  import { Pinia } from 'pinia';
4
4
  import { RouteRecordRaw, RouterHistory, Router } from 'vue-router';
5
- import { H as HttpClient } from '../catalog-C4Gv2_KM.js';
6
- import { S as SuperAdminGuardOptions, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, A as ActionsMap, c as SuperAdminLoginAdapter, U as UiNotify, I as InstallPlugin, d as SuperAdminI18nOptions, e as SuperAdminI18n } from '../use-super-admin-i18n-uteRCL9q.js';
5
+ import { H as HttpClient } from '../catalog-JXdKdIqG.js';
6
+ import { S as SuperAdminGuardOptions, a as SuperAdminBrand, b as SuperAdminEndpoints, E as ExtensionsMap, A as ActionsMap, c as SuperAdminLoginAdapter, U as UiNotify, I as InstallPlugin, d as SuperAdminI18nOptions, e as SuperAdminI18n } from '../use-super-admin-i18n-BlqcD0N7.js';
7
7
  import '@saasicat/types';
8
8
 
9
9
  interface CreateSuperAdminAppOptions extends SuperAdminGuardOptions {
@@ -10,10 +10,10 @@ import {
10
10
  SUPER_ADMIN_NOTIFY_KEY,
11
11
  buildNavigationGuard,
12
12
  createSuperAdminI18n
13
- } from "../chunk-247RJPU4.js";
13
+ } from "../chunk-Y5MWMWMD.js";
14
14
  import {
15
15
  defaultHttpClient
16
- } from "../chunk-IZGFS5RS.js";
16
+ } from "../chunk-CC4WK3DC.js";
17
17
 
18
18
  // src/quasar/create-super-admin-app.ts
19
19
  import { createApp } from "vue";
@@ -1,7 +1,7 @@
1
1
  import { Component, App, InjectionKey, Ref, ComputedRef } from 'vue';
2
2
  import { NavigationGuardWithThis } from 'vue-router';
3
3
  import { ActionKey, ComponentKey, AdminManifest } from '@saasicat/types';
4
- import { A as ActionHandler, H as HttpClient, S as SaLocale, a as SaMessages, b as SaLocaleOption, c as SaLocaleDefinition, d as SaMessagesOverrides, K as KvStore } from './catalog-C4Gv2_KM.cjs';
4
+ import { A as ActionHandler, H as HttpClient, S as SaLocale, a as SaMessages, b as SaLocaleOption, c as SaLocaleDefinition, d as SaMessagesOverrides, K as KvStore } from './catalog-JXdKdIqG.cjs';
5
5
 
6
6
  /**
7
7
  * App-specific branding data that the platform `AdminLayout` and other
@@ -1,7 +1,7 @@
1
1
  import { Component, App, InjectionKey, Ref, ComputedRef } from 'vue';
2
2
  import { NavigationGuardWithThis } from 'vue-router';
3
3
  import { ActionKey, ComponentKey, AdminManifest } from '@saasicat/types';
4
- import { A as ActionHandler, H as HttpClient, S as SaLocale, a as SaMessages, b as SaLocaleOption, c as SaLocaleDefinition, d as SaMessagesOverrides, K as KvStore } from './catalog-C4Gv2_KM.js';
4
+ import { A as ActionHandler, H as HttpClient, S as SaLocale, a as SaMessages, b as SaLocaleOption, c as SaLocaleDefinition, d as SaMessagesOverrides, K as KvStore } from './catalog-JXdKdIqG.js';
5
5
 
6
6
  /**
7
7
  * App-specific branding data that the platform `AdminLayout` and other
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasicat/ui-vue",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Vue 3 components, resource clients and composables for the SuperAdmin UI shell. Provides boot and manifest loaders, navigation, actions and standard pages.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -53,7 +53,7 @@
53
53
  "src"
54
54
  ],
55
55
  "dependencies": {
56
- "@saasicat/types": "^0.17.0"
56
+ "@saasicat/types": "^0.18.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "pinia": "^2.0.0 || ^3.0.0",
@@ -40,20 +40,3 @@ export const SA_LOCALE_LABELS: Record<SaBuiltinLocale, string> = {
40
40
  export function isSaBuiltinLocale(value: unknown): value is SaBuiltinLocale {
41
41
  return typeof value === 'string' && (SA_LOCALES as readonly string[]).includes(value);
42
42
  }
43
-
44
- /**
45
- * The built-in catalog a locale reads from. Helper modules that index the raw
46
- * catalogs (rather than the resolved one from `useSaMessages`) need this: a
47
- * language an app added has no entry there, and indexing it would yield
48
- * `undefined` and take the page down.
49
- *
50
- * Strings resolved this way stay in the fallback language for an app-supplied
51
- * locale — migrating those helpers to the resolved catalog is tracked
52
- * separately.
53
- */
54
- export function builtinLocaleOf(
55
- locale: SaLocale | undefined,
56
- fallback: SaBuiltinLocale = DEFAULT_SA_LOCALE,
57
- ): SaBuiltinLocale {
58
- return isSaBuiltinLocale(locale) ? locale : fallback;
59
- }
@@ -99,7 +99,7 @@ function statusOf(v: BundleVersionRow) {
99
99
  }
100
100
 
101
101
  function statusMetaOf(v: BundleVersionRow): BundleStatusMeta {
102
- return bundleStatusMeta(statusOf(v), locale.value);
102
+ return bundleStatusMeta(statusOf(v), msg.value);
103
103
  }
104
104
  </script>
105
105
 
@@ -6,13 +6,8 @@
6
6
 
7
7
  import type { BundleVersionRow, PlanVersionRow } from '@saasicat/types';
8
8
 
9
- import {
10
- SA_INTL_LOCALES,
11
- builtinLocaleOf,
12
- type SaBuiltinLocale,
13
- type SaLocale,
14
- } from '../../client/i18n/locale.js';
15
- import { bundlesMessages } from '../../client/i18n/messages/bundles.js';
9
+ import { SA_INTL_LOCALES, type SaBuiltinLocale, type SaLocale } from '../../client/i18n/locale.js';
10
+ import type { SaMessages } from '../../client/i18n/messages.js';
16
11
 
17
12
  /** UI lifecycle status of a single BundleVersion. */
18
13
  export type BundleVersionUiStatus = 'draft' | 'live' | 'scheduled' | 'superseded';
@@ -67,12 +62,16 @@ const BUNDLE_STATUS_CLASS: Record<BundleAggregateStatus, BundleStatusMeta['cls']
67
62
  retired: 'supersed',
68
63
  };
69
64
 
70
- /** Label, chip class and tooltip for a status in the given UI locale. */
65
+ /**
66
+ * Label, chip class and tooltip for a status. Takes the resolved slice rather
67
+ * than a locale code — that is what lets an app-supplied language and
68
+ * `i18n.overrides` reach these labels.
69
+ */
71
70
  export function bundleStatusMeta(
72
71
  status: BundleAggregateStatus,
73
- locale: SaLocale,
72
+ bundles: SaMessages['bundles'],
74
73
  ): BundleStatusMeta {
75
- const texts = bundlesMessages[builtinLocaleOf(locale)].status[status];
74
+ const texts = bundles.status[status];
76
75
  return { label: texts.label, cls: BUNDLE_STATUS_CLASS[status], tooltip: texts.tooltip };
77
76
  }
78
77
 
@@ -195,7 +195,7 @@ const statusFilterOptions = computed<Array<{ label: string; value: DiscoveryStat
195
195
  () => [
196
196
  { label: msg.value.statusFilterAll, value: 'all' },
197
197
  ...(['pending', 'approved', 'outdated', 'obsolete'] as const).map((status) => ({
198
- label: statusLabel(status, locale.value),
198
+ label: statusLabel(status, msg.value),
199
199
  value: status,
200
200
  })),
201
201
  ],
@@ -50,7 +50,7 @@ import {
50
50
  type BundleAggregateStatus,
51
51
  } from '../../components/bundle-editor/bundle-version-status.js';
52
52
  import { formatMessage } from '../../client/i18n/format.js';
53
- import { useSaMessages, useSuperAdminI18n } from '../../vue/use-super-admin-i18n.js';
53
+ import { useSaMessages } from '../../vue/use-super-admin-i18n.js';
54
54
 
55
55
  const props = defineProps<{
56
56
  filteredBundles: BundleRow[];
@@ -69,10 +69,9 @@ const emit = defineEmits<{
69
69
  }>();
70
70
 
71
71
  const msg = useSaMessages('bundles');
72
- const { locale } = useSuperAdminI18n();
73
72
 
74
73
  function statusMetaOf(bundle: BundleRow) {
75
- return bundleStatusMeta(props.aggregateStatusOf(bundle), locale.value);
74
+ return bundleStatusMeta(props.aggregateStatusOf(bundle), msg.value);
76
75
  }
77
76
 
78
77
  function statusClass(bundle: BundleRow): string {
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
  <div class="sa-trans-fields">
11
11
  <div v-for="f in fields" :key="f" class="sa-trans-field">
12
- <label class="sa-trans-field__cap">{{ i18nFieldLabel(f, uiLocale) }}</label>
12
+ <label class="sa-trans-field__cap">{{ i18nFieldLabel(f, msg, common) }}</label>
13
13
  <q-input
14
14
  v-if="f !== 'unit'"
15
15
  dense
@@ -47,7 +47,7 @@
47
47
  </div>
48
48
  <div class="sa-trans-fields">
49
49
  <div v-for="f in fields" :key="f" class="sa-trans-field">
50
- <label class="sa-trans-field__cap">{{ i18nFieldLabel(f, uiLocale) }}</label>
50
+ <label class="sa-trans-field__cap">{{ i18nFieldLabel(f, msg, common) }}</label>
51
51
  <q-input
52
52
  dense
53
53
  outlined
@@ -71,7 +71,7 @@
71
71
  import { computed, reactive } from 'vue';
72
72
  import type { CatalogEntryI18nFields } from '@saasicat/types';
73
73
  import { formatMessage } from '../../client/i18n/format.js';
74
- import { useSaMessages, useSuperAdminI18n } from '../../vue/use-super-admin-i18n.js';
74
+ import { useSaMessages } from '../../vue/use-super-admin-i18n.js';
75
75
  import {
76
76
  DISCOVERY_DEFAULT_LOCALE,
77
77
  i18nFieldLabel,
@@ -107,7 +107,7 @@ const emit = defineEmits<{
107
107
 
108
108
  const msg = useSaMessages('discovery');
109
109
  // Renamed: `locale` is the catalog-entry data locale everywhere else in this file.
110
- const { locale: uiLocale } = useSuperAdminI18n();
110
+ const common = useSaMessages('common');
111
111
 
112
112
  const targetLocales = computed(() => props.activeLocales.filter((l) => l !== props.defaultLocale));
113
113
 
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="sa-stc" @click.stop>
3
3
  <span class="sa-review" :class="`sa-review--${status}`">
4
- {{ statusLabel(status, locale) }}
5
- <q-tooltip>{{ statusHint(status, locale) }}</q-tooltip>
4
+ {{ statusLabel(status, msg) }}
5
+ <q-tooltip>{{ statusHint(status, msg) }}</q-tooltip>
6
6
  </span>
7
7
  <q-btn
8
8
  dense
@@ -15,7 +15,7 @@
15
15
  :loading="busy"
16
16
  @click="emit('set-status', primary.to)"
17
17
  >
18
- <q-tooltip>{{ statusHint(primary.to, locale) }}</q-tooltip>
18
+ <q-tooltip>{{ statusHint(primary.to, msg) }}</q-tooltip>
19
19
  </q-btn>
20
20
  <q-btn v-if="menu.length" dense flat round size="sm" icon="more_horiz">
21
21
  <q-menu auto-close anchor="bottom right" self="top right">
@@ -39,7 +39,7 @@
39
39
  <script setup lang="ts">
40
40
  import { computed } from 'vue';
41
41
  import type { DiscoveryStatus } from '@saasicat/types';
42
- import { useSuperAdminI18n } from '../../vue/use-super-admin-i18n.js';
42
+ import { useSaMessages } from '../../vue/use-super-admin-i18n.js';
43
43
  import { primaryReviewAction, reviewMenuActions, statusHint, statusLabel } from './discovery-ui.js';
44
44
 
45
45
  // StatusControl (#20, design sim): status chip + contextual primary action
@@ -57,10 +57,10 @@ const emit = defineEmits<{
57
57
  'set-status': [target: DiscoveryStatus];
58
58
  }>();
59
59
 
60
- const { locale } = useSuperAdminI18n();
60
+ const msg = useSaMessages('discovery');
61
61
 
62
- const primary = computed(() => primaryReviewAction(props.status, locale.value));
63
- const menu = computed(() => reviewMenuActions(props.status, locale.value));
62
+ const primary = computed(() => primaryReviewAction(props.status, msg.value));
63
+ const menu = computed(() => reviewMenuActions(props.status, msg.value));
64
64
  </script>
65
65
 
66
66
  <style scoped>
@@ -4,9 +4,14 @@
4
4
  // labels/colors/coverage calculations.
5
5
 
6
6
  import type { CatalogEntryI18n, DiscoveryStatus } from '@saasicat/types';
7
- import { DEFAULT_SA_LOCALE, builtinLocaleOf, type SaLocale } from '../../client/i18n/locale.js';
8
- import { commonMessages } from '../../client/i18n/messages/common.js';
9
- import { discoveryMessages } from '../../client/i18n/messages/discovery.js';
7
+ import type { SaMessages } from '../../client/i18n/messages.js';
8
+
9
+ // The resolved slices these helpers render from. Taking the catalog rather
10
+ // than a locale code is what lets an app-supplied language and `i18n.overrides`
11
+ // reach them — a raw `discoveryMessages[locale]` lookup only ever sees the two
12
+ // catalogs the platform ships.
13
+ type SaDiscoveryMessages = SaMessages['discovery'];
14
+ type SaCommonMessages = SaMessages['common'];
10
15
 
11
16
  /** Translatable fields of a catalog entry. */
12
17
  export type I18nField = 'label' | 'description' | 'unit';
@@ -42,20 +47,24 @@ export function localeFull(locale: string): string {
42
47
  return LOCALE_NAMES[locale]?.full ?? locale;
43
48
  }
44
49
 
45
- export function i18nFieldLabel(f: I18nField, locale: SaLocale = DEFAULT_SA_LOCALE): string {
46
- if (f === 'label') return discoveryMessages[builtinLocaleOf(locale)].trans.fieldLabel;
47
- if (f === 'description') return commonMessages[builtinLocaleOf(locale)].description;
48
- return discoveryMessages[builtinLocaleOf(locale)].unit;
50
+ export function i18nFieldLabel(
51
+ f: I18nField,
52
+ discovery: SaDiscoveryMessages,
53
+ common: SaCommonMessages,
54
+ ): string {
55
+ if (f === 'label') return discovery.trans.fieldLabel;
56
+ if (f === 'description') return common.description;
57
+ return discovery.unit;
49
58
  }
50
59
 
51
60
  // ─── Approval lifecycle (#20): status display + state machine ────────────────
52
61
 
53
- export function statusLabel(status: DiscoveryStatus, locale: SaLocale = DEFAULT_SA_LOCALE): string {
54
- return discoveryMessages[builtinLocaleOf(locale)].statusLabels[status];
62
+ export function statusLabel(status: DiscoveryStatus, discovery: SaDiscoveryMessages): string {
63
+ return discovery.statusLabels[status];
55
64
  }
56
65
 
57
- export function statusHint(status: DiscoveryStatus, locale: SaLocale = DEFAULT_SA_LOCALE): string {
58
- return discoveryMessages[builtinLocaleOf(locale)].statusHints[status];
66
+ export function statusHint(status: DiscoveryStatus, discovery: SaDiscoveryMessages): string {
67
+ return discovery.statusHints[status];
59
68
  }
60
69
 
61
70
  export interface ReviewAction {
@@ -69,9 +78,9 @@ export interface ReviewAction {
69
78
  /** Primary action per status (design sim `StatusControl`, #20). */
70
79
  export function primaryReviewAction(
71
80
  status: DiscoveryStatus,
72
- locale: SaLocale = DEFAULT_SA_LOCALE,
81
+ discovery: SaDiscoveryMessages,
73
82
  ): ReviewAction {
74
- const actions = discoveryMessages[builtinLocaleOf(locale)].reviewActions;
83
+ const actions = discovery.reviewActions;
75
84
  switch (status) {
76
85
  case 'pending':
77
86
  return { label: actions.approve, to: 'approved', emphasized: true };
@@ -87,9 +96,9 @@ export function primaryReviewAction(
87
96
  /** Kebab menu actions per status (design sim `StatusControl`, #20). */
88
97
  export function reviewMenuActions(
89
98
  status: DiscoveryStatus,
90
- locale: SaLocale = DEFAULT_SA_LOCALE,
99
+ discovery: SaDiscoveryMessages,
91
100
  ): ReviewAction[] {
92
- const actions = discoveryMessages[builtinLocaleOf(locale)].reviewActions;
101
+ const actions = discovery.reviewActions;
93
102
  const markObsolete: ReviewAction = {
94
103
  label: actions.markObsolete,
95
104
  to: 'obsolete',
@@ -73,7 +73,7 @@
73
73
  <script setup lang="ts">
74
74
  import { computed } from 'vue';
75
75
  import { formatMessage } from '../../client/i18n/format.js';
76
- import { useSaMessages, useSuperAdminI18n } from '../../vue/use-super-admin-i18n.js';
76
+ import { useSaMessages } from '../../vue/use-super-admin-i18n.js';
77
77
  import type { CatalogSnapshot } from './catalog-history.types.js';
78
78
  import { formatRelative } from './format.js';
79
79
 
@@ -91,7 +91,6 @@ const emit = defineEmits<{
91
91
  }>();
92
92
 
93
93
  const msg = useSaMessages('planVersions');
94
- const { locale } = useSuperAdminI18n();
95
94
 
96
95
  const snapshotCountLabel = computed(() =>
97
96
  formatMessage(msg.value.timeline.snapshotCount, { count: props.snapshots.length }),
@@ -109,7 +108,7 @@ function metaText(s: CatalogSnapshot): string {
109
108
  ? msg.value.timeline.noOpenDrafts
110
109
  : formatMessage(msg.value.timeline.openCount, { count: s.draftCount });
111
110
  }
112
- if (s.publishedAt) return formatRelative(s.publishedAt, locale.value);
111
+ if (s.publishedAt) return formatRelative(s.publishedAt, msg.value);
113
112
  return msg.value.timeline.unknown;
114
113
  }
115
114
  </script>
@@ -1,22 +1,21 @@
1
1
  // Formatting helper retained for the reusable catalog-history timeline.
2
2
 
3
3
  import { formatMessage } from '../../client/i18n/format.js';
4
- import { DEFAULT_SA_LOCALE, builtinLocaleOf, type SaLocale } from '../../client/i18n/locale.js';
5
- import { planVersionsMessages } from '../../client/i18n/messages/plan-versions.js';
4
+ import type { SaMessages } from '../../client/i18n/messages.js';
6
5
 
7
- const EMPTY_VALUE = '—';
6
+ // The resolved slice, not a locale code: only this way do an app-supplied
7
+ // language and `i18n.overrides` reach the relative-date wording.
8
+ type SaPlanVersionsMessages = SaMessages['planVersions'];
8
9
 
9
- function texts(locale: SaLocale) {
10
- return planVersionsMessages[builtinLocaleOf(locale)].format;
11
- }
10
+ const EMPTY_VALUE = '—';
12
11
 
13
12
  export function formatRelative(
14
13
  iso: string | undefined,
15
- locale: SaLocale = DEFAULT_SA_LOCALE,
14
+ planVersions: SaPlanVersionsMessages,
16
15
  now: Date = new Date(),
17
16
  ): string {
18
17
  if (!iso) return EMPTY_VALUE;
19
- const msg = texts(locale);
18
+ const msg = planVersions.format;
20
19
  const d = new Date(iso);
21
20
  const diffMs = now.getTime() - d.getTime();
22
21
  const days = Math.floor(diffMs / 86_400_000);