@nivaro/react 0.3.33 → 0.3.35

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 (32) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +79 -5
  4. package/dist/index.js +338 -329
  5. package/dist/shared/components/ItemEditForm.js +5274 -5069
  6. package/dist/shared/components/ProfileView.js +46 -44
  7. package/dist/shared/components/ReportView.js +208 -205
  8. package/dist/shared/components/SearchHighlight.js +30 -0
  9. package/dist/shared/components/TipLayer.js +39 -37
  10. package/dist/shared/components/item-edit/CatalogPickerField.js +1484 -1232
  11. package/dist/shared/components/item-edit/FieldAffordances.js +424 -213
  12. package/dist/shared/components/item-edit/FieldRow.js +475 -427
  13. package/dist/shared/components/item-edit/PersonalDefaultControl.js +211 -0
  14. package/dist/shared/components/item-edit/PersonalDefaultPill.js +20 -0
  15. package/dist/shared/components/item-edit/RecordLiveSync.js +115 -110
  16. package/dist/shared/components/item-edit/RelationCombobox.js +42 -41
  17. package/dist/shared/components/item-edit/catalog-search.js +34 -0
  18. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +43 -43
  19. package/dist/shared/components/item-edit/live-record-marks.js +13 -0
  20. package/dist/shared/components/item-edit/personal-default-checks.js +134 -0
  21. package/dist/shared/components/item-edit/usePersonalDefaults.js +442 -0
  22. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +130 -111
  23. package/dist/shared/components/layout-editor/inspector/RulesTab.js +76 -75
  24. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  25. package/dist/shared/components/profile/MyDefaultsCard.js +667 -0
  26. package/dist/shared/components/profile/PersonProfile.js +42 -40
  27. package/dist/shared/components/profile/my-defaults-labels.js +76 -0
  28. package/dist/shared/components/profile/primitives.js +72 -67
  29. package/dist/shared/lib/personal-defaults.js +76 -0
  30. package/dist/shared/lib/request-gate.js +78 -76
  31. package/dist/shared/lib/search-text.js +111 -0
  32. package/package.json +1 -1
@@ -18,11 +18,12 @@ import { MailSuppressedPill as Ze } from "./profile/MailSuppressedPill.js";
18
18
  import { TeamLoadCard as Xe } from "./profile/PersonExtras.js";
19
19
  import { TeamsConnect as et } from "./profile/TeamsConnect.js";
20
20
  import { NotificationSourcesCard as tt } from "./NotificationSourcesCard.js";
21
- import { UserScopesCard as at } from "./profile/PersonAccess.js";
22
- import { PersonProfile as rt } from "./profile/PersonProfile.js";
23
- import { Toggle as nt, SectionCard as ie, Field as Y, ConfirmButton as fe } from "./profile/primitives.js";
21
+ import { MyDefaultsCard as at } from "./profile/MyDefaultsCard.js";
22
+ import { UserScopesCard as rt } from "./profile/PersonAccess.js";
23
+ import { PersonProfile as nt } from "./profile/PersonProfile.js";
24
+ import { Toggle as st, SectionCard as ie, Field as Y, ConfirmButton as fe } from "./profile/primitives.js";
24
25
  import { SimpleSelectXs as E } from "./ui/SimpleSelect.js";
25
- const st = (i) => [i.first_name, i.last_name].filter(Boolean).join(" ") || (i.email ?? "Unknown"), lt = (i) => {
26
+ const lt = (i) => [i.first_name, i.last_name].filter(Boolean).join(" ") || (i.email ?? "Unknown"), ot = (i) => {
26
27
  var m, r;
27
28
  return (`${((m = i.first_name) == null ? void 0 : m[0]) ?? ""}${((r = i.last_name) == null ? void 0 : r[0]) ?? ""}` || (i.email ?? "?").slice(0, 2)).toUpperCase();
28
29
  }, te = [
@@ -87,7 +88,7 @@ const st = (i) => [i.first_name, i.last_name].filter(Boolean).join(" ") || (i.em
87
88
  help: "Any notification that does not fit a category above — direct messages from other users, access requests, task assignments."
88
89
  }
89
90
  ];
90
- function ot() {
91
+ function it() {
91
92
  const i = L(), m = K(), { data: r = [] } = w({
92
93
  queryKey: ["nvr-profile-fields"],
93
94
  queryFn: () => i.request(D("/profile-fields/mine")).then((n) => n.data ?? []).catch(() => [])
@@ -164,7 +165,7 @@ function ot() {
164
165
  ] })
165
166
  ] });
