@parallelworks/tandem-web 0.139.3 → 0.141.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 +45 -0
- package/_virtual/_virtual_i18n/es/common.js +45 -0
- package/_virtual/_virtual_i18n/ja/common.js +45 -0
- package/_virtual/_virtual_i18n/ko/common.js +45 -0
- package/_virtual/_virtual_i18n/zh/common.js +45 -0
- package/api/queries.js +80 -70
- package/components/DocButton.js +221 -0
- package/components/Editor.js +77 -75
- package/components/SettingsNav.js +55 -47
- package/components/SlashMenu.js +2 -0
- package/lib/docs.js +158 -123
- package/package.json +1 -1
- package/routeTree.gen.js +164 -158
- package/routes/_workspace/settings/slack.js +12 -0
- package/routes/_workspace/settings/slack2.js +109 -0
- package/routes/_workspace/settings/slack3.js +4 -0
- package/styles.css +4 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { docQuery as n, docTemplatesQuery as r, docsQuery as i } from "../api/queries.js";
|
|
3
|
+
import { EditIcon as a } from "./icons.js";
|
|
4
|
+
import { docKey as o, docRef as s, useTemplateValues as c } from "../lib/docs.js";
|
|
5
|
+
import { closingFence as l } from "./toggle.js";
|
|
6
|
+
import { Button as u, Combobox as d, IconButton as f, Input as p, Popover as m, SegmentedControl as h, Select as g, Textarea as _ } from "@parallelworks/ui";
|
|
7
|
+
import { useNavigate as v, useParams as y } from "@tanstack/react-router";
|
|
8
|
+
import { useState as b } from "react";
|
|
9
|
+
import { useTranslations as x } from "use-intl";
|
|
10
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
|
+
import { useQuery as w } from "@tanstack/react-query";
|
|
12
|
+
import { Node as T, NodeViewWrapper as E, ReactNodeViewRenderer as D, mergeAttributes as O } from "@tiptap/react";
|
|
13
|
+
// src/components/DocButton.tsx
|
|
14
|
+
var k = /^:::button[ \t]*([^\n]*)\n/, A = /\s+(template|parent)=([\w-]+)/g, j = T.create({
|
|
15
|
+
name: "docButton",
|
|
16
|
+
group: "block",
|
|
17
|
+
atom: !0,
|
|
18
|
+
draggable: !0,
|
|
19
|
+
addAttributes: () => ({
|
|
20
|
+
label: { default: "" },
|
|
21
|
+
action: { default: "insert" },
|
|
22
|
+
blocks: { default: "" },
|
|
23
|
+
template: { default: "" },
|
|
24
|
+
parent: { default: "" }
|
|
25
|
+
}),
|
|
26
|
+
parseHTML: () => [{ tag: "div[data-doc-button]" }],
|
|
27
|
+
renderHTML: ({ node: e, HTMLAttributes: t }) => [
|
|
28
|
+
"div",
|
|
29
|
+
O(t, { "data-doc-button": "" }),
|
|
30
|
+
String(e.attrs.label)
|
|
31
|
+
],
|
|
32
|
+
addNodeView: () => D(M, { stopEvent: ({ event: e }) => e.target instanceof Element && !!e.target.closest("[data-button-ui]") }),
|
|
33
|
+
markdownTokenName: "docButton",
|
|
34
|
+
markdownTokenizer: {
|
|
35
|
+
name: "docButton",
|
|
36
|
+
level: "block",
|
|
37
|
+
start: (e) => e.search(/^:::button/m),
|
|
38
|
+
tokenize: (e) => {
|
|
39
|
+
let t = k.exec(e);
|
|
40
|
+
if (!t) return;
|
|
41
|
+
let n = e.slice(t[0].length), r = l(n);
|
|
42
|
+
if (r) return {
|
|
43
|
+
type: "docButton",
|
|
44
|
+
raw: e.slice(0, t[0].length + r.index + r.length),
|
|
45
|
+
text: n.slice(0, r.index).trim(),
|
|
46
|
+
head: t[1] ?? ""
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
parseMarkdown: (e, t) => {
|
|
51
|
+
let n = String(e.head ?? ""), r = {};
|
|
52
|
+
for (let e of n.matchAll(A)) r[e[1] ?? ""] = e[2] ?? "";
|
|
53
|
+
return t.createNode("docButton", {
|
|
54
|
+
label: n.replace(A, "").trim(),
|
|
55
|
+
action: r.template ? "doc" : "insert",
|
|
56
|
+
blocks: e.text ?? "",
|
|
57
|
+
template: r.template ?? "",
|
|
58
|
+
parent: r.parent ?? ""
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
renderMarkdown: (e) => {
|
|
62
|
+
let t = e.attrs ?? {}, n = String(t.label ?? "").replace(/\n/g, " ");
|
|
63
|
+
if (t.action === "doc") {
|
|
64
|
+
let e = t.parent ? ` parent=${t.parent}` : "";
|
|
65
|
+
return `:::button ${n} template=${t.template ?? ""}${e}\n:::`;
|
|
66
|
+
}
|
|
67
|
+
return `:::button ${n}\n\n${String(t.blocks ?? "").trim()}\n\n:::`;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
function M({ node: r, editor: i, getPos: l, updateAttributes: d }) {
|
|
71
|
+
let p = x("docButton"), h = v(), g = c(), { workspace: _ = "", doc: T = "" } = y({ strict: !1 }), { data: D } = w({
|
|
72
|
+
...n(_, T),
|
|
73
|
+
enabled: !!_ && !!T
|
|
74
|
+
}), [O, k] = b(!1), A = String(r.attrs.label ?? "") || p("untitled"), j = r.attrs.action, M = j === "doc" ? !!r.attrs.template : !!String(r.attrs.blocks ?? "").trim(), P = async () => {
|
|
75
|
+
if (j === "insert") {
|
|
76
|
+
let e = g(), t = Object.entries(e).reduce((e, [t, n]) => e.replaceAll(`{{${t}}}`, n), String(r.attrs.blocks ?? "")), n = l();
|
|
77
|
+
if (n === void 0) return;
|
|
78
|
+
i.chain().focus().insertContentAt(n + r.nodeSize, t, { contentType: "markdown" }).run();
|
|
79
|
+
} else {
|
|
80
|
+
k(!0);
|
|
81
|
+
try {
|
|
82
|
+
let n = String(r.attrs.parent ?? "") || D?.key, i = t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
|
|
83
|
+
params: { path: { workspace: _ } },
|
|
84
|
+
body: {
|
|
85
|
+
template: String(r.attrs.template),
|
|
86
|
+
variables: g(),
|
|
87
|
+
...n && { parent: n }
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
h({
|
|
91
|
+
to: "/$workspace/docs/$doc",
|
|
92
|
+
params: {
|
|
93
|
+
workspace: _,
|
|
94
|
+
doc: s(i)
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
} finally {
|
|
98
|
+
k(!1);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
return /* @__PURE__ */ S(E, {
|
|
103
|
+
className: "doc-button",
|
|
104
|
+
contentEditable: !1,
|
|
105
|
+
children: /* @__PURE__ */ C("div", {
|
|
106
|
+
"data-button-ui": !0,
|
|
107
|
+
className: "flex items-center gap-1",
|
|
108
|
+
children: [/* @__PURE__ */ S(u, {
|
|
109
|
+
size: "sm",
|
|
110
|
+
onClick: () => void P(),
|
|
111
|
+
disabled: !i.isEditable || !M,
|
|
112
|
+
loading: O,
|
|
113
|
+
children: A
|
|
114
|
+
}), i.isEditable && /* @__PURE__ */ S(m, {
|
|
115
|
+
trigger: /* @__PURE__ */ S(f, {
|
|
116
|
+
variant: "ghost",
|
|
117
|
+
size: "xs",
|
|
118
|
+
icon: /* @__PURE__ */ S(a, {}),
|
|
119
|
+
label: p("edit")
|
|
120
|
+
}),
|
|
121
|
+
align: "start",
|
|
122
|
+
className: "w-96",
|
|
123
|
+
initialFocus: "first-control",
|
|
124
|
+
"aria-label": p("edit"),
|
|
125
|
+
children: /* @__PURE__ */ S(N, {
|
|
126
|
+
workspace: _,
|
|
127
|
+
attrs: r.attrs,
|
|
128
|
+
thisDoc: D?.key ?? (T ? o(T) : ""),
|
|
129
|
+
onChange: d
|
|
130
|
+
})
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function N({ workspace: e, attrs: t, thisDoc: n, onChange: a }) {
|
|
136
|
+
let o = x("docButton"), { data: s = [] } = w(r(e)), { data: c = [] } = w(i(e)), l = t.action;
|
|
137
|
+
return /* @__PURE__ */ C("div", {
|
|
138
|
+
className: "space-y-3 text-sm",
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ C("label", {
|
|
141
|
+
className: "block text-xs font-medium text-muted-foreground",
|
|
142
|
+
children: [o("label"), /* @__PURE__ */ S(p, {
|
|
143
|
+
value: String(t.label ?? ""),
|
|
144
|
+
onChange: (e) => a({ label: e.target.value }),
|
|
145
|
+
placeholder: o("labelPlaceholder"),
|
|
146
|
+
className: "mt-1"
|
|
147
|
+
})]
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ S(h, {
|
|
150
|
+
label: o("does"),
|
|
151
|
+
size: "sm",
|
|
152
|
+
value: l,
|
|
153
|
+
onValueChange: (e) => a({ action: e }),
|
|
154
|
+
options: [{
|
|
155
|
+
value: "insert",
|
|
156
|
+
label: o("insert")
|
|
157
|
+
}, {
|
|
158
|
+
value: "doc",
|
|
159
|
+
label: o("makeDoc")
|
|
160
|
+
}]
|
|
161
|
+
}),
|
|
162
|
+
l === "insert" ? /* @__PURE__ */ C("label", {
|
|
163
|
+
className: "block text-xs font-medium text-muted-foreground",
|
|
164
|
+
children: [
|
|
165
|
+
o("blocks"),
|
|
166
|
+
/* @__PURE__ */ S(_, {
|
|
167
|
+
value: String(t.blocks ?? ""),
|
|
168
|
+
onChange: (e) => a({ blocks: e.target.value }),
|
|
169
|
+
rows: 6,
|
|
170
|
+
placeholder: o("blocksPlaceholder"),
|
|
171
|
+
className: "mt-1 font-mono text-xs"
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ S("span", {
|
|
174
|
+
className: "mt-1 block font-normal",
|
|
175
|
+
children: o("placeholders")
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
}) : /* @__PURE__ */ C("div", {
|
|
179
|
+
className: "space-y-2",
|
|
180
|
+
children: [/* @__PURE__ */ C("div", {
|
|
181
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
182
|
+
children: [o("template"), /* @__PURE__ */ S("div", {
|
|
183
|
+
className: "mt-1",
|
|
184
|
+
children: /* @__PURE__ */ S(g, {
|
|
185
|
+
value: String(t.template ?? ""),
|
|
186
|
+
items: [{
|
|
187
|
+
value: "",
|
|
188
|
+
label: o("chooseTemplate")
|
|
189
|
+
}, ...s.map((e) => ({
|
|
190
|
+
value: e.id,
|
|
191
|
+
label: e.title
|
|
192
|
+
}))],
|
|
193
|
+
onValueChange: (e) => a({ template: e }),
|
|
194
|
+
"aria-label": o("template"),
|
|
195
|
+
width: "content"
|
|
196
|
+
})
|
|
197
|
+
})]
|
|
198
|
+
}), /* @__PURE__ */ C("div", {
|
|
199
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
200
|
+
children: [o("parent"), /* @__PURE__ */ S("div", {
|
|
201
|
+
className: "mt-1",
|
|
202
|
+
children: /* @__PURE__ */ S(d, {
|
|
203
|
+
items: [{
|
|
204
|
+
value: "",
|
|
205
|
+
label: o("thisDoc")
|
|
206
|
+
}, ...c.filter((e) => e.key !== n).map((e) => ({
|
|
207
|
+
value: e.key,
|
|
208
|
+
label: e.title
|
|
209
|
+
}))],
|
|
210
|
+
value: String(t.parent ?? ""),
|
|
211
|
+
onValueChange: (e) => e !== null && a({ parent: e }),
|
|
212
|
+
"aria-label": o("parent"),
|
|
213
|
+
placeholder: o("parent")
|
|
214
|
+
})
|
|
215
|
+
})]
|
|
216
|
+
})]
|
|
217
|
+
})
|
|
218
|
+
]
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
export { j as DocButton };
|
package/components/Editor.js
CHANGED
|
@@ -3,87 +3,88 @@ import { Callout as l } from "./callout.js";
|
|
|
3
3
|
import { DetailsContent as u, DetailsSummary as d, Toggle as f } from "./toggle.js";
|
|
4
4
|
import { Columns as p } from "./columns.js";
|
|
5
5
|
import { DateChip as m } from "./DateChip.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { DocButton as h } from "./DocButton.js";
|
|
7
|
+
import { DocLinkPicker as g } from "./DocLinkPicker.js";
|
|
8
|
+
import { IssueListBlock as _ } from "./IssueListBlock.js";
|
|
9
|
+
import { LinkCard as ee } from "./LinkCard.js";
|
|
9
10
|
import { MentionPicker as v } from "./MentionPicker.js";
|
|
10
11
|
import { Diagrams as y, MathBlock as b, MathInline as x } from "./mathDiagrams.js";
|
|
11
12
|
import { SlashMenu as S } from "./SlashMenu.js";
|
|
12
|
-
import { SubPages as
|
|
13
|
-
import { MarkdownTable as
|
|
14
|
-
import { useEffect as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { EditorContent as
|
|
17
|
-
import { CodeBlockLowlight as
|
|
18
|
-
import { TaskItem as
|
|
19
|
-
import { TableKit as
|
|
20
|
-
import { Placeholder as
|
|
21
|
-
import { Markdown as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import { createLowlight as
|
|
13
|
+
import { SubPages as te } from "./SubPages.js";
|
|
14
|
+
import { MarkdownTable as C } from "./table.js";
|
|
15
|
+
import { useEffect as w, useRef as T } from "react";
|
|
16
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
17
|
+
import { EditorContent as k, useEditor as A } from "@tiptap/react";
|
|
18
|
+
import { CodeBlockLowlight as j } from "@tiptap/extension-code-block-lowlight";
|
|
19
|
+
import { TaskItem as M, TaskList as N } from "@tiptap/extension-list";
|
|
20
|
+
import { TableKit as P } from "@tiptap/extension-table";
|
|
21
|
+
import { Placeholder as F } from "@tiptap/extensions";
|
|
22
|
+
import { Markdown as I } from "@tiptap/markdown";
|
|
23
|
+
import L from "@tiptap/starter-kit";
|
|
24
|
+
import R from "highlight.js/lib/languages/bash";
|
|
25
|
+
import ne from "highlight.js/lib/languages/css";
|
|
26
|
+
import z from "highlight.js/lib/languages/diff";
|
|
27
|
+
import B from "highlight.js/lib/languages/dockerfile";
|
|
28
|
+
import V from "highlight.js/lib/languages/go";
|
|
29
|
+
import H from "highlight.js/lib/languages/ini";
|
|
30
|
+
import U from "highlight.js/lib/languages/javascript";
|
|
31
|
+
import W from "highlight.js/lib/languages/json";
|
|
32
|
+
import G from "highlight.js/lib/languages/markdown";
|
|
33
|
+
import K from "highlight.js/lib/languages/python";
|
|
34
|
+
import q from "highlight.js/lib/languages/rust";
|
|
35
|
+
import J from "highlight.js/lib/languages/shell";
|
|
36
|
+
import Y from "highlight.js/lib/languages/sql";
|
|
37
|
+
import X from "highlight.js/lib/languages/typescript";
|
|
38
|
+
import Z from "highlight.js/lib/languages/xml";
|
|
39
|
+
import re from "highlight.js/lib/languages/yaml";
|
|
40
|
+
import { createLowlight as ie } from "lowlight";
|
|
40
41
|
// src/components/Editor.tsx
|
|
41
|
-
var
|
|
42
|
-
bash:
|
|
43
|
-
css:
|
|
44
|
-
diff:
|
|
45
|
-
dockerfile:
|
|
46
|
-
go:
|
|
47
|
-
ini:
|
|
48
|
-
javascript:
|
|
49
|
-
json:
|
|
50
|
-
markdown:
|
|
51
|
-
python:
|
|
52
|
-
rust:
|
|
53
|
-
shell:
|
|
54
|
-
sql:
|
|
55
|
-
typescript:
|
|
56
|
-
xml:
|
|
57
|
-
yaml:
|
|
42
|
+
var ae = ie({
|
|
43
|
+
bash: R,
|
|
44
|
+
css: ne,
|
|
45
|
+
diff: z,
|
|
46
|
+
dockerfile: B,
|
|
47
|
+
go: V,
|
|
48
|
+
ini: H,
|
|
49
|
+
javascript: U,
|
|
50
|
+
json: W,
|
|
51
|
+
markdown: G,
|
|
52
|
+
python: K,
|
|
53
|
+
rust: q,
|
|
54
|
+
shell: J,
|
|
55
|
+
sql: Y,
|
|
56
|
+
typescript: X,
|
|
57
|
+
xml: Z,
|
|
58
|
+
yaml: re
|
|
58
59
|
});
|
|
59
|
-
function Q({ editable:
|
|
60
|
+
function Q({ editable: g = !0, placeholder: v = "", collaborative: S = !1 } = {}) {
|
|
60
61
|
return [
|
|
61
|
-
|
|
62
|
+
L.configure({
|
|
62
63
|
link: {
|
|
63
|
-
openOnClick: !
|
|
64
|
+
openOnClick: !g,
|
|
64
65
|
autolink: !0
|
|
65
66
|
},
|
|
66
67
|
codeBlock: !1,
|
|
67
68
|
blockquote: !1,
|
|
68
|
-
...
|
|
69
|
+
...g && !S ? {} : { trailingNode: !1 },
|
|
69
70
|
...S ? { undoRedo: !1 } : {}
|
|
70
71
|
}),
|
|
71
|
-
|
|
72
|
+
j.configure({ lowlight: ae }),
|
|
72
73
|
l,
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
N,
|
|
75
|
+
M.configure({ nested: !0 }),
|
|
75
76
|
f,
|
|
76
|
-
|
|
77
|
+
te,
|
|
77
78
|
d,
|
|
78
79
|
u,
|
|
79
80
|
p,
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
P.configure({ table: !1 }),
|
|
82
|
+
C.configure({
|
|
82
83
|
resizable: !1,
|
|
83
84
|
allowTableNodeSelection: !1
|
|
84
85
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
F.configure({ placeholder: v }),
|
|
87
|
+
I,
|
|
87
88
|
a,
|
|
88
89
|
r,
|
|
89
90
|
n,
|
|
@@ -93,11 +94,12 @@ function Q({ editable: h = !0, placeholder: v = "", collaborative: S = !1 } = {}
|
|
|
93
94
|
s,
|
|
94
95
|
c,
|
|
95
96
|
i,
|
|
96
|
-
|
|
97
|
+
h,
|
|
98
|
+
ee,
|
|
97
99
|
x,
|
|
98
100
|
b,
|
|
99
101
|
y,
|
|
100
|
-
|
|
102
|
+
_,
|
|
101
103
|
m
|
|
102
104
|
];
|
|
103
105
|
}
|
|
@@ -116,8 +118,8 @@ function $(e) {
|
|
|
116
118
|
}
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
|
-
function
|
|
120
|
-
let f =
|
|
121
|
+
function oe({ value: e, onChange: t, onSubmit: n, onBlur: r, onFocus: i, placeholder: a, editable: o = !0, autofocus: s = !1, className: c = "", label: l, onFiles: u, onEditor: d }) {
|
|
122
|
+
let f = T({
|
|
121
123
|
onChange: t,
|
|
122
124
|
onSubmit: n,
|
|
123
125
|
onBlur: r,
|
|
@@ -129,9 +131,9 @@ function ae({ value: e, onChange: t, onSubmit: n, onBlur: r, onFocus: i, placeho
|
|
|
129
131
|
onBlur: r,
|
|
130
132
|
onFocus: i
|
|
131
133
|
};
|
|
132
|
-
let p =
|
|
134
|
+
let p = T(u);
|
|
133
135
|
p.current = u;
|
|
134
|
-
let m =
|
|
136
|
+
let m = A({
|
|
135
137
|
extensions: Q({
|
|
136
138
|
editable: o,
|
|
137
139
|
placeholder: a ?? ""
|
|
@@ -158,23 +160,23 @@ function ae({ value: e, onChange: t, onSubmit: n, onBlur: r, onFocus: i, placeho
|
|
|
158
160
|
onBlur: ({ editor: e }) => f.current.onBlur?.(e.getMarkdown()),
|
|
159
161
|
onFocus: () => f.current.onFocus?.()
|
|
160
162
|
});
|
|
161
|
-
|
|
163
|
+
w(() => {
|
|
162
164
|
m && !m.isFocused && m.getMarkdown() !== e && m.commands.setContent(e, {
|
|
163
165
|
contentType: "markdown",
|
|
164
166
|
emitUpdate: !1
|
|
165
167
|
});
|
|
166
|
-
}, [m, e]),
|
|
168
|
+
}, [m, e]), w(() => {
|
|
167
169
|
m?.setEditable(o);
|
|
168
170
|
}, [m, o]);
|
|
169
|
-
let
|
|
170
|
-
return
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
o && /* @__PURE__ */
|
|
173
|
-
o && /* @__PURE__ */
|
|
171
|
+
let h = T(d);
|
|
172
|
+
return h.current = d, w(() => (h.current?.(m), () => h.current?.(null)), [m]), /* @__PURE__ */ O(E, { children: [
|
|
173
|
+
/* @__PURE__ */ D(k, { editor: m }),
|
|
174
|
+
o && /* @__PURE__ */ D(g, { editor: m }),
|
|
175
|
+
o && /* @__PURE__ */ D(S, {
|
|
174
176
|
editor: m,
|
|
175
177
|
onFiles: p
|
|
176
178
|
}),
|
|
177
|
-
o && /* @__PURE__ */
|
|
179
|
+
o && /* @__PURE__ */ D(v, { editor: m })
|
|
178
180
|
] });
|
|
179
181
|
}
|
|
180
|
-
export {
|
|
182
|
+
export { oe as Editor, Q as contentExtensions, $ as fileHandlers };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Link as e } from "../lib/router.js";
|
|
2
2
|
import { githubAccountQuery as t, meQuery as n } from "../api/queries.js";
|
|
3
|
-
import { ChevronDownIcon as r,
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { useQuery as
|
|
3
|
+
import { ChevronDownIcon as r, CommentIcon as i, FolderIcon as a, HistoryIcon as o, KeyIcon as s, LinkIcon as c, NotificationIcon as l, RepositoryIcon as u, SettingsIcon as d, ShieldIcon as f, TagIcon as p, UserIcon as m, UsersIcon as h, WebhookIcon as g, WorkerIcon as _ } from "./icons.js";
|
|
4
|
+
import { useTranslations as v } from "use-intl";
|
|
5
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
6
|
+
import { useQuery as S, useSuspenseQuery as C } from "@tanstack/react-query";
|
|
7
7
|
// src/components/SettingsNav.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let { data: e } =
|
|
8
|
+
var w = "flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", T = "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium", E = { className: T };
|
|
9
|
+
function D() {
|
|
10
|
+
let { data: e } = C(n), r = v("settingsNav"), y = e?.mode === "platform", { data: b } = S(t);
|
|
11
11
|
return [
|
|
12
12
|
{
|
|
13
13
|
label: r("account"),
|
|
@@ -15,31 +15,31 @@ function E() {
|
|
|
15
15
|
{
|
|
16
16
|
to: "/$workspace/settings/account",
|
|
17
17
|
label: r("profile"),
|
|
18
|
-
Icon:
|
|
18
|
+
Icon: m
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
to: "/$workspace/settings/notifications",
|
|
22
22
|
label: r("notifications"),
|
|
23
|
-
Icon:
|
|
23
|
+
Icon: l
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
to: "/$workspace/settings/runners",
|
|
27
27
|
label: r("runners"),
|
|
28
|
-
Icon:
|
|
28
|
+
Icon: _
|
|
29
29
|
},
|
|
30
|
-
...
|
|
30
|
+
...b?.enabled ? [{
|
|
31
31
|
to: "/$workspace/settings/connections",
|
|
32
32
|
label: r("connections"),
|
|
33
|
-
Icon:
|
|
33
|
+
Icon: c
|
|
34
34
|
}] : [],
|
|
35
|
-
...
|
|
35
|
+
...y ? [] : [{
|
|
36
36
|
to: "/$workspace/settings/tokens",
|
|
37
37
|
label: r("tokens"),
|
|
38
|
-
Icon:
|
|
38
|
+
Icon: s
|
|
39
39
|
}, {
|
|
40
40
|
to: "/$workspace/settings/sessions",
|
|
41
41
|
label: r("sessions"),
|
|
42
|
-
Icon:
|
|
42
|
+
Icon: f
|
|
43
43
|
}]
|
|
44
44
|
]
|
|
45
45
|
},
|
|
@@ -49,84 +49,92 @@ function E() {
|
|
|
49
49
|
{
|
|
50
50
|
to: "/$workspace/settings",
|
|
51
51
|
label: r("general"),
|
|
52
|
-
Icon:
|
|
52
|
+
Icon: d
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
to: "/$workspace/settings/members",
|
|
56
|
-
label: r(
|
|
57
|
-
Icon:
|
|
56
|
+
label: r(y ? "access" : "members"),
|
|
57
|
+
Icon: h
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
to: "/$workspace/settings/roles",
|
|
61
61
|
label: r("roles"),
|
|
62
|
-
Icon:
|
|
62
|
+
Icon: f
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
to: "/$workspace/settings/groups",
|
|
66
66
|
label: r("groups"),
|
|
67
|
-
Icon:
|
|
67
|
+
Icon: f
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
to: "/$workspace/settings/teams",
|
|
71
71
|
label: r("teams"),
|
|
72
|
-
Icon:
|
|
72
|
+
Icon: a
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
to: "/$workspace/settings/labels",
|
|
76
76
|
label: r("labels"),
|
|
77
|
-
Icon:
|
|
77
|
+
Icon: p
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
to: "/$workspace/settings/audit-log",
|
|
81
81
|
label: r("auditLog"),
|
|
82
|
-
Icon:
|
|
82
|
+
Icon: o
|
|
83
83
|
},
|
|
84
|
-
...
|
|
84
|
+
...y ? [] : [{
|
|
85
85
|
to: "/$workspace/settings/sso",
|
|
86
86
|
label: r("sso"),
|
|
87
|
-
Icon:
|
|
87
|
+
Icon: s
|
|
88
88
|
}]
|
|
89
89
|
]
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
label: r("integrations"),
|
|
93
|
-
items: [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
items: [
|
|
94
|
+
{
|
|
95
|
+
to: "/$workspace/settings/github",
|
|
96
|
+
label: r("github"),
|
|
97
|
+
Icon: u
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
to: "/$workspace/settings/slack",
|
|
101
|
+
label: r("slack"),
|
|
102
|
+
Icon: i
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
to: "/$workspace/settings/webhooks",
|
|
106
|
+
label: r("webhooks"),
|
|
107
|
+
Icon: g
|
|
108
|
+
}
|
|
109
|
+
]
|
|
102
110
|
}
|
|
103
111
|
];
|
|
104
112
|
}
|
|
105
|
-
function
|
|
106
|
-
let n =
|
|
107
|
-
return /* @__PURE__ */
|
|
113
|
+
function O({ workspace: t }) {
|
|
114
|
+
let n = v("settingsNav"), i = D();
|
|
115
|
+
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x(e, {
|
|
108
116
|
to: "/$workspace/issues",
|
|
109
117
|
params: { workspace: t },
|
|
110
118
|
className: "flex h-9 items-center gap-2 rounded-md px-2 text-sm font-semibold hover:bg-muted",
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
-
}), /* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ b(r, { className: "size-4 rotate-90 text-muted-foreground" }), n("label")]
|
|
120
|
+
}), /* @__PURE__ */ b("nav", {
|
|
113
121
|
"aria-label": n("label"),
|
|
114
122
|
className: "-mx-3 mt-2 min-h-0 flex-1 overflow-y-auto px-3",
|
|
115
|
-
children: i.map((n) => /* @__PURE__ */
|
|
123
|
+
children: i.map((n) => /* @__PURE__ */ x("div", {
|
|
116
124
|
className: "mt-4 first:mt-0",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ b("p", {
|
|
118
126
|
className: "flex h-6 items-center px-2 text-xs font-medium text-muted-foreground",
|
|
119
127
|
children: n.label
|
|
120
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ b("div", {
|
|
121
129
|
className: "mt-1 space-y-0.5",
|
|
122
|
-
children: n.items.map(({ to: n, label: r, Icon: i }) => /* @__PURE__ */
|
|
130
|
+
children: n.items.map(({ to: n, label: r, Icon: i }) => /* @__PURE__ */ x(e, {
|
|
123
131
|
to: n,
|
|
124
132
|
params: { workspace: t },
|
|
125
|
-
className:
|
|
126
|
-
activeProps:
|
|
133
|
+
className: w,
|
|
134
|
+
activeProps: E,
|
|
127
135
|
activeOptions: { exact: !0 },
|
|
128
136
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ b(i, { className: "size-4" }),
|
|
130
138
|
" ",
|
|
131
139
|
r
|
|
132
140
|
]
|
|
@@ -135,4 +143,4 @@ function D({ workspace: t }) {
|
|
|
135
143
|
}, n.label))
|
|
136
144
|
})] });
|
|
137
145
|
}
|
|
138
|
-
export {
|
|
146
|
+
export { O as SettingsNav, w as navItem, T as navOn, D as useSettingsPages };
|
package/components/SlashMenu.js
CHANGED
|
@@ -58,6 +58,7 @@ var w = {
|
|
|
58
58
|
file: "↥",
|
|
59
59
|
table: "▦",
|
|
60
60
|
docLink: "[[",
|
|
61
|
+
button: "▭",
|
|
61
62
|
issueList: "☰",
|
|
62
63
|
date: "@",
|
|
63
64
|
page: "+",
|
|
@@ -103,6 +104,7 @@ var w = {
|
|
|
103
104
|
withHeaderRow: !0
|
|
104
105
|
}),
|
|
105
106
|
docLink: (e) => e.insertContent("[["),
|
|
107
|
+
button: (e) => e.insertContent({ type: "docButton" }),
|
|
106
108
|
issueList: (e) => e.insertContent({ type: "issueList" }),
|
|
107
109
|
date: (e) => e.insertContent([{
|
|
108
110
|
type: "dateChip",
|