@saasicat/ui-vue 0.18.1 → 0.19.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.
@@ -79,11 +79,9 @@ function mergeMessages(base, overrides) {
79
79
  }
80
80
 
81
81
  // src/client/i18n/format.ts
82
+ import { formatErrorMessage } from "@saasicat/types";
82
83
  function formatMessage(template, params) {
83
- return template.replace(/\{(\w+)\}/g, (match, name) => {
84
- const value = params[name];
85
- return value === void 0 ? match : String(value);
86
- });
84
+ return formatErrorMessage(template, params);
87
85
  }
88
86
 
89
87
  // src/client/i18n/currency.ts
@@ -4,7 +4,7 @@ import {
4
4
  defaultKvStore,
5
5
  isSaBuiltinLocale,
6
6
  navMessages
7
- } from "./chunk-CC4WK3DC.js";
7
+ } from "./chunk-DPTIOQXX.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-CC4WK3DC.js";
4
+ } from "./chunk-DPTIOQXX.js";
5
5
 
6
6
  // src/vue/super-admin-context.ts
7
7
  var SUPER_ADMIN_BRAND_KEY = /* @__PURE__ */ Symbol.for(
@@ -732,11 +732,9 @@ function queryString(params) {
732
732
  }
733
733
 
734
734
  // src/client/i18n/format.ts
735
+ var import_types4 = require("@saasicat/types");
735
736
  function formatMessage(template, params) {
736
- return template.replace(/\{(\w+)\}/g, (match, name) => {
737
- const value = params[name];
738
- return value === void 0 ? match : String(value);
739
- });
737
+ return (0, import_types4.formatErrorMessage)(template, params);
740
738
  }
741
739
 
742
740
  // src/client/i18n/currency.ts
@@ -21,7 +21,7 @@ import {
21
21
  resolveExtension,
22
22
  resolveLoginBranding,
23
23
  trimTrailingSlashes
24
- } from "../chunk-VRCVJTY4.js";
24
+ } from "../chunk-ORX3ZG47.js";
25
25
  import {
26
26
  DEFAULT_SA_LOCALE,
27
27
  SA_INTL_LOCALES,
@@ -37,7 +37,7 @@ import {
37
37
  isSaBuiltinLocale,
38
38
  mergeMessages,
39
39
  resolveMessages
40
- } from "../chunk-CC4WK3DC.js";
40
+ } from "../chunk-DPTIOQXX.js";
41
41
  export {
42
42
  ADMIN_UI_VERSION,
43
43
  ActionDefNotInManifestError,
package/dist/index.cjs CHANGED
@@ -807,11 +807,9 @@ function queryString(params) {
807
807
  }
808
808
 
809
809
  // src/client/i18n/format.ts
810
+ var import_types4 = require("@saasicat/types");
810
811
  function formatMessage(template, params) {
811
- return template.replace(/\{(\w+)\}/g, (match, name) => {
812
- const value = params[name];
813
- return value === void 0 ? match : String(value);
814
- });
812
+ return (0, import_types4.formatErrorMessage)(template, params);
815
813
  }
816
814
 
817
815
  // src/client/i18n/currency.ts
@@ -4515,7 +4513,7 @@ function useTenantBilling(options = {}) {
4515
4513
 
4516
4514
  // src/vue/use-subscription-draft.ts
4517
4515
  var import_vue12 = require("vue");
4518
- var import_types11 = require("@saasicat/types");
4516
+ var import_types12 = require("@saasicat/types");
4519
4517
  var DEFAULT_YEARLY_FACTOR = 10;
4520
4518
  function unwrap(source) {
4521
4519
  if (source && typeof source === "object" && "value" in source) {
@@ -4555,7 +4553,7 @@ function useSubscriptionDraft(options) {
4555
4553
  const planFeatures = selectedPlan.value?.features ?? [];
4556
4554
  const selected = selectedBundles.value;
4557
4555
  const keptIds = new Set(
4558
- (0, import_types11.selectChargeableBundles)(planFeatures, selected).map((b) => b.bundleVersionId)
4556
+ (0, import_types12.selectChargeableBundles)(planFeatures, selected).map((b) => b.bundleVersionId)
4559
4557
  );
4560
4558
  return selected.filter((b) => keptIds.has(b.bundleVersionId));
4561
4559
  });
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  resolveExtension,
22
22
  resolveLoginBranding,
23
23
  trimTrailingSlashes
24
- } from "./chunk-VRCVJTY4.js";
24
+ } from "./chunk-ORX3ZG47.js";
25
25
  import {
26
26
  SA_LOCALE_STORAGE_KEY,
27
27
  SUPER_ADMIN_ACTIONS_KEY,
@@ -37,7 +37,7 @@ import {
37
37
  createSuperAdminI18n,
38
38
  useSaMessages,
39
39
  useSuperAdminI18n
40
- } from "./chunk-Y5MWMWMD.js";
40
+ } from "./chunk-RVG6LQHL.js";
41
41
  import {
42
42
  DEFAULT_SA_LOCALE,
43
43
  SA_INTL_LOCALES,
@@ -53,7 +53,7 @@ import {
53
53
  isSaBuiltinLocale,
54
54
  mergeMessages,
55
55
  resolveMessages
56
- } from "./chunk-CC4WK3DC.js";
56
+ } from "./chunk-DPTIOQXX.js";
57
57
 
58
58
  // src/vue/use-super-admin-context.ts
59
59
  import { inject } from "vue";
@@ -167,6 +167,9 @@ function mergeMessages(base, overrides) {
167
167
  return result;
168
168
  }
169
169
 
170
+ // src/client/i18n/format.ts
171
+ var import_types = require("@saasicat/types");
172
+
170
173
  // src/client/i18n/messages/audit.ts
171
174
  var auditMessages = defineMessages(
172
175
  {
@@ -10,10 +10,10 @@ import {
10
10
  SUPER_ADMIN_NOTIFY_KEY,
11
11
  buildNavigationGuard,
12
12
  createSuperAdminI18n
13
- } from "../chunk-Y5MWMWMD.js";
13
+ } from "../chunk-RVG6LQHL.js";
14
14
  import {
15
15
  defaultHttpClient
16
- } from "../chunk-CC4WK3DC.js";
16
+ } from "../chunk-DPTIOQXX.js";
17
17
 
18
18
  // src/quasar/create-super-admin-app.ts
19
19
  import { createApp } from "vue";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasicat/ui-vue",
3
- "version": "0.18.1",
3
+ "version": "0.19.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.18.1"
56
+ "@saasicat/types": "^0.19.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "pinia": "^2.0.0 || ^3.0.0",
@@ -1,12 +1,15 @@
1
1
  // Placeholder interpolation for catalog messages: `{name}` is replaced with
2
2
  // `params.name`. Unknown placeholders stay verbatim so a missing param is
3
3
  // visible in the UI instead of silently disappearing.
4
+ //
5
+ // The implementation lives in `@saasicat/types` because the shipped error-text
6
+ // catalogue needs the same interpolation and must not depend on a UI package.
7
+ // This stays as the name the UI code already imports.
8
+
9
+ import { formatErrorMessage } from '@saasicat/types';
4
10
 
5
11
  export type MessageParams = Record<string, string | number>;
6
12
 
7
13
  export function formatMessage(template: string, params: MessageParams): string {
8
- return template.replace(/\{(\w+)\}/g, (match, name: string) => {
9
- const value = params[name];
10
- return value === undefined ? match : String(value);
11
- });
14
+ return formatErrorMessage(template, params);
12
15
  }