@parallelworks/tandem-web 0.175.2 → 0.175.4

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.
@@ -114,18 +114,17 @@ function O({ workspace: O, identifier: k, title: A }) {
114
114
  className: "size-3.5 text-muted-foreground"
115
115
  }),
116
116
  /* @__PURE__ */ y("span", {
117
- className: "min-w-0 flex-1 truncate",
118
- children: [
119
- e.title,
120
- " ",
121
- /* @__PURE__ */ v("span", {
122
- className: "text-muted-foreground",
123
- children: j("pullRequestRef", {
124
- repository: e.repository,
125
- number: D(e)
126
- })
117
+ className: "flex min-w-0 flex-1 items-baseline gap-1",
118
+ children: [/* @__PURE__ */ v("span", {
119
+ className: "min-w-0 truncate",
120
+ children: e.title
121
+ }), /* @__PURE__ */ v("span", {
122
+ className: "shrink-0 text-muted-foreground",
123
+ children: j("pullRequestRef", {
124
+ repository: e.repository,
125
+ number: D(e)
127
126
  })
128
- ]
127
+ })]
129
128
  }),
130
129
  /* @__PURE__ */ y("span", {
131
130
  className: "flex items-center gap-3 text-xs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.175.2",
3
+ "version": "0.175.4",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -250,7 +250,7 @@ function V() {
250
250
  }), /* @__PURE__ */ R("div", {
251
251
  className: "flex w-full gap-10 px-4 pt-6 md:px-8 md:pt-8",
252
252
  children: [/* @__PURE__ */ R("article", {
253
- className: `group/doc min-w-0 flex-1 pb-24 ${d.fullWidth ? "" : "mx-auto max-w-3xl"}`,
253
+ className: `group/doc min-w-0 flex-1 pb-24 ${d.fullWidth ? "" : "mx-auto max-w-reading"}`,
254
254
  children: [
255
255
  $ && /* @__PURE__ */ R("div", {
256
256
  className: "mb-6 flex items-center gap-3 rounded-md border border-border bg-muted px-3 py-2 text-sm",
@@ -1,198 +1,217 @@
1
1
  import { teamsQuery as e, workspaceQuery as t } from "../../../api/queries.js";
2
2
  import { DocTable as n, groupable as r } from "../../../components/DocTable.js";
3
- import { BoardIcon as i, ListViewIcon as a } from "../../../components/icons.js";
4
- import { docPropertiesQuery as o, docViewsQuery as s, readConfig as c, useDocPropertyActions as l } from "../../../lib/docProperties.js";
5
- import { usePageTitle as u } from "../../../lib/pageTitle.js";
6
- import { usePeople as d } from "../../../lib/people.js";
7
- import { Route as f } from "./space._space.js";
8
- import { Breadcrumbs as p, Button as m, ErrorText as h, Input as g, Popover as _, SegmentedControl as v, Select as y, useClosePopover as b } from "@parallelworks/ui";
9
- import { useNavigate as x } from "@tanstack/react-router";
10
- import { useEffect as S, useState as C } from "react";
11
- import { useErrorMessage as w } from "@parallelworks/problem/react";
12
- import { useTranslations as T } from "use-intl";
13
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
14
- import { useQuery as O, useSuspenseQuery as k } from "@tanstack/react-query";
3
+ import { AddIcon as i, BoardIcon as a, ListViewIcon as o } from "../../../components/icons.js";
4
+ import { docPropertiesQuery as s, docViewsQuery as c, readConfig as l, useDocPropertyActions as u } from "../../../lib/docProperties.js";
5
+ import { useDocActions as d } from "../../../lib/docs.js";
6
+ import { usePageTitle as f } from "../../../lib/pageTitle.js";
7
+ import { usePeople as p } from "../../../lib/people.js";
8
+ import { Route as m } from "./space._space.js";
9
+ import { Breadcrumbs as ee, Button as h, ErrorText as g, Input as _, Popover as v, SegmentedControl as y, Select as b, useClosePopover as x } from "@parallelworks/ui";
10
+ import { useNavigate as S } from "@tanstack/react-router";
11
+ import { useEffect as C, useState as w } from "react";
12
+ import { useErrorMessage as T } from "@parallelworks/problem/react";
13
+ import { useTranslations as E } from "use-intl";
14
+ import { jsx as D, jsxs as O } from "react/jsx-runtime";
15
+ import { useQuery as k, useSuspenseQuery as A } from "@tanstack/react-query";
15
16
  // src/routes/$workspace/docs/space.$space.tsx?tsr-split=component
16
- function A() {
17
- let d = T("docViews"), g = w(), { workspace: _, space: b } = f.useParams(), { view: A } = f.useSearch(), N = x(), P = (e) => N({
17
+ function j() {
18
+ let p = E("docViews"), v = T(), { workspace: x, space: j } = m.useParams(), { view: P } = m.useSearch(), F = S(), I = (e) => F({
18
19
  to: "/$workspace/docs/space/$space",
19
20
  params: {
20
- workspace: _,
21
- space: b
21
+ workspace: x,
22
+ space: j
22
23
  },
23
24
  search: e ? { view: e } : {}
24
- }), { data: F } = k(e(_)), { data: I } = k(t(_)), L = b === "workspace" ? I.name : F.find((e) => e.key === b)?.name ?? b;
25
- u(d("title"), L);
26
- let { data: R = [] } = O(o(_, b)), { data: z = [] } = O(s(_, b)), B = l(_), V = z.find((e) => e.id === A), [H, U] = C("table"), [W, G] = C({});
27
- S(() => {
28
- V && (U(V.layout), G(c(V.config)));
29
- }, [V]);
30
- let K = (e) => G(e), q = [
25
+ }), { data: L } = A(e(x)), { data: R } = A(t(x)), z = j === "workspace" ? R.name : L.find((e) => e.key === j)?.name ?? j;
26
+ f(p("title"), z);
27
+ let { data: B = [] } = k(s(x, j)), { data: V = [] } = k(c(x, j)), H = u(x), U = V.find((e) => e.id === P), [W, G] = w("table"), [K, q] = w({}), [J, Y] = w(""), X = E("docs"), Z = d(x);
28
+ C(() => {
29
+ U && (G(U.layout), q(l(U.config)));
30
+ }, [U]);
31
+ let Q = (e) => q(e), te = [
31
32
  {
32
33
  value: "title",
33
- label: d("docTitle")
34
+ label: p("docTitle")
34
35
  },
35
36
  {
36
37
  value: "updated",
37
- label: d("updated")
38
+ label: p("updated")
38
39
  },
39
- ...R.map((e) => ({
40
+ ...B.map((e) => ({
40
41
  value: e.id,
41
42
  label: e.name
42
43
  }))
43
- ], J = B.saveView.error ?? B.updateView.error;
44
- return /* @__PURE__ */ D("div", {
44
+ ], $ = H.saveView.error ?? H.updateView.error;
45
+ return /* @__PURE__ */ O("div", {
45
46
  className: "flex h-full flex-col",
46
47
  children: [
47
- /* @__PURE__ */ D("header", {
48
+ /* @__PURE__ */ O("header", {
48
49
  className: "flex min-h-12 shrink-0 flex-wrap items-center gap-2 border-b border-border px-4 py-2 md:px-5",
49
50
  children: [
50
- /* @__PURE__ */ E(p, {
51
+ /* @__PURE__ */ D(ee, {
51
52
  crumbs: [{
52
- label: d("docs"),
53
- href: `/${_}/docs`
54
- }, { label: L }],
53
+ label: p("docs"),
54
+ href: `/${x}/docs`
55
+ }, { label: z }],
55
56
  className: "min-w-0 flex-1"
56
57
  }),
57
- /* @__PURE__ */ E(y, {
58
- value: A ?? "",
58
+ /* @__PURE__ */ D(b, {
59
+ value: P ?? "",
59
60
  items: [{
60
61
  value: "",
61
- label: d("unsaved")
62
- }, ...z.map((e) => ({
62
+ label: p("unsaved")
63
+ }, ...V.map((e) => ({
63
64
  value: e.id,
64
65
  label: e.name
65
66
  }))],
66
- onValueChange: (e) => P(e || void 0),
67
- "aria-label": d("savedViews"),
67
+ onValueChange: (e) => I(e || void 0),
68
+ "aria-label": p("savedViews"),
68
69
  size: "sm",
69
70
  width: "content"
70
71
  }),
71
- V ? /* @__PURE__ */ E(m, {
72
+ U ? /* @__PURE__ */ D(h, {
72
73
  size: "sm",
73
- loading: B.updateView.isPending,
74
- onClick: () => B.updateView.mutate({
75
- id: V.id,
76
- layout: H,
77
- config: { ...W }
74
+ loading: H.updateView.isPending,
75
+ onClick: () => H.updateView.mutate({
76
+ id: U.id,
77
+ layout: W,
78
+ config: { ...K }
78
79
  }),
79
- children: d("update")
80
- }) : /* @__PURE__ */ E(M, {
80
+ children: p("update")
81
+ }) : /* @__PURE__ */ D(N, {
81
82
  onSave: async (e) => {
82
- let t = await B.saveView.mutateAsync({
83
- space: b,
83
+ let t = await H.saveView.mutateAsync({
84
+ space: j,
84
85
  name: e,
85
- layout: H,
86
- config: { ...W }
86
+ layout: W,
87
+ config: { ...K }
87
88
  });
88
- P(t.id);
89
+ I(t.id);
89
90
  },
90
- pending: B.saveView.isPending
91
+ pending: H.saveView.isPending
91
92
  }),
92
- /* @__PURE__ */ E(v, {
93
- label: d("layout"),
93
+ /* @__PURE__ */ D(h, {
94
+ variant: "primary",
94
95
  size: "sm",
95
- value: H,
96
- onValueChange: U,
96
+ icon: /* @__PURE__ */ D(i, {}),
97
+ loading: Z.create.isPending,
98
+ onClick: () => Z.create.mutate(j === "workspace" ? {} : { team: j }),
99
+ children: X("new")
100
+ }),
101
+ /* @__PURE__ */ D(y, {
102
+ label: p("layout"),
103
+ size: "sm",
104
+ value: W,
105
+ onValueChange: G,
97
106
  options: [{
98
107
  value: "table",
99
- label: d("table"),
100
- icon: /* @__PURE__ */ E(a, {})
108
+ label: p("table"),
109
+ icon: /* @__PURE__ */ D(o, {})
101
110
  }, {
102
111
  value: "board",
103
- label: d("board"),
104
- icon: /* @__PURE__ */ E(i, {})
112
+ label: p("board"),
113
+ icon: /* @__PURE__ */ D(a, {})
105
114
  }]
106
115
  })
107
116
  ]
108
117
  }),
109
- /* @__PURE__ */ D("div", {
118
+ /* @__PURE__ */ O("div", {
110
119
  className: "flex flex-wrap items-center gap-2 border-b border-border px-4 py-2 text-xs md:px-5",
111
120
  children: [
112
- H === "board" ? /* @__PURE__ */ E(y, {
113
- value: W.groupBy ?? "",
121
+ /* @__PURE__ */ D(_, {
122
+ type: "search",
123
+ size: "sm",
124
+ value: J,
125
+ onChange: (e) => Y(e.target.value),
126
+ placeholder: X("search"),
127
+ "aria-label": X("search"),
128
+ className: "w-48"
129
+ }),
130
+ W === "board" ? /* @__PURE__ */ D(b, {
131
+ value: K.groupBy ?? "",
114
132
  items: [{
115
133
  value: "",
116
- label: d("groupBy")
117
- }, ...R.filter(r).map((e) => ({
134
+ label: p("groupBy")
135
+ }, ...B.filter(r).map((e) => ({
118
136
  value: e.id,
119
137
  label: e.name
120
138
  }))],
121
- onValueChange: (e) => K({
122
- ...W,
139
+ onValueChange: (e) => Q({
140
+ ...K,
123
141
  ...e ? { groupBy: e } : { groupBy: void 0 }
124
142
  }),
125
- "aria-label": d("groupBy"),
143
+ "aria-label": p("groupBy"),
126
144
  size: "sm",
127
145
  width: "content"
128
- }) : /* @__PURE__ */ E(y, {
146
+ }) : /* @__PURE__ */ D(b, {
129
147
  multiple: !0,
130
- value: W.columns ?? R.map((e) => e.id),
131
- items: R.map((e) => ({
148
+ value: K.columns ?? B.map((e) => e.id),
149
+ items: B.map((e) => ({
132
150
  value: e.id,
133
151
  label: e.name
134
152
  })),
135
- onValueChange: (e) => K({
136
- ...W,
153
+ onValueChange: (e) => Q({
154
+ ...K,
137
155
  columns: e
138
156
  }),
139
- "aria-label": d("columns"),
140
- placeholder: d("columns"),
157
+ "aria-label": p("columns"),
158
+ placeholder: p("columns"),
141
159
  size: "sm",
142
160
  width: "content"
143
161
  }),
144
- /* @__PURE__ */ E(y, {
145
- value: W.sort ?? "title",
146
- items: q,
147
- onValueChange: (e) => K({
148
- ...W,
162
+ /* @__PURE__ */ D(b, {
163
+ value: K.sort ?? "title",
164
+ items: te,
165
+ onValueChange: (e) => Q({
166
+ ...K,
149
167
  sort: e
150
168
  }),
151
- "aria-label": d("sortBy"),
169
+ "aria-label": p("sortBy"),
152
170
  size: "sm",
153
171
  width: "content"
154
172
  }),
155
- /* @__PURE__ */ E(m, {
173
+ /* @__PURE__ */ D(h, {
156
174
  size: "xs",
157
175
  variant: "ghost",
158
- onClick: () => K({
159
- ...W,
160
- desc: !W.desc
176
+ onClick: () => Q({
177
+ ...K,
178
+ desc: !K.desc
161
179
  }),
162
- children: W.desc ? d("descending") : d("ascending")
180
+ children: K.desc ? p("descending") : p("ascending")
163
181
  }),
164
- R.map((e) => /* @__PURE__ */ E(j, {
165
- workspace: _,
182
+ B.map((e) => /* @__PURE__ */ D(M, {
183
+ workspace: x,
166
184
  property: e,
167
- value: W.filters?.[e.id] ?? "",
185
+ value: K.filters?.[e.id] ?? "",
168
186
  onChange: (t) => {
169
- let n = { ...W.filters };
170
- t ? n[e.id] = t : delete n[e.id], K({
171
- ...W,
187
+ let n = { ...K.filters };
188
+ t ? n[e.id] = t : delete n[e.id], Q({
189
+ ...K,
172
190
  filters: n
173
191
  });
174
192
  }
175
193
  }, e.id)),
176
- J && /* @__PURE__ */ E(h, {
194
+ $ && /* @__PURE__ */ D(g, {
177
195
  inline: !0,
178
- children: g(J)
196
+ children: v($)
179
197
  })
180
198
  ]
181
199
  }),
182
- /* @__PURE__ */ E("div", {
200
+ /* @__PURE__ */ D("div", {
183
201
  className: "min-h-0 flex-1 overflow-y-auto",
184
- children: /* @__PURE__ */ E(n, {
185
- workspace: _,
186
- space: b,
187
- layout: H,
188
- config: W
202
+ children: /* @__PURE__ */ D(n, {
203
+ workspace: x,
204
+ space: j,
205
+ layout: W,
206
+ config: K,
207
+ query: J
189
208
  })
190
209
  })
191
210
  ]
192
211
  });
193
212
  }
194
- function j({ workspace: e, property: t, value: n, onChange: r }) {
195
- let i = T("docViews"), { members: a } = d(e), o = t.kind === "select" || t.kind === "multi_select" ? t.options.map((e) => ({
213
+ function M({ workspace: e, property: t, value: n, onChange: r }) {
214
+ let i = E("docViews"), { members: a } = p(e), o = t.kind === "select" || t.kind === "multi_select" ? t.options.map((e) => ({
196
215
  value: e.id ?? "",
197
216
  label: e.name
198
217
  })) : t.kind === "person" ? a.map((e) => ({
@@ -202,7 +221,7 @@ function j({ workspace: e, property: t, value: n, onChange: r }) {
202
221
  value: "true",
203
222
  label: i("checked")
204
223
  }] : null;
205
- return o ? /* @__PURE__ */ E(y, {
224
+ return o ? /* @__PURE__ */ D(b, {
206
225
  value: n,
207
226
  items: [{
208
227
  value: "",
@@ -214,10 +233,10 @@ function j({ workspace: e, property: t, value: n, onChange: r }) {
214
233
  width: "content"
215
234
  }) : null;
216
235
  }
217
- function M({ onSave: e, pending: t }) {
218
- let n = T("docViews");
219
- return /* @__PURE__ */ E(_, {
220
- trigger: /* @__PURE__ */ E(m, {
236
+ function N({ onSave: e, pending: t }) {
237
+ let n = E("docViews");
238
+ return /* @__PURE__ */ D(v, {
239
+ trigger: /* @__PURE__ */ D(h, {
221
240
  size: "sm",
222
241
  children: n("save")
223
242
  }),
@@ -225,25 +244,25 @@ function M({ onSave: e, pending: t }) {
225
244
  className: "w-64",
226
245
  initialFocus: "first-control",
227
246
  "aria-label": n("save"),
228
- children: /* @__PURE__ */ E(N, {
247
+ children: /* @__PURE__ */ D(P, {
229
248
  onSave: e,
230
249
  pending: t
231
250
  })
232
251
  });
233
252
  }
234
- function N({ onSave: e, pending: t }) {
235
- let n = T("docViews"), r = b(), [i, a] = C("");
236
- return /* @__PURE__ */ D("form", {
253
+ function P({ onSave: e, pending: t }) {
254
+ let n = E("docViews"), r = x(), [i, a] = w("");
255
+ return /* @__PURE__ */ O("form", {
237
256
  className: "space-y-2",
238
257
  onSubmit: (t) => {
239
258
  t.preventDefault(), i.trim() && (e(i.trim()), r());
240
259
  },
241
- children: [/* @__PURE__ */ E(g, {
260
+ children: [/* @__PURE__ */ D(_, {
242
261
  value: i,
243
262
  onChange: (e) => a(e.target.value),
244
263
  placeholder: n("viewName"),
245
264
  "aria-label": n("viewName")
246
- }), /* @__PURE__ */ E(m, {
265
+ }), /* @__PURE__ */ D(h, {
247
266
  type: "submit",
248
267
  size: "sm",
249
268
  variant: "primary",
@@ -253,4 +272,4 @@ function N({ onSave: e, pending: t }) {
253
272
  })]
254
273
  });
255
274
  }
256
- export { A as component };
275
+ export { j as component };
@@ -222,9 +222,9 @@ function Ft() {
222
222
  /* @__PURE__ */ J("div", {
223
223
  className: "flex min-h-0 flex-1 flex-col overflow-y-auto md:flex-row md:overflow-hidden",
224
224
  children: [/* @__PURE__ */ q("div", {
225
- className: "min-w-0 md:flex-1 md:overflow-y-auto",
225
+ className: "min-w-0 px-4 md:flex-1 md:overflow-y-auto md:px-8",
226
226
  children: /* @__PURE__ */ J("article", {
227
- className: "w-full px-4 pt-6 pb-24 md:px-8 md:pt-8",
227
+ className: "mx-auto w-full max-w-reading pt-6 pb-24 md:pt-8",
228
228
  children: [
229
229
  /* @__PURE__ */ J(Qt.Provider, {
230
230
  value: y,