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

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 (100) hide show
  1. package/dist/assets/components/aurora/Aurora.style.css +1 -0
  2. package/dist/assets/components/badge/Badge.style.css +1 -1
  3. package/dist/assets/components/button/Button.style.css +1 -1
  4. package/dist/assets/components/button-group/ButtonGroup.style.css +1 -1
  5. package/dist/assets/components/card/Card.style.css +1 -1
  6. package/dist/assets/components/command/Command.style.css +1 -1
  7. package/dist/assets/components/d-flow/folder/DFlowFolder.style.css +1 -1
  8. package/dist/assets/components/d-flow/function/DFlowFunctionDefaultCard.style.css +1 -1
  9. package/dist/assets/components/dialog/Dialog.style.css +1 -1
  10. package/dist/assets/components/file-tabs/FileTabs.style.css +1 -1
  11. package/dist/assets/components/form/Input.style.css +1 -1
  12. package/dist/assets/components/menu/Menu.style.css +1 -1
  13. package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
  14. package/dist/assets/components/tab/Tab.style.css +1 -1
  15. package/dist/assets/components/text/Text.style.css +1 -1
  16. package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
  17. package/dist/components/aurora/Aurora.d.ts +5 -0
  18. package/dist/components/aurora/Aurora.js +23 -0
  19. package/dist/components/badge/Badge.d.ts +1 -0
  20. package/dist/components/badge/Badge.js +12 -11
  21. package/dist/components/button/Button.d.ts +1 -1
  22. package/dist/components/d-flow/DFlow.view.d.ts +6 -2
  23. package/dist/components/d-flow/DFlow.view.js +52 -17
  24. package/dist/components/d-flow/control/DFlowControl.js +38 -38
  25. package/dist/components/d-flow/data-type/DFlowDataType.service.js +1 -1
  26. package/dist/components/d-flow/export/DFlowExport.d.ts +6 -0
  27. package/dist/components/d-flow/export/DFlowExport.js +24 -0
  28. package/dist/components/d-flow/input/DFlowInputDataType.js +32 -32
  29. package/dist/components/d-flow/suggestion/DFlowSuggestion.hook.js +1 -1
  30. package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +22 -22
  31. package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.util.js +11 -11
  32. package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.d.ts +1 -1
  33. package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +29 -16
  34. package/dist/components/d-flow/tab/DFlowTabDefault.js +59 -53
  35. package/dist/components/d-flow/type/DFlowType.view.d.ts +1 -1
  36. package/dist/components/d-member/DNamespaceMember.view.js +13 -11
  37. package/dist/components/d-member/DNamespaceMemberCard.d.ts +10 -0
  38. package/dist/components/d-member/DNamespaceMemberCard.js +16 -0
  39. package/dist/components/d-member/DNamespaceMemberContent.d.ts +10 -0
  40. package/dist/components/d-member/DNamespaceMemberContent.js +176 -0
  41. package/dist/components/d-member/DNamespaceMemberList.d.ts +12 -0
  42. package/dist/components/d-member/DNamespaceMemberList.js +23 -0
  43. package/dist/components/d-member/index.d.ts +2 -0
  44. package/dist/components/d-member/index.js +6 -2
  45. package/dist/components/d-organization/DOrganizatonContent.js +29 -14
  46. package/dist/components/d-organization/index.js +22 -7
  47. package/dist/components/d-project/DNamespaceProjectContent.js +36 -42
  48. package/dist/components/d-role/DNamespaceRole.view.d.ts +4 -1
  49. package/dist/components/d-role/DNamespaceRole.view.js +6 -3
  50. package/dist/components/d-role/DNamespaceRoleCard.d.ts +11 -0
  51. package/dist/components/d-role/DNamespaceRoleCard.js +17 -0
  52. package/dist/components/d-role/DNamespaceRoleContent.d.ts +10 -0
  53. package/dist/components/d-role/DNamespaceRoleContent.js +156 -0
  54. package/dist/components/d-role/DNamespaceRoleList.d.ts +12 -0
  55. package/dist/components/d-role/DNamespaceRoleList.js +24 -0
  56. package/dist/components/d-role/DNamespaceRolePermissions.d.ts +5 -0
  57. package/dist/components/d-role/DNamespaceRolePermissions.js +129 -0
  58. package/dist/components/d-role/index.d.ts +2 -0
  59. package/dist/components/d-role/index.js +6 -2
  60. package/dist/components/d-runtime/DRuntimeCard.d.ts +1 -0
  61. package/dist/components/d-runtime/DRuntimeCard.js +13 -12
  62. package/dist/components/d-runtime/DRuntimeContent.d.ts +1 -0
  63. package/dist/components/d-runtime/DRuntimeContent.js +25 -20
  64. package/dist/components/d-runtime/DRuntimeList.d.ts +2 -1
  65. package/dist/components/d-runtime/DRuntimeList.js +17 -14
  66. package/dist/components/d-user/DUser.service.d.ts +1 -0
  67. package/dist/components/d-user/DUser.service.js +5 -2
  68. package/dist/components/d-user/DUserContent.js +25 -25
  69. package/dist/components/d-user/DUserInput.d.ts +7 -0
  70. package/dist/components/d-user/DUserInput.js +98 -0
  71. package/dist/components/d-user/DUserMenu.js +7 -6
  72. package/dist/components/d-user/index.d.ts +1 -0
  73. package/dist/components/d-user/index.js +11 -9
  74. package/dist/components/dialog/Dialog.d.ts +2 -1
  75. package/dist/components/dialog/Dialog.js +67 -59
  76. package/dist/components/form/EmailInput.js +12 -11
  77. package/dist/components/form/Input.d.ts +17 -5
  78. package/dist/components/form/Input.js +420 -137
  79. package/dist/components/form/Input.selection.hook.d.ts +17 -0
  80. package/dist/components/form/Input.selection.hook.js +78 -0
  81. package/dist/components/form/Input.syntax.hook.d.ts +27 -0
  82. package/dist/components/form/Input.syntax.hook.js +80 -0
  83. package/dist/components/form/Input.utils.d.ts +11 -0
  84. package/dist/components/form/Input.utils.js +33 -0
  85. package/dist/components/form/InputSuggestion.d.ts +14 -6
  86. package/dist/components/form/InputSuggestion.js +126 -72
  87. package/dist/components/form/InputSyntax.d.ts +19 -0
  88. package/dist/components/form/InputSyntax.js +52 -0
  89. package/dist/components/form/PasswordInput.js +11 -10
  90. package/dist/components/form/TextInput.js +11 -10
  91. package/dist/components/form/index.js +26 -27
  92. package/dist/components/form/inputSyntaxMapping.d.ts +3 -0
  93. package/dist/components/form/inputSyntaxMapping.js +42 -0
  94. package/dist/components/menu/Menu.d.ts +7 -3
  95. package/dist/components/menu/Menu.js +22 -22
  96. package/dist/components/tooltip/Tooltip.js +33 -33
  97. package/dist/index.d.ts +1 -0
  98. package/dist/index.js +250 -239
  99. package/dist/utils/generics.js +1 -1
  100. package/package.json +17 -17
