@parallelworks/tandem-web 0.171.1 → 0.171.3
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 +5 -2
- package/_virtual/_virtual_i18n/es/common.js +5 -2
- package/_virtual/_virtual_i18n/ja/common.js +5 -2
- package/_virtual/_virtual_i18n/ko/common.js +5 -2
- package/_virtual/_virtual_i18n/zh/common.js +5 -2
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +60 -60
- package/components/ActorAvatar.js +4 -4
- package/components/ActorLink.js +34 -0
- package/components/AgentWork.js +494 -494
- package/components/AppLauncher.js +7 -7
- package/components/AreaLink.js +13 -13
- package/components/AreaTiles.js +13 -13
- package/components/AreaWork.js +22 -22
- package/components/Attachments.js +73 -69
- package/components/BlockHandle.js +3 -3
- package/components/BugRotation.js +8 -8
- package/components/CodeHostSettings.js +121 -87
- package/components/CollabEditor.js +13 -13
- package/components/CommandPalette.js +206 -206
- package/components/CustomFields.js +95 -95
- package/components/CustomerRequests.js +11 -11
- package/components/DashboardPanel.js +201 -164
- package/components/DateChip.js +21 -21
- package/components/DocHistory.js +14 -14
- package/components/DocIcon.js +4 -4
- package/components/DocIconPicker.js +4 -4
- package/components/DocLinkPicker.js +22 -22
- package/components/DocLook.js +16 -16
- package/components/DocProperties.js +81 -81
- package/components/DocTable.js +53 -53
- package/components/DocsTree.js +179 -179
- package/components/Editor.js +69 -69
- package/components/FavoritesNav.js +78 -78
- package/components/GitHub.js +87 -87
- package/components/Graph.js +14 -14
- package/components/HostActions.js +21 -21
- package/components/HostPanel.js +6 -6
- package/components/HoverCards.js +74 -74
- package/components/IssueBoard.js +13 -10
- package/components/IssueBreakdown.js +31 -31
- package/components/IssueCode.js +19 -19
- package/components/IssueEvent.js +97 -92
- package/components/IssueFilters.js +39 -39
- package/components/IssueGroup.js +16 -16
- package/components/IssueImport.js +13 -13
- package/components/IssueInsights.js +20 -20
- package/components/IssueListBlock.js +81 -81
- package/components/IssueRelations.js +34 -34
- package/components/IssueRow.js +31 -31
- package/components/IssueSentry.js +36 -34
- package/components/IssueTemplates.js +23 -23
- package/components/IssueTypes.js +40 -40
- package/components/MarkdownTransfer.js +10 -10
- package/components/MentionPicker.js +19 -19
- package/components/NewIssueDialog.js +53 -53
- package/components/NewProjectDialog.js +82 -82
- package/components/PersonActivity.js +13 -13
- package/components/PersonHoverCard.js +44 -44
- package/components/Planning.js +16 -16
- package/components/Reports.js +8 -8
- package/components/SettingsNav.js +15 -15
- package/components/ShareDialog.js +8 -8
- package/components/SharedViewer.js +23 -23
- package/components/SlashMenu.js +26 -26
- package/components/SubPages.js +10 -10
- package/components/TeamForm.js +9 -9
- package/components/TeamRepositories.js +21 -21
- package/components/TeamWorkflow.js +6 -6
- package/components/UnlinkedMentions.js +29 -29
- package/components/Updates.js +8 -8
- package/components/Widgets.js +99 -97
- package/components/WorkCounts.js +12 -12
- package/components/cycleCrumb.js +8 -8
- package/components/editorPlugins.js +101 -101
- package/components/settings.js +6 -6
- package/components/video.js +7 -7
- package/hostedApp.js +24 -24
- package/index.js +18 -18
- package/lib/assignees.js +3 -3
- package/lib/attachments.js +12 -12
- package/lib/boardMove.js +27 -27
- package/lib/collab.js +1 -1
- package/lib/docs.js +115 -115
- package/lib/githubLink.js +7 -7
- package/lib/issueList.js +51 -51
- package/lib/issueMenu.js +117 -117
- package/lib/knowledge.js +134 -134
- package/lib/live.js +38 -38
- package/lib/notifications.js +47 -47
- package/lib/triageSeen.js +2 -2
- package/lib/views.js +31 -31
- package/package.json +24 -24
- package/pages/area.js +64 -64
- package/pages/areas.js +199 -199
- package/pages/decisions.js +51 -51
- package/pages/issues.js +120 -120
- package/pages/projects.js +238 -238
- package/pages/triage.js +202 -212
- package/routes/_workspace/agents/_slug2.js +127 -127
- package/routes/_workspace/agents/index2.js +22 -22
- package/routes/_workspace/dashboards/_dashboardId2.js +84 -84
- package/routes/_workspace/dashboards/index2.js +34 -34
- package/routes/_workspace/docs/_doc2.js +267 -267
- package/routes/_workspace/docs/space2._space.js +31 -31
- package/routes/_workspace/docs2.js +4 -4
- package/routes/_workspace/graph2.js +11 -11
- package/routes/_workspace/graph3.js +11 -11
- package/routes/_workspace/issues/_identifier2.js +519 -522
- package/routes/_workspace/issues/index.js +13 -13
- package/routes/_workspace/knowledge/_term2.js +148 -146
- package/routes/_workspace/knowledge/_term3.js +4 -4
- package/routes/_workspace/knowledge/index.js +12 -12
- package/routes/_workspace/knowledge/index2.js +117 -115
- package/routes/_workspace/measures2.js +8 -8
- package/routes/_workspace/measures3.js +29 -29
- package/routes/_workspace/notifications2.js +263 -263
- package/routes/_workspace/people/_username.js +10 -10
- package/routes/_workspace/people/_username2.js +41 -41
- package/routes/_workspace/projects/_projectId3.js +303 -303
- package/routes/_workspace/projects/_projectId4.js +4 -4
- package/routes/_workspace/projects/_projectId_3.milestones._milestoneId.js +28 -28
- package/routes/_workspace/projects/_projectId_4.milestones._milestoneId.js +4 -4
- package/routes/_workspace/projects/index.js +8 -8
- package/routes/_workspace/settings/account2.js +8 -8
- package/routes/_workspace/settings/audit-log2.js +8 -8
- package/routes/_workspace/settings/audit-log3.js +155 -155
- package/routes/_workspace/settings/connections2.js +4 -4
- package/routes/_workspace/settings/fields2.js +5 -5
- package/routes/_workspace/settings/github2.js +11 -11
- package/routes/_workspace/settings/gitlab2.js +5 -5
- package/routes/_workspace/settings/groups2.js +52 -52
- package/routes/_workspace/settings/import2.js +39 -39
- package/routes/_workspace/settings/index2.js +5 -5
- package/routes/_workspace/settings/intercom2.js +11 -11
- package/routes/_workspace/settings/labels2.js +33 -33
- package/routes/_workspace/settings/members2.js +81 -81
- package/routes/_workspace/settings/notifications2.js +46 -46
- package/routes/_workspace/settings/parallelworks2.js +20 -20
- package/routes/_workspace/settings/roles2.js +41 -41
- package/routes/_workspace/settings/runners2.js +15 -15
- package/routes/_workspace/settings/sentry2.js +15 -15
- package/routes/_workspace/settings/sessions2.js +9 -9
- package/routes/_workspace/settings/sessions3.js +4 -4
- package/routes/_workspace/settings/slack2.js +12 -12
- package/routes/_workspace/settings/sso2.js +37 -37
- package/routes/_workspace/settings/sso3.js +7 -7
- package/routes/_workspace/settings/teams2.js +29 -29
- package/routes/_workspace/settings/tokens2.js +32 -32
- package/routes/_workspace/settings/tokens3.js +4 -4
- package/routes/_workspace/settings/webhooks2.js +41 -41
- package/routes/_workspace/settings/zendesk2.js +11 -11
- package/routes/_workspace/teams/_key/cycles/_number2.js +33 -33
- package/routes/_workspace/teams/_key/cycles/_number3.js +7 -7
- package/routes/_workspace/teams/_key/cycles/index2.js +37 -37
- package/routes/_workspace/teams/_key/issues.js +10 -10
- package/routes/_workspace/teams/_key/projects.js +6 -6
- package/routes/_workspace/teams/_key/settings2.js +396 -396
- package/routes/_workspace2.js +308 -308
- package/routes/_workspace3.js +8 -8
- package/routes/device2.js +4 -4
- package/routes/device3.js +4 -4
- package/routes/docs/_tag/_endpoint2.js +3 -3
- package/routes/docs/_tag/index2.js +3 -3
- package/routes/docs/route2.js +7 -7
- package/routes/index2.js +5 -5
- package/routes/login2.js +10 -10
- package/routes/new2.js +12 -12
- package/routes/new3.js +5 -5
- package/routes/request2._token.js +6 -6
- package/routes/share2._secret.js +4 -4
package/lib/assignees.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { meQuery as e } from "../api/queries.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { youFirst as t } from "./assigneeOrder.js";
|
|
3
|
+
import { usePeople as n } from "./people.js";
|
|
4
4
|
import { PickManyBox as r } from "./pickMany.js";
|
|
5
5
|
import { Avatar as i } from "@parallelworks/ui";
|
|
6
6
|
import { useTranslations as a } from "use-intl";
|
|
@@ -16,7 +16,7 @@ function u(e) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
function d(u, d = !1) {
|
|
19
|
-
let f = a("common"), { members: p, agents: m } =
|
|
19
|
+
let f = a("common"), { members: p, agents: m } = n(u), h = c(e).data?.user.username, g = [...t(p, h).map((e) => ({
|
|
20
20
|
value: l({
|
|
21
21
|
kind: "user",
|
|
22
22
|
handle: e.user.username
|
package/lib/attachments.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { basePath as n } from "./base.js";
|
|
3
3
|
// src/lib/attachments.ts
|
|
4
4
|
var r = "/api/v1/attachments/", i = /\/api\/v1\/attachments\/([0-9a-f-]{36})/;
|
|
5
5
|
function a(e) {
|
|
@@ -16,8 +16,8 @@ function o(e) {
|
|
|
16
16
|
return !1;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function s(
|
|
20
|
-
return
|
|
19
|
+
function s(e) {
|
|
20
|
+
return e.startsWith("/api/v1/attachments/") ? n + e : e;
|
|
21
21
|
}
|
|
22
22
|
var c = /\.(mp4|m4v|mov|webm)$/i;
|
|
23
23
|
function l(e) {
|
|
@@ -29,8 +29,8 @@ function l(e) {
|
|
|
29
29
|
return !1;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function u(
|
|
33
|
-
return l(
|
|
32
|
+
function u(e) {
|
|
33
|
+
return l(e) ? `${n}/api/v1/github/media?url=${encodeURIComponent(e)}` : s(e);
|
|
34
34
|
}
|
|
35
35
|
function d(e) {
|
|
36
36
|
if (!e) return !1;
|
|
@@ -42,11 +42,11 @@ function d(e) {
|
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
async function f(
|
|
46
|
-
return
|
|
45
|
+
async function f(n, r, i) {
|
|
46
|
+
return t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/attachments", {
|
|
47
47
|
params: {
|
|
48
48
|
path: {
|
|
49
|
-
workspace:
|
|
49
|
+
workspace: n,
|
|
50
50
|
identifier: r
|
|
51
51
|
},
|
|
52
52
|
query: { name: i.name || "file" }
|
|
@@ -56,11 +56,11 @@ async function f(e, r, i) {
|
|
|
56
56
|
headers: { "Content-Type": "application/octet-stream" }
|
|
57
57
|
}));
|
|
58
58
|
}
|
|
59
|
-
async function p(
|
|
60
|
-
return
|
|
59
|
+
async function p(n, r, i) {
|
|
60
|
+
return t(await e.POST("/api/v1/workspaces/{workspace}/knowledge/{entry}/attachments", {
|
|
61
61
|
params: {
|
|
62
62
|
path: {
|
|
63
|
-
workspace:
|
|
63
|
+
workspace: n,
|
|
64
64
|
entry: r
|
|
65
65
|
},
|
|
66
66
|
query: { name: i.name || "file" }
|
package/lib/boardMove.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { invalidateIssueViews as n } from "../api/mutations.js";
|
|
3
|
+
import { issueQuery as r, statusesQuery as i } from "../api/queries.js";
|
|
4
4
|
import { setIssueFields as a } from "./customFields.js";
|
|
5
5
|
import { toast as o } from "@parallelworks/ui";
|
|
6
6
|
import { useCallback as s } from "react";
|
|
@@ -8,46 +8,46 @@ import { useErrorMessage as c } from "@parallelworks/problem/react";
|
|
|
8
8
|
import { useQueries as l, useQueryClient as u } from "@tanstack/react-query";
|
|
9
9
|
// src/lib/boardMove.ts
|
|
10
10
|
function d(d, f) {
|
|
11
|
-
let p = u(), m = c(), h = l({ queries: f.map((e) =>
|
|
12
|
-
return s(async (
|
|
11
|
+
let p = u(), m = c(), h = l({ queries: f.map((e) => i(d, e.key)) });
|
|
12
|
+
return s(async (i, s, c, l, u, g) => {
|
|
13
13
|
let _, v, y;
|
|
14
14
|
if (g) {
|
|
15
15
|
let e = l === "none" ? null : l;
|
|
16
16
|
if (g.kind === "checkbox" && (e = l === "true"), g.kind === "multi_select") {
|
|
17
|
-
let t =
|
|
17
|
+
let t = i.fields[g.id] ?? [];
|
|
18
18
|
e = l === "none" ? [] : [...t.filter((e) => e !== c && e !== l), l];
|
|
19
19
|
}
|
|
20
20
|
v = { [g.id]: e }, y = {
|
|
21
|
-
...
|
|
21
|
+
...i,
|
|
22
22
|
fields: {
|
|
23
|
-
...
|
|
23
|
+
...i.fields,
|
|
24
24
|
[g.id]: e
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
} else if (s === "type") {
|
|
28
28
|
let e = l === "none" ? void 0 : u?.type;
|
|
29
29
|
_ = { typeId: l === "none" ? "" : l };
|
|
30
|
-
let { type: t, ...n } =
|
|
30
|
+
let { type: t, ...n } = i;
|
|
31
31
|
y = e ? {
|
|
32
32
|
...n,
|
|
33
33
|
type: e
|
|
34
34
|
} : n;
|
|
35
35
|
} else if (s === "status") {
|
|
36
|
-
let e = (h[f.findIndex((e) => e.id ===
|
|
36
|
+
let e = (h[f.findIndex((e) => e.id === i.teamId)]?.data ?? []).filter((e) => e.category === l).sort((e, t) => e.position - t.position)[0];
|
|
37
37
|
if (!e) return;
|
|
38
38
|
_ = { statusId: e.id }, y = {
|
|
39
|
-
...
|
|
39
|
+
...i,
|
|
40
40
|
status: e
|
|
41
41
|
};
|
|
42
42
|
} else if (s === "priority") _ = { priority: Number(l) }, y = {
|
|
43
|
-
...
|
|
43
|
+
...i,
|
|
44
44
|
priority: Number(l)
|
|
45
45
|
};
|
|
46
46
|
else if (s === "project") {
|
|
47
47
|
let e = l === "none" ? void 0 : u?.project;
|
|
48
48
|
if (l !== "none" && !e) return;
|
|
49
49
|
_ = { projectId: e?.id ?? "" };
|
|
50
|
-
let { project: t, ...n } =
|
|
50
|
+
let { project: t, ...n } = i;
|
|
51
51
|
y = e ? {
|
|
52
52
|
...n,
|
|
53
53
|
project: e
|
|
@@ -55,41 +55,41 @@ function d(d, f) {
|
|
|
55
55
|
} else if (s === "assignee") {
|
|
56
56
|
let e = (e) => `${e.kind}:${e.handle}`, t = l === "none" ? void 0 : u?.assignees.find((t) => e(t) === l);
|
|
57
57
|
if (l !== "none" && !t) return;
|
|
58
|
-
let n =
|
|
58
|
+
let n = i.assignees.find((t) => e(t) === c);
|
|
59
59
|
if (t) {
|
|
60
|
-
let e =
|
|
60
|
+
let e = i.assignees.filter((e) => e !== n);
|
|
61
61
|
_ = {
|
|
62
62
|
addAssignees: [t],
|
|
63
63
|
...n && { removeAssignees: [n] }
|
|
64
64
|
}, y = {
|
|
65
|
-
...
|
|
65
|
+
...i,
|
|
66
66
|
assignees: [...e, t]
|
|
67
67
|
};
|
|
68
|
-
} else _ = { removeAssignees:
|
|
69
|
-
...
|
|
68
|
+
} else _ = { removeAssignees: i.assignees }, y = {
|
|
69
|
+
...i,
|
|
70
70
|
assignees: []
|
|
71
71
|
};
|
|
72
72
|
} else {
|
|
73
73
|
let e = l === "none" ? void 0 : u?.labels.find((e) => e.id === l);
|
|
74
74
|
if (l !== "none" && !e) return;
|
|
75
|
-
let t =
|
|
75
|
+
let t = i.labels.find((e) => e.id === c);
|
|
76
76
|
if (e) {
|
|
77
|
-
let n =
|
|
77
|
+
let n = i.labels.filter((e) => e !== t);
|
|
78
78
|
_ = {
|
|
79
79
|
addLabels: [e.id],
|
|
80
80
|
...t && { removeLabels: [t.id] }
|
|
81
81
|
}, y = {
|
|
82
|
-
...
|
|
82
|
+
...i,
|
|
83
83
|
labels: [...n, e]
|
|
84
84
|
};
|
|
85
|
-
} else _ = { removeLabels:
|
|
86
|
-
...
|
|
85
|
+
} else _ = { removeLabels: i.labels.map((e) => e.id) }, y = {
|
|
86
|
+
...i,
|
|
87
87
|
labels: []
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
let b = (e) => ({
|
|
91
91
|
...e,
|
|
92
|
-
issues: e.issues.map((e) => e.id ===
|
|
92
|
+
issues: e.issues.map((e) => e.id === i.id ? y : e)
|
|
93
93
|
}), x = { queryKey: [
|
|
94
94
|
"workspace",
|
|
95
95
|
d,
|
|
@@ -108,18 +108,18 @@ function d(d, f) {
|
|
|
108
108
|
pages: e.pages.map(b)
|
|
109
109
|
});
|
|
110
110
|
try {
|
|
111
|
-
let
|
|
111
|
+
let n = v ? await a(d, i.identifier, v) : t(await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
|
|
112
112
|
params: { path: {
|
|
113
113
|
workspace: d,
|
|
114
|
-
identifier:
|
|
114
|
+
identifier: i.identifier
|
|
115
115
|
} },
|
|
116
116
|
body: _ ?? {}
|
|
117
117
|
}));
|
|
118
|
-
p.setQueryData(
|
|
118
|
+
p.setQueryData(r(d, i.identifier).queryKey, n);
|
|
119
119
|
} catch (e) {
|
|
120
120
|
o.error(m(e));
|
|
121
121
|
} finally {
|
|
122
|
-
|
|
122
|
+
n(p, d, i.identifier);
|
|
123
123
|
}
|
|
124
124
|
}, [
|
|
125
125
|
p,
|
package/lib/collab.js
CHANGED
|
@@ -115,7 +115,7 @@ function w({ workspace: e, target: t, user: n, getMarkdown: u }) {
|
|
|
115
115
|
}, F = (e, t) => {
|
|
116
116
|
t !== "remote" && (s.push(e), clearTimeout(l), l = setTimeout(N, _), t !== "seed" && (c = !0, clearTimeout(w), w = setTimeout(P, v)));
|
|
117
117
|
}, I = () => {
|
|
118
|
-
E = void 0,
|
|
118
|
+
E = void 0, t || a.awareness({
|
|
119
119
|
connId: d,
|
|
120
120
|
update: x(m(i, [n.clientID]))
|
|
121
121
|
}).catch(() => {});
|
package/lib/docs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { docTemplatesQuery as n, docsQuery as r, meQuery as i, teamsQuery as a } from "../api/queries.js";
|
|
3
|
+
import { appURL as o, basePath as s } from "./base.js";
|
|
4
|
+
import { useFavorites as c } from "./favorites.js";
|
|
5
|
+
import { copyItem as l, useLinkItems as u } from "./menus.js";
|
|
6
|
+
import { useNavigate as d } from "./router.js";
|
|
7
7
|
import { openShare as f } from "./share.js";
|
|
8
8
|
import { menuDivider as p } from "@parallelworks/ui";
|
|
9
9
|
import { useCallback as m } from "react";
|
|
@@ -18,7 +18,7 @@ function x(e) {
|
|
|
18
18
|
return /^[a-z2-7]{10}$/.test(t) ? t : e.toLowerCase();
|
|
19
19
|
}
|
|
20
20
|
function S() {
|
|
21
|
-
let e = h(), { data: t } = v(
|
|
21
|
+
let e = h(), { data: t } = v(i);
|
|
22
22
|
return m(() => {
|
|
23
23
|
let n = /* @__PURE__ */ new Date();
|
|
24
24
|
return {
|
|
@@ -31,77 +31,77 @@ function S() {
|
|
|
31
31
|
function C(e, t) {
|
|
32
32
|
return `/${e}/docs/${b(t)}`;
|
|
33
33
|
}
|
|
34
|
-
function w(
|
|
35
|
-
let
|
|
34
|
+
function w(r) {
|
|
35
|
+
let i = y(), o = d(), s = g("docs"), c = () => i.invalidateQueries({ queryKey: [
|
|
36
36
|
"workspace",
|
|
37
|
-
|
|
37
|
+
r,
|
|
38
38
|
"docs"
|
|
39
|
-
] }),
|
|
40
|
-
workspace:
|
|
41
|
-
doc:
|
|
42
|
-
} }),
|
|
43
|
-
mutationFn: async ({ team:
|
|
44
|
-
let o = a ?? await C(
|
|
45
|
-
return
|
|
46
|
-
params: { path: { workspace:
|
|
39
|
+
] }), l = (e) => ({ path: {
|
|
40
|
+
workspace: r,
|
|
41
|
+
doc: e
|
|
42
|
+
} }), u = S(), f = _({
|
|
43
|
+
mutationFn: async ({ team: n, parent: i, template: a }) => {
|
|
44
|
+
let o = a ?? await C(n, i);
|
|
45
|
+
return t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
|
|
46
|
+
params: { path: { workspace: r } },
|
|
47
47
|
body: {
|
|
48
48
|
...o ? {
|
|
49
49
|
template: o,
|
|
50
|
-
variables:
|
|
50
|
+
variables: u()
|
|
51
51
|
} : { title: s("untitled") },
|
|
52
|
-
...
|
|
52
|
+
...n && { team: n },
|
|
53
53
|
...i && { parent: i.key }
|
|
54
54
|
}
|
|
55
55
|
}));
|
|
56
56
|
},
|
|
57
|
-
onSuccess: (
|
|
58
|
-
|
|
57
|
+
onSuccess: (e) => {
|
|
58
|
+
c(), o({
|
|
59
59
|
to: "/$workspace/docs/$doc",
|
|
60
60
|
params: {
|
|
61
|
-
workspace:
|
|
62
|
-
doc: b(
|
|
61
|
+
workspace: r,
|
|
62
|
+
doc: b(e)
|
|
63
63
|
},
|
|
64
64
|
search: { rename: !0 }
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
}), p = _({
|
|
68
|
-
mutationFn: async ({ doc:
|
|
69
|
-
params:
|
|
70
|
-
body: { title:
|
|
68
|
+
mutationFn: async ({ doc: n, title: r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
69
|
+
params: l(n.key),
|
|
70
|
+
body: { title: r }
|
|
71
71
|
})),
|
|
72
|
-
onSettled:
|
|
72
|
+
onSettled: c
|
|
73
73
|
}), m = _({
|
|
74
|
-
mutationFn: async ({ doc:
|
|
75
|
-
params:
|
|
76
|
-
body: { area:
|
|
74
|
+
mutationFn: async ({ doc: n, area: r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
75
|
+
params: l(n.key),
|
|
76
|
+
body: { area: r }
|
|
77
77
|
})),
|
|
78
|
-
onSettled:
|
|
78
|
+
onSettled: c
|
|
79
79
|
}), h = _({
|
|
80
|
-
mutationFn: async ({ doc:
|
|
81
|
-
params:
|
|
80
|
+
mutationFn: async ({ doc: n, space: r, parent: i, after: a, before: o }) => t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/move", {
|
|
81
|
+
params: l(n.key),
|
|
82
82
|
body: {
|
|
83
|
-
...
|
|
83
|
+
...r && { space: r },
|
|
84
84
|
...i && { parent: i.key },
|
|
85
85
|
...a && { after: a.key },
|
|
86
86
|
...o && { before: o.key }
|
|
87
87
|
}
|
|
88
88
|
})),
|
|
89
|
-
onSettled:
|
|
89
|
+
onSettled: c
|
|
90
90
|
}), v = _({
|
|
91
|
-
mutationFn: async (
|
|
92
|
-
onSettled:
|
|
91
|
+
mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/archive", { params: l(n.key) })),
|
|
92
|
+
onSettled: c
|
|
93
93
|
}), x = _({
|
|
94
|
-
mutationFn: async (
|
|
95
|
-
onSettled:
|
|
96
|
-
}), C = async (
|
|
97
|
-
let [
|
|
98
|
-
return
|
|
94
|
+
mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/restore", { params: l(n.key) })),
|
|
95
|
+
onSettled: c
|
|
96
|
+
}), C = async (e, t) => {
|
|
97
|
+
let [o, s] = await Promise.all([i.fetchQuery(n(r)), i.fetchQuery(a(r))]), c = t ? t.teamId ?? "" : s.find((t) => t.key === e)?.id ?? "";
|
|
98
|
+
return o.find((e) => e.spaceDefault && (e.teamId ?? "") === c)?.id;
|
|
99
99
|
}, w = _({
|
|
100
|
-
mutationFn: async ({ doc:
|
|
101
|
-
params:
|
|
102
|
-
body: { spaceDefault:
|
|
100
|
+
mutationFn: async ({ doc: n, spaceDefault: r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
101
|
+
params: l(n.key),
|
|
102
|
+
body: { spaceDefault: r }
|
|
103
103
|
})),
|
|
104
|
-
onSettled:
|
|
104
|
+
onSettled: c
|
|
105
105
|
});
|
|
106
106
|
return {
|
|
107
107
|
create: f,
|
|
@@ -111,34 +111,34 @@ function w(e) {
|
|
|
111
111
|
archive: v,
|
|
112
112
|
restore: x,
|
|
113
113
|
setTemplate: _({
|
|
114
|
-
mutationFn: async ({ doc:
|
|
115
|
-
params:
|
|
116
|
-
body: { template:
|
|
114
|
+
mutationFn: async ({ doc: n, template: r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
115
|
+
params: l(n.key),
|
|
116
|
+
body: { template: r }
|
|
117
117
|
})),
|
|
118
|
-
onSettled:
|
|
118
|
+
onSettled: c
|
|
119
119
|
}),
|
|
120
120
|
setSpaceDefault: w,
|
|
121
121
|
setLook: _({
|
|
122
|
-
mutationFn: async ({ doc:
|
|
123
|
-
params:
|
|
124
|
-
body:
|
|
122
|
+
mutationFn: async ({ doc: n, ...r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
123
|
+
params: l(n.key),
|
|
124
|
+
body: r
|
|
125
125
|
})),
|
|
126
|
-
onMutate: ({ doc:
|
|
127
|
-
|
|
126
|
+
onMutate: ({ doc: e, ...t }) => {
|
|
127
|
+
i.setQueriesData({ queryKey: [
|
|
128
128
|
"workspace",
|
|
129
|
-
|
|
129
|
+
r,
|
|
130
130
|
"docs"
|
|
131
|
-
] }, (
|
|
132
|
-
...
|
|
133
|
-
...
|
|
134
|
-
} :
|
|
131
|
+
] }, (n) => n && typeof n == "object" && "id" in n && n.id === e.id ? {
|
|
132
|
+
...n,
|
|
133
|
+
...t
|
|
134
|
+
} : n);
|
|
135
135
|
},
|
|
136
|
-
onSettled:
|
|
136
|
+
onSettled: c
|
|
137
137
|
}),
|
|
138
138
|
duplicate: _({
|
|
139
|
-
mutationFn: async ({ doc:
|
|
140
|
-
let a =
|
|
141
|
-
params: { path: { workspace:
|
|
139
|
+
mutationFn: async ({ doc: n, team: i }) => {
|
|
140
|
+
let a = t(await e.GET("/api/v1/workspaces/{workspace}/docs/{doc}", { params: l(n.key) })), o = a.ancestors?.at(-1)?.key, c = t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
|
|
141
|
+
params: { path: { workspace: r } },
|
|
142
142
|
body: {
|
|
143
143
|
title: s("copyOf", { title: a.title }),
|
|
144
144
|
body: a.body ?? "",
|
|
@@ -146,17 +146,17 @@ function w(e) {
|
|
|
146
146
|
...o && { parent: o }
|
|
147
147
|
}
|
|
148
148
|
}));
|
|
149
|
-
return a.icon ?
|
|
150
|
-
params:
|
|
149
|
+
return a.icon ? t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
150
|
+
params: l(c.key),
|
|
151
151
|
body: { icon: a.icon }
|
|
152
152
|
})) : c;
|
|
153
153
|
},
|
|
154
|
-
onSuccess: (
|
|
155
|
-
|
|
154
|
+
onSuccess: (e) => {
|
|
155
|
+
c(), o({
|
|
156
156
|
to: "/$workspace/docs/$doc",
|
|
157
157
|
params: {
|
|
158
|
-
workspace:
|
|
159
|
-
doc: b(
|
|
158
|
+
workspace: r,
|
|
159
|
+
doc: b(e)
|
|
160
160
|
},
|
|
161
161
|
search: { rename: !0 }
|
|
162
162
|
});
|
|
@@ -165,28 +165,28 @@ function w(e) {
|
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
function T(e) {
|
|
168
|
-
let t =
|
|
169
|
-
return m((
|
|
170
|
-
let c = y.find((e) => e.id ===
|
|
171
|
-
label:
|
|
168
|
+
let t = d(), n = g("docs"), i = g("common"), o = g("favorites"), s = u(), h = c(e), _ = w(e), { data: y = [] } = v(a(e)), { data: x = [] } = v(r(e, { top: !0 }));
|
|
169
|
+
return m((r, { onRename: a } = {}) => {
|
|
170
|
+
let c = y.find((e) => e.id === r.teamId), u = c?.key ?? "workspace", d = {
|
|
171
|
+
label: i("open"),
|
|
172
172
|
onClick: () => t({
|
|
173
173
|
to: "/$workspace/docs/$doc",
|
|
174
174
|
params: {
|
|
175
175
|
workspace: e,
|
|
176
|
-
doc: b(
|
|
176
|
+
doc: b(r)
|
|
177
177
|
}
|
|
178
178
|
})
|
|
179
|
-
}, m = [...s(C(e,
|
|
180
|
-
if (
|
|
179
|
+
}, m = [...s(C(e, r)), l(n("copyKey"), r.key)];
|
|
180
|
+
if (r.archivedAt) return [
|
|
181
181
|
d,
|
|
182
182
|
{
|
|
183
183
|
label: n("restore"),
|
|
184
|
-
onClick: () => _.restore.mutate(
|
|
184
|
+
onClick: () => _.restore.mutate(r)
|
|
185
185
|
},
|
|
186
186
|
p,
|
|
187
187
|
...m
|
|
188
188
|
];
|
|
189
|
-
let g = x.filter((e) => e.id !==
|
|
189
|
+
let g = x.filter((e) => e.id !== r.id), v = [{
|
|
190
190
|
key: "workspace",
|
|
191
191
|
name: n("workspaceSpace")
|
|
192
192
|
}, ...y.filter((e) => !e.archivedAt).map((e) => ({
|
|
@@ -197,30 +197,30 @@ function T(e) {
|
|
|
197
197
|
d,
|
|
198
198
|
{
|
|
199
199
|
label: n("newInside"),
|
|
200
|
-
onClick: () => _.create.mutate({ parent:
|
|
200
|
+
onClick: () => _.create.mutate({ parent: r })
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
label: n("duplicate"),
|
|
204
204
|
onClick: () => _.duplicate.mutate({
|
|
205
|
-
doc:
|
|
205
|
+
doc: r,
|
|
206
206
|
team: c?.key
|
|
207
207
|
})
|
|
208
208
|
},
|
|
209
|
-
...
|
|
209
|
+
...a ? [{
|
|
210
210
|
label: n("rename"),
|
|
211
|
-
onClick:
|
|
211
|
+
onClick: a
|
|
212
212
|
}] : [],
|
|
213
213
|
{
|
|
214
214
|
label: n("moveTo"),
|
|
215
215
|
items: [
|
|
216
216
|
...v.map((e) => {
|
|
217
|
-
let t = !
|
|
217
|
+
let t = !r.parentId && e.key === u;
|
|
218
218
|
return {
|
|
219
219
|
label: n("topOf", { space: e.name }),
|
|
220
220
|
checked: t,
|
|
221
221
|
disabled: t,
|
|
222
222
|
onClick: () => _.move.mutate({
|
|
223
|
-
doc:
|
|
223
|
+
doc: r,
|
|
224
224
|
space: e.key
|
|
225
225
|
})
|
|
226
226
|
};
|
|
@@ -228,10 +228,10 @@ function T(e) {
|
|
|
228
228
|
...g.length > 0 ? [p] : [],
|
|
229
229
|
...g.map((e) => ({
|
|
230
230
|
label: e.title,
|
|
231
|
-
checked: e.id ===
|
|
232
|
-
disabled: e.id ===
|
|
231
|
+
checked: e.id === r.parentId,
|
|
232
|
+
disabled: e.id === r.parentId,
|
|
233
233
|
onClick: () => _.move.mutate({
|
|
234
|
-
doc:
|
|
234
|
+
doc: r,
|
|
235
235
|
parent: e
|
|
236
236
|
})
|
|
237
237
|
}))
|
|
@@ -240,40 +240,40 @@ function T(e) {
|
|
|
240
240
|
{
|
|
241
241
|
label: n("share"),
|
|
242
242
|
onClick: () => f({
|
|
243
|
-
doc:
|
|
244
|
-
title:
|
|
243
|
+
doc: r.key,
|
|
244
|
+
title: r.title
|
|
245
245
|
})
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
|
-
label: h.find("doc",
|
|
249
|
-
onClick: () => h.toggle("doc",
|
|
248
|
+
label: h.find("doc", r.id) ? o("remove") : o("add"),
|
|
249
|
+
onClick: () => h.toggle("doc", r.id)
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
label: n("look.fullWidth"),
|
|
253
|
-
checked: !!
|
|
253
|
+
checked: !!r.fullWidth,
|
|
254
254
|
onClick: () => _.setLook.mutate({
|
|
255
|
-
doc:
|
|
256
|
-
fullWidth: !
|
|
255
|
+
doc: r,
|
|
256
|
+
fullWidth: !r.fullWidth
|
|
257
257
|
})
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
|
-
label:
|
|
260
|
+
label: r.template ? n("stopTemplate") : n("useAsTemplate"),
|
|
261
261
|
onClick: () => _.setTemplate.mutate({
|
|
262
|
-
doc:
|
|
263
|
-
template: !
|
|
262
|
+
doc: r,
|
|
263
|
+
template: !r.template
|
|
264
264
|
})
|
|
265
265
|
},
|
|
266
|
-
...
|
|
266
|
+
...r.template ? [{
|
|
267
267
|
label: n("spaceDefault"),
|
|
268
|
-
checked: !!
|
|
268
|
+
checked: !!r.spaceDefault,
|
|
269
269
|
onClick: () => _.setSpaceDefault.mutate({
|
|
270
|
-
doc:
|
|
271
|
-
spaceDefault: !
|
|
270
|
+
doc: r,
|
|
271
|
+
spaceDefault: !r.spaceDefault
|
|
272
272
|
})
|
|
273
273
|
}] : [],
|
|
274
274
|
{
|
|
275
275
|
label: n("exportMarkdown"),
|
|
276
|
-
onClick: () => D(e, { doc:
|
|
276
|
+
onClick: () => D(e, { doc: r.key })
|
|
277
277
|
},
|
|
278
278
|
p,
|
|
279
279
|
...m,
|
|
@@ -281,7 +281,7 @@ function T(e) {
|
|
|
281
281
|
{
|
|
282
282
|
label: n("archive"),
|
|
283
283
|
destructive: !0,
|
|
284
|
-
onClick: () => _.archive.mutate(
|
|
284
|
+
onClick: () => _.archive.mutate(r)
|
|
285
285
|
}
|
|
286
286
|
];
|
|
287
287
|
}, [
|
|
@@ -293,18 +293,18 @@ function T(e) {
|
|
|
293
293
|
h,
|
|
294
294
|
_,
|
|
295
295
|
n,
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
i,
|
|
297
|
+
o
|
|
298
298
|
]);
|
|
299
299
|
}
|
|
300
|
-
function E(
|
|
301
|
-
return
|
|
300
|
+
function E(e, t) {
|
|
301
|
+
return o(C(e, t));
|
|
302
302
|
}
|
|
303
|
-
function D(e,
|
|
304
|
-
let
|
|
305
|
-
...
|
|
306
|
-
...
|
|
307
|
-
}),
|
|
308
|
-
|
|
303
|
+
function D(e, t) {
|
|
304
|
+
let n = new URLSearchParams({
|
|
305
|
+
...t,
|
|
306
|
+
...t.space && { knowledge: "true" }
|
|
307
|
+
}), r = document.createElement("a");
|
|
308
|
+
r.href = `${s}/api/v1/workspaces/${encodeURIComponent(e)}/docs/export?${n}`, r.download = "", r.click();
|
|
309
309
|
}
|
|
310
310
|
export { x as docKey, C as docPath, b as docRef, E as docURL, D as downloadMarkdown, w as useDocActions, T as useDocMenu, S as useTemplateValues };
|
package/lib/githubLink.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { api as e } from "../api/client.js";
|
|
2
|
+
import { basePath as t } from "./base.js";
|
|
3
3
|
// src/lib/githubLink.ts
|
|
4
4
|
var n;
|
|
5
5
|
function r() {
|
|
6
|
-
return n ??=
|
|
7
|
-
if (!
|
|
8
|
-
if (
|
|
9
|
-
let n = window.location.pathname.slice(
|
|
10
|
-
return n ? `${
|
|
6
|
+
return n ??= e.GET("/api/v1/me/github").then(({ data: e }) => {
|
|
7
|
+
if (!e?.enabled || !e.keepsTokens || e.actsAsYou) return null;
|
|
8
|
+
if (e.linkedByHost) return e.linkURL ?? null;
|
|
9
|
+
let n = window.location.pathname.slice(t.length).split("/")[1];
|
|
10
|
+
return n ? `${t}/${n}/settings/connections` : null;
|
|
11
11
|
}).catch(() => null), n;
|
|
12
12
|
}
|
|
13
13
|
export { r as githubLinkPage };
|