@nivaro/react 0.3.127 → 0.3.129

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 (50) hide show
  1. package/dist/components/slots/CommentsSlot.js +124 -95
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +29 -3
  5. package/dist/index.js +150 -147
  6. package/dist/shared/components/CollectionBrowserView.js +3259 -3211
  7. package/dist/shared/components/DataTable.js +406 -401
  8. package/dist/shared/components/ItemEditForm.js +4485 -4409
  9. package/dist/shared/components/MatrixEditor.js +548 -490
  10. package/dist/shared/components/MyWorkView.js +284 -274
  11. package/dist/shared/components/NotificationBell.js +264 -218
  12. package/dist/shared/components/RecordGridEditor.js +582 -472
  13. package/dist/shared/components/ai/AiMarkdown.js +215 -196
  14. package/dist/shared/components/chat/chat-core.js +331 -346
  15. package/dist/shared/components/chat/chat-typing.js +25 -0
  16. package/dist/shared/components/command-center/CommandCenterView.js +1 -1
  17. package/dist/shared/components/command-center/PeekPanel.js +8 -1
  18. package/dist/shared/components/command-center/api.js +17 -9
  19. package/dist/shared/components/command-center/panels/AttentionPanel.js +4 -1
  20. package/dist/shared/components/command-center/panels/PartnersPanel.js +2 -1
  21. package/dist/shared/components/item-edit/GroupSection.js +1 -1
  22. package/dist/shared/components/item-edit/HeaderTools.js +216 -210
  23. package/dist/shared/components/item-edit/InlineTableField.js +432 -429
  24. package/dist/shared/components/item-edit/RecordLiveSync.js +115 -108
  25. package/dist/shared/components/item-edit/RecordViewersChip.js +17 -16
  26. package/dist/shared/components/item-edit/RowComments.js +33 -30
  27. package/dist/shared/components/item-edit/cascade-clear-notice.js +30 -28
  28. package/dist/shared/components/item-edit/live-related.js +29 -16
  29. package/dist/shared/components/item-edit/record-opened-live.js +86 -0
  30. package/dist/shared/components/panels/CommentPanel.js +345 -327
  31. package/dist/shared/components/panels/OwnerOpenedLine.js +24 -23
  32. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  33. package/dist/shared/components/pipeline/TeamSuggestions.js +1 -1
  34. package/dist/shared/components/queue/QueueItemSheet.js +171 -130
  35. package/dist/shared/components/record-grid-guard.js +85 -0
  36. package/dist/shared/components/support/TicketDetailSheet.js +213 -174
  37. package/dist/shared/components/trackers/MirroredText.js +40 -0
  38. package/dist/shared/components/trackers/SourceTracker.js +168 -0
  39. package/dist/shared/components/trackers/TrackerChip.js +71 -0
  40. package/dist/shared/components/trackers/TrackerLinkPanel.js +1039 -0
  41. package/dist/shared/components/trackers/TrackerPickers.js +245 -0
  42. package/dist/shared/components/trackers/tracker-model.js +126 -0
  43. package/dist/shared/components/trackers/use-tracker-link.js +159 -0
  44. package/dist/shared/lib/at-risk-fields.js +14 -0
  45. package/dist/shared/lib/live-queries.js +9 -8
  46. package/dist/shared/lib/live-screen.js +77 -76
  47. package/dist/shared/lib/presence-hooks.js +190 -127
  48. package/dist/shared/lib/user-sync.js +78 -65
  49. package/dist/shared/lib/waiting-count.js +40 -29
  50. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { cn as a } from "../../lib/utils.js";
