@layers-app/shared 0.4.10 → 0.4.11

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 (57) hide show
  1. package/dist/components/AppContainer/AppContainer.js +24 -24
  2. package/dist/components/AppContainer/components/Header.d.ts +3 -1
  3. package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
  4. package/dist/components/AppContainer/components/Header.js +9 -6
  5. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +102 -102
  6. package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts +2 -2
  7. package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts.map +1 -1
  8. package/dist/components/AppContainer/hooks/useAppContainerStore.js +20 -19
  9. package/dist/components/ColorPicker/icons.js +5 -5
  10. package/dist/components/MeetingPage/MeetingObjectAttitude.d.ts.map +1 -1
  11. package/dist/components/MeetingPage/MeetingObjectAttitude.js +64 -68
  12. package/dist/components/MeetingPage/MeetingObjectCard.d.ts.map +1 -1
  13. package/dist/components/MeetingPage/MeetingObjectCard.js +108 -109
  14. package/dist/components/MeetingPage/MeetingObjectDirectory.d.ts.map +1 -1
  15. package/dist/components/MeetingPage/MeetingObjectDirectory.js +85 -80
  16. package/dist/components/MeetingPage/MeetingObjectEditor.d.ts.map +1 -1
  17. package/dist/components/MeetingPage/MeetingObjectEditor.js +144 -140
  18. package/dist/components/MeetingPage/MeetingPanelError.d.ts.map +1 -1
  19. package/dist/components/MeetingPage/MeetingPanelError.js +17 -16
  20. package/dist/components/MeetingPage/MeetingPersonAppearances.d.ts.map +1 -1
  21. package/dist/components/MeetingPage/MeetingPersonAppearances.js +63 -55
  22. package/dist/components/MeetingPage/meetingAppearances.d.ts.map +1 -1
  23. package/dist/components/MeetingPage/meetingAppearances.js +29 -28
  24. package/dist/components/MeetingPage/meetingObjects.d.ts +8 -2
  25. package/dist/components/MeetingPage/meetingObjects.d.ts.map +1 -1
  26. package/dist/components/MeetingPage/meetingObjects.js +28 -31
  27. package/dist/components/MeetingPage/objectAttitude.d.ts +9 -2
  28. package/dist/components/MeetingPage/objectAttitude.d.ts.map +1 -1
  29. package/dist/components/MeetingPage/objectAttitude.js +88 -89
  30. package/dist/components/Notification/InfiniteScroll.js +10 -10
  31. package/dist/components/Notification/Notification.module.css.js +24 -20
  32. package/dist/components/Notification/atoms/UnreadDot.d.ts.map +1 -1
  33. package/dist/components/Notification/atoms/UnreadDot.js +4 -4
  34. package/dist/components/Notification/molecules/InboxEmpty.d.ts.map +1 -1
  35. package/dist/components/Notification/molecules/InboxEmpty.js +17 -15
  36. package/dist/components/Notification/molecules/InboxHeader.d.ts.map +1 -1
  37. package/dist/components/Notification/molecules/InboxHeader.js +26 -26
  38. package/dist/components/Notification/molecules/InboxTabs.d.ts.map +1 -1
  39. package/dist/components/Notification/molecules/InboxTabs.js +33 -22
  40. package/dist/components/Notification/molecules/NotificationContent.d.ts.map +1 -1
  41. package/dist/components/Notification/molecules/NotificationContent.js +121 -121
  42. package/dist/components/Notification/organisms/InboxItem.d.ts.map +1 -1
  43. package/dist/components/Notification/organisms/InboxItem.js +23 -22
  44. package/dist/components/Notification/organisms/InboxPanel.js +1 -1
  45. package/dist/components/StorageUsageProgress/index.d.ts.map +1 -1
  46. package/dist/components/StorageUsageProgress/index.js +1 -3
  47. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +10 -7
  48. package/dist/config/envConfig.d.ts +3 -0
  49. package/dist/config/envConfig.d.ts.map +1 -1
  50. package/dist/index.css +1 -1
  51. package/dist/lang/locales/ui_en.json.js +20 -18
  52. package/dist/lang/locales/ui_es.json.js +30 -28
  53. package/dist/lang/locales/ui_ru.json.js +24 -22
  54. package/dist/utils/formatStorage.d.ts +6 -5
  55. package/dist/utils/formatStorage.d.ts.map +1 -1
  56. package/dist/utils/formatStorage.js +21 -11
  57. package/package.json +1 -1