@@ -0,0 +1,156 @@
1
+ import { jsxs as r, jsx as e, Fragment as y } from "react/jsx-runtime";
2
+ import g from "react";
3
+ import { Flex as o } from "../flex/Flex.js";
4
+ import { useService as a, useStore as d } from "../../utils/contextStore.js";
5
+ import "merge-props";
6
+ import { DNamespaceRoleReactiveService as x } from "./DNamespaceRole.service.js";
7
+ import { Text as n } from "../text/Text.js";
8
+ import { Button as u } from "../button/Button.js";
9
+ import { IconFolders as G, IconUsers as H, IconSettings as J } from "@tabler/icons-react";
10
+ import { DNamespaceRolePermissions as K } from "./DNamespaceRolePermissions.js";
11
+ import { DNamespaceMemberReactiveService as b } from "../d-member/DNamespaceMember.service.js";
12
+ import "../../_virtual/compiler-runtime.js";
13
+ import { Card as f } from "../card/Card.js";
14
+ import { DUserReactiveService as v } from "../d-user/DUser.service.js";
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
+ import "@radix-ui/react-dropdown-menu";
17
+ import { Avatar as S } from "../avatar/Avatar.js";
18
+ import { Badge as m } from "../badge/Badge.js";
19
+ import p from "../card/CardSection.js";
20
+ import "@radix-ui/react-checkbox";
21
+ /* empty css */
22
+ import "../form/EmailInput.js";
23
+ import "../form/Input.js";
24
+ import "../form/InputSuggestion.js";
25
+ import "../form/NumberInput.js";
26
+ import "../form/PasswordInput.js";
27
+ import "@radix-ui/react-one-time-password-field";
28
+ import "@radix-ui/react-radio-group";
29
+ import "../form/SwitchInput.js";
30
+ import "../form/TextInput.js";
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";
33
+ import "@radix-ui/react-dialog";
34
+ /* empty css */
35
+ import { DNamespaceProjectReactiveService as w } from "../d-project/DNamespaceProject.service.js";
36
+ const De = (I) => {
37
+ const {
38
+ roleId: h,
39
+ onSetting: M = () => {
40
+ },
41
+ onMembersViewMore: P = () => {
42
+ },
43
+ onProjectsViewMore: N = () => {
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({
46
+ namespaceId: i?.namespace?.id
47
+ }).filter((t) => i?.assignedProjects?.nodes?.map((l) => l?.id).includes(t.id)), [V, i]), c = g.useMemo(() => F.values({
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;
50
+ return /* @__PURE__ */ r(o, { align: "center", style: {
51
+ gap: "1.3rem"
52
+ }, justify: "space-between", children: [
53
+ /* @__PURE__ */ r(o, { align: "center", style: {
54
+ gap: "1.3rem"
55
+ }, children: [
56
+ /* @__PURE__ */ e(n, { size: "lg", hierarchy: "primary", display: "block", children: i?.name }),
57
+ /* @__PURE__ */ e(K, { abilities: i?.abilities })
58
+ ] }),
59
+ /* @__PURE__ */ r(o, { align: "center", style: {
60
+ gap: "1.3rem"
61
+ }, children: [
62
+ /* @__PURE__ */ r(o, { style: {
63
+ flexDirection: "column",
64
+ gap: "0.35rem"
65
+ }, children: [
66
+ /* @__PURE__ */ e(n, { size: "xs", hierarchy: "tertiary", children: "Usage" }),
67
+ /* @__PURE__ */ r(o, { align: "center", style: {
68
+ gap: "0.35rem"
69
+ }, children: [
70
+ /* @__PURE__ */ r(R, { children: [
71
+ /* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ r(m, { border: !0, style: {
72
+ verticalAlign: "middle"
73
+ }, children: [
74
+ /* @__PURE__ */ e(G, { size: 16 }),
75
+ /* @__PURE__ */ e(n, { hierarchy: "tertiary", size: "xs", children: s.length })
76
+ ] }) }),
77
+ /* @__PURE__ */ e(j, { children: /* @__PURE__ */ r(C, { side: "bottom", maw: "200px", children: [
78
+ /* @__PURE__ */ e(n, { children: "Assigned projects" }),
79
+ /* @__PURE__ */ e(D, {}),
80
+ s.length > 0 ? /* @__PURE__ */ r(y, { children: [
81
+ /* @__PURE__ */ e(z, { spacing: "xxs" }),
82
+ /* @__PURE__ */ r(f, { paddingSize: "xs", mb: -0.35, mx: -0.7, style: {
83
+ borderWidth: "2px"
84
+ }, children: [
85
+ s.slice(0, 1).map((t) => /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ r(o, { align: "center", style: {
86
+ gap: "0.7rem"
87
+ }, children: [
88
+ /* @__PURE__ */ e(S, { bg: "transparent", identifier: t?.name ?? "" }),
89
+ /* @__PURE__ */ r(o, { style: {
90
+ flexDirection: "column",
91
+ gap: "0.35rem"
92
+ }, children: [
93
+ /* @__PURE__ */ e(n, { size: "xs", hierarchy: "secondary", children: t?.name }),
94
+ /* @__PURE__ */ e(n, { size: "xs", hierarchy: "tertiary", children: t?.description })
95
+ ] })
96
+ ] }) }, t.id)),
97
+ i && s.slice(1, s.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: () => N(i), children: [
98
+ /* @__PURE__ */ e(n, { size: "xs", children: "View more" }),
99
+ /* @__PURE__ */ e(m, { border: !0, children: s.slice(1, s.length).length })
100
+ ] }) }) : null
101
+ ] })
102
+ ] }) : null
103
+ ] }) })
104
+ ] }),
105
+ /* @__PURE__ */ r(R, { children: [
106
+ /* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ r(m, { border: !0, style: {
107
+ verticalAlign: "middle"
108
+ }, children: [
109
+ /* @__PURE__ */ e(H, { size: 16 }),
110
+ /* @__PURE__ */ e(n, { hierarchy: "tertiary", size: "xs", children: c.length })
111
+ ] }) }),
112
+ /* @__PURE__ */ e(j, { children: /* @__PURE__ */ r(C, { side: "bottom", maw: "200px", children: [
113
+ /* @__PURE__ */ e(n, { children: "Assigned members" }),
114
+ /* @__PURE__ */ e(D, {}),
115
+ c.length > 0 ? /* @__PURE__ */ r(y, { children: [
116
+ /* @__PURE__ */ e(z, { spacing: "xxs" }),
117
+ /* @__PURE__ */ r(f, { paddingSize: "xs", mb: -0.35, mx: -0.7, style: {
118
+ borderWidth: "2px"
119
+ }, children: [
120
+ c.slice(0, 1).map((t) => {
121
+ const l = W.getById(t.user?.id);
122
+ return /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ r(o, { align: "center", style: {
123
+ gap: "0.7rem"
124
+ }, children: [
125
+ /* @__PURE__ */ e(S, { bg: "transparent", identifier: l?.username ?? "" }),
126
+ /* @__PURE__ */ r(o, { style: {
127
+ flexDirection: "column",
128
+ gap: "0.35rem"
129
+ }, children: [
130
+ /* @__PURE__ */ r(n, { size: "xs", hierarchy: "secondary", children: [
131
+ "@",
132
+ l?.username
133
+ ] }),
134
+ /* @__PURE__ */ e(n, { size: "xs", hierarchy: "tertiary", children: l?.email })
135
+ ] })
136
+ ] }) }, t.id);
137
+ }),
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: [
139
+ /* @__PURE__ */ e(n, { size: "xs", children: "View more" }),
140
+ /* @__PURE__ */ e(m, { border: !0, children: c.length - 1 })
141
+ ] }) }) : null
142
+ ] })
143
+ ] }) : null
144
+ ] }) })
145
+ ] })
146
+ ] })
147
+ ] }),
148
+ q && /* @__PURE__ */ e(u, { color: "secondary", onClick: (t) => {
149
+ t.stopPropagation(), M(i);
150
+ }, children: /* @__PURE__ */ e(J, { size: 16 }) })
151
+ ] })
152
+ ] });
153
+ };
154
+ export {
155
+ De as DNamespaceRoleContent
156
+ };
@@ -0,0 +1,12 @@
1
+ import { Namespace } from '@code0-tech/sagittarius-graphql-types';
2
+ import { default as React } from 'react';
3
+ import { Card } from '../card/Card';
4
+ import { DNamespaceRoleView } from './DNamespaceRole.view';
5
+ export interface DNamespaceRoleListProps extends Omit<Card, "children" | "onSelect"> {
6
+ namespaceId: Namespace["id"];
7
+ filter?: (role: DNamespaceRoleView, index: number) => boolean;
8
+ onSetting?: (role: DNamespaceRoleView) => void;
9
+ onMembersViewMore?: (role: DNamespaceRoleView) => void;
10
+ onProjectsViewMore?: (role: DNamespaceRoleView) => void;
11
+ }
12
+ export declare const DNamespaceRoleList: React.FC<DNamespaceRoleListProps>;
@@ -0,0 +1,24 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { DNamespaceRoleContent as f } from "./DNamespaceRoleContent.js";
3
+ import u from "react";
4
+ import { Card as S } from "../card/Card.js";
5
+ import { useService as v, useStore as R } from "../../utils/contextStore.js";
6
+ import "merge-props";
7
+ import { DNamespaceRoleReactiveService as t } from "./DNamespaceRole.service.js";
8
+ import M from "../card/CardSection.js";
9
+ const I = (i) => {
10
+ const {
11
+ namespaceId: o,
12
+ filter: m = () => !0,
13
+ onSetting: s,
14
+ onProjectsViewMore: c,
15
+ onMembersViewMore: n,
16
+ ...a
17
+ } = i, p = v(t), d = R(t), l = u.useMemo(() => p.values({
18
+ namespaceId: o
19
+ }), [d, o]);
20
+ return /* @__PURE__ */ r(S, { ...a, children: l.filter(m).map((e) => e.id && /* @__PURE__ */ r(M, { border: !0, children: /* @__PURE__ */ r(f, { onSetting: s, onProjectsViewMore: c, onMembersViewMore: n, roleId: e?.id }) }, e.id)) });
21
+ };
22
+ export {
23
+ I as DNamespaceRoleList
24
+ };
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export interface DNamespaceRolePermissionsProps {
3
+ abilities?: string[];
4
+ }
5
+ export declare const DNamespaceRolePermissions: React.FC<DNamespaceRolePermissionsProps>;
@@ -0,0 +1,129 @@
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";
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 = {
9
+ ASSIGN_MEMBER_ROLES: "members",
10
+ INVITE_MEMBER: "members",
11
+ DELETE_MEMBER: "members",
12
+ CREATE_NAMESPACE_PROJECT: "projects",
13
+ UPDATE_NAMESPACE_PROJECT: "projects",
14
+ DELETE_NAMESPACE_PROJECT: "projects",
15
+ ASSIGN_ROLE_PROJECTS: "projects",
16
+ READ_NAMESPACE_PROJECT: "projects",
17
+ CREATE_NAMESPACE_ROLE: "roles",
18
+ UPDATE_NAMESPACE_ROLE: "roles",
19
+ ASSIGN_ROLE_ABILITIES: "roles",
20
+ CREATE_RUNTIME: "runtimes",
21
+ UPDATE_RUNTIME: "runtimes",
22
+ DELETE_RUNTIME: "runtimes",
23
+ ROTATE_RUNTIME_TOKEN: "runtimes",
24
+ ASSIGN_PROJECT_RUNTIMES: "runtimes",
25
+ CREATE_FLOW: "flows",
26
+ UPDATE_FLOW: "flows",
27
+ DELETE_FLOW: "flows",
28
+ CREATE_NAMESPACE_LICENSE: "license",
29
+ READ_NAMESPACE_LICENSE: "license",
30
+ DELETE_NAMESPACE_LICENSE: "license",
31
+ UPDATE_ORGANIZATION: "organization",
32
+ DELETE_ORGANIZATION: "organization",
33
+ NAMESPACE_ADMINISTRATOR: "admin"
34
+ }, p = {
35
+ members: "members",
36
+ projects: "projects",
37
+ roles: "roles",
38
+ runtimes: "runtimes",
39
+ flows: "flows",
40
+ license: "licenses",
41
+ organization: "the organization",
42
+ admin: "everything"
43
+ };
44
+ function d(e) {
45
+ return e.startsWith("CREATE_") ? "create" : e.startsWith("UPDATE_") ? "update" : e.startsWith("DELETE_") ? "delete" : e.startsWith("ASSIGN_") ? "assign" : e.startsWith("READ_") ? "read" : "manage";
46
+ }
47
+ function N(e) {
48
+ const r = Array.from(new Set(e));
49
+ return r.length === 1 ? r[0] : "manage";
50
+ }
51
+ function S(e) {
52
+ if (!e || e.length === 0) return [];
53
+ const r = /* @__PURE__ */ new Map();
54
+ for (const i of e) {
55
+ const o = f[i];
56
+ if (!o) continue;
57
+ const t = r.get(o) ?? [];
58
+ t.push(i), r.set(o, t);
59
+ }
60
+ return Array.from(r.entries()).map(([i, o]) => {
61
+ const t = o.map(d), E = N(t);
62
+ return {
63
+ category: i,
64
+ label: p[i],
65
+ abilities: o,
66
+ action: E
67
+ };
68
+ });
69
+ }
70
+ function g(e) {
71
+ if (e.length === 0) return "No special permissions.";
72
+ const r = (t) => /* @__PURE__ */ s(c, { children: [
73
+ t.action,
74
+ " ",
75
+ /* @__PURE__ */ s(_, { children: [
76
+ /* @__PURE__ */ n(u, { asChild: !0, children: /* @__PURE__ */ n(A, { color: "info", style: {
77
+ verticalAlign: "middle"
78
+ }, children: /* @__PURE__ */ n(l, { style: {
79
+ color: "inherit"
80
+ }, children: t.label }) }) }),
81
+ /* @__PURE__ */ n(h, { children: /* @__PURE__ */ s(C, { side: "bottom", children: [
82
+ /* @__PURE__ */ n(m, { style: {
83
+ flexDirection: "column",
84
+ gap: "0.25rem"
85
+ }, children: t.abilities.map((E) => /* @__PURE__ */ s(m, { align: "center", style: {
86
+ gap: "0.35rem"
87
+ }, children: [
88
+ /* @__PURE__ */ n(T, { size: 16 }),
89
+ /* @__PURE__ */ n(l, { size: "xs", children: E })
90
+ ] }, E)) }),
91
+ /* @__PURE__ */ n(R, {})
92
+ ] }) })
93
+ ] })
94
+ ] });
95
+ if (e.length === 1) {
96
+ const t = e[0];
97
+ return /* @__PURE__ */ s(c, { children: [
98
+ "Can ",
99
+ r(t)
100
+ ] });
101
+ }
102
+ const i = e.slice(0, -1), o = e[e.length - 1];
103
+ return /* @__PURE__ */ s(c, { children: [
104
+ "Can",
105
+ " ",
106
+ i.map((t, E) => /* @__PURE__ */ s(a.Fragment, { children: [
107
+ E > 0 && ", ",
108
+ r(t)
109
+ ] }, t.category)),
110
+ " ",
111
+ "and ",
112
+ r(o)
113
+ ] });
114
+ }
115
+ const b = (e) => {
116
+ const {
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
+ ] });
126
+ };
127
+ export {
128
+ b as DNamespaceRolePermissions
129
+ };
@@ -1,2 +1,4 @@
1
1
  export * from './DNamespaceRole.service';
