@parallelworks/tandem-web 0.171.1 → 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.
Files changed (164) hide show
  1. package/components/AccessGrants.js +6 -6
  2. package/components/ActivityTimeline.js +57 -57
  3. package/components/ActorAvatar.js +4 -4
  4. package/components/AgentWork.js +494 -494
  5. package/components/AppLauncher.js +7 -7
  6. package/components/AreaLink.js +13 -13
  7. package/components/AreaTiles.js +13 -13
  8. package/components/AreaWork.js +22 -22
  9. package/components/Attachments.js +29 -29
  10. package/components/BlockHandle.js +3 -3
  11. package/components/BugRotation.js +8 -8
  12. package/components/CodeHostSettings.js +38 -38
  13. package/components/CollabEditor.js +13 -13
  14. package/components/CommandPalette.js +206 -206
  15. package/components/CustomFields.js +95 -95
  16. package/components/CustomerRequests.js +11 -11
  17. package/components/DashboardPanel.js +23 -23
  18. package/components/DateChip.js +21 -21
  19. package/components/DocHistory.js +14 -14
  20. package/components/DocIcon.js +4 -4
  21. package/components/DocIconPicker.js +4 -4
  22. package/components/DocLinkPicker.js +22 -22
  23. package/components/DocLook.js +16 -16
  24. package/components/DocProperties.js +81 -81
  25. package/components/DocTable.js +53 -53
  26. package/components/DocsTree.js +179 -179
  27. package/components/Editor.js +69 -69
  28. package/components/FavoritesNav.js +78 -78
  29. package/components/GitHub.js +87 -87
  30. package/components/Graph.js +14 -14
  31. package/components/HostActions.js +21 -21
  32. package/components/HostPanel.js +6 -6
  33. package/components/HoverCards.js +74 -74
  34. package/components/IssueBoard.js +13 -10
  35. package/components/IssueBreakdown.js +31 -31
  36. package/components/IssueCode.js +19 -19
  37. package/components/IssueEvent.js +12 -12
  38. package/components/IssueFilters.js +39 -39
  39. package/components/IssueGroup.js +16 -16
  40. package/components/IssueImport.js +13 -13
  41. package/components/IssueInsights.js +20 -20
  42. package/components/IssueListBlock.js +81 -81
  43. package/components/IssueRelations.js +34 -34
  44. package/components/IssueRow.js +31 -31
  45. package/components/IssueSentry.js +4 -4
  46. package/components/IssueTemplates.js +23 -23
  47. package/components/IssueTypes.js +40 -40
  48. package/components/MarkdownTransfer.js +10 -10
  49. package/components/MentionPicker.js +19 -19
  50. package/components/NewIssueDialog.js +53 -53
  51. package/components/NewProjectDialog.js +82 -82
  52. package/components/PersonActivity.js +13 -13
  53. package/components/PersonHoverCard.js +44 -44
  54. package/components/Planning.js +16 -16
  55. package/components/Reports.js +8 -8
  56. package/components/SettingsNav.js +15 -15
  57. package/components/ShareDialog.js +8 -8
  58. package/components/SharedViewer.js +23 -23
  59. package/components/SlashMenu.js +26 -26
  60. package/components/SubPages.js +10 -10
  61. package/components/TeamForm.js +9 -9
  62. package/components/TeamRepositories.js +21 -21
  63. package/components/TeamWorkflow.js +6 -6
  64. package/components/UnlinkedMentions.js +29 -29
  65. package/components/Updates.js +8 -8
  66. package/components/Widgets.js +4 -4
  67. package/components/WorkCounts.js +12 -12
  68. package/components/cycleCrumb.js +8 -8
  69. package/components/editorPlugins.js +101 -101
  70. package/components/settings.js +6 -6
  71. package/components/video.js +7 -7
  72. package/hostedApp.js +24 -24
  73. package/index.js +18 -18
  74. package/lib/assignees.js +3 -3
  75. package/lib/attachments.js +12 -12
  76. package/lib/boardMove.js +27 -27
  77. package/lib/collab.js +1 -1
  78. package/lib/docs.js +115 -115
  79. package/lib/githubLink.js +7 -7
  80. package/lib/issueList.js +51 -51
  81. package/lib/issueMenu.js +117 -117
  82. package/lib/knowledge.js +134 -134
  83. package/lib/live.js +38 -38
  84. package/lib/notifications.js +47 -47
  85. package/lib/views.js +31 -31
  86. package/package.json +24 -24
  87. package/pages/area.js +64 -64
  88. package/pages/areas.js +199 -199
  89. package/pages/decisions.js +51 -51
  90. package/pages/issues.js +120 -120
  91. package/pages/projects.js +238 -238
  92. package/pages/triage.js +109 -109
  93. package/routes/_workspace/agents/_slug2.js +127 -127
  94. package/routes/_workspace/agents/index2.js +22 -22
  95. package/routes/_workspace/dashboards/_dashboardId2.js +84 -84
  96. package/routes/_workspace/dashboards/index2.js +34 -34
  97. package/routes/_workspace/docs/_doc2.js +267 -267
  98. package/routes/_workspace/docs/space2._space.js +31 -31
  99. package/routes/_workspace/docs2.js +4 -4
  100. package/routes/_workspace/graph2.js +11 -11
  101. package/routes/_workspace/graph3.js +11 -11
  102. package/routes/_workspace/issues/_identifier2.js +477 -477
  103. package/routes/_workspace/issues/index.js +13 -13
  104. package/routes/_workspace/knowledge/_term2.js +175 -175
  105. package/routes/_workspace/knowledge/_term3.js +4 -4
  106. package/routes/_workspace/knowledge/index.js +12 -12
  107. package/routes/_workspace/knowledge/index2.js +117 -117
  108. package/routes/_workspace/measures2.js +8 -8
  109. package/routes/_workspace/measures3.js +29 -29
  110. package/routes/_workspace/notifications2.js +263 -263
  111. package/routes/_workspace/people/_username.js +10 -10
  112. package/routes/_workspace/people/_username2.js +41 -41
  113. package/routes/_workspace/projects/_projectId3.js +303 -303
  114. package/routes/_workspace/projects/_projectId4.js +4 -4
  115. package/routes/_workspace/projects/_projectId_3.milestones._milestoneId.js +28 -28
  116. package/routes/_workspace/projects/_projectId_4.milestones._milestoneId.js +4 -4
  117. package/routes/_workspace/projects/index.js +8 -8
  118. package/routes/_workspace/settings/account2.js +8 -8
  119. package/routes/_workspace/settings/audit-log2.js +8 -8
  120. package/routes/_workspace/settings/audit-log3.js +155 -155
  121. package/routes/_workspace/settings/connections2.js +4 -4
  122. package/routes/_workspace/settings/fields2.js +5 -5
  123. package/routes/_workspace/settings/github2.js +11 -11
  124. package/routes/_workspace/settings/gitlab2.js +5 -5
  125. package/routes/_workspace/settings/groups2.js +52 -52
  126. package/routes/_workspace/settings/import2.js +39 -39
  127. package/routes/_workspace/settings/index2.js +5 -5
  128. package/routes/_workspace/settings/intercom2.js +11 -11
  129. package/routes/_workspace/settings/labels2.js +33 -33
  130. package/routes/_workspace/settings/members2.js +81 -81
  131. package/routes/_workspace/settings/notifications2.js +46 -46
  132. package/routes/_workspace/settings/parallelworks2.js +20 -20
  133. package/routes/_workspace/settings/roles2.js +41 -41
  134. package/routes/_workspace/settings/runners2.js +15 -15
  135. package/routes/_workspace/settings/sentry2.js +15 -15
  136. package/routes/_workspace/settings/sessions2.js +9 -9
  137. package/routes/_workspace/settings/sessions3.js +4 -4
  138. package/routes/_workspace/settings/slack2.js +12 -12
  139. package/routes/_workspace/settings/sso2.js +37 -37
  140. package/routes/_workspace/settings/sso3.js +7 -7
  141. package/routes/_workspace/settings/teams2.js +29 -29
  142. package/routes/_workspace/settings/tokens2.js +32 -32
  143. package/routes/_workspace/settings/tokens3.js +4 -4
  144. package/routes/_workspace/settings/webhooks2.js +41 -41
  145. package/routes/_workspace/settings/zendesk2.js +11 -11
  146. package/routes/_workspace/teams/_key/cycles/_number2.js +33 -33
  147. package/routes/_workspace/teams/_key/cycles/_number3.js +7 -7
  148. package/routes/_workspace/teams/_key/cycles/index2.js +37 -37
  149. package/routes/_workspace/teams/_key/issues.js +10 -10
  150. package/routes/_workspace/teams/_key/projects.js +6 -6
  151. package/routes/_workspace/teams/_key/settings2.js +396 -396
  152. package/routes/_workspace2.js +308 -308
  153. package/routes/_workspace3.js +8 -8
  154. package/routes/device2.js +4 -4
  155. package/routes/device3.js +4 -4
  156. package/routes/docs/_tag/_endpoint2.js +3 -3
  157. package/routes/docs/_tag/index2.js +3 -3
  158. package/routes/docs/route2.js +7 -7
  159. package/routes/index2.js +5 -5
  160. package/routes/login2.js +10 -10
  161. package/routes/new2.js +12 -12
  162. package/routes/new3.js +5 -5
  163. package/routes/request2._token.js +6 -6
  164. package/routes/share2._secret.js +4 -4
