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