2
2
  export * from './DNamespaceRole.view';
3
+ export * from './DNamespaceRoleList';
4
+ export * from './DNamespaceRoleCard';
@@ -1,6 +1,10 @@
1
1
  import { DNamespaceRoleReactiveService as a } from "./DNamespaceRole.service.js";
2
- import { DNamespaceRoleView as c } from "./DNamespaceRole.view.js";
2
+ import { DNamespaceRoleView as m } from "./DNamespaceRole.view.js";
3
+ import { DNamespaceRoleList as c } from "./DNamespaceRoleList.js";
4
+ import { DNamespaceRoleCard as s } from "./DNamespaceRoleCard.js";
3
5
  export {
6
+ s as DNamespaceRoleCard,
7
+ c as DNamespaceRoleList,
4
8
  a as DNamespaceRoleReactiveService,
5
- c as DNamespaceRoleView
9
+ m as DNamespaceRoleView
6
10
  };
@@ -4,5 +4,6 @@ import { DRuntimeView } from './DRuntime.view';
4
4
  export interface DRuntimeCardProps {
5
5
  runtimeId: Runtime['id'];
6
6
  onSetting?: (runtime: DRuntimeView) => void;
7
+ minimized?: boolean;
7
8
  }
8
9
  export declare const DRuntimeCard: React.FC<DRuntimeCardProps>;
