@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,10 @@
1
+ import { default as React } from 'react';
2
+ import { NamespaceMember } from '@code0-tech/sagittarius-graphql-types';
3
+ import { DNamespaceRoleView } from '../d-role';
4
+ import { DNamespaceMemberView } from './DNamespaceMember.view';
5
+ export interface DNamespaceMemberContentProps {
6
+ memberId: NamespaceMember['id'];
7
+ onRemove?: (member: DNamespaceMemberView) => void;
8
+ onAssignRole?: (member: DNamespaceMemberView, roles: DNamespaceRoleView[]) => void;
9
+ }
10
+ export declare const DNamespaceMemberContent: React.FC<DNamespaceMemberContentProps>;
@@ -0,0 +1,176 @@
1
+ import { jsxs as r, jsx as e, Fragment as K } from "react/jsx-runtime";
2
+ import c from "react";
3
+ import { Flex as n } from "../flex/Flex.js";
4
+ import { useService as g, useStore as y } from "../../utils/contextStore.js";
5
+ import "merge-props";
6
+ import { DNamespaceMemberReactiveService as D } from "./DNamespaceMember.service.js";
7
+ import { DUserReactiveService as x } from "../d-user/DUser.service.js";
8
+ import { Menu as z, MenuTrigger as I, MenuPortal as T, MenuContent as w, MenuLabel as O, MenuItem as f, MenuSeparator as Q } from "../menu/Menu.js";
9
+ import { Avatar as W } from "../avatar/Avatar.js";
10
+ import { Text as o } from "../text/Text.js";
11
+ import "../../_virtual/compiler-runtime.js";
12
+ import { Card as X } from "../card/Card.js";
13
+ import { Badge as m } from "../badge/Badge.js";
14
+ import { IconTrash as Z, IconMailCheck as $, IconDots as _, IconUserOff as ee, IconUserCog as re } from "@tabler/icons-react";
15
+ import { Button as l } from "../button/Button.js";
16
+ import j from "../card/CardSection.js";
17
+ import "@radix-ui/react-checkbox";
18
+ import '../../assets/components/spacing/Spacing.style.css';import '../../assets/components/form/Input.style.css';/* empty css */
19
+ import "../form/EmailInput.js";
20
+ import "../form/Input.js";
21
+ import "../form/InputSuggestion.js";
22
+ import "../form/NumberInput.js";
23
+ import "../form/PasswordInput.js";
24
+ import "@radix-ui/react-one-time-password-field";
25
+ import "@radix-ui/react-radio-group";
26
+ import "../form/SwitchInput.js";
27
+ import "../form/TextInput.js";
28
+ /* empty css */
29
+ import { DNamespaceRoleReactiveService as B } from "../d-role/DNamespaceRole.service.js";
30
+ import { DNamespaceRolePermissions as b } from "../d-role/DNamespaceRolePermissions.js";
31
+ import { Tooltip as ie, TooltipTrigger as ne, TooltipPortal as oe, TooltipContent as te, TooltipArrow as le } from "../tooltip/Tooltip.js";
32
+ import { Dialog as k, DialogPortal as N, DialogContent as P, DialogClose as d } from "../dialog/Dialog.js";
33
+ const Le = (F) => {
34
+ const {
35
+ memberId: v,
36
+ onAssignRole: U = () => {
37
+ },
38
+ onRemove: L = () => {
39
+ }
40
+ } = F, Y = g(D), E = y(D), V = g(x), q = y(x), C = g(B), G = y(B), t = c.useMemo(() => Y.getById(v), [E, v]), s = c.useMemo(() => V.getById(t?.user?.id), [q, t]), h = c.useMemo(() => t?.roles?.nodes?.map((i) => C.getById(i?.id, {
41
+ namespaceId: t?.namespace?.id
42
+ })) || [], [G, t]), [p, S] = c.useState(h), [H, A] = c.useState(!1), [J, R] = c.useState(!1), M = C.values({
43
+ namespaceId: t?.namespace?.id
44
+ }).filter((i) => !p.find((a) => a?.id === i.id));
45
+ return /* @__PURE__ */ r(n, { align: "center", style: {
46
+ gap: "1.3rem"
47
+ }, justify: "space-between", children: [
48
+ /* @__PURE__ */ e(k, { open: H, onOpenChange: (i) => A(i), children: /* @__PURE__ */ e(N, { children: /* @__PURE__ */ r(P, { showCloseButton: !0, title: "Remove member", children: [
49
+ /* @__PURE__ */ r(o, { size: "md", hierarchy: "secondary", children: [
50
+ "Are you sure you want to remove ",
51
+ " ",
52
+ /* @__PURE__ */ e(m, { color: "info", children: /* @__PURE__ */ r(o, { size: "md", style: {
53
+ color: "inherit"
54
+ }, children: [
55
+ "@",
56
+ s?.username
57
+ ] }) }),
58
+ " ",
59
+ " ",
60
+ "from the namespace members?"
61
+ ] }),
62
+ /* @__PURE__ */ r(n, { justify: "space-between", align: "center", children: [
63
+ /* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(l, { color: "secondary", children: "No, go back!" }) }),
64
+ /* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(l, { color: "error", onClick: () => L(t), children: "Yes, remove!" }) })
65
+ ] })
66
+ ] }) }) }),
67
+ /* @__PURE__ */ e(k, { open: J, onOpenChange: (i) => R(i), children: /* @__PURE__ */ e(N, { children: /* @__PURE__ */ r(P, { autoFocus: !0, showCloseButton: !0, title: "Assign roles", children: [
68
+ /* @__PURE__ */ e(o, { size: "md", hierarchy: "tertiary", children: "Assign, remove and manage the roles of a active member" }),
69
+ /* @__PURE__ */ r(X, { paddingSize: "xs", color: "secondary", children: [
70
+ p.map((i) => /* @__PURE__ */ e(j, { border: !0, children: /* @__PURE__ */ r(n, { style: {
71
+ gap: "0.7rem"
72
+ }, align: "center", justify: "space-between", children: [
73
+ /* @__PURE__ */ r(n, { align: "center", style: {
74
+ gap: "1.3rem"
75
+ }, children: [
76
+ /* @__PURE__ */ e(o, { hierarchy: "primary", children: i?.name }),
77
+ /* @__PURE__ */ e(b, { abilities: i?.abilities })
78
+ ] }),
79
+ /* @__PURE__ */ e(l, { color: "error", paddingSize: "xxs", onClick: () => {
80
+ S((a) => a.filter((u) => u?.id != i?.id));
81
+ }, children: /* @__PURE__ */ e(Z, { size: 16 }) })
82
+ ] }) }, i?.id)),
83
+ /* @__PURE__ */ r(z, { children: [
84
+ /* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e(j, { hover: !0, p: 0.35, border: !0, display: "flex", justify: "center", children: /* @__PURE__ */ e(l, { paddingSize: "xxs", variant: "none", children: "Assign roles" }) }) }),
85
+ /* @__PURE__ */ e(T, { children: /* @__PURE__ */ r(w, { side: "bottom", sideOffset: 8, align: "center", children: [
86
+ /* @__PURE__ */ e(O, { children: "Roles to add" }),
87
+ M.map((i, a) => /* @__PURE__ */ r(K, { children: [
88
+ /* @__PURE__ */ e(f, { onSelect: () => {
89
+ S((u) => [...u, i]);
90
+ }, children: /* @__PURE__ */ r(n, { align: "center", style: {
91
+ gap: "1.3rem"
92
+ }, children: [
93
+ /* @__PURE__ */ e(o, { hierarchy: "primary", children: i?.name }),
94
+ /* @__PURE__ */ e(b, { abilities: i?.abilities })
95
+ ] }) }),
96
+ a < M.length - 1 && /* @__PURE__ */ e(Q, {})
97
+ ] }))
98
+ ] }) })
99
+ ] })
100
+ ] }),
101
+ /* @__PURE__ */ r(n, { justify: "space-between", align: "center", children: [
102
+ /* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(l, { color: "secondary", children: "No, go back!" }) }),
103
+ /* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(l, { onClick: () => U(t, p), color: "success", children: "Yes, save!" }) })
104
+ ] })
105
+ ] }) }) }),
106
+ /* @__PURE__ */ r(n, { style: {
107
+ gap: "1.3rem"
108
+ }, align: "center", children: [
109
+ /* @__PURE__ */ r(n, { align: "center", style: {
110
+ gap: ".7rem"
111
+ }, children: [
112
+ /* @__PURE__ */ e(W, { identifier: s?.username, bg: "transparent" }),
113
+ /* @__PURE__ */ r(n, { style: {
114
+ flexDirection: "column",
115
+ gap: "0.35rem"
116
+ }, children: [
117
+ /* @__PURE__ */ r(o, { size: "md", hierarchy: "primary", children: [
118
+ "@",
119
+ s?.username
120
+ ] }),
121
+ /* @__PURE__ */ e(o, { size: "sm", hierarchy: "tertiary", children: s?.email })
122
+ ] })
123
+ ] }),
124
+ h.length > 0 ? /* @__PURE__ */ r(n, { style: {
125
+ flexDirection: "column",
126
+ gap: "0.35rem"
127
+ }, children: [
128
+ /* @__PURE__ */ e(o, { size: "xs", hierarchy: "tertiary", children: "Assigned roles" }),
129
+ /* @__PURE__ */ e(n, { align: "center", style: {
130
+ gap: "0.35rem"
131
+ }, children: h.map((i) => /* @__PURE__ */ r(ie, { children: [
132
+ /* @__PURE__ */ e(ne, { asChild: !0, children: /* @__PURE__ */ e(m, { color: "info", children: /* @__PURE__ */ e(o, { style: {
133
+ color: "inherit"
134
+ }, hierarchy: "tertiary", children: i?.name }) }) }),
135
+ /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ r(te, { side: "bottom", children: [
136
+ /* @__PURE__ */ e(b, { abilities: i?.abilities }),
137
+ /* @__PURE__ */ e(le, {})
138
+ ] }) })
139
+ ] })) })
140
+ ] }) : null
141
+ ] }),
142
+ /* @__PURE__ */ r(n, { align: "center", style: {
143
+ gap: "1.3rem"
144
+ }, children: [
145
+ /* @__PURE__ */ e(n, { style: {
146
+ flexDirection: "column",
147
+ gap: "0.35rem"
148
+ }, children: /* @__PURE__ */ r(n, { style: {
149
+ gap: "0.35rem"
150
+ }, align: "center", children: [
151
+ s?.admin ? /* @__PURE__ */ e(m, { border: !0, color: "primary", children: /* @__PURE__ */ e(o, { hierarchy: "tertiary", children: "Owner" }) }) : null,
152
+ s?.emailVerifiedAt ? /* @__PURE__ */ r(m, { border: !0, color: "primary", children: [
153
+ /* @__PURE__ */ e($, { size: 16 }),
154
+ /* @__PURE__ */ e(o, { hierarchy: "tertiary", children: "Email verified" })
155
+ ] }) : null
156
+ ] }) }),
157
+ t?.userAbilities?.deleteMember || t?.userAbilities?.assignMemberRoles ? /* @__PURE__ */ r(z, { children: [
158
+ /* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e(l, { color: "secondary", children: /* @__PURE__ */ e(_, { size: 16 }) }) }),
159
+ /* @__PURE__ */ e(T, { children: /* @__PURE__ */ r(w, { align: "end", side: "bottom", sideOffset: 8, children: [
160
+ /* @__PURE__ */ e(O, { children: "Actions" }),
161
+ t?.userAbilities?.deleteMember && /* @__PURE__ */ r(f, { onSelect: () => A(!0), children: [
162
+ /* @__PURE__ */ e(ee, { size: 16 }),
163
+ /* @__PURE__ */ e(o, { children: "Remove member" })
164
+ ] }),
165
+ t?.userAbilities?.assignMemberRoles && /* @__PURE__ */ r(f, { onSelect: () => R(!0), children: [
166
+ /* @__PURE__ */ e(re, { size: 16 }),
167
+ /* @__PURE__ */ e(o, { children: "Assign role" })
168
+ ] })
169
+ ] }) })
170
+ ] }) : null
171
+ ] })
172
+ ] });
173
+ };
174
+ export {
175
+ Le as DNamespaceMemberContent
176
+ };
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { Namespace } from '@code0-tech/sagittarius-graphql-types';
3
+ import { Card } from '../card/Card';
4
+ import { DNamespaceMemberView } from './DNamespaceMember.view';
5
+ import { DNamespaceRoleView } from '../d-role';
6
+ export interface DNamespaceMemberListProps extends Omit<Card, "children" | "onSelect"> {
7
+ namespaceId: Namespace["id"];
8
+ filter?: (runtime: DNamespaceMemberView, index: number) => boolean;
9
+ onRemove?: (member: DNamespaceMemberView) => void;
10
+ onAssignRole?: (member: DNamespaceMemberView, roles: DNamespaceRoleView[]) => void;
11
+ }
12
+ export declare const DNamespaceMemberList: React.FC<DNamespaceMemberListProps>;
@@ -0,0 +1,23 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import f from "react";
3
+ import { useService as u, useStore as l } from "../../utils/contextStore.js";
4
+ import "merge-props";
5
+ import { DNamespaceMemberReactiveService as t } from "./DNamespaceMember.service.js";
6
+ import { Card as v } from "../card/Card.js";
7
+ import S from "../card/CardSection.js";
8
+ import { DNamespaceMemberContent as b } from "./DNamespaceMemberContent.js";
9
+ const g = (m) => {
10
+ const {
11
+ namespaceId: o,
12
+ filter: i = () => !0,
13
+ onRemove: s,
14
+ onAssignRole: c,
15
+ ...n
16
+ } = m, a = u(t), p = l(t), d = f.useMemo(() => a.values({
17
+ namespaceId: o
18
+ }), [p, o]);
19
+ return /* @__PURE__ */ r(v, { ...n, children: d.filter(i).map((e) => e && e.id && /* @__PURE__ */ r(S, { border: !0, children: /* @__PURE__ */ r(b, { onRemove: s, onAssignRole: c, memberId: e?.id }) }, e.id)) });
20
+ };
21
+ export {
22
+ g as DNamespaceMemberList
23
+ };
@@ -1,2 +1,4 @@
1
1
  export * from './DNamespaceMember.service';
2
2
  export * from './DNamespaceMember.view';
3
+ export * from './DNamespaceMemberCard';
4
+ export * from './DNamespaceMemberList';
@@ -1,6 +1,10 @@
1
1
  import { DNamespaceMemberReactiveService as m } from "./DNamespaceMember.service.js";
2
- import { DNamespaceMemberView as c } from "./DNamespaceMember.view.js";
2
+ import { DNamespaceMemberView as o } from "./DNamespaceMember.view.js";
3
+ import { DNamespaceMemberCard as c } from "./DNamespaceMemberCard.js";
4
+ import { DNamespaceMemberList as s } from "./DNamespaceMemberList.js";
3
5
  export {
6
+ c as DNamespaceMemberCard,
7
+ s as DNamespaceMemberList,
4
8
  m as DNamespaceMemberReactiveService,
5
- c as DNamespaceMemberView
9
+ o as DNamespaceMemberView
6
10
  };
@@ -2,7 +2,7 @@ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import n from "react";
3
3
  import { useStore as c, useService as s } from "../../utils/contextStore.js";
4
4
  import "merge-props";
5
- import { Text as a } from "../text/Text.js";
5
+ import { Text as m } from "../text/Text.js";
6
6
  import { DOrganizationReactiveService as S } from "./DOrganization.service.js";
7
7
  import { IconFolder as k, IconUser as L, IconServer as N, IconSettings as w, IconLogout as F } from "@tabler/icons-react";
8
8
  import { Flex as o } from "../flex/Flex.js";
@@ -11,21 +11,36 @@ import { Spacing as P } from "../spacing/Spacing.js";
11
11
  import { Avatar as T } from "../avatar/Avatar.js";
12
12
  import { DUserReactiveService as z } from "../d-user/DUser.service.js";
13
13
  import "../../_virtual/compiler-runtime.js";
14
- import '../../assets/components/card/Card.style.css';import '../../assets/components/menu/Menu.style.css';/* empty css */
14
+ import '../../assets/components/dialog/Dialog.style.css';import '../../assets/components/tooltip/Tooltip.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/card/Card.style.css';import '../../assets/components/menu/Menu.style.css';/* empty css */
15
15
  import "@radix-ui/react-dropdown-menu";
16
16
  /* empty css */
17
17
  import { useUserSession as W } from "../d-user/DUser.session.hook.js";
18
18
  import { Badge as d } from "../badge/Badge.js";
19
+ import "@radix-ui/react-checkbox";
20
+ /* empty css */
21
+ import "../form/EmailInput.js";
22
+ import "../form/Input.js";
23
+ import "../form/InputSuggestion.js";
24
+ import "../form/NumberInput.js";
25
+ import "../form/PasswordInput.js";
26
+ import "@radix-ui/react-one-time-password-field";
27
+ import "@radix-ui/react-radio-group";
28
+ import "../form/SwitchInput.js";
29
+ import "../form/TextInput.js";
19
30
  import { DNamespaceReactiveService as b } from "../d-namespace/DNamespace.service.js";
20
31
  import { DNamespaceMemberReactiveService as x } from "../d-member/DNamespaceMember.service.js";
21
- const ae = (I) => {
32
+ import "@radix-ui/react-tooltip";
33
+ /* empty css */
34
+ import "@radix-ui/react-dialog";
35
+ /* empty css */
36
+ const Ie = (I) => {
22
37
  const {
23
- organizationId: m,
38
+ organizationId: a,
24
39
  onLeave: M = () => {
25
40
  },
26
41
  onSetting: j = () => {
27
42
  }
28
- } = I, B = c(S), C = s(S), D = c(b), $ = s(b), A = c(x), R = s(x), U = s(z), O = c(z), g = W(), l = n.useMemo(() => U.getById(g?.user?.id), [O, g]), r = n.useMemo(() => m ? C.getById(m) : null, [B, m]), t = n.useMemo(() => r ? $.getById(r.namespace?.id) : null, [D, r]), u = n.useMemo(() => t && l ? R.getByNamespaceIdAndUserId(t.id, l.id) : null, [A, t, l]), y = t?.projects?.count, h = t?.members?.count, f = t?.runtimes?.count;
43
+ } = I, B = c(S), C = s(S), D = c(b), $ = s(b), A = c(x), R = s(x), U = s(z), O = c(z), g = W(), p = n.useMemo(() => U.getById(g?.user?.id), [O, g]), r = n.useMemo(() => a ? C.getById(a) : null, [B, a]), t = n.useMemo(() => r ? $.getById(r.namespace?.id) : null, [D, r]), u = n.useMemo(() => t && p ? R.getByNamespaceIdAndUserId(t.id, p.id) : null, [A, t, p]), y = t?.projects?.count, h = t?.members?.count, f = t?.runtimes?.count;
29
44
  return /* @__PURE__ */ i(o, { align: "center", style: {
30
45
  gap: "1.3rem"
31
46
  }, justify: "space-between", children: [
@@ -36,7 +51,7 @@ const ae = (I) => {
36
51
  /* @__PURE__ */ i(o, { style: {
37
52
  flexDirection: "column"
38
53
  }, children: [
39
- /* @__PURE__ */ e(a, { size: "lg", hierarchy: "primary", display: "block", children: r?.name }),
54
+ /* @__PURE__ */ e(m, { size: "lg", hierarchy: "primary", display: "block", children: r?.name }),
40
55
  /* @__PURE__ */ e(P, { spacing: "xxs" }),
41
56
  /* @__PURE__ */ i(o, { align: "center", style: {
42
57
  gap: "0.35rem",
@@ -46,13 +61,13 @@ const ae = (I) => {
46
61
  gap: "0.35rem"
47
62
  }, children: [
48
63
  /* @__PURE__ */ e(k, { size: 16 }),
49
- /* @__PURE__ */ e(a, { size: "xs", hierarchy: "tertiary", children: `${y ?? 0} project${(y ?? 0) !== 1 ? "s" : ""}` })
64
+ /* @__PURE__ */ e(m, { size: "xs", hierarchy: "tertiary", children: `${y ?? 0} project${(y ?? 0) !== 1 ? "s" : ""}` })
50
65
  ] }) }),
51
66
  /* @__PURE__ */ e(d, { color: "secondary", children: /* @__PURE__ */ i(o, { align: "center", style: {
52
67
  gap: "0.35rem"
53
68
  }, children: [
54
69
  /* @__PURE__ */ e(L, { size: 16 }),
55
- /* @__PURE__ */ i(a, { size: "xs", hierarchy: "tertiary", children: [
70
+ /* @__PURE__ */ i(m, { size: "xs", hierarchy: "tertiary", children: [
56
71
  " ",
57
72
  `${h ?? 0} member${(h ?? 0) !== 1 ? "s" : ""}`
58
73
  ] })
@@ -61,7 +76,7 @@ const ae = (I) => {
61
76
  gap: "0.35rem"
62
77
  }, children: [
63
78
  /* @__PURE__ */ e(N, { size: 16 }),
64
- /* @__PURE__ */ e(a, { size: "xs", hierarchy: "tertiary", children: `${f ?? 0} runtime${(f ?? 0) !== 1 ? "s" : ""}` })
79
+ /* @__PURE__ */ e(m, { size: "xs", hierarchy: "tertiary", children: `${f ?? 0} runtime${(f ?? 0) !== 1 ? "s" : ""}` })
65
80
  ] }) })
66
81
  ] })
67
82
  ] })
@@ -69,11 +84,11 @@ const ae = (I) => {
69
84
  /* @__PURE__ */ i(o, { align: "center", style: {
70
85
  gap: "0.35rem"
71
86
  }, children: [
72
- r?.userAbilities?.deleteOrganization || r?.userAbilities?.updateOrganization ? /* @__PURE__ */ e(v, { color: "secondary", onClick: (p) => {
73
- p.stopPropagation(), j(r);
87
+ r?.userAbilities?.deleteOrganization || r?.userAbilities?.updateOrganization ? /* @__PURE__ */ e(v, { color: "secondary", onClick: (l) => {
88
+ l.stopPropagation(), j(r);
74
89
  }, children: /* @__PURE__ */ e(w, { size: 16 }) }) : null,
75
- u && u.userAbilities?.deleteMember ? /* @__PURE__ */ i(v, { color: "error", onClick: (p) => {
76
- p.stopPropagation(), r && M(r);
90
+ u && u.userAbilities?.deleteMember ? /* @__PURE__ */ i(v, { color: "error", onClick: (l) => {
91
+ l.stopPropagation(), r && M(r);
77
92
  }, children: [
78
93
  /* @__PURE__ */ e(F, { size: 16 }),
79
94
  " Leave"
@@ -82,5 +97,5 @@ const ae = (I) => {
82
97
  ] });
83
98
  };
84
99
  export {
85
- ae as DOrganizationContent
100
+ Ie as DOrganizationContent
86
101
  };
@@ -1,8 +1,8 @@
1
- import { DOrganizationReactiveService as w } from "./DOrganization.service.js";
2
- import { DOrganizationView as R } from "./DOrganization.view.js";
1
+ import { DOrganizationReactiveService as B } from "./DOrganization.service.js";
2
+ import { DOrganizationView as E } from "./DOrganization.view.js";
3
3
  import "react/jsx-runtime";
4
4
  import "../../_virtual/compiler-runtime.js";
5
- import '../../assets/components/badge/Badge.style.css';import '../../assets/components/menu/Menu.style.css';import '../../assets/components/avatar/Avatar.style.css';import '../../assets/components/spacing/Spacing.style.css';import '../../assets/components/flex/Flex.style.css';import '../../assets/components/text/Text.style.css';import '../../assets/components/card/Card.style.css';/* empty css */
5
+ import '../../assets/components/dialog/Dialog.style.css';import '../../assets/components/tooltip/Tooltip.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/badge/Badge.style.css';import '../../assets/components/menu/Menu.style.css';import '../../assets/components/avatar/Avatar.style.css';import '../../assets/components/spacing/Spacing.style.css';import '../../assets/components/flex/Flex.style.css';import '../../assets/components/text/Text.style.css';import '../../assets/components/card/Card.style.css';/* empty css */
6
6
  import "react";
7
7
  import "merge-props";
8
8
  import "../../utils/contextStore.js";
@@ -16,9 +16,24 @@ import "js-md5";
16
16
  /* empty css */
17
17
  import "@radix-ui/react-dropdown-menu";
18
18
  /* empty css */
19
- import { DOrganizationList as V } from "./DOrganizationList.js";
19
+ import "@radix-ui/react-checkbox";
20
+ /* empty css */
21
+ import "../form/EmailInput.js";
22
+ import "../form/Input.js";
23
+ import "../form/InputSuggestion.js";
24
+ import "../form/NumberInput.js";
25
+ import "../form/PasswordInput.js";
26
+ import "@radix-ui/react-one-time-password-field";
27
+ import "@radix-ui/react-radio-group";
28
+ import "../form/SwitchInput.js";
29
+ import "../form/TextInput.js";
30
+ import "@radix-ui/react-tooltip";
31
+ /* empty css */
32
+ import "@radix-ui/react-dialog";
33
+ /* empty css */
34
+ import { DOrganizationList as G } from "./DOrganizationList.js";
20
35
  export {
21
- V as DOrganizationList,
22
- w as DOrganizationReactiveService,
23
- R as DOrganizationView
36
+ G as DOrganizationList,
37
+ B as DOrganizationReactiveService,
38
+ E as DOrganizationView
24
39
  };
@@ -1,70 +1,64 @@
1
1
  import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import { useService as n } from "../../utils/contextStore.js";
3
- import a from "react";
2
+ import { useService as a } from "../../utils/contextStore.js";
3
+ import l from "react";
4
4
  import "merge-props";
5
- import { Flex as o } from "../flex/Flex.js";
6
- import { DNamespaceReactiveService as S } from "../d-namespace/DNamespace.service.js";
7
- import { DOrganizationReactiveService as z } from "../d-organization/DOrganization.service.js";
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";
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";
8
12
  import "../../_virtual/compiler-runtime.js";
9
- import '../../assets/components/menu/Menu.style.css';import '../../assets/components/spacing/Spacing.style.css';import '../../assets/components/card/Card.style.css';/* empty css */
10
- import { Text as c } from "../text/Text.js";
11
- import { IconGitFork as j, IconServer as I, IconServerSpark as x, IconSettings as R } from "@tabler/icons-react";
12
- import { Button as _ } from "../button/Button.js";
13
- /* empty css */
14
- import { Avatar as B } from "../avatar/Avatar.js";
15
- import { DUserReactiveService as D } from "../d-user/DUser.service.js";
16
- /* empty css */
17
- import "@radix-ui/react-dropdown-menu";
18
- import { Badge as s } from "../badge/Badge.js";
19
- import { DNamespaceProjectReactiveService as b } from "./DNamespaceProject.service.js";
20
- import { DRuntimeReactiveService as P } from "../d-runtime/DRuntime.service.js";
21
- const Y = (m) => {
13
+ import '../../assets/components/card/Card.style.css';/* empty css */
14
+ import { Button as z } from "../button/Button.js";
15
+ const T = (p) => {
22
16
  const {
23
- projectId: k,
24
- onSetting: y = () => {
17
+ projectId: n,
18
+ onSetting: d = () => {
25
19
  }
26
- } = m, p = n(b), l = n(S), g = n(z), f = n(D), v = n(P), e = a.useMemo(() => p.getById(m.projectId), [p, m.projectId]), d = a.useMemo(() => e ? v.getById(e.primaryRuntime?.id) : null, [e]), t = a.useMemo(() => e ? l.getById(e.namespace?.id) : null, [l, e]), u = a.useMemo(() => t && t.parent ? t.parent.__typename === "Organization" ? g.getById(t.parent.id) : t.parent.__typename === "User" ? f.getById(t.parent.id) : null : null, []);
27
- return /* @__PURE__ */ i(o, { align: "center", style: {
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]);
21
+ return /* @__PURE__ */ i(t, { align: "center", style: {
28
22
  gap: "1.3rem"
29
23
  }, justify: "space-between", children: [
30
- /* @__PURE__ */ i(o, { align: "center", style: {
24
+ /* @__PURE__ */ i(t, { align: "center", style: {
31
25
  gap: "1.3rem"
32
26
  }, children: [
33
- /* @__PURE__ */ r(B, { bg: "transparent", identifier: (t?.parent?.__typename === "User" ? u.username : t?.parent?.__typename === "Organization" ? u.name : "") ?? "" }),
34
- /* @__PURE__ */ i(o, { style: {
27
+ /* @__PURE__ */ r(h, { bg: "transparent", identifier: e?.name ?? "" }),
28
+ /* @__PURE__ */ i(t, { style: {
35
29
  flexDirection: "column",
36
30
  gap: "0.35rem"
37
31
  }, children: [
38
- /* @__PURE__ */ r(c, { size: "lg", hierarchy: "primary", display: "block", children: e?.name }),
39
- /* @__PURE__ */ r(c, { size: "sm", hierarchy: "tertiary", display: "block", children: e?.description })
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 })
40
34
  ] })
41
35
  ] }),
42
- /* @__PURE__ */ i(o, { align: "center", style: {
36
+ /* @__PURE__ */ i(t, { align: "center", style: {
43
37
  gap: "1.3rem"
44
38
  }, children: [
45
- /* @__PURE__ */ i(o, { align: "center", style: {
39
+ /* @__PURE__ */ i(t, { align: "center", style: {
46
40
  gap: "0.35rem",
47
41
  flexWrap: "wrap"
48
42
  }, children: [
49
- /* @__PURE__ */ i(s, { color: "secondary", children: [
50
- /* @__PURE__ */ r(j, { size: 16 }),
51
- /* @__PURE__ */ r(c, { size: "xs", children: e?.flows?.count ?? 0 })
43
+ /* @__PURE__ */ i(c, { color: "secondary", children: [
44
+ /* @__PURE__ */ r(f, { size: 16 }),
45
+ /* @__PURE__ */ r(o, { size: "xs", children: e?.flows?.count ?? 0 })
52
46
  ] }),
53
- /* @__PURE__ */ i(s, { color: "secondary", children: [
54
- /* @__PURE__ */ r(I, { size: 16 }),
55
- /* @__PURE__ */ r(c, { size: "xs", children: e?.runtimes?.count ?? 0 })
47
+ /* @__PURE__ */ i(c, { color: "secondary", children: [
48
+ /* @__PURE__ */ r(j, { size: 16 }),
49
+ /* @__PURE__ */ r(o, { size: "xs", children: e?.runtimes?.count ?? 0 })
56
50
  ] }),
57
- d && /* @__PURE__ */ i(s, { color: "secondary", children: [
58
- /* @__PURE__ */ r(x, { size: 16 }),
59
- /* @__PURE__ */ r(c, { size: "xs", children: d.name })
51
+ m && /* @__PURE__ */ i(c, { color: "secondary", children: [
52
+ /* @__PURE__ */ r(v, { size: 16 }),
53
+ /* @__PURE__ */ r(o, { size: "xs", children: m.name })
60
54
  ] })
61
55
  ] }),
62
- e?.userAbilities?.deleteNamespaceProject || e?.userAbilities?.updateNamespaceProject ? /* @__PURE__ */ r(_, { color: "secondary", onClick: (h) => {
63
- h.stopPropagation(), y(e);
64
- }, children: /* @__PURE__ */ r(R, { size: 16 }) }) : null
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
65
59
  ] })
66
60
  ] });
67
61
  };
68
62
  export {
69
- Y as DNamespaceProjectContent
63
+ T as DNamespaceProjectContent
70
64
  };
@@ -1,4 +1,4 @@
1
- import { Maybe, Namespace, NamespaceProjectConnection, NamespaceRole, NamespaceRoleAbility, Scalars } from '@code0-tech/sagittarius-graphql-types';
1
+ import { Maybe, Namespace, NamespaceProjectConnection, NamespaceRole, NamespaceRoleAbility, NamespaceRoleUserAbilities, Scalars } from '@code0-tech/sagittarius-graphql-types';
2
2
  export declare class DNamespaceRoleView {
3
3
  /** The abilities the role is granted */
4
4
  private readonly _abilities?;
@@ -14,6 +14,8 @@ export declare class DNamespaceRoleView {
14
14
  private readonly _namespace?;
15
15
  /** Time when this NamespaceRole was last updated */
16
16
  private readonly _updatedAt?;
17
+ /** Abilities for the current user on this NamespaceRole */
18
+ private readonly _userAbilities?;
17
19
  constructor(payload: NamespaceRole);
18
20
  get abilities(): Maybe<Array<NamespaceRoleAbility>> | undefined;
19
21
  get assignedProjects(): Maybe<NamespaceProjectConnection> | undefined;
@@ -22,5 +24,6 @@ export declare class DNamespaceRoleView {
22
24
  get name(): Maybe<Scalars["String"]["output"]> | undefined;
23
25
  get namespace(): Maybe<Namespace> | undefined;
24
26
  get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined;
27
+ get userAbilities(): Maybe<NamespaceRoleUserAbilities> | undefined;
25
28
  json(): NamespaceRole;
26
29
  }
@@ -15,9 +15,9 @@ function a(t, e) {
15
15
  }
16
16
  return (e === "string" ? String : Number)(t);
17
17
  }
18
- class d {
18
+ class u {
19
19
  constructor(e) {
20
- i(this, "_abilities", void 0), i(this, "_assignedProjects", void 0), i(this, "_createdAt", void 0), i(this, "_id", void 0), i(this, "_name", void 0), i(this, "_namespace", void 0), i(this, "_updatedAt", void 0), this._abilities = e.abilities, this._assignedProjects = e.assignedProjects, this._createdAt = e.createdAt, this._id = e.id, this._name = e.name, this._namespace = e.namespace, this._updatedAt = e.updatedAt;
20
+ i(this, "_abilities", void 0), i(this, "_assignedProjects", void 0), i(this, "_createdAt", void 0), i(this, "_id", void 0), i(this, "_name", void 0), i(this, "_namespace", void 0), i(this, "_updatedAt", void 0), i(this, "_userAbilities", void 0), this._abilities = e.abilities, this._assignedProjects = e.assignedProjects, this._createdAt = e.createdAt, this._id = e.id, this._name = e.name, this._namespace = e.namespace, this._updatedAt = e.updatedAt, this._userAbilities = e.userAbilities;
21
21
  }
22
22
  get abilities() {
23
23
  return this._abilities;
@@ -40,6 +40,9 @@ class d {
40
40
  get updatedAt() {
41
41
  return this._updatedAt;
42
42
  }
43
+ get userAbilities() {
44
+ return this._userAbilities;
45
+ }
43
46
  json() {
44
47
  return {
45
48
  abilities: this._abilities,
@@ -53,5 +56,5 @@ class d {
53
56
  }
54
57
  }
55
58
  export {
56
- d as DNamespaceRoleView
59
+ u as DNamespaceRoleView
57
60
  };
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { DNamespaceRoleView } from './DNamespaceRole.view';
3
+ import { Card } from '../card/Card';
4
+ import { NamespaceRole } from '@code0-tech/sagittarius-graphql-types';
5
+ export interface DNamespaceRoleCardProps extends Omit<Card, "children" | "onSelect"> {
6
+ roleId: NamespaceRole['id'];
7
+ onSetting?: (role: DNamespaceRoleView) => void;
8
+ onMembersViewMore?: (role: DNamespaceRoleView) => void;
9
+ onProjectsViewMore?: (role: DNamespaceRoleView) => void;
10
+ }
11
+ export declare const DNamespaceRoleCard: React.FC<DNamespaceRoleCardProps>;
@@ -0,0 +1,17 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { c } from "../../_virtual/compiler-runtime.js";
3
+ import { Card as p } from "../card/Card.js";
4
+ import { DNamespaceRoleContent as a } from "./DNamespaceRoleContent.js";
5
+ const C = (s) => {
6
+ const e = c.c(5), {
7
+ roleId: r,
8
+ onSetting: t,
9
+ onMembersViewMore: m,
10
+ onProjectsViewMore: n
11
+ } = s;
12
+ let o;
13
+ return e[0] !== m || e[1] !== n || e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(a, { onSetting: t, onMembersViewMore: m, onProjectsViewMore: n, roleId: r }) }), e[0] = m, e[1] = n, e[2] = t, e[3] = r, e[4] = o) : o = e[4], o;
14
+ };
15
+ export {
16
+ C as DNamespaceRoleCard
17
+ };
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { DNamespaceRoleView } from './DNamespaceRole.view';
3
+ import { NamespaceRole } from '@code0-tech/sagittarius-graphql-types';
4
+ export interface DNamespaceRoleContentProps {
5
+ roleId: NamespaceRole["id"];
6
+ onSetting?: (role: DNamespaceRoleView) => void;
7
+ onMembersViewMore?: (role: DNamespaceRoleView) => void;
8
+ onProjectsViewMore?: (role: DNamespaceRoleView) => void;
9
+ }
10
+ export declare const DNamespaceRoleContent: React.FC<DNamespaceRoleContentProps>;