@code0-tech/pictor 0.0.0-mvp.24 → 0.0.0-mvp.26

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 (25) hide show
  1. package/dist/assets/components/form/Input.style.css +1 -1
  2. package/dist/components/d-member/DNamespaceMember.service.js +7 -7
  3. package/dist/components/d-member/DNamespaceMemberContent.js +140 -92
  4. package/dist/components/d-namespace/DNamespace.service.js +2 -2
  5. package/dist/components/d-organization/DOrganization.service.js +5 -5
  6. package/dist/components/d-organization/DOrganizatonContent.js +23 -23
  7. package/dist/components/d-project/DNamespaceProject.service.js +5 -5
  8. package/dist/components/d-project/DNamespaceProjectContent.d.ts +1 -0
  9. package/dist/components/d-project/DNamespaceProjectContent.js +42 -35
  10. package/dist/components/d-project/DNamespaceProjectMenu.d.ts +7 -3
  11. package/dist/components/d-project/DNamespaceProjectMenu.js +53 -14
  12. package/dist/components/d-project/index.js +17 -9
  13. package/dist/components/d-role/DNamespaceRole.service.js +2 -2
  14. package/dist/components/d-role/DNamespaceRole.view.js +2 -1
  15. package/dist/components/d-role/DNamespaceRoleContent.js +28 -22
  16. package/dist/components/d-role/DNamespaceRolePermissions.js +31 -37
  17. package/dist/components/d-runtime/DRuntime.service.js +2 -2
  18. package/dist/components/d-runtime/DRuntimeContent.js +10 -10
  19. package/dist/components/d-user/DUser.service.d.ts +1 -1
  20. package/dist/components/d-user/DUser.service.js +9 -6
  21. package/dist/components/d-user/DUserContent.js +9 -9
  22. package/dist/components/form/CheckboxInput.js +61 -52
  23. package/dist/components/form/useForm.js +7 -6
  24. package/dist/index.js +20 -20
  25. package/package.json +2 -2
@@ -1,61 +1,68 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { useService as a } from "../../utils/contextStore.js";
3
- import l from "react";
3
+ import p from "react";
4
4
  import "merge-props";
5
5
  import { Flex as t } from "../flex/Flex.js";
6
- import { DNamespaceProjectReactiveService as g } from "./DNamespaceProject.service.js";
7
- import { Avatar as h } from "../avatar/Avatar.js";
8
- import { Text as o } from "../text/Text.js";
6
+ import { DNamespaceProjectReactiveService as y } from "./DNamespaceProject.service.js";
7
+ import { Avatar as g } from "../avatar/Avatar.js";
8
+ import { Text as n } from "../text/Text.js";
9
9
  import { Badge as c } from "../badge/Badge.js";
10
- import { IconGitFork as f, IconServer as j, IconServerSpark as v, IconSettings as x } from "@tabler/icons-react";
11
- import { DRuntimeReactiveService as S } from "../d-runtime/DRuntime.service.js";
10
+ import { IconGitFork as x, IconServer as v, IconServerSpark as z, IconEdit as j } from "@tabler/icons-react";
11
+ import { DRuntimeReactiveService as b } from "../d-runtime/DRuntime.service.js";
12
12
  import "../../_virtual/compiler-runtime.js";
13
13
  import '../../assets/components/card/Card.style.css';/* empty css */
