@scalio-cloud/ui 0.109.0 → 0.110.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 (37) hide show
  1. package/dist/app-kit/ScalioFactoryReset.d.ts +15 -0
  2. package/dist/app-kit/ScalioFactoryReset.d.ts.map +1 -0
  3. package/dist/app-kit/ScalioLicensePanel.d.ts +23 -0
  4. package/dist/app-kit/ScalioLicensePanel.d.ts.map +1 -0
  5. package/dist/app-kit/ScalioLoginPage.d.ts +1 -1
  6. package/dist/app-kit/ScalioLoginPage.d.ts.map +1 -1
  7. package/dist/app-kit/ScalioMailSettings.d.ts +13 -0
  8. package/dist/app-kit/ScalioMailSettings.d.ts.map +1 -0
  9. package/dist/app-kit/ScalioRoleTenants.d.ts +22 -0
  10. package/dist/app-kit/ScalioRoleTenants.d.ts.map +1 -0
  11. package/dist/app-kit/_uiReact.d.ts +307 -0
  12. package/dist/app-kit/_uiReact.d.ts.map +1 -0
  13. package/dist/app-kit/index.d.ts +4 -0
  14. package/dist/app-kit/index.d.ts.map +1 -1
  15. package/dist/app-kit/index.js +303 -106
  16. package/dist/app-kit/index.js.map +1 -1
  17. package/dist/app-kit/index.mjs +213 -40
  18. package/dist/app-kit/index.mjs.map +1 -1
  19. package/dist/config/i18nCheck.d.ts +49 -0
  20. package/dist/config/i18nCheck.d.ts.map +1 -0
  21. package/dist/config/index.d.ts +2 -0
  22. package/dist/config/index.d.ts.map +1 -1
  23. package/dist/config/index.js +187 -4
  24. package/dist/config/index.js.map +1 -1
  25. package/dist/config/index.mjs +178 -3
  26. package/dist/config/index.mjs.map +1 -1
  27. package/dist/config/openapi.d.ts +34 -0
  28. package/dist/config/openapi.d.ts.map +1 -0
  29. package/dist/editor/RichTextEditor.d.ts +58 -0
  30. package/dist/editor/RichTextEditor.d.ts.map +1 -0
  31. package/dist/editor/index.d.ts +5 -0
  32. package/dist/editor/index.d.ts.map +1 -0
  33. package/dist/editor/index.js +350 -0
  34. package/dist/editor/index.js.map +1 -0
  35. package/dist/editor/index.mjs +324 -0
  36. package/dist/editor/index.mjs.map +1 -0
  37. package/package.json +22 -1
