@parallelworks/tandem-web 0.179.1 → 0.180.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 +49 -23
- package/_virtual/_virtual_i18n/es/common.js +49 -23
- package/_virtual/_virtual_i18n/ja/common.js +49 -23
- package/_virtual/_virtual_i18n/ko/common.js +49 -23
- package/_virtual/_virtual_i18n/zh/common.js +49 -23
- package/components/AgentWork.js +419 -382
- package/components/DocOutline.js +38 -35
- package/components/DocSeries.js +92 -88
- package/components/DocTable.js +100 -93
- package/components/HoverCards.js +139 -124
- package/components/SharedViewer.js +1 -0
- package/components/SubPages.js +101 -44
- package/components/SubpageViews.js +475 -0
- package/lib/docs.js +76 -65
- package/lib/glossary.js +11 -7
- package/lib/subpageViews.js +85 -0
- package/package.json +1 -1
- package/pages/decisions.js +90 -168
- package/routes/_workspace/docs/_doc2.js +279 -235
- package/routes/_workspace/docs/space2._space.js +113 -172
- package/routes/_workspace/issues/_identifier2.js +1 -1
- package/routes/_workspace/teams/_key/settings2.js +96 -24
- package/routes/_workspace2.js +9 -9
- package/styles.css +12 -0
- package/components/DocCalendar.js +0 -245
package/components/DocTable.js
CHANGED
|
@@ -3,120 +3,127 @@ import { docPropertiesQuery as t, spaceScope as n, useDocPropertyActions as r }
|
|
|
3
3
|
import { docRef as i } from "../lib/docs.js";
|
|
4
4
|
import { usePeople as a } from "../lib/people.js";
|
|
5
5
|
import { useCan as o } from "../lib/roles.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { keepPreviousData as _, useQuery as v } from "@tanstack/react-query";
|
|
6
|
+
import { DocIcon as s } from "./DocIcon.js";
|
|
7
|
+
import { usePropertyText as c } from "./DocProperties.js";
|
|
8
|
+
import { cx as l } from "@parallelworks/ui";
|
|
9
|
+
import { Link as u } from "@tanstack/react-router";
|
|
10
|
+
import { useState as d } from "react";
|
|
11
|
+
import { useFormatter as f, useTranslations as p } from "use-intl";
|
|
12
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
|
+
import { keepPreviousData as g, useQuery as _ } from "@tanstack/react-query";
|
|
15
14
|
// src/components/DocTable.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
let
|
|
15
|
+
var v = (e) => e.kind === "select" || e.kind === "person";
|
|
16
|
+
function y(n, r, i, a = !1) {
|
|
17
|
+
let o = Object.entries(i.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: s = [], isPending: l } = _({
|
|
19
18
|
...e(n, {
|
|
20
19
|
...r === "workspace" ? { workspace: !0 } : { team: r },
|
|
21
|
-
...
|
|
20
|
+
...o.length > 0 && { property: o },
|
|
21
|
+
...a && { top: !0 }
|
|
22
22
|
}),
|
|
23
|
-
placeholderData:
|
|
24
|
-
}), { data:
|
|
25
|
-
if (
|
|
26
|
-
if (!
|
|
27
|
-
let t = e.properties?.[
|
|
28
|
-
return
|
|
23
|
+
placeholderData: g
|
|
24
|
+
}), { data: u = [] } = _(t(n, r)), d = c(n), f = i.sort ?? "title", p = u.find((e) => e.id === f), m = (e) => {
|
|
25
|
+
if (f === "updated") return e.updatedAt;
|
|
26
|
+
if (!p) return e.title.toLowerCase();
|
|
27
|
+
let t = e.properties?.[p.id];
|
|
28
|
+
return p.kind === "number" ? typeof t == "number" ? t : -Infinity : d(p, t).toLowerCase();
|
|
29
29
|
};
|
|
30
30
|
return {
|
|
31
|
-
docs:
|
|
32
|
-
let n =
|
|
31
|
+
docs: s.filter((e) => !e.template).sort((e, t) => {
|
|
32
|
+
let n = m(e), r = m(t), a = n < r ? -1 : +(n > r);
|
|
33
33
|
return i.desc ? -a : a;
|
|
34
34
|
}),
|
|
35
|
-
props:
|
|
36
|
-
isPending:
|
|
35
|
+
props: u,
|
|
36
|
+
isPending: l
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
let
|
|
41
|
-
|
|
39
|
+
function b({ workspace: e, space: t, layout: n, config: r, query: o = "" }) {
|
|
40
|
+
let l = p("docViews"), d = f(), { actorName: g } = a(e), _ = o.trim().toLowerCase(), b = n === "table" && !_ && Object.keys(r.filters ?? {}).length === 0, { docs: S, props: C, isPending: w } = y(e, t, r, b), T = _ ? S.filter((e) => e.title.toLowerCase().includes(_)) : S, E = new Map(S.map((e) => [e.id, e])), D = (e) => {
|
|
41
|
+
let t = [];
|
|
42
|
+
for (let n = E.get(e.parentId ?? ""); n && !(t.length > 20); n = E.get(n.parentId ?? "")) t.unshift(n.title);
|
|
43
|
+
return t.join(" / ");
|
|
44
|
+
}, O = c(e), k = (e, t) => e.properties?.[t.id];
|
|
45
|
+
if (w) return /* @__PURE__ */ m("p", {
|
|
42
46
|
className: "p-4 text-sm text-muted-foreground",
|
|
43
|
-
children:
|
|
44
|
-
});
|
|
45
|
-
if (n === "calendar") return /* @__PURE__ */ h(s, {
|
|
46
|
-
workspace: e,
|
|
47
|
-
space: t,
|
|
48
|
-
config: r,
|
|
49
|
-
query: o
|
|
47
|
+
children: l("loading")
|
|
50
48
|
});
|
|
51
49
|
if (n === "board") {
|
|
52
|
-
let n =
|
|
53
|
-
return n ? /* @__PURE__ */
|
|
50
|
+
let n = C.find((e) => e.id === r.groupBy && v(e));
|
|
51
|
+
return n ? /* @__PURE__ */ m(x, {
|
|
54
52
|
workspace: e,
|
|
55
53
|
space: t,
|
|
56
54
|
docs: T,
|
|
57
|
-
props:
|
|
55
|
+
props: C,
|
|
58
56
|
by: n
|
|
59
|
-
}) : /* @__PURE__ */
|
|
57
|
+
}) : /* @__PURE__ */ m("p", {
|
|
60
58
|
className: "p-4 text-sm text-muted-foreground",
|
|
61
|
-
children:
|
|
59
|
+
children: l("pickGroup")
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
|
-
let
|
|
65
|
-
return T.length === 0 ? /* @__PURE__ */
|
|
62
|
+
let A = r.columns ? r.columns.flatMap((e) => C.filter((t) => t.id === e)) : C;
|
|
63
|
+
return T.length === 0 ? /* @__PURE__ */ m("p", {
|
|
66
64
|
className: "p-4 text-sm text-muted-foreground",
|
|
67
|
-
children:
|
|
68
|
-
}) : /* @__PURE__ */
|
|
65
|
+
children: l("none")
|
|
66
|
+
}) : /* @__PURE__ */ m("div", {
|
|
69
67
|
className: "overflow-x-auto",
|
|
70
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ h("table", {
|
|
71
69
|
className: "doc-table w-full min-w-max text-sm",
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ m("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
|
71
|
+
/* @__PURE__ */ m("th", {
|
|
74
72
|
scope: "col",
|
|
75
|
-
children:
|
|
73
|
+
children: l("docTitle")
|
|
76
74
|
}),
|
|
77
|
-
|
|
75
|
+
A.map((e) => /* @__PURE__ */ m("th", {
|
|
78
76
|
scope: "col",
|
|
79
77
|
children: e.name
|
|
80
78
|
}, e.id)),
|
|
81
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ m("th", {
|
|
82
80
|
scope: "col",
|
|
83
|
-
children:
|
|
81
|
+
children: l("author")
|
|
84
82
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ m("th", {
|
|
86
84
|
scope: "col",
|
|
87
|
-
children:
|
|
85
|
+
children: l("updated")
|
|
88
86
|
})
|
|
89
|
-
] }) }), /* @__PURE__ */
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
87
|
+
] }) }), /* @__PURE__ */ m("tbody", { children: T.map((t) => {
|
|
88
|
+
let n = b ? "" : D(t);
|
|
89
|
+
return /* @__PURE__ */ h("tr", { children: [
|
|
90
|
+
/* @__PURE__ */ h("td", { children: [/* @__PURE__ */ h("div", {
|
|
91
|
+
className: "flex items-center gap-2",
|
|
92
|
+
children: [/* @__PURE__ */ h(u, {
|
|
93
|
+
to: "/$workspace/docs/$doc",
|
|
94
|
+
params: {
|
|
95
|
+
workspace: e,
|
|
96
|
+
doc: i(t)
|
|
97
|
+
},
|
|
98
|
+
className: "flex min-w-0 items-center gap-2 font-medium hover:underline",
|
|
99
|
+
children: [/* @__PURE__ */ m(s, { icon: t.icon }), /* @__PURE__ */ m("span", {
|
|
100
|
+
className: "truncate",
|
|
101
|
+
children: t.title
|
|
102
|
+
})]
|
|
103
|
+
}), b && (t.children ?? 0) > 0 && /* @__PURE__ */ m("span", {
|
|
104
|
+
className: "shrink-0 text-xs tabular-nums text-muted-foreground",
|
|
105
|
+
children: l("childCount", { count: t.children ?? 0 })
|
|
106
|
+
})]
|
|
107
|
+
}), n && /* @__PURE__ */ m("span", {
|
|
108
|
+
className: "ml-6 block truncate text-xs text-muted-foreground",
|
|
109
|
+
children: l("inParent", { parent: n })
|
|
110
|
+
})] }),
|
|
111
|
+
A.map((e) => /* @__PURE__ */ m("td", { children: O(e, k(t, e)) }, e.id)),
|
|
112
|
+
/* @__PURE__ */ m("td", {
|
|
113
|
+
className: "text-muted-foreground",
|
|
114
|
+
children: g(t.creator)
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ m("td", {
|
|
117
|
+
className: "text-muted-foreground",
|
|
118
|
+
children: d.dateTime(new Date(t.updatedAt), { dateStyle: "medium" })
|
|
119
|
+
})
|
|
120
|
+
] }, t.id);
|
|
121
|
+
}) })]
|
|
115
122
|
})
|
|
116
123
|
});
|
|
117
124
|
}
|
|
118
|
-
function
|
|
119
|
-
let v =
|
|
125
|
+
function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
|
|
126
|
+
let v = p("docViews"), { members: y } = a(e), b = c(e), x = o(e, "edit_docs", n(t)), S = r(e), [C, w] = d(null), [T, E] = d(null), D = [..._.kind === "select" ? _.options.map((e) => ({
|
|
120
127
|
key: e.id ?? "",
|
|
121
128
|
label: e.name
|
|
122
129
|
})) : y.map((e) => ({
|
|
@@ -128,13 +135,13 @@ function S({ workspace: e, space: t, docs: s, props: p, by: _ }) {
|
|
|
128
135
|
}], O = (e) => {
|
|
129
136
|
let t = e.properties?.[_.id];
|
|
130
137
|
return typeof t == "string" ? t : "";
|
|
131
|
-
}, k = D.filter((e) => _.kind === "select" || e.key === "" ||
|
|
132
|
-
return /* @__PURE__ */
|
|
138
|
+
}, k = D.filter((e) => _.kind === "select" || e.key === "" || f.some((t) => O(t) === e.key)), A = g.filter((e) => e.id !== _.id).slice(0, 2);
|
|
139
|
+
return /* @__PURE__ */ m("ul", {
|
|
133
140
|
className: "flex gap-3 overflow-x-auto p-3",
|
|
134
141
|
"aria-label": v("board"),
|
|
135
142
|
children: k.map((t) => {
|
|
136
|
-
let n =
|
|
137
|
-
return /* @__PURE__ */
|
|
143
|
+
let n = f.filter((e) => O(e) === t.key);
|
|
144
|
+
return /* @__PURE__ */ h("li", {
|
|
138
145
|
"aria-label": t.label,
|
|
139
146
|
onDragOver: (e) => {
|
|
140
147
|
C && (e.preventDefault(), E(t.key));
|
|
@@ -146,37 +153,37 @@ function S({ workspace: e, space: t, docs: s, props: p, by: _ }) {
|
|
|
146
153
|
values: { [_.id]: t.key || null }
|
|
147
154
|
}), w(null), E(null);
|
|
148
155
|
},
|
|
149
|
-
className:
|
|
150
|
-
children: [/* @__PURE__ */
|
|
156
|
+
className: l("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", T === t.key ? "border-primary" : "border-border"),
|
|
157
|
+
children: [/* @__PURE__ */ h("p", {
|
|
151
158
|
className: "flex items-center gap-2 px-3 py-2 text-xs font-medium",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ m("span", {
|
|
153
160
|
className: "truncate",
|
|
154
161
|
children: t.label
|
|
155
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ m("span", {
|
|
156
163
|
className: "text-muted-foreground tabular-nums",
|
|
157
164
|
children: n.length
|
|
158
165
|
})]
|
|
159
|
-
}), /* @__PURE__ */
|
|
166
|
+
}), /* @__PURE__ */ m("ul", {
|
|
160
167
|
className: "flex flex-col gap-2 px-2 pb-2",
|
|
161
|
-
children: n.map((t) => /* @__PURE__ */
|
|
168
|
+
children: n.map((t) => /* @__PURE__ */ h("li", {
|
|
162
169
|
draggable: x,
|
|
163
170
|
onDragStart: () => w(t.key),
|
|
164
171
|
onDragEnd: () => w(null),
|
|
165
172
|
className: "rounded-md border border-border bg-card p-2.5 text-sm shadow-xs",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ h(u, {
|
|
167
174
|
to: "/$workspace/docs/$doc",
|
|
168
175
|
params: {
|
|
169
176
|
workspace: e,
|
|
170
177
|
doc: i(t)
|
|
171
178
|
},
|
|
172
179
|
className: "flex items-center gap-2 font-medium hover:underline",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ m(s, { icon: t.icon }), /* @__PURE__ */ m("span", {
|
|
174
181
|
className: "truncate",
|
|
175
182
|
children: t.title
|
|
176
183
|
})]
|
|
177
184
|
}), A.map((e) => {
|
|
178
185
|
let n = b(e, t.properties?.[e.id]);
|
|
179
|
-
return n ? /* @__PURE__ */
|
|
186
|
+
return n ? /* @__PURE__ */ h("p", {
|
|
180
187
|
className: "mt-1 truncate text-xs text-muted-foreground",
|
|
181
188
|
children: [
|
|
182
189
|
e.name,
|
|
@@ -191,4 +198,4 @@ function S({ workspace: e, space: t, docs: s, props: p, by: _ }) {
|
|
|
191
198
|
})
|
|
192
199
|
});
|
|
193
200
|
}
|
|
194
|
-
export {
|
|
201
|
+
export { b as DocTable, v as groupable, y as useSpaceDocs };
|