14
- import { Button as z } from "../button/Button.js";
15
- const T = (p) => {
14
+ import { Button as S } from "../button/Button.js";
15
+ const T = (d) => {
16
16
  const {
17
- projectId: n,
18
- onSetting: d = () => {
19
- }
20
- } = p, s = a(g), u = a(S), e = l.useMemo(() => s.getById(n), [s, n]), m = l.useMemo(() => e ? u.getById(e.primaryRuntime?.id) : null, [e]);
17
+ projectId: s,
18
+ onSetting: u = () => {
19
+ },
20
+ minimized: o = !1
21
+ } = d, l = a(y), h = o ? null : a(b), r = p.useMemo(() => l.getById(s), [l, s]), m = o ? null : p.useMemo(() => r ? h.getById(r.primaryRuntime?.id) : null, [r]);
21
22
  return /* @__PURE__ */ i(t, { align: "center", style: {
22
23
  gap: "1.3rem"
23
24
  }, justify: "space-between", children: [
24
25
  /* @__PURE__ */ i(t, { align: "center", style: {
25
- gap: "1.3rem"
26
+ gap: "0.7rem"
26
27
  }, children: [
27
- /* @__PURE__ */ r(h, { bg: "transparent", identifier: e?.name ?? "" }),
28
+ /* @__PURE__ */ e(g, { bg: "transparent", identifier: r?.name ?? "" }),
28
29
  /* @__PURE__ */ i(t, { style: {
29
30
  flexDirection: "column",
30
31
  gap: "0.35rem"
31
32
  }, children: [
32
- /* @__PURE__ */ r(o, { size: "lg", hierarchy: "primary", display: "block", children: e?.name }),
33
- /* @__PURE__ */ r(o, { size: "sm", hierarchy: "tertiary", display: "block", children: e?.description })
33
+ /* @__PURE__ */ e(n, { size: o ? "xs" : "md", hierarchy: "secondary", display: "block", children: r?.name }),
34
+ /* @__PURE__ */ e(n, { size: o ? "xs" : "sm", hierarchy: "tertiary", display: "block", children: r?.description })
34
35
  ] })
35
36
  ] }),
36
- /* @__PURE__ */ i(t, { align: "center", style: {
37
+ o ? null : /* @__PURE__ */ i(t, { align: "center", style: {
37
38
  gap: "1.3rem"
38
39
  }, children: [
39
- /* @__PURE__ */ i(t, { align: "center", style: {
40
- gap: "0.35rem",
41
- flexWrap: "wrap"
40
+ /* @__PURE__ */ i(t, { style: {
41
+ flexDirection: "column",
42
+ gap: "0.35rem"
42
43
  }, children: [
43
- /* @__PURE__ */ i(c, { color: "secondary", children: [
44
- /* @__PURE__ */ r(f, { size: 16 }),
45
- /* @__PURE__ */ r(o, { size: "xs", children: e?.flows?.count ?? 0 })
46
- ] }),
47
- /* @__PURE__ */ i(c, { color: "secondary", children: [
48
- /* @__PURE__ */ r(j, { size: 16 }),
49
- /* @__PURE__ */ r(o, { size: "xs", children: e?.runtimes?.count ?? 0 })
50
- ] }),
51
- m && /* @__PURE__ */ i(c, { color: "secondary", children: [
52
- /* @__PURE__ */ r(v, { size: 16 }),
53
- /* @__PURE__ */ r(o, { size: "xs", children: m.name })
44
+ /* @__PURE__ */ e(n, { size: "xs", hierarchy: "tertiary", children: "Usage" }),
45
+ /* @__PURE__ */ i(t, { align: "center", style: {
46
+ gap: "0.35rem",
47
+ flexWrap: "wrap"
48
+ }, children: [
49
+ /* @__PURE__ */ i(c, { border: !0, children: [
50
+ /* @__PURE__ */ e(x, { size: 16 }),
51
+ /* @__PURE__ */ e(n, { size: "xs", children: r?.flows?.count ?? 0 })
52
+ ] }),
53
+ /* @__PURE__ */ i(c, { border: !0, children: [
54
+ /* @__PURE__ */ e(v, { size: 16 }),
55
+ /* @__PURE__ */ e(n, { size: "xs", children: r?.runtimes?.count ?? 0 })
56
+ ] }),
57
+ m && /* @__PURE__ */ i(c, { border: !0, children: [
58
+ /* @__PURE__ */ e(z, { size: 16 }),
59
+ /* @__PURE__ */ e(n, { size: "xs", children: m.name })
60
+ ] })
54
61
  ] })
55
62
  ] }),
56
- e?.userAbilities?.deleteNamespaceProject || e?.userAbilities?.updateNamespaceProject ? /* @__PURE__ */ r(z, { color: "secondary", onClick: (y) => {
57
- y.stopPropagation(), d(e);
58
- }, children: /* @__PURE__ */ r(x, { size: 16 }) }) : null
63
+ r?.userAbilities?.deleteNamespaceProject || r?.userAbilities?.updateNamespaceProject ? /* @__PURE__ */ e(S, { color: "secondary", variant: "filled", onClick: (f) => {
64
+ f.stopPropagation(), u(r);
65
+ }, children: /* @__PURE__ */ e(j, { size: 16 }) }) : null
59
66
  ] })
60
67
  ] });
61
68
  };
@@ -1,9 +1,13 @@
1
1
  import { default as React } from 'react';
2
2
  import { MenuProps } from '../menu/Menu';
3
- import { Scalars } from '@code0-tech/sagittarius-graphql-types';
3
+ import { Namespace, Scalars } from '@code0-tech/sagittarius-graphql-types';
4
+ import { DNamespaceProjectView } from './DNamespaceProject.view';
4
5
  export interface DNamespaceProjectMenuProps extends MenuProps {
5
- projectId: Scalars['NamespaceProjectID']['output'];
6
- onProjectSelect: (id: Scalars['NamespaceProjectID']['output']) => void;
6
+ onProjectSelect: (project: DNamespaceProjectView) => void;
7
+ namespaceId: Namespace["id"];
8
+ filter?: (project: DNamespaceProjectView, index: number) => boolean;
9
+ projectId?: Scalars['NamespaceProjectID']['output'];
10
+ children?: React.ReactNode;
7
11
  }
8
12
  declare const DNamespaceProjectMenu: React.FC<DNamespaceProjectMenuProps>;
9
13
  export default DNamespaceProjectMenu;
@@ -1,18 +1,57 @@
1
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as e, Fragment as M } from "react/jsx-runtime";
2
2
  import s from "react";
3
- import { Menu as u, MenuTrigger as d, MenuPortal as l, MenuContent as f, MenuItem as p } from "../menu/Menu.js";
4
- import { DNamespaceProjectReactiveService as o } from "./DNamespaceProject.service.js";
5
- import { useService as c } from "../../utils/contextStore.js";
6
- import { Button as h } from "../button/Button.js";
7
- const x = (t) => {
8
- const n = c(o), i = c(o), a = n.getById(t.projectId);
9
- return s.useMemo(() => /* @__PURE__ */ m(u, { ...t, children: [
10
- /* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(h, { variant: "none", style: {
11
- background: "transparent"
12
- }, children: a?.name }) }),
13
- /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(f, { side: "bottom", align: "start", sideOffset: 0, children: n.values().map((r) => /* @__PURE__ */ e(p, { onSelect: () => t.onProjectSelect(r.id), children: r.name }, r.id)) }) })
14
- ] }), [i]);
3
+ import { Menu as S, MenuTrigger as I, MenuPortal as v, MenuContent as b, MenuItem as y, MenuSeparator as z, MenuLabel as P } from "../menu/Menu.js";
4
+ import { DNamespaceProjectReactiveService as p } from "./DNamespaceProject.service.js";
5
+ import { useService as u } from "../../utils/contextStore.js";
6
+ import { Button as w } from "../button/Button.js";
7
+ import { DNamespaceProjectContent as C } from "./DNamespaceProjectContent.js";
8
+ import { Card as D } from "../card/Card.js";
9
+ import { Flex as t } from "../flex/Flex.js";
10
+ import { Badge as n } from "../badge/Badge.js";
11
+ import { IconArrowUp as B, IconArrowDown as N, IconCornerDownLeft as A } from "@tabler/icons-react";
12
+ import { Spacing as F } from "../spacing/Spacing.js";
13
+ const K = (i) => {
14
+ const {
15
+ onProjectSelect: h,
16
+ namespaceId: c,
17
+ filter: f = () => !0,
18
+ projectId: g,
19
+ children: m
20
+ } = i, d = u(p), a = u(p), x = d.getById(g), l = s.useMemo(() => d.values({
21
+ namespaceId: c
22
+ }).filter(f), [a, c]);
23
+ return s.useMemo(() => /* @__PURE__ */ r(S, { ...i, children: [
24
+ /* @__PURE__ */ e(I, { asChild: !0, children: m || /* @__PURE__ */ e(w, { variant: "none", paddingSize: "xxs", children: x?.name }) }),
25
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ r(b, { side: "bottom", align: "center", sideOffset: 8, maw: "210px", color: "secondary", children: [
26
+ /* @__PURE__ */ e(D, { paddingSize: "xxs", mt: -0.35, mx: -0.35, style: {
27
+ borderWidth: "2px"
28
+ }, children: l.map((o, j) => /* @__PURE__ */ r(M, { children: [
29
+ /* @__PURE__ */ e(y, { onSelect: () => h(o), children: /* @__PURE__ */ e(C, { minimized: !0, projectId: o.id }) }, o.id),
30
+ j < l.length - 1 && /* @__PURE__ */ e(z, {})
31
+ ] })) }),
32
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ r(t, { style: {
33
+ gap: ".35rem"
34
+ }, children: [
35
+ /* @__PURE__ */ r(t, { align: "center", style: {
36
+ gap: "0.35rem"
37
+ }, children: [
38
+ /* @__PURE__ */ r(t, { children: [
39
+ /* @__PURE__ */ e(n, { border: !0, children: /* @__PURE__ */ e(B, { size: 12 }) }),
40
+ /* @__PURE__ */ e(n, { border: !0, children: /* @__PURE__ */ e(N, { size: 12 }) })
41
+ ] }),
42
+ "move"
43
+ ] }),
44
+ /* @__PURE__ */ e(F, { spacing: "xxs" }),
45
+ /* @__PURE__ */ r(t, { align: "center", style: {
46
+ gap: ".35rem"
47
+ }, children: [
48
+ /* @__PURE__ */ e(n, { border: !0, children: /* @__PURE__ */ e(A, { size: 12 }) }),
49
+ "add"
50
+ ] })
51
+ ] }) })
52
+ ] }) })
53
+ ] }), [a]);
15
54
  };
