@declarion/react 0.87.0 → 0.89.0

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 (90) hide show
  1. package/dist-lib/app.js +28 -28
  2. package/dist-lib/components/actions/ActionButton.js +86 -85
  3. package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
  4. package/dist-lib/components/actions/ActionRunner.js +47 -47
  5. package/dist-lib/components/actions/ObjectActionBar.js +9 -9
  6. package/dist-lib/components/actions/RowActionsKebab.js +19 -19
  7. package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
  8. package/dist-lib/components/chrome/AssociationTabs.js +21 -21
  9. package/dist-lib/components/chrome/RecordHeader.js +33 -40
  10. package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
  11. package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
  12. package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
  13. package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
  14. package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
  15. package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
  16. package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
  17. package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
  18. package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
  19. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
  20. package/dist-lib/components/fields/FileReferenceField.js +9 -9
  21. package/dist-lib/components/fields/StructureField.js +57 -47
  22. package/dist-lib/components/fields/TimestampField.js +59 -54
  23. package/dist-lib/components/fields/cells/factories/money.js +14 -23
  24. package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
  25. package/dist-lib/components/fields/cells/factories/text.js +18 -3
  26. package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
  27. package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
  28. package/dist-lib/components/layout/Layout.js +306 -361
  29. package/dist-lib/components/layout/Rail.js +42 -41
  30. package/dist-lib/components/layout/Sidebar.js +132 -117
  31. package/dist-lib/components/layout/TabStrip.js +116 -115
  32. package/dist-lib/components/layout/TenantChip.js +47 -54
  33. package/dist-lib/components/layout/TopBar.js +108 -105
  34. package/dist-lib/components/list/InlineEditCell.js +23 -23
  35. package/dist-lib/components/list/QuickPeek.js +65 -66
  36. package/dist-lib/components/pages/DocumentsMenu.js +42 -42
  37. package/dist-lib/components/pages/ExportMenu.js +25 -25
  38. package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
  39. package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
  40. package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
  41. package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
  42. package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
  43. package/dist-lib/components/pages/auth/AuthShell.js +73 -73
  44. package/dist-lib/components/pages/auth/SignIn.js +32 -32
  45. package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
  46. package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
  47. package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
  48. package/dist-lib/components/pages/list/ListHeader.js +19 -19
  49. package/dist-lib/components/pages/list/ListNoRows.js +15 -15
  50. package/dist-lib/components/pages/list/ListToolbar.js +145 -145
  51. package/dist-lib/components/pages/list/useActiveView.js +14 -5
  52. package/dist-lib/components/pages/list/useListQuery.js +121 -81
  53. package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
  54. package/dist-lib/components/pages/list/useRowMenu.js +7 -7
  55. package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
  56. package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
  57. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
  58. package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
  59. package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
  60. package/dist-lib/hooks/useAuth.js +11 -11
  61. package/dist-lib/hooks/useBranding.js +4 -4
  62. package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
  63. package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
  64. package/dist-lib/hooks/useImpersonation.js +6 -6
  65. package/dist-lib/hooks/useMutations.js +23 -23
  66. package/dist-lib/hooks/useObjectStatus.js +5 -5
  67. package/dist-lib/hooks/useParams.js +59 -51
  68. package/dist-lib/hooks/useProperties.js +8 -8
  69. package/dist-lib/hooks/useRowTenant.js +18 -6
  70. package/dist-lib/hooks/useText.js +9 -7
  71. package/dist-lib/hooks/useUiPreferences.js +71 -0
  72. package/dist-lib/index.d.ts +22 -6
  73. package/dist-lib/index.js +127 -126
  74. package/dist-lib/lib/actions.js +116 -84
  75. package/dist-lib/lib/child-config.js +10 -1
  76. package/dist-lib/lib/format-count.js +16 -1
  77. package/dist-lib/lib/language.js +23 -21
  78. package/dist-lib/lib/money-text.js +29 -0
  79. package/dist-lib/lib/profile.js +4 -0
  80. package/dist-lib/lib/role-label.js +8 -0
  81. package/dist-lib/lib/schema-routing.js +34 -14
  82. package/dist-lib/lib/shortcut.js +10 -0
  83. package/dist-lib/lib/timestamp.js +93 -31
  84. package/dist-lib/stores/auth.js +9 -8
  85. package/dist-lib/stores/preferences.js +56 -17
  86. package/dist-lib/testing.d.ts +1 -1
  87. package/dist-lib/testing.js +25 -28
  88. package/dist-lib/types/schema.js +33 -27
  89. package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
  90. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  import { useSchema as e } from "../../hooks/useSchema.js";
