@nivaro/react 0.3.9 → 0.3.10

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 (47) hide show
  1. package/dist/components/fields/FileField.js +20 -19
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useNivaroForm.js +129 -126
  4. package/dist/hooks/useSessionRecorder.js +1 -1
  5. package/dist/index.d.ts +69 -1
  6. package/dist/index.js +512 -501
  7. package/dist/shared/components/CollectionBrowserView.js +1000 -1001
  8. package/dist/shared/components/ConformanceView.js +36 -35
  9. package/dist/shared/components/ForceReloadBanner.js +58 -34
  10. package/dist/shared/components/ItemEditForm.js +3687 -3580
  11. package/dist/shared/components/JsonMapEditor.js +18 -17
  12. package/dist/shared/components/MatrixEditor.js +8 -7
  13. package/dist/shared/components/MyWorkView.js +32 -31
  14. package/dist/shared/components/PageRenderer.js +146 -145
  15. package/dist/shared/components/RecordGridEditor.js +76 -75
  16. package/dist/shared/components/ai/AiMemorySuggestions.js +15 -14
  17. package/dist/shared/components/ai/AskPanel.js +55 -54
  18. package/dist/shared/components/bulk/BulkActionButtons.js +30 -29
  19. package/dist/shared/components/bulk/PushBulkButtons.js +57 -56
  20. package/dist/shared/components/chat/SlashCommands.js +30 -29
  21. package/dist/shared/components/chat/chat-outbox.js +76 -75
  22. package/dist/shared/components/help-videos/recorder/useLeaveWarning.js +6 -5
  23. package/dist/shared/components/integrations/console/SignalCard.js +124 -123
  24. package/dist/shared/components/integrations/console/SnoozeMenu.js +24 -23
  25. package/dist/shared/components/item-edit/CloneDialog.js +85 -78
  26. package/dist/shared/components/item-edit/InlineTableField.js +301 -300
  27. package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
  28. package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
  29. package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
  30. package/dist/shared/components/item-edit/staged-links.js +86 -0
  31. package/dist/shared/components/layout-editor/LayoutEditor.js +275 -274
  32. package/dist/shared/components/layout-editor/editors/cascade-rule-row.js +18 -17
  33. package/dist/shared/components/layout-editor/inspector/HelpTab.js +37 -36
  34. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +50 -49
  35. package/dist/shared/components/profile/AiMemoryCard.js +15 -14
  36. package/dist/shared/components/profile/PersonAdminTools.js +70 -67
  37. package/dist/shared/components/queue/QueueItemSheet.js +36 -35
  38. package/dist/shared/components/queue/QueueWorklist.js +597 -598
  39. package/dist/shared/lib/client-version.js +63 -0
  40. package/dist/shared/lib/force-reload.js +36 -0
  41. package/dist/shared/lib/load-error.js +11 -10
  42. package/dist/shared/lib/presence-live.js +54 -35
  43. package/dist/shared/lib/record-outbox.js +76 -75
  44. package/dist/shared/lib/safe-error.js +39 -0
  45. package/dist/shared/lib/server-clock.js +11 -7
  46. package/dist/shared/lib/unsaved-work.js +62 -0
  47. package/package.json +1 -1
@@ -1,17 +1,18 @@
1
1
  import { jsxs as C, jsx as r } from "react/jsx-runtime";
2
- import { useState as o } from "react";
2
+ import { useState as a } from "react";
3
3
  import { useOptionalNivaroClient as F } from "../../shared/context.js";
4
- function w({
4
+ import { userErrorMessage as I } from "../../shared/lib/safe-error.js";
5
+ function N({
5
6
  field: s,
6
7
  value: l,
7
8
  onChange: g,
8
9
  error: d,
9
- disabled: h,
10
- readOnly: m,
10
+ disabled: m,
11
+ readOnly: h,
11
12
  inputId: y,
12
13
  errorId: b
13
14
  }) {
14
- const n = F(), [c, p] = o(!1), [i, u] = o(null), [U, j] = o(0), x = y ?? s.field, e = l != null && typeof l == "object" ? String(l.id ?? "") : l == null ? "" : String(l);
15
+ const e = F(), [p, c] = a(!1), [t, u] = a(null), [U, j] = a(0), x = y ?? s.field, n = l != null && typeof l == "object" ? String(l.id ?? "") : l == null ? "" : String(l);
15
16
  return /* @__PURE__ */ C("div", { children: [
16
17
  /* @__PURE__ */ r(
17
18
  "input",
@@ -19,32 +20,32 @@ function w({
19
20
  type: "file",
20
21
  id: x,
21
22
  name: s.field,
22
- disabled: h || m || c || !n,
23
- "aria-invalid": d != null && d.length > 0 || i != null,
23
+ disabled: m || h || p || !e,
24
+ "aria-invalid": d != null && d.length > 0 || t != null,
24
25
  "aria-describedby": b,
25
26
  onChange: async (E) => {
26
27
  var f;
27
- const a = (f = E.target.files) == null ? void 0 : f[0];
28
- if (!(!a || !n)) {
29
- p(!0), u(null);
28
+ const i = (f = E.target.files) == null ? void 0 : f[0];
29
+ if (!(!i || !e)) {
30
+ c(!0), u(null);
30
31
  try {
31
- const t = await n.upload(a, { title: a.name });
32
- g(t.id);
33
- } catch (t) {
34
- u(t instanceof Error ? t.message : "Upload failed"), j((S) => S + 1);
32
+ const o = await e.upload(i, { title: i.name });
33
+ g(o.id);
34
+ } catch (o) {
35
+ u(I(o, "Upload failed")), j((S) => S + 1);
35
36
  } finally {
36
- p(!1);
37
+ c(!1);
37
38
  }
38
39
  }
39
40
  }
40
41
  },
41
42
  U
42
43
  ),
43
- c ? /* @__PURE__ */ r("span", { "aria-live": "polite", children: "Uploading…" }) : null,
44
- e && n ? /* @__PURE__ */ r("a", { href: n.fileUrl(e), target: "_blank", rel: "noreferrer", children: e }) : e ? /* @__PURE__ */ r("span", { children: e }) : null,
45
- i ? /* @__PURE__ */ r("span", { role: "alert", children: i }) : null
44
+ p ? /* @__PURE__ */ r("span", { "aria-live": "polite", children: "Uploading…" }) : null,
45
+ n && e ? /* @__PURE__ */ r("a", { href: e.fileUrl(n), target: "_blank", rel: "noreferrer", children: n }) : n ? /* @__PURE__ */ r("span", { children: n }) : null,
46
+ t ? /* @__PURE__ */ r("span", { role: "alert", children: t }) : null
46
47
  ] });
47
48
  }
48
49
  export {
49
- w as FileField
50
+ N as FileField
50
51
  };