@@ -7,7 +7,60 @@ import {
7
7
  // src/app-kit/ScalioSecurityFactors.tsx
8
8
  import { useMemo } from "react";
9
9
  import { toast } from "sonner";
10
- import { SecurityFactors as SharedSecurityFactors, securityApi } from "@scalio-cloud/ui/react";
10
+
11
+ // src/app-kit/_uiReact.ts
12
+ import uiReact from "@scalio-cloud/ui/react";
13
+ var {
14
+ AuditLog,
15
+ AuditNav,
16
+ AuthHeader,
17
+ AuthLayout,
18
+ AuthMessage,
19
+ BackupPanel,
20
+ FactoryReset,
21
+ JobsPanel,
22
+ LanguageChoice,
23
+ LicensePanel,
24
+ LoginPage,
25
+ MailTransport,
26
+ MaintenanceNotice,
27
+ MicrosoftConnection,
28
+ PageHeader,
29
+ PasswordChange,
30
+ PasswordPolicySelect,
31
+ ProfileIdentity,
32
+ ProfileSection,
33
+ RoleAdmin,
34
+ RoleSourceSettings,
35
+ SaasUpdatesPanel,
36
+ SecurityFactors,
37
+ SelfTestPanel,
38
+ SettingsLayout,
39
+ SettingsSection,
40
+ SupportConnection,
41
+ ThemeChoice,
42
+ TimezoneChoice,
43
+ UpdateBanner,
44
+ UserAdmin,
45
+ accountArea,
46
+ accountGroups,
47
+ auditApi,
48
+ backupApi,
49
+ customerAccessProps,
50
+ factoryResetApi,
51
+ jobsApi,
52
+ labelsFor,
53
+ licenseApi,
54
+ mailApi,
55
+ rolesApi,
56
+ saasUpdatesApi,
57
+ securityApi,
58
+ selftestApi,
59
+ supportApi,
60
+ usersApi
61
+ } = uiReact;
62
+
63
+ // src/app-kit/ScalioSecurityFactors.tsx
11
64
  import { jsx } from "react/jsx-runtime";
12
65
  var defaultNotify = (text, tone) => {
13
66
  if (tone === "error") toast.error(text);
@@ -35,7 +88,7 @@ function ScalioSecurityFactors({
35
88
  return formatApiErrorDetail(err?.response?.data?.detail) || err?.message || "";
36
89
  };
37
90
  return /* @__PURE__ */ jsx(
38
- SharedSecurityFactors,
91
+ SecurityFactors,
39
92
  {
40
93
  client,
41
94
  lang,
@@ -53,7 +106,6 @@ function ScalioSecurityFactors({
53
106
 
54
107
  // src/app-kit/ScalioPasswordChangePage.tsx
55
108
  import { toast as toast2 } from "sonner";
56
- import { AuthHeader, AuthLayout, PasswordChange } from "@scalio-cloud/ui/react";
57
109
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
58
110
  function ScalioPasswordChangePage({
59
111
  api,
@@ -112,16 +164,6 @@ function ScalioPasswordChangePage({
112
164
  import { useEffect, useState } from "react";
113
165
  import { toast as toast3 } from "sonner";
114
166
  import { Loader2 } from "lucide-react";
115
- import {
116
- LanguageChoice,
117
- MicrosoftConnection,
118
- PasswordChange as PasswordChange2,
119
- ProfileIdentity,
120
- ProfileSection,
121
- ThemeChoice,
122
- TimezoneChoice,
123
- labelsFor
124
- } from "@scalio-cloud/ui/react";
125
167
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
126
168
  var FIELD_CLASS = "mt-1 w-full h-10 px-3 bg-background border border-input rounded-sm text-sm focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring transition-colors";
127
169
  var LABEL_CLASS = "text-[11px] font-bold uppercase tracking-widest text-muted-foreground";
@@ -289,7 +331,7 @@ function ScalioProfilePage({
289
331
  ] }),
290
332
  /* @__PURE__ */ jsxs2(ProfileSection, { id: "security", lang, testId: "change-password-section", children: [
291
333
  /* @__PURE__ */ jsx3(
292
- PasswordChange2,
334
+ PasswordChange,
293
335
  {
294
336
  onSubmit: changePassword,
295
337
  onDone: () => toast3.success(t("Password changed. Other devices have been signed out.")),
@@ -317,18 +359,6 @@ function ScalioProfilePage({
317
359
  import { useCallback, useEffect as useEffect2, useMemo as useMemo2, useState as useState2 } from "react";
318
360
  import { Navigate, NavLink, useNavigate, useParams, useSearchParams } from "react-router-dom";
319
361
  import { toast as toast4 } from "sonner";
320
- import {
321
- PasswordPolicySelect,
322
- RoleAdmin,
323
- SettingsLayout,
324
- UserAdmin,
325
- accountArea,
326
- accountGroups,
327
- customerAccessProps,
328
- labelsFor as labelsFor2,
329
- rolesApi,
330
- usersApi
331
- } from "@scalio-cloud/ui/react";
332
362
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
333
363
  function roleLabel(name, lang) {
334
364
  if (name && typeof name === "object") {
@@ -348,7 +378,7 @@ function ScalioUsersPage({
348
378
  emptyCustomersHint,
349
379
  renderEntraTab
350
380
  }) {
351
- const L = labelsFor2(lang);
381
+ const L = labelsFor(lang);
352
382
  const [params] = useSearchParams();
353
383
  const { area } = useParams();
354
384
  const navigate = useNavigate();
@@ -495,7 +525,6 @@ function ScalioUsersPage({
495
525
  // src/app-kit/ScalioLoginPage.tsx
496
526
  import { useCallback as useCallback2, useEffect as useEffect3 } from "react";
497
527
  import { useNavigate as useNavigate2 } from "react-router-dom";
498
- import { LoginPage } from "@scalio-cloud/ui/react";
499
528
  import { jsx as jsx5 } from "react/jsx-runtime";
500
529
  function ScalioLoginPage({
501
530
  api,
@@ -546,7 +575,6 @@ function ScalioLoginPage({
546
575
  import { useEffect as useEffect4, useState as useState3 } from "react";
547
576
  import { useNavigate as useNavigate3 } from "react-router-dom";
548
577
  import { Loader2 as Loader22 } from "lucide-react";
549
- import { AuthHeader as AuthHeader2, AuthLayout as AuthLayout2, AuthMessage } from "@scalio-cloud/ui/react";
550
578
  import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
551
579
  var FIELD_CLASS2 = "mt-1 w-full h-11 px-3 bg-background border border-input rounded-sm text-sm focus:outline-none focus:ring-1 focus:ring-ring";
552
580
  var LABEL_CLASS2 = "text-[11px] font-bold uppercase tracking-widest text-muted-foreground";
@@ -599,9 +627,9 @@ function ScalioInvitePage({
599
627
  setBusy(false);
600
628
  }
601
629
  };
602
- return /* @__PURE__ */ jsx6(AuthLayout2, { legalUrl, brand, lang, onLangChange, children: /* @__PURE__ */ jsxs4("div", { className: "space-y-4", "data-testid": "invite-page", children: [
630
+ return /* @__PURE__ */ jsx6(AuthLayout, { legalUrl, brand, lang, onLangChange, children: /* @__PURE__ */ jsxs4("div", { className: "space-y-4", "data-testid": "invite-page", children: [
603
631
  /* @__PURE__ */ jsx6(
604
- AuthHeader2,
632
+ AuthHeader,
605
633
  {
606
634
  eyebrow: info?.email,
607
635
  title: welcomeTitle,
@@ -661,14 +689,13 @@ function ScalioInvitePage({
661
689
  import { useMemo as useMemo3 } from "react";
662
690
  import { Link, NavLink as NavLink2 } from "react-router-dom";
663
691
  import { toast as toast5 } from "sonner";
664
- import { AuditLog, AuditNav, JobsPanel, PageHeader, auditApi, jobsApi, labelsFor as labelsFor3 } from "@scalio-cloud/ui/react";
665
692
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
666
693
  var defaultNotify2 = (text, tone) => {
667
694
  if (tone === "error") toast5.error(text);
668
695
  else toast5.success(text);
669
696
  };
670
697
  function ScalioAuditHeader({ lang, t }) {
671
- const L = labelsFor3(lang);
698
+ const L = labelsFor(lang);
672
699
  return /* @__PURE__ */ jsxs5("div", { className: "space-y-3", children: [
673
700
  /* @__PURE__ */ jsx7(PageHeader, { title: L.auditLog, subtitle: t("Who changed what, and the background jobs of this installation") }),
674
701
  /* @__PURE__ */ jsx7(AuditNav, { link: NavLink2, lang })
@@ -712,7 +739,6 @@ function ScalioJobsPage({ api, user, lang, t, confirm }) {
712
739
  import { useEffect as useEffect5, useMemo as useMemo4, useState as useState4 } from "react";
713
740
  import { Navigate as Navigate2 } from "react-router-dom";
714
741
  import { toast as toast6 } from "sonner";
715
- import { PageHeader as PageHeader2, SelfTestPanel, selftestApi } from "@scalio-cloud/ui/react";
716
742
  import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
717
743
  function ScalioSelfTestPage({ api, user, lang, t }) {
718
744
  const [on, setOn] = useState4(null);
@@ -723,7 +749,7 @@ function ScalioSelfTestPage({ api, user, lang, t }) {
723
749
  if (user?.role !== "admin" || on === false) return /* @__PURE__ */ jsx8(Navigate2, { to: "/", replace: true });
724
750
  if (on === null) return null;
725
751
  return /* @__PURE__ */ jsxs6("div", { "data-testid": "selftest-page", className: "space-y-5", children: [
726
- /* @__PURE__ */ jsx8(PageHeader2, { eyebrow: t("Tests"), title: t("E2E self-check"), subtitle: t("Self-check of this test instance") }),
752
+ /* @__PURE__ */ jsx8(PageHeader, { eyebrow: t("Tests"), title: t("E2E self-check"), subtitle: t("Self-check of this test instance") }),
727
753
  /* @__PURE__ */ jsx8(
728
754
  SelfTestPanel,
729
755
  {
@@ -739,7 +765,6 @@ function ScalioSelfTestPage({ api, user, lang, t }) {
739
765
  import { useEffect as useEffect6, useMemo as useMemo5, useState as useState5 } from "react";
740
766
  import { Link as Link2 } from "react-router-dom";
741
767
  import { toast as toast7 } from "sonner";
742
- import { BackupPanel, MaintenanceNotice, SettingsSection, backupApi } from "@scalio-cloud/ui/react";
743
768
  import { jsx as jsx9 } from "react/jsx-runtime";
744
769
  var notify = (text, tone) => {
745
770
  if (tone === "error") toast7.error(text);
@@ -795,7 +820,6 @@ function ScalioMaintenanceBanner({ api, lang }) {
795
820
  // src/app-kit/ScalioSaasUpdatesSection.tsx
796
821
  import { useEffect as useEffect7, useMemo as useMemo6, useState as useState6 } from "react";
797
822
  import { toast as toast8 } from "sonner";
798
- import { SaasUpdatesPanel, SettingsSection as SettingsSection2, UpdateBanner, saasUpdatesApi } from "@scalio-cloud/ui/react";
799
823
  import { jsx as jsx10 } from "react/jsx-runtime";
800
824
  function ScalioSaasUpdateBanner({ api, lang, onOpen }) {
801
825
  const client = useMemo6(() => saasUpdatesApi(api), [api]);
@@ -829,7 +853,7 @@ function ScalioSaasUpdatesSection({
829
853
  setPrerelease(d?.prerelease ? Boolean(d.prerelease.opt_in) : Boolean(on));
830
854
  };
831
855
  return /* @__PURE__ */ jsx10(
832
- SettingsSection2,
856
+ SettingsSection,
833
857
  {
834
858
  id: "updates",
835
859
  title: t("Updates"),
@@ -852,22 +876,171 @@ function ScalioSaasUpdatesSection({
852
876
 
853
877
  // src/app-kit/ScalioSupportCard.tsx
854
878
  import { useMemo as useMemo7 } from "react";
855
- import { SettingsSection as SettingsSection3, SupportConnection, supportApi } from "@scalio-cloud/ui/react";
856
879
  import { jsx as jsx11 } from "react/jsx-runtime";
857
880
  function ScalioSupportCard({ api, lang, t }) {
858
881
  const client = useMemo7(() => supportApi(api), [api]);
859
- return /* @__PURE__ */ jsx11(SettingsSection3, { id: "support", title: t("Support connection"), testId: "support-connection-card", children: /* @__PURE__ */ jsx11(SupportConnection, { client, lang }) });
882
+ return /* @__PURE__ */ jsx11(SettingsSection, { id: "support", title: t("Support connection"), testId: "support-connection-card", children: /* @__PURE__ */ jsx11(SupportConnection, { client, lang }) });
883
+ }
884
+
885
+ // src/app-kit/ScalioMailSettings.tsx
886
+ import { useMemo as useMemo8 } from "react";
887
+ import { toast as toast9 } from "sonner";
888
+ import { jsx as jsx12 } from "react/jsx-runtime";
889
+ var defaultNotify3 = (text, tone) => {
890
+ if (tone === "error") toast9.error(text);
891
+ else toast9.success(text);
892
+ };
893
+ function ScalioMailSettings({
894
+ api,
895
+ lang,
896
+ formatApiErrorDetail
897
+ }) {
898
+ const client = useMemo8(() => mailApi(api), [api]);
899
+ const formatError = (e) => {
900
+ const err = e;
901
+ return formatApiErrorDetail(err?.response?.data?.detail) || err?.message || "";
902
+ };
903
+ return /* @__PURE__ */ jsx12(MailTransport, { client, lang, notify: defaultNotify3, formatError });
904
+ }
905
+
906
+ // src/app-kit/ScalioLicensePanel.tsx
907
+ import { useMemo as useMemo9 } from "react";
908
+ import { toast as toast10 } from "sonner";
909
+ import { jsx as jsx13 } from "react/jsx-runtime";
910
+ var defaultNotify4 = (text, tone) => {
911
+ if (tone === "error") toast10.error(text);
912
+ else toast10.success(text);
913
+ };
914
+ function ScalioLicensePanel({
915
+ api,
916
+ product,
917
+ lang,
918
+ kindLabel,
919
+ featureLabel,
920
+ confirm,
921
+ formatApiErrorDetail,
922
+ noFeatures
923
+ }) {
924
+ const client = useMemo9(() => licenseApi(api), [api]);
925
+ const formatError = (e) => {
926
+ const err = e;
927
+ return formatApiErrorDetail(err?.response?.data?.detail) || err?.message || "";
928
+ };
929
+ return /* @__PURE__ */ jsx13(
930
+ LicensePanel,
931
+ {
932
+ client,
933
+ lang,
934
+ product,
935
+ kindLabel,
936
+ featureLabel,
937
+ noFeatures,
938
+ notify: defaultNotify4,
939
+ confirm,
940
+ formatError
941
+ }
942
+ );
943
+ }
944
+
945
+ // src/app-kit/ScalioFactoryReset.tsx
946
+ import { useMemo as useMemo10 } from "react";
947
+ import { Link as Link3 } from "react-router-dom";
948
+ import { toast as toast11 } from "sonner";
949
+ import { jsx as jsx14 } from "react/jsx-runtime";
950
+ var defaultNotify5 = (text, tone) => {
951
+ if (tone === "error") toast11.error(text);
952
+ else toast11.success(text);
953
+ };
954
+ function ScalioFactoryReset({
955
+ api,
956
+ lang,
957
+ formatApiErrorDetail,
958
+ accountTo = "/profile",
959
+ backupTo = "/settings/backup"
960
+ }) {
961
+ const client = useMemo10(() => factoryResetApi(api), [api]);
962
+ const formatError = (e) => {
963
+ const err = e;
964
+ return formatApiErrorDetail(err?.response?.data?.detail) || err?.message || "";
965
+ };
966
+ return /* @__PURE__ */ jsx14(
967
+ FactoryReset,
968
+ {
969
+ client,
970
+ lang,
971
+ accountTo,
972
+ backupTo,
973
+ link: Link3,
974
+ notify: defaultNotify5,
975
+ formatError
976
+ }
977
+ );
978
+ }
979
+
980
+ // src/app-kit/ScalioRoleTenants.tsx
981
+ import { useCallback as useCallback3, useEffect as useEffect8, useState as useState7 } from "react";
982
+ import { toast as toast12 } from "sonner";
983
+ import { jsx as jsx15 } from "react/jsx-runtime";
984
+ var defaultNotify6 = (text, tone) => {
985
+ if (tone === "error") toast12.error(text);
986
+ else toast12.success(text);
987
+ };
988
+ function ScalioRoleTenants({
989
+ api,
990
+ apiBaseUrl,
991
+ lang,
992
+ t,
993
+ confirm,
994
+ formatApiErrorDetail,
995
+ onChange
996
+ }) {
997
+ const [source, setSource] = useState7(null);
998
+ const [ssoOn, setSsoOn] = useState7(false);
999
+ const load = useCallback3(() => {
1000
+ api.get("/users/role-source").then((r) => setSource(r.data)).catch(() => setSource(null));
1001
+ api.get("/auth/scalio/status").then((r) => setSsoOn(Boolean(r.data?.enabled))).catch(() => setSsoOn(false));
1002
+ }, [api]);
1003
+ useEffect8(() => {
1004
+ load();
1005
+ }, [load]);
1006
+ if (!source) return null;
1007
+ const save = async ({ source: value, tenants }) => {
1008
+ await api.put("/users/role-source", { source: value, tenants });
1009
+ load();
1010
+ onChange?.();
1011
+ };
1012
+ const formatError = (e) => {
1013
+ const err = e;
1014
+ return err?.response?.data?.detail ? formatApiErrorDetail(err.response.data.detail) : t("The action failed.");
1015
+ };
1016
+ return /* @__PURE__ */ jsx15("div", { className: "bg-card border border-border rounded-sm px-4 py-3", "data-testid": "role-tenants", children: /* @__PURE__ */ jsx15(
1017
+ RoleSourceSettings,
1018
+ {
1019
+ lang,
1020
+ tenants: true,
1021
+ confirm,
1022
+ onSave: save,
1023
+ consentUrl: ssoOn ? `${apiBaseUrl}/auth/scalio/consent` : void 0,
1024
+ value: { source: source.source, values: source.values, tenants: source.tenants },
1025
+ notify: defaultNotify6,
1026
+ formatError
1027
+ }
1028
+ ) });
860
1029
  }
861
1030
  export {
862
1031
  ScalioAuditHeader,
863
1032
  ScalioAuditPage,
864
1033
  ScalioBackupSection,
1034
+ ScalioFactoryReset,
865
1035
  ScalioInvitePage,
866
1036
  ScalioJobsPage,
1037
+ ScalioLicensePanel,
867
1038
  ScalioLoginPage,
1039
+ ScalioMailSettings,
868
1040
  ScalioMaintenanceBanner,
869
1041
  ScalioPasswordChangePage,
870
1042
  ScalioProfilePage,
1043
+ ScalioRoleTenants,
871
1044
  ScalioSaasUpdateBanner,
872
1045
  ScalioSaasUpdatesSection,
873
1046
  ScalioSecurityFactors,