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

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 (87) hide show
  1. package/dist/assets/components/badge/Badge.style.css +1 -1
  2. package/dist/assets/components/button/Button.style.css +1 -1
  3. package/dist/assets/components/button-group/ButtonGroup.style.css +1 -1
  4. package/dist/assets/components/card/Card.style.css +1 -1
  5. package/dist/assets/components/command/Command.style.css +1 -1
  6. package/dist/assets/components/d-flow/folder/DFlowFolder.style.css +1 -1
  7. package/dist/assets/components/d-flow/function/DFlowFunctionDefaultCard.style.css +1 -1
  8. package/dist/assets/components/dialog/Dialog.style.css +1 -1
  9. package/dist/assets/components/file-tabs/FileTabs.style.css +1 -1
  10. package/dist/assets/components/form/Input.style.css +1 -1
  11. package/dist/assets/components/menu/Menu.style.css +1 -1
  12. package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
  13. package/dist/assets/components/tab/Tab.style.css +1 -1
  14. package/dist/assets/components/text/Text.style.css +1 -1
  15. package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
  16. package/dist/components/badge/Badge.d.ts +1 -0
  17. package/dist/components/badge/Badge.js +12 -11
  18. package/dist/components/button/Button.d.ts +1 -1
  19. package/dist/components/d-flow/input/DFlowInputDataType.js +32 -32
  20. package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +22 -22
  21. package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.util.js +11 -11
  22. package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.d.ts +1 -1
  23. package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +29 -16
  24. package/dist/components/d-flow/tab/DFlowTabDefault.js +59 -53
  25. package/dist/components/d-member/DNamespaceMember.view.js +13 -11
  26. package/dist/components/d-member/DNamespaceMemberCard.d.ts +10 -0
  27. package/dist/components/d-member/DNamespaceMemberCard.js +16 -0
  28. package/dist/components/d-member/DNamespaceMemberContent.d.ts +10 -0
  29. package/dist/components/d-member/DNamespaceMemberContent.js +176 -0
  30. package/dist/components/d-member/DNamespaceMemberList.d.ts +12 -0
  31. package/dist/components/d-member/DNamespaceMemberList.js +23 -0
  32. package/dist/components/d-member/index.d.ts +2 -0
  33. package/dist/components/d-member/index.js +6 -2
  34. package/dist/components/d-organization/DOrganizatonContent.js +29 -14
  35. package/dist/components/d-organization/index.js +22 -7
  36. package/dist/components/d-project/DNamespaceProjectContent.js +36 -42
  37. package/dist/components/d-role/DNamespaceRole.view.d.ts +4 -1
  38. package/dist/components/d-role/DNamespaceRole.view.js +6 -3
  39. package/dist/components/d-role/DNamespaceRoleCard.d.ts +11 -0
  40. package/dist/components/d-role/DNamespaceRoleCard.js +17 -0
  41. package/dist/components/d-role/DNamespaceRoleContent.d.ts +10 -0
  42. package/dist/components/d-role/DNamespaceRoleContent.js +156 -0
  43. package/dist/components/d-role/DNamespaceRoleList.d.ts +12 -0
  44. package/dist/components/d-role/DNamespaceRoleList.js +24 -0
  45. package/dist/components/d-role/DNamespaceRolePermissions.d.ts +5 -0
  46. package/dist/components/d-role/DNamespaceRolePermissions.js +129 -0
  47. package/dist/components/d-role/index.d.ts +2 -0
  48. package/dist/components/d-role/index.js +6 -2
  49. package/dist/components/d-runtime/DRuntimeCard.d.ts +1 -0
  50. package/dist/components/d-runtime/DRuntimeCard.js +13 -12
  51. package/dist/components/d-runtime/DRuntimeContent.d.ts +1 -0
  52. package/dist/components/d-runtime/DRuntimeContent.js +25 -20
  53. package/dist/components/d-runtime/DRuntimeList.d.ts +2 -1
  54. package/dist/components/d-runtime/DRuntimeList.js +17 -14
  55. package/dist/components/d-user/DUser.service.d.ts +1 -0
  56. package/dist/components/d-user/DUser.service.js +5 -2
  57. package/dist/components/d-user/DUserContent.js +25 -25
  58. package/dist/components/d-user/DUserInput.d.ts +5 -0
  59. package/dist/components/d-user/DUserInput.js +97 -0
  60. package/dist/components/d-user/DUserMenu.js +7 -6
  61. package/dist/components/d-user/index.d.ts +1 -0
  62. package/dist/components/d-user/index.js +11 -9
  63. package/dist/components/dialog/Dialog.d.ts +2 -1
  64. package/dist/components/dialog/Dialog.js +67 -59
  65. package/dist/components/form/EmailInput.js +12 -11
  66. package/dist/components/form/Input.d.ts +17 -5
  67. package/dist/components/form/Input.js +420 -137
  68. package/dist/components/form/Input.selection.hook.d.ts +17 -0
  69. package/dist/components/form/Input.selection.hook.js +78 -0
  70. package/dist/components/form/Input.syntax.hook.d.ts +27 -0
  71. package/dist/components/form/Input.syntax.hook.js +80 -0
  72. package/dist/components/form/Input.utils.d.ts +11 -0
  73. package/dist/components/form/Input.utils.js +33 -0
  74. package/dist/components/form/InputSuggestion.d.ts +14 -6
  75. package/dist/components/form/InputSuggestion.js +126 -72
  76. package/dist/components/form/InputSyntax.d.ts +19 -0
  77. package/dist/components/form/InputSyntax.js +52 -0
  78. package/dist/components/form/PasswordInput.js +11 -10
  79. package/dist/components/form/TextInput.js +11 -10
  80. package/dist/components/form/index.js +26 -27
  81. package/dist/components/form/inputSyntaxMapping.d.ts +3 -0
  82. package/dist/components/form/inputSyntaxMapping.js +42 -0
  83. package/dist/components/menu/Menu.d.ts +7 -3
  84. package/dist/components/menu/Menu.js +22 -22
  85. package/dist/components/tooltip/Tooltip.js +33 -33
  86. package/dist/index.js +209 -200
  87. package/package.json +15 -15
@@ -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>;
@@ -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>;