@saasicat/ui-vue 0.18.0 → 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.0",
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.0"
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
  }
@@ -481,44 +481,27 @@ async function doSubmit(code: string): Promise<void> {
481
481
  }
482
482
  </script>
483
483
 
484
+ <style src="./pilot-dialog.css" scoped></style>
485
+
484
486
  <style scoped>
485
487
  .pl-dlg {
486
488
  width: 760px;
487
489
  max-width: 96vw;
488
490
  }
489
- .pl-dlg__head {
490
- display: flex;
491
- align-items: flex-start;
492
- gap: 16px;
493
- padding: 18px 22px 14px;
494
- border-bottom: 1px solid var(--sa-border, #e2e8f0);
495
- }
496
- .pl-dlg__title {
497
- font-family: var(--sa-font-head, system-ui, sans-serif);
498
- font-weight: 700;
499
- font-size: 17px;
500
- color: var(--sa-heading, #0f172a);
501
- letter-spacing: -0.015em;
502
- }
491
+
503
492
  .pl-dlg__sub {
504
493
  font-size: 12.5px;
505
494
  color: var(--sa-muted, #64748b);
506
495
  margin-top: 3px;
507
496
  line-height: 1.4;
508
497
  }
509
- .pl-dlg__close {
510
- margin-left: auto;
511
- }
498
+
512
499
  .pl-dlg__body {
513
500
  padding: 20px 22px;
514
501
  max-height: 72vh;
515
502
  overflow-y: auto;
516
503
  }
517
- .pl-dlg__foot {
518
- border-top: 1px solid var(--sa-border, #e2e8f0);
519
- background: #fbfbfd;
520
- padding: 12px 18px;
521
- }
504
+
522
505
  .pl-foot-hint {
523
506
  margin-right: auto;
524
507
  display: inline-flex;
@@ -535,53 +518,23 @@ async function doSubmit(code: string): Promise<void> {
535
518
  .pl-section {
536
519
  margin-bottom: 20px;
537
520
  }
538
- .pl-section:last-of-type {
539
- margin-bottom: 4px;
540
- }
541
- .pl-section__head {
542
- display: flex;
543
- align-items: flex-start;
544
- gap: 12px;
545
- margin-bottom: 12px;
546
- padding-bottom: 10px;
547
- border-bottom: 1px solid #f1f5f9;
548
- }
549
- .pl-section__num {
550
- width: 24px;
551
- height: 24px;
552
- background: #eff6ff;
553
- color: #1d4ed8;
554
- border-radius: 50%;
555
- font: 700 12px var(--sa-font-body, system-ui, sans-serif);
556
- display: grid;
557
- place-items: center;
558
- flex: 0 0 auto;
559
- }
560
- .pl-section__title {
561
- font-size: 13.5px;
562
- font-weight: 700;
563
- color: var(--sa-heading, #0f172a);
564
- letter-spacing: -0.005em;
565
- }
566
- .pl-section__sub {
567
- font-size: 11.5px;
568
- color: #94a3b8;
569
- margin-top: 2px;
570
- }
571
521
 
572
522
  .pl-grid {
573
523
  display: grid;
574
524
  grid-template-columns: 1fr 1fr;
575
525
  gap: 12px 14px;
576
526
  }
527
+
577
528
  .pl-field {
578
529
  display: flex;
579
530
  flex-direction: column;
580
531
  gap: 5px;
581
532
  }
533
+
582
534
  .pl-field--full {
583
535
  grid-column: 1 / -1;
584
536
  }
537
+
585
538
  .pl-field label {
586
539
  font: 600 11px var(--sa-font-body, system-ui, sans-serif);
587
540
  letter-spacing: 0.04em;
@@ -591,6 +544,7 @@ async function doSubmit(code: string): Promise<void> {
591
544
  align-items: baseline;
592
545
  gap: 6px;
593
546
  }
547
+
594
548
  .pl-field__hint {
595
549
  font-weight: 500;
596
550
  text-transform: none;
@@ -598,34 +552,20 @@ async function doSubmit(code: string): Promise<void> {
598
552
  color: #94a3b8;
599
553
  font-size: 11px;
600
554
  }
555
+
601
556
  .pl-field__error {
602
557
  font-size: 11.5px;
603
558
  color: #b91c1c;
604
559
  }
605
560
 
606
- .pl-input {
607
- width: 100%;
608
- padding: 9px 12px;
609
- background: #fff;
610
- border: 1px solid var(--sa-border, #e2e8f0);
611
- border-radius: 8px;
612
- font: 13px var(--sa-font-body, system-ui, sans-serif);
613
- color: var(--sa-body, #1e293b);
614
- outline: 0;
615
- transition:
616
- border-color 0.12s,
617
- box-shadow 0.12s;
618
- }
619
- .pl-input:focus {
620
- border-color: var(--sa-primary, #3f6bff);
621
- box-shadow: 0 0 0 3px rgba(63, 107, 255, 0.12);
622
- }
623
561
  .pl-input--invalid {
624
562
  border-color: #fca5a5;
625
563
  }
564
+
626
565
  .pl-input::placeholder {
627
566
  color: #cbd5e1;
628
567
  }
568
+
629
569
  .pl-textarea {
630
570
  resize: vertical;
631
571
  min-height: 64px;
@@ -640,6 +580,7 @@ async function doSubmit(code: string): Promise<void> {
640
580
  border-radius: 8px;
641
581
  overflow: hidden;
642
582
  }
583
+
643
584
  .pl-slug-input__prefix {
644
585
  padding: 9px 12px;
645
586
  background: #f8fafc;
@@ -648,128 +589,14 @@ async function doSubmit(code: string): Promise<void> {
648
589
  border-right: 1px solid var(--sa-border, #e2e8f0);
649
590
  white-space: nowrap;
650
591
  }
592
+
651
593
  .pl-input--flush {
652
594
  border: 0 !important;
653
595
  border-radius: 0 !important;
654
596
  box-shadow: none !important;
655
597
  }
598
+
656
599
  .pl-input--flush:focus {
657
600
  box-shadow: none !important;
658
601
  }
659
-
660
- .pl-plan-select {
661
- display: flex;
662
- flex-direction: column;
663
- gap: 5px;
664
- }
665
- .pl-plan-opt {
666
- display: flex;
667
- align-items: center;
668
- gap: 10px;
669
- padding: 8px 11px;
670
- background: #fff;
671
- border: 1px solid var(--sa-border, #e2e8f0);
672
- border-radius: 8px;
673
- cursor: pointer;
674
- text-align: left;
675
- font-family: var(--sa-font-body, system-ui, sans-serif);
676
- transition:
677
- border-color 0.12s,
678
- background 0.12s;
679
- }
680
- .pl-plan-opt:hover {
681
- border-color: #93c5fd;
682
- background: #fafbff;
683
- }
684
- .pl-plan-opt--active {
685
- border-color: var(--sa-primary, #2563eb);
686
- background: #eff6ff;
687
- box-shadow: 0 0 0 1px var(--sa-primary, #2563eb) inset;
688
- }
689
- .pl-plan-opt__dot {
690
- width: 10px;
691
- height: 10px;
692
- border-radius: 50%;
693
- flex: 0 0 auto;
694
- }
695
- .pl-plan-opt__text {
696
- display: flex;
697
- flex-direction: column;
698
- flex: 1;
699
- min-width: 0;
700
- }
701
- .pl-plan-opt__key {
702
- font: 700 11px var(--sa-font-mono, ui-monospace, monospace);
703
- letter-spacing: 0.05em;
704
- color: var(--sa-heading, #0f172a);
705
- }
706
- .pl-plan-opt__label {
707
- font-size: 11px;
708
- color: var(--sa-muted, #64748b);
709
- margin-top: 1px;
710
- }
711
- .pl-plan-opt__check {
712
- color: #1d4ed8;
713
- }
714
-
715
- .pl-end-row {
716
- display: flex;
717
- align-items: center;
718
- gap: 6px;
719
- }
720
- .pl-end-row .pl-input {
721
- flex: 1;
722
- }
723
- .pl-btn-mini {
724
- display: inline-flex;
725
- align-items: center;
726
- gap: 4px;
727
- padding: 7px 10px;
728
- background: #fff;
729
- border: 1px solid var(--sa-border, #e2e8f0);
730
- border-radius: 7px;
731
- color: var(--sa-muted-dark, #475569);
732
- font: 500 11.5px var(--sa-font-body, system-ui, sans-serif);
733
- cursor: pointer;
734
- white-space: nowrap;
735
- }
736
- .pl-btn-mini:hover {
737
- background: #f8fafc;
738
- border-color: #cbd5e1;
739
- }
740
- .pl-end-presets {
741
- display: flex;
742
- flex-wrap: wrap;
743
- gap: 5px;
744
- margin-top: 5px;
745
- }
746
- .pl-preset-btn {
747
- padding: 4px 9px;
748
- background: #fff;
749
- border: 1px dashed #cbd5e1;
750
- border-radius: 999px;
751
- font: 600 11px var(--sa-font-body, system-ui, sans-serif);
752
- color: var(--sa-muted-dark, #475569);
753
- cursor: pointer;
754
- transition:
755
- background 0.12s,
756
- border-color 0.12s,
757
- color 0.12s;
758
- }
759
- .pl-preset-btn:hover {
760
- background: #eff6ff;
761
- border-color: #93c5fd;
762
- border-style: solid;
763
- color: #1d4ed8;
764
- }
765
-
766
- .pl-error {
767
- background: #fef2f2;
768
- border: 1px solid #fecaca;
769
- color: #b91c1c;
770
- font-size: 13px;
771
- margin: 12px 0 0;
772
- padding: 8px 12px;
773
- border-radius: 8px;
774
- }
775
602
  </style>