166
167
  }
167
- function it() {
168
+ function dt() {
168
169
  var me, pe;
169
170
  const i = L(), m = K(), { data: r } = w({
170
171
  queryKey: ["nvr-profile-prefs"],
@@ -432,7 +433,7 @@ function it() {
432
433
  ] }),
433
434
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-600 dark:text-muted-foreground", children: [
434
435
  /* @__PURE__ */ e(
435
- nt,
436
+ st,
436
437
  {
437
438
  on: (r == null ? void 0 : r.huddle_hold_notifications) !== !1,
438
439
  onChange: () => A.mutate({
@@ -676,7 +677,7 @@ function it() {
676
677
  }
677
678
  );
678
679
  }
679
- function dt() {
680
+ function ct() {
680
681
  const i = L(), m = K(), { data: r } = w({
681
682
  queryKey: ["nvr-profile-prefs"],
682
683
  queryFn: () => i.request(D("/users/me")).then((s) => {
@@ -714,7 +715,7 @@ function dt() {
714
715
  }
715
716
  );
716
717
  }
717
- function ct() {
718
+ function ut() {
718
719
  const i = L(), m = K(), [r, d] = q(""), o = (() => {
719
720
  try {
720
721
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -793,7 +794,7 @@ function ct() {
793
794
  }
794
795
  );
795
796
  }
796
- function ut() {
797
+ function mt() {
797
798
  const i = L(), m = K(), { data: r } = w({
798
799
  queryKey: ["nvr-profile-scopes"],
799
800
  queryFn: () => i.request(qe()).then((o) => o.data)
@@ -809,7 +810,7 @@ function ut() {
809
810
  title: "Default filters",
810
811
  hint: "Pre-selected in browsers and reports — clear anytime",
811
812
  children: /* @__PURE__ */ e("div", { className: "space-y-3", children: r.dimensions.map((o) => /* @__PURE__ */ e(
812
- mt,
813
+ pt,
813
814
  {
814
815
  dimension: o,
815
816
  selected: r.defaults[o.name] ?? [],
@@ -821,7 +822,7 @@ function ut() {
821
822
  }
822
823
  );
823
824
  }
824
- function mt({
825
+ function pt({
825
826
  dimension: i,
826
827
  selected: m,
827
828
  restricted: r,
@@ -979,7 +980,7 @@ function mt({
979
980
  ] })
980
981
  ] });
981
982
  }
982
- function pt() {
983
+ function ht() {
983
984
  const { data: i } = w({
984
985
  queryKey: ["nvr-settings-2fa"],
985
986
  queryFn: () => r.request({ _method: "GET", _path: "/settings/" }).then((f) => (f == null ? void 0 : f.data) ?? null).catch(() => null),
@@ -1161,7 +1162,7 @@ function pt() {
1161
1162
  }
1162
1163
  );
1163
1164
  }
1164
- function Yt({
1165
+ function Gt({
1165
1166
  userId: i,
1166
1167
  className: m,
1167
1168
  initialTab: r,
@@ -1169,9 +1170,9 @@ function Yt({
1169
1170
  pushServiceWorker: o = "/sw.js"
1170
1171
  }) {
1171
1172
  const l = ve();
1172
- return !i || (l == null ? void 0 : l.userId) != null && String(l.userId) === String(i) ? /* @__PURE__ */ e(ht, { className: m, extra: d, pushServiceWorker: o }) : /* @__PURE__ */ e(rt, { userId: i, className: m, initialTab: r });
1173
+ return !i || (l == null ? void 0 : l.userId) != null && String(l.userId) === String(i) ? /* @__PURE__ */ e(bt, { className: m, extra: d, pushServiceWorker: o }) : /* @__PURE__ */ e(nt, { userId: i, className: m, initialTab: r });
1173
1174
  }
1174
- function ht({
1175
+ function bt({
1175
1176
  className: i,
1176
1177
  extra: m,
1177
1178
  pushServiceWorker: r
@@ -1199,7 +1200,7 @@ function ht({
1199
1200
  onSuccess: () => {
1200
1201
  N(null), o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
1201
1202
  }
1202
- }), [S, f] = q(bt), z = je(null), P = _({
1203
+ }), [S, f] = q(xt), z = je(null), P = _({
1203
1204
  mutationFn: async (c) => {
1204
1205
  const k = await new Promise((F, J) => {
1205
1206
  const M = new Image(), W = URL.createObjectURL(c);
@@ -1247,7 +1248,7 @@ function ht({
1247
1248
  alt: "",
1248
1249
  className: "h-[76px] w-[76px] rounded-full border border-slate-200 object-cover dark:border-border"
1249
1250
  }
1250
- ) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: lt(y) }),
1251
+ ) : /* @__PURE__ */ e("span", { className: "flex h-[76px] w-[76px] items-center justify-center rounded-full bg-[#c7f0fb] text-[24px] font-semibold text-[#04516b] dark:bg-nvr-cyan/15 dark:text-nvr-cyan", children: ot(y) }),
1251
1252
  /* @__PURE__ */ e(
1252
1253
  "span",
1253
1254
  {
@@ -1291,7 +1292,7 @@ function ht({
1291
1292
  ] }),
1292
1293
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
1293
1294
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
1294
- /* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: st(y) }),
1295
+ /* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: lt(y) }),
1295
1296
  y.role_name && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: y.role_name }),
1296
1297
  y.is_out_of_office && /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-50 px-2 py-px text-[10.5px] font-semibold text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: "Out of office" }),
1297
1298
  /* @__PURE__ */ e(Ze, { email: y.email, canClear: l.isAdmin })
@@ -1349,7 +1350,7 @@ function ht({
1349
1350
  ] })
1350
1351
  ] })
1351
1352
  ] }) }),
1352
- /* @__PURE__ */ e(xt, { tab: S, onChange: f }),
1353
+ /* @__PURE__ */ e(gt, { tab: S, onChange: f }),
1353
1354
  S === "agents" ? /* @__PURE__ */ e(Ye, {}) : n ? (
1354
1355
  // One list in reading order — you, then notifications, then access
1355
1356
  // and security — flowing into two balanced columns. Two fixed stacks
@@ -1453,23 +1454,24 @@ function ht({
1453
1454
  }
1454
1455
  }
1455
1456
  ),
1456
- /* @__PURE__ */ e(ot, {}),
1457
+ /* @__PURE__ */ e(it, {}),
1458
+ /* @__PURE__ */ e(ut, {}),
1459
+ /* @__PURE__ */ e(wt, {}),
1460
+ /* @__PURE__ */ e(at, {}),
1457
1461
  /* @__PURE__ */ e(ct, {}),
1458
- /* @__PURE__ */ e(Nt, {}),
1459
- /* @__PURE__ */ e(dt, {}),
1460
1462
  /* @__PURE__ */ e(We, {}),
1461
1463
  /* @__PURE__ */ e(Ge, {}),
1462
- l.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(at, { userId: String(n.id) }) : /* @__PURE__ */ e(ut, {}),
1463
- /* @__PURE__ */ e(yt, {}),
1464
- /* @__PURE__ */ e(Xe, { userId: "me" }),
1464
+ l.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(rt, { userId: String(n.id) }) : /* @__PURE__ */ e(mt, {}),
1465
1465
  /* @__PURE__ */ e(ft, {}),
1466
- /* @__PURE__ */ e(it, {}),
1466
+ /* @__PURE__ */ e(Xe, { userId: "me" }),
1467
+ /* @__PURE__ */ e(vt, {}),
1468
+ /* @__PURE__ */ e(dt, {}),
1467
1469
  /* @__PURE__ */ e(tt, {}),
1468
1470
  r !== !1 && /* @__PURE__ */ e(Je, { serviceWorkerPath: r }),
1469
- /* @__PURE__ */ e(vt, {}),
1470
- /* @__PURE__ */ e(pt, {}),
1471
1471
  /* @__PURE__ */ e(kt, {}),
1472
- /* @__PURE__ */ e(gt, {}),
1472
+ /* @__PURE__ */ e(ht, {}),
1473
+ /* @__PURE__ */ e(Nt, {}),
1474
+ /* @__PURE__ */ e(yt, {}),
1473
1475
  m
1474
1476
  ]
1475
1477
  }
@@ -1477,14 +1479,14 @@ function ht({
1477
1479
  ) : null
1478
1480
  ] });
1479
1481
  }
1480
- function bt() {
1482
+ function xt() {
1481
1483
  try {
1482
1484
  return new URLSearchParams(window.location.search).get("tab") === "agents" ? "agents" : "profile";
1483
1485
  } catch {
1484
1486
  return "profile";
1485
1487
  }
1486
1488
  }
1487
- function xt({
1489
+ function gt({
1488
1490
  tab: i,
1489
1491
  onChange: m
1490
1492
  }) {
@@ -1523,7 +1525,7 @@ function xt({
1523
1525
  }
1524
1526
  );
1525
1527
  }
1526
- function gt() {
1528
+ function yt() {
1527
1529
  const i = L(), [m, r] = q(!1), { data: d = [], isLoading: o } = w({
1528
1530
  queryKey: ["my-matrix-seats"],
1529
1531
  queryFn: () => i.request(D("/pipelines/my-seats")).then((s) => s.data ?? []).catch(() => []),
@@ -1587,7 +1589,7 @@ function gt() {
1587
1589
  ] }, s)) }))
1588
1590
  ] });
1589
1591
  }
1590
- function yt() {
1592
+ function ft() {
1591
1593
  const i = L(), m = K(), { data: r = [] } = w({
1592
1594
  queryKey: ["my-reminders"],
1593
1595
  queryFn: () => i.request(D("/reminders")).then((h) => h.data).catch(() => []),
@@ -1664,7 +1666,7 @@ function yt() {
1664
1666
  ] })
1665
1667
  ] });
1666
1668
  }
1667
- function ft() {
1669
+ function vt() {
1668
1670
  const i = L(), { data: m } = w({
1669
1671
  queryKey: ["my-stats"],
1670
1672
  queryFn: () => i.request(D("/users/me/stats")).then((d) => d.data).catch(() => null),
@@ -1720,7 +1722,7 @@ function ft() {
1720
1722
  ] })
1721
1723
  ] });
1722
1724
  }
1723
- function vt() {
1725
+ function kt() {
1724
1726
  const i = L(), m = K(), { data: r } = w({
1725
1727
  queryKey: ["my-security"],
1726
1728
  queryFn: () => i.request(D("/security/my/sessions")).then((l) => l.data).catch(() => ({ sessions: [], logins: [] })),
@@ -1798,7 +1800,7 @@ function vt() {
1798
1800
  ] })
1799
1801
  ] });
1800
1802
  }
1801
- function kt() {
1803
+ function Nt() {
1802
1804
  const i = L(), [m, r] = q(!1), { data: d } = w({
1803
1805
  queryKey: ["my-permissions"],
1804
1806
  queryFn: () => i.request(D("/security/my/permissions")).then((o) => o.data),
@@ -1854,7 +1856,7 @@ function kt() {
1854
1856
  ] })
1855
1857
  ] });
1856
1858
  }
1857
- function Nt() {
1859
+ function wt() {
1858
1860
  const i = L(), m = K(), { data: r } = w({
1859
1861
  queryKey: ["nvr-profile-prefs"],
1860
1862
  queryFn: () => i.request(D("/users/me")).then((u) => {
@@ -1989,10 +1991,10 @@ function Nt() {
1989
1991
  }
1990
1992
  export {
1991
1993
  Ve as DelegationCard,
1992
- Nt as DisplayPrefsCard,
1993
- dt as LinkAppCard,
1994
- it as NotificationRulesCard,
1995
- ot as ProfileFieldsCard,
1996
- Yt as ProfileView,
1997
- ct as TimezoneCard
1994
+ wt as DisplayPrefsCard,
1995
+ ct as LinkAppCard,
1996
+ dt as NotificationRulesCard,
1997
+ it as ProfileFieldsCard,
1998
+ Gt as ProfileView,
1999
+ ut as TimezoneCard
1998
2000
  };