2
- import { Icon as t } from "../primitives/Icons.js";
3
- import { Btn as n } from "../primitives/Btn.js";
4
- import { useText as r } from "../../hooks/useText.js";
5
- import { SectionCard as i } from "../primitives/SectionCard.js";
6
- import { executeAction as a } from "../../api/data.js";
7
- import { downloadFile as o, isMissingArtifactError as s } from "../../lib/download.js";
8
- import { failureTitle as c } from "../../lib/failure.js";
2
+ import { executeAction as t } from "../../api/data.js";
3
+ import { downloadFile as n, isMissingArtifactError as r } from "../../lib/download.js";
4
+ import { failureTitle as i } from "../../lib/failure.js";
5
+ import { Icon as a } from "../primitives/Icons.js";
6
+ import { Btn as o } from "../primitives/Btn.js";
7
+ import { useText as s } from "../../hooks/useText.js";
8
+ import { SectionCard as c } from "../primitives/SectionCard.js";
9
9
  import { RECORD_DOCUMENTS_KEY as l } from "../../lib/record-documents-key.js";
10
10
  import { useState as u } from "react";
11
11
  import { useQuery as d, useQueryClient as f } from "@tanstack/react-query";
@@ -15,35 +15,35 @@ var h = 4e3, g = "pdf";
15
15
  function _(e) {
16
16
  return e?.some((e) => e.status === "pending") ? h : !1;
17
17
  }