@@ -1,7 +1,7 @@
1
- import { AddIcon as e } from "./icons.js";
2
- import { usePeople as t } from "../lib/people.js";
3
- import { docPropertiesQuery as n, propertyKinds as r, spaceScope as i, useDocPropertyActions as a } from "../lib/docProperties.js";
4
- import { useCan as o } from "../lib/roles.js";
1
+ import { docPropertiesQuery as e, propertyKinds as t, spaceScope as n, useDocPropertyActions as r } from "../lib/docProperties.js";
2
+ import { usePeople as i } from "../lib/people.js";
3
+ import { useCan as a } from "../lib/roles.js";
4
+ import { AddIcon as o } from "./icons.js";
5
5
  import { Button as s, Checkbox as c, ErrorText as l, IconButton as u, Input as d, Popover as f, Select as p, Textarea as m, menuDivider as h, useOpenMenu as g } from "@parallelworks/ui";
6
6
  import { Link as _ } from "@tanstack/react-router";
7
7
  import { useEffect as v, useState as y } from "react";
@@ -11,57 +11,57 @@ import { jsx as S, jsxs as C } from "react/jsx-runtime";
11
11
  import { useQuery as w } from "@tanstack/react-query";
12
12
  // src/components/DocProperties.tsx
13
13
  function T(e) {
14
- let { nameOf: n } = t(e), r = x("docProperties");
15
- return (e, t) => {
16
- if (t == null) return "";
14
+ let { nameOf: t } = i(e), n = x("docProperties");
15
+ return (e, r) => {
16
+ if (r == null) return "";
17
17
  let i = (t) => e.options.find((e) => e.id === t)?.name ?? String(t);
18
18
  switch (e.kind) {
19
- case "select": return i(t);
20
- case "multi_select": return Array.isArray(t) ? t.map(i).join(", ") : "";
21
- case "person": return n("user", String(t));
22
- case "checkbox": return t === !0 ? r("yes") : "";
23
- default: return String(t);
19
+ case "select": return i(r);
20
+ case "multi_select": return Array.isArray(r) ? r.map(i).join(", ") : "";
21
+ case "person": return t("user", String(r));
22
+ case "checkbox": return r === !0 ? n("yes") : "";
23
+ default: return String(r);
24
24
  }
25
25
  };
26
26
  }
27
- function E({ workspace: e, doc: t, space: r, editable: s }) {
28
- let c = x("docProperties"), u = b(), { data: d = [] } = w(n(e, r)), f = o(e, "manage_labels", i(r)), p = a(e), m = t.properties ?? {};
27
+ function E({ workspace: t, doc: i, space: o, editable: s }) {
28
+ let c = x("docProperties"), u = b(), { data: d = [] } = w(e(t, o)), f = a(t, "manage_labels", n(o)), p = r(t), m = i.properties ?? {};
29
29
  if (d.length === 0 && !(s && f)) return null;
30
- let h = (e, n) => p.setValues.mutate({
31
- doc: t.key,
32
- values: { [e]: n }
30
+ let h = (e, t) => p.setValues.mutate({
31
+ doc: i.key,
32
+ values: { [e]: t }
33
33
  });
34
34
  return /* @__PURE__ */ C("section", {
35
35
  "aria-label": c("title"),
36
36
  className: "mt-3 space-y-0.5 text-sm",
37
37
  children: [
38
- d.map((t) => /* @__PURE__ */ C("div", {
38
+ d.map((e) => /* @__PURE__ */ C("div", {
39
39
  className: "flex min-h-8 items-center gap-2",
40
40
  children: [/* @__PURE__ */ S(D, {
41
- workspace: e,
42
- property: t,
41
+ workspace: t,
42
+ property: e,
43
43
  admin: s && f
44
44
  }), /* @__PURE__ */ S("div", {
45
45
  className: "min-w-0 flex-1",
46
46
  children: /* @__PURE__ */ S(O, {
47
- workspace: e,
48
- property: t,
49
- value: m[t.id],
47
+ workspace: t,
48
+ property: e,
49
+ value: m[e.id],
50
50
  editable: s,
51
- onChange: (e) => h(t.id, e)
51
+ onChange: (t) => h(e.id, t)
52
52
  })
53
53
  })]
54
- }, t.id)),
54
+ }, e.id)),
55
55
  s && f && /* @__PURE__ */ S(A, {
56
- workspace: e,
57
- space: r
56
+ workspace: t,
57
+ space: o
58
58
  }),
59
59
  p.setValues.error && /* @__PURE__ */ S(l, { children: u(p.setValues.error) })
60
60
  ]
61
61
  });
62
62
  }
63
63
  function D({ workspace: e, property: t, admin: n }) {
64
- let r = x("docProperties"), i = g(), o = a(e), [s, c] = y(!1), l = /* @__PURE__ */ S("span", {
64
+ let i = x("docProperties"), a = g(), o = r(e), [s, c] = y(!1), l = /* @__PURE__ */ S("span", {
65
65
  className: "truncate",
66
66
  children: t.name
67
67
  });
@@ -71,12 +71,12 @@ function D({ workspace: e, property: t, admin: n }) {
71
71
  });
72
72
  let u = () => [
73
73
  {
74
- label: r("edit"),
74
+ label: i("edit"),
75
75
  onClick: () => c(!0)
76
76
  },
77
77
  h,
78
78
  {
79
- label: r("remove"),
79
+ label: i("remove"),
80
80
  destructive: !0,
81
81
  onClick: () => o.remove.mutate(t.id)
82
82
  }
@@ -86,14 +86,14 @@ function D({ workspace: e, property: t, admin: n }) {
86
86
  onOpenChange: c,
87
87
  trigger: /* @__PURE__ */ S("button", {
88
88
  type: "button",
89
- onContextMenu: (e) => i(e, u()),
89
+ onContextMenu: (e) => a(e, u()),
90
90
  className: "flex h-7 w-36 shrink-0 items-center rounded-md px-1.5 text-left text-muted-foreground hover:bg-muted",
91
91
  children: l
92
92
  }),
93
93
  align: "start",
94
94
  className: "w-72",
95
95
  initialFocus: "first-control",
96
- "aria-label": r("edit"),
96
+ "aria-label": i("edit"),
97
97
  children: /* @__PURE__ */ S(j, {
98
98
  workspace: e,
99
99
  property: t,
@@ -104,59 +104,59 @@ function D({ workspace: e, property: t, admin: n }) {
104
104
  })
105
105
  });
106
106
  }
107
- function O({ workspace: e, property: n, value: r, editable: i, onChange: a }) {
108
- let o = x("docProperties"), { members: s } = t(e), l = T(e), u = o("empty");
109
- if (!i) {
110
- let t = l(n, r);
111
- return n.kind === "issue" && t ? /* @__PURE__ */ S(_, {
107
+ function O({ workspace: e, property: t, value: n, editable: r, onChange: a }) {
108
+ let o = x("docProperties"), { members: s } = i(e), l = T(e), u = o("empty");
109
+ if (!r) {
110
+ let r = l(t, n);
111
+ return t.kind === "issue" && r ? /* @__PURE__ */ S(_, {
112
112
  to: "/$workspace/issues/$identifier",
113
113
  params: {
114
114
  workspace: e,
115
- identifier: t
115
+ identifier: r
116
116
  },
117
117
  className: "text-primary hover:underline",
118
- children: t
119
- }) : n.kind === "url" && t ? /* @__PURE__ */ S("a", {
120
- href: t,
118
+ children: r
119
+ }) : t.kind === "url" && r ? /* @__PURE__ */ S("a", {
120
+ href: r,
121
121
  target: "_blank",
122
122
  rel: "noopener noreferrer",
123
123
  className: "truncate text-primary hover:underline",
124
- children: t
124
+ children: r
125
125
  }) : /* @__PURE__ */ S("span", {
126
- className: t ? "" : "text-muted-foreground",
127
- children: t || u
126
+ className: r ? "" : "text-muted-foreground",
127
+ children: r || u
128
128
  });
129
129
  }
130
- switch (n.kind) {
130
+ switch (t.kind) {
131
131
  case "select": return /* @__PURE__ */ S(p, {
132
- value: typeof r == "string" ? r : "",
132
+ value: typeof n == "string" ? n : "",
133
133
  items: [{
134
134
  value: "",
135
135
  label: u
136
- }, ...n.options.map((e) => ({
136
+ }, ...t.options.map((e) => ({
137
137
  value: e.id ?? "",
138
138
  label: e.name
139
139
  }))],
140
140
  onValueChange: (e) => a(e || null),
141
- "aria-label": n.name,
141
+ "aria-label": t.name,
142
142
  size: "sm",
143
143
  width: "content"
144
144
  });
145
145
  case "multi_select": return /* @__PURE__ */ S(p, {
146
146
  multiple: !0,
147
- value: Array.isArray(r) ? r : [],
148
- items: n.options.map((e) => ({
147
+ value: Array.isArray(n) ? n : [],
148
+ items: t.options.map((e) => ({
149
149
  value: e.id ?? "",
150
150
  label: e.name
151
151
  })),
152
152
  onValueChange: (e) => a(e),
153
153
  placeholder: u,
154
- "aria-label": n.name,
154
+ "aria-label": t.name,
155
155
  size: "sm",
156
156
  width: "content"
157
157
  });
158
158
  case "person": return /* @__PURE__ */ S(p, {
159
- value: typeof r == "string" ? r : "",
159
+ value: typeof n == "string" ? n : "",
160
160
  items: [{
161
161
  value: "",
162
162
  label: u
@@ -165,25 +165,25 @@ function O({ workspace: e, property: n, value: r, editable: i, onChange: a }) {
165
165
  label: e.user.name
166
166
  }))],
167
167
  onValueChange: (e) => a(e || null),
168
- "aria-label": n.name,
168
+ "aria-label": t.name,
169
169
  size: "sm",
170
170
  width: "content"
171
171
  });
172
172
  case "checkbox": return /* @__PURE__ */ S(c, {
173
- checked: r === !0,
173
+ checked: n === !0,
174
174
  onCheckedChange: (e) => a(e === !0),
175
- "aria-label": n.name
175
+ "aria-label": t.name
176
176
  });
177
177
  case "date": return /* @__PURE__ */ S(d, {
178
178
  type: "date",
179
- value: typeof r == "string" ? r : "",
179
+ value: typeof n == "string" ? n : "",
180
180
  onChange: (e) => a(e.target.value || null),
181
- "aria-label": n.name,
181
+ "aria-label": t.name,
182
182
  className: "h-7 px-1.5 w-40"
183
183
  });
184
184
  default: return /* @__PURE__ */ S(k, {
185
- property: n,
186
- value: r,
185
+ property: t,
186
+ value: n,
187
187
  onChange: a
188
188
  });
189
189
  }
@@ -205,49 +205,49 @@ function k({ property: e, value: t, onChange: n }) {
205
205
  className: "h-7 border-transparent px-1.5 shadow-none hover:border-border"
206
206
  });
207
207
  }
208
- function A({ workspace: t, space: n }) {
209
- let r = x("docProperties"), [i, a] = y(!1);
208
+ function A({ workspace: e, space: t }) {
209
+ let n = x("docProperties"), [r, i] = y(!1);
210
210
  return /* @__PURE__ */ S(f, {
211
- open: i,
212
- onOpenChange: a,
211
+ open: r,
212
+ onOpenChange: i,
213
213
  trigger: /* @__PURE__ */ S(s, {
214
214
  size: "xs",
215
215
  variant: "ghost",
216
- icon: /* @__PURE__ */ S(e, {}),
216
+ icon: /* @__PURE__ */ S(o, {}),
217
217
  className: "mt-1 text-muted-foreground",
218
- children: r("add")
218
+ children: n("add")
219
219
  }),
220
220
  align: "start",
221
221
  className: "w-72",
222
222
  initialFocus: "first-control",
223
- "aria-label": r("add"),
223
+ "aria-label": n("add"),
224
224
  children: /* @__PURE__ */ S(j, {
225
- workspace: t,
226
- space: n,
227
- onDone: () => a(!1)
225
+ workspace: e,
226
+ space: t,
227
+ onDone: () => i(!1)
228
228
  })
229
229
  });
230
230
  }
231
- function j({ workspace: e, space: t, property: n, onDone: i, onRemove: o }) {
232
- let c = x("docProperties"), f = b(), h = a(e), [g, _] = y(n?.name ?? ""), [v, w] = y(n?.kind ?? "text"), [T, E] = y((n?.options ?? []).map((e) => e.name).join("\n")), D = v === "select" || v === "multi_select", O = () => T.split("\n").map((e) => e.trim()).filter(Boolean).map((e) => {
233
- let t = n?.options.find((t) => t.name === e)?.id;
231
+ function j({ workspace: e, space: n, property: i, onDone: a, onRemove: o }) {
232
+ let c = x("docProperties"), f = b(), h = r(e), [g, _] = y(i?.name ?? ""), [v, w] = y(i?.kind ?? "text"), [T, E] = y((i?.options ?? []).map((e) => e.name).join("\n")), D = v === "select" || v === "multi_select", O = () => T.split("\n").map((e) => e.trim()).filter(Boolean).map((e) => {
233
+ let t = i?.options.find((t) => t.name === e)?.id;
234
234
  return {
235
235
  name: e,
236
236
  ...t && { id: t }
237
237
  };
238
- }), k = n ? h.update : h.create;
238
+ }), k = i ? h.update : h.create;
239
239
  return /* @__PURE__ */ C("form", {
240
240
  onSubmit: (e) => {
241
- e.preventDefault(), n ? h.update.mutate({
242
- id: n.id,
241
+ e.preventDefault(), i ? h.update.mutate({
242
+ id: i.id,
243
243
  name: g,
244
244
  ...D && { options: O() }
245
- }, { onSuccess: i }) : h.create.mutate({
246
- ...t && { space: t },
245
+ }, { onSuccess: a }) : h.create.mutate({
246
+ ...n && { space: n },
247
247
  name: g,
248
248
  kind: v,
249
249
  ...D && { options: O() }
250
- }, { onSuccess: i });
250
+ }, { onSuccess: a });
251
251
  },
252
252
  className: "space-y-3 text-sm",
253
253
  children: [
@@ -261,13 +261,13 @@ function j({ workspace: e, space: t, property: n, onDone: i, onRemove: o }) {
261
261
  className: "mt-1"
262
262
  })]
263
263
  }),
264
- !n && /* @__PURE__ */ C("div", {
264
+ !i && /* @__PURE__ */ C("div", {
265
265
  className: "text-xs font-medium text-muted-foreground",
266
266
  children: [c("kind"), /* @__PURE__ */ S("div", {
267
267
  className: "mt-1",
268
268
  children: /* @__PURE__ */ S(p, {
269
269
  value: v,
270
- items: r.map((e) => ({
270
+ items: t.map((e) => ({
271
271
  value: e,
272
272
  label: c(`kinds.${e}`)
273
273
  })),
@@ -311,7 +311,7 @@ function j({ workspace: e, space: t, property: n, onDone: i, onRemove: o }) {
311
311
  variant: "primary",
312
312
  loading: k.isPending,
313
313
  disabled: !g.trim(),
314
- children: c(n ? "save" : "add")
314
+ children: c(i ? "save" : "add")
315
315
  })]
316
316
  })
317
317
  ]
@@ -1,9 +1,9 @@
1
1
  import { docsQuery as e } from "../api/queries.js";
2
- import { docRef as t } from "../lib/docs.js";
3
- import { usePeople as n } from "../lib/people.js";
4
- import { DocIcon as r } from "./DocIcon.js";
5
- import { docPropertiesQuery as i, spaceScope as a, useDocPropertyActions as o } from "../lib/docProperties.js";
6
- import { useCan as s } from "../lib/roles.js";
2
+ import { docPropertiesQuery as t, spaceScope as n, useDocPropertyActions as r } from "../lib/docProperties.js";
3
+ import { docRef as i } from "../lib/docs.js";
4
+ import { usePeople as a } from "../lib/people.js";
5
+ import { useCan as o } from "../lib/roles.js";
6
+ import { DocIcon as s } from "./DocIcon.js";
7
7
  import { usePropertyText as c } from "./DocProperties.js";
8
8
  import { cx as l } from "@parallelworks/ui";
9
9
  import { Link as u } from "@tanstack/react-router";
@@ -13,14 +13,14 @@ import { jsx as m, jsxs as h } from "react/jsx-runtime";
13
13
  import { keepPreviousData as g, useQuery as _ } from "@tanstack/react-query";
14
14
  // src/components/DocTable.tsx
15
15
  var v = (e) => e.kind === "select" || e.kind === "person";
16
- function y(t, n, r) {
17
- let a = Object.entries(r.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: o = [], isPending: s } = _({
18
- ...e(t, {
19
- ...n === "workspace" ? { workspace: !0 } : { team: n },
16
+ function y(n, r, i) {
17
+ let a = Object.entries(i.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: o = [], isPending: s } = _({
18
+ ...e(n, {
19
+ ...r === "workspace" ? { workspace: !0 } : { team: r },
20
20
  ...a.length > 0 && { property: a }
21
21
  }),
22
22
  placeholderData: g
23
- }), { data: l = [] } = _(i(t, n)), u = c(t), d = r.sort ?? "title", f = l.find((e) => e.id === d), p = (e) => {
23
+ }), { data: l = [] } = _(t(n, r)), u = c(n), d = i.sort ?? "title", f = l.find((e) => e.id === d), p = (e) => {
24
24
  if (d === "updated") return e.updatedAt;
25
25
  if (!f) return e.title.toLowerCase();
26
26
  let t = e.properties?.[f.id];
@@ -28,36 +28,36 @@ function y(t, n, r) {
28
28
  };
29
29
  return {
30
30
  docs: o.filter((e) => !e.template).sort((e, t) => {
31
- let n = p(e), i = p(t), a = n < i ? -1 : +(n > i);
32
- return r.desc ? -a : a;
31
+ let n = p(e), r = p(t), a = n < r ? -1 : +(n > r);
32
+ return i.desc ? -a : a;
33
33
  }),
34
34
  props: l,
35
35
  isPending: s
36
36
  };
37
37
  }
38
- function b({ workspace: e, space: n, layout: i, config: a }) {
39
- let o = p("docViews"), s = f(), { docs: l, props: d, isPending: g } = y(e, n, a), _ = c(e), b = (e, t) => e.properties?.[t.id];
38
+ function b({ workspace: e, space: t, layout: n, config: r }) {
39
+ let a = p("docViews"), o = f(), { docs: l, props: d, isPending: g } = y(e, t, r), _ = c(e), b = (e, t) => e.properties?.[t.id];
40
40
  if (g) return /* @__PURE__ */ m("p", {
41
41
  className: "p-4 text-sm text-muted-foreground",
42
- children: o("loading")
42
+ children: a("loading")
43
43
  });
44
- if (i === "board") {
45
- let t = d.find((e) => e.id === a.groupBy && v(e));
46
- return t ? /* @__PURE__ */ m(x, {
44
+ if (n === "board") {
45
+ let n = d.find((e) => e.id === r.groupBy && v(e));
46
+ return n ? /* @__PURE__ */ m(x, {
47
47
  workspace: e,
48
- space: n,
48
+ space: t,
49
49
  docs: l,
50
50
  props: d,
51
- by: t
51
+ by: n
52
52
  }) : /* @__PURE__ */ m("p", {
53
53
  className: "p-4 text-sm text-muted-foreground",
54
- children: o("pickGroup")
54
+ children: a("pickGroup")
55
55
  });
56
56
  }
57
- let S = a.columns ? a.columns.flatMap((e) => d.filter((t) => t.id === e)) : d;
57
+ let S = r.columns ? r.columns.flatMap((e) => d.filter((t) => t.id === e)) : d;
58
58
  return l.length === 0 ? /* @__PURE__ */ m("p", {
59
59
  className: "p-4 text-sm text-muted-foreground",
60
- children: o("none")
60
+ children: a("none")
61
61
  }) : /* @__PURE__ */ m("div", {
62
62
  className: "overflow-x-auto",
63
63
  children: /* @__PURE__ */ h("table", {
@@ -65,7 +65,7 @@ function b({ workspace: e, space: n, layout: i, config: a }) {
65
65
  children: [/* @__PURE__ */ m("thead", { children: /* @__PURE__ */ h("tr", { children: [
66
66
  /* @__PURE__ */ m("th", {
67
67
  scope: "col",
68
- children: o("docTitle")
68
+ children: a("docTitle")
69
69
  }),
70
70
  S.map((e) => /* @__PURE__ */ m("th", {
71
71
  scope: "col",
@@ -73,32 +73,32 @@ function b({ workspace: e, space: n, layout: i, config: a }) {
73
73
  }, e.id)),
74
74
  /* @__PURE__ */ m("th", {
75
75
  scope: "col",
76
- children: o("updated")
76
+ children: a("updated")
77
77
  })
78
- ] }) }), /* @__PURE__ */ m("tbody", { children: l.map((n) => /* @__PURE__ */ h("tr", { children: [
78
+ ] }) }), /* @__PURE__ */ m("tbody", { children: l.map((t) => /* @__PURE__ */ h("tr", { children: [
79
79
  /* @__PURE__ */ m("td", { children: /* @__PURE__ */ h(u, {
80
80
  to: "/$workspace/docs/$doc",
81
81
  params: {
82
82
  workspace: e,
83
- doc: t(n)
83
+ doc: i(t)
84
84
  },
85
85
  className: "flex items-center gap-2 font-medium hover:underline",
86
- children: [/* @__PURE__ */ m(r, { icon: n.icon }), /* @__PURE__ */ m("span", {
86
+ children: [/* @__PURE__ */ m(s, { icon: t.icon }), /* @__PURE__ */ m("span", {
87
87
  className: "truncate",
88
- children: n.title
88
+ children: t.title
89
89
  })]
90
90
  }) }),
91
- S.map((e) => /* @__PURE__ */ m("td", { children: _(e, b(n, e)) }, e.id)),
91
+ S.map((e) => /* @__PURE__ */ m("td", { children: _(e, b(t, e)) }, e.id)),
92
92
  /* @__PURE__ */ m("td", {
93
93
  className: "text-muted-foreground",
94
- children: s.dateTime(new Date(n.updatedAt), { dateStyle: "medium" })
94
+ children: o.dateTime(new Date(t.updatedAt), { dateStyle: "medium" })
95
95
  })
96
- ] }, n.id)) })]
96
+ ] }, t.id)) })]
97
97
  })
98
98
  });
99
99
  }
100
- function x({ workspace: e, space: i, docs: f, props: g, by: _ }) {
101
- let v = p("docViews"), { members: y } = n(e), b = c(e), x = s(e, "edit_docs", a(i)), S = o(e), [C, w] = d(null), [T, E] = d(null), D = [..._.kind === "select" ? _.options.map((e) => ({
100
+ function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
101
+ let v = p("docViews"), { members: y } = a(e), b = c(e), x = o(e, "edit_docs", n(t)), S = r(e), [C, w] = d(null), [T, E] = d(null), D = [..._.kind === "select" ? _.options.map((e) => ({
102
102
  key: e.id ?? "",
103
103
  label: e.name
104
104
  })) : y.map((e) => ({
@@ -114,62 +114,62 @@ function x({ workspace: e, space: i, docs: f, props: g, by: _ }) {
114
114
  return /* @__PURE__ */ m("ul", {
115
115
  className: "flex gap-3 overflow-x-auto p-3",
116
116
  "aria-label": v("board"),
117
- children: k.map((n) => {
118
- let i = f.filter((e) => O(e) === n.key);
117
+ children: k.map((t) => {
118
+ let n = f.filter((e) => O(e) === t.key);
119
119
  return /* @__PURE__ */ h("li", {
120
- "aria-label": n.label,
120
+ "aria-label": t.label,
121
121
  onDragOver: (e) => {
122
- C && (e.preventDefault(), E(n.key));
122
+ C && (e.preventDefault(), E(t.key));
123
123
  },
124
- onDragLeave: () => E((e) => e === n.key ? null : e),
124
+ onDragLeave: () => E((e) => e === t.key ? null : e),
125
125
  onDrop: (e) => {
126
126
  e.preventDefault(), C && S.setValues.mutate({
127
127
  doc: C,
128
- values: { [_.id]: n.key || null }
128
+ values: { [_.id]: t.key || null }
129
129
  }), w(null), E(null);
130
130
  },
131
- className: l("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", T === n.key ? "border-primary" : "border-border"),
131
+ className: l("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", T === t.key ? "border-primary" : "border-border"),
132
132
  children: [/* @__PURE__ */ h("p", {
133
133
  className: "flex items-center gap-2 px-3 py-2 text-xs font-medium",
134
134
  children: [/* @__PURE__ */ m("span", {
135
135
  className: "truncate",
136
- children: n.label
136
+ children: t.label
137
137
  }), /* @__PURE__ */ m("span", {
138
138
  className: "text-muted-foreground tabular-nums",
139
- children: i.length
139
+ children: n.length
140
140
  })]
141
141
  }), /* @__PURE__ */ m("ul", {
142
142
  className: "flex flex-col gap-2 px-2 pb-2",
143
- children: i.map((n) => /* @__PURE__ */ h("li", {
143
+ children: n.map((t) => /* @__PURE__ */ h("li", {
144
144
  draggable: x,
145
- onDragStart: () => w(n.key),
145
+ onDragStart: () => w(t.key),
146
146
  onDragEnd: () => w(null),
147
147
  className: "rounded-md border border-border bg-card p-2.5 text-sm shadow-xs",
148
148
  children: [/* @__PURE__ */ h(u, {
149
149
  to: "/$workspace/docs/$doc",
150
150
  params: {
151
151
  workspace: e,
152
- doc: t(n)
152
+ doc: i(t)
153
153
  },
154
154
  className: "flex items-center gap-2 font-medium hover:underline",
155
- children: [/* @__PURE__ */ m(r, { icon: n.icon }), /* @__PURE__ */ m("span", {
155
+ children: [/* @__PURE__ */ m(s, { icon: t.icon }), /* @__PURE__ */ m("span", {
156
156
  className: "truncate",
157
- children: n.title
157
+ children: t.title
158
158
  })]
159
159
  }), A.map((e) => {
160
- let t = b(e, n.properties?.[e.id]);
161
- return t ? /* @__PURE__ */ h("p", {
160
+ let n = b(e, t.properties?.[e.id]);
161
+ return n ? /* @__PURE__ */ h("p", {
162
162
  className: "mt-1 truncate text-xs text-muted-foreground",
163
163
  children: [
164
164
  e.name,
165
165
  ": ",
166
- t
166
+ n
167
167
  ]
168
168
  }, e.id) : null;
169
169
  })]
170
- }, n.id))
170
+ }, t.id))
171
171
  })]
172
- }, n.key || "none");
172
+ }, t.key || "none");
173
173
  })
174
174
  });
175
175
  }