@@ -1,17 +1,18 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { c } from "../../_virtual/compiler-runtime.js";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { c as d } from "../../_virtual/compiler-runtime.js";
3
3
  import { Card as p } from "../card/Card.js";
4
- import { DRuntimeContent as s } from "./DRuntimeContent.js";
5
- const x = (m) => {
6
- const t = c.c(3), {
7
- runtimeId: n,
8
- onSetting: e
9
- } = m, r = e === void 0 ? f : e;
10
- let o;
11
- return t[0] !== r || t[1] !== n ? (o = /* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(s, { runtimeId: n, onSetting: r }) }), t[0] = r, t[1] = n, t[2] = o) : o = t[2], o;
4
+ import { DRuntimeContent as f } from "./DRuntimeContent.js";
5
+ const R = (s) => {
6
+ const t = d.c(4), {
7
+ runtimeId: o,
8
+ minimized: m,
9
+ onSetting: r
10
+ } = s, n = m === void 0 ? !1 : m, e = r === void 0 ? u : r;
11
+ let i;
12
+ return t[0] !== n || t[1] !== e || t[2] !== o ? (i = /* @__PURE__ */ c(p, { children: /* @__PURE__ */ c(f, { minimized: n, runtimeId: o, onSetting: e }) }), t[0] = n, t[1] = e, t[2] = o, t[3] = i) : i = t[3], i;
12
13
  };