16
55
  export {
17
- x as default
56
+ K as default
18
57
  };
@@ -1,18 +1,26 @@
1
- import { DNamespaceProjectReactiveService as f } from "./DNamespaceProject.service.js";
2
- import { DNamespaceProjectView as x } from "./DNamespaceProject.view.js";
3
- import { DNamespaceProjectCard as N } from "./DNamespaceProjectCard.js";
4
- import { DNamespaceProjectList as v } from "./DNamespaceProjectList.js";
1
+ import { DNamespaceProjectReactiveService as w } from "./DNamespaceProject.service.js";
2
+ import { DNamespaceProjectView as L } from "./DNamespaceProject.view.js";
3
+ import { DNamespaceProjectCard as S } from "./DNamespaceProjectCard.js";
4
+ import { DNamespaceProjectList as b } from "./DNamespaceProjectList.js";
5
5
  import "react/jsx-runtime";
6
6
  import "react";
7
7
  import "../../_virtual/compiler-runtime.js";
8
- import '../../assets/components/menu/Menu.style.css';/* empty css */
8
+ import '../../assets/components/spacing/Spacing.style.css';import '../../assets/components/card/Card.style.css';import '../../assets/components/badge/Badge.style.css';import '../../assets/components/text/Text.style.css';import '../../assets/components/avatar/Avatar.style.css';import '../../assets/components/flex/Flex.style.css';import '../../assets/components/menu/Menu.style.css';/* empty css */
9
9
  import "merge-props";
