@parallelworks/tandem-web 0.171.0 → 0.171.2
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 +1 -0
- package/_virtual/_virtual_i18n/es/common.js +1 -0
- package/_virtual/_virtual_i18n/ja/common.js +1 -0
- package/_virtual/_virtual_i18n/ko/common.js +1 -0
- package/_virtual/_virtual_i18n/zh/common.js +1 -0
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +57 -57
- package/components/ActorAvatar.js +4 -4
- 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 +29 -29
- package/components/BlockHandle.js +3 -3
- package/components/BugRotation.js +8 -8
- package/components/CodeHostSettings.js +38 -38
- 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 +23 -23
- 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 +12 -12
- package/components/IssueFilters.js +103 -99
- 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 +4 -4
- 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 +4 -4
- 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/assigneeOrder.js +6 -0
- package/lib/assignees.js +24 -20
- 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/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 +109 -109
- 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 +477 -477
- package/routes/_workspace/issues/index.js +13 -13
- package/routes/_workspace/knowledge/_term2.js +175 -175
- package/routes/_workspace/knowledge/_term3.js +4 -4
- package/routes/_workspace/knowledge/index.js +12 -12
- package/routes/_workspace/knowledge/index2.js +117 -117
- 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/live.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { api as e } from "../api/client.js";
|
|
2
|
+
import { invalidateIssueViews as t } from "../api/mutations.js";
|
|
3
|
+
import { basePath as n } from "./base.js";
|
|
4
|
+
import { pageOf as r } from "./presencePage.js";
|
|
5
|
+
import { usePathname as i } from "./router.js";
|
|
6
6
|
import { createContext as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
7
7
|
import { jsx as f } from "react/jsx-runtime";
|
|
8
8
|
import { useQueryClient as p } from "@tanstack/react-query";
|
|
@@ -22,25 +22,25 @@ function _(e) {
|
|
|
22
22
|
}
|
|
23
23
|
var v = 1e4;
|
|
24
24
|
function y({ workspace: a, children: s }) {
|
|
25
|
-
let m = p(), [y, b] = d([]), x = l(() => crypto.randomUUID(), []), S = u({}), C =
|
|
25
|
+
let m = p(), [y, b] = d([]), x = l(() => crypto.randomUUID(), []), S = u({}), C = i(), w = r(C, a), T = u(w), E = u(/* @__PURE__ */ new Map()), D = o((e, t) => {
|
|
26
26
|
let n = E.current.get(e) ?? /* @__PURE__ */ new Set();
|
|
27
27
|
return n.add(t), E.current.set(e, n), () => {
|
|
28
28
|
n.delete(t);
|
|
29
29
|
};
|
|
30
30
|
}, []);
|
|
31
31
|
c(() => {
|
|
32
|
-
let
|
|
32
|
+
let e = new EventSource(`${n}/api/v1/workspaces/${encodeURIComponent(a)}/live`), r = () => {
|
|
33
33
|
m.invalidateQueries({ queryKey: ["workspace", a] }), m.invalidateQueries({ queryKey: ["decisions"] }), m.invalidateQueries({ queryKey: ["me"] });
|
|
34
34
|
}, i = !1;
|
|
35
|
-
|
|
36
|
-
i &&
|
|
37
|
-
}),
|
|
38
|
-
let
|
|
39
|
-
if ((
|
|
35
|
+
e.addEventListener("open", () => {
|
|
36
|
+
i && r(), i = !0;
|
|
37
|
+
}), e.addEventListener("resync", r), e.addEventListener("presence", (e) => b(JSON.parse(e.data).people)), e.addEventListener("change", (e) => {
|
|
38
|
+
let n = JSON.parse(e.data);
|
|
39
|
+
if ((n.type.startsWith("decision.") || n.type.startsWith("run.")) && (m.invalidateQueries({ queryKey: [
|
|
40
40
|
"workspace",
|
|
41
41
|
a,
|
|
42
42
|
"decisions"
|
|
43
|
-
] }), m.invalidateQueries({ queryKey: ["decisions"] })),
|
|
43
|
+
] }), m.invalidateQueries({ queryKey: ["decisions"] })), n.type.startsWith("workspace.") && (m.invalidateQueries({ queryKey: ["workspace", a] }), m.invalidateQueries({ queryKey: ["me"] })), n.type.startsWith("area.") && (m.invalidateQueries({ queryKey: [
|
|
44
44
|
"workspace",
|
|
45
45
|
a,
|
|
46
46
|
"areas"
|
|
@@ -54,11 +54,11 @@ function y({ workspace: a, children: s }) {
|
|
|
54
54
|
a,
|
|
55
55
|
"decisions",
|
|
56
56
|
"counts"
|
|
57
|
-
] })),
|
|
57
|
+
] })), n.type.startsWith("agent.") && m.invalidateQueries({ queryKey: [
|
|
58
58
|
"workspace",
|
|
59
59
|
a,
|
|
60
60
|
"agents"
|
|
61
|
-
] }),
|
|
61
|
+
] }), n.type.startsWith("knowledge.")) m.invalidateQueries({ queryKey: [
|
|
62
62
|
"workspace",
|
|
63
63
|
a,
|
|
64
64
|
"knowledge"
|
|
@@ -67,7 +67,7 @@ function y({ workspace: a, children: s }) {
|
|
|
67
67
|
a,
|
|
68
68
|
"decisions"
|
|
69
69
|
] }), m.invalidateQueries({ queryKey: ["decisions"] });
|
|
70
|
-
else if (
|
|
70
|
+
else if (n.type.startsWith("doc.") || n.doc) m.invalidateQueries({ queryKey: [
|
|
71
71
|
"workspace",
|
|
72
72
|
a,
|
|
73
73
|
"docs"
|
|
@@ -76,47 +76,47 @@ function y({ workspace: a, children: s }) {
|
|
|
76
76
|
a,
|
|
77
77
|
"favorites"
|
|
78
78
|
] });
|
|
79
|
-
else if (
|
|
79
|
+
else if (n.type === "issue.parent_changed" || n.type.startsWith("issue.relation_")) m.invalidateQueries({ queryKey: [
|
|
80
80
|
"workspace",
|
|
81
81
|
a,
|
|
82
82
|
"issues"
|
|
83
83
|
] });
|
|
84
|
-
else if (
|
|
84
|
+
else if (n.type.startsWith("issue.reaction_") && n.identifier) m.invalidateQueries({ queryKey: [
|
|
85
85
|
"workspace",
|
|
86
86
|
a,
|
|
87
87
|
"issues",
|
|
88
|
-
|
|
88
|
+
n.identifier.toUpperCase(),
|
|
89
89
|
"reactions"
|
|
90
90
|
] });
|
|
91
|
-
else if (
|
|
92
|
-
let e =
|
|
91
|
+
else if (n.identifier) {
|
|
92
|
+
let e = n.identifier.toUpperCase();
|
|
93
93
|
m.invalidateQueries({ queryKey: [
|
|
94
94
|
"workspace",
|
|
95
95
|
a,
|
|
96
96
|
"issues",
|
|
97
97
|
e
|
|
98
|
-
] }),
|
|
99
|
-
} else
|
|
98
|
+
] }), t(m, a, e);
|
|
99
|
+
} else n.type.startsWith("project.") ? (m.invalidateQueries({ queryKey: [
|
|
100
100
|
"workspace",
|
|
101
101
|
a,
|
|
102
102
|
"projects"
|
|
103
|
-
] }),
|
|
103
|
+
] }), n.type !== "project.created" && m.invalidateQueries({ queryKey: [
|
|
104
104
|
"workspace",
|
|
105
105
|
a,
|
|
106
106
|
"issues"
|
|
107
|
-
] })) :
|
|
107
|
+
] })) : n.type.startsWith("cycle.") ? (m.invalidateQueries({ queryKey: [
|
|
108
108
|
"workspace",
|
|
109
109
|
a,
|
|
110
110
|
"cycles"
|
|
111
|
-
] }),
|
|
111
|
+
] }), n.type !== "cycle.created" && m.invalidateQueries({ queryKey: [
|
|
112
112
|
"workspace",
|
|
113
113
|
a,
|
|
114
114
|
"issues"
|
|
115
|
-
] })) :
|
|
115
|
+
] })) : n.type.startsWith("team.") ? (m.invalidateQueries({ queryKey: [
|
|
116
116
|
"workspace",
|
|
117
117
|
a,
|
|
118
118
|
"teams"
|
|
119
|
-
] }),
|
|
119
|
+
] }), n.type.startsWith("team.status_") && m.invalidateQueries({ queryKey: [
|
|
120
120
|
"workspace",
|
|
121
121
|
a,
|
|
122
122
|
"issues"
|
|
@@ -124,16 +124,16 @@ function y({ workspace: a, children: s }) {
|
|
|
124
124
|
"workspace",
|
|
125
125
|
a,
|
|
126
126
|
"cycles"
|
|
127
|
-
] })) :
|
|
127
|
+
] })) : n.type.startsWith("label.") && (m.invalidateQueries({ queryKey: [
|
|
128
128
|
"workspace",
|
|
129
129
|
a,
|
|
130
130
|
"labels"
|
|
131
|
-
] }),
|
|
131
|
+
] }), n.type !== "label.created" && m.invalidateQueries({ queryKey: [
|
|
132
132
|
"workspace",
|
|
133
133
|
a,
|
|
134
134
|
"issues"
|
|
135
135
|
] }));
|
|
136
|
-
}),
|
|
136
|
+
}), e.addEventListener("notification", () => {
|
|
137
137
|
m.invalidateQueries({ queryKey: [
|
|
138
138
|
"workspace",
|
|
139
139
|
a,
|
|
@@ -143,7 +143,7 @@ function y({ workspace: a, children: s }) {
|
|
|
143
143
|
let o = (e, t) => {
|
|
144
144
|
for (let n of E.current.get(e) ?? []) n(t);
|
|
145
145
|
};
|
|
146
|
-
return
|
|
146
|
+
return e.addEventListener("doc_update", (e) => {
|
|
147
147
|
let t = JSON.parse(e.data);
|
|
148
148
|
o(h(t), {
|
|
149
149
|
kind: "update",
|
|
@@ -152,30 +152,30 @@ function y({ workspace: a, children: s }) {
|
|
|
152
152
|
connId: t.connId,
|
|
153
153
|
update: _(t.update)
|
|
154
154
|
});
|
|
155
|
-
}),
|
|
155
|
+
}), e.addEventListener("doc_reset", (e) => {
|
|
156
156
|
let t = JSON.parse(e.data);
|
|
157
157
|
o(h(t), {
|
|
158
158
|
kind: "reset",
|
|
159
159
|
generation: t.generation
|
|
160
160
|
});
|
|
161
|
-
}),
|
|
161
|
+
}), e.addEventListener("doc_awareness", (e) => {
|
|
162
162
|
let t = JSON.parse(e.data);
|
|
163
163
|
o(h(t), {
|
|
164
164
|
kind: "awareness",
|
|
165
165
|
connId: t.connId,
|
|
166
166
|
update: _(t.update)
|
|
167
167
|
});
|
|
168
|
-
}), () =>
|
|
168
|
+
}), () => e.close();
|
|
169
169
|
}, [a, m]);
|
|
170
|
-
let O = o((
|
|
170
|
+
let O = o((t = !1) => e.POST("/api/v1/workspaces/{workspace}/presence", {
|
|
171
171
|
params: { path: { workspace: a } },
|
|
172
172
|
body: {
|
|
173
173
|
connId: x,
|
|
174
174
|
...S.current,
|
|
175
175
|
...T.current && { page: T.current },
|
|
176
|
-
...
|
|
176
|
+
...t && { leave: !0 }
|
|
177
177
|
},
|
|
178
|
-
...
|
|
178
|
+
...t && { keepalive: !0 }
|
|
179
179
|
}).catch(() => {}), [a, x]);
|
|
180
180
|
c(() => {
|
|
181
181
|
O();
|
package/lib/notifications.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { notificationsQuery as n, pushSettingsQuery as r } from "../api/queries.js";
|
|
3
|
+
import { basePath as i } from "./base.js";
|
|
4
4
|
import { markRead as a } from "./notificationRead.js";
|
|
5
5
|
import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
6
6
|
import { useTranslations as u } from "use-intl";
|
|
7
7
|
import { useMutation as d, useQuery as f, useQueryClient as p } from "@tanstack/react-query";
|
|
8
8
|
// src/lib/notifications.ts
|
|
9
|
-
async function m(e, t,
|
|
10
|
-
let { queryKey: o } =
|
|
9
|
+
async function m(e, t, r, i) {
|
|
10
|
+
let { queryKey: o } = n(t);
|
|
11
11
|
await e.cancelQueries({ queryKey: o });
|
|
12
12
|
let s = (/* @__PURE__ */ new Date()).toISOString();
|
|
13
|
-
e.setQueryData(o, (e) => e && a(e,
|
|
13
|
+
e.setQueryData(o, (e) => e && a(e, r, i, s));
|
|
14
14
|
}
|
|
15
|
-
function h(
|
|
15
|
+
function h(r) {
|
|
16
16
|
let i = p();
|
|
17
17
|
return d({
|
|
18
|
-
mutationFn: async (
|
|
19
|
-
|
|
20
|
-
workspace:
|
|
21
|
-
...
|
|
22
|
-
} })), await x(
|
|
18
|
+
mutationFn: async (n) => {
|
|
19
|
+
t(await e.POST("/api/v1/notifications/read", { body: {
|
|
20
|
+
workspace: r,
|
|
21
|
+
...n && { ids: n }
|
|
22
|
+
} })), await x(n);
|
|
23
23
|
},
|
|
24
|
-
onMutate: (
|
|
25
|
-
onSettled: () => i.invalidateQueries({ queryKey: r
|
|
24
|
+
onMutate: (e) => m(i, r, e, !0),
|
|
25
|
+
onSettled: () => i.invalidateQueries({ queryKey: n(r).queryKey })
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
function g(
|
|
28
|
+
function g(r) {
|
|
29
29
|
let i = p();
|
|
30
30
|
return d({
|
|
31
|
-
mutationFn: async (
|
|
32
|
-
workspace:
|
|
33
|
-
ids:
|
|
31
|
+
mutationFn: async (n) => t(await e.POST("/api/v1/notifications/unread", { body: {
|
|
32
|
+
workspace: r,
|
|
33
|
+
ids: n
|
|
34
34
|
} })),
|
|
35
|
-
onMutate: (
|
|
36
|
-
onSettled: () => i.invalidateQueries({ queryKey: r
|
|
35
|
+
onMutate: (e) => m(i, r, e, !1),
|
|
36
|
+
onSettled: () => i.invalidateQueries({ queryKey: n(r).queryKey })
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
function _(
|
|
39
|
+
function _(r) {
|
|
40
40
|
let i = p();
|
|
41
41
|
return d({
|
|
42
|
-
mutationFn: async (
|
|
43
|
-
|
|
44
|
-
workspace:
|
|
45
|
-
...
|
|
46
|
-
} })),
|
|
42
|
+
mutationFn: async (n) => {
|
|
43
|
+
t(await e.POST("/api/v1/notifications/archive", { body: {
|
|
44
|
+
workspace: r,
|
|
45
|
+
...n && { ids: n }
|
|
46
|
+
} })), n && await x(n);
|
|
47
47
|
},
|
|
48
|
-
onSettled: () => i.invalidateQueries({ queryKey: r
|
|
48
|
+
onSettled: () => i.invalidateQueries({ queryKey: n(r).queryKey })
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
function v(e, t) {
|
|
52
|
-
let { data:
|
|
52
|
+
let { data: r } = f(n(e)), { mutate: i } = h(e), a = c(/* @__PURE__ */ new Set()), o = t.toUpperCase(), l = (r?.notifications ?? []).filter((e) => !e.readAt && e.identifier.toUpperCase() === o && !a.current.has(e.id)).map((e) => e.id).join(",");
|
|
53
53
|
s(() => {
|
|
54
54
|
if (!l) return;
|
|
55
55
|
let e = l.split(",");
|
|
@@ -57,7 +57,7 @@ function v(e, t) {
|
|
|
57
57
|
i(e);
|
|
58
58
|
}, [l, i]);
|
|
59
59
|
}
|
|
60
|
-
var y = () => `${
|
|
60
|
+
var y = () => `${i}/`;
|
|
61
61
|
async function b() {
|
|
62
62
|
if ("serviceWorker" in navigator) return navigator.serviceWorker.getRegistration(y());
|
|
63
63
|
}
|
|
@@ -92,52 +92,52 @@ function T() {
|
|
|
92
92
|
fallback: e.raw("fallback")
|
|
93
93
|
}), [e]);
|
|
94
94
|
}
|
|
95
|
-
async function E(
|
|
96
|
-
await navigator.serviceWorker.register(`${
|
|
95
|
+
async function E(n, r) {
|
|
96
|
+
await navigator.serviceWorker.register(`${i}/sw.js`, { scope: y() });
|
|
97
97
|
let a = await navigator.serviceWorker.ready;
|
|
98
98
|
a.active?.postMessage({
|
|
99
99
|
type: "messages",
|
|
100
|
-
messages:
|
|
100
|
+
messages: r
|
|
101
101
|
});
|
|
102
|
-
let o = C(
|
|
102
|
+
let o = C(n), s = await a.pushManager.getSubscription();
|
|
103
103
|
s && !w(s, o) && (await s.unsubscribe(), s = null), s ??= await a.pushManager.subscribe({
|
|
104
104
|
userVisibleOnly: !0,
|
|
105
105
|
applicationServerKey: o
|
|
106
|
-
}),
|
|
106
|
+
}), t(await e.POST("/api/v1/push/subscriptions", { body: { endpoint: s.endpoint } }));
|
|
107
107
|
}
|
|
108
108
|
function D() {
|
|
109
|
-
let { data:
|
|
109
|
+
let { data: t } = f(r), n = T(), [i, a] = l("off"), [c, u] = l(!1), d = o(async () => {
|
|
110
110
|
if (!S()) return a("unsupported");
|
|
111
|
-
if (!
|
|
112
|
-
if (!
|
|
111
|
+
if (!t) return;
|
|
112
|
+
if (!t.enabled) return a("unavailable");
|
|
113
113
|
if (Notification.permission === "denied") return a("denied");
|
|
114
|
-
let
|
|
115
|
-
a(
|
|
116
|
-
}, [
|
|
114
|
+
let e = await (await b())?.pushManager.getSubscription();
|
|
115
|
+
a(e && Notification.permission === "granted" ? "on" : "off");
|
|
116
|
+
}, [t]);
|
|
117
117
|
return s(() => {
|
|
118
118
|
d();
|
|
119
119
|
}, [d]), {
|
|
120
|
-
state:
|
|
120
|
+
state: i,
|
|
121
121
|
pending: c,
|
|
122
122
|
enable: o(async () => {
|
|
123
|
-
if (
|
|
123
|
+
if (t?.publicKey) {
|
|
124
124
|
u(!0);
|
|
125
125
|
try {
|
|
126
|
-
await Notification.requestPermission() === "granted" && await E(
|
|
126
|
+
await Notification.requestPermission() === "granted" && await E(t.publicKey, n());
|
|
127
127
|
} finally {
|
|
128
128
|
u(!1), await d();
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
}, [
|
|
132
|
-
|
|
132
|
+
t,
|
|
133
133
|
n,
|
|
134
134
|
d
|
|
135
135
|
]),
|
|
136
136
|
disable: o(async () => {
|
|
137
137
|
u(!0);
|
|
138
138
|
try {
|
|
139
|
-
let
|
|
140
|
-
|
|
139
|
+
let t = await (await b())?.pushManager.getSubscription();
|
|
140
|
+
t && (await e.DELETE("/api/v1/push/subscriptions", { params: { query: { endpoint: t.endpoint } } }), await t.unsubscribe());
|
|
141
141
|
} finally {
|
|
142
142
|
u(!1), await d();
|
|
143
143
|
}
|
|
@@ -145,7 +145,7 @@ function D() {
|
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
function O() {
|
|
148
|
-
let { data: e } = f(
|
|
148
|
+
let { data: e } = f(r), t = T();
|
|
149
149
|
s(() => {
|
|
150
150
|
S() && e?.enabled && e.publicKey && Notification.permission === "granted" && b().then(async (n) => {
|
|
151
151
|
n && await n.pushManager.getSubscription() && await E(e.publicKey, t());
|
package/lib/views.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { viewsQuery as n } from "../api/queries.js";
|
|
3
|
+
import { ViewDialog as r } from "../components/ViewDialog.js";
|
|
4
|
+
import { useConfirm as i } from "./confirm.js";
|
|
5
|
+
import { useLinkItems as a } from "./menus.js";
|
|
6
6
|
import { viewRef as o } from "./refs.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useNavigate as s } from "./router.js";
|
|
8
|
+
import { issuesHref as c } from "./teamPaths.js";
|
|
9
9
|
import { menuDivider as l } from "@parallelworks/ui";
|
|
10
10
|
import { useState as u } from "react";
|
|
11
11
|
import { useTranslations as d } from "use-intl";
|
|
@@ -51,73 +51,73 @@ function x(e) {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
function S(e, t) {
|
|
54
|
-
return
|
|
54
|
+
return c(e, x(t));
|
|
55
55
|
}
|
|
56
|
-
function C(
|
|
57
|
-
let i = _(), { data: a = [] } = g(r
|
|
56
|
+
function C(r) {
|
|
57
|
+
let i = _(), { data: a = [] } = g(n(r)), o = () => i.invalidateQueries({ queryKey: n(r).queryKey });
|
|
58
58
|
return {
|
|
59
59
|
views: a,
|
|
60
60
|
create: h({
|
|
61
|
-
mutationFn: async (
|
|
62
|
-
params: { path: { workspace:
|
|
63
|
-
body:
|
|
61
|
+
mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/views", {
|
|
62
|
+
params: { path: { workspace: r } },
|
|
63
|
+
body: n
|
|
64
64
|
})),
|
|
65
65
|
onSettled: o
|
|
66
66
|
}),
|
|
67
67
|
update: h({
|
|
68
|
-
mutationFn: async ({ id:
|
|
68
|
+
mutationFn: async ({ id: n, ...i }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/views/{viewId}", {
|
|
69
69
|
params: { path: {
|
|
70
|
-
workspace:
|
|
71
|
-
viewId:
|
|
70
|
+
workspace: r,
|
|
71
|
+
viewId: n
|
|
72
72
|
} },
|
|
73
73
|
body: i
|
|
74
74
|
})),
|
|
75
75
|
onSettled: o
|
|
76
76
|
}),
|
|
77
77
|
remove: h({
|
|
78
|
-
mutationFn: async (
|
|
79
|
-
workspace:
|
|
80
|
-
viewId:
|
|
78
|
+
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/views/{viewId}", { params: { path: {
|
|
79
|
+
workspace: r,
|
|
80
|
+
viewId: n
|
|
81
81
|
} } })),
|
|
82
82
|
onSettled: o
|
|
83
83
|
})
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
function w(e) {
|
|
87
|
-
let t = d("savedViews"),
|
|
87
|
+
let t = d("savedViews"), n = d("common"), o = s(), c = a(), { update: h, remove: g } = C(e), { confirm: _, dialog: v } = i(), [y, b] = u(null);
|
|
88
88
|
return {
|
|
89
|
-
menu: (
|
|
89
|
+
menu: (r) => [
|
|
90
90
|
{
|
|
91
|
-
label:
|
|
91
|
+
label: n("open"),
|
|
92
92
|
onClick: () => o({
|
|
93
93
|
to: "/$workspace/issues",
|
|
94
94
|
params: { workspace: e },
|
|
95
|
-
search: x(
|
|
95
|
+
search: x(r)
|
|
96
96
|
})
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
label: t("rename"),
|
|
100
|
-
disabled: !
|
|
101
|
-
onClick: () => b(
|
|
100
|
+
disabled: !r.canEdit,
|
|
101
|
+
onClick: () => b(r)
|
|
102
102
|
},
|
|
103
103
|
l,
|
|
104
|
-
...
|
|
104
|
+
...c(S(e, r)),
|
|
105
105
|
l,
|
|
106
106
|
{
|
|
107
107
|
label: t("delete"),
|
|
108
108
|
destructive: !0,
|
|
109
|
-
disabled: !
|
|
109
|
+
disabled: !r.canDelete,
|
|
110
110
|
onClick: () => _({
|
|
111
|
-
title: t("deleteTitle", { name:
|
|
112
|
-
description:
|
|
111
|
+
title: t("deleteTitle", { name: r.name }),
|
|
112
|
+
description: r.shared ? t("deleteShared") : t("deletePersonal"),
|
|
113
113
|
confirmLabel: t("delete"),
|
|
114
|
-
onConfirm: () => g.mutateAsync(
|
|
114
|
+
onConfirm: () => g.mutateAsync(r.id)
|
|
115
115
|
})
|
|
116
116
|
}
|
|
117
117
|
],
|
|
118
|
-
dialogs: /* @__PURE__ */ m(f, { children: [v, y && /* @__PURE__ */ p(
|
|
118
|
+
dialogs: /* @__PURE__ */ m(f, { children: [v, y && /* @__PURE__ */ p(r, {
|
|
119
119
|
title: t("renameTitle"),
|
|
120
|
-
submitLabel:
|
|
120
|
+
submitLabel: n("save"),
|
|
121
121
|
defaultName: y.name,
|
|
122
122
|
onClose: () => b(null),
|
|
123
123
|
onSubmit: ({ name: e }) => h.mutateAsync({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parallelworks/tandem-web",
|
|
3
|
-
"version": "0.171.
|
|
3
|
+
"version": "0.171.2",
|
|
4
4
|
"description": "Tandem's pages, for a host app to render in its own",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -15,34 +15,34 @@
|
|
|
15
15
|
"./styles.css": "./styles.css"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@dagrejs/dagre": "3.1.
|
|
18
|
+
"@dagrejs/dagre": "3.1.3",
|
|
19
19
|
"@fontsource-variable/public-sans": "^5.3.0",
|
|
20
20
|
"@parallelworks/api-docs": "^0.4.0",
|
|
21
21
|
"@parallelworks/i18n": "^0.3.0",
|
|
22
|
-
"@parallelworks/problem": "^0.6.
|
|
23
|
-
"@tanstack/react-query": "^5.
|
|
24
|
-
"@tanstack/react-virtual": "3.14.
|
|
25
|
-
"@tiptap/extension-blockquote": "3.
|
|
26
|
-
"@tiptap/extension-code-block-lowlight": "3.
|
|
27
|
-
"@tiptap/extension-collaboration": "^3.
|
|
28
|
-
"@tiptap/extension-collaboration-caret": "^3.
|
|
29
|
-
"@tiptap/extension-details": "3.
|
|
30
|
-
"@tiptap/extension-drag-handle": "3.
|
|
31
|
-
"@tiptap/extension-drag-handle-react": "3.
|
|
32
|
-
"@tiptap/extension-image": "^3.
|
|
33
|
-
"@tiptap/extension-list": "^3.
|
|
34
|
-
"@tiptap/extension-node-range": "3.
|
|
35
|
-
"@tiptap/extension-table": "3.
|
|
36
|
-
"@tiptap/extensions": "^3.
|
|
37
|
-
"@tiptap/markdown": "^3.
|
|
38
|
-
"@tiptap/pm": "^3.
|
|
39
|
-
"@tiptap/react": "^3.
|
|
40
|
-
"@tiptap/starter-kit": "^3.
|
|
41
|
-
"@xyflow/react": "12.12.
|
|
22
|
+
"@parallelworks/problem": "^0.6.1",
|
|
23
|
+
"@tanstack/react-query": "^5.107.1",
|
|
24
|
+
"@tanstack/react-virtual": "3.14.26",
|
|
25
|
+
"@tiptap/extension-blockquote": "3.33.0",
|
|
26
|
+
"@tiptap/extension-code-block-lowlight": "3.33.0",
|
|
27
|
+
"@tiptap/extension-collaboration": "^3.33.0",
|
|
28
|
+
"@tiptap/extension-collaboration-caret": "^3.33.0",
|
|
29
|
+
"@tiptap/extension-details": "3.33.0",
|
|
30
|
+
"@tiptap/extension-drag-handle": "3.33.0",
|
|
31
|
+
"@tiptap/extension-drag-handle-react": "3.33.0",
|
|
32
|
+
"@tiptap/extension-image": "^3.33.0",
|
|
33
|
+
"@tiptap/extension-list": "^3.33.0",
|
|
34
|
+
"@tiptap/extension-node-range": "3.33.0",
|
|
35
|
+
"@tiptap/extension-table": "3.33.0",
|
|
36
|
+
"@tiptap/extensions": "^3.33.0",
|
|
37
|
+
"@tiptap/markdown": "^3.33.0",
|
|
38
|
+
"@tiptap/pm": "^3.33.0",
|
|
39
|
+
"@tiptap/react": "^3.33.0",
|
|
40
|
+
"@tiptap/starter-kit": "^3.33.0",
|
|
41
|
+
"@xyflow/react": "12.12.1",
|
|
42
42
|
"highlight.js": "11.12.0",
|
|
43
|
-
"katex": "^0.19.
|
|
43
|
+
"katex": "^0.19.1",
|
|
44
44
|
"lowlight": "^3.3.0",
|
|
45
|
-
"mermaid": "
|
|
45
|
+
"mermaid": "12.3.0",
|
|
46
46
|
"openapi-fetch": "^0.17.0",
|
|
47
47
|
"y-prosemirror": "^1.3.7",
|
|
48
48
|
"y-protocols": "^1.0.7",
|