13
- function f() {
14
+ function u() {
14
15
  }
15
16
  export {
16
- x as DRuntimeCard
17
+ R as DRuntimeCard
17
18
  };
@@ -4,5 +4,6 @@ import { DRuntimeView } from './DRuntime.view';
4
4
  export interface DRuntimeContentProps {
5
5
  runtimeId: Runtime['id'];
6
6
  onSetting?: (runtime: DRuntimeView) => void;
7
+ minimized?: boolean;
7
8
  }
8
9
  export declare const DRuntimeContent: React.FC<DRuntimeContentProps>;
@@ -1,37 +1,42 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import d from "react";
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import h from "react";
3
3
  import { Text as n } from "../text/Text.js";
4
- import { Flex as t } from "../flex/Flex.js";
5
- import { IconSettings as h } from "@tabler/icons-react";
6
- import { Button as f } from "../button/Button.js";
7
- import { useService as g, useStore as y } from "../../utils/contextStore.js";
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";
8
8
  import "merge-props";
9
- import { DRuntimeReactiveService as c } from "./DRuntime.service.js";
10
- import { Badge as s } from "../badge/Badge.js";
9
+ import { DRuntimeReactiveService as s } from "./DRuntime.service.js";
10
+ import { Badge as l } from "../badge/Badge.js";
11
11
  const v = (m) => {
12
12
  const {
13
13
  runtimeId: o,
14
- onSetting: l = () => {
14
+ minimized: c = !1,
15
+ onSetting: a = () => {
15
16
  }
16
- } = m, a = g(c), p = y(c), e = d.useMemo(() => a.getById(o), [p, o]);
17
- return /* @__PURE__ */ i(t, { justify: "space-between", align: "center", children: [
18
- /* @__PURE__ */ i(t, { style: {
17
+ } = m, p = f(s), d = C(s), r = h.useMemo(() => p.getById(o), [d, o]);
18
+ return /* @__PURE__ */ t(i, { justify: "space-between", align: "center", style: {
19
+ gap: "1.3rem"
20
+ }, children: [
21
+ c ? /* @__PURE__ */ e(i, { align: "center", style: {
22
+ gap: "0.7rem"
23
+ }, children: /* @__PURE__ */ e(n, { size: "md", hierarchy: "secondary", display: "block", children: r?.name }) }) : /* @__PURE__ */ t(i, { style: {
19
24
  flexDirection: "column",
20
25
  gap: "0.35rem"
21
26
  }, children: [
22
- /* @__PURE__ */ r(n, { size: "lg", hierarchy: "primary", display: "block", children: e?.name }),
23
- /* @__PURE__ */ r(n, { size: "sm", hierarchy: "tertiary", display: "block", children: e?.description })
27
+ /* @__PURE__ */ e(n, { size: "lg", hierarchy: "secondary", display: "block", children: r?.name }),
28
+ /* @__PURE__ */ e(n, { size: "sm", hierarchy: "tertiary", display: "block", children: r?.description })
24
29
  ] }),
25
- /* @__PURE__ */ i(t, { align: "center", style: {
30
+ /* @__PURE__ */ t(i, { align: "center", style: {
26
31
  gap: "1.3rem"
27
32
  }, children: [
28
- /* @__PURE__ */ r(t, { align: "center", style: {
33
+ /* @__PURE__ */ e(i, { align: "center", style: {
29
34
  gap: "0.35rem",
30
35
  flexWrap: "wrap"
31
- }, children: e?.status === "CONNECTED" ? /* @__PURE__ */ r(s, { color: "success", children: "CONNECTED" }) : /* @__PURE__ */ r(s, { color: "error", children: "DISCONNECTED" }) }),
32
- e?.userAbilities?.deleteRuntime || e?.userAbilities?.updateRuntime || e?.userAbilities?.rotateRuntimeToken ? /* @__PURE__ */ r(f, { color: "secondary", onClick: (u) => {
33
- u.stopPropagation(), l(e);
34
- }, children: /* @__PURE__ */ r(h, { size: 16 }) }) : null
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) => {
38
+ u.stopPropagation(), a(r);
39
+ }, children: /* @__PURE__ */ e(y, { size: 16 }) }) : null
35
40
  ] })
36
41
  ] });
37
42
  };
@@ -3,9 +3,10 @@ import { DRuntimeView } from './DRuntime.view';
3
3
  import { Card } from '../card/Card';
4
4
  import { default as React } from 'react';
5
5
  export interface DRuntimeListProps extends Omit<Card, "children" | "onSelect"> {
6
- namespaceId: Namespace["id"];
6
+ namespaceId?: Namespace["id"];
7
7
  filter?: (runtime: DRuntimeView, index: number) => boolean;
8
8
  onSelect?: (runtime: DRuntimeView) => void;
9
9
  onSetting?: (runtime: DRuntimeView) => void;
10
+ minimized?: boolean;
10
11
  }
11
12
  export declare const DRuntimeList: React.FC<DRuntimeListProps>;
@@ -1,24 +1,27 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { Card as f } from "../card/Card.js";
3
- import a from "react";
4
- import { useService as S, useStore as l } from "../../utils/contextStore.js";
2
+ import { Card as a } from "../card/Card.js";
3
+ import S from "react";
4
+ import { useService as l, useStore as v } from "../../utils/contextStore.js";
5
5
  import "merge-props";
6
- import { DRuntimeReactiveService as i } from "./DRuntime.service.js";
7
- import v from "../card/CardSection.js";
8
- import { DRuntimeContent as R } from "./DRuntimeContent.js";
9
- const k = (m) => {
6
+ import { DRuntimeReactiveService as m } from "./DRuntime.service.js";
7
+ import R from "../card/CardSection.js";
8
+ import { DRuntimeContent as C } from "./DRuntimeContent.js";
9
+ const k = (n) => {
10
10
  const {
11
11
  namespaceId: t,
12
- filter: n = () => !0,
13
- onSetting: c,
12
+ minimized: i = !1,
13
+ filter: c = () => !0,
14
+ onSetting: s,
14
15
  onSelect: o,
15
- ...s
16
- } = m, u = S(i), p = l(i), d = a.useMemo(() => u.values({
16
+ ...d
17
+ } = n, p = l(m), u = v(m), f = S.useMemo(() => p.values({
17
18
  namespaceId: t
18
- }), [p, t]);
19
- return /* @__PURE__ */ r(f, { ...s, children: d.filter(n).map((e) => e.id && /* @__PURE__ */ r(v, { border: !0, hover: !0, onClick: () => {
19
+ }), [u, t]);
20
+ return /* @__PURE__ */ r(a, { ...d, ...i ? {
21
+ paddingSize: "sm"
22
+ } : {}, children: f.filter(c).map((e) => e.id && /* @__PURE__ */ r(R, { border: !0, hover: !0, onClick: () => {
20
23
  o && o(e);
21
- }, children: /* @__PURE__ */ r(R, { onSetting: c, runtimeId: e?.id }) }, e.id)) });
24
+ }, children: /* @__PURE__ */ r(C, { minimized: i, onSetting: s, runtimeId: e?.id }) }, e.id)) });
22
25
  };
23
26
  export {
24
27
  k as DRuntimeList
@@ -3,6 +3,7 @@ import { User, UsersEmailVerificationInput, UsersEmailVerificationPayload, Users
3
3
  import { DUserView } from './DUser.view';
4
4
  export declare abstract class DUserReactiveService extends ReactiveArrayService<DUserView> {
5
5
  getById(id: User['id']): DUserView | undefined;
6
+ getByUsername(username: User['username']): DUserView | undefined;
6
7
  abstract usersEmailVerification(payload: UsersEmailVerificationInput): Promise<UsersEmailVerificationPayload | undefined>;
7
8
  abstract usersIdentityLink(payload: UsersIdentityLinkInput): Promise<UsersIdentityLinkPayload | undefined>;
8
9
  abstract usersIdentityLogin(payload: UsersIdentityLoginInput): Promise<UsersIdentityLoginPayload | undefined>;
@@ -1,10 +1,13 @@
1
- import { ReactiveArrayService as i } from "../../utils/reactiveArrayService.js";
2
- class a extends i {
1
+ import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
2
+ class a extends t {
3
3
  //TODO: inject UI error handler for toasts
4
4
  //no id's need to be injected here because the root query has a users field
5
5
  getById(e) {
6
6
  return this.values().find((r) => r.id === e);
7
7
  }
8
+ getByUsername(e) {
9
+ return this.values().find((r) => r.username === e);
10
+ }
8
11
  }
9
12
  export {
10
13
  a as DUserReactiveService
@@ -1,10 +1,10 @@
1
1
  import { jsx as d, jsxs as p } from "react/jsx-runtime";
2
2
  import { c as V } from "../../_virtual/compiler-runtime.js";
3
- import B from "react";
3
+ import w from "react";
4
4
  import { Flex as u } from "../flex/Flex.js";
5
- import { Avatar as E } from "../avatar/Avatar.js";
6
- import { useUserSession as k } from "./DUser.session.hook.js";
7
- import { useService as w } from "../../utils/contextStore.js";
5
+ import { Avatar as B } from "../avatar/Avatar.js";
6
+ import { useUserSession as E } from "./DUser.session.hook.js";
7
+ import { useService as k } from "../../utils/contextStore.js";
8
8
  import "merge-props";
9
9
  import { DUserReactiveService as F } from "./DUser.service.js";
10
10
  import { Text as R } from "../text/Text.js";
@@ -14,17 +14,17 @@ import "../button/Button.js";
14
14
  const Z = (D) => {
15
15
  const e = V.c(37), {
16
16
  userId: x,
17
- onRemove: A
18
- } = D, z = A === void 0 ? T : A, b = w(F), I = k(), [U, $] = B.useState(!1);
17
+ onRemove: z
18
+ } = D, A = z === void 0 ? O : z, b = k(F), I = E(), [U, T] = w.useState(!1);
19
19
  let h;
20
20
  e[0] !== x || e[1] !== b ? (h = b.getById(x), e[0] = x, e[1] = b, e[2] = h) : h = e[2];
21
- const t = h, j = I?.user?.id === t.id;
21
+ const r = h, j = I?.user?.id === r.id;
22
22
  let y;
23
23
  e[3] === Symbol.for("react.memo_cache_sentinel") ? (y = {
24
24
  gap: ".7rem"
25
25
  }, e[3] = y) : y = e[3];
26
- let r;
27
- e[4] !== t.username ? (r = /* @__PURE__ */ d(E, { identifier: t.username, bg: "transparent" }), e[4] = t.username, e[5] = r) : r = e[5];
26
+ let t;
27
+ e[4] !== r.username ? (t = /* @__PURE__ */ d(B, { identifier: r.username, bg: "transparent" }), e[4] = r.username, e[5] = t) : t = e[5];
28
28
  let g;
29
29
  e[6] === Symbol.for("react.memo_cache_sentinel") ? (g = {
30
30
  gap: ".35rem",
@@ -35,37 +35,37 @@ const Z = (D) => {
35
35
  gap: "0.35rem"
36
36
  }, e[7] = v) : v = e[7];
37
37
  let i;
38
- e[8] !== t.username ? (i = /* @__PURE__ */ d(R, { size: "md", hierarchy: "primary", children: t.username }), e[8] = t.username, e[9] = i) : i = e[9];
38
+ e[8] !== r.username ? (i = /* @__PURE__ */ d(R, { size: "md", hierarchy: "primary", children: r.username }), e[8] = r.username, e[9] = i) : i = e[9];
39
39
  let l;
40
- e[10] !== t.admin ? (l = t.admin ? /* @__PURE__ */ d(C, { color: "secondary", children: "Admin" }) : null, e[10] = t.admin, e[11] = l) : l = e[11];
40
+ e[10] !== r.admin ? (l = r.admin ? /* @__PURE__ */ d(C, { color: "secondary", children: "Owner" }) : null, e[10] = r.admin, e[11] = l) : l = e[11];
41
41
  let s;
42
42
  e[12] !== i || e[13] !== l ? (s = /* @__PURE__ */ p(u, { align: "center", style: v, children: [
43
43
  i,
44
44
  l
45
45
  ] }), e[12] = i, e[13] = l, e[14] = s) : s = e[14];
46
- let n;
47
- e[15] !== t.email ? (n = /* @__PURE__ */ d(R, { size: "md", hierarchy: "tertiary", children: t.email }), e[15] = t.email, e[16] = n) : n = e[16];
48
46
  let m;
49
- e[17] !== s || e[18] !== n ? (m = /* @__PURE__ */ p(u, { style: g, children: [
47
+ e[15] !== r.email ? (m = /* @__PURE__ */ d(R, { size: "sm", hierarchy: "tertiary", children: r.email }), e[15] = r.email, e[16] = m) : m = e[16];
48
+ let n;
49
+ e[17] !== s || e[18] !== m ? (n = /* @__PURE__ */ p(u, { style: g, children: [
50
50
  s,
51
- n
52
- ] }), e[17] = s, e[18] = n, e[19] = m) : m = e[19];
53
- let o;
54
- e[20] !== m || e[21] !== r ? (o = /* @__PURE__ */ p(u, { style: y, align: "center", children: [
55
- r,
56
51
  m
57
- ] }), e[20] = m, e[21] = r, e[22] = o) : o = e[22];
52
+ ] }), e[17] = s, e[18] = m, e[19] = n) : n = e[19];
53
+ let o;
54
+ e[20] !== n || e[21] !== t ? (o = /* @__PURE__ */ p(u, { style: y, align: "center", children: [
55
+ t,
56
+ n
57
+ ] }), e[20] = n, e[21] = t, e[22] = o) : o = e[22];
58
58
  let S;
59
59
  e[23] === Symbol.for("react.memo_cache_sentinel") ? (S = {
60
60
  gap: "1.3rem"
61
61
  }, e[23] = S) : S = e[23];
62
62
  let c;
63
- e[24] !== t.emailVerifiedAt ? (c = t.emailVerifiedAt ? /* @__PURE__ */ p(C, { color: "secondary", children: [
63
+ e[24] !== r.emailVerifiedAt ? (c = r?.emailVerifiedAt ? /* @__PURE__ */ p(C, { color: "primary", children: [
64
64
  /* @__PURE__ */ d(M, { size: 16 }),
65
- /* @__PURE__ */ d(R, { size: "xs", children: "Email verified" })
66
- ] }) : null, e[24] = t.emailVerifiedAt, e[25] = c) : c = e[25];
65
+ /* @__PURE__ */ d(R, { size: "xs", hierarchy: "tertiary", children: "Email verified" })
66
+ ] }) : null, e[24] = r.emailVerifiedAt, e[25] = c) : c = e[25];
67
67
  let a;
68
- e[26] !== j || e[27] !== z || e[28] !== U || e[29] !== t ? (a = null, e[26] = j, e[27] = z, e[28] = U, e[29] = t, e[30] = a) : a = e[30];
68
+ e[26] !== j || e[27] !== A || e[28] !== U || e[29] !== r ? (a = null, e[26] = j, e[27] = A, e[28] = U, e[29] = r, e[30] = a) : a = e[30];
69
69
  let f;
70
70
  e[31] !== c || e[32] !== a ? (f = /* @__PURE__ */ p(u, { style: S, align: "center", children: [
71
71
  c,
@@ -77,7 +77,7 @@ const Z = (D) => {
77
77
  f
78
78
  ] }), e[34] = o, e[35] = f, e[36] = _) : _ = e[36], _;
79
79
  };
80
- function T() {
80
+ function O() {
81
81
  }
82
82
  export {
83
83
  Z as DUserContent