10
10
  import "@radix-ui/react-dropdown-menu";
11
11
  import "../../utils/contextStore.js";
12
12
  import "../button/Button.js";
13
+ /* empty css */
14
+ import "js-md5";
15
+ /* empty css */
16
+ /* empty css */
17
+ /* empty css */
18
+ import "@tabler/icons-react";
19
+ /* empty css */
20
+ /* empty css */
13
21
  export {
14
- N as DNamespaceProjectCard,
15
- v as DNamespaceProjectList,
16
- f as DNamespaceProjectReactiveService,
17
- x as DNamespaceProjectView
22
+ S as DNamespaceProjectCard,
23
+ b as DNamespaceProjectList,
24
+ w as DNamespaceProjectReactiveService,
25
+ L as DNamespaceProjectView
18
26
  };
@@ -3,8 +3,8 @@ import "react";
3
3
  import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
4
4
  import "merge-props";
5
5
  class s extends t {
6
- getById(e, r) {
7
- return this.values(r).find((i) => i.id === e);
6
+ getById(i, r) {
7
+ return this.values(r).find((e) => e && e.id === i);
8
8
  }
9
9
  }
10
10
  export {
@@ -51,7 +51,8 @@ class u {
51
51
  id: this._id,
52
52
  name: this._name,
53
53
  namespace: this._namespace,
54
- updatedAt: this._updatedAt
54
+ updatedAt: this._updatedAt,
55
+ userAbilities: this._userAbilities
55
56
  };
56
57
  }
57
58
  }
@@ -6,11 +6,11 @@ import "merge-props";
6
6
  import { DNamespaceRoleReactiveService as x } from "./DNamespaceRole.service.js";
7
7
  import { Text as n } from "../text/Text.js";
8
8
  import { Button as u } from "../button/Button.js";
9
- import { IconFolders as G, IconUsers as H, IconSettings as J } from "@tabler/icons-react";
9
+ import { IconFolders as G, IconUsers as H, IconEdit as J } from "@tabler/icons-react";
10
10
  import { DNamespaceRolePermissions as K } from "./DNamespaceRolePermissions.js";
11
- import { DNamespaceMemberReactiveService as b } from "../d-member/DNamespaceMember.service.js";
11
+ import { DNamespaceMemberReactiveService as f } from "../d-member/DNamespaceMember.service.js";
12
12
  import "../../_virtual/compiler-runtime.js";
13
- import { Card as f } from "../card/Card.js";
13
+ import { Card as b } from "../card/Card.js";
14
14
  import { DUserReactiveService as v } from "../d-user/DUser.service.js";
15
15
  import '../../assets/components/dialog/Dialog.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/menu/Menu.style.css';/* empty css */
16
16
  import "@radix-ui/react-dropdown-menu";
@@ -29,24 +29,24 @@ import "@radix-ui/react-radio-group";
29
29
  import "../form/SwitchInput.js";
30
30
  import "../form/TextInput.js";
31
31
  import { Spacing as z } from "../spacing/Spacing.js";
32
- import { Tooltip as R, TooltipTrigger as A, TooltipPortal as j, TooltipContent as C, TooltipArrow as D } from "../tooltip/Tooltip.js";
32
+ import { Tooltip as R, TooltipTrigger as A, TooltipPortal as j, TooltipContent as D, TooltipArrow as C } from "../tooltip/Tooltip.js";
33
33
  import "@radix-ui/react-dialog";
34
34
  /* empty css */
