@parallelworks/tandem-web 0.192.2 → 0.194.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 +23 -5
- package/_virtual/_virtual_i18n/es/common.js +23 -5
- package/_virtual/_virtual_i18n/ja/common.js +23 -5
- package/_virtual/_virtual_i18n/ko/common.js +23 -5
- package/_virtual/_virtual_i18n/zh/common.js +23 -5
- package/api/queries.js +2 -1
- package/components/DashboardPanel.js +70 -57
- 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/IssueBreakdown.js +1 -1
- 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/dashboards/_dashboardId2.js +26 -2
- 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/SubPages.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { docQuery as e, docsQuery as t, teamsQuery as n } from "../api/queries.js";
|
|
2
2
|
import { useConfirm as r } from "../lib/confirm.js";
|
|
3
3
|
import { docRef as i, useDocActions as a, useDocMenu as o } from "../lib/docs.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
4
|
+
import { menuOpenerProps as s } from "../lib/menus.js";
|
|
5
|
+
import { Link as c } from "../lib/router.js";
|
|
6
|
+
import { DocIcon as l } from "./DocIcon.js";
|
|
7
|
+
import { useOpenMenu as u } from "@parallelworks/ui";
|
|
8
|
+
import { useParams as d } from "@tanstack/react-router";
|
|
9
|
+
import { useState as f } from "react";
|
|
10
|
+
import { useTranslations as p } from "use-intl";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { useQuery as g } from "@tanstack/react-query";
|
|
13
|
+
import { MoreButton as _ } from "@parallelworks/ui/list";
|
|
14
|
+
import { Node as v, NodeViewWrapper as y, ReactNodeViewRenderer as b, mergeAttributes as x } from "@tiptap/react";
|
|
13
15
|
// src/components/SubPages.tsx
|
|
14
|
-
var
|
|
16
|
+
var S = /^:::subpages[ \t]*\n[ \t]*:::[ \t]*(?:\n|$)/, C = v.create({
|
|
15
17
|
name: "subPages",
|
|
16
18
|
group: "block",
|
|
17
19
|
atom: !0,
|
|
18
20
|
draggable: !0,
|
|
19
21
|
selectable: !0,
|
|
20
22
|
parseHTML: () => [{ tag: "div[data-sub-pages]" }],
|
|
21
|
-
renderHTML: ({ HTMLAttributes: e }) => ["div",
|
|
22
|
-
addNodeView: () =>
|
|
23
|
+
renderHTML: ({ HTMLAttributes: e }) => ["div", x(e, { "data-sub-pages": "" })],
|
|
24
|
+
addNodeView: () => b(w),
|
|
23
25
|
markdownTokenName: "subPages",
|
|
24
26
|
markdownTokenizer: {
|
|
25
27
|
name: "subPages",
|
|
26
28
|
level: "block",
|
|
27
29
|
start: (e) => e.search(/^:::subpages/m),
|
|
28
30
|
tokenize: (e) => {
|
|
29
|
-
let t =
|
|
31
|
+
let t = S.exec(e);
|
|
30
32
|
return t ? {
|
|
31
33
|
type: "subPages",
|
|
32
34
|
raw: t[0]
|
|
@@ -36,93 +38,94 @@ var b = /^:::subpages[ \t]*\n[ \t]*:::[ \t]*(?:\n|$)/, x = g.create({
|
|
|
36
38
|
parseMarkdown: (e, t) => t.createNode("subPages"),
|
|
37
39
|
renderMarkdown: () => ":::subpages\n:::"
|
|
38
40
|
});
|
|
39
|
-
function
|
|
40
|
-
let
|
|
41
|
-
...e(
|
|
42
|
-
enabled: !!
|
|
43
|
-
}), { data:
|
|
44
|
-
...t(
|
|
45
|
-
enabled: !!
|
|
46
|
-
}), { data:
|
|
47
|
-
...n(
|
|
48
|
-
enabled: !!
|
|
49
|
-
}),
|
|
41
|
+
function w({ editor: v }) {
|
|
42
|
+
let b = p("docs"), x = p("common"), { workspace: S = "", doc: C = "" } = d({ strict: !1 }), { data: w } = g({
|
|
43
|
+
...e(S, C),
|
|
44
|
+
enabled: !!S && !!C
|
|
45
|
+
}), { data: T = [] } = g({
|
|
46
|
+
...t(S, { parent: w?.key ?? "" }),
|
|
47
|
+
enabled: !!S && !!w
|
|
48
|
+
}), { data: E = [] } = g({
|
|
49
|
+
...n(S),
|
|
50
|
+
enabled: !!S
|
|
51
|
+
}), D = o(S), O = u(), k = a(S), { confirm: A, dialog: j } = r(), [M, N] = f(), P = v.isEditable, F = (e) => D(e, { onRename: () => N(e.key) }).flatMap((t) => {
|
|
50
52
|
if (!("label" in t)) return [t];
|
|
51
|
-
if (t.label ===
|
|
52
|
-
label:
|
|
53
|
+
if (t.label === b("archive")) return [{
|
|
54
|
+
label: b("archive"),
|
|
53
55
|
destructive: !0,
|
|
54
56
|
onClick: () => {
|
|
55
|
-
|
|
56
|
-
title:
|
|
57
|
-
description:
|
|
58
|
-
confirmLabel:
|
|
59
|
-
onConfirm: () =>
|
|
57
|
+
A({
|
|
58
|
+
title: b("archiveConfirm", { title: e.title || b("untitled") }),
|
|
59
|
+
description: b("archiveDetail"),
|
|
60
|
+
confirmLabel: b("archive"),
|
|
61
|
+
onConfirm: () => k.archive.mutateAsync(e)
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
}];
|
|
63
|
-
if (t.label ===
|
|
64
|
-
let n =
|
|
65
|
+
if (t.label === b("moveTo")) {
|
|
66
|
+
let n = E.find((t) => t.id === e.teamId)?.key ?? "workspace";
|
|
65
67
|
return [{
|
|
66
|
-
label:
|
|
67
|
-
onClick: () =>
|
|
68
|
+
label: b("moveOut"),
|
|
69
|
+
onClick: () => k.move.mutate({
|
|
68
70
|
doc: e,
|
|
69
71
|
space: n
|
|
70
72
|
})
|
|
71
73
|
}, t];
|
|
72
74
|
}
|
|
73
75
|
return [t];
|
|
74
|
-
}),
|
|
75
|
-
|
|
76
|
+
}), I = (e, t) => {
|
|
77
|
+
N(void 0);
|
|
76
78
|
let n = t.trim();
|
|
77
|
-
n && n !== e.title &&
|
|
79
|
+
n && n !== e.title && k.rename.mutate({
|
|
78
80
|
doc: e,
|
|
79
81
|
title: n
|
|
80
82
|
});
|
|
81
83
|
};
|
|
82
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ h(y, {
|
|
83
85
|
className: "sub-pages",
|
|
84
86
|
contentEditable: !1,
|
|
85
87
|
"data-drag-handle": !0,
|
|
86
88
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ m("p", {
|
|
88
90
|
className: "sub-pages-title",
|
|
89
|
-
children:
|
|
91
|
+
children: b("subPages")
|
|
90
92
|
}),
|
|
91
|
-
|
|
93
|
+
T.length === 0 ? /* @__PURE__ */ m("p", {
|
|
92
94
|
className: "sub-pages-empty",
|
|
93
|
-
children:
|
|
94
|
-
}) : /* @__PURE__ */
|
|
95
|
+
children: b("noSubPages")
|
|
96
|
+
}) : /* @__PURE__ */ m("ul", { children: T.map((e) => /* @__PURE__ */ h("li", {
|
|
95
97
|
className: "group flex items-center gap-1",
|
|
96
|
-
|
|
98
|
+
...M !== e.key && s(O, () => P ? F(e) : D(e)),
|
|
99
|
+
children: [M === e.key ? /* @__PURE__ */ m("input", {
|
|
97
100
|
autoFocus: !0,
|
|
98
101
|
defaultValue: e.title,
|
|
99
|
-
"aria-label":
|
|
102
|
+
"aria-label": b("rename"),
|
|
100
103
|
className: "sub-pages-rename",
|
|
101
|
-
onBlur: (t) =>
|
|
104
|
+
onBlur: (t) => I(e, t.currentTarget.value),
|
|
102
105
|
onKeyDown: (t) => {
|
|
103
|
-
t.key === "Enter" &&
|
|
106
|
+
t.key === "Enter" && I(e, t.currentTarget.value), t.key === "Escape" && N(void 0);
|
|
104
107
|
}
|
|
105
|
-
}) : /* @__PURE__ */
|
|
108
|
+
}) : /* @__PURE__ */ h(c, {
|
|
106
109
|
to: "/$workspace/docs/$doc",
|
|
107
110
|
params: {
|
|
108
|
-
workspace:
|
|
111
|
+
workspace: S,
|
|
109
112
|
doc: i(e)
|
|
110
113
|
},
|
|
111
114
|
className: "sub-pages-link",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ m(l, {
|
|
113
116
|
icon: e.icon,
|
|
114
117
|
className: "size-4"
|
|
115
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ m("span", {
|
|
116
119
|
className: "truncate",
|
|
117
120
|
children: e.title
|
|
118
121
|
})]
|
|
119
|
-
}),
|
|
120
|
-
items: () =>
|
|
121
|
-
label:
|
|
122
|
+
}), P && /* @__PURE__ */ m(_, {
|
|
123
|
+
items: () => F(e),
|
|
124
|
+
label: x("moreActionsFor", { name: e.title || b("untitled") })
|
|
122
125
|
})]
|
|
123
126
|
}, e.key)) }),
|
|
124
|
-
|
|
127
|
+
j
|
|
125
128
|
]
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
|
-
export {
|
|
131
|
+
export { C as SubPages };
|