3
+ import { AiMarkdown as n } from "../ai/AiMarkdown.js";
4
+ import { GitlabBadge as i } from "./TrackerChip.js";
5
+ function m(r) {
6
+ var t;
7
+ return ((t = r.author) == null ? void 0 : t.trim()) || "Someone on GitLab";
8
+ }
9
+ function l({ from: r, className: t }) {
10
+ return /* @__PURE__ */ o(
11
+ "span",
12
+ {
13
+ className: a("inline-flex min-w-0 items-center gap-1.5", t),
14
+ "data-comment-gitlab-author": !0,
15
+ children: [
16
+ /* @__PURE__ */ e(i, {}),
17
+ /* @__PURE__ */ e("span", { className: "truncate", children: m(r) })
18
+ ]
19
+ }
20
+ );
21
+ }
22
+ function h({ text: r, className: t }) {
23
+ return /* @__PURE__ */ e(n, { content: r, mirrored: !0, autolink: !1, className: a("break-words", t) });
24
+ }
25
+ function f({ className: r }) {
26
+ return /* @__PURE__ */ e(
27
+ "p",
28
+ {
29
+ className: a("text-[11.5px] text-slate-600 dark:text-muted-foreground", r),
30
+ "data-gitlab-shared": !0,
31
+ children: "Comments here are shared with GitLab."
32
+ }
33
+ );
34
+ }
35
+ export {
36
+ f as GitlabSharedNotice,
37
+ l as MirroredAuthor,
38
+ h as MirroredBody,
39
+ m as mirroredAuthorName
40
+ };
@@ -0,0 +1,168 @@
1
+ import { jsxs as a, jsx as n, Fragment as h } from "react/jsx-runtime";
2
+ import { Gitlab as l, Link2 as x } from "lucide-react";
3
+ import { useMemo as m } from "react";
4
+ import { useHeaderAnchor as f } from "../item-edit/HeaderTools.js";
5
+ import { Popover as b, PopoverAnchor as g, PopoverContent as v } from "../ui/popover.js";
6
+ import { TrackerLinkPanel as k } from "./TrackerLinkPanel.js";
7
+ import { ticketLabelsFor as N } from "./tracker-model.js";
8
+ function p({
9
+ tracker: e,
10
+ source: i,
11
+ sourceTitle: r,
12
+ fixedLabels: t,
13
+ initialMode: o,
14
+ onClose: s
15
+ }) {
16
+ if (!e.canCreate) return null;
17
+ const c = e.isAdmin ? null : e.chips[0] ?? null;
18
+ return /* @__PURE__ */ n(
19
+ k,
20
+ {
21
+ source: i,
22
+ admin: e.isAdmin,
23
+ connections: e.connections,
24
+ link: e.link,
25
+ chip: c,
26
+ pending: e.failed,
27
+ creating: e.creating,
28
+ slow: e.slow,
29
+ onCheckAgain: e.checkAgain,
30
+ sourceTitle: r,
31
+ fixedLabels: t,
32
+ initialMode: o,
33
+ onClose: s,
34
+ onCreated: e.markCreating,
35
+ onChanged: e.refresh
36
+ }
37
+ );
38
+ }
39
+ function P({
40
+ tracker: e,
41
+ ticket: i
42
+ }) {
43
+ const r = m(
44
+ () => (t) => N(i, t),
45
+ [i]
46
+ );
47
+ return e.canCreate ? /* @__PURE__ */ a("section", { "data-ticket-gitlab": !0, children: [
48
+ /* @__PURE__ */ a("h3", { className: "mb-2 flex items-center gap-1.5 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: [
49
+ /* @__PURE__ */ n(l, { className: "h-3.5 w-3.5 text-orange-600 dark:text-orange-400", "aria-hidden": !0 }),
50
+ "GitLab"
51
+ ] }),
52
+ /* @__PURE__ */ n(
53
+ p,
54
+ {
55
+ tracker: e,
56
+ source: { kind: "ticket", id: String(i.id) },
57
+ sourceTitle: i.title,
58
+ fixedLabels: r
59
+ }
60
+ )
61
+ ] }) : null;
62
+ }
63
+ function R({
64
+ tracker: e,
65
+ recordId: i,
66
+ recordLabel: r,
67
+ mode: t,
68
+ anchor: o,
69
+ onOpenChange: s
70
+ }) {
71
+ const c = m(() => ({ current: o }), [o]);
72
+ if (!t || !e.canCreate) return null;
73
+ const u = t === "create" ? "Create GitLab issue" : t === "link" ? "Link GitLab issue" : "GitLab issue";
74
+ return /* @__PURE__ */ a(b, { open: !0, onOpenChange: s, children: [
75
+ /* @__PURE__ */ n(g, { virtualRef: c }),
76
+ /* @__PURE__ */ a(
77
+ v,
78
+ {
79
+ align: "end",
80
+ role: "dialog",
81
+ "aria-label": u,
82
+ className: "max-h-[min(80vh,640px)] w-[460px] max-w-[calc(100vw-24px)] overflow-y-auto overscroll-contain p-0",
83
+ "data-record-gitlab": t,
84
+ children: [
85
+ /* @__PURE__ */ a("div", { className: "px-4 pt-3.5", children: [
86
+ /* @__PURE__ */ a("p", { className: "flex items-center gap-1.5 text-[13.5px] font-semibold text-slate-900 dark:text-slate-100", children: [
87
+ /* @__PURE__ */ n(l, { className: "h-3.5 w-3.5 text-orange-600 dark:text-orange-400", "aria-hidden": !0 }),
88
+ u
89
+ ] }),
90
+ r && /* @__PURE__ */ n("p", { className: "mt-0.5 truncate text-[12px] text-slate-500 dark:text-muted-foreground", children: r })
91
+ ] }),
92
+ /* @__PURE__ */ n("div", { className: "px-4 pb-4 pt-3", children: /* @__PURE__ */ n(
93
+ p,
94
+ {
95
+ tracker: e,
96
+ source: { kind: "record", id: i },
97
+ sourceTitle: r,
98
+ initialMode: t,
99
+ onClose: () => s(!1)
100
+ }
101
+ ) })
102
+ ]
103
+ }
104
+ )
105
+ ] });
106
+ }
107
+ const d = "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground";
108
+ function M({
109
+ tracker: e,
110
+ onOpen: i
111
+ }) {
112
+ const r = f();
113
+ if (!e.canCreate) return null;
114
+ const t = (o) => (s) => i(o, r() ?? s.currentTarget);
115
+ return e.link ? /* @__PURE__ */ a(
116
+ "button",
117
+ {
118
+ type: "button",
119
+ "data-nvr-menu-close": !0,
120
+ "data-record-gitlab-open": !0,
121
+ "data-tip": "Resync, unlink or see what else is on it",
122
+ onClick: t("idle"),
123
+ className: d,
124
+ children: [
125
+ /* @__PURE__ */ n(l, { className: "h-3.5 w-3.5" }),
126
+ "GitLab issue #",
127
+ e.link.iid
128
+ ]
129
+ }
130
+ ) : e.chips.length > 0 || e.creating ? null : /* @__PURE__ */ a(h, { children: [
131
+ /* @__PURE__ */ a(
132
+ "button",
133
+ {
134
+ type: "button",
135
+ "data-nvr-menu-close": !0,
136
+ "data-record-gitlab-create": !0,
137
+ "data-tip": "Open a GitLab issue about this record",
138
+ onClick: t("create"),
139
+ className: d,
140
+ children: [
141
+ /* @__PURE__ */ n(l, { className: "h-3.5 w-3.5" }),
142
+ "Create GitLab issue"
143
+ ]
144
+ }
145
+ ),
146
+ /* @__PURE__ */ a(
147
+ "button",
148
+ {
149
+ type: "button",
150
+ "data-nvr-menu-close": !0,
151
+ "data-record-gitlab-link": !0,
152
+ "data-tip": "Link a GitLab issue that already exists",
153
+ onClick: t("link"),
154
+ className: d,
155
+ children: [
156
+ /* @__PURE__ */ n(x, { className: "h-3.5 w-3.5" }),
157
+ "Link GitLab issue"
158
+ ]
159
+ }
160
+ )
161
+ ] });
162
+ }
163
+ export {
164
+ M as RecordGitlabMenuEntries,
165
+ R as RecordTrackerPopover,
166
+ p as SourceTrackerPanel,
167
+ P as TicketTrackerSection
168
+ };
@@ -0,0 +1,71 @@
1
+ import { jsxs as o, Fragment as u, jsx as t } from "react/jsx-runtime";
2
+ import { Gitlab as p } from "lucide-react";
3
+ import { cn as d } from "../../lib/utils.js";
4
+ import { chipOf as h, chipTone as m, safeHref as f, stateWord as x, isLink as k } from "./tracker-model.js";
5
+ const w = {
6
+ open: "border-orange-500/30 bg-orange-50 text-orange-800 dark:border-orange-400/30 dark:bg-orange-500/10 dark:text-orange-300",
7
+ closed: "border-slate-300/70 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted/40 dark:text-muted-foreground",
8
+ error: "border-red-300 bg-red-50 text-red-700 dark:border-red-500/40 dark:bg-red-500/10 dark:text-red-300"
9
+ };
10
+ function N({
11
+ tracker: r,
12
+ className: n
13
+ }) {
14
+ if (!r) return null;
15
+ const e = h(r), a = m(r), s = f(e.web_url), l = a === "error" ? "sync error" : x(e.state), i = k(r) ? r.sync_error : null, c = /* @__PURE__ */ o(u, { children: [
16
+ /* @__PURE__ */ t(p, { className: "h-3 w-3 shrink-0", "aria-hidden": !0 }),
17
+ /* @__PURE__ */ o("span", { className: "tabular-nums", children: [
18
+ "#",
19
+ e.iid
20
+ ] }),
21
+ /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "opacity-60", children: "·" }),
22
+ /* @__PURE__ */ t("span", { children: l })
23
+ ] }), b = d(
24
+ "inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded border px-1.5 text-[10.5px] font-medium",
25
+ w[a],
26
+ n
27
+ ), g = i ? `Could not read it from GitLab: ${i}` : e.title ? `${e.title} — opens GitLab` : "Opens GitLab";
28
+ return s ? /* @__PURE__ */ t(
29
+ "a",
30
+ {
31
+ href: s,
32
+ target: "_blank",
33
+ rel: "noreferrer noopener",
34
+ className: d(
35
+ b,
36
+ "hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan"
37
+ ),
38
+ "data-tip": g,
39
+ "aria-label": `GitLab issue #${e.iid}, ${l}${e.title ? `: ${e.title}` : ""} (opens GitLab)`,
40
+ "data-gitlab-chip": e.iid,
41
+ "data-gitlab-chip-state": a,
42
+ children: c
43
+ }
44
+ ) : /* @__PURE__ */ t(
45
+ "span",
46
+ {
47
+ className: b,
48
+ "data-tip": i ?? (e.title || void 0),
49
+ "data-gitlab-chip": e.iid,
50
+ "data-gitlab-chip-state": a,
51
+ children: c
52
+ }
53
+ );
54
+ }
55
+ function y({
56
+ tracker: r,
57
+ className: n
58
+ }) {
59
+ return r.shown.length ? /* @__PURE__ */ t("span", { className: d("inline-flex flex-wrap items-center gap-1", n), children: r.shown.map((e) => /* @__PURE__ */ t(N, { tracker: e }, `${e.web_url}:${e.iid}`)) }) : null;
60
+ }
61
+ function T() {
62
+ return /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1 rounded border border-orange-500/30 bg-orange-50 px-1 text-[10px] font-medium text-orange-800 dark:border-orange-400/30 dark:bg-orange-500/10 dark:text-orange-300", children: [
63
+ /* @__PURE__ */ t(p, { className: "h-2.5 w-2.5", "aria-hidden": !0 }),
64
+ "GitLab"
65
+ ] });
66
+ }
67
+ export {
68
+ T as GitlabBadge,
69
+ N as TrackerChip,
70
+ y as TrackerChips
71
+ };