35
- import { DNamespaceProjectReactiveService as w } from "../d-project/DNamespaceProject.service.js";
36
- const De = (I) => {
35
+ import { DNamespaceProjectReactiveService as P } from "../d-project/DNamespaceProject.service.js";
36
+ const Ce = (w) => {
37
37
  const {
38
38
  roleId: h,
39
- onSetting: M = () => {
39
+ onSetting: I = () => {
40
40
  },
41
- onMembersViewMore: P = () => {
41
+ onMembersViewMore: M = () => {
42
42
  },
43
43
  onProjectsViewMore: N = () => {
44
44
  }
45
- } = I, T = a(x), k = d(x), B = a(w), V = d(w), F = a(b), U = d(b), W = a(v), E = d(v), i = g.useMemo(() => T.getById(h), [k, h]), s = g.useMemo(() => B.values({
45
+ } = w, T = a(x), k = d(x), B = a(P), V = d(P), F = a(f), U = d(f), E = a(v), W = d(v), i = g.useMemo(() => T.getById(h), [k, h]), s = g.useMemo(() => B.values({
46
46
  namespaceId: i?.namespace?.id
47
47
  }).filter((t) => i?.assignedProjects?.nodes?.map((l) => l?.id).includes(t.id)), [V, i]), c = g.useMemo(() => F.values({
48
48
  namespaceId: i?.namespace?.id
49
- }).filter((t) => t.roles?.nodes?.map((l) => l?.id).includes(i?.id)), [U, E, h]), q = i?.userAbilities?.deleteNamespaceRole || i?.userAbilities?.updateNamespaceRole || i?.userAbilities?.assignRoleAbilities || i?.userAbilities?.assignRoleProjects;
49
+ }).filter((t) => t.roles?.nodes?.map((l) => l?.id).includes(i?.id)), [U, W, h]), q = i?.userAbilities?.deleteNamespaceRole || i?.userAbilities?.updateNamespaceRole || i?.userAbilities?.assignRoleAbilities || i?.userAbilities?.assignRoleProjects;
50
50
  return /* @__PURE__ */ r(o, { align: "center", style: {
51
51
  gap: "1.3rem"
52
52
  }, justify: "space-between", children: [
@@ -54,7 +54,13 @@ const De = (I) => {
54
54
  gap: "1.3rem"
55
55
  }, children: [
56
56
  /* @__PURE__ */ e(n, { size: "lg", hierarchy: "primary", display: "block", children: i?.name }),
57
- /* @__PURE__ */ e(K, { abilities: i?.abilities })
57
+ /* @__PURE__ */ r(o, { style: {
58
+ flexDirection: "column",
59
+ gap: "0.35rem"
60
+ }, children: [
61
+ /* @__PURE__ */ e(n, { size: "xs", hierarchy: "tertiary", children: "Permissions" }),
62
+ /* @__PURE__ */ e(K, { abilities: i?.abilities })
63
+ ] })
58
64
  ] }),
59
65
  /* @__PURE__ */ r(o, { align: "center", style: {
60
66
  gap: "1.3rem"
@@ -74,12 +80,12 @@ const De = (I) => {
74
80
  /* @__PURE__ */ e(G, { size: 16 }),
75
81
  /* @__PURE__ */ e(n, { hierarchy: "tertiary", size: "xs", children: s.length })
76
82
  ] }) }),
77
- /* @__PURE__ */ e(j, { children: /* @__PURE__ */ r(C, { side: "bottom", maw: "200px", children: [
83
+ /* @__PURE__ */ e(j, { children: /* @__PURE__ */ r(D, { side: "bottom", maw: "200px", children: [
78
84
  /* @__PURE__ */ e(n, { children: "Assigned projects" }),
79
- /* @__PURE__ */ e(D, {}),
85
+ /* @__PURE__ */ e(C, {}),
80
86
  s.length > 0 ? /* @__PURE__ */ r(y, { children: [
81
87
  /* @__PURE__ */ e(z, { spacing: "xxs" }),
82
- /* @__PURE__ */ r(f, { paddingSize: "xs", mb: -0.35, mx: -0.7, style: {
88
+ /* @__PURE__ */ r(b, { paddingSize: "xs", mb: -0.35, mx: -0.7, style: {
83
89
  borderWidth: "2px"
84
90
  }, children: [
85
91
  s.slice(0, 1).map((t) => /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ r(o, { align: "center", style: {
@@ -109,16 +115,16 @@ const De = (I) => {
109
115
  /* @__PURE__ */ e(H, { size: 16 }),
110
116
  /* @__PURE__ */ e(n, { hierarchy: "tertiary", size: "xs", children: c.length })
111
117
  ] }) }),
112
- /* @__PURE__ */ e(j, { children: /* @__PURE__ */ r(C, { side: "bottom", maw: "200px", children: [
118
+ /* @__PURE__ */ e(j, { children: /* @__PURE__ */ r(D, { side: "bottom", maw: "200px", children: [
113
119
  /* @__PURE__ */ e(n, { children: "Assigned members" }),
114
- /* @__PURE__ */ e(D, {}),
120
+ /* @__PURE__ */ e(C, {}),
115
121
  c.length > 0 ? /* @__PURE__ */ r(y, { children: [
116
122
  /* @__PURE__ */ e(z, { spacing: "xxs" }),
117
- /* @__PURE__ */ r(f, { paddingSize: "xs", mb: -0.35, mx: -0.7, style: {
123
+ /* @__PURE__ */ r(b, { paddingSize: "xs", mb: -0.35, mx: -0.7, style: {
118
124
  borderWidth: "2px"
119
125
  }, children: [
120
126
  c.slice(0, 1).map((t) => {
121
- const l = W.getById(t.user?.id);
127
+ const l = E.getById(t.user?.id);
122
128
  return /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ r(o, { align: "center", style: {
123
129
  gap: "0.7rem"
124
130
  }, children: [
@@ -135,7 +141,7 @@ const De = (I) => {
135
141
  ] })
136
142
  ] }) }, t.id);
137
143
  }),
138
- i && c.slice(1, c.length).length > 0 ? /* @__PURE__ */ e(p, { border: !0, display: "flex", p: 0.35, justify: "center", hover: !0, children: /* @__PURE__ */ r(u, { paddingSize: "xxs", variant: "none", onClick: () => P(i), children: [
144
+ i && c.slice(1, c.length).length > 0 ? /* @__PURE__ */ e(p, { border: !0, display: "flex", p: 0.35, justify: "center", hover: !0, children: /* @__PURE__ */ r(u, { paddingSize: "xxs", variant: "none", onClick: () => M(i), children: [
139
145
  /* @__PURE__ */ e(n, { size: "xs", children: "View more" }),
140
146
  /* @__PURE__ */ e(m, { border: !0, children: c.length - 1 })
141
147
  ] }) }) : null
@@ -145,12 +151,12 @@ const De = (I) => {
145
151
  ] })
146
152
  ] })
147
153
  ] }),
148
- q && /* @__PURE__ */ e(u, { color: "secondary", onClick: (t) => {
149
- t.stopPropagation(), M(i);
154
+ q && /* @__PURE__ */ e(u, { color: "secondary", variant: "filled", onClick: (t) => {
155
+ t.stopPropagation(), I(i);
150
156
  }, children: /* @__PURE__ */ e(J, { size: 16 }) })
151
157
  ] })
152
158
  ] });
153
159
  };
154
160
  export {
155
- De as DNamespaceRoleContent
161
+ Ce as DNamespaceRoleContent
156
162
  };
@@ -1,11 +1,11 @@
1
- import { jsxs as s, jsx as n, Fragment as c } from "react/jsx-runtime";
2
- import a from "react";
3
- import { Flex as m } from "../flex/Flex.js";
4
- import { Text as l } from "../text/Text.js";
5
- import { Badge as A } from "../badge/Badge.js";
1
+ import { jsx as i, jsxs as s, Fragment as l } from "react/jsx-runtime";
2
+ import m from "react";
3
+ import { Flex as A } from "../flex/Flex.js";
4
+ import { Text as c } from "../text/Text.js";
5
+ import { Badge as a } from "../badge/Badge.js";
6
6
  import { IconCheck as T } from "@tabler/icons-react";
7
- import { Tooltip as _, TooltipTrigger as u, TooltipPortal as h, TooltipContent as C, TooltipArrow as R } from "../tooltip/Tooltip.js";
8
- const f = {
7
+ import { Tooltip as _, TooltipTrigger as u, TooltipPortal as C, TooltipContent as R, TooltipArrow as f } from "../tooltip/Tooltip.js";
8
+ const h = {
9
9
  ASSIGN_MEMBER_ROLES: "members",
10
10
  INVITE_MEMBER: "members",
11
11
  DELETE_MEMBER: "members",
@@ -41,27 +41,27 @@ const f = {
41
41
  organization: "the organization",
42
42
  admin: "everything"
43
43
  };
44
- function d(e) {
44
+ function N(e) {
45
45
  return e.startsWith("CREATE_") ? "create" : e.startsWith("UPDATE_") ? "update" : e.startsWith("DELETE_") ? "delete" : e.startsWith("ASSIGN_") ? "assign" : e.startsWith("READ_") ? "read" : "manage";
46
46
  }
47
- function N(e) {
47
+ function d(e) {
48
48
  const r = Array.from(new Set(e));
49
49
  return r.length === 1 ? r[0] : "manage";
50
50
  }
51
51
  function S(e) {
52
52
  if (!e || e.length === 0) return [];
53
53
  const r = /* @__PURE__ */ new Map();
54
- for (const i of e) {
55
- const o = f[i];
54
+ for (const n of e) {
55
+ const o = h[n];
56
56
  if (!o) continue;
57
57
  const t = r.get(o) ?? [];
58
- t.push(i), r.set(o, t);
58
+ t.push(n), r.set(o, t);
59
59
  }
60
- return Array.from(r.entries()).map(([i, o]) => {
61
- const t = o.map(d), E = N(t);
60
+ return Array.from(r.entries()).map(([n, o]) => {
61
+ const t = o.map(N), E = d(t);
62
62
  return {
63
- category: i,
64
- label: p[i],
63
+ category: n,
64
+ label: p[n],
65
65
  abilities: o,
66
66
  action: E
67
67
  };
@@ -69,41 +69,41 @@ function S(e) {
69
69
  }
70
70
  function g(e) {
71
71
  if (e.length === 0) return "No special permissions.";
72
- const r = (t) => /* @__PURE__ */ s(c, { children: [
72
+ const r = (t) => /* @__PURE__ */ s(l, { children: [
73
73
  t.action,
74
74
  " ",
75
75
  /* @__PURE__ */ s(_, { children: [
76
- /* @__PURE__ */ n(u, { asChild: !0, children: /* @__PURE__ */ n(A, { color: "info", style: {
76
+ /* @__PURE__ */ i(u, { asChild: !0, children: /* @__PURE__ */ i(a, { color: "info", style: {
77
77
  verticalAlign: "middle"
78
- }, children: /* @__PURE__ */ n(l, { style: {
78
+ }, children: /* @__PURE__ */ i(c, { style: {
79
79
  color: "inherit"
80
80
  }, children: t.label }) }) }),
81
- /* @__PURE__ */ n(h, { children: /* @__PURE__ */ s(C, { side: "bottom", children: [
82
- /* @__PURE__ */ n(m, { style: {
81
+ /* @__PURE__ */ i(C, { children: /* @__PURE__ */ s(R, { side: "bottom", children: [
82
+ /* @__PURE__ */ i(A, { style: {
83
83
  flexDirection: "column",
84
84
  gap: "0.25rem"
85
- }, children: t.abilities.map((E) => /* @__PURE__ */ s(m, { align: "center", style: {
85
+ }, children: t.abilities.map((E) => /* @__PURE__ */ s(A, { align: "center", style: {
86
86
  gap: "0.35rem"
87
87
  }, children: [
88
- /* @__PURE__ */ n(T, { size: 16 }),
89
- /* @__PURE__ */ n(l, { size: "xs", children: E })
88
+ /* @__PURE__ */ i(T, { size: 16 }),
89
+ /* @__PURE__ */ i(c, { size: "xs", children: E })
90
90
  ] }, E)) }),
91
- /* @__PURE__ */ n(R, {})
91
+ /* @__PURE__ */ i(f, {})
92
92
  ] }) })
93
93
  ] })
94
94
  ] });
95
95
  if (e.length === 1) {
96
96
  const t = e[0];
97
- return /* @__PURE__ */ s(c, { children: [
97
+ return /* @__PURE__ */ s(l, { children: [
98
98
  "Can ",
99
99
  r(t)
100
100
  ] });
101
101
  }
102
- const i = e.slice(0, -1), o = e[e.length - 1];
103
- return /* @__PURE__ */ s(c, { children: [
102
+ const n = e.slice(0, -1), o = e[e.length - 1];
103
+ return /* @__PURE__ */ s(l, { children: [
104
104
  "Can",
105
105
  " ",
106
- i.map((t, E) => /* @__PURE__ */ s(a.Fragment, { children: [
106
+ n.map((t, E) => /* @__PURE__ */ s(m.Fragment, { children: [
107
107
  E > 0 && ", ",
108
108
  r(t)
109
109
  ] }, t.category)),
@@ -115,14 +115,8 @@ function g(e) {
115
115
  const b = (e) => {
116
116
  const {
117
117
  abilities: r
118
- } = e, i = a.useMemo(() => S(r), [r]);
119
- return /* @__PURE__ */ s(m, { style: {
120
- flexDirection: "column",
121
- gap: "0.35rem"
122
- }, children: [
123
- /* @__PURE__ */ n(l, { size: "xs", hierarchy: "tertiary", children: "Permissions" }),
124
- /* @__PURE__ */ n(l, { size: "sm", hierarchy: "secondary", children: g(i) })
125
- ] });
118
+ } = e, n = m.useMemo(() => S(r), [r]);
119
+ return /* @__PURE__ */ i(c, { size: "sm", hierarchy: "secondary", children: g(n) });
126
120
  };
127
121
  export {
128
122
  b as DNamespaceRolePermissions
@@ -1,7 +1,7 @@
1
1
  import { ReactiveArrayService as r } from "../../utils/reactiveArrayService.js";
2
2
  class c extends r {
3
- getById(e) {
4
- return this.values().find((i) => i.id === e);
3
+ getById(i) {
4
+ return this.values().find((e) => e && e.id === i);
5
5
  }
6
6
  }
7
7
  export {
@@ -2,19 +2,19 @@ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
2
  import h from "react";
3
3
  import { Text as n } from "../text/Text.js";
4
4
  import { Flex as i } from "../flex/Flex.js";
5
- import { IconSettings as y } from "@tabler/icons-react";
6
- import { Button as g } from "../button/Button.js";
7
- import { useService as f, useStore as C } from "../../utils/contextStore.js";
5
+ import { IconEdit as y } from "@tabler/icons-react";
6
+ import { Button as f } from "../button/Button.js";
7
+ import { useService as g, useStore as C } from "../../utils/contextStore.js";
8
8
  import "merge-props";
9
- import { DRuntimeReactiveService as s } from "./DRuntime.service.js";
10
- import { Badge as l } from "../badge/Badge.js";
11
- const v = (m) => {
9
+ import { DRuntimeReactiveService as l } from "./DRuntime.service.js";
10
+ import { Badge as s } from "../badge/Badge.js";
11
+ const T = (m) => {
12
12
  const {
13
13
  runtimeId: o,
14
14
  minimized: c = !1,
15
15
  onSetting: a = () => {
16
16
  }
17
- } = m, p = f(s), d = C(s), r = h.useMemo(() => p.getById(o), [d, o]);
17
+ } = m, d = g(l), p = C(l), r = h.useMemo(() => d.getById(o), [p, o]);
18
18
  return /* @__PURE__ */ t(i, { justify: "space-between", align: "center", style: {
19
19
  gap: "1.3rem"
20
20
  }, children: [
@@ -33,13 +33,13 @@ const v = (m) => {
33
33
  /* @__PURE__ */ e(i, { align: "center", style: {
34
34
  gap: "0.35rem",
35
35
  flexWrap: "wrap"
36
- }, children: r?.status === "CONNECTED" ? /* @__PURE__ */ e(l, { color: "success", children: "CONNECTED" }) : /* @__PURE__ */ e(l, { color: "error", children: "DISCONNECTED" }) }),
37
- !c && (r?.userAbilities?.deleteRuntime || r?.userAbilities?.updateRuntime || r?.userAbilities?.rotateRuntimeToken) ? /* @__PURE__ */ e(g, { color: "secondary", onClick: (u) => {
36
+ }, children: r?.status === "CONNECTED" ? /* @__PURE__ */ e(s, { color: "success", children: "CONNECTED" }) : /* @__PURE__ */ e(s, { color: "error", children: "DISCONNECTED" }) }),
37
+ !c && (r?.userAbilities?.deleteRuntime || r?.userAbilities?.updateRuntime || r?.userAbilities?.rotateRuntimeToken) ? /* @__PURE__ */ e(f, { color: "secondary", variant: "filled", onClick: (u) => {
38
38
  u.stopPropagation(), a(r);
39
39
  }, children: /* @__PURE__ */ e(y, { size: 16 }) }) : null
40
40
  ] })
41
41
  ] });
42
42
  };
43
43
  export {
44
- v as DRuntimeContent
44
+ T as DRuntimeContent
45
45
  };
@@ -1,4 +1,4 @@
1
- import { ReactiveArrayService } from '../../utils/reactiveArrayService';
1
+ import { ReactiveArrayService } from '../../utils';
2
2
  import { User, UsersEmailVerificationInput, UsersEmailVerificationPayload, UsersIdentityLinkInput, UsersIdentityLinkPayload, UsersIdentityLoginInput, UsersIdentityLoginPayload, UsersIdentityRegisterInput, UsersIdentityRegisterPayload, UsersIdentityUnlinkInput, UsersIdentityUnlinkPayload, UsersLoginInput, UsersLoginPayload, UsersLogoutInput, UsersLogoutPayload, UsersMfaBackupCodesRotateInput, UsersMfaBackupCodesRotatePayload, UsersMfaTotpGenerateSecretInput, UsersMfaTotpGenerateSecretPayload, UsersMfaTotpValidateSecretInput, UsersMfaTotpValidateSecretPayload, UsersPasswordResetInput, UsersPasswordResetPayload, UsersPasswordResetRequestInput, UsersPasswordResetRequestPayload, UsersRegisterInput, UsersRegisterPayload } from '@code0-tech/sagittarius-graphql-types';
3
3
  import { DUserView } from './DUser.view';
4
4
  export declare abstract class DUserReactiveService extends ReactiveArrayService<DUserView> {
@@ -1,14 +1,17 @@
1
+ import "../../utils/contextStore.js";
2
+ import "react";
1
3
  import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
2
- class a extends t {
4
+ import "merge-props";
5
+ class o extends t {
3
6
  //TODO: inject UI error handler for toasts
4
7
  //no id's need to be injected here because the root query has a users field
5
- getById(e) {
6
- return this.values().find((r) => r.id === e);
8
+ getById(r) {
9
+ return this.values().find((e) => e && e.id === r);
7
10
  }
8
- getByUsername(e) {
9
- return this.values().find((r) => r.username === e);
11
+ getByUsername(r) {
12
+ return this.values().find((e) => e && e.username === r);
10
13
  }
11
14
  }
12
15
  export {
13
- a as DUserReactiveService
16
+ o as DUserReactiveService
14
17
  };