@nivaro/react 0.3.48 → 0.3.49

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 (27) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/shared/components/CellCopyLayer.js +81 -44
  4. package/dist/shared/components/CollectionBrowserView.js +306 -297
  5. package/dist/shared/components/DataTable.js +3 -3
  6. package/dist/shared/components/FulfilmentPill.js +98 -78
  7. package/dist/shared/components/ItemEditForm.js +2830 -2815
  8. package/dist/shared/components/NotificationSourcesCard.js +151 -147
  9. package/dist/shared/components/ProfileView.js +72 -70
  10. package/dist/shared/components/QueryTable.js +3 -3
  11. package/dist/shared/components/imports/ImportConsole.js +4 -4
  12. package/dist/shared/components/integrations/console/IntegrationsConsole.js +58 -50
  13. package/dist/shared/components/item-edit/HeaderTools.js +118 -113
  14. package/dist/shared/components/item-edit/InlineTableField.js +874 -868
  15. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +65 -65
  16. package/dist/shared/components/layout-editor/settings/settings-registry.js +4 -4
  17. package/dist/shared/components/notifications/DeliveryChips.js +9 -9
  18. package/dist/shared/components/panels/PipelinePanel.js +73 -71
  19. package/dist/shared/components/panels/SlaBreachBanner.js +2 -2
  20. package/dist/shared/components/panels/TransitionRequirementsDialog.js +384 -380
  21. package/dist/shared/components/profile/PersonProfile.js +23 -21
  22. package/dist/shared/components/profile/SignedInDevices.js +126 -0
  23. package/dist/shared/components/queue/QueueItemSheet.js +38 -37
  24. package/dist/shared/components/support/SupportView.js +1 -1
  25. package/dist/shared/lib/edit-lock-fields.js +7 -0
  26. package/dist/shared/lib/reimport-visibility.js +10 -0
  27. package/package.json +1 -1
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
9
9
  import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
10
10
  import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
11
11
  import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
