@code0-tech/pictor 0.0.0-mvp.21 → 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 (107) hide show
  1. package/dist/assets/components/alert/Alert.style.css +1 -1
  2. package/dist/assets/components/badge/Badge.style.css +1 -1
  3. package/dist/assets/components/breadcrumb/Breadcrumb.style.css +1 -1
  4. package/dist/assets/components/button/Button.style.css +1 -1
  5. package/dist/assets/components/button-group/ButtonGroup.style.css +1 -1
  6. package/dist/assets/components/card/Card.style.css +1 -1
  7. package/dist/assets/components/command/Command.style.css +1 -1
  8. package/dist/assets/components/d-flow/folder/DFlowFolder.style.css +1 -1
  9. package/dist/assets/components/d-flow/function/DFlowFunctionDefaultCard.style.css +1 -1
  10. package/dist/assets/components/d-flow/input/DFlowInputDataType.style.css +1 -1
  11. package/dist/assets/components/d-layout/DLayout.style.css +1 -1
  12. package/dist/assets/components/dialog/Dialog.style.css +1 -1
  13. package/dist/assets/components/file-tabs/FileTabs.style.css +1 -1
  14. package/dist/assets/components/form/Input.style.css +1 -1
  15. package/dist/assets/components/menu/Menu.style.css +1 -1
  16. package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
  17. package/dist/assets/components/tab/Tab.style.css +1 -1
  18. package/dist/assets/components/text/Text.style.css +1 -1
  19. package/dist/assets/components/toast/Toast.style.css +1 -1
  20. package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
  21. package/dist/components/badge/Badge.d.ts +1 -0
  22. package/dist/components/badge/Badge.js +12 -11
  23. package/dist/components/button/Button.d.ts +1 -1
  24. package/dist/components/d-flow/input/DFlowInputDataType.js +32 -32
  25. package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +22 -22
  26. package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.util.js +11 -11
  27. package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.d.ts +1 -1
  28. package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +29 -16
  29. package/dist/components/d-flow/tab/DFlowTabDefault.js +59 -53
  30. package/dist/components/d-member/DNamespaceMember.service.js +6 -4
  31. package/dist/components/d-member/DNamespaceMember.view.js +13 -11
  32. package/dist/components/d-member/DNamespaceMemberCard.d.ts +10 -0
  33. package/dist/components/d-member/DNamespaceMemberCard.js +16 -0
  34. package/dist/components/d-member/DNamespaceMemberContent.d.ts +10 -0
  35. package/dist/components/d-member/DNamespaceMemberContent.js +176 -0
  36. package/dist/components/d-member/DNamespaceMemberList.d.ts +12 -0
  37. package/dist/components/d-member/DNamespaceMemberList.js +23 -0
  38. package/dist/components/d-member/index.d.ts +2 -0
  39. package/dist/components/d-member/index.js +6 -2
  40. package/dist/components/d-organization/DOrganizationCard.d.ts +3 -2
  41. package/dist/components/d-organization/DOrganizationList.d.ts +3 -4
  42. package/dist/components/d-organization/DOrganizationList.js +7 -7
  43. package/dist/components/d-organization/DOrganizatonContent.d.ts +5 -4
  44. package/dist/components/d-organization/DOrganizatonContent.js +40 -25
  45. package/dist/components/d-organization/index.js +22 -7
  46. package/dist/components/d-project/DNamespaceProjectCard.d.ts +5 -5
  47. package/dist/components/d-project/DNamespaceProjectCard.js +13 -11
  48. package/dist/components/d-project/DNamespaceProjectContent.d.ts +2 -1
  49. package/dist/components/d-project/DNamespaceProjectContent.js +36 -42
  50. package/dist/components/d-project/DNamespaceProjectList.d.ts +3 -3
  51. package/dist/components/d-project/DNamespaceProjectList.js +1 -1
  52. package/dist/components/d-project/index.js +11 -17
  53. package/dist/components/d-role/DNamespaceRole.view.d.ts +4 -1
  54. package/dist/components/d-role/DNamespaceRole.view.js +6 -3
  55. package/dist/components/d-role/DNamespaceRoleCard.d.ts +11 -0
  56. package/dist/components/d-role/DNamespaceRoleCard.js +17 -0
  57. package/dist/components/d-role/DNamespaceRoleContent.d.ts +10 -0
  58. package/dist/components/d-role/DNamespaceRoleContent.js +156 -0
  59. package/dist/components/d-role/DNamespaceRoleList.d.ts +12 -0
  60. package/dist/components/d-role/DNamespaceRoleList.js +24 -0
  61. package/dist/components/d-role/DNamespaceRolePermissions.d.ts +5 -0
  62. package/dist/components/d-role/DNamespaceRolePermissions.js +129 -0
  63. package/dist/components/d-role/index.d.ts +2 -0
  64. package/dist/components/d-role/index.js +6 -2
  65. package/dist/components/d-runtime/DRuntimeCard.d.ts +3 -1
  66. package/dist/components/d-runtime/DRuntimeCard.js +13 -12
  67. package/dist/components/d-runtime/DRuntimeContent.d.ts +3 -1
  68. package/dist/components/d-runtime/DRuntimeContent.js +25 -20
  69. package/dist/components/d-runtime/DRuntimeList.d.ts +5 -3
  70. package/dist/components/d-runtime/DRuntimeList.js +21 -15
  71. package/dist/components/d-user/DUser.service.d.ts +1 -0
  72. package/dist/components/d-user/DUser.service.js +5 -2
  73. package/dist/components/d-user/DUserCard.d.ts +2 -1
  74. package/dist/components/d-user/DUserContent.d.ts +2 -1
  75. package/dist/components/d-user/DUserContent.js +45 -45
  76. package/dist/components/d-user/DUserInput.d.ts +5 -0
  77. package/dist/components/d-user/DUserInput.js +97 -0
  78. package/dist/components/d-user/DUserList.d.ts +2 -3
  79. package/dist/components/d-user/DUserList.js +4 -4
  80. package/dist/components/d-user/DUserMenu.js +7 -6
  81. package/dist/components/d-user/index.d.ts +1 -0
  82. package/dist/components/d-user/index.js +11 -9
  83. package/dist/components/dialog/Dialog.d.ts +2 -1
  84. package/dist/components/dialog/Dialog.js +67 -59
  85. package/dist/components/form/EmailInput.js +12 -11
  86. package/dist/components/form/Input.d.ts +17 -5
  87. package/dist/components/form/Input.js +420 -137
  88. package/dist/components/form/Input.selection.hook.d.ts +17 -0
  89. package/dist/components/form/Input.selection.hook.js +78 -0
  90. package/dist/components/form/Input.syntax.hook.d.ts +27 -0
  91. package/dist/components/form/Input.syntax.hook.js +80 -0
  92. package/dist/components/form/Input.utils.d.ts +11 -0
  93. package/dist/components/form/Input.utils.js +33 -0
  94. package/dist/components/form/InputSuggestion.d.ts +14 -6
  95. package/dist/components/form/InputSuggestion.js +126 -72
  96. package/dist/components/form/InputSyntax.d.ts +19 -0
  97. package/dist/components/form/InputSyntax.js +52 -0
  98. package/dist/components/form/PasswordInput.js +11 -10
  99. package/dist/components/form/TextInput.js +11 -10
  100. package/dist/components/form/index.js +26 -27
  101. package/dist/components/form/inputSyntaxMapping.d.ts +3 -0
  102. package/dist/components/form/inputSyntaxMapping.js +42 -0
  103. package/dist/components/menu/Menu.d.ts +7 -3
  104. package/dist/components/menu/Menu.js +22 -22
  105. package/dist/components/tooltip/Tooltip.js +33 -33
  106. package/dist/index.js +200 -189
  107. package/package.json +16 -16
