@code0-tech/pictor 0.0.0-mvp.13 → 0.0.0-mvp.15

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 (82) hide show
  1. package/dist/assets/components/button/Button.style.css +1 -1
  2. package/dist/assets/components/card/Card.style.css +1 -1
  3. package/dist/assets/components/toast/Toast.style.css +1 -1
  4. package/dist/components/button/Button.d.ts +2 -1
  5. package/dist/components/button/Button.js +22 -20
  6. package/dist/components/card/Card.d.ts +2 -1
  7. package/dist/components/card/Card.js +24 -21
  8. package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.service.d.ts +1 -1
  9. package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.service.js +1 -1
  10. package/dist/components/d-license/index.d.ts +2 -0
  11. package/dist/components/d-license/index.js +6 -0
  12. package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.service.d.ts +3 -2
  13. package/dist/components/d-member/DNamespaceMember.service.js +14 -0
  14. package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.d.ts +4 -1
  15. package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.js +4 -1
  16. package/dist/components/d-member/index.d.ts +2 -0
  17. package/dist/components/d-member/index.js +6 -0
  18. package/dist/components/d-namespace/index.d.ts +0 -10
  19. package/dist/components/d-namespace/index.js +4 -33
  20. package/dist/components/d-organization/DOrganization.service.d.ts +2 -2
  21. package/dist/components/d-organization/DOrganization.view.d.ts +4 -1
  22. package/dist/components/d-organization/DOrganization.view.js +21 -18
  23. package/dist/components/d-organization/DOrganizationCard.d.ts +3 -3
  24. package/dist/components/d-organization/DOrganizationCard.js +13 -76
  25. package/dist/components/d-organization/DOrganizationList.d.ts +10 -0
  26. package/dist/components/d-organization/DOrganizationList.js +20 -0
  27. package/dist/components/d-organization/DOrganizatonContent.d.ts +9 -0
  28. package/dist/components/d-organization/DOrganizatonContent.js +82 -0
  29. package/dist/components/d-organization/index.d.ts +1 -0
  30. package/dist/components/d-organization/index.js +8 -5
  31. package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.service.d.ts +1 -1
  32. package/dist/components/d-project/DNamespaceProject.service.js +14 -0
  33. package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.d.ts +4 -1
  34. package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.js +13 -10
  35. package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectCard.d.ts +1 -1
  36. package/dist/components/d-project/DNamespaceProjectCard.js +15 -0
  37. package/dist/components/d-project/DNamespaceProjectContent.d.ts +8 -0
  38. package/dist/components/d-project/DNamespaceProjectContent.js +68 -0
  39. package/dist/components/d-project/DNamespaceProjectList.d.ts +9 -0
  40. package/dist/components/d-project/DNamespaceProjectList.js +19 -0
  41. package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectMenu.d.ts +1 -1
  42. package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectMenu.js +3 -3
  43. package/dist/components/d-project/index.d.ts +5 -0
  44. package/dist/components/d-project/index.js +24 -0
  45. package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.service.d.ts +1 -1
  46. package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.service.js +1 -1
  47. package/dist/components/d-role/index.d.ts +2 -0
  48. package/dist/components/d-role/index.js +6 -0
  49. package/dist/components/d-runtime/DRuntime.view.d.ts +4 -1
  50. package/dist/components/d-runtime/DRuntime.view.js +6 -3
  51. package/dist/components/d-runtime/DRuntimeCard.d.ts +7 -0
  52. package/dist/components/d-runtime/DRuntimeCard.js +17 -0
  53. package/dist/components/d-runtime/DRuntimeContent.d.ts +7 -0
  54. package/dist/components/d-runtime/DRuntimeContent.js +38 -0
  55. package/dist/components/d-runtime/DRuntimeList.d.ts +9 -0
  56. package/dist/components/d-runtime/DRuntimeList.js +19 -0
  57. package/dist/components/d-runtime/index.d.ts +2 -0
  58. package/dist/components/d-runtime/index.js +6 -2
  59. package/dist/components/d-user/DUser.view.d.ts +4 -1
  60. package/dist/components/d-user/DUser.view.js +13 -10
  61. package/dist/components/d-user/DUserCard.d.ts +7 -0
  62. package/dist/components/d-user/DUserCard.js +15 -0
  63. package/dist/components/d-user/DUserContent.d.ts +7 -0
  64. package/dist/components/d-user/DUserContent.js +84 -0
  65. package/dist/components/d-user/DUserList.d.ts +9 -0
  66. package/dist/components/d-user/DUserList.js +19 -0
  67. package/dist/components/d-user/index.d.ts +2 -0
  68. package/dist/components/d-user/index.js +11 -7
  69. package/dist/components/form/useForm.d.ts +2 -1
  70. package/dist/components/form/useForm.js +27 -18
  71. package/dist/components/toast/Toast.d.ts +1 -0
  72. package/dist/components/toast/Toast.js +54 -62
  73. package/dist/index.d.ts +4 -0
  74. package/dist/index.js +184 -172
  75. package/package.json +11 -10
  76. package/dist/components/d-namespace/member/DNamespaceMember.service.js +0 -11
  77. package/dist/components/d-namespace/project/DNamespaceProject.service.js +0 -11
  78. package/dist/components/d-namespace/project/DNamespaceProjectCard.js +0 -57
  79. /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.d.ts +0 -0
  80. /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.js +0 -0
  81. /package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.d.ts +0 -0
  82. /package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.js +0 -0
