@parallelworks/tandem-web 0.149.0 → 0.150.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.
@@ -8,21 +8,22 @@ import { DocIcon as p } from "./DocIcon.js";
8
8
  import { menuDivider as m, useOpenMenu as h } from "@parallelworks/ui";
9
9
  import { useState as g } from "react";
10
10
  import { useTranslations as _ } from "use-intl";
11
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
12
- import { MoreButton as x } from "@parallelworks/ui/list";
11
+ import { jsx as v } from "react/jsx-runtime";
12
+ import { MoreButton as y } from "@parallelworks/ui/list";
13
+ import { AppFrameNavGroup as b, AppFrameNavItem as x } from "@parallelworks/ui/app-frame";
13
14
  // src/components/FavoritesNav.tsx
14
- var S = "group flex h-8 items-center rounded-md pr-1 text-sm text-muted-foreground hover:bg-muted hover:text-foreground";
15
+ var S = (...e) => e.filter(Boolean).join(" ");
15
16
  function C(e, u, m, h) {
16
17
  switch (e.kind) {
17
18
  case "issue": return {
18
19
  href: `/${u}/issues/${e.issue?.identifier ?? ""}`,
19
20
  label: e.issue ? `${e.issue.identifier} ${e.issue.title}` : h("issue"),
20
- icon: e.issue ? /* @__PURE__ */ y(s, { category: e.issue.status.category }) : null
21
+ icon: e.issue ? /* @__PURE__ */ v(s, { category: e.issue.status.category }) : null
21
22
  };
22
23
  case "team": return {
23
24
  href: l(u, e.team?.key ?? "", "issues"),
24
25
  label: e.team?.name ?? h("team"),
25
- icon: e.team ? /* @__PURE__ */ y(f, {
26
+ icon: e.team ? /* @__PURE__ */ v(f, {
26
27
  icon: e.team.icon,
27
28
  color: e.team.color,
28
29
  name: e.team.name
@@ -31,7 +32,7 @@ function C(e, u, m, h) {
31
32
  case "doc": return {
32
33
  href: `/${u}/docs/${e.doc ? d(e.doc) : ""}`,
33
34
  label: e.doc?.title ?? h("doc"),
34
- icon: /* @__PURE__ */ y(p, {
35
+ icon: /* @__PURE__ */ v(p, {
35
36
  icon: e.doc?.icon,
36
37
  className: "size-4"
37
38
  })
@@ -39,11 +40,11 @@ function C(e, u, m, h) {
39
40
  case "project": return {
40
41
  href: `/${u}/projects/${e.plan?.ref ?? e.target}`,
41
42
  label: e.plan?.name ?? h("project"),
42
- icon: e.plan?.icon || e.plan?.color ? /* @__PURE__ */ y(f, {
43
+ icon: e.plan?.icon || e.plan?.color ? /* @__PURE__ */ v(f, {
43
44
  icon: e.plan.icon ?? "",
44
45
  color: e.plan.color ?? "",
45
46
  name: e.plan.name
46
- }) : /* @__PURE__ */ y(o, { className: "size-4" })
47
+ }) : /* @__PURE__ */ v(o, { className: "size-4" })
47
48
  };
48
49
  case "cycle": return {
49
50
  href: `${l(u, e.team?.key ?? "", "cycles")}/${e.plan?.ref ?? ""}`,
@@ -51,41 +52,41 @@ function C(e, u, m, h) {
51
52
  team: e.team?.key ?? "",
52
53
  number: e.plan.ref
53
54
  }) : h("cycle"),
54
- icon: /* @__PURE__ */ y(t, { className: "size-4" })
55
+ icon: /* @__PURE__ */ v(t, { className: "size-4" })
55
56
  };
56
57
  case "view": return {
57
58
  href: e.target,
58
59
  label: e.label || h("view"),
59
- icon: /* @__PURE__ */ y(a, { className: "size-4" })
60
+ icon: /* @__PURE__ */ v(a, { className: "size-4" })
60
61
  };
61
62
  case "page": return e.target === "decisions" ? {
62
63
  href: `/${u}/decisions`,
63
64
  label: h("decisions"),
64
- icon: /* @__PURE__ */ y(r, { className: "size-4" })
65
+ icon: /* @__PURE__ */ v(r, { className: "size-4" })
65
66
  } : e.target === "agents" ? {
66
67
  href: `/${u}/agents`,
67
68
  label: h("agents"),
68
- icon: /* @__PURE__ */ y(c, { className: "size-4" })
69
+ icon: /* @__PURE__ */ v(c, { className: "size-4" })
69
70
  } : e.target === "projects" ? {
70
71
  href: `/${u}/projects`,
71
72
  label: h("projects"),
72
- icon: /* @__PURE__ */ y(o, { className: "size-4" })
73
+ icon: /* @__PURE__ */ v(o, { className: "size-4" })
73
74
  } : e.target === "knowledge" ? {
74
75
  href: `/${u}/knowledge`,
75
76
  label: h("knowledge"),
76
- icon: /* @__PURE__ */ y(i, { className: "size-4" })
77
+ icon: /* @__PURE__ */ v(i, { className: "size-4" })
77
78
  } : e.target === "docs" ? {
78
79
  href: `/${u}/docs`,
79
80
  label: h("docs"),
80
- icon: /* @__PURE__ */ y(n, { className: "size-4" })
81
+ icon: /* @__PURE__ */ v(n, { className: "size-4" })
81
82
  } : e.target === "my-issues" ? {
82
83
  href: `/${u}/issues?assignee=${m}`,
83
84
  label: h("myIssues"),
84
- icon: /* @__PURE__ */ y(c, { className: "size-4" })
85
+ icon: /* @__PURE__ */ v(c, { className: "size-4" })
85
86
  } : {
86
87
  href: `/${u}/issues`,
87
88
  label: h("issues"),
88
- icon: /* @__PURE__ */ y(a, { className: "size-4" })
89
+ icon: /* @__PURE__ */ v(a, { className: "size-4" })
89
90
  };
90
91
  }
91
92
  }
@@ -116,15 +117,16 @@ function w({ workspace: t, myUsername: n, currentHref: r }) {
116
117
  ...a && { before: a.id }
117
118
  });
118
119
  };
119
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("p", {
120
- className: "mt-6 px-2 text-xs font-medium text-muted-foreground",
121
- children: c("title")
122
- }), /* @__PURE__ */ y("ul", {
123
- className: "mt-1 space-y-0.5",
124
- "aria-label": c("title"),
120
+ return /* @__PURE__ */ v(b, {
121
+ label: c("title"),
122
+ collapsible: !1,
125
123
  children: i.map((e) => {
126
- let i = C(e, t, n, c), a = i.href === r;
127
- return /* @__PURE__ */ y("li", {
124
+ let i = C(e, t, n, c);
125
+ return /* @__PURE__ */ v(x, {
126
+ label: i.label,
127
+ icon: i.icon,
128
+ href: i.href,
129
+ selected: i.href === r,
128
130
  draggable: !0,
129
131
  onDragStart: (t) => {
130
132
  p(e.id), t.dataTransfer.effectAllowed = "move";
@@ -139,27 +141,14 @@ function w({ workspace: t, myUsername: n, currentHref: r }) {
139
141
  onDragEnd: () => {
140
142
  p(null), T(null);
141
143
  },
142
- className: `${f === e.id ? "opacity-40" : ""} ${w === e.id && f !== e.id ? "rounded-md ring-1 ring-primary/60" : ""}`,
143
- children: /* @__PURE__ */ b("div", {
144
- className: `${S} ${a ? "bg-muted !text-foreground font-medium" : ""}`,
145
- children: [/* @__PURE__ */ b("a", {
146
- href: i.href,
147
- onClick: (e) => {
148
- e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0 || (e.preventDefault(), d({ href: i.href }));
149
- },
150
- onContextMenu: (t) => s(t, E(e, i.href)),
151
- className: "flex h-full min-w-0 flex-1 items-center gap-2.5 pl-2",
152
- children: [i.icon, /* @__PURE__ */ y("span", {
153
- className: "truncate",
154
- children: i.label
155
- })]
156
- }), /* @__PURE__ */ y(x, {
157
- items: () => E(e, i.href),
158
- label: l("moreActionsFor", { name: i.label })
159
- })]
144
+ onContextMenu: (t) => s(t, E(e, i.href)),
145
+ className: S(f === e.id && "opacity-40", w === e.id && f !== e.id && "ring-1 ring-primary/60"),
146
+ action: /* @__PURE__ */ v(y, {
147
+ items: () => E(e, i.href),
148
+ label: l("moreActionsFor", { name: i.label })
160
149
  })
161
150
  }, e.id);
162
151
  })
163
- })] });
152
+ });
164
153
  }
165
154
  export { w as FavoritesNav };
@@ -1,12 +1,12 @@
1
- import { Link as e } from "../lib/router.js";
1
+ import { usePathname as e } from "../lib/router.js";
2
2
  import { githubAccountQuery as t, meQuery as n } from "../api/queries.js";
3
3
  import { ChevronDownIcon as r, CloudIcon as i, CommentIcon as a, FolderIcon as o, HistoryIcon as s, KeyIcon as c, LinkIcon as l, ListViewIcon as u, MigrationIcon as d, NotificationIcon as f, RepositoryIcon as p, SettingsIcon as m, ShieldIcon as h, TagIcon as g, UserIcon as _, UsersIcon as v, WebhookIcon as y, WorkerIcon as b } from "./icons.js";
4
4
  import { useTranslations as x } from "use-intl";
5
5
  import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
6
6
  import { useQuery as T, useSuspenseQuery as E } from "@tanstack/react-query";
7
+ import { AppFrameNavGroup as D, AppFrameNavItem as O } from "@parallelworks/ui/app-frame";
7
8
  // src/components/SettingsNav.tsx
8
- var D = "flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", O = "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium", k = { className: O };
9
- function A() {
9
+ function k() {
10
10
  let { data: e } = E(n), r = x("settingsNav"), S = e?.mode === "platform", { data: C } = T(t);
11
11
  return [
12
12
  {
@@ -125,37 +125,29 @@ function A() {
125
125
  }
126
126
  ];
127
127
  }
128
- function j({ workspace: t }) {
129
- let n = x("settingsNav"), i = A();
130
- return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ w(e, {
131
- to: "/$workspace/issues",
132
- params: { workspace: t },
133
- className: "flex h-9 items-center gap-2 rounded-md px-2 text-sm font-semibold hover:bg-muted",
134
- children: [/* @__PURE__ */ C(r, { className: "size-4 rotate-90 text-muted-foreground" }), n("label")]
128
+ function A({ workspace: t }) {
129
+ let n = x("settingsNav"), i = k(), a = e();
130
+ return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(O, {
131
+ label: n("label"),
132
+ icon: /* @__PURE__ */ C(r, { className: "size-4 rotate-90" }),
133
+ href: `/${t}/issues`,
134
+ className: "font-semibold"
135
135
  }), /* @__PURE__ */ C("nav", {
136
136
  "aria-label": n("label"),
137
137
  className: "-mx-3 mt-2 min-h-0 flex-1 overflow-y-auto px-3",
138
- children: i.map((n) => /* @__PURE__ */ w("div", {
139
- className: "mt-4 first:mt-0",
140
- children: [/* @__PURE__ */ C("p", {
141
- className: "flex h-6 items-center px-2 text-xs font-medium text-muted-foreground",
142
- children: n.label
143
- }), /* @__PURE__ */ C("div", {
144
- className: "mt-1 space-y-0.5",
145
- children: n.items.map(({ to: n, label: r, Icon: i }) => /* @__PURE__ */ w(e, {
146
- to: n,
147
- params: { workspace: t },
148
- className: D,
149
- activeProps: k,
150
- activeOptions: { exact: !0 },
151
- children: [
152
- /* @__PURE__ */ C(i, { className: "size-4" }),
153
- " ",
154
- r
155
- ]
156
- }, n))
157
- })]
158
- }, n.label))
138
+ children: i.map((e) => /* @__PURE__ */ C(D, {
139
+ label: e.label,
140
+ collapsible: !1,
141
+ children: e.items.map(({ to: e, label: n, Icon: r }) => {
142
+ let i = e.replace("$workspace", t);
143
+ return /* @__PURE__ */ C(O, {
144
+ label: n,
145
+ icon: /* @__PURE__ */ C(r, { className: "size-4" }),
146
+ href: i,
147
+ selected: a === i
148
+ }, e);
149
+ })
150
+ }, e.label))
159
151
  })] });
160
152
  }
161
- export { j as SettingsNav, D as navItem, O as navOn, A as useSettingsPages };
153
+ export { A as SettingsNav, k as useSettingsPages };
@@ -249,6 +249,7 @@ function h() {
249
249
  }),
250
250
  displayOptions: r("list.displayOptions"),
251
251
  grouping: r("list.grouping"),
252
+ layout: r("list.layout"),
252
253
  groups: r("list.groups"),
253
254
  ordering: r("list.ordering"),
254
255
  orderDefault: r("list.orderDefault"),
package/lib/teamTree.js CHANGED
@@ -1,19 +1,5 @@
1
1
  // src/lib/teamTree.ts
2
- function e(e) {
3
- let t = new Set(e.map((e) => e.id)), n = /* @__PURE__ */ new Map();
4
- for (let r of e) {
5
- let e = r.parentId && t.has(r.parentId) ? r.parentId : "";
6
- n.set(e, [...n.get(e) ?? [], r]);
7
- }
8
- let r = [], i = (e, t) => {
9
- for (let a of n.get(e) ?? []) r.push({
10
- team: a,
11
- depth: t
12
- }), i(a.id, t + 1);
13
- };
14
- return i("", 0), r;
15
- }
16
- function t(e, t) {
2
+ function e(e, t) {
17
3
  let n = /* @__PURE__ */ new Set([t]);
18
4
  for (let t = !0; t;) {
19
5
  t = !1;
@@ -21,4 +7,4 @@ function t(e, t) {
21
7
  }
22
8
  return n;
23
9
  }
24
- export { e as teamTree, t as withSubTeams };
10
+ export { e as withSubTeams };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.149.0",
3
+ "version": "0.150.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -48,7 +48,7 @@
48
48
  "yjs": "^13.6.33"
49
49
  },
50
50
  "peerDependencies": {
51
- "@parallelworks/ui": ">=0.105.0 <1",
51
+ "@parallelworks/ui": ">=0.111.0 <1",
52
52
  "@tanstack/react-router": "^1.170.0",
53
53
  "react": "^19.3.0",
54
54
  "react-dom": "^19.3.0",
@@ -11,15 +11,15 @@ import { usePeople as g } from "../../../../lib/people.js";
11
11
  import { usePermissions as _ } from "../../../../lib/roles.js";
12
12
  import { PersonHoverCard as v } from "../../../../components/PersonHoverCard.js";
13
13
  import { FieldSettings as y } from "../../../../components/CustomFields.js";
14
- import { withSubTeams as b } from "../../../../lib/teamTree.js";
15
- import { FavoriteStar as x } from "../../../../components/FavoriteStar.js";
16
- import { IconUpload as S } from "../../../../components/IconUpload.js";
17
- import { AccessGrants as C } from "../../../../components/AccessGrants.js";
18
- import { BugRotation as w } from "../../../../components/BugRotation.js";
19
- import { IssueTemplates as T } from "../../../../components/IssueTemplates.js";
20
- import { StatusRules as E } from "../../../../components/StatusRules.js";
21
- import { TeamRepositories as D } from "../../../../components/TeamRepositories.js";
22
- import { TeamWorkflow as O } from "../../../../components/TeamWorkflow.js";
14
+ import { FavoriteStar as b } from "../../../../components/FavoriteStar.js";
15
+ import { IconUpload as x } from "../../../../components/IconUpload.js";
16
+ import { AccessGrants as S } from "../../../../components/AccessGrants.js";
17
+ import { BugRotation as C } from "../../../../components/BugRotation.js";
18
+ import { IssueTemplates as w } from "../../../../components/IssueTemplates.js";
19
+ import { StatusRules as T } from "../../../../components/StatusRules.js";
20
+ import { TeamRepositories as E } from "../../../../components/TeamRepositories.js";
21
+ import { TeamWorkflow as D } from "../../../../components/TeamWorkflow.js";
22
+ import { withSubTeams as O } from "../../../../lib/teamTree.js";
23
23
  import { Avatar as k, Button as A, Card as ee, Combobox as te, ConfirmModal as j, CopyButton as M, ErrorText as N, Input as P, PageHeader as F, Section as I, Select as L, SettingRow as R, SettingsCard as z, Switch as B, menuDivider as V, useOpenMenu as H } from "@parallelworks/ui";
24
24
  import { useState as U } from "react";
25
25
  import { useErrorMessage as W } from "@parallelworks/problem/react";
@@ -61,7 +61,7 @@ function ne() {
61
61
  /* @__PURE__ */ J("div", {
62
62
  className: "flex items-center gap-3",
63
63
  children: [
64
- /* @__PURE__ */ q(S, {
64
+ /* @__PURE__ */ q(x, {
65
65
  workspace: e,
66
66
  icon: f.icon,
67
67
  name: f.name,
@@ -83,7 +83,7 @@ function ne() {
83
83
  })
84
84
  ]
85
85
  }),
86
- /* @__PURE__ */ q(x, {
86
+ /* @__PURE__ */ q(b, {
87
87
  workspace: e,
88
88
  kind: "team",
89
89
  target: f.id
@@ -101,7 +101,7 @@ function ne() {
101
101
  teamKey: i,
102
102
  isAdmin: o.has("manage_members")
103
103
  }),
104
- /* @__PURE__ */ q(O, {
104
+ /* @__PURE__ */ q(D, {
105
105
  workspace: e,
106
106
  teamKey: i,
107
107
  isAdmin: o.has("manage_labels")
@@ -114,7 +114,7 @@ function ne() {
114
114
  id: f.id
115
115
  }
116
116
  }),
117
- /* @__PURE__ */ q(E, {
117
+ /* @__PURE__ */ q(T, {
118
118
  workspace: e,
119
119
  team: f,
120
120
  isAdmin: s
@@ -134,12 +134,12 @@ function ne() {
134
134
  team: f,
135
135
  isAdmin: s
136
136
  }),
137
- /* @__PURE__ */ q(w, {
137
+ /* @__PURE__ */ q(C, {
138
138
  workspace: e,
139
139
  teamKey: i,
140
140
  isAdmin: s
141
141
  }),
142
- /* @__PURE__ */ q(T, {
142
+ /* @__PURE__ */ q(w, {
143
143
  workspace: e,
144
144
  teamKey: i,
145
145
  isAdmin: o.has("manage_templates")
@@ -154,7 +154,7 @@ function ne() {
154
154
  team: f,
155
155
  isAdmin: s
156
156
  }),
157
- /* @__PURE__ */ q(D, {
157
+ /* @__PURE__ */ q(E, {
158
158
  workspace: e,
159
159
  team: f,
160
160
  isAdmin: s
@@ -182,7 +182,7 @@ function re({ workspace: e, team: r, teams: i, isAdmin: a }) {
182
182
  body: { parent: i }
183
183
  })),
184
184
  onSettled: () => c.invalidateQueries({ queryKey: l(e).queryKey })
185
- }), d = b(i, r.id), f = i.find((e) => e.id === r.parentId), p = i.filter((e) => e.parentId === r.id && !e.archivedAt);
185
+ }), d = O(i, r.id), f = i.find((e) => e.id === r.parentId), p = i.filter((e) => e.parentId === r.id && !e.archivedAt);
186
186
  return /* @__PURE__ */ J(z, {
187
187
  title: o("title"),
188
188
  description: o("description"),
@@ -895,7 +895,7 @@ function de({ workspace: e, teamKey: r }) {
895
895
  collapsible: !1,
896
896
  title: c("access"),
897
897
  description: c("accessDescription"),
898
- children: /* @__PURE__ */ q(C, {
898
+ children: /* @__PURE__ */ q(S, {
899
899
  workspace: e,
900
900
  resourceName: a.find((e) => e.key === r)?.name ?? r,
901
901
  access: i,