@@ -1,22 +1,35 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Input as p, setElementKey as l } from "../../form/Input.js";
3
- import r from "react";
4
- import { Button as m } from "../../button/Button.js";
5
- import { IconX as u } from "@tabler/icons-react";
6
- import '../../../assets/components/d-flow/suggestion/DFlowSuggestionSearchInput.style.css';/* empty css */
7
- const C = r.forwardRef((n, t) => {
8
- t = t || r.useRef(null);
2
+ import "../../../_virtual/compiler-runtime.js";
3
+ import i from "react";
4
+ import "@radix-ui/react-checkbox";
5
+ import "merge-props";
6
+ import { IconX as a } from "@tabler/icons-react";
7
+ import '../../../assets/components/d-flow/suggestion/DFlowSuggestionSearchInput.style.css';import '../../../assets/components/form/Input.style.css';/* empty css */
8
+ import "../../form/EmailInput.js";
9
+ import { Input as c } from "../../form/Input.js";
10
+ import "../../form/InputSuggestion.js";
11
+ import "../../form/NumberInput.js";
12
+ import "../../form/PasswordInput.js";
13
+ import "@radix-ui/react-one-time-password-field";
14
+ import "@radix-ui/react-radio-group";
15
+ import "../../form/SwitchInput.js";
16
+ import "../../form/TextInput.js";
17
+ import { Button as l } from "../../button/Button.js";
18
+ /* empty css */
19
+ import { setElementKey as u } from "../../form/Input.utils.js";
20
+ const E = i.forwardRef((e, t) => {
21
+ t = t || i.useRef(null);
9
22
  const {
10
- clearable: i = !1,
11
- right: s,
12
- ...a
13
- } = n, c = () => {
14
- t.current && l(t.current, "value", "", "change");
15
- }, e = [s];
16
- return i && e.push(/* @__PURE__ */ o(m, { variant: "none", onClick: c, children: /* @__PURE__ */ o(u, { size: 13 }) })), /* @__PURE__ */ o(p, { wrapperComponent: {
23
+ clearable: m = !1,
24
+ right: p,
25
+ ...n
26
+ } = e, s = () => {
27
+ t.current && u(t.current, "value", "", "change");
28
+ }, r = [p];
29
+ return m && r.push(/* @__PURE__ */ o(l, { variant: "none", onClick: s, children: /* @__PURE__ */ o(a, { size: 13 }) })), /* @__PURE__ */ o(c, { wrapperComponent: {
17
30
  className: "d-flow-suggestion-search-input"
18
- }, right: e, type: "text", ref: t, ...a });
31
+ }, right: r, type: "text", ref: t, ...n });
19
32
  });
20
33
  export {
21
- C as DFlowSuggestionSearchInput
34
+ E as DFlowSuggestionSearchInput
22
35
  };
@@ -1,38 +1,38 @@
1
- import { jsx as r, jsxs as I } from "react/jsx-runtime";
2
- import m from "react";
3
- import { NodeFunctionView as w } from "../DFlow.view.js";
4
- import { TextInput as R } from "../../form/TextInput.js";
5
- import { Flex as b } from "../../flex/Flex.js";
6
- import { useService as p } from "../../../utils/contextStore.js";
7
- import { DFlowFunctionReactiveService as L } from "../function/DFlowFunction.service.js";
8
- import { useSuggestions as j } from "../suggestion/DFlowSuggestion.hook.js";
9
- import { DFlowSuggestionMenuFooter as x } from "../suggestion/DFlowSuggestionMenuFooter.js";
10
- import { toInputSuggestions as B } from "../suggestion/DFlowSuggestionMenu.util.js";
11
- import { DFlowReactiveService as T } from "../DFlow.service.js";
12
- import { Badge as g } from "../../badge/Badge.js";
13
- const Q = (v) => {
1
+ import { jsx as r, jsxs as _ } from "react/jsx-runtime";
2
+ import y from "react";
3
+ import { NodeFunctionView as R } from "../DFlow.view.js";
4
+ import { TextInput as j } from "../../form/TextInput.js";
5
+ import { Flex as B } from "../../flex/Flex.js";
6
+ import { useService as S } from "../../../utils/contextStore.js";
7
+ import { DFlowFunctionReactiveService as T } from "../function/DFlowFunction.service.js";
8
+ import { useSuggestions as M } from "../suggestion/DFlowSuggestion.hook.js";
9
+ import { DFlowSuggestionMenuFooter as E } from "../suggestion/DFlowSuggestionMenuFooter.js";
10
+ import { toInputSuggestions as k } from "../suggestion/DFlowSuggestionMenu.util.js";
11
+ import { DFlowReactiveService as C } from "../DFlow.service.js";
12
+ import { Badge as h } from "../../badge/Badge.js";
13
+ const Z = (V) => {
14
14
  const {
15
- functionInstance: s,
16
- flowId: y,
17
- depthLevel: S,
18
- scopeLevel: V,
19
- nodeLevel: N
20
- } = v, a = p(L), D = p(T), u = a.getById(s.functionDefinition?.id), c = m.useMemo(() => {
15
+ functionInstance: l,
16
+ flowId: D,
17
+ depthLevel: F,
18
+ scopeLevel: N,
19
+ nodeLevel: I
20
+ } = V, c = S(T), b = S(C), d = c.getById(l.functionDefinition?.id), f = y.useMemo(() => {
21
21
  const e = {};
22
- return u?.parameterDefinitions?.forEach((o) => {
22
+ return d?.parameterDefinitions?.forEach((o) => {
23
23
  e[o.id] = o;
24
24
  }), e;
25
- }, [u?.parameterDefinitions]), l = m.useMemo(() => [...s.parameters || []].sort((e, o) => e.id.localeCompare(o.id)), [s.parameters]), f = {};
26
- return l.forEach((e) => {
27
- const o = c[e.id];
28
- f[e.id] = j(o?.dataTypeIdentifier, [], y, S, V, N);
29
- }), /* @__PURE__ */ r(b, { style: {
25
+ }, [d?.parameterDefinitions]), m = y.useMemo(() => [...l.parameters || []].sort((e, o) => e.id.localeCompare(o.id)), [l.parameters]), g = {};
26
+ return m.forEach((e) => {
27
+ const o = f[e.id];
28
+ g[e.id] = M(o?.dataTypeIdentifier, [], D, F, N, I);
29
+ }), /* @__PURE__ */ r(B, { style: {
30
30
  gap: ".7rem",
31
31
  flexDirection: "column"
32
- }, children: l.map((e) => {
32
+ }, children: m.map((e) => {
33
33
  const o = (t) => {
34
- e.value = t, D.update();
35
- }, d = (t) => {
34
+ e.value = t, b.update();
35
+ }, p = (t) => {
36
36
  try {
37
37
  const n = JSON.parse(t.target.value);
38
38
  if (!n.__typename) {
@@ -49,49 +49,55 @@ const Q = (v) => {
49
49
  value: t.target.value
50
50
  });
51
51
  }
52
- }, i = c[e.id], O = f[e.id], h = i?.names ? i?.names?.nodes[0]?.content : i?.id, F = i?.descriptions ? i?.descriptions?.nodes[0]?.content : JSON.stringify(i?.dataTypeIdentifier), J = e.value instanceof w ? JSON.stringify({
52
+ }, s = f[e.id], w = g[e.id], L = s?.names ? s?.names?.nodes[0]?.content : s?.id, O = s?.descriptions ? s?.descriptions?.nodes[0]?.content : JSON.stringify(s?.dataTypeIdentifier), x = e.value instanceof R ? JSON.stringify({
53
53
  ...e.value.json(),
54
54
  __typename: "NodeFunction"
55
55
  }) : e.value?.__typename === "ReferenceValue" ? JSON.stringify(e.value) : e.value?.__typename === "LiteralValue" ? typeof e.value?.value == "object" ? JSON.stringify(e.value?.value) : e.value.value : "";
56
- return /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(R, { title: h, description: F, clearable: !0, transformValue: (t) => {
56
+ return /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(j, { title: L, description: O, clearable: !0, transformSyntax: (t) => {
57
+ const n = t ?? "", u = typeof n == "string" ? n : String(n), J = (i) => [{
58
+ type: "text",
59
+ start: 0,
60
+ end: i.length,
61
+ visualLength: i.length,
62
+ content: i
63
+ }], v = (i) => [{
64
+ type: "block",
65
+ start: 0,
66
+ end: u.length,
67
+ visualLength: 1,
68
+ content: i
69
+ }];
57
70
  try {
58
- if (!t) return t;
59
- if (JSON.parse(t).__typename === "NodeFunction") {
60
- const n = a.getById(JSON.parse(t).functionDefinition?.id);
61
- return /* @__PURE__ */ r(g, { color: "info", children: n?.names?.nodes[0]?.content });
71
+ const i = JSON.parse(u);
72
+ if (i?.__typename === "NodeFunction") {
73
+ const a = c.getById(i.functionDefinition?.id);
74
+ return v(/* @__PURE__ */ r(h, { color: "info", children: a?.names?.nodes[0]?.content }));
62
75
  }
63
- if (JSON.parse(t).__typename === "ReferenceValue") {
64
- const n = JSON.parse(t);
65
- return /* @__PURE__ */ I(g, { color: "warning", children: [
66
- n.depth,
76
+ if (i?.__typename === "ReferenceValue") {
77
+ const a = i;
78
+ return v(/* @__PURE__ */ _(h, { color: "warning", children: [
79
+ a.depth,
67
80
  "-",
68
- n.scope,
81
+ a.scope,
69
82
  "-",
70
- n.node,
83
+ a.node,
71
84
  "-",
72
- JSON.stringify(n.dataTypeIdentifier)
73
- ] });
85
+ JSON.stringify(a.dataTypeIdentifier)
86
+ ] }));
74
87
  }
75
88
  } catch {
76
89
  }
77
- return t;
78
- }, disableOnValue: (t) => {
79
- if (!t) return !1;
80
- try {
81
- return t.__typename === "NodeFunction" || t.__typename === "ReferenceValue";
82
- } catch {
83
- }
84
- return !1;
85
- }, defaultValue: J, onSuggestionSelect: (t) => {
90
+ return J(u);
91
+ }, defaultValue: x, onSuggestionSelect: (t) => {
86
92
  o(t.value);
87
93
  }, formValidation: {
88
94
  setValue: () => {
89
95
  },
90
96
  valid: e.validationResults.length <= 0,
91
97
  notValidMessage: e.validationResults.map((t) => t.message.nodes[0]?.content).join(", ")
92
- }, onBlur: d, onClear: d, suggestionsFooter: /* @__PURE__ */ r(x, {}), suggestions: B(O) }, JSON.stringify(e.value)) });
98
+ }, onBlur: p, onClear: p, suggestionsFooter: /* @__PURE__ */ r(E, {}), suggestions: k(w) }, JSON.stringify(e.value)) });
93
99
  }) });
94
100
  };
95
101
  export {
96
- Q as DFlowTabDefault
102
+ Z as DFlowTabDefault
97
103
  };
@@ -3,11 +3,13 @@ import "react";
3
3
  import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
4
4
  import "merge-props";
5
5
  class m extends t {
6
- getById(r, i) {
7
- return this.values(i).find((e) => e.id === r);
6
+ getById(e, i) {
7
+ return this.values(i).find((r) => r.id === e);
8
8
  }
9
- getByNamespaceIdAndUserId(r, i) {
10
- return this.values().find((e) => e.namespace?.id === r && e.user?.id === i);
9
+ getByNamespaceIdAndUserId(e, i) {
10
+ return this.values({
11
+ namespaceId: e
12
+ }).find((r) => r.namespace?.id === e && r.user?.id === i);
11
13
  }
12
14
  }
13
15
  export {
@@ -1,23 +1,23 @@
1
- function r(t, e, i) {
2
- return (e = u(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
1
+ function i(t, e, r) {
2
+ return (e = u(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
3
3
  }
4
4
  function u(t) {
5
- var e = o(t, "string");
5
+ var e = n(t, "string");
6
6
  return typeof e == "symbol" ? e : e + "";
7
7
  }
8
- function o(t, e) {
8
+ function n(t, e) {
9
9
  if (typeof t != "object" || !t) return t;
10
- var i = t[Symbol.toPrimitive];
11
- if (i !== void 0) {
12
- var s = i.call(t, e);
10
+ var r = t[Symbol.toPrimitive];
11
+ if (r !== void 0) {
12
+ var s = r.call(t, e);
13
13
  if (typeof s != "object") return s;
14
14
  throw new TypeError("@@toPrimitive must return a primitive value.");
15
15
  }
16
16
  return (e === "string" ? String : Number)(t);
17
17
  }
18
- class n {
18
+ class o {
19
19
  constructor(e) {
20
- r(this, "_createdAt", void 0), r(this, "_id", void 0), r(this, "_memberRoles", void 0), r(this, "_namespace", void 0), r(this, "_roles", void 0), r(this, "_updatedAt", void 0), r(this, "_user", void 0), r(this, "_userAbilities", void 0), this._createdAt = e.createdAt, this._id = e.id, this._memberRoles = e.memberRoles, this._namespace = e.namespace, this._roles = e.roles, this._updatedAt = e.updatedAt, this._user = e.user, this._userAbilities = e.userAbilities;
20
+ i(this, "_createdAt", void 0), i(this, "_id", void 0), i(this, "_memberRoles", void 0), i(this, "_namespace", void 0), i(this, "_roles", void 0), i(this, "_updatedAt", void 0), i(this, "_user", void 0), i(this, "_userAbilities", void 0), this._createdAt = e.createdAt, this._id = e.id, this._memberRoles = e.memberRoles, this._namespace = e.namespace, this._roles = e.roles, this._updatedAt = e.updatedAt, this._user = e.user, this._userAbilities = e.userAbilities;
21
21
  }
22
22
  get createdAt() {
23
23
  return this._createdAt;
@@ -45,16 +45,18 @@ class n {
45
45
  }
46
46
  json() {
47
47
  return {
48
+ __typename: "NamespaceMember",
48
49
  createdAt: this._createdAt,
49
50
  id: this._id,
50
51
  memberRoles: this._memberRoles,
51
52
  namespace: this._namespace,
52
53
  roles: this._roles,
53
54
  updatedAt: this._updatedAt,
54
- user: this._user
55
+ user: this._user,
56
+ userAbilities: this._userAbilities
55
57
  };
56
58
  }
57
59
  }
58
60
  export {
59
- n as DNamespaceMemberView
61
+ o as DNamespaceMemberView
60
62
  };
@@ -0,0 +1,10 @@
1
+ import { NamespaceMember } from '@code0-tech/sagittarius-graphql-types';
2
+ import { default as React } from 'react';
3
+ import { DNamespaceMemberView } from './DNamespaceMember.view';
4
+ import { DNamespaceRoleView } from '../d-role';
5
+ export interface DNamespaceMemberCardProps {
6
+ memberId: NamespaceMember["id"];
7
+ onRemove?: (member: DNamespaceMemberView) => void;
8
+ onAssignRole?: (member: DNamespaceMemberView, roles: DNamespaceRoleView[]) => void;
9
+ }
10
+ export declare const DNamespaceMemberCard: React.FC<DNamespaceMemberCardProps>;
@@ -0,0 +1,16 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { c } from "../../_virtual/compiler-runtime.js";
3
+ import { Card as i } from "../card/Card.js";
4
+ import { DNamespaceMemberContent as p } from "./DNamespaceMemberContent.js";
5
+ const b = (s) => {
6
+ const e = c.c(4), {
7
+ memberId: r,
8
+ onRemove: m,
9
+ onAssignRole: t
10
+ } = s;
11
+ let o;
12
+ return e[0] !== r || e[1] !== t || e[2] !== m ? (o = /* @__PURE__ */ n(i, { children: /* @__PURE__ */ n(p, { onRemove: m, onAssignRole: t, memberId: r }) }), e[0] = r, e[1] = t, e[2] = m, e[3] = o) : o = e[3], o;
13
+ };
14
+ export {
15
+ b as DNamespaceMemberCard
16
+ };
@@ -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
  };
@@ -1,10 +1,11 @@
1
1
  import { default as React } from 'react';
2
2
  import { Code0Component } from '../../utils';
3
3
  import { Scalars } from '@code0-tech/sagittarius-graphql-types';
4
+ import { DOrganizationView } from './DOrganization.view';
4
5
  export interface DOrganizationCardProps extends Code0Component<HTMLDivElement> {
5
6
  organizationId: Scalars['OrganizationID']['output'];
6
- onSetting?: (organizationId: Scalars['OrganizationID']['output']) => void;
7
- onLeave?: (organizationId: Scalars['OrganizationID']['output']) => void;
7
+ onSetting?: (organization: DOrganizationView) => void;
8
+ onLeave?: (organization: DOrganizationView) => void;
8
9
  }
9
10
  declare const DOrganizationCard: React.FC<DOrganizationCardProps>;
10
11
  export default DOrganizationCard;
@@ -1,11 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { Card } from '../card/Card';
3
3
  import { DOrganizationView } from './DOrganization.view';
4
- import { Organization } from '@code0-tech/sagittarius-graphql-types';
5
4
  export interface DOrganizationListProps extends Omit<Card, "children" | "onSelect"> {
6
5
  filter?: (organizations: DOrganizationView, index: number) => boolean;
7
- onSetting?: (organizationId: Organization['id']) => void;
8
- onLeave?: (organizationId: Organization['id']) => void;
9
- onSelect?: (organizationId: Organization['id']) => void;
6
+ onSetting?: (organization: DOrganizationView) => void;
7
+ onLeave?: (organization: DOrganizationView) => void;
8
+ onSelect?: (organization: DOrganizationView) => void;
10
9
  }
11
10
  export declare const DOrganizationList: React.FC<DOrganizationListProps>;
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import p from "react";
2
+ import d from "react";
3
3
  import { Card as u } from "../card/Card.js";
4
4
  import { useService as S, useStore as l } from "../../utils/contextStore.js";
5
5
  import "merge-props";
@@ -7,16 +7,16 @@ import { DOrganizationReactiveService as e } from "./DOrganization.service.js";
7
7
  import v from "../card/CardSection.js";
8
8
  import { DOrganizationContent as g } from "./DOrganizatonContent.js";
9
9
  const b = (i) => {
10
- const n = S(e), m = l(e), a = p.useMemo(() => n.values(), [m]), {
10
+ const n = S(e), m = l(e), a = d.useMemo(() => n.values(), [m]), {
11
11
  filter: c = () => !0,
12
12
  onLeave: s,
13
- onSetting: d,
13
+ onSetting: f,
14
14
  onSelect: t,
15
- ...f
15
+ ...p
16
16
  } = i;
17
- return /* @__PURE__ */ o(u, { ...f, children: a.filter(c).map((r) => r.id && /* @__PURE__ */ o(v, { border: !0, hover: !0, onClick: () => {
18
- t && t(r.id);
19
- }, children: /* @__PURE__ */ o(g, { onLeave: s, onSetting: d, organizationId: r?.id }) }, r.id)) });
17
+ return /* @__PURE__ */ o(u, { ...p, children: a.filter(c).map((r) => r.id && /* @__PURE__ */ o(v, { border: !0, hover: !0, onClick: () => {
18
+ t && t(r);
19
+ }, children: /* @__PURE__ */ o(g, { onLeave: s, onSetting: f, organizationId: r?.id }) }, r.id)) });
20
20
  };
21
21
  export {
22
22
  b as DOrganizationList
@@ -1,9 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { Code0Component } from '../../utils';
3
- import { Scalars } from '@code0-tech/sagittarius-graphql-types';
3
+ import { Organization } from '@code0-tech/sagittarius-graphql-types';
4
+ import { DOrganizationView } from './DOrganization.view';
4
5
  export interface DOrganizationCardProps extends Code0Component<HTMLDivElement> {
5
- organizationId: Scalars['OrganizationID']['output'];
6
- onSetting?: (organizationId: Scalars['OrganizationID']['output']) => void;
7
- onLeave?: (organizationId: Scalars['OrganizationID']['output']) => void;
6
+ organizationId: Organization['id'];
7
+ onSetting?: (organization: DOrganizationView) => void;
8
+ onLeave?: (organization: DOrganizationView) => void;
8
9
  }
9
10
  export declare const DOrganizationContent: React.FC<DOrganizationCardProps>;