@@ -0,0 +1,82 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import c from "react";
3
+ import { useStore as s, useService as a } from "../../utils/contextStore.js";
4
+ import "merge-props";
5
+ import { Text as m } from "../text/Text.js";
6
+ import { DOrganizationReactiveService as S } from "./DOrganization.service.js";
7
+ import { IconFolder as O, IconUser as k, IconServer as L, IconSettings as N, IconLogout as w } from "@tabler/icons-react";
8
+ import { Flex as i } from "../flex/Flex.js";
9
+ import { Button as f } from "../button/Button.js";
10
+ import { Spacing as F } from "../spacing/Spacing.js";
11
+ import { Avatar as T } from "../avatar/Avatar.js";
12
+ import { DUserReactiveService as v } from "../d-user/DUser.service.js";
13
+ import "../../_virtual/compiler-runtime.js";
14
+ import '../../assets/components/card/Card.style.css';import '../../assets/components/menu/Menu.style.css';/* empty css */
15
+ import "@radix-ui/react-dropdown-menu";
16
+ /* empty css */
17
+ import { useUserSession as W } from "../d-user/DUser.session.hook.js";
18
+ import { Badge as p } from "../badge/Badge.js";
19
+ import { DNamespaceReactiveService as z } from "../d-namespace/DNamespace.service.js";
20
+ import { DNamespaceMemberReactiveService as b } from "../d-member/DNamespaceMember.service.js";
21
+ const se = (x) => {
22
+ const {
23
+ organizationId: o,
24
+ onLeave: I = () => {
25
+ },
26
+ onSetting: M = () => {
27
+ }
28
+ } = x, j = s(S), B = a(S), C = s(z), D = a(z), $ = s(b), A = a(b), R = a(v), U = s(v), d = W(), l = c.useMemo(() => R.getById(d?.user?.id), [U, d]), n = c.useMemo(() => o ? B.getById(o) : null, [j, o]), t = c.useMemo(() => n ? D.getById(n.namespace?.id) : null, [C, n]), u = c.useMemo(() => t && l ? A.getByNamespaceIdAndUserId(t.id, l.id) : null, [$, t, l]), g = t?.projects?.count, y = t?.members?.count, h = t?.runtimes?.count;
29
+ return /* @__PURE__ */ r(i, { align: "center", style: {
30
+ gap: "1.3rem"
31
+ }, justify: "space-between", children: [
32
+ /* @__PURE__ */ r(i, { align: "center", style: {
33
+ gap: "1.3rem"
34
+ }, children: [
35
+ /* @__PURE__ */ e(T, { bg: "transparent", identifier: n?.name ?? "" }),
36
+ /* @__PURE__ */ r(i, { style: {
37
+ flexDirection: "column"
38
+ }, children: [
39
+ /* @__PURE__ */ e(m, { size: "lg", hierarchy: "primary", display: "block", children: n?.name }),
40
+ /* @__PURE__ */ e(F, { spacing: "xxs" }),
41
+ /* @__PURE__ */ r(i, { align: "center", style: {
42
+ gap: "0.35rem",
43
+ flexWrap: "wrap"
44
+ }, children: [
45
+ /* @__PURE__ */ e(p, { color: "secondary", children: /* @__PURE__ */ r(i, { align: "center", style: {
46
+ gap: "0.35rem"
47
+ }, children: [
48
+ /* @__PURE__ */ e(O, { size: 16 }),
49
+ /* @__PURE__ */ e(m, { size: "xs", hierarchy: "tertiary", children: `${g ?? 0} project${(g ?? 0) !== 1 ? "s" : ""}` })
50
+ ] }) }),
51
+ /* @__PURE__ */ e(p, { color: "secondary", children: /* @__PURE__ */ r(i, { align: "center", style: {
52
+ gap: "0.35rem"
53
+ }, children: [
54
+ /* @__PURE__ */ e(k, { size: 16 }),
55
+ /* @__PURE__ */ r(m, { size: "xs", hierarchy: "tertiary", children: [
56
+ " ",
57
+ `${y ?? 0} member${(y ?? 0) !== 1 ? "s" : ""}`
58
+ ] })
59
+ ] }) }),
60
+ /* @__PURE__ */ e(p, { color: "secondary", children: /* @__PURE__ */ r(i, { align: "center", style: {
61
+ gap: "0.35rem"
62
+ }, children: [
63
+ /* @__PURE__ */ e(L, { size: 16 }),
64
+ /* @__PURE__ */ e(m, { size: "xs", hierarchy: "tertiary", children: `${h ?? 0} runtime${(h ?? 0) !== 1 ? "s" : ""}` })
65
+ ] }) })
66
+ ] })
67
+ ] })
68
+ ] }),
69
+ /* @__PURE__ */ r(i, { align: "center", style: {
70
+ gap: "0.35rem"
71
+ }, children: [
72
+ n?.userAbilities?.deleteOrganization || n?.userAbilities?.updateOrganization ? /* @__PURE__ */ e(f, { color: "secondary", onClick: () => M(o), children: /* @__PURE__ */ e(N, { size: 16 }) }) : null,
73
+ u && u.userAbilities?.deleteMember ? /* @__PURE__ */ r(f, { color: "error", onClick: () => I(o), children: [
74
+ /* @__PURE__ */ e(w, { size: 16 }),
75
+ " Leave"
76
+ ] }) : null
77
+ ] })
78
+ ] });
79
+ };
80
+ export {
81
+ se as DOrganizationContent
82
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './DOrganization.service';
2
2
  export * from './DOrganization.view';
3
3
  export * from './DOrganizationCard';
4
+ export * from './DOrganizationList';
4
5
  export * from './DOrganizationMenu';
@@ -1,12 +1,12 @@
1
1
  import { DOrganizationReactiveService as w } from "./DOrganization.service.js";
2
- import { DOrganizationView as S } from "./DOrganization.view.js";
2
+ import { DOrganizationView as R } from "./DOrganization.view.js";
3
3
  import "react/jsx-runtime";
4
- import "react";
5
4
  import "../../_virtual/compiler-runtime.js";
6
- 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/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
+ import "react";
7
7
  import "merge-props";
8
- /* empty css */
9
8
  import "../../utils/contextStore.js";
9
+ /* empty css */
10
10
  import "@tabler/icons-react";
11
11
  /* empty css */
12
12
  import "../button/Button.js";
@@ -15,7 +15,10 @@ import "js-md5";
15
15
  /* empty css */
16
16
  /* empty css */
17
17
  import "@radix-ui/react-dropdown-menu";
18
+ /* empty css */
19
+ import { DOrganizationList as V } from "./DOrganizationList.js";
18
20
  export {
21
+ V as DOrganizationList,
19
22
  w as DOrganizationReactiveService,
20
- S as DOrganizationView
23
+ R as DOrganizationView
21
24
  };
@@ -1,6 +1,6 @@
1
1
  import { NamespaceProject, NamespacesProjectsAssignRuntimesInput, NamespacesProjectsAssignRuntimesPayload, NamespacesProjectsCreateInput, NamespacesProjectsCreatePayload, NamespacesProjectsDeleteInput, NamespacesProjectsDeletePayload } from '@code0-tech/sagittarius-graphql-types';
2
2
  import { DNamespaceProjectView } from './DNamespaceProject.view';
3
- import { ReactiveArrayService } from '../../../utils/reactiveArrayService';
3
+ import { ReactiveArrayService } from '../../utils';
4
4
  export declare abstract class DNamespaceProjectReactiveService extends ReactiveArrayService<DNamespaceProjectView> {
5
5
  getById(id: NamespaceProject['id']): DNamespaceProjectView | undefined;
6
6
  abstract projectAssignRuntimes(payload: NamespacesProjectsAssignRuntimesInput): Promise<NamespacesProjectsAssignRuntimesPayload | undefined>;
@@ -0,0 +1,14 @@
1
+ import "../../utils/contextStore.js";
2
+ import "react";
3
+ import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
4
+ import "merge-props";
5
+ class p extends t {
6
+ //TODO: inject UI error handler for toasts
7
+ //inject: namespaceId because the runtimes query needs it
8
+ getById(e) {
9
+ return this.values().find((r) => r.id === e);
10
+ }
11
+ }
12
+ export {
13
+ p as DNamespaceProjectReactiveService
14
+ };
@@ -1,4 +1,4 @@
1
- import { Flow, FlowConnection, Maybe, Namespace, NamespaceProject, Runtime, RuntimeConnection, Scalars } from '@code0-tech/sagittarius-graphql-types';
1
+ import { Flow, FlowConnection, Maybe, Namespace, NamespaceProject, NamespaceProjectUserAbilities, Runtime, RuntimeConnection, Scalars } from '@code0-tech/sagittarius-graphql-types';
2
2
  export declare class DNamespaceProjectView {
3
3
  /** Time when this NamespaceProject was created */
4
4
  private readonly _createdAt?;
@@ -20,6 +20,8 @@ export declare class DNamespaceProjectView {
20
20
  private readonly _runtimes?;
21
21
  /** Time when this NamespaceProject was last updated */
22
22
  private readonly _updatedAt?;
23
+ /** Abilities for the current user on this NamespaceProject */
24
+ private readonly _userAbilities?;
23
25
  constructor(payload: NamespaceProject);
24
26
  get createdAt(): Maybe<Scalars["Time"]["output"]> | undefined;
25
27
  get description(): Maybe<Scalars["String"]["output"]> | undefined;
@@ -31,5 +33,6 @@ export declare class DNamespaceProjectView {
31
33
  get primaryRuntime(): Maybe<Runtime> | undefined;
32
34
  get runtimes(): Maybe<RuntimeConnection> | undefined;
33
35
  get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined;
36
+ get userAbilities(): Maybe<NamespaceProjectUserAbilities> | undefined;
34
37
  json(): NamespaceProject;
35
38
  }
@@ -1,23 +1,23 @@
1
- function i(e, t, r) {
2
- return (t = n(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
1
+ function e(i, t, r) {
2
+ return (t = n(t)) in i ? Object.defineProperty(i, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = r, i;
3
3
  }
4
- function n(e) {
5
- var t = u(e, "string");
4
+ function n(i) {
5
+ var t = u(i, "string");
6
6
  return typeof t == "symbol" ? t : t + "";
7
7
  }
8
- function u(e, t) {
9
- if (typeof e != "object" || !e) return e;
10
- var r = e[Symbol.toPrimitive];
8
+ function u(i, t) {
9
+ if (typeof i != "object" || !i) return i;
10
+ var r = i[Symbol.toPrimitive];
11
11
  if (r !== void 0) {
12
- var s = r.call(e, t);
12
+ var s = r.call(i, t);
13
13
  if (typeof s != "object") return s;
14
14
  throw new TypeError("@@toPrimitive must return a primitive value.");
15
15
  }
16
- return (t === "string" ? String : Number)(e);
16
+ return (t === "string" ? String : Number)(i);
17
17
  }
18
18
  class o {
19
19
  constructor(t) {
20
- i(this, "_createdAt", void 0), i(this, "_description", void 0), i(this, "_flow", void 0), i(this, "_flows", void 0), i(this, "_id", void 0), i(this, "_name", void 0), i(this, "_namespace", void 0), i(this, "_primaryRuntime", void 0), i(this, "_runtimes", void 0), i(this, "_updatedAt", void 0), this._createdAt = t.createdAt, this._description = t.description, this._flow = t.flow, this._flows = t.flows, this._id = t.id, this._name = t.name, this._namespace = t.namespace, this._primaryRuntime = t.primaryRuntime, this._runtimes = t.runtimes, this._updatedAt = t.updatedAt;
20
+ e(this, "_createdAt", void 0), e(this, "_description", void 0), e(this, "_flow", void 0), e(this, "_flows", void 0), e(this, "_id", void 0), e(this, "_name", void 0), e(this, "_namespace", void 0), e(this, "_primaryRuntime", void 0), e(this, "_runtimes", void 0), e(this, "_updatedAt", void 0), e(this, "_userAbilities", void 0), this._createdAt = t.createdAt, this._description = t.description, this._flow = t.flow, this._flows = t.flows, this._id = t.id, this._name = t.name, this._namespace = t.namespace, this._primaryRuntime = t.primaryRuntime, this._runtimes = t.runtimes, this._updatedAt = t.updatedAt, this._userAbilities = t.userAbilities;
21
21
  }
22
22
  get createdAt() {
23
23
  return this._createdAt;
@@ -49,6 +49,9 @@ class o {
49
49
  get updatedAt() {
50
50
  return this._updatedAt;
51
51
  }
52
+ get userAbilities() {
53
+ return this._userAbilities;
54
+ }
52
55
  json() {
53
56
  return {
54
57
  createdAt: this._createdAt,
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Code0Component } from '../../../utils/types';
2
+ import { Code0Component } from '../../utils';
3
3
  import { Scalars } from '@code0-tech/sagittarius-graphql-types';
4
4
  export interface DNamespaceProjectCardProps extends Code0Component<HTMLDivElement> {
5
5
  projectId: Scalars['NamespaceProjectID']['output'];
@@ -0,0 +1,15 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { c as m } from "../../_virtual/compiler-runtime.js";
3
+ import { Card as s } from "../card/Card.js";
4
+ import { DNamespaceProjectContent as i } from "./DNamespaceProjectContent.js";
5
+ const d = (c) => {
6
+ const t = m.c(2), {
7
+ projectId: r,
8
+ onSettingsClick: n
9
+ } = c;
10
+ let o;
11
+ return t[0] !== r ? (o = /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(i, { projectId: r }) }), t[0] = r, t[1] = o) : o = t[1], o;
12
+ };
13
+ export {
14
+ d as default
15
+ };
@@ -0,0 +1,8 @@
1
+ import { Code0Component } from '../../utils';
2
+ import { NamespaceProject } from '@code0-tech/sagittarius-graphql-types';
3
+ import { default as React } from 'react';
4
+ export interface DNamespaceProjectContentProps extends Code0Component<HTMLDivElement> {
5
+ projectId: NamespaceProject["id"];
6
+ onSetting?: (projectId: NamespaceProject["id"]) => void;
7
+ }
8
+ export declare const DNamespaceProjectContent: React.FC<DNamespaceProjectContentProps>;
@@ -0,0 +1,68 @@
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";
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";
8
+ 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 k } from "../d-runtime/DRuntime.service.js";
21
+ const X = (m) => {
22
+ const {
23
+ projectId: y,
24
+ onSetting: g = () => {
25
+ }
26
+ } = m, p = n(b), l = n(S), f = n(z), v = n(D), h = n(k), e = a.useMemo(() => p.getById(m.projectId), [p, m.projectId]), d = a.useMemo(() => e ? h.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" ? f.getById(t.parent.id) : t.parent.__typename === "User" ? v.getById(t.parent.id) : null : null, []);
27
+ return /* @__PURE__ */ i(o, { align: "center", style: {
28
+ gap: "1.3rem"
29
+ }, justify: "space-between", children: [
30
+ /* @__PURE__ */ i(o, { align: "center", style: {
31
+ gap: "1.3rem"
32
+ }, 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: {
35
+ flexDirection: "column",
36
+ gap: "0.35rem"
37
+ }, 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 })
40
+ ] })
41
+ ] }),
42
+ /* @__PURE__ */ i(o, { align: "center", style: {
43
+ gap: "1.3rem"
44
+ }, children: [
45
+ /* @__PURE__ */ i(o, { align: "center", style: {
46
+ gap: "0.35rem",
47
+ flexWrap: "wrap"
48
+ }, 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 })
52
+ ] }),
53
+ /* @__PURE__ */ i(s, { color: "secondary", children: [
54
+ /* @__PURE__ */ r(I, { size: 16 }),
55
+ /* @__PURE__ */ r(c, { size: "xs", children: e?.runtimes?.count ?? 0 })
56
+ ] }),
57
+ d && /* @__PURE__ */ i(s, { color: "secondary", children: [
58
+ /* @__PURE__ */ r(x, { size: 16 }),
59
+ /* @__PURE__ */ r(c, { size: "xs", children: d.name })
60
+ ] })
61
+ ] }),
62
+ e?.userAbilities?.deleteNamespaceProject || e?.userAbilities?.updateNamespaceProject ? /* @__PURE__ */ r(_, { color: "secondary", onClick: () => g(y), children: /* @__PURE__ */ r(R, { size: 16 }) }) : null
63
+ ] })
64
+ ] });
65
+ };
66
+ export {
67
+ X as DNamespaceProjectContent
68
+ };
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { NamespaceProject } from '@code0-tech/sagittarius-graphql-types';
3
+ import { Card } from '../card/Card';
4
+ import { DNamespaceProjectView } from './DNamespaceProject.view';
5
+ export interface DNamespaceProjectListProps extends Omit<Card, "children"> {
6
+ filter?: (project: DNamespaceProjectView, index: number) => boolean;
7
+ onSetting?: (projectId: NamespaceProject["id"]) => void;
8
+ }
9
+ export declare const DNamespaceProjectList: React.FC<DNamespaceProjectListProps>;
@@ -0,0 +1,19 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import a from "react";
3
+ import { Card as d } from "../card/Card.js";
4
+ import { useService as f, useStore as u } from "../../utils/contextStore.js";
5
+ import "merge-props";
6
+ import { DNamespaceProjectReactiveService as t } from "./DNamespaceProject.service.js";
7
+ import S from "../card/CardSection.js";
8
+ import { DNamespaceProjectContent as j } from "./DNamespaceProjectContent.js";
9
+ const R = (o) => {
10
+ const {
11
+ filter: i = () => !0,
12
+ onSetting: c,
13
+ ...m
14
+ } = o, s = f(t), p = u(t), n = a.useMemo(() => s.values(), [p]);
15
+ return /* @__PURE__ */ r(d, { ...m, children: n.filter(i).map((e) => e.id && /* @__PURE__ */ r(S, { border: !0, children: /* @__PURE__ */ r(j, { onSetting: c, projectId: e?.id }) }, e.id)) });
16
+ };
17
+ export {
18
+ R as DNamespaceProjectList
19
+ };
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { MenuProps } from '../../menu/Menu';
2
+ import { MenuProps } from '../menu/Menu';
3
3
  import { Scalars } from '@code0-tech/sagittarius-graphql-types';
4
4
  export interface DNamespaceProjectMenuProps extends MenuProps {
5
5
  projectId: Scalars['NamespaceProjectID']['output'];
@@ -1,9 +1,9 @@
1
1
  import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
2
  import s from "react";
3
- import { Menu as u, MenuTrigger as d, MenuPortal as l, MenuContent as f, MenuItem as p } from "../../menu/Menu.js";
3
+ import { Menu as u, MenuTrigger as d, MenuPortal as l, MenuContent as f, MenuItem as p } from "../menu/Menu.js";
4
4
  import { DNamespaceProjectReactiveService as o } from "./DNamespaceProject.service.js";
5
- import { useService as c } from "../../../utils/contextStore.js";
6
- import { Button as h } from "../../button/Button.js";
5
+ import { useService as c } from "../../utils/contextStore.js";
6
+ import { Button as h } from "../button/Button.js";
7
7
  const x = (t) => {
8
8
  const n = c(o), i = c(o), a = n.getById(t.projectId);
9
9
  return s.useMemo(() => /* @__PURE__ */ m(u, { ...t, children: [
@@ -0,0 +1,5 @@
1
+ export * from './DNamespaceProject.service';
2
+ export * from './DNamespaceProject.view';
3
+ export * from './DNamespaceProjectCard';
4
+ export * from './DNamespaceProjectList';
5
+ export * from './DNamespaceProjectMenu';
@@ -0,0 +1,24 @@
1
+ import { DNamespaceProjectReactiveService as L } from "./DNamespaceProject.service.js";
2
+ import { DNamespaceProjectView as S } from "./DNamespaceProject.view.js";
3
+ import "react/jsx-runtime";
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/text/Text.style.css';import '../../assets/components/flex/Flex.style.css';import '../../assets/components/card/Card.style.css';/* empty css */
6
+ import "react";
7
+ import "merge-props";
8
+ import "../../utils/contextStore.js";
9
+ /* empty css */
10
+ /* empty css */
11
+ import "@tabler/icons-react";
12
+ import "../button/Button.js";
13
+ /* empty css */
14
+ import "js-md5";
15
+ /* empty css */
16
+ /* empty css */
17
+ import "@radix-ui/react-dropdown-menu";
18
+ /* empty css */
19
+ import { DNamespaceProjectList as b } from "./DNamespaceProjectList.js";
20
+ export {
21
+ b as DNamespaceProjectList,
22
+ L as DNamespaceProjectReactiveService,
23
+ S as DNamespaceProjectView
24
+ };
@@ -1,4 +1,4 @@
1
- import { ReactiveArrayService } from '../../../utils/reactiveArrayService';
1
+ import { ReactiveArrayService } from '../../utils/reactiveArrayService';
2
2
  import { DNamespaceRoleView } from './DNamespaceRole.view';
3
3
  import { NamespaceRole, NamespacesRolesAssignAbilitiesInput, NamespacesRolesAssignAbilitiesPayload, NamespacesRolesAssignProjectsInput, NamespacesRolesAssignProjectsPayload, NamespacesRolesCreateInput, NamespacesRolesCreatePayload, NamespacesRolesDeleteInput, NamespacesRolesDeletePayload } from '@code0-tech/sagittarius-graphql-types';
4
4
  export declare abstract class DNamespaceRoleReactiveService extends ReactiveArrayService<DNamespaceRoleView> {
@@ -1,4 +1,4 @@
1
- import { ReactiveArrayService as i } from "../../../utils/reactiveArrayService.js";
1
+ import { ReactiveArrayService as i } from "../../utils/reactiveArrayService.js";
2
2
  class c extends i {
3
3
  //TODO: inject UI error handler for toasts
4
4
  //inject: namespaceId because the runtimes query needs it
@@ -0,0 +1,2 @@
1
+ export * from './DNamespaceRole.service';
2
+ export * from './DNamespaceRole.view';
@@ -0,0 +1,6 @@
1
+ import { DNamespaceRoleReactiveService as a } from "./DNamespaceRole.service.js";
2
+ import { DNamespaceRoleView as c } from "./DNamespaceRole.view.js";
3
+ export {
4
+ a as DNamespaceRoleReactiveService,
5
+ c as DNamespaceRoleView
6
+ };
@@ -1,4 +1,4 @@
1
- import { DataTypeConnection, FlowTypeConnection, Maybe, Namespace, NamespaceProjectConnection, Runtime, RuntimeStatusType, Scalars } from '@code0-tech/sagittarius-graphql-types';
1
+ import { DataTypeConnection, FlowTypeConnection, Maybe, Namespace, NamespaceProjectConnection, Runtime, RuntimeStatusType, RuntimeUserAbilities, Scalars } from '@code0-tech/sagittarius-graphql-types';
2
2
  export declare class DRuntimeView {
3
3
  /** Time when this Runtime was created */
4
4
  private readonly _createdAt?;
@@ -22,6 +22,8 @@ export declare class DRuntimeView {
22
22
  private readonly _token?;
23
23
  /** Time when this Runtime was last updated */
24
24
  private readonly _updatedAt?;
25
+ /** Abilities for the current user on this Runtime */
26
+ private readonly _userAbilities?;
25
27
  constructor(payload: Runtime);
26
28
  get createdAt(): Maybe<Scalars["Time"]["output"]> | undefined;
27
29
  get dataTypes(): Maybe<DataTypeConnection> | undefined;
@@ -34,5 +36,6 @@ export declare class DRuntimeView {
34
36
  get status(): Maybe<RuntimeStatusType> | undefined;
35
37
  get token(): Maybe<Scalars["String"]["output"]> | undefined;
36
38
  get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined;
39
+ get userAbilities(): Maybe<RuntimeUserAbilities> | undefined;
37
40
  json(): Runtime;
38
41
  }
@@ -15,9 +15,9 @@ function o(e, t) {
15
15
  }
16
16
  return (t === "string" ? String : Number)(e);
17
17
  }
18
- class a {
18
+ class u {
19
19
  constructor(t) {
20
- i(this, "_createdAt", void 0), i(this, "_dataTypes", void 0), i(this, "_description", void 0), i(this, "_flowTypes", void 0), i(this, "_id", void 0), i(this, "_name", void 0), i(this, "_namespace", void 0), i(this, "_projects", void 0), i(this, "_status", void 0), i(this, "_token", void 0), i(this, "_updatedAt", void 0), this._createdAt = t.createdAt, this._dataTypes = t.dataTypes, this._description = t.description, this._flowTypes = t.flowTypes, this._id = t.id, this._name = t.name, this._namespace = t.namespace, this._projects = t.projects, this._status = t.status, this._token = t.token, this._updatedAt = t.updatedAt;
20
+ i(this, "_createdAt", void 0), i(this, "_dataTypes", void 0), i(this, "_description", void 0), i(this, "_flowTypes", void 0), i(this, "_id", void 0), i(this, "_name", void 0), i(this, "_namespace", void 0), i(this, "_projects", void 0), i(this, "_status", void 0), i(this, "_token", void 0), i(this, "_updatedAt", void 0), i(this, "_userAbilities", void 0), this._createdAt = t.createdAt, this._dataTypes = t.dataTypes, this._description = t.description, this._flowTypes = t.flowTypes, this._id = t.id, this._name = t.name, this._namespace = t.namespace, this._projects = t.projects, this._status = t.status, this._token = t.token, this._updatedAt = t.updatedAt, this._userAbilities = t.userAbilities;
21
21
  }
22
22
  get createdAt() {
23
23
  return this._createdAt;
@@ -52,6 +52,9 @@ class a {
52
52
  get updatedAt() {
53
53
  return this._updatedAt;
54
54
  }
55
+ get userAbilities() {
56
+ return this._userAbilities;
57
+ }
55
58
  json() {
56
59
  return {
57
60
  createdAt: this._createdAt,
@@ -69,5 +72,5 @@ class a {
69
72
  }
70
73
  }
71
74
  export {
72
- a as DRuntimeView
75
+ u as DRuntimeView
73
76
  };
@@ -0,0 +1,7 @@
1
+ import { Runtime } from '@code0-tech/sagittarius-graphql-types';
2
+ import { default as React } from 'react';
3
+ export interface DRuntimeCardProps {
4
+ runtimeId: Runtime['id'];
5
+ onSetting?: (runtimeId: Runtime['id']) => void;
6
+ }
7
+ export declare const DRuntimeCard: React.FC<DRuntimeCardProps>;
@@ -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 { 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;
12
+ };
13
+ function f() {
14
+ }
15
+ export {
16
+ x as DRuntimeCard
17
+ };
@@ -0,0 +1,7 @@
1
+ import { Runtime } from '@code0-tech/sagittarius-graphql-types';
2
+ import { default as React } from 'react';
3
+ export interface DRuntimeContentProps {
4
+ runtimeId: Runtime['id'];
5
+ onSetting?: (runtimeId: Runtime['id']) => void;
6
+ }
7
+ export declare const DRuntimeContent: React.FC<DRuntimeContentProps>;
@@ -0,0 +1,38 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import p from "react";
3
+ import { Text as n } from "../text/Text.js";
4
+ import { Flex as i } from "../flex/Flex.js";
5
+ import { IconSettings as d } from "@tabler/icons-react";
6
+ import { Button as h } from "../button/Button.js";
7
+ import { useService as f, useStore as y } from "../../utils/contextStore.js";
8
+ import "merge-props";
9
+ import { DRuntimeReactiveService as c } from "./DRuntime.service.js";
10
+ import { Badge as m } from "../badge/Badge.js";
11
+ const k = (s) => {
12
+ const {
13
+ runtimeId: t,
14
+ onSetting: l = () => {
15
+ }
16
+ } = s, a = f(c), u = y(c), r = p.useMemo(() => a.getById(t), [u, t]);
17
+ return /* @__PURE__ */ o(i, { justify: "space-between", align: "center", children: [
18
+ /* @__PURE__ */ o(i, { style: {
19
+ flexDirection: "column",
20
+ gap: "0.35rem"
21
+ }, children: [
22
+ /* @__PURE__ */ e(n, { size: "lg", hierarchy: "primary", display: "block", children: r?.name }),
23
+ /* @__PURE__ */ e(n, { size: "sm", hierarchy: "tertiary", display: "block", children: r?.description })
24
+ ] }),
25
+ /* @__PURE__ */ o(i, { align: "center", style: {
26
+ gap: "1.3rem"
27
+ }, children: [
28
+ /* @__PURE__ */ e(i, { align: "center", style: {
29
+ gap: "0.35rem",
30
+ flexWrap: "wrap"
31
+ }, children: r?.status === "CONNECTED" ? /* @__PURE__ */ e(m, { color: "success", children: "CONNECTED" }) : /* @__PURE__ */ e(m, { color: "error", children: "DISCONNECTED" }) }),
32
+ r?.userAbilities?.deleteRuntime || r?.userAbilities?.updateRuntime || r?.userAbilities?.rotateRuntimeToken ? /* @__PURE__ */ e(h, { color: "secondary", onClick: () => l(t), children: /* @__PURE__ */ e(d, { size: 16 }) }) : null
33
+ ] })
34
+ ] });
35
+ };
36
+ export {
37
+ k as DRuntimeContent
38
+ };
@@ -0,0 +1,9 @@
1
+ import { Runtime } from '@code0-tech/sagittarius-graphql-types';
2
+ import { DRuntimeView } from './DRuntime.view';
3
+ import { Card } from '../card/Card';
4
+ import { default as React } from 'react';
5
+ export interface DRuntimeListProps extends Omit<Card, "children"> {
6
+ filter?: (runtime: DRuntimeView, index: number) => boolean;
7
+ onSetting?: (runtimeId: Runtime['id']) => void;
8
+ }
9
+ export declare const DRuntimeList: React.FC<DRuntimeListProps>;
@@ -0,0 +1,19 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Card as p } from "../card/Card.js";
3
+ import d from "react";
4
+ import { useService as f, useStore as S } from "../../utils/contextStore.js";
5
+ import "merge-props";
6
+ import { DRuntimeReactiveService as e } from "./DRuntime.service.js";
7
+ import a from "../card/CardSection.js";
8
+ import { DRuntimeContent as l } from "./DRuntimeContent.js";
9
+ const j = (o) => {
10
+ const {
11
+ filter: i = () => !0,
12
+ onSetting: m,
13
+ ...n
14
+ } = o, c = f(e), s = S(e), u = d.useMemo(() => c.values(), [s]);
15
+ return /* @__PURE__ */ t(p, { ...n, children: u.filter(i).map((r) => r.id && /* @__PURE__ */ t(a, { border: !0, children: /* @__PURE__ */ t(l, { onSetting: m, runtimeId: r?.id }) }, r.id)) });
16
+ };
17
+ export {
18
+ j as DRuntimeList
19
+ };
@@ -1,2 +1,4 @@
1
1
  export * from './DRuntime.service';
2
2
  export * from './DRuntime.view';
3
+ export * from './DRuntimeCard';
4
+ export * from './DRuntimeList';
@@ -1,6 +1,10 @@
1
- import { DRuntimeReactiveService as r } from "./DRuntime.service.js";
1
+ import { DRuntimeReactiveService as t } from "./DRuntime.service.js";
2
2
  import { DRuntimeView as m } from "./DRuntime.view.js";
3
+ import { DRuntimeCard as R } from "./DRuntimeCard.js";
4
+ import { DRuntimeList as n } from "./DRuntimeList.js";
3
5
  export {
4
- r as DRuntimeReactiveService,
6
+ R as DRuntimeCard,
7
+ n as DRuntimeList,
8
+ t as DRuntimeReactiveService,
5
9
  m as DRuntimeView
6
10
  };