@parallelworks/tandem-web 0.192.2 → 0.193.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 +15 -3
- package/_virtual/_virtual_i18n/es/common.js +15 -3
- package/_virtual/_virtual_i18n/ja/common.js +15 -3
- package/_virtual/_virtual_i18n/ko/common.js +15 -3
- package/_virtual/_virtual_i18n/zh/common.js +15 -3
- package/components/DocIconPicker.js +17 -8
- package/components/DocLook.js +93 -68
- package/components/DocTable.js +67 -66
- package/components/DocsTree.js +182 -182
- package/components/IssueImport.js +95 -46
- package/components/IssueView.js +397 -397
- package/components/SubPages.js +60 -57
- package/components/SubpageViews.js +379 -365
- package/lib/docs.js +203 -133
- package/lib/menus.js +15 -1
- package/package.json +1 -1
- package/pages/issues.js +421 -455
- package/routes/_workspace/docs/_doc2.js +227 -227
- package/routes/_workspace/teams/_key/settings2.js +202 -196
- package/routes/_workspace2.js +157 -155
package/components/DocTable.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { docsQuery as e } from "../api/queries.js";
|
|
2
2
|
import { docPropertiesQuery as t, spaceScope as n, useDocPropertyActions as r, usedProperties as i } from "../lib/docProperties.js";
|
|
3
|
-
import { docRef as a,
|
|
4
|
-
import { usePeople as
|
|
5
|
-
import { useCan as
|
|
6
|
-
import { DocIcon as
|
|
7
|
-
import { usePropertyText as
|
|
8
|
-
import { cx as
|
|
3
|
+
import { docRef as a, useDocContextMenu as o, useDocMenu as s } from "../lib/docs.js";
|
|
4
|
+
import { usePeople as c } from "../lib/people.js";
|
|
5
|
+
import { useCan as l } from "../lib/roles.js";
|
|
6
|
+
import { DocIcon as u } from "./DocIcon.js";
|
|
7
|
+
import { usePropertyText as d } from "./DocProperties.js";
|
|
8
|
+
import { cx as f } from "@parallelworks/ui";
|
|
9
9
|
import { Link as p } from "@tanstack/react-router";
|
|
10
10
|
import { useState as m } from "react";
|
|
11
11
|
import { useFormatter as h, useTranslations as g } from "use-intl";
|
|
12
12
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
13
|
import { keepPreviousData as y, useQuery as b } from "@tanstack/react-query";
|
|
14
|
-
import { MoreButton as x
|
|
14
|
+
import { MoreButton as x } from "@parallelworks/ui/list";
|
|
15
15
|
// src/components/DocTable.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
16
|
+
var S = (e) => e.kind === "select" || e.kind === "person";
|
|
17
|
+
function C(n, r, a, o = !1) {
|
|
18
18
|
let s = Object.entries(a.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: c = [], isPending: l } = b({
|
|
19
19
|
...e(n, {
|
|
20
20
|
...r === "workspace" ? { workspace: !0 } : { team: r },
|
|
@@ -22,7 +22,7 @@ function w(n, r, a, o = !1) {
|
|
|
22
22
|
...o && { top: !0 }
|
|
23
23
|
}),
|
|
24
24
|
placeholderData: y
|
|
25
|
-
}), { data:
|
|
25
|
+
}), { data: u = [] } = b(t(n, r)), f = d(n), p = a.sort ?? "title", m = u.find((e) => e.id === p), h = (e) => {
|
|
26
26
|
if (p === "updated") return e.updatedAt;
|
|
27
27
|
if (!m) return e.title.toLowerCase();
|
|
28
28
|
let t = e.properties?.[m.id];
|
|
@@ -33,39 +33,39 @@ function w(n, r, a, o = !1) {
|
|
|
33
33
|
});
|
|
34
34
|
return {
|
|
35
35
|
docs: g,
|
|
36
|
-
props:
|
|
37
|
-
used: i(
|
|
36
|
+
props: u,
|
|
37
|
+
used: i(u, g),
|
|
38
38
|
isPending: l
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
var
|
|
42
|
-
function
|
|
43
|
-
let
|
|
41
|
+
var w = (e, t, n) => e === "table" && !t.trim() && Object.keys(n.filters ?? {}).length === 0;
|
|
42
|
+
function T({ workspace: e, space: t, layout: n, config: r, query: i = "" }) {
|
|
43
|
+
let l = g("docViews"), f = g("common"), m = g("docs"), y = h(), { actorName: b } = c(e), T = s(e), D = o(e), O = i.trim().toLowerCase(), k = w(n, i, r), { docs: A, props: j, used: M, isPending: N } = C(e, t, r, k), P = O ? A.filter((e) => e.title.toLowerCase().includes(O)) : A, F = new Map(A.map((e) => [e.id, e])), I = (e) => {
|
|
44
44
|
let t = [];
|
|
45
|
-
for (let n =
|
|
45
|
+
for (let n = F.get(e.parentId ?? ""); n && !(t.length > 20); n = F.get(n.parentId ?? "")) t.unshift(n.title);
|
|
46
46
|
return t.join(" / ");
|
|
47
|
-
},
|
|
48
|
-
if (
|
|
47
|
+
}, L = d(e), R = (e, t) => e.properties?.[t.id];
|
|
48
|
+
if (N) return /* @__PURE__ */ _("p", {
|
|
49
49
|
className: "p-4 text-sm text-muted-foreground",
|
|
50
|
-
children:
|
|
50
|
+
children: l("loading")
|
|
51
51
|
});
|
|
52
52
|
if (n === "board") {
|
|
53
|
-
let n =
|
|
54
|
-
return n ? /* @__PURE__ */ _(
|
|
53
|
+
let n = j.find((e) => e.id === r.groupBy && S(e));
|
|
54
|
+
return n ? /* @__PURE__ */ _(E, {
|
|
55
55
|
workspace: e,
|
|
56
56
|
space: t,
|
|
57
|
-
docs:
|
|
58
|
-
props:
|
|
57
|
+
docs: P,
|
|
58
|
+
props: j,
|
|
59
59
|
by: n
|
|
60
60
|
}) : /* @__PURE__ */ _("p", {
|
|
61
61
|
className: "p-4 text-sm text-muted-foreground",
|
|
62
|
-
children:
|
|
62
|
+
children: l("pickGroup")
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
let
|
|
66
|
-
return
|
|
65
|
+
let z = r.columns ? r.columns.flatMap((e) => j.filter((t) => t.id === e)) : M;
|
|
66
|
+
return P.length === 0 ? /* @__PURE__ */ _("p", {
|
|
67
67
|
className: "p-4 text-sm text-muted-foreground",
|
|
68
|
-
children:
|
|
68
|
+
children: l("none")
|
|
69
69
|
}) : /* @__PURE__ */ _("div", {
|
|
70
70
|
className: "overflow-x-auto",
|
|
71
71
|
children: /* @__PURE__ */ v("table", {
|
|
@@ -73,33 +73,33 @@ function E({ workspace: e, space: t, layout: n, config: r, query: i = "" }) {
|
|
|
73
73
|
children: [/* @__PURE__ */ _("thead", { children: /* @__PURE__ */ v("tr", { children: [
|
|
74
74
|
/* @__PURE__ */ _("th", {
|
|
75
75
|
scope: "col",
|
|
76
|
-
children:
|
|
76
|
+
children: l("docTitle")
|
|
77
77
|
}),
|
|
78
|
-
|
|
78
|
+
z.map((e) => /* @__PURE__ */ _("th", {
|
|
79
79
|
scope: "col",
|
|
80
80
|
children: e.name
|
|
81
81
|
}, e.id)),
|
|
82
82
|
/* @__PURE__ */ _("th", {
|
|
83
83
|
scope: "col",
|
|
84
|
-
children:
|
|
84
|
+
children: l("author")
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ _("th", {
|
|
87
87
|
scope: "col",
|
|
88
|
-
children:
|
|
88
|
+
children: l("updated")
|
|
89
89
|
}),
|
|
90
90
|
/* @__PURE__ */ _("th", {
|
|
91
91
|
scope: "col",
|
|
92
92
|
className: "max-md:sticky max-md:right-0 max-md:bg-card",
|
|
93
93
|
children: /* @__PURE__ */ _("span", {
|
|
94
94
|
className: "sr-only",
|
|
95
|
-
children:
|
|
95
|
+
children: f("moreActions")
|
|
96
96
|
})
|
|
97
97
|
})
|
|
98
|
-
] }) }), /* @__PURE__ */ _("tbody", { children:
|
|
99
|
-
let n =
|
|
98
|
+
] }) }), /* @__PURE__ */ _("tbody", { children: P.map((t) => {
|
|
99
|
+
let n = k ? "" : I(t);
|
|
100
100
|
return /* @__PURE__ */ v("tr", {
|
|
101
101
|
className: "group",
|
|
102
|
-
...
|
|
102
|
+
...D(t),
|
|
103
103
|
children: [
|
|
104
104
|
/* @__PURE__ */ v("td", { children: [/* @__PURE__ */ v("div", {
|
|
105
105
|
className: "flex items-center gap-2",
|
|
@@ -110,19 +110,19 @@ function E({ workspace: e, space: t, layout: n, config: r, query: i = "" }) {
|
|
|
110
110
|
doc: a(t)
|
|
111
111
|
},
|
|
112
112
|
className: "flex min-w-0 items-center gap-2 font-medium hover:underline",
|
|
113
|
-
children: [/* @__PURE__ */ _(
|
|
113
|
+
children: [/* @__PURE__ */ _(u, { icon: t.icon }), /* @__PURE__ */ _("span", {
|
|
114
114
|
className: "truncate",
|
|
115
115
|
children: t.title
|
|
116
116
|
})]
|
|
117
|
-
}),
|
|
117
|
+
}), k && (t.children ?? 0) > 0 && /* @__PURE__ */ _("span", {
|
|
118
118
|
className: "shrink-0 text-xs tabular-nums text-muted-foreground",
|
|
119
|
-
children:
|
|
119
|
+
children: l("childCount", { count: t.children ?? 0 })
|
|
120
120
|
})]
|
|
121
121
|
}), n && /* @__PURE__ */ _("span", {
|
|
122
122
|
className: "ml-6 block truncate text-xs text-muted-foreground",
|
|
123
|
-
children:
|
|
123
|
+
children: l("inParent", { parent: n })
|
|
124
124
|
})] }),
|
|
125
|
-
|
|
125
|
+
z.map((e) => /* @__PURE__ */ _("td", { children: L(e, R(t, e)) }, e.id)),
|
|
126
126
|
/* @__PURE__ */ _("td", {
|
|
127
127
|
className: "text-muted-foreground",
|
|
128
128
|
children: b(t.creator)
|
|
@@ -134,8 +134,8 @@ function E({ workspace: e, space: t, layout: n, config: r, query: i = "" }) {
|
|
|
134
134
|
/* @__PURE__ */ _("td", {
|
|
135
135
|
className: "w-0 max-md:sticky max-md:right-0 max-md:bg-card",
|
|
136
136
|
children: /* @__PURE__ */ _(x, {
|
|
137
|
-
items: () =>
|
|
138
|
-
label:
|
|
137
|
+
items: () => T(t),
|
|
138
|
+
label: f("moreActionsFor", { name: t.title || m("untitled") })
|
|
139
139
|
})
|
|
140
140
|
})
|
|
141
141
|
]
|
|
@@ -144,38 +144,38 @@ function E({ workspace: e, space: t, layout: n, config: r, query: i = "" }) {
|
|
|
144
144
|
})
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
let
|
|
147
|
+
function E({ workspace: e, space: t, docs: i, props: s, by: h }) {
|
|
148
|
+
let y = g("docViews"), b = o(e), { members: x } = c(e), S = d(e), C = l(e, "edit_docs", n(t)), w = r(e), [T, E] = m(null), [D, O] = m(null), k = [...h.kind === "select" ? h.options.map((e) => ({
|
|
149
149
|
key: e.id ?? "",
|
|
150
150
|
label: e.name
|
|
151
|
-
})) :
|
|
151
|
+
})) : x.map((e) => ({
|
|
152
152
|
key: e.user.username,
|
|
153
153
|
label: e.user.name
|
|
154
154
|
})), {
|
|
155
155
|
key: "",
|
|
156
|
-
label:
|
|
157
|
-
}],
|
|
158
|
-
let t = e.properties?.[
|
|
156
|
+
label: y("noValue", { property: h.name })
|
|
157
|
+
}], A = (e) => {
|
|
158
|
+
let t = e.properties?.[h.id];
|
|
159
159
|
return typeof t == "string" ? t : "";
|
|
160
|
-
},
|
|
160
|
+
}, j = k.filter((e) => h.kind === "select" || e.key === "" || i.some((t) => A(t) === e.key)), M = s.filter((e) => e.id !== h.id).slice(0, 2);
|
|
161
161
|
return /* @__PURE__ */ _("ul", {
|
|
162
162
|
className: "flex gap-3 overflow-x-auto p-3",
|
|
163
|
-
"aria-label":
|
|
164
|
-
children:
|
|
165
|
-
let n = i.filter((e) =>
|
|
163
|
+
"aria-label": y("board"),
|
|
164
|
+
children: j.map((t) => {
|
|
165
|
+
let n = i.filter((e) => A(e) === t.key);
|
|
166
166
|
return /* @__PURE__ */ v("li", {
|
|
167
167
|
"aria-label": t.label,
|
|
168
168
|
onDragOver: (e) => {
|
|
169
|
-
|
|
169
|
+
T && (e.preventDefault(), O(t.key));
|
|
170
170
|
},
|
|
171
|
-
onDragLeave: () =>
|
|
171
|
+
onDragLeave: () => O((e) => e === t.key ? null : e),
|
|
172
172
|
onDrop: (e) => {
|
|
173
|
-
e.preventDefault(),
|
|
174
|
-
doc:
|
|
175
|
-
values: { [
|
|
176
|
-
}),
|
|
173
|
+
e.preventDefault(), T && w.setValues.mutate({
|
|
174
|
+
doc: T,
|
|
175
|
+
values: { [h.id]: t.key || null }
|
|
176
|
+
}), E(null), O(null);
|
|
177
177
|
},
|
|
178
|
-
className:
|
|
178
|
+
className: f("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", D === t.key ? "border-primary" : "border-border"),
|
|
179
179
|
children: [/* @__PURE__ */ v("p", {
|
|
180
180
|
className: "flex items-center gap-2 px-3 py-2 text-xs font-medium",
|
|
181
181
|
children: [/* @__PURE__ */ _("span", {
|
|
@@ -188,9 +188,10 @@ function D({ workspace: e, space: t, docs: i, props: o, by: f }) {
|
|
|
188
188
|
}), /* @__PURE__ */ _("ul", {
|
|
189
189
|
className: "flex flex-col gap-2 px-2 pb-2",
|
|
190
190
|
children: n.map((t) => /* @__PURE__ */ v("li", {
|
|
191
|
-
draggable:
|
|
192
|
-
onDragStart: () =>
|
|
193
|
-
onDragEnd: () =>
|
|
191
|
+
draggable: C,
|
|
192
|
+
onDragStart: () => E(t.key),
|
|
193
|
+
onDragEnd: () => E(null),
|
|
194
|
+
...b(t),
|
|
194
195
|
className: "rounded-md border border-border bg-card p-2.5 text-sm shadow-xs",
|
|
195
196
|
children: [/* @__PURE__ */ v(p, {
|
|
196
197
|
to: "/$workspace/docs/$doc",
|
|
@@ -199,12 +200,12 @@ function D({ workspace: e, space: t, docs: i, props: o, by: f }) {
|
|
|
199
200
|
doc: a(t)
|
|
200
201
|
},
|
|
201
202
|
className: "flex items-center gap-2 font-medium hover:underline",
|
|
202
|
-
children: [/* @__PURE__ */ _(
|
|
203
|
+
children: [/* @__PURE__ */ _(u, { icon: t.icon }), /* @__PURE__ */ _("span", {
|
|
203
204
|
className: "truncate",
|
|
204
205
|
children: t.title
|
|
205
206
|
})]
|
|
206
|
-
}),
|
|
207
|
-
let n =
|
|
207
|
+
}), M.map((e) => {
|
|
208
|
+
let n = S(e, t.properties?.[e.id]);
|
|
208
209
|
return n ? /* @__PURE__ */ v("p", {
|
|
209
210
|
className: "mt-1 truncate text-xs text-muted-foreground",
|
|
210
211
|
children: [
|
|
@@ -220,4 +221,4 @@ function D({ workspace: e, space: t, docs: i, props: o, by: f }) {
|
|
|
220
221
|
})
|
|
221
222
|
});
|
|
222
223
|
}
|
|
223
|
-
export {
|
|
224
|
+
export { E as Board, T as DocTable, S as groupable, w as listsTop, C as useSpaceDocs };
|