@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,167 +1,172 @@
1
- import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
- import { useState as n, useCallback as w, useEffect as B } from "react";
3
- import { MeetingObjectEditor as D } from "./MeetingObjectEditor.js";
4
- import { MeetingPanelError as L } from "./MeetingPanelError.js";
5
- import { useWorkspaceMembers as x, SpeakerAvatar as q } from "./SpeakerAvatar.js";
6
- import { listObjects as F, objectFace as V, createObject as W } from "./meetingObjects.js";
1
+ import { jsx as i, jsxs as c } from "react/jsx-runtime";
2
+ import { useState as s, useCallback as z, useEffect as B } from "react";
3
+ import { useTranslation as D } from "react-i18next";
4
+ import { MeetingObjectEditor as F } from "./MeetingObjectEditor.js";
5
+ import { MeetingPanelError as K } from "./MeetingPanelError.js";
6
+ import { useWorkspaceMembers as L, SpeakerAvatar as q } from "./SpeakerAvatar.js";
7
+ import { listObjects as x, objectFace as W, createObject as V } from "./meetingObjects.js";
7
8
  import { panelRequestView as _ } from "./panelRequestView.js";
8
9
  import t from "./MeetingPage.module.css.js";
9
- const G = 250, H = [
10
- { type: "PERSON", label: "Люди" },
11
- { type: "ORGANIZATION", label: "Организации" }
10
+ const k = 250, G = [
11
+ { type: "PERSON", labelKey: "meeting.directory.tabPerson" },
12
+ { type: "ORGANIZATION", labelKey: "meeting.directory.tabOrganization" }
12
13
  ];
13
- function k({
14
- workspaceId: s
14
+ function te({
15
+ workspaceId: a
15
16
  }) {
16
- const [r, S] = n("PERSON"), [c, R] = n(""), [u, N] = n(null), [g, j] = n({ isError: !1, status: null }), [l, o] = n(null), [p, f] = n(""), [b, v] = n(!1), [E, C] = n(null), [A, $] = n(0), P = x(s), m = w(() => $((e) => e + 1), []);
17
+ const { t: r } = D("ui"), [n, j] = s("PERSON"), [o, A] = s(""), [p, N] = s(null), [f, P] = s({ isError: !1, status: null }), [l, m] = s(null), [u, b] = s(""), [v, O] = s(!1), [E, C] = s(null), [R, w] = s(0), M = L(a), d = z(() => w((e) => e + 1), []);
17
18
  B(() => {
18
- if (!s) {
19
+ if (!a) {
19
20
  N([]);
20
21
  return;
21
22
  }
22
23
  let e = !1;
23
- const d = window.setTimeout(
24
+ const y = window.setTimeout(
24
25
  () => {
25
- F(r, s, c).then((h) => {
26
- e || (N(h.data), j({ isError: h.isError, status: h.status }));
26
+ x(n, a, o).then((h) => {
27
+ e || (N(h.data), P({ isError: h.isError, status: h.status }));
27
28
  });
28
29
  },
29
- c ? G : 0
30
+ o ? k : 0
30
31
  );
31
32
  return () => {
32
- e = !0, window.clearTimeout(d);
33
+ e = !0, window.clearTimeout(y);
33
34
  };
34
- }, [s, r, c, A]);
35
- const O = async () => {
36
- const e = p.trim();
37
- if (!s || !e) return;
38
- v(!0), C(null);
39
- const d = await W(r, s, e);
40
- if (v(!1), !d) {
41
- C("Не завелось — возможно, нет прав на правку справочника");
35
+ }, [a, n, o, R]);
36
+ const S = async () => {
37
+ const e = u.trim();
38
+ if (!a || !e) return;
39
+ O(!0), C(null);
40
+ const y = await V(n, a, e);
41
+ if (O(!1), !y) {
42
+ C(r("meeting.directory.createFailed"));
42
43
  return;
43
44
  }
44
- f(""), o(d.id), m();
45
- }, y = _({
46
- isLoading: u === null,
47
- isError: g.isError,
48
- status: g.status,
49
- count: u?.length ?? 0
45
+ b(""), m(y.id), d();
46
+ }, g = _({
47
+ isLoading: p === null,
48
+ isError: f.isError,
49
+ status: f.status,
50
+ count: p?.length ?? 0
50
51
  });
51
- if (!s)
52
- return /* @__PURE__ */ a("div", { className: t.directory, children: /* @__PURE__ */ a("p", { className: t.empty, children: "Справочник открывается из пространства." }) });
53
- const M = u ?? [], T = !!c.trim();
54
- return /* @__PURE__ */ i("div", { className: t.directory, "data-cy": "meeting-object-directory", children: [
55
- /* @__PURE__ */ i("div", { className: t.row, children: [
56
- H.map((e) => /* @__PURE__ */ a(
52
+ if (!a)
53
+ return /* @__PURE__ */ i("div", { className: t.directory, children: /* @__PURE__ */ i("p", { className: t.empty, children: r("meeting.directory.workspaceOnly") }) });
54
+ const T = p ?? [], $ = !!o.trim();
55
+ return /* @__PURE__ */ c("div", { className: t.directory, "data-cy": "meeting-object-directory", children: [
56
+ /* @__PURE__ */ c("div", { className: t.row, children: [
57
+ G.map((e) => /* @__PURE__ */ i(
57
58
  "button",
58
59
  {
59
60
  type: "button",
60
- "aria-pressed": r === e.type,
61
- className: r === e.type ? `${t.chip} ${t.chipActive}` : t.chip,
61
+ "aria-pressed": n === e.type,
62
+ className: n === e.type ? `${t.chip} ${t.chipActive}` : t.chip,
62
63
  onClick: () => {
63
- S(e.type), o(null);
64
+ j(e.type), m(null);
64
65
  },
65
66
  "data-cy": `meeting-objects-tab-${e.type.toLowerCase()}`,
66
- children: e.label
67
+ children: r(e.labelKey)
67
68
  },
68
69
  e.type
69
70
  )),
70
- /* @__PURE__ */ a(
71
+ /* @__PURE__ */ i(
71
72
  "input",
72
73
  {
73
74
  type: "search",
74
75
  className: t.search,
75
- value: c,
76
- placeholder: r === "PERSON" ? "Поиск по людям" : "Поиск по организациям",
77
- onChange: (e) => R(e.target.value),
76
+ value: o,
77
+ placeholder: r(n === "PERSON" ? "meeting.directory.searchPerson" : "meeting.directory.searchOrganization"),
78
+ onChange: (e) => A(e.target.value),
78
79
  "data-cy": "meeting-objects-search"
79
80
  }
80
81
  )
81
82
  ] }),
82
- /* @__PURE__ */ i("div", { className: t.row, children: [
83
- /* @__PURE__ */ a(
83
+ /* @__PURE__ */ c("div", { className: t.row, children: [
84
+ /* @__PURE__ */ i(
84
85
  "input",
85
86
  {
86
87
  className: t.namingInput,
87
- value: p,
88
- disabled: b,
89
- placeholder: r === "PERSON" ? "Имя нового человека" : "Название организации",
90
- onChange: (e) => f(e.target.value),
88
+ value: u,
89
+ disabled: v,
90
+ placeholder: r(n === "PERSON" ? "meeting.directory.newPerson" : "meeting.directory.newOrganization"),
91
+ onChange: (e) => b(e.target.value),
91
92
  onKeyDown: (e) => {
92
- e.key === "Enter" && O();
93
+ e.key === "Enter" && S();
93
94
  },
94
95
  "data-cy": "meeting-objects-create-input"
95
96
  }
96
97
  ),
97
- /* @__PURE__ */ a(
98
+ /* @__PURE__ */ i(
98
99
  "button",
99
100
  {
100
101
  type: "button",
101
102
  className: t.objectAction,
102
- disabled: b || !p.trim(),
103
+ disabled: v || !u.trim(),
103
104
  onClick: () => {
104
- O();
105
+ S();
105
106
  },
106
107
  "data-cy": "meeting-objects-create",
107
- children: "Завести"
108
+ children: r("meeting.directory.create")
108
109
  }
109
110
  ),
110
- E && /* @__PURE__ */ a("span", { className: t.namingError, children: E })
111
+ E && /* @__PURE__ */ i("span", { className: t.namingError, children: E })
111
112
  ] }),
112
- /* @__PURE__ */ i("div", { className: t.directoryBody, children: [
113
- /* @__PURE__ */ i("div", { className: t.directoryList, children: [
114
- y === "loading" && /* @__PURE__ */ a("p", { className: t.empty, children: "Читаем справочник…" }),
115
- y === "failed" && /* @__PURE__ */ a("p", { className: t.empty, children: /* @__PURE__ */ a(
116
- L,
113
+ /* @__PURE__ */ c("div", { className: t.directoryBody, children: [
114
+ /* @__PURE__ */ c("div", { className: t.directoryList, children: [
115
+ g === "loading" && /* @__PURE__ */ i("p", { className: t.empty, children: r("meeting.directory.loading") }),
116
+ g === "failed" && /* @__PURE__ */ i("p", { className: t.empty, children: /* @__PURE__ */ i(
117
+ K,
117
118
  {
118
- what: "справочник",
119
- onRetry: m,
119
+ what: r("meeting.directory.errorWhat"),
120
+ onRetry: d,
120
121
  "data-cy": "meeting-objects-error"
121
122
  }
122
123
  ) }),
123
- y === "empty" && /* @__PURE__ */ a("p", { className: t.empty, "data-cy": "meeting-objects-empty", children: T ? `По запросу «${c.trim()}» никого не нашлось.` : r === "PERSON" ? "В справочнике пока никого." : "Организаций пока нет." }),
124
- M.map((e) => /* @__PURE__ */ i(
124
+ g === "empty" && /* @__PURE__ */ i("p", { className: t.empty, "data-cy": "meeting-objects-empty", children: $ ? r("meeting.directory.emptyFound", { query: o.trim() }) : r(n === "PERSON" ? "meeting.directory.emptyPerson" : "meeting.directory.emptyOrganization") }),
125
+ T.map((e) => /* @__PURE__ */ c(
125
126
  "button",
126
127
  {
127
128
  type: "button",
128
129
  "aria-pressed": l === e.id,
129
130
  className: l === e.id ? `${t.directoryItem} ${t.directoryItemActive}` : t.directoryItem,
130
- onClick: () => o(l === e.id ? null : e.id),
131
+ onClick: () => m(l === e.id ? null : e.id),
131
132
  "data-cy": "meeting-object-row",
132
133
  children: [
133
- /* @__PURE__ */ i("span", { className: t.namingWho, children: [
134
- /* @__PURE__ */ a(
134
+ /* @__PURE__ */ c("span", { className: t.namingWho, children: [
135
+ /* @__PURE__ */ i(
135
136
  q,
136
137
  {
137
138
  label: e.displayName,
138
- avatarUrl: V(e, P, s)
139
+ avatarUrl: W(e, M, a)
139
140
  }
140
141
  ),
141
142
  e.displayName
142
143
  ] }),
143
- /* @__PURE__ */ a("span", { className: t.namingCount, children: r === "PERSON" ? e.appearanceCount > 0 ? `встреч: ${e.appearanceCount}` : "ещё не встречался" : e.mentionCount > 0 ? `упоминаний: ${e.mentionCount}` : "ещё не упоминалась" })
144
+ /* @__PURE__ */ i("span", { className: t.namingCount, children: n === "PERSON" ? e.appearanceCount > 0 ? r("meeting.directory.appearances", {
145
+ count: e.appearanceCount
146
+ }) : r("meeting.directory.neverAppeared") : e.mentionCount > 0 ? r("meeting.directory.mentions", {
147
+ count: e.mentionCount
148
+ }) : r("meeting.directory.neverMentioned") })
144
149
  ]
145
150
  },
146
151
  e.id
147
152
  ))
148
153
  ] }),
149
- /* @__PURE__ */ a("div", { className: t.directoryDetails, children: l ? /* @__PURE__ */ a(
150
- D,
154
+ /* @__PURE__ */ i("div", { className: t.directoryDetails, children: l ? /* @__PURE__ */ i(
155
+ F,
151
156
  {
152
- workspaceId: s,
153
- objectType: r,
157
+ workspaceId: a,
158
+ objectType: n,
154
159
  objectId: l,
155
- onChanged: m,
160
+ onChanged: d,
156
161
  onMerged: (e) => {
157
- o(e), m();
162
+ m(e), d();
158
163
  }
159
164
  },
160
165
  l
161
- ) : /* @__PURE__ */ a("p", { className: t.empty, children: "Выберите объект слева." }) })
166
+ ) : /* @__PURE__ */ i("p", { className: t.empty, children: r("meeting.directory.pickObject") }) })
162
167
  ] })
163
168
  ] });
164
169
  }
165
170
  export {
166
- k as MeetingObjectDirectory
171
+ te as MeetingObjectDirectory
167
172
  };
@@ -1 +1 @@
1
- {"version":3,"file":"MeetingObjectEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MeetingPage/MeetingObjectEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,iBAAiB,EASvB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,sDAAsD;IACtD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE,wBAAwB,2CAiV1B"}
1
+ {"version":3,"file":"MeetingObjectEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MeetingPage/MeetingObjectEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,iBAAiB,EASvB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,sDAAsD;IACtD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE,wBAAwB,2CAiW1B"}