12
- const Ue = "nivaro-react@0.3.48", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
+ const Ue = "nivaro-react@0.3.49", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
13
13
  function Be(n) {
14
14
  return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
15
15
  const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
@@ -1,68 +1,105 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { Check as E, Copy as L } from "lucide-react";
3
- import { useState as p, useRef as R, useEffect as b } from "react";
4
- import { createPortal as N } from "react-dom";
5
- let f = 0;
6
- function j() {
7
- const [a, o] = p(null), [C, m] = p(!1), [c, k] = p(!1), i = R(null);
8
- return b(() => (f += 1, k(f === 1), () => {
9
- f -= 1;
10
- }), []), b(() => {
11
- if (!c) return;
12
- const r = (T) => {
13
- var y, v;
14
- const t = T.target;
15
- if ((y = t == null ? void 0 : t.closest) != null && y.call(t, "[data-cell-copy-btn]")) return;
16
- const n = (v = t == null ? void 0 : t.closest) == null ? void 0 : v.call(t, "td");
17
- if (!n || !n.closest("[data-copy-cells]") || n.hasAttribute("colspan")) {
18
- o((e) => e && null);
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { Check as k, Copy as N } from "lucide-react";
3
+ import { useState as m, useRef as R, useEffect as T } from "react";
4
+ import { createPortal as q } from "react-dom";
5
+ let v = 0;
6
+ const w = "nvr:copy-text";
7
+ function A(e, t) {
8
+ const r = (l) => l.detail.provide(t());
9
+ return e.addEventListener(w, r), () => e.removeEventListener(w, r);
10
+ }
11
+ function I(e, t) {
12
+ if (!(e != null && e.isConnected)) return Promise.resolve(t);
13
+ let r = null;
14
+ return e.dispatchEvent(
15
+ new CustomEvent(w, {
16
+ detail: { provide: (l) => r = l }
17
+ })
18
+ ), r ? r.catch(() => t) : Promise.resolve(t);
19
+ }
20
+ async function O(e) {
21
+ var t, r;
22
+ if (typeof ClipboardItem < "u" && ((t = navigator.clipboard) != null && t.write))
23
+ try {
24
+ await navigator.clipboard.write([
25
+ new ClipboardItem({
26
+ "text/plain": e.then((l) => new Blob([l], { type: "text/plain" }))
27
+ })
28
+ ]);
29
+ return;
30
+ } catch {
31
+ }
32
+ await ((r = navigator.clipboard) == null ? void 0 : r.writeText(await e));
33
+ }
34
+ function _() {
35
+ const [e, t] = m(null), [r, l] = m(!1), [d, L] = m(!1), u = R(null);
36
+ return T(() => (v += 1, L(v === 1), () => {
37
+ v -= 1;
38
+ }), []), T(() => {
39
+ if (!d) return;
40
+ const i = (P) => {
41
+ var C, E;
42
+ const o = P.target;
43
+ if ((C = o == null ? void 0 : o.closest) != null && C.call(o, "[data-cell-copy-btn]")) return;
44
+ const a = (E = o == null ? void 0 : o.closest) == null ? void 0 : E.call(o, "td");
45
+ if (!a || !a.closest("[data-copy-cells]") || a.hasAttribute("colspan")) {
46
+ t((n) => n && null);
19
47
  return;
20
48
  }
21
- if (n.querySelector('input[type="checkbox"]') || n.querySelector("[data-no-copy]")) {
22
- o((e) => e && null);
49
+ if (a.querySelector('input[type="checkbox"]') || a.querySelector("[data-no-copy]")) {
50
+ t((n) => n && null);
23
51
  return;
24
52
  }
25
- const u = n.innerText.trim();
26
- if (!u || u === "—") {
27
- o((e) => e && null);
53
+ const p = a.innerText.trim();
54
+ if (!p || p === "—") {
55
+ t((n) => n && null);
28
56
  return;
29
57
  }
30
- const l = n.getBoundingClientRect(), g = document.createRange();
31
- g.selectNodeContents(n);
32
- const h = g.getBoundingClientRect().right || l.right - 24, w = l.right - 24, x = h + 4 <= w ? w : h + 4;
33
- if (x + 20 > l.right + 2) {
34
- o((e) => e && null);
58
+ const s = a.getBoundingClientRect(), h = document.createRange();
59
+ h.selectNodeContents(a);
60
+ const b = h.getBoundingClientRect().right || s.right - 24, g = s.right - 24, x = b + 4 <= g ? g : b + 4;
61
+ if (x + 20 > s.right + 2) {
62
+ t((n) => n && null);
35
63
  return;
36
64
  }
37
- o({ x, y: l.top + (l.height - 20) / 2, text: u }), m(!1);
38
- }, s = () => o(null);
39
- return window.addEventListener("mouseover", r), window.addEventListener("scroll", s, !0), () => {
40
- window.removeEventListener("mouseover", r), window.removeEventListener("scroll", s, !0);
65
+ const c = a.querySelector("[data-copy-source]");
66
+ t({
67
+ x,
68
+ y: s.top + (s.height - 20) / 2,
69
+ text: p,
70
+ source: c,
71
+ label: (c == null ? void 0 : c.getAttribute("data-copy-label")) || null
72
+ }), l(!1);
73
+ }, y = () => t(null);
74
+ return window.addEventListener("mouseover", i), window.addEventListener("scroll", y, !0), () => {
75
+ window.removeEventListener("mouseover", i), window.removeEventListener("scroll", y, !0);
41
76
  };
42
- }, [c]), !c || !a ? null : N(
43
- /* @__PURE__ */ d(
77
+ }, [d]), !d || !e ? null : q(
78
+ /* @__PURE__ */ f(
44
79
  "button",
45
80
  {
46
81
  type: "button",
47
82
  "data-cell-copy-btn": !0,
48
- "aria-label": "Copy cell value",
49
- style: { position: "fixed", left: a.x, top: a.y, zIndex: 115 },
83
+ "aria-label": e.label ?? "Copy cell value",
84
+ "data-tip": e.label ?? void 0,
85
+ style: { position: "fixed", left: e.x, top: e.y, zIndex: 115 },
50
86
  className: "flex h-5 w-5 items-center justify-center rounded border border-slate-200 bg-white text-slate-400 shadow-sm hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:hover:text-slate-200",
51
- onMouseDown: (r) => {
52
- r.preventDefault(), r.stopPropagation();
87
+ onMouseDown: (i) => {
88
+ i.preventDefault(), i.stopPropagation();
53
89
  },
54
- onClick: (r) => {
55
- var s;
56
- r.preventDefault(), r.stopPropagation(), (s = navigator.clipboard) == null || s.writeText(a.text).then(() => {
57
- m(!0), i.current && clearTimeout(i.current), i.current = setTimeout(() => o(null), 900);
90
+ onClick: (i) => {
91
+ i.preventDefault(), i.stopPropagation(), O(I(e.source, e.text)).then(() => {
92
+ l(!0), u.current && clearTimeout(u.current), u.current = setTimeout(() => t(null), 900);
58
93
  });
59
94
  },
60
- children: C ? /* @__PURE__ */ d(E, { className: "h-3 w-3 text-emerald-500" }) : /* @__PURE__ */ d(L, { className: "h-3 w-3" })
95
+ children: r ? /* @__PURE__ */ f(k, { className: "h-3 w-3 text-emerald-500" }) : /* @__PURE__ */ f(N, { className: "h-3 w-3" })
61
96
  }
62
97
  ),
63
98
  document.body
64
99
  );
65
100
  }
66
101
  export {
67
- j as CellCopyLayer
102
+ w as COPY_TEXT_EVENT,
103
+ _ as CellCopyLayer,
104
+ A as provideCopyText
68
105
  };