18
- function v({ entityCode: e, objectId: n, canGenerateOne: o, canManageTemplates: s }) {
19
- let u = r(), f = r("errors"), { data: h, isLoading: g, error: v } = d({
18
+ function v({ entityCode: e, objectId: n, canGenerateOne: r, canManageTemplates: o }) {
19
+ let u = s(), f = s("errors"), { data: h, isLoading: g, error: v } = d({
20
20
  queryKey: [
21
21
  l,
22
22
  e,
23
23
  n
24
24
  ],
25
- queryFn: async () => (await a("document.object_links", {
25
+ queryFn: async () => (await t("document.object_links", {
26
26
  entity: e,
27
27
  object_id: n
28
28
  })).result?.documents ?? [],
29
- enabled: !!(e && n) && (!!o || !!s),
29
+ enabled: !!(e && n) && (!!r || !!o),
30
30
  refetchInterval: (e) => _(e.state.data)
31
31
  }), S = (h?.length ?? 0) > 0;
32
- return !o && !S ? null : /* @__PURE__ */ m(i, {
32
+ return !r && !S ? null : /* @__PURE__ */ m(c, {
33
33
  title: /* @__PURE__ */ p(y, {}),
34
34
  collapsible: !1,
35
35
  padding: "0",
36
36
  children: [
37
37
  g && /* @__PURE__ */ p(x, {
38
- icon: /* @__PURE__ */ p(t.loader, { size: 14 }),
38
+ icon: /* @__PURE__ */ p(a.loader, { size: 14 }),
39
39
  text: u("document.panel.loading", "Loading documents...")
40
40
  }),
41
41
  v && /* @__PURE__ */ p(x, {
42
- icon: /* @__PURE__ */ p(t.warning, { size: 14 }),
43
- text: c(f, v)
42
+ icon: /* @__PURE__ */ p(a.warning, { size: 14 }),
43
+ text: i(f, v)
44
44
  }),
45
45
  !g && !v && (h?.length ?? 0) === 0 && /* @__PURE__ */ p(x, {
46
- icon: /* @__PURE__ */ p(t.file, { size: 14 }),
46
+ icon: /* @__PURE__ */ p(a.file, { size: 14 }),
47
47
  text: u("document.panel.empty", "No generated documents")
48
48
  }),
49
49
  !g && !v && h && h.length > 0 && /* @__PURE__ */ p("div", {
@@ -61,7 +61,7 @@ function v({ entityCode: e, objectId: n, canGenerateOne: o, canManageTemplates:
61
61
  });
62
62
  }
63
63
  function y() {
64
- let e = r();
64
+ let e = s();
65
65
  return /* @__PURE__ */ m("div", {
66
66
  style: {
67
67
  display: "flex",
@@ -73,21 +73,21 @@ function y() {
73
73
  fontWeight: 600,
74
74
  color: "var(--text)"
75
75
  },
76
- children: [/* @__PURE__ */ p(t.file, { size: 13 }), e("document.panel.title", "Documents")]
76
+ children: [/* @__PURE__ */ p(a.file, { size: 13 }), e("document.panel.title", "Documents")]
77
77
  });
78
78
  }
79
- function b({ entityCode: i, objectId: d, doc: h }) {
80
- let _ = r(), { data: v } = e(), y = _(v?.entities?.generated_document?.fields.get("status")?.values?.find((e) => e.code === h.status)?.name) || h.status, b = r("errors"), x = f(), [S, C] = u(!1), [w, T] = u(!1), [E, D] = u(!1), [O, k] = u(!1), [A, j] = u(null), M = _(h.title) || h.filename || h.template_code, N = h.status === "ready" && h.download_url && !O;
79
+ function b({ entityCode: c, objectId: d, doc: h }) {
80
+ let _ = s(), { data: v } = e(), y = _(v?.entities?.generated_document?.fields.get("status")?.values?.find((e) => e.code === h.status)?.name) || h.status, b = s("errors"), x = f(), [S, C] = u(!1), [w, T] = u(!1), [E, D] = u(!1), [O, k] = u(!1), [A, j] = u(null), M = _(h.title) || h.filename || h.template_code, N = h.status === "ready" && h.download_url && !O;
81
81
  async function P() {
82
82
  C(!0), j(null);
83
83
  try {
84
- let e = (await a("document.download_format", {
84
+ let e = (await t("document.download_format", {
85
85
  generated_document_id: h.generated_document_id,
86
86
  format: g
87
87
  })).result;
88
- e?.download_url && await o(b, e.download_url, e.filename);
88
+ e?.download_url && await n(b, e.download_url, e.filename);
89
89
  } catch (e) {
90
- s(e) ? (k(!0), j(b("document.artifact_unavailable", "This generated file is not available."))) : j(c(b, e));
90
+ r(e) ? (k(!0), j(b("document.artifact_unavailable", "This generated file is not available."))) : j(i(b, e));
91
91
  } finally {
92
92
  C(!1);
93
93
  }
@@ -96,9 +96,9 @@ function b({ entityCode: i, objectId: d, doc: h }) {
96
96
  if (h.download_url) {
97
97
  T(!0), j(null);
98
98
  try {
99
- await o(b, h.download_url, h.filename);
99
+ await n(b, h.download_url, h.filename);
100
100
  } catch (e) {
101
- s(e) ? (k(!0), j(b("document.artifact_unavailable", "This generated file is not available."))) : j(c(b, e));
101
+ r(e) ? (k(!0), j(b("document.artifact_unavailable", "This generated file is not available."))) : j(i(b, e));
102
102
  } finally {
103
103
  T(!1);
104
104
  }
@@ -107,18 +107,18 @@ function b({ entityCode: i, objectId: d, doc: h }) {
107
107
  async function I() {
108
108
  D(!0), j(null);
109
109
  try {
110
- await a("document.generate", {
110
+ await t("document.generate", {
111
111
  ...h.input ?? {},
112
112
  template_code: h.template_code,
113
113
  template_source: h.template_source,
114
114
  output_format: h.output_format
115
115
  }), await x.invalidateQueries({ queryKey: [
116
116
  l,
117
- i,
117
+ c,
118
118
  d
119
119
  ] });
120
120
  } catch (e) {
121
- j(c(b, e));
121
+ j(i(b, e));
122
122
  } finally {
123
123
  D(!1);
124
124
  }
@@ -183,29 +183,29 @@ function b({ entityCode: i, objectId: d, doc: h }) {
183
183
  display: "flex",
184
184
  gap: 6
185
185
  },
186
- children: [/* @__PURE__ */ p(n, {
186
+ children: [/* @__PURE__ */ p(o, {
187
187
  kind: "ghost",
188
188
  size: "sm",
189
- icon: p(S ? t.loader : t.file, { size: 12 }),
189
+ icon: p(S ? a.loader : a.file, { size: 12 }),
190
190
  onClick: P,
191
191
  disabled: S,
192
192
  children: g.toUpperCase()
193
- }), /* @__PURE__ */ p(n, {
193
+ }), /* @__PURE__ */ p(o, {
194
194
  kind: "default",
195
195
  size: "sm",
196
- icon: p(w ? t.loader : t.download, { size: 12 }),
196
+ icon: p(w ? a.loader : a.download, { size: 12 }),
197
197
  onClick: F,
198
198
  disabled: w,
199
199
  children: _("document.result.download", "Download")
200
200
  })]
201
- }) : O ? /* @__PURE__ */ p(n, {
201
+ }) : O ? /* @__PURE__ */ p(o, {
202
202
  kind: "ghost",
203
203
  size: "sm",
204
- icon: p(E ? t.loader : t.file, { size: 12 }),
204
+ icon: p(E ? a.loader : a.file, { size: 12 }),
205
205
  onClick: I,
206
206
  disabled: E,
207
207
  children: _("document.row.regenerate", "Regenerate")
208
- }) : /* @__PURE__ */ p(n, {
208
+ }) : /* @__PURE__ */ p(o, {
209
209
  kind: "ghost",
210
210
  size: "sm",
211
211
  disabled: !0,
@@ -1,88 +1,89 @@
1
- import { resolveRefRecordLabel as e } from "../../types/schema.js";
2
- import { useSchema as t } from "../../hooks/useSchema.js";
3
- import { Icon as n } from "../primitives/Icons.js";
4
- import { Btn as r } from "../primitives/Btn.js";
5
- import { useText as i } from "../../hooks/useText.js";
6
- import { SectionCard as a } from "../primitives/SectionCard.js";
7
- import { FieldLabel as o, TextArea as s } from "../primitives/Fields.js";
8
- import { executeAction as c } from "../../api/data.js";
9
- import { failureTitle as l } from "../../lib/failure.js";
10
- import { PanelState as u } from "./RecordDocumentsPanel.js";
11
- import { useId as d, useState as f } from "react";
12
- import { useQuery as p, useQueryClient as m } from "@tanstack/react-query";
13
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
1
+ import { formatOffsetTimestamp as e } from "../../lib/timestamp.js";
2
+ import { resolveRefRecordLabel as t } from "../../types/schema.js";
3
+ import { useSchema as n } from "../../hooks/useSchema.js";
4
+ import { executeAction as r } from "../../api/data.js";
5
+ import { failureTitle as i } from "../../lib/failure.js";
6
+ import { Icon as a } from "../primitives/Icons.js";
7
+ import { Btn as o } from "../primitives/Btn.js";
8
+ import { useText as s } from "../../hooks/useText.js";
9
+ import { SectionCard as c } from "../primitives/SectionCard.js";
10
+ import { FieldLabel as l, TextArea as u } from "../primitives/Fields.js";
11
+ import { PanelState as d } from "./RecordDocumentsPanel.js";
12
+ import { useId as f, useState as p } from "react";
13
+ import { useQuery as m, useQueryClient as h } from "@tanstack/react-query";
14
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
15
  //#region src/components/pages/RecordNotesPanel.tsx
15
- var _ = "record-notes";
16
- function v({ entityCode: v, objectId: b }) {
17
- let x = i(), S = i("errors"), { data: C } = t(), w = m(), T = !!C?.actions?.["record_note.list"], E = !!C?.actions?.["record_note.add"], D = !!C?.actions?.["record_note.remove"], [O, k] = f(!1), [A, j] = f(""), [M, N] = f(!1), [P, F] = f(null), I = d(), { data: L, isLoading: R, error: z } = p({
16
+ var v = "record-notes";
17
+ function y({ entityCode: y, objectId: x }) {
18
+ let S = s(), C = s("errors"), { data: w } = n(), T = h(), E = !!w?.actions?.["record_note.list"], D = !!w?.actions?.["record_note.add"], O = !!w?.actions?.["record_note.remove"], [k, A] = p(!1), [j, M] = p(""), [N, P] = p(!1), [F, I] = p(null), L = f(), { data: R, isLoading: z, error: B } = m({
18
19
  queryKey: [
19
- _,
20
20
  v,
21
- b,
22
- O
21
+ y,
22
+ x,
23
+ k
23
24
  ],
24
25
  queryFn: async () => {
25
- let e = await c("record_note.list", {
26
+ let e = await r("record_note.list", {
26
27
  target: {
27
- entity: v,
28
- id: b
28
+ entity: y,
29
+ id: x
29
30
  },
30
- include_superseded: O
31
+ include_superseded: k
31
32
  });
32
33
  return {
33
34
  notes: e.result?.notes ?? [],
34
35
  refs: e.result?.$refs ?? {}
35
36
  };
36
37
  },
37
- enabled: T && !!(v && b)
38
+ enabled: E && !!(y && x)
38
39
  });
39
- if (!T) return null;
40
- let B = (t, n, r) => {
41
- let i = L?.refs?.[t]?.[n];
42
- return i ? e(x, i, r ?? "$display", n) : n;
40
+ if (!E) return null;
41
+ let V = (e, n, r) => {
42
+ let i = R?.refs?.[e]?.[n];
43
+ return i ? t(S, i, r ?? "$display", n) : n;
43
44
  };
44
- async function V(e, t) {
45
- N(!0), F(null);
45
+ async function H(e, t) {
46
+ P(!0), I(null);
46
47
  try {
47
- return await c(e, t), await w.invalidateQueries({ queryKey: [
48
- _,
48
+ return await r(e, t), await T.invalidateQueries({ queryKey: [
49
49
  v,
50
- b
50
+ y,
51
+ x
51
52
  ] }), !0;
52
53
  } catch (e) {
53
- return F(l(S, e)), !1;
54
+ return I(i(C, e)), !1;
54
55
  } finally {
55
- N(!1);
56
+ P(!1);
56
57
  }
57
58
  }
58
- async function H() {
59
- A.trim() !== "" && await V("record_note.add", {
59
+ async function U() {
60
+ j.trim() !== "" && await H("record_note.add", {
60
61
  target: {
61
- entity: v,
62
- id: b
62
+ entity: y,
63
+ id: x
63
64
  },
64
- body: A
65
- }) && j("");
65
+ body: j
66
+ }) && M("");
66
67
  }
67
- let U = L?.notes ?? [];
68
- return /* @__PURE__ */ g(a, {
69
- title: /* @__PURE__ */ h(y, {}),
68
+ let W = R?.notes ?? [];
69
+ return /* @__PURE__ */ _(c, {
70
+ title: /* @__PURE__ */ g(b, {}),
70
71
  collapsible: !1,
71
72
  padding: "0",
72
73
  children: [
73
- R && /* @__PURE__ */ h(u, {
74
- icon: /* @__PURE__ */ h(n.loader, { size: 14 }),
75
- text: x("record.notes.loading", "Loading notes...")
74
+ z && /* @__PURE__ */ g(d, {
75
+ icon: /* @__PURE__ */ g(a.loader, { size: 14 }),
76
+ text: S("record.notes.loading", "Loading notes...")
76
77
  }),
77
- z && /* @__PURE__ */ h(u, {
78
- icon: /* @__PURE__ */ h(n.warning, { size: 14 }),
79
- text: l(S, z)
78
+ B && /* @__PURE__ */ g(d, {
79
+ icon: /* @__PURE__ */ g(a.warning, { size: 14 }),
80
+ text: i(C, B)
80
81
  }),
81
- !R && !z && U.length === 0 && /* @__PURE__ */ h(u, {
82
- icon: /* @__PURE__ */ h(n.file, { size: 14 }),
83
- text: x("record.notes.empty", "No notes")
82
+ !z && !B && W.length === 0 && /* @__PURE__ */ g(d, {
83
+ icon: /* @__PURE__ */ g(a.file, { size: 14 }),
84
+ text: S("record.notes.empty", "No notes")
84
85
  }),
85
- !R && !z && U.map((e) => /* @__PURE__ */ g("div", {
86
+ !z && !B && W.map((t) => /* @__PURE__ */ _("div", {
86
87
  "data-testid": "record-note",
87
88
  style: {
88
89
  display: "flex",
@@ -90,44 +91,44 @@ function v({ entityCode: v, objectId: b }) {
90
91
  alignItems: "flex-start",
91
92
  padding: "10px 14px",
92
93
  borderTop: "1px solid var(--border)",
93
- opacity: e.superseded_by_note_id ? .6 : 1
94
+ opacity: t.superseded_by_note_id ? .6 : 1
94
95
  },
95
- children: [/* @__PURE__ */ g("div", {
96
+ children: [/* @__PURE__ */ _("div", {
96
97
  style: {
97
98
  flex: 1,
98
99
  minWidth: 0
99
100
  },
100
- children: [/* @__PURE__ */ h("div", {
101
+ children: [/* @__PURE__ */ g("div", {
101
102
  style: {
102
103
  fontSize: 13,
103
104
  whiteSpace: "pre-wrap",
104
105
  overflowWrap: "anywhere"
105
106
  },
106
- children: e.body
107
- }), /* @__PURE__ */ h("div", {
107
+ children: t.body
108
+ }), /* @__PURE__ */ g("div", {
108
109
  style: {
109
110
  marginTop: 4,
110
111
  fontSize: 12,
111
112
  color: "var(--text-3)"
112
113
  },
113
114
  children: [
114
- B("user", e.author_user_id),
115
- e.agent_id ? x("record.notes.via_agent", "via {agent}", { agent: B("agent", e.agent_id, "code") }) : null,
116
- e.acted_for ? x("record.notes.acted_for", "for {who}", { who: B(e.acted_for.entity, e.acted_for.id) }) : null,
117
- new Date(e.created_at).toLocaleString(x.language),
118
- e.superseded_by_note_id ? x("record.notes.replaced", "replaced") : null
115
+ V("user", t.author_user_id),
116
+ t.agent_id ? S("record.notes.via_agent", "via {agent}", { agent: V("agent", t.agent_id, "code") }) : null,
117
+ t.acted_for ? S("record.notes.acted_for", "for {who}", { who: V(t.acted_for.entity, t.acted_for.id) }) : null,
118
+ e(t.created_at, { zone: S.timeZone }),
119
+ t.superseded_by_note_id ? S("record.notes.replaced", "replaced") : null
119
120
  ].filter(Boolean).join(" · ")
120
121
  })]
121
- }), D && /* @__PURE__ */ h(r, {
122
+ }), O && /* @__PURE__ */ g(o, {
122
123
  kind: "ghost",
123
124
  size: "sm",
124
- icon: /* @__PURE__ */ h(n.trash, { size: 12 }),
125
- disabled: M,
126
- onClick: () => V("record_note.remove", { note_id: e.id }),
127
- children: x("record.notes.remove", "Remove")
125
+ icon: /* @__PURE__ */ g(a.trash, { size: 12 }),
126
+ disabled: N,
127
+ onClick: () => H("record_note.remove", { note_id: t.id }),
128
+ children: S("record.notes.remove", "Remove")
128
129
  })]
129
- }, e.id)),
130
- /* @__PURE__ */ g("div", {
130
+ }, t.id)),
131
+ /* @__PURE__ */ _("div", {
131
132
  style: {
132
133
  display: "flex",
133
134
  flexDirection: "column",
@@ -136,53 +137,53 @@ function v({ entityCode: v, objectId: b }) {
136
137
  borderTop: "1px solid var(--border)"
137
138
  },
138
139
  children: [
139
- /* @__PURE__ */ h("div", { children: /* @__PURE__ */ h(r, {
140
+ /* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(o, {
140
141
  kind: "ghost",
141
142
  size: "sm",
142
- onClick: () => k((e) => !e),
143
- children: O ? x("record.notes.hide_replaced", "Hide replaced notes") : x("record.notes.show_replaced", "Show replaced notes")
143
+ onClick: () => A((e) => !e),
144
+ children: k ? S("record.notes.hide_replaced", "Hide replaced notes") : S("record.notes.show_replaced", "Show replaced notes")
144
145
  }) }),
145
- E && /* @__PURE__ */ g("div", {
146
+ D && /* @__PURE__ */ _("div", {
146
147
  style: {
147
148
  display: "flex",
148
149
  flexDirection: "column",
149
150
  gap: 6
150
151
  },
151
152
  children: [
152
- /* @__PURE__ */ h(o, {
153
- htmlFor: I,
154
- children: x("record.notes.new", "New note")
153
+ /* @__PURE__ */ g(l, {
154
+ htmlFor: L,
155
+ children: S("record.notes.new", "New note")
155
156
  }),
156
- /* @__PURE__ */ h(s, {
157
- id: I,
158
- value: A,
159
- onChange: j,
157
+ /* @__PURE__ */ g(u, {
158
+ id: L,
159
+ value: j,
160
+ onChange: M,
160
161
  rows: 2
161
162
  }),
162
- /* @__PURE__ */ h("div", { children: /* @__PURE__ */ h(r, {
163
+ /* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(o, {
163
164
  kind: "default",
164
165
  size: "sm",
165
- disabled: M || A.trim() === "",
166
- onClick: H,
167
- children: x("record.notes.add", "Add note")
166
+ disabled: N || j.trim() === "",
167
+ onClick: U,
168
+ children: S("record.notes.add", "Add note")
168
169
  }) })
169
170
  ]
170
171
  }),
171
- P && /* @__PURE__ */ h("div", {
172
+ F && /* @__PURE__ */ g("div", {
172
173
  style: {
173
174
  color: "var(--danger)",
174
175
  fontSize: 12
175
176
  },
176
- children: P
177
+ children: F
177
178
  })
178
179
  ]
179
180
  })
180
181
  ]
181
182
  });
182
183
  }
183
- function y() {
184
- let e = i();
185
- return /* @__PURE__ */ g("div", {
184
+ function b() {
185
+ let e = s();
186
+ return /* @__PURE__ */ _("div", {
186
187
  style: {
187
188
  display: "flex",
188
189
  alignItems: "center",
@@ -193,8 +194,8 @@ function y() {
193
194
  fontWeight: 600,
194
195
  color: "var(--text)"
195
196
  },
196
- children: [/* @__PURE__ */ h(n.file, { size: 13 }), e("record.notes.title", "Notes")]
197
+ children: [/* @__PURE__ */ g(a.file, { size: 13 }), e("record.notes.title", "Notes")]
197
198
  });
198
199
  }
199
200
  //#endregion
200
- export { v as RecordNotesPanel };
201
+ export { y as RecordNotesPanel };