@parallelworks/tandem-web 0.187.0 → 0.188.1

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.
@@ -585,7 +585,14 @@ var e = {
585
585
  triage: "Triage",
586
586
  graph: "What this connects to",
587
587
  measures: "Measures",
588
- teamPage: "{team} · {page}"
588
+ teamPage: "{team} · {page}",
589
+ milestone: "Milestone",
590
+ milestoneOf: "{project} · {milestone}",
591
+ dashboard: "Dashboard",
592
+ area: "Area",
593
+ term: "Term",
594
+ agent: "Agent",
595
+ person: "Person"
589
596
  },
590
597
  widgets: {
591
598
  chart: "Chart of {series}",
@@ -585,7 +585,14 @@ var e = {
585
585
  triage: "Clasificación",
586
586
  graph: "Con qué se conecta",
587
587
  measures: "Métricas",
588
- teamPage: "{team} · {page}"
588
+ teamPage: "{team} · {page}",
589
+ milestone: "Hito",
590
+ milestoneOf: "{project} · {milestone}",
591
+ dashboard: "Panel",
592
+ area: "Área",
593
+ term: "Término",
594
+ agent: "Agente",
595
+ person: "Persona"
589
596
  },
590
597
  widgets: {
591
598
  chart: "Gráfico de {series}",
@@ -585,7 +585,14 @@ var e = {
585
585
  triage: "トリアージ",
586
586
  graph: "つながり",
587
587
  measures: "指標",
588
- teamPage: "{team} · {page}"
588
+ teamPage: "{team} · {page}",
589
+ milestone: "マイルストーン",
590
+ milestoneOf: "{project} · {milestone}",
591
+ dashboard: "ダッシュボード",
592
+ area: "エリア",
593
+ term: "用語",
594
+ agent: "エージェント",
595
+ person: "メンバー"
589
596
  },
590
597
  widgets: {
591
598
  chart: "{series} のグラフ",
@@ -585,7 +585,14 @@ var e = {
585
585
  triage: "분류",
586
586
  graph: "연결된 항목",
587
587
  measures: "지표",
588
- teamPage: "{team} · {page}"
588
+ teamPage: "{team} · {page}",
589
+ milestone: "마일스톤",
590
+ milestoneOf: "{project} · {milestone}",
591
+ dashboard: "대시보드",
592
+ area: "영역",
593
+ term: "용어",
594
+ agent: "에이전트",
595
+ person: "사람"
589
596
  },
590
597
  widgets: {
591
598
  chart: "{series} 차트",
@@ -585,7 +585,14 @@ var e = {
585
585
  triage: "分拣",
586
586
  graph: "关联内容",
587
587
  measures: "指标",
588
- teamPage: "{team} · {page}"
588
+ teamPage: "{team} · {page}",
589
+ milestone: "里程碑",
590
+ milestoneOf: "{project} · {milestone}",
591
+ dashboard: "仪表板",
592
+ area: "领域",
593
+ term: "术语",
594
+ agent: "智能体",
595
+ person: "成员"
589
596
  },
590
597
  widgets: {
591
598
  chart: "{series} 图表",
@@ -1,38 +1,80 @@
1
1
  import { projectsQuery as e } from "../api/queries.js";
2
2
  import { docRef as t } from "../lib/docs.js";
3
3
  import { useFavorites as n } from "../lib/favorites.js";
4
- import { projectLevel as r } from "../lib/projects.js";
5
- import { useCan as i } from "../lib/roles.js";
6
- import { useNavigate as a } from "../lib/router.js";
7
- import { teamPath as o } from "../lib/teamPaths.js";
8
- import { DocIcon as s } from "./DocIcon.js";
9
- import { EntityIcon as c } from "./EntityIcon.js";
10
- import { AreaIcon as l, ChartIcon as u, CycleIcon as d, FileTextIcon as f, InboxIcon as p, LibraryIcon as m, ListViewIcon as h, NotificationIcon as g, ProjectIcon as _, StatusIcon as v, TriageIcon as y, UserIcon as b } from "./icons.js";
11
- import { NewProjectDialog as x } from "./NewProjectDialog.js";
12
- import { menuDivider as S, useOpenMenu as C } from "@parallelworks/ui";
13
- import { useState as w } from "react";
14
- import { useTranslations as T } from "use-intl";
15
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
16
- import { useQuery as O } from "@tanstack/react-query";
17
- import { MoreButton as k } from "@parallelworks/ui/list";
18
- import { AppFrameNavGroup as A, AppFrameNavItem as j } from "@parallelworks/ui/app-frame";
4
+ import { usePeople as r } from "../lib/people.js";
5
+ import { projectLevel as i } from "../lib/projects.js";
6
+ import { useCan as a } from "../lib/roles.js";
7
+ import { useNavigate as o } from "../lib/router.js";
8
+ import { teamPath as s } from "../lib/teamPaths.js";
9
+ import { DocIcon as c } from "./DocIcon.js";
10
+ import { EntityIcon as l } from "./EntityIcon.js";
11
+ import { AgentIcon as u, AreaIcon as d, ChartIcon as f, CycleIcon as p, FileTextIcon as m, InboxIcon as h, LibraryIcon as g, ListViewIcon as _, NotificationIcon as v, ProjectIcon as y, StatusIcon as b, TriageIcon as x, UserIcon as S } from "./icons.js";
12
+ import { NewProjectDialog as C } from "./NewProjectDialog.js";
13
+ import { Avatar as w, menuDivider as T, useOpenMenu as E } from "@parallelworks/ui";
14
+ import { useState as D } from "react";
15
+ import { useTranslations as O } from "use-intl";
16
+ import { jsx as k, jsxs as A } from "react/jsx-runtime";
17
+ import { useQuery as j } from "@tanstack/react-query";
18
+ import { MoreButton as M } from "@parallelworks/ui/list";
19
+ import { AppFrameNavGroup as N, AppFrameNavItem as P } from "@parallelworks/ui/app-frame";
19
20
  // src/components/FavoritesNav.tsx
20
- var M = (...e) => e.filter(Boolean).join(" ");
21
- function N(e, n, r, i) {
21
+ var F = (...e) => e.filter(Boolean).join(" ");
22
+ function I(e, n, r, i, a) {
22
23
  switch (e.kind) {
24
+ case "milestone": return {
25
+ href: `/${n}/projects/${e.plan?.ref ?? ""}/milestones/${e.item?.ref ?? e.target}`,
26
+ label: e.plan && e.item ? i("milestoneOf", {
27
+ project: e.plan.name,
28
+ milestone: e.item.name
29
+ }) : i("milestone"),
30
+ icon: /* @__PURE__ */ k(y, { className: "size-4" })
31
+ };
32
+ case "dashboard": return {
33
+ href: `/${n}/dashboards/${e.item?.ref ?? e.target}`,
34
+ label: e.item?.name || i("dashboard"),
35
+ icon: /* @__PURE__ */ k(f, { className: "size-4" })
36
+ };
37
+ case "area": return {
38
+ href: `/${n}/areas/${e.item?.ref ?? ""}`,
39
+ label: e.item?.name || i("area"),
40
+ icon: /* @__PURE__ */ k(d, { className: "size-4" })
41
+ };
42
+ case "term": return {
43
+ href: `/${n}/knowledge/${e.item?.ref ?? e.target}`,
44
+ label: e.item?.name || i("term"),
45
+ icon: /* @__PURE__ */ k(g, { className: "size-4" })
46
+ };
47
+ case "agent": return {
48
+ href: `/${n}/agents/${e.item?.ref ?? ""}`,
49
+ label: e.item?.name || i("agent"),
50
+ icon: /* @__PURE__ */ k(u, { className: "size-4" })
51
+ };
52
+ case "person": {
53
+ let t = a(e.target);
54
+ return {
55
+ href: `/${n}/people/${encodeURIComponent(e.target)}`,
56
+ label: t?.name ?? (e.target || i("person")),
57
+ icon: /* @__PURE__ */ k(w, {
58
+ name: t?.name ?? e.target,
59
+ src: t?.avatarUrl,
60
+ size: "xs",
61
+ decorative: !0
62
+ })
63
+ };
64
+ }
23
65
  case "issue": return {
24
66
  href: `/${n}/issues/${e.issue?.identifier ?? ""}`,
25
67
  label: e.issue ? `${e.issue.identifier} ${e.issue.title}` : i("issue"),
26
- icon: e.issue ? /* @__PURE__ */ E(v, {
68
+ icon: e.issue ? /* @__PURE__ */ k(b, {
27
69
  category: e.issue.status.category,
28
70
  review: e.issue.status.review,
29
71
  step: e.issue.status.step
30
72
  }) : null
31
73
  };
32
74
  case "team": return {
33
- href: o(n, e.team?.key ?? "", "issues"),
75
+ href: s(n, e.team?.key ?? "", "issues"),
34
76
  label: e.team?.name ?? i("team"),
35
- icon: e.team ? /* @__PURE__ */ E(c, {
77
+ icon: e.team ? /* @__PURE__ */ k(l, {
36
78
  icon: e.team.icon,
37
79
  color: e.team.color,
38
80
  name: e.team.name
@@ -41,7 +83,7 @@ function N(e, n, r, i) {
41
83
  case "doc": return {
42
84
  href: `/${n}/docs/${e.doc ? t(e.doc) : ""}`,
43
85
  label: e.doc?.title ?? i("doc"),
44
- icon: /* @__PURE__ */ E(s, {
86
+ icon: /* @__PURE__ */ k(c, {
45
87
  icon: e.doc?.icon,
46
88
  className: "size-4"
47
89
  })
@@ -49,166 +91,166 @@ function N(e, n, r, i) {
49
91
  case "project": return {
50
92
  href: `/${n}/projects/${e.plan?.ref ?? e.target}`,
51
93
  label: e.plan?.name ?? i("project"),
52
- icon: e.plan?.icon || e.plan?.color ? /* @__PURE__ */ E(c, {
94
+ icon: e.plan?.icon || e.plan?.color ? /* @__PURE__ */ k(l, {
53
95
  icon: e.plan.icon ?? "",
54
96
  color: e.plan.color ?? "",
55
97
  name: e.plan.name
56
- }) : /* @__PURE__ */ E(_, { className: "size-4" })
98
+ }) : /* @__PURE__ */ k(y, { className: "size-4" })
57
99
  };
58
100
  case "cycle": return {
59
- href: `${o(n, e.team?.key ?? "", "cycles")}/${e.plan?.ref ?? ""}`,
101
+ href: `${s(n, e.team?.key ?? "", "cycles")}/${e.plan?.ref ?? ""}`,
60
102
  label: e.plan ? e.plan.name || i("cycleOf", {
61
103
  team: e.team?.key ?? "",
62
104
  number: e.plan.ref
63
105
  }) : i("cycle"),
64
- icon: /* @__PURE__ */ E(d, { className: "size-4" })
106
+ icon: /* @__PURE__ */ k(p, { className: "size-4" })
65
107
  };
66
108
  case "view": return {
67
109
  href: e.target,
68
110
  label: e.label || i("view"),
69
- icon: /* @__PURE__ */ E(h, { className: "size-4" })
111
+ icon: /* @__PURE__ */ k(_, { className: "size-4" })
70
112
  };
71
113
  case "page": return {
72
114
  decisions: {
73
115
  href: `/${n}/decisions`,
74
116
  label: i("decisions"),
75
- icon: /* @__PURE__ */ E(p, { className: "size-4" })
117
+ icon: /* @__PURE__ */ k(h, { className: "size-4" })
76
118
  },
77
119
  agents: {
78
120
  href: `/${n}/agents`,
79
121
  label: i("agents"),
80
- icon: /* @__PURE__ */ E(b, { className: "size-4" })
122
+ icon: /* @__PURE__ */ k(S, { className: "size-4" })
81
123
  },
82
124
  projects: {
83
125
  href: `/${n}/projects`,
84
126
  label: i("projects"),
85
- icon: /* @__PURE__ */ E(_, { className: "size-4" })
127
+ icon: /* @__PURE__ */ k(y, { className: "size-4" })
86
128
  },
87
129
  knowledge: {
88
130
  href: `/${n}/knowledge`,
89
131
  label: i("knowledge"),
90
- icon: /* @__PURE__ */ E(m, { className: "size-4" })
132
+ icon: /* @__PURE__ */ k(g, { className: "size-4" })
91
133
  },
92
134
  docs: {
93
135
  href: `/${n}/docs`,
94
136
  label: i("docs"),
95
- icon: /* @__PURE__ */ E(f, { className: "size-4" })
137
+ icon: /* @__PURE__ */ k(m, { className: "size-4" })
96
138
  },
97
139
  "my-issues": {
98
140
  href: `/${n}/issues?assignee=${r}`,
99
141
  label: i("myIssues"),
100
- icon: /* @__PURE__ */ E(b, { className: "size-4" })
142
+ icon: /* @__PURE__ */ k(S, { className: "size-4" })
101
143
  },
102
144
  notifications: {
103
145
  href: `/${n}/notifications`,
104
146
  label: i("notifications"),
105
- icon: /* @__PURE__ */ E(g, { className: "size-4" })
147
+ icon: /* @__PURE__ */ k(v, { className: "size-4" })
106
148
  },
107
149
  dashboards: {
108
150
  href: `/${n}/dashboards`,
109
151
  label: i("dashboards"),
110
- icon: /* @__PURE__ */ E(u, { className: "size-4" })
152
+ icon: /* @__PURE__ */ k(f, { className: "size-4" })
111
153
  },
112
154
  areas: {
113
155
  href: `/${n}/areas`,
114
156
  label: i("areas"),
115
- icon: /* @__PURE__ */ E(l, { className: "size-4" })
157
+ icon: /* @__PURE__ */ k(d, { className: "size-4" })
116
158
  },
117
159
  triage: {
118
160
  href: `/${n}/triage`,
119
161
  label: i("triage"),
120
- icon: /* @__PURE__ */ E(y, { className: "size-4" })
162
+ icon: /* @__PURE__ */ k(x, { className: "size-4" })
121
163
  },
122
164
  graph: {
123
165
  href: `/${n}/graph`,
124
166
  label: i("graph"),
125
- icon: /* @__PURE__ */ E(m, { className: "size-4" })
167
+ icon: /* @__PURE__ */ k(g, { className: "size-4" })
126
168
  },
127
169
  measures: {
128
170
  href: `/${n}/measures`,
129
171
  label: i("measures"),
130
- icon: /* @__PURE__ */ E(h, { className: "size-4" })
172
+ icon: /* @__PURE__ */ k(_, { className: "size-4" })
131
173
  }
132
174
  }[e.target] ?? {
133
175
  href: `/${n}/issues`,
134
176
  label: i("issues"),
135
- icon: /* @__PURE__ */ E(h, { className: "size-4" })
177
+ icon: /* @__PURE__ */ k(_, { className: "size-4" })
136
178
  };
137
179
  }
138
180
  }
139
- function P({ workspace: t, myUsername: o, currentHref: s }) {
140
- let { favorites: c, remove: l, move: u } = n(t), d = C(), f = T("favorites"), p = T("common"), m = T("planning"), h = a(), [g, _] = w(null), [v, y] = w(null), [b, P] = w(null), F = i(t, "manage_projects"), { data: I = [] } = O({
181
+ function L({ workspace: t, myUsername: s, currentHref: c }) {
182
+ let { favorites: l, remove: u, move: d } = n(t), { person: f } = r(t), p = E(), m = O("favorites"), h = O("common"), g = O("planning"), _ = o(), [v, y] = D(null), [b, x] = D(null), [S, w] = D(null), L = a(t, "manage_projects"), { data: R = [] } = j({
141
183
  ...e(t),
142
- enabled: F && c.some((e) => e.kind === "project")
184
+ enabled: L && l.some((e) => e.kind === "project")
143
185
  });
144
- if (c.length === 0) return null;
145
- let L = (e) => e.kind === "project" ? I.find((t) => t.id === e.target) : void 0, R = (e) => {
146
- let t = L(e);
147
- return F && !!t && !t.template && r(I, t.id) < 5;
148
- }, z = (e, t) => [
186
+ if (l.length === 0) return null;
187
+ let z = (e) => e.kind === "project" ? R.find((t) => t.id === e.target) : void 0, B = (e) => {
188
+ let t = z(e);
189
+ return L && !!t && !t.template && i(R, t.id) < 5;
190
+ }, V = (e, t) => [
149
191
  {
150
- label: p("open"),
151
- onClick: () => h({ href: t })
192
+ label: h("open"),
193
+ onClick: () => _({ href: t })
152
194
  },
153
- ...R(e) ? [{
154
- label: m("newSubProject"),
155
- onClick: () => P(e.target)
195
+ ...B(e) ? [{
196
+ label: g("newSubProject"),
197
+ onClick: () => w(e.target)
156
198
  }] : [],
157
199
  {
158
- label: p("openInNewTab"),
200
+ label: h("openInNewTab"),
159
201
  href: t,
160
202
  target: "_blank"
161
203
  },
162
- S,
204
+ T,
163
205
  {
164
- label: f("remove"),
165
- onClick: () => l(e.id)
206
+ label: m("remove"),
207
+ onClick: () => u(e.id)
166
208
  }
167
- ], B = (e) => {
168
- if (!g || g === e) return;
169
- let t = c.filter((e) => e.id !== g), n = t.findIndex((t) => t.id === e), [r, i] = c.findIndex((e) => e.id === g) < c.findIndex((t) => t.id === e) ? [t[n], t[n + 1]] : [t[n - 1], t[n]];
170
- u({
171
- id: g,
209
+ ], H = (e) => {
210
+ if (!v || v === e) return;
211
+ let t = l.filter((e) => e.id !== v), n = t.findIndex((t) => t.id === e), [r, i] = l.findIndex((e) => e.id === v) < l.findIndex((t) => t.id === e) ? [t[n], t[n + 1]] : [t[n - 1], t[n]];
212
+ d({
213
+ id: v,
172
214
  ...r && { after: r.id },
173
215
  ...i && { before: i.id }
174
216
  });
175
217
  };
176
- return /* @__PURE__ */ D(A, {
177
- label: f("title"),
218
+ return /* @__PURE__ */ A(N, {
219
+ label: m("title"),
178
220
  collapsible: !1,
179
- children: [c.map((e) => {
180
- let n = N(e, t, o, f);
181
- return /* @__PURE__ */ E(j, {
221
+ children: [l.map((e) => {
222
+ let n = I(e, t, s, m, f);
223
+ return /* @__PURE__ */ k(P, {
182
224
  label: n.label,
183
225
  icon: n.icon,
184
226
  href: n.href,
185
- selected: n.href === s,
227
+ selected: n.href === c,
186
228
  draggable: !0,
187
229
  onDragStart: (t) => {
188
- _(e.id), t.dataTransfer.effectAllowed = "move";
230
+ y(e.id), t.dataTransfer.effectAllowed = "move";
189
231
  },
190
232
  onDragOver: (t) => {
191
- t.preventDefault(), y(e.id);
233
+ t.preventDefault(), x(e.id);
192
234
  },
193
- onDragLeave: () => y((t) => t === e.id ? null : t),
235
+ onDragLeave: () => x((t) => t === e.id ? null : t),
194
236
  onDrop: (t) => {
195
- t.preventDefault(), B(e.id), _(null), y(null);
237
+ t.preventDefault(), H(e.id), y(null), x(null);
196
238
  },
197
239
  onDragEnd: () => {
198
- _(null), y(null);
240
+ y(null), x(null);
199
241
  },
200
- onContextMenu: (t) => d(t, z(e, n.href)),
201
- className: M(g === e.id && "opacity-40", v === e.id && g !== e.id && "ring-1 ring-primary/60"),
202
- action: /* @__PURE__ */ E(k, {
203
- items: () => z(e, n.href),
204
- label: p("moreActionsFor", { name: n.label })
242
+ onContextMenu: (t) => p(t, V(e, n.href)),
243
+ className: F(v === e.id && "opacity-40", b === e.id && v !== e.id && "ring-1 ring-primary/60"),
244
+ action: /* @__PURE__ */ k(M, {
245
+ items: () => V(e, n.href),
246
+ label: h("moreActionsFor", { name: n.label })
205
247
  })
206
248
  }, e.id);
207
- }), b && /* @__PURE__ */ E(x, {
249
+ }), S && /* @__PURE__ */ k(C, {
208
250
  workspace: t,
209
- parentId: b,
210
- onClose: () => P(null)
251
+ parentId: S,
252
+ onClose: () => w(null)
211
253
  })]
212
254
  });
213
255
  }
214
- export { P as FavoritesNav };
256
+ export { L as FavoritesNav };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.187.0",
3
+ "version": "0.188.1",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",