@@ -1,76 +1,72 @@
1
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { useState as d, useEffect as T } from "react";
3
- import { useWorkspaceAlias as v, meetingPageHref as y } from "./continuityLink.js";
4
- import { formatTimecode as P } from "./meetingModel.js";
5
- import { formatAppearanceDate as S } from "./meetingAppearances.js";
6
- import { loadObjectAttitude as k, meetingsWithMarks as L, SENTIMENT_SIGN as N, describeAttitude as H, SENTIMENT_SHORT as O } from "./objectAttitude.js";
7
- import { MeetingPanelError as x } from "./MeetingPanelError.js";
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import { useState as u, useEffect as P } from "react";
3
+ import { useTranslation as A } from "react-i18next";
4
+ import { useWorkspaceAlias as S, meetingPageHref as b } from "./continuityLink.js";
5
+ import { formatTimecode as k } from "./meetingModel.js";
6
+ import { formatAppearanceDate as H } from "./meetingAppearances.js";
7
+ import { loadObjectAttitude as L, meetingsWithMarks as O, SENTIMENT_SIGN as f, describeAttitude as x, SENTIMENT_SHORT as R } from "./objectAttitude.js";
8
+ import { MeetingPanelError as W } from "./MeetingPanelError.js";
8
9
  import t from "./MeetingPage.module.css.js";
