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