@nivaro/react 0.3.105 → 0.3.107
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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +47 -0
- package/dist/index.js +713 -708
- package/dist/shared/components/CollectionBrowserView.js +908 -892
- package/dist/shared/components/EnvironmentNotice.js +127 -0
- package/dist/shared/components/WidgetSlot.js +51 -50
- package/dist/shared/components/item-edit/GroupSection.js +116 -112
- package/dist/shared/components/panels/AddendumPanel.js +548 -547
- package/dist/shared/components/panels/CommentPanel.js +253 -256
- package/dist/shared/components/panels/OwnersSlot.js +35 -39
- package/dist/shared/components/panels/PipelinePanel.js +1048 -1051
- package/dist/shared/components/panels/ReferencedByPanel.js +16 -16
- package/dist/shared/components/panels/RelatedRecordsPanel.js +33 -32
- package/dist/shared/components/panels/TaskPanel.js +259 -262
- package/dist/shared/lib/use-starts-open.js +10 -0
- package/package.json +1 -1
|
@@ -1,73 +1,69 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Users as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { UserAvatar as
|
|
8
|
-
function
|
|
9
|
-
return [
|
|
2
|
+
import { useQuery as u } from "@tanstack/react-query";
|
|
3
|
+
import { Users as h, ChevronDown as w } from "lucide-react";
|
|
4
|
+
import { useNivaroClient as b } from "../../context.js";
|
|
5
|
+
import { get as N } from "../../lib/commands.js";
|
|
6
|
+
import { useStartsOpen as y } from "../../lib/use-starts-open.js";
|
|
7
|
+
import { UserAvatar as v } from "../UserAvatar.js";
|
|
8
|
+
function d(n) {
|
|
9
|
+
return [n.first_name, n.last_name].filter(Boolean).join(" ") || n.email;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function g(n) {
|
|
12
|
+
return d(n).split(" ").map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
collection:
|
|
16
|
-
item:
|
|
17
|
-
title:
|
|
18
|
-
defaultExpanded:
|
|
14
|
+
function U({
|
|
15
|
+
collection: n,
|
|
16
|
+
item: s,
|
|
17
|
+
title: p,
|
|
18
|
+
defaultExpanded: m
|
|
19
19
|
}) {
|
|
20
|
-
const x =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const { data: a = [] } = h({
|
|
25
|
-
queryKey: ["pipeline-instance-owners", s, r],
|
|
26
|
-
queryFn: () => x.request(_(`/pipelines/instance/${s}/${r}/owners`)).then((t) => t.data ?? []),
|
|
27
|
-
enabled: !!s && !!r && r !== "new"
|
|
20
|
+
const x = b(), [c, f] = y(m, !1), { data: r = [] } = u({
|
|
21
|
+
queryKey: ["pipeline-instance-owners", n, s],
|
|
22
|
+
queryFn: () => x.request(N(`/pipelines/instance/${n}/${s}/owners`)).then((t) => t.data ?? []),
|
|
23
|
+
enabled: !!n && !!s && s !== "new"
|
|
28
24
|
});
|
|
29
|
-
if (!
|
|
25
|
+
if (!s || s === "new") return null;
|
|
30
26
|
const l = /* @__PURE__ */ new Map();
|
|
31
|
-
for (const t of
|
|
32
|
-
const
|
|
33
|
-
l.has(
|
|
27
|
+
for (const t of r) {
|
|
28
|
+
const a = t.state ?? "__all__";
|
|
29
|
+
l.has(a) || l.set(a, []), l.get(a).push(t);
|
|
34
30
|
}
|
|
35
31
|
return /* @__PURE__ */ o("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white", children: [
|
|
36
32
|
/* @__PURE__ */ o(
|
|
37
33
|
"button",
|
|
38
34
|
{
|
|
39
35
|
type: "button",
|
|
40
|
-
onClick: () =>
|
|
36
|
+
onClick: () => f((t) => !t),
|
|
41
37
|
className: "flex w-full items-center gap-2 px-4 py-2.5",
|
|
42
38
|
children: [
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-500", children:
|
|
45
|
-
!
|
|
39
|
+
/* @__PURE__ */ e(h, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
40
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-500", children: p || "Owners" }),
|
|
41
|
+
!c && r.length > 0 && /* @__PURE__ */ e("span", { className: "ml-1 text-[11px] text-slate-400", children: r.length }),
|
|
46
42
|
/* @__PURE__ */ e(
|
|
47
|
-
|
|
43
|
+
w,
|
|
48
44
|
{
|
|
49
|
-
className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${
|
|
45
|
+
className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${c ? " rotate-180" : ""}`
|
|
50
46
|
}
|
|
51
47
|
)
|
|
52
48
|
]
|
|
53
49
|
}
|
|
54
50
|
),
|
|
55
|
-
|
|
51
|
+
c && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 px-4 py-3", children: r.length === 0 ? /* @__PURE__ */ e("p", { className: "py-1 text-[13px] text-slate-400", children: "No owners assigned" }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: [...l.entries()].map(([t, a]) => /* @__PURE__ */ o("div", { children: [
|
|
56
52
|
t !== "__all__" && /* @__PURE__ */ e("p", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: t }),
|
|
57
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children:
|
|
53
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: a.map((i) => /* @__PURE__ */ o(
|
|
58
54
|
"div",
|
|
59
55
|
{
|
|
60
56
|
className: "flex items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5",
|
|
61
57
|
children: [
|
|
62
58
|
/* @__PURE__ */ e(
|
|
63
|
-
|
|
59
|
+
v,
|
|
64
60
|
{
|
|
65
61
|
userId: i.user,
|
|
66
62
|
className: "h-6 w-6",
|
|
67
|
-
fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children:
|
|
63
|
+
fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: g(i) })
|
|
68
64
|
}
|
|
69
65
|
),
|
|
70
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700", children:
|
|
66
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700", children: d(i) })
|
|
71
67
|
]
|
|
72
68
|
},
|
|
73
69
|
i.id
|
|
@@ -76,5 +72,5 @@ function O({
|
|
|
76
72
|
] });
|
|
77
73
|
}
|
|
78
74
|
export {
|
|
79
|
-
|
|
75
|
+
U as OwnersSlot
|
|
80
76
|
};
|