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