@parallelworks/tandem-web 0.175.2 → 0.175.3
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.
- package/_virtual/_virtual_i18n/en/common.js +3 -1
- package/_virtual/_virtual_i18n/es/common.js +3 -1
- package/_virtual/_virtual_i18n/ja/common.js +3 -1
- package/_virtual/_virtual_i18n/ko/common.js +3 -1
- package/_virtual/_virtual_i18n/zh/common.js +3 -1
- package/components/DocTable.js +30 -19
- package/components/DocsTree.js +198 -224
- package/package.json +1 -1
- package/routes/_workspace/docs/space2._space.js +134 -115
- package/routes/_workspace2.js +310 -314
package/package.json
CHANGED
|
@@ -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 {
|
|
4
|
-
import { docPropertiesQuery as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
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
|
|
17
|
-
let
|
|
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:
|
|
21
|
+
workspace: x,
|
|
22
|
+
space: j
|
|
22
23
|
},
|
|
23
24
|
search: e ? { view: e } : {}
|
|
24
|
-
}), { data:
|
|
25
|
-
|
|
26
|
-
let { data:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
let
|
|
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:
|
|
34
|
+
label: p("docTitle")
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
37
|
value: "updated",
|
|
37
|
-
label:
|
|
38
|
+
label: p("updated")
|
|
38
39
|
},
|
|
39
|
-
...
|
|
40
|
+
...B.map((e) => ({
|
|
40
41
|
value: e.id,
|
|
41
42
|
label: e.name
|
|
42
43
|
}))
|
|
43
|
-
],
|
|
44
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
51
|
+
/* @__PURE__ */ D(ee, {
|
|
51
52
|
crumbs: [{
|
|
52
|
-
label:
|
|
53
|
-
href: `/${
|
|
54
|
-
}, { label:
|
|
53
|
+
label: p("docs"),
|
|
54
|
+
href: `/${x}/docs`
|
|
55
|
+
}, { label: z }],
|
|
55
56
|
className: "min-w-0 flex-1"
|
|
56
57
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
value:
|
|
58
|
+
/* @__PURE__ */ D(b, {
|
|
59
|
+
value: P ?? "",
|
|
59
60
|
items: [{
|
|
60
61
|
value: "",
|
|
61
|
-
label:
|
|
62
|
-
}, ...
|
|
62
|
+
label: p("unsaved")
|
|
63
|
+
}, ...V.map((e) => ({
|
|
63
64
|
value: e.id,
|
|
64
65
|
label: e.name
|
|
65
66
|
}))],
|
|
66
|
-
onValueChange: (e) =>
|
|
67
|
-
"aria-label":
|
|
67
|
+
onValueChange: (e) => I(e || void 0),
|
|
68
|
+
"aria-label": p("savedViews"),
|
|
68
69
|
size: "sm",
|
|
69
70
|
width: "content"
|
|
70
71
|
}),
|
|
71
|
-
|
|
72
|
+
U ? /* @__PURE__ */ D(h, {
|
|
72
73
|
size: "sm",
|
|
73
|
-
loading:
|
|
74
|
-
onClick: () =>
|
|
75
|
-
id:
|
|
76
|
-
layout:
|
|
77
|
-
config: { ...
|
|
74
|
+
loading: H.updateView.isPending,
|
|
75
|
+
onClick: () => H.updateView.mutate({
|
|
76
|
+
id: U.id,
|
|
77
|
+
layout: W,
|
|
78
|
+
config: { ...K }
|
|
78
79
|
}),
|
|
79
|
-
children:
|
|
80
|
-
}) : /* @__PURE__ */
|
|
80
|
+
children: p("update")
|
|
81
|
+
}) : /* @__PURE__ */ D(N, {
|
|
81
82
|
onSave: async (e) => {
|
|
82
|
-
let t = await
|
|
83
|
-
space:
|
|
83
|
+
let t = await H.saveView.mutateAsync({
|
|
84
|
+
space: j,
|
|
84
85
|
name: e,
|
|
85
|
-
layout:
|
|
86
|
-
config: { ...
|
|
86
|
+
layout: W,
|
|
87
|
+
config: { ...K }
|
|
87
88
|
});
|
|
88
|
-
|
|
89
|
+
I(t.id);
|
|
89
90
|
},
|
|
90
|
-
pending:
|
|
91
|
+
pending: H.saveView.isPending
|
|
91
92
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
|
|
93
|
+
/* @__PURE__ */ D(h, {
|
|
94
|
+
variant: "primary",
|
|
94
95
|
size: "sm",
|
|
95
|
-
|
|
96
|
-
|
|
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:
|
|
100
|
-
icon: /* @__PURE__ */
|
|
108
|
+
label: p("table"),
|
|
109
|
+
icon: /* @__PURE__ */ D(o, {})
|
|
101
110
|
}, {
|
|
102
111
|
value: "board",
|
|
103
|
-
label:
|
|
104
|
-
icon: /* @__PURE__ */
|
|
112
|
+
label: p("board"),
|
|
113
|
+
icon: /* @__PURE__ */ D(a, {})
|
|
105
114
|
}]
|
|
106
115
|
})
|
|
107
116
|
]
|
|
108
117
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
113
|
-
|
|
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:
|
|
117
|
-
}, ...
|
|
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) =>
|
|
122
|
-
...
|
|
139
|
+
onValueChange: (e) => Q({
|
|
140
|
+
...K,
|
|
123
141
|
...e ? { groupBy: e } : { groupBy: void 0 }
|
|
124
142
|
}),
|
|
125
|
-
"aria-label":
|
|
143
|
+
"aria-label": p("groupBy"),
|
|
126
144
|
size: "sm",
|
|
127
145
|
width: "content"
|
|
128
|
-
}) : /* @__PURE__ */
|
|
146
|
+
}) : /* @__PURE__ */ D(b, {
|
|
129
147
|
multiple: !0,
|
|
130
|
-
value:
|
|
131
|
-
items:
|
|
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) =>
|
|
136
|
-
...
|
|
153
|
+
onValueChange: (e) => Q({
|
|
154
|
+
...K,
|
|
137
155
|
columns: e
|
|
138
156
|
}),
|
|
139
|
-
"aria-label":
|
|
140
|
-
placeholder:
|
|
157
|
+
"aria-label": p("columns"),
|
|
158
|
+
placeholder: p("columns"),
|
|
141
159
|
size: "sm",
|
|
142
160
|
width: "content"
|
|
143
161
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
value:
|
|
146
|
-
items:
|
|
147
|
-
onValueChange: (e) =>
|
|
148
|
-
...
|
|
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":
|
|
169
|
+
"aria-label": p("sortBy"),
|
|
152
170
|
size: "sm",
|
|
153
171
|
width: "content"
|
|
154
172
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ D(h, {
|
|
156
174
|
size: "xs",
|
|
157
175
|
variant: "ghost",
|
|
158
|
-
onClick: () =>
|
|
159
|
-
...
|
|
160
|
-
desc: !
|
|
176
|
+
onClick: () => Q({
|
|
177
|
+
...K,
|
|
178
|
+
desc: !K.desc
|
|
161
179
|
}),
|
|
162
|
-
children:
|
|
180
|
+
children: K.desc ? p("descending") : p("ascending")
|
|
163
181
|
}),
|
|
164
|
-
|
|
165
|
-
workspace:
|
|
182
|
+
B.map((e) => /* @__PURE__ */ D(M, {
|
|
183
|
+
workspace: x,
|
|
166
184
|
property: e,
|
|
167
|
-
value:
|
|
185
|
+
value: K.filters?.[e.id] ?? "",
|
|
168
186
|
onChange: (t) => {
|
|
169
|
-
let n = { ...
|
|
170
|
-
t ? n[e.id] = t : delete n[e.id],
|
|
171
|
-
...
|
|
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
|
-
|
|
194
|
+
$ && /* @__PURE__ */ D(g, {
|
|
177
195
|
inline: !0,
|
|
178
|
-
children:
|
|
196
|
+
children: v($)
|
|
179
197
|
})
|
|
180
198
|
]
|
|
181
199
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ D("div", {
|
|
183
201
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
-
workspace:
|
|
186
|
-
space:
|
|
187
|
-
layout:
|
|
188
|
-
config:
|
|
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
|
|
195
|
-
let i =
|
|
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__ */
|
|
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
|
|
218
|
-
let n =
|
|
219
|
-
return /* @__PURE__ */
|
|
220
|
-
trigger: /* @__PURE__ */
|
|
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__ */
|
|
247
|
+
children: /* @__PURE__ */ D(P, {
|
|
229
248
|
onSave: e,
|
|
230
249
|
pending: t
|
|
231
250
|
})
|
|
232
251
|
});
|
|
233
252
|
}
|
|
234
|
-
function
|
|
235
|
-
let n =
|
|
236
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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 {
|
|
275
|
+
export { j as component };
|