9
- function q({
10
+ function C({
10
11
  objectType: a,
11
- objectId: c,
12
- limit: l = 4
12
+ objectId: l,
13
+ limit: r = 4
13
14
  }) {
14
- const [n, u] = d(null), [i, o] = d(!1), [m, M] = d(!0), [A, b] = d(!1), [I, E] = d(0), j = v();
15
- if (T(() => {
16
- let r = !1;
17
- return M(!0), k(a, c, 50).then((g) => {
18
- r || (u(g.data), o(g.isError), M(!1));
15
+ const { t: n } = A("ui"), [s, o] = u(null), [i, m] = u(!1), [h, M] = u(!0), [I, E] = u(!1), [T, j] = u(0), v = S();
16
+ if (P(() => {
17
+ let c = !1;
18
+ return M(!0), L(a, l, 50).then((y) => {
19
+ c || (o(y.data), m(y.isError), M(!1));
19
20
  }), () => {
20
- r = !0;
21
+ c = !0;
21
22
  };
22
- }, [a, c, I]), m)
23
- return /* @__PURE__ */ s("span", { className: t.attitude, "data-cy": "meeting-object-attitude", children: [
24
- /* @__PURE__ */ e("span", { className: t.sectionLabel, children: "Как о нём отзывались" }),
25
- /* @__PURE__ */ e("span", { className: t.objectHint, children: "Смотрим…" })
23
+ }, [a, l, T]), h)
24
+ return /* @__PURE__ */ d("span", { className: t.attitude, "data-cy": "meeting-object-attitude", children: [
25
+ /* @__PURE__ */ e("span", { className: t.sectionLabel, children: n("meeting.attitude.title") }),
26
+ /* @__PURE__ */ e("span", { className: t.objectHint, children: n("meeting.attitude.loading") })
26
27
  ] });
27
- if (i || !n)
28
- return /* @__PURE__ */ s("span", { className: t.attitude, "data-cy": "meeting-object-attitude", children: [
29
- /* @__PURE__ */ e("span", { className: t.sectionLabel, children: "Как о нём отзывались" }),
28
+ if (i || !s)
29
+ return /* @__PURE__ */ d("span", { className: t.attitude, "data-cy": "meeting-object-attitude", children: [
30
+ /* @__PURE__ */ e("span", { className: t.sectionLabel, children: n("meeting.attitude.title") }),
30
31
  /* @__PURE__ */ e(
31
- x,
32
+ W,
32
33
  {
33
- what: "отношение к объекту",
34
- onRetry: () => E((r) => r + 1),
34
+ what: n("meeting.attitude.errorWhat"),
35
+ onRetry: () => j((c) => c + 1),
35
36
  "data-cy": "meeting-object-attitude-error"
36
37
  }
37
38
  )
38
39
  ] });
39
- const f = H(n), h = L(n), p = A ? h : h.slice(0, l);
40
- return /* @__PURE__ */ s("span", { className: t.attitude, "data-cy": "meeting-object-attitude", children: [
41
- /* @__PURE__ */ e("span", { className: t.sectionLabel, children: "Как о нём отзывались" }),
42
- /* @__PURE__ */ e("span", { className: t.attitudeAside, children: "Не про настроение встречи, а про то, что говорили об этом объекте." }),
43
- /* @__PURE__ */ e("span", { className: t.attitudeVerdict, "data-cy": "meeting-object-attitude-verdict", children: f.headline }),
44
- /* @__PURE__ */ e("span", { className: t.attitudeDetail, children: f.detail }),
45
- n.positive + n.negative > 0 && /* @__PURE__ */ s("span", { className: t.attitudeTally, "aria-hidden": "true", children: [
46
- /* @__PURE__ */ s("span", { className: t.attitudeTallyPositive, children: [
47
- N.POSITIVE,
40
+ const g = x(s), p = O(s), N = I ? p : p.slice(0, r);
41
+ return /* @__PURE__ */ d("span", { className: t.attitude, "data-cy": "meeting-object-attitude", children: [
42
+ /* @__PURE__ */ e("span", { className: t.sectionLabel, children: n("meeting.attitude.title") }),
43
+ /* @__PURE__ */ e("span", { className: t.attitudeAside, children: n("meeting.attitude.aside") }),
44
+ /* @__PURE__ */ e("span", { className: t.attitudeVerdict, "data-cy": "meeting-object-attitude-verdict", children: n(g.headline) }),
45
+ /* @__PURE__ */ e("span", { className: t.attitudeDetail, children: n(g.detail, g.values) }),
46
+ s.positive + s.negative > 0 && /* @__PURE__ */ d("span", { className: t.attitudeTally, "aria-hidden": "true", children: [
47
+ /* @__PURE__ */ d("span", { className: t.attitudeTallyPositive, children: [
48
+ f.POSITIVE,
48
49
  " ",
49
- n.positive
50
+ s.positive
50
51
  ] }),
51
- /* @__PURE__ */ s("span", { className: t.attitudeTallyNegative, children: [
52
- N.NEGATIVE,
52
+ /* @__PURE__ */ d("span", { className: t.attitudeTallyNegative, children: [
53
+ f.NEGATIVE,
53
54
  " ",
54
- n.negative
55
+ s.negative
55
56
  ] })
56
57
  ] }),
57
- n.unread > 0 && n.state !== "NOT_ANALYZED" && /* @__PURE__ */ s("span", { className: t.objectHint, children: [
58
- "Ещё ",
59
- n.unread,
60
- " упоминаний не разбирали."
61
- ] }),
62
- p.map((r) => /* @__PURE__ */ e(V, { meeting: r, alias: j }, w(r))),
63
- h.length > p.length && /* @__PURE__ */ s(
58
+ s.unread > 0 && s.state !== "NOT_ANALYZED" && /* @__PURE__ */ e("span", { className: t.objectHint, children: n("meeting.attitude.unread", { count: s.unread }) }),
59
+ N.map((c) => /* @__PURE__ */ e(V, { meeting: c, alias: v }, w(c))),
60
+ p.length > N.length && /* @__PURE__ */ e(
64
61
  "button",
65
62
  {
66
63
  type: "button",
67
64
  className: t.objectActionQuiet,
68
- onClick: () => b(!0),
65
+ onClick: () => E(!0),
69
66
  "data-cy": "meeting-object-attitude-more",
70
- children: [
71
- "Ещё ",
72
- h.length - p.length
73
- ]
67
+ children: n("meeting.attitude.more", {
68
+ count: p.length - N.length
69
+ })
74
70
  }
75
71
  )
76
72
  ] });
@@ -80,35 +76,35 @@ function w(a) {
80
76
  }
81
77
  function V({
82
78
  meeting: a,
83
- alias: c
79
+ alias: l
84
80
  }) {
85
- const l = a.summaryPageId ? y(c, a.summaryPageId) : null, n = S(a.occurredAt), u = a.title ?? "Встреча";
86
- return /* @__PURE__ */ s("span", { className: t.attitudeMeeting, children: [
87
- /* @__PURE__ */ s("span", { className: t.attitudeMeetingHead, children: [
88
- l ? /* @__PURE__ */ e("a", { className: t.attitudeMeetingLink, href: l, children: u }) : /* @__PURE__ */ e("span", { className: t.attitudeMeetingLink, children: u }),
89
- n && /* @__PURE__ */ e("span", { className: t.attitudeWhen, children: n })
81
+ const { t: r } = A("ui"), n = a.summaryPageId ? b(l, a.summaryPageId) : null, s = H(a.occurredAt), o = a.title ?? r("meeting.attitude.meetingFallback");
82
+ return /* @__PURE__ */ d("span", { className: t.attitudeMeeting, children: [
83
+ /* @__PURE__ */ d("span", { className: t.attitudeMeetingHead, children: [
84
+ n ? /* @__PURE__ */ e("a", { className: t.attitudeMeetingLink, href: n, children: o }) : /* @__PURE__ */ e("span", { className: t.attitudeMeetingLink, children: o }),
85
+ s && /* @__PURE__ */ e("span", { className: t.attitudeWhen, children: s })
90
86
  ] }),
91
87
  a.marks.map((i) => {
92
- const o = a.summaryPageId && i.startMs !== null ? y(c, a.summaryPageId, i.startMs) : null, m = i.startMs !== null ? P(i.startMs) : null;
93
- return /* @__PURE__ */ s(
88
+ const m = a.summaryPageId && i.startMs !== null ? b(l, a.summaryPageId, i.startMs) : null, h = i.startMs !== null ? k(i.startMs) : null;
89
+ return /* @__PURE__ */ d(
94
90
  "span",
95
91
  {
96
92
  className: i.sentiment === "POSITIVE" ? `${t.attitudeMark} ${t.attitudeMarkPositive}` : `${t.attitudeMark} ${t.attitudeMarkNegative}`,
97
93
  "data-cy": "meeting-object-attitude-mark",
98
94
  children: [
99
- /* @__PURE__ */ e("span", { className: t.attitudeMarkSign, "aria-hidden": "true", children: N[i.sentiment] }),
100
- /* @__PURE__ */ s("span", { className: t.attitudeMarkBody, children: [
95
+ /* @__PURE__ */ e("span", { className: t.attitudeMarkSign, "aria-hidden": "true", children: f[i.sentiment] }),
96
+ /* @__PURE__ */ d("span", { className: t.attitudeMarkBody, children: [
101
97
  i.summary && /* @__PURE__ */ e("span", { className: t.attitudeMarkSummary, children: i.summary }),
102
- /* @__PURE__ */ s("span", { className: t.attitudeMarkQuote, children: [
98
+ /* @__PURE__ */ d("span", { className: t.attitudeMarkQuote, children: [
103
99
  "«",
104
100
  i.quote,
105
101
  "»"
106
102
  ] }),
107
- /* @__PURE__ */ s("span", { className: t.attitudeMarkWhere, children: [
108
- o ? /* @__PURE__ */ e("a", { className: t.attitudeMarkAt, href: o, children: m ?? "в записи" }) : /* @__PURE__ */ e("span", { className: t.attitudeMarkAt, children: m ?? "в записи" }),
109
- /* @__PURE__ */ s("span", { className: t.attitudeMarkKind, children: [
110
- O[i.sentiment],
111
- i.method === "HUMAN" ? ", поправлено вручную" : ""
103
+ /* @__PURE__ */ d("span", { className: t.attitudeMarkWhere, children: [
104
+ m ? /* @__PURE__ */ e("a", { className: t.attitudeMarkAt, href: m, children: h ?? r("meeting.attitude.inRecording") }) : /* @__PURE__ */ e("span", { className: t.attitudeMarkAt, children: h ?? r("meeting.attitude.inRecording") }),
105
+ /* @__PURE__ */ d("span", { className: t.attitudeMarkKind, children: [
106
+ r(R[i.sentiment]),
107
+ i.method === "HUMAN" ? r("meeting.attitude.byHand") : ""
112
108
  ] })
113
109
  ] })
114
110
  ] })
@@ -120,5 +116,5 @@ function V({
120
116
  ] });
121
117
  }
122
118
  export {
123
- q as MeetingObjectAttitude
119
+ C as MeetingObjectAttitude
124
120
  };
@@ -1 +1 @@
1
- {"version":3,"file":"MeetingObjectCard.d.ts","sourceRoot":"","sources":["../../../src/components/MeetingPage/MeetingObjectCard.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,iBAAiB,EAKvB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACjB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAYD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,QAAQ,EACR,WAAkB,EAClB,EAAS,EACT,MAAa,EACb,SAAS,EACT,WAAkB,EAClB,gBAAoB,EACpB,QAAe,EACf,aAAiB,EACjB,WAAkB,GACnB,EAAE,sBAAsB,2CAmRxB"}
1
+ {"version":3,"file":"MeetingObjectCard.d.ts","sourceRoot":"","sources":["../../../src/components/MeetingPage/MeetingObjectCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,iBAAiB,EAKvB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACjB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAYD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,QAAQ,EACR,WAAkB,EAClB,EAAS,EACT,MAAa,EACb,SAAS,EACT,WAAkB,EAClB,gBAAoB,EACpB,QAAe,EACf,aAAiB,EACjB,WAAkB,GACnB,EAAE,sBAAsB,2CAyRxB"}
@@ -1,184 +1,183 @@
1
- import { jsx as s, jsxs as l, Fragment as q } from "react/jsx-runtime";
2
- import { useState as i, useRef as z, useEffect as y, useMemo as J } from "react";
3
- import { MeetingObjectAttitude as V } from "./MeetingObjectAttitude.js";
4
- import { MeetingPersonAppearances as X } from "./MeetingPersonAppearances.js";
5
- import { useWorkspaceMembers as $, SpeakerAvatar as T } from "./SpeakerAvatar.js";
6
- import { loadObject as w, listRelations as D, objectFace as ee, renameObject as te } from "./meetingObjects.js";
1
+ import { jsx as n, jsxs as d, Fragment as Z } from "react/jsx-runtime";
2
+ import { useState as r, useRef as q, useEffect as O, useMemo as J } from "react";
3
+ import { useTranslation as V } from "react-i18next";
4
+ import { MeetingObjectAttitude as X } from "./MeetingObjectAttitude.js";
5
+ import { MeetingPersonAppearances as $ } from "./MeetingPersonAppearances.js";
6
+ import { useWorkspaceMembers as D, SpeakerAvatar as ee } from "./SpeakerAvatar.js";
7
+ import { loadObject as I, listRelations as te, objectFace as ne, renameObject as ae } from "./meetingObjects.js";
7
8
  import t from "./MeetingPage.module.css.js";
8
9
  const se = {
9
- PERSON: "Человек",
10
- ORGANIZATION: "Организация"
11
- }, ne = {
12
- MEMBER_OF: "в",
13
- PART_OF: "часть"
10
+ PERSON: "meeting.card.typePerson",
11
+ ORGANIZATION: "meeting.card.typeOrganization"
12
+ }, ce = {
13
+ MEMBER_OF: "meeting.card.relationIn",
14
+ PART_OF: "meeting.card.relationPartOf"
14
15
  };
15
- function me({
16
- objectType: r,
17
- objectId: a,
16
+ function be({
17
+ objectType: l,
18
+ objectId: c,
18
19
  nameThatDay: o = null,
19
- at: f = null,
20
+ at: g = null,
20
21
  reason: R = null,
21
22
  onChanged: H,
22
- appearances: I = !0,
23
- appearancesLimit: _ = 3,
24
- attitude: x = !0,
25
- attitudeLimit: B = 3,
26
- workspaceId: E = null
23
+ appearances: _ = !0,
24
+ appearancesLimit: x = 3,
25
+ attitude: B = !0,
26
+ attitudeLimit: W = 3,
27
+ workspaceId: A = null
27
28
  }) {
28
- const [m, O] = i(null), [p, K] = i([]), [L, W] = i(/* @__PURE__ */ new Map()), [G, A] = i(!1), [b, u] = i(!1), [v, M] = i(""), [N, k] = i(!1), [C, j] = i(null), P = z(null), Q = $(E), h = f ? f.toISOString() : null;
29
- y(() => {
29
+ const { t: a } = V("ui"), [u, E] = r(null), [b, K] = r([]), [L, z] = r(/* @__PURE__ */ new Map()), [G, v] = r(!1), [f, p] = r(!1), [P, M] = r(""), [N, k] = r(!1), [C, j] = r(null), S = q(null), Q = D(A), h = g ? g.toISOString() : null;
30
+ O(() => {
30
31
  let e = !1;
31
- return A(!1), Promise.all([
32
- w(r, a),
33
- D(r, a, h ? new Date(h) : null)
34
- ]).then(([n, c]) => {
35
- e || (O(n), K(c), A(!0));
32
+ return v(!1), Promise.all([
33
+ I(l, c),
34
+ te(l, c, h ? new Date(h) : null)
35
+ ]).then(([s, i]) => {
36
+ e || (E(s), K(i), v(!0));
36
37
  }), () => {
37
38
  e = !0;
38
39
  };
39
- }, [r, a, h]);
40
- const g = J(
41
- () => p.map(
42
- (e) => e.subjectId === a ? { type: e.objectType, id: e.objectId } : { type: e.subjectType, id: e.subjectId }
43
- ).filter((e) => e.id && e.id !== a).slice(0, 5),
44
- [p, a]
40
+ }, [l, c, h]);
41
+ const y = J(
42
+ () => b.map(
43
+ (e) => e.subjectId === c ? { type: e.objectType, id: e.objectId } : { type: e.subjectType, id: e.subjectId }
44
+ ).filter((e) => e.id && e.id !== c).slice(0, 5),
45
+ [b, c]
45
46
  );
46
- y(() => {
47
- if (!g.length) return;
47
+ O(() => {
48
+ if (!y.length) return;
48
49
  let e = !1;
49
50
  return Promise.all(
50
- g.map(
51
- (n) => w(n.type, n.id).then((c) => [n.id, c])
51
+ y.map(
52
+ (s) => I(s.type, s.id).then((i) => [s.id, i])
52
53
  )
53
- ).then((n) => {
54
+ ).then((s) => {
54
55
  if (e) return;
55
- const c = /* @__PURE__ */ new Map();
56
- n.forEach(([Z, F]) => {
57
- F?.displayName && c.set(Z, F.displayName);
58
- }), W(c);
56
+ const i = /* @__PURE__ */ new Map();
57
+ s.forEach(([Y, w]) => {
58
+ w?.displayName && i.set(Y, w.displayName);
59
+ }), z(i);
59
60
  }), () => {
60
61
  e = !0;
61
62
  };
62
- }, [g]), y(() => {
63
- b && P.current?.focus();
64
- }, [b]);
65
- const d = m?.displayName ?? "", U = !!(o && d && o !== d), Y = () => {
66
- M(d || o || ""), j(null), u(!0);
67
- }, S = async () => {
68
- const e = v.trim();
69
- if (!e || e === d) {
70
- u(!1);
63
+ }, [y]), O(() => {
64
+ f && S.current?.focus();
65
+ }, [f]);
66
+ const m = u?.displayName ?? "", T = !!(o && m && o !== m), U = () => {
67
+ M(m || o || ""), j(null), p(!0);
68
+ }, F = async () => {
69
+ const e = P.trim();
70
+ if (!e || e === m) {
71
+ p(!1);
71
72
  return;
72
73
  }
73
74
  k(!0), j(null);
74
- const n = await te(r, a, e);
75
- if (k(!1), !n) {
76
- j("Не сохранилось — возможно, нет прав на правку справочника");
75
+ const s = await ae(l, c, e);
76
+ if (k(!1), !s) {
77
+ j(a("meeting.card.renameFailed"));
77
78
  return;
78
79
  }
79
- O(n), u(!1), H?.();
80
+ E(s), p(!1), H?.();
80
81
  };
81
- return G ? m ? /* @__PURE__ */ l("span", { className: t.objectCard, "data-cy": "meeting-object-card", children: [
82
- /* @__PURE__ */ l("span", { className: t.objectHead, children: [
83
- /* @__PURE__ */ s(
84
- T,
82
+ return G ? u ? /* @__PURE__ */ d("span", { className: t.objectCard, "data-cy": "meeting-object-card", children: [
83
+ /* @__PURE__ */ d("span", { className: t.objectHead, children: [
84
+ /* @__PURE__ */ n(
85
+ ee,
85
86
  {
86
- label: d || o || "?",
87
- avatarUrl: ee(m, Q, E)
87
+ label: m || o || "?",
88
+ avatarUrl: ne(u, Q, A)
88
89
  }
89
90
  ),
90
- /* @__PURE__ */ l("span", { className: t.objectTitle, children: [
91
- b ? /* @__PURE__ */ s(
91
+ /* @__PURE__ */ d("span", { className: t.objectTitle, children: [
92
+ f ? /* @__PURE__ */ n(
92
93
  "input",
93
94
  {
94
- ref: P,
95
+ ref: S,
95
96
  className: t.namingInput,
96
- value: v,
97
+ value: P,
97
98
  disabled: N,
98
99
  onChange: (e) => M(e.target.value),
99
100
  onKeyDown: (e) => {
100
- e.key === "Enter" && S(), e.key === "Escape" && u(!1);
101
+ e.key === "Enter" && F(), e.key === "Escape" && p(!1);
101
102
  },
102
103
  "data-cy": "meeting-object-rename"
103
104
  }
104
- ) : /* @__PURE__ */ s("span", { className: t.objectName, "data-cy": "meeting-object-name", children: d || o }),
105
- /* @__PURE__ */ s("span", { className: t.objectType, children: se[r] })
105
+ ) : /* @__PURE__ */ n("span", { className: t.objectName, "data-cy": "meeting-object-name", children: m || o }),
106
+ /* @__PURE__ */ n("span", { className: t.objectType, children: a(se[l]) })
106
107
  ] })
107
108
  ] }),
108
- U && /* @__PURE__ */ l("span", { className: t.objectThen, "data-cy": "meeting-object-then", children: [
109
- тот день его звали «",
110
- o,
111
- "»"
112
- ] }),
113
- p.length > 0 ? /* @__PURE__ */ s("span", { className: t.objectRelations, children: p.map((e) => {
114
- const n = e.subjectId === a ? e.objectId : e.subjectId, c = L.get(n);
115
- return /* @__PURE__ */ l("span", { className: t.objectRelation, children: [
116
- e.roleTitle && /* @__PURE__ */ s("span", { className: t.objectRole, children: e.roleTitle }),
117
- /* @__PURE__ */ l("span", { className: t.objectWhere, children: [
118
- ne[e.kind ?? ""] ?? "связан с",
109
+ T && /* @__PURE__ */ n("span", { className: t.objectThen, "data-cy": "meeting-object-then", children: a("meeting.card.namedThen", { name: o }) }),
110
+ b.length > 0 ? /* @__PURE__ */ n("span", { className: t.objectRelations, children: b.map((e) => {
111
+ const s = e.subjectId === c ? e.objectId : e.subjectId, i = L.get(s);
112
+ return /* @__PURE__ */ d("span", { className: t.objectRelation, children: [
113
+ e.roleTitle && /* @__PURE__ */ n("span", { className: t.objectRole, children: e.roleTitle }),
114
+ /* @__PURE__ */ d("span", { className: t.objectWhere, children: [
115
+ a(
116
+ ce[e.kind ?? ""] ?? "meeting.card.relationWith"
117
+ ),
119
118
  " ",
120
- c ?? "…"
119
+ i ?? "…"
121
120
  ] }),
122
- !e.current && /* @__PURE__ */ s("span", { className: t.objectPast, children: "уже не так" })
121
+ !e.current && /* @__PURE__ */ n("span", { className: t.objectPast, children: a("meeting.card.relationPast") })
123
122
  ] }, e.id);
124
- }) }) : /* @__PURE__ */ s("span", { className: t.objectHint, "data-cy": "meeting-object-no-links", children: f ? "На день встречи связей не записано." : "Связей не записано." }),
125
- m.description && /* @__PURE__ */ s("span", { className: t.objectAbout, children: m.description }),
126
- R && /* @__PURE__ */ s("span", { className: t.objectReason, children: R }),
127
- /* @__PURE__ */ s("span", { className: t.objectActions, children: b ? /* @__PURE__ */ l(q, { children: [
128
- /* @__PURE__ */ s(
123
+ }) }) : /* @__PURE__ */ n("span", { className: t.objectHint, "data-cy": "meeting-object-no-links", children: a(g ? "meeting.card.noRelationsAt" : "meeting.card.noRelations") }),
124
+ u.description && /* @__PURE__ */ n("span", { className: t.objectAbout, children: u.description }),
125
+ R && /* @__PURE__ */ n("span", { className: t.objectReason, children: R }),
126
+ /* @__PURE__ */ n("span", { className: t.objectActions, children: f ? /* @__PURE__ */ d(Z, { children: [
127
+ /* @__PURE__ */ n(
129
128
  "button",
130
129
  {
131
130
  type: "button",
132
131
  className: t.objectAction,
133
132
  disabled: N,
134
133
  onClick: () => {
135
- S();
134
+ F();
136
135
  },
137
136
  "data-cy": "meeting-object-rename-save",
138
- children: "Сохранить"
137
+ children: a("meeting.card.save")
139
138
  }
140
139
  ),
141
- /* @__PURE__ */ s(
140
+ /* @__PURE__ */ n(
142
141
  "button",
143
142
  {
144
143
  type: "button",
145
144
  className: t.objectActionQuiet,
146
145
  disabled: N,
147
- onClick: () => u(!1),
148
- children: "Отмена"
146
+ onClick: () => p(!1),
147
+ children: a("meeting.card.cancel")
149
148
  }
150
149
  )
151
- ] }) : /* @__PURE__ */ s(
150
+ ] }) : /* @__PURE__ */ n(
152
151
  "button",
153
152
  {
154
153
  type: "button",
155
154
  className: t.objectAction,
156
- onClick: Y,
155
+ onClick: U,
157
156
  "data-cy": "meeting-object-edit",
158
- children: "Переименовать"
157
+ children: a("meeting.card.rename")
159
158
  }
160
159
  ) }),
161
- C && /* @__PURE__ */ s("span", { className: t.namingError, children: C }),
162
- x && /* @__PURE__ */ s(
163
- V,
160
+ C && /* @__PURE__ */ n("span", { className: t.namingError, children: C }),
161
+ B && /* @__PURE__ */ n(
162
+ X,
164
163
  {
165
- objectType: r,
166
- objectId: a,
167
- limit: B
164
+ objectType: l,
165
+ objectId: c,
166
+ limit: W
168
167
  }
169
168
  ),
170
- I && r === "PERSON" && /* @__PURE__ */ s(
171
- X,
169
+ _ && l === "PERSON" && /* @__PURE__ */ n(
170
+ $,
172
171
  {
173
- personId: a,
174
- limit: _
172
+ personId: c,
173
+ limit: x
175
174
  }
176
175
  )
177
- ] }) : /* @__PURE__ */ l("span", { className: t.objectCard, "data-cy": "meeting-object-card", children: [
178
- /* @__PURE__ */ s("span", { className: t.objectName, children: o || "Объект" }),
179
- /* @__PURE__ */ s("span", { className: t.objectHint, children: "Этого объекта больше нет в справочнике — его удалили или слили с другим." })
180
- ] }) : /* @__PURE__ */ s("span", { className: t.objectCard, "data-cy": "meeting-object-card", children: /* @__PURE__ */ s("span", { className: t.objectHint, children: "Смотрим, кто это…" }) });
176
+ ] }) : /* @__PURE__ */ d("span", { className: t.objectCard, "data-cy": "meeting-object-card", children: [
177
+ /* @__PURE__ */ n("span", { className: t.objectName, children: o || a("meeting.card.unknownObject") }),
178
+ /* @__PURE__ */ n("span", { className: t.objectHint, children: a("meeting.card.gone") })
179
+ ] }) : /* @__PURE__ */ n("span", { className: t.objectCard, "data-cy": "meeting-object-card", children: /* @__PURE__ */ n("span", { className: t.objectHint, children: a("meeting.card.loading") }) });
181
180
  }
182
181
  export {
183
- me as MeetingObjectCard
182
+ be as MeetingObjectCard
184
183
  };
@@ -1 +1 @@
1
- {"version":3,"file":"MeetingObjectDirectory.d.ts","sourceRoot":"","sources":["../../../src/components/MeetingPage/MeetingObjectDirectory.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,2BAA2B;IAC1C,oGAAoG;IACpG,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,WAAW,GACZ,EAAE,2BAA2B,2CAiO7B"}
1
+ {"version":3,"file":"MeetingObjectDirectory.d.ts","sourceRoot":"","sources":["../../../src/components/MeetingPage/MeetingObjectDirectory.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,2BAA2B;IAC1C,oGAAoG;IACpG,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,WAAW,GACZ,EAAE,2BAA2B,2CAwO7B"}