@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.
- 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 +39 -39
- package/components/IssueGroup.js +16 -16
- package/components/IssueImport.js +13 -13
- package/components/IssueInsights.js +20 -20
- package/components/IssueListBlock.js +81 -81
- package/components/IssueRelations.js +34 -34
- package/components/IssueRow.js +31 -31
- package/components/IssueSentry.js +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/assignees.js +3 -3
- package/lib/attachments.js +12 -12
- package/lib/boardMove.js +27 -27
- package/lib/collab.js +1 -1
- package/lib/docs.js +115 -115
- package/lib/githubLink.js +7 -7
- package/lib/issueList.js +51 -51
- package/lib/issueMenu.js +117 -117
- package/lib/knowledge.js +134 -134
- package/lib/live.js +38 -38
- package/lib/notifications.js +47 -47
- package/lib/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/components/DateChip.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { meQuery as n } from "../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { fromIsoDate as r, isoDate as i } from "../lib/datePhrases.js";
|
|
4
|
+
import { docKey as a } from "../lib/docs.js";
|
|
5
5
|
import { usePeople as o } from "../lib/people.js";
|
|
6
|
-
import {
|
|
6
|
+
import { CalendarIcon as s, NotificationIcon as c } from "./icons.js";
|
|
7
7
|
import { Button as l, ErrorText as u, Input as d, Popover as f, Select as p } from "@parallelworks/ui";
|
|
8
8
|
import { useParams as m } from "@tanstack/react-router";
|
|
9
9
|
import { useState as h } from "react";
|
|
@@ -42,7 +42,7 @@ var O = w.create({
|
|
|
42
42
|
start: (e) => e.search(/@\d{4}-\d{2}-\d{2}/),
|
|
43
43
|
tokenize: (e) => {
|
|
44
44
|
let t = /^@(\d{4}-\d{2}-\d{2})(?![\w-])/.exec(e);
|
|
45
|
-
if (t &&
|
|
45
|
+
if (t && r(t[1] ?? "")) return {
|
|
46
46
|
type: "dateChip",
|
|
47
47
|
raw: t[0],
|
|
48
48
|
text: t[1] ?? ""
|
|
@@ -53,20 +53,20 @@ var O = w.create({
|
|
|
53
53
|
renderMarkdown: (e) => `@${String(e.attrs?.date ?? "")}`
|
|
54
54
|
});
|
|
55
55
|
function k({ node: e, editor: t, updateAttributes: n }) {
|
|
56
|
-
let
|
|
56
|
+
let i = _(), a = v("dateChip"), o = r(String(e.attrs.date ?? "")), l = e.attrs.remindAt, u = /* @__PURE__ */ new Date(), d = o ? i.dateTime(o, {
|
|
57
57
|
weekday: "short",
|
|
58
58
|
month: "short",
|
|
59
59
|
day: "numeric",
|
|
60
|
-
...
|
|
60
|
+
...o.getFullYear() !== u.getFullYear() && { year: "numeric" }
|
|
61
61
|
}) : String(e.attrs.date), p = /* @__PURE__ */ x("span", {
|
|
62
62
|
className: "date-chip",
|
|
63
63
|
"data-reminder": l ? "" : void 0,
|
|
64
64
|
children: [
|
|
65
|
-
/* @__PURE__ */ b(
|
|
65
|
+
/* @__PURE__ */ b(s, { className: "size-3.5" }),
|
|
66
66
|
d,
|
|
67
|
-
l && /* @__PURE__ */ b(
|
|
67
|
+
l && /* @__PURE__ */ b(c, {
|
|
68
68
|
className: "size-3",
|
|
69
|
-
"aria-label":
|
|
69
|
+
"aria-label": a("reminderSet")
|
|
70
70
|
})
|
|
71
71
|
]
|
|
72
72
|
});
|
|
@@ -77,13 +77,13 @@ function k({ node: e, editor: t, updateAttributes: n }) {
|
|
|
77
77
|
trigger: /* @__PURE__ */ b("button", {
|
|
78
78
|
type: "button",
|
|
79
79
|
className: "date-chip-button",
|
|
80
|
-
"aria-label":
|
|
80
|
+
"aria-label": a("change", { date: d }),
|
|
81
81
|
children: p
|
|
82
82
|
}),
|
|
83
83
|
align: "start",
|
|
84
84
|
className: "w-72",
|
|
85
85
|
initialFocus: "first-control",
|
|
86
|
-
"aria-label":
|
|
86
|
+
"aria-label": a("title"),
|
|
87
87
|
children: /* @__PURE__ */ b(A, {
|
|
88
88
|
node: e,
|
|
89
89
|
updateAttributes: n
|
|
@@ -91,25 +91,25 @@ function k({ node: e, editor: t, updateAttributes: n }) {
|
|
|
91
91
|
}) : p
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
function A({ node:
|
|
95
|
-
let f = v("dateChip"), w = _(), T = g(), { workspace: E = "", doc: D } = m({ strict: !1 }), { members: O } = o(E), { data: k } = C(n), A = String(
|
|
94
|
+
function A({ node: s, updateAttributes: c }) {
|
|
95
|
+
let f = v("dateChip"), w = _(), T = g(), { workspace: E = "", doc: D } = m({ strict: !1 }), { members: O } = o(E), { data: k } = C(n), A = String(s.attrs.date ?? ""), j = s.attrs.reminderId, M = s.attrs.remindAt, N = s.attrs.remindFor ?? "", [P, F] = h(""), [I, L] = h("09:00"), R = {
|
|
96
96
|
workspace: E,
|
|
97
|
-
doc: D ?
|
|
97
|
+
doc: D ? a(D) : ""
|
|
98
98
|
}, z = S({
|
|
99
99
|
mutationFn: async () => {
|
|
100
|
-
let n =
|
|
100
|
+
let n = r(A);
|
|
101
101
|
if (!n) throw Error(f("noDate"));
|
|
102
|
-
let [
|
|
102
|
+
let [i, a] = I.split(":").map(Number), o = new Date(n.getFullYear(), n.getMonth(), n.getDate(), i ?? 9, a ?? 0);
|
|
103
103
|
return t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/reminders", {
|
|
104
104
|
params: { path: R },
|
|
105
105
|
body: {
|
|
106
106
|
date: A,
|
|
107
|
-
remindAt:
|
|
107
|
+
remindAt: o.toISOString(),
|
|
108
108
|
...P && { for: P }
|
|
109
109
|
}
|
|
110
110
|
}));
|
|
111
111
|
},
|
|
112
|
-
onSuccess: (e) =>
|
|
112
|
+
onSuccess: (e) => c({
|
|
113
113
|
reminderId: e.id,
|
|
114
114
|
remindAt: e.remindAt,
|
|
115
115
|
remindFor: P || null
|
|
@@ -121,7 +121,7 @@ function A({ node: i, updateAttributes: a }) {
|
|
|
121
121
|
reminderId: j
|
|
122
122
|
} } });
|
|
123
123
|
},
|
|
124
|
-
onSuccess: () =>
|
|
124
|
+
onSuccess: () => c({
|
|
125
125
|
reminderId: null,
|
|
126
126
|
remindAt: null,
|
|
127
127
|
remindFor: null
|
|
@@ -135,8 +135,8 @@ function A({ node: i, updateAttributes: a }) {
|
|
|
135
135
|
type: "date",
|
|
136
136
|
value: A,
|
|
137
137
|
onChange: (e) => {
|
|
138
|
-
let t =
|
|
139
|
-
t &&
|
|
138
|
+
let t = r(e.target.value);
|
|
139
|
+
t && c({ date: i(t) });
|
|
140
140
|
},
|
|
141
141
|
className: "mt-1"
|
|
142
142
|
})]
|
package/components/DocHistory.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { docVersionQuery as n, docVersionsQuery as r } from "../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { lineDiff as i } from "../lib/diff.js";
|
|
4
|
+
import { usePeople as a } from "../lib/people.js";
|
|
5
|
+
import { useTime as o } from "../lib/time.js";
|
|
6
|
+
import { Editor as s } from "./Editor.js";
|
|
7
7
|
import { Avatar as c, Button as l, ErrorText as u, Loader as d, Tooltip as f } from "@parallelworks/ui";
|
|
8
8
|
import { useState as p } from "react";
|
|
9
9
|
import { useErrorMessage as m } from "@parallelworks/problem/react";
|
|
@@ -11,8 +11,8 @@ import { useTranslations as h } from "use-intl";
|
|
|
11
11
|
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
12
|
import { useMutation as v, useQuery as y, useQueryClient as b } from "@tanstack/react-query";
|
|
13
13
|
// src/components/DocHistory.tsx
|
|
14
|
-
function x({ workspace: e, doc: t, selected: n, onSelect:
|
|
15
|
-
let s = h("docs"), l =
|
|
14
|
+
function x({ workspace: e, doc: t, selected: n, onSelect: i }) {
|
|
15
|
+
let s = h("docs"), l = o(), { actorName: u, avatarOf: p } = a(e), { data: m = [], isPending: v } = y(r(e, t.key));
|
|
16
16
|
return /* @__PURE__ */ _("aside", {
|
|
17
17
|
"aria-label": s("history"),
|
|
18
18
|
className: "w-72 shrink-0 overflow-y-auto border-l border-border px-3 py-4 max-md:hidden",
|
|
@@ -32,7 +32,7 @@ function x({ workspace: e, doc: t, selected: n, onSelect: o }) {
|
|
|
32
32
|
return /* @__PURE__ */ g("li", { children: /* @__PURE__ */ _("button", {
|
|
33
33
|
type: "button",
|
|
34
34
|
"aria-current": r ? "true" : void 0,
|
|
35
|
-
onClick: () =>
|
|
35
|
+
onClick: () => i(t === 0 ? void 0 : e.id),
|
|
36
36
|
className: `flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted ${r ? "bg-muted" : ""}`,
|
|
37
37
|
children: [/* @__PURE__ */ g(c, {
|
|
38
38
|
kind: e.editor.kind === "agent" ? "agent" : "person",
|
|
@@ -61,11 +61,11 @@ function x({ workspace: e, doc: t, selected: n, onSelect: o }) {
|
|
|
61
61
|
]
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
function S({ workspace: r, doc:
|
|
65
|
-
let f = h("docs"), x =
|
|
64
|
+
function S({ workspace: r, doc: i, versionId: c, onDone: d }) {
|
|
65
|
+
let f = h("docs"), x = o(), S = m(), w = b(), { actorName: T } = a(r), [E, D] = p(!1), { data: O } = y(n(r, i.key, c)), k = v({
|
|
66
66
|
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/versions/{versionId}/restore", { params: { path: {
|
|
67
67
|
workspace: r,
|
|
68
|
-
doc:
|
|
68
|
+
doc: i.key,
|
|
69
69
|
versionId: c
|
|
70
70
|
} } })),
|
|
71
71
|
onSuccess: () => {
|
|
@@ -109,16 +109,16 @@ function S({ workspace: r, doc: s, versionId: c, onDone: d }) {
|
|
|
109
109
|
className: "mt-2",
|
|
110
110
|
children: S(k.error)
|
|
111
111
|
}),
|
|
112
|
-
O.title !==
|
|
112
|
+
O.title !== i.title && /* @__PURE__ */ g("p", {
|
|
113
113
|
className: "mt-3 text-xs text-muted-foreground",
|
|
114
114
|
children: f("versionTitle", { title: O.title })
|
|
115
115
|
}),
|
|
116
116
|
E ? /* @__PURE__ */ g(C, {
|
|
117
117
|
before: O.body ?? "",
|
|
118
|
-
after:
|
|
118
|
+
after: i.body ?? ""
|
|
119
119
|
}) : /* @__PURE__ */ g("div", {
|
|
120
120
|
className: "mt-4",
|
|
121
|
-
children: /* @__PURE__ */ g(
|
|
121
|
+
children: /* @__PURE__ */ g(s, {
|
|
122
122
|
value: O.body ?? "",
|
|
123
123
|
editable: !1,
|
|
124
124
|
className: "min-h-32"
|
|
@@ -128,7 +128,7 @@ function S({ workspace: r, doc: s, versionId: c, onDone: d }) {
|
|
|
128
128
|
}) : null;
|
|
129
129
|
}
|
|
130
130
|
function C({ before: e, after: t }) {
|
|
131
|
-
let n = h("docs"), r =
|
|
131
|
+
let n = h("docs"), r = i(e, t);
|
|
132
132
|
return r.some((e) => e.kind !== "same") ? /* @__PURE__ */ g("ol", {
|
|
133
133
|
"aria-label": n("changes"),
|
|
134
134
|
className: "mt-4 overflow-x-auto rounded-md border border-border font-mono text-xs leading-5",
|
package/components/DocIcon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { iconImageURL as ee } from "./EntityIcon.js";
|
|
2
|
+
import { FileTextIcon as e } from "./icons.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
import { ArticleIcon as n, BillingIcon as r, BriefcaseIcon as i, CalendarIcon as a, CelebrateIcon as o, ChartIcon as te, ChatIcon as ne, ClipboardCheckIcon as s, CloudIcon as c, ClusterIcon as l, CodeIcon as u, ComputeIcon as d, ContractIcon as f, DiskIcon as p, EducationIcon as m, FavoriteIcon as h, FeaturedIcon as g, FileIcon as _, FilesIcon as v, FlaggedIcon as y, FlaskIcon as b, FolderIcon as x, FolderOpenIcon as S, GearsIcon as C, GlobeIcon as w, GraphIcon as T, HelpIcon as E, HomeIcon as D, ImageIcon as O, InfoIcon as k, IssueIcon as A, KeyIcon as j, LegalIcon as M, LibraryIcon as N, LockIcon as re, MailIcon as P, MapPinIcon as F, MegaphoneIcon as I, MoonIcon as L, NotebookIcon as R, OrganizationIcon as z, PieChartIcon as B, ProjectIcon as V, ReleaseIcon as H, ReportIcon as U, ScriptIcon as W, SettingsIcon as G, ShieldIcon as K, SparklesIcon as q, SpreadsheetIcon as J, StorageIcon as Y, SummaryIcon as X, SunIcon as ie, SupportIcon as ae, TerminalIcon as oe, TodoIcon as se, ToolsIcon as ce, UsersIcon as Z, VideoIcon as le, WarningIcon as ue, WorkflowIcon as de, ZapIcon as fe } from "@parallelworks/ui/icons";
|
|
5
5
|
// src/components/DocIcon.tsx
|
|
@@ -68,7 +68,7 @@ var Q = {
|
|
|
68
68
|
moon: L
|
|
69
69
|
}, $ = "icon:";
|
|
70
70
|
function pe({ icon: n, className: r = "size-4", emojiClassName: i = "text-sm" }) {
|
|
71
|
-
let a = n &&
|
|
71
|
+
let a = n && ee(n);
|
|
72
72
|
if (a) return /* @__PURE__ */ t("img", {
|
|
73
73
|
src: a,
|
|
74
74
|
alt: "",
|
|
@@ -80,6 +80,6 @@ function pe({ icon: n, className: r = "size-4", emojiClassName: i = "text-sm" })
|
|
|
80
80
|
"aria-hidden": "true",
|
|
81
81
|
className: `inline-flex shrink-0 items-center justify-center leading-none ${r} ${i}`,
|
|
82
82
|
children: n
|
|
83
|
-
}) : /* @__PURE__ */ t(
|
|
83
|
+
}) : /* @__PURE__ */ t(e, { className: `shrink-0 text-muted-foreground ${r}` });
|
|
84
84
|
}
|
|
85
85
|
export { pe as DocIcon, Q as docIcons };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { emoji as e } from "../lib/emoji.js";
|
|
2
2
|
import { docIcons as t } from "./DocIcon.js";
|
|
3
|
-
import {
|
|
3
|
+
import { iconImageURL as n } from "./EntityIcon.js";
|
|
4
4
|
import { Button as r, FileButton as i, Popover as a, SearchInput as o, SegmentedControl as s, useClosePopover as c } from "@parallelworks/ui";
|
|
5
5
|
import { useState as l } from "react";
|
|
6
6
|
import { useTranslations as u } from "use-intl";
|
|
@@ -20,7 +20,7 @@ function m({ trigger: e, icon: t, onPick: n, onUploadFile: r }) {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
function h({ icon: a, onPick: m, onUploadFile: h }) {
|
|
23
|
-
let g = u("docs.look"), _ = c(), [v, y] = l(
|
|
23
|
+
let g = u("docs.look"), _ = c(), [v, y] = l(n(a) ? "upload" : a.startsWith("icon:") ? "icons" : "emoji"), [b, x] = l(""), S = b.trim().toLowerCase(), C = (e) => {
|
|
24
24
|
m(e), _();
|
|
25
25
|
}, w = "flex size-8 items-center justify-center rounded-md hover:bg-muted aria-pressed:bg-muted focus-visible:outline-2 focus-visible:outline-primary";
|
|
26
26
|
return /* @__PURE__ */ p("div", {
|
|
@@ -76,7 +76,7 @@ function h({ icon: a, onPick: m, onUploadFile: h }) {
|
|
|
76
76
|
}), /* @__PURE__ */ f("fieldset", {
|
|
77
77
|
className: "grid max-h-56 grid-cols-8 gap-0.5 overflow-y-auto",
|
|
78
78
|
"aria-label": g(v),
|
|
79
|
-
children: v === "emoji" ?
|
|
79
|
+
children: v === "emoji" ? e.filter(([, e]) => !S || e.includes(S)).map(([e, t]) => /* @__PURE__ */ f("button", {
|
|
80
80
|
type: "button",
|
|
81
81
|
title: t.split(" ")[0],
|
|
82
82
|
"aria-label": t.split(" ")[0],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { docQuery as e, docsQuery as t, issueSearchQuery as n, projectsQuery as r } from "../api/queries.js";
|
|
2
|
+
import { appURL as i } from "../lib/base.js";
|
|
3
3
|
import { docURL as a } from "../lib/docs.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { headingAnchor as o, headings as s } from "../lib/glossary.js";
|
|
5
|
+
import { issueURL as c } from "../lib/issueMenu.js";
|
|
6
|
+
import { projectRef as l } from "../lib/projects.js";
|
|
7
|
+
import { DocIcon as u } from "./DocIcon.js";
|
|
8
|
+
import { useEditorListbox as d } from "./editorListbox.js";
|
|
9
|
+
import { ProjectIcon as f, StatusIcon as p } from "./icons.js";
|
|
10
10
|
import { ListboxOption as m, ListboxPanel as h, useListboxNavigation as g } from "@parallelworks/ui";
|
|
11
11
|
import { useParams as _ } from "@tanstack/react-router";
|
|
12
12
|
import { useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
@@ -33,7 +33,7 @@ function E(e) {
|
|
|
33
33
|
var D = 4;
|
|
34
34
|
function O({ editor: O }) {
|
|
35
35
|
let { workspace: k } = _({ strict: !1 }), A = S("docLinks"), [j, M] = x(null), [N, P] = (j?.query ?? "").split("#", 2), F = N.trim(), { data: I = [] } = T({
|
|
36
|
-
...
|
|
36
|
+
...t(k ?? "", F ? {
|
|
37
37
|
title: F,
|
|
38
38
|
limit: 8
|
|
39
39
|
} : {
|
|
@@ -43,14 +43,14 @@ function O({ editor: O }) {
|
|
|
43
43
|
enabled: !!j && !!k,
|
|
44
44
|
placeholderData: w
|
|
45
45
|
}), L = P === void 0 ? void 0 : I[0], { data: R } = T({
|
|
46
|
-
...
|
|
46
|
+
...e(k ?? "", L?.key ?? ""),
|
|
47
47
|
enabled: !!L && !!k
|
|
48
48
|
}), z = !!j && !!k && P === void 0 && !!F, { data: B } = T({
|
|
49
|
-
...
|
|
49
|
+
...n(k ?? "", { q: F }),
|
|
50
50
|
enabled: z,
|
|
51
51
|
placeholderData: w
|
|
52
52
|
}), { data: V = [] } = T({
|
|
53
|
-
...
|
|
53
|
+
...r(k ?? ""),
|
|
54
54
|
enabled: z
|
|
55
55
|
}), H = y(() => {
|
|
56
56
|
if (P === void 0 || !L) {
|
|
@@ -73,7 +73,7 @@ function O({ editor: O }) {
|
|
|
73
73
|
];
|
|
74
74
|
}
|
|
75
75
|
let e = P.trim().toLowerCase();
|
|
76
|
-
return
|
|
76
|
+
return s(R?.body ?? "").filter((t) => t.text.toLowerCase().includes(e)).slice(0, 8).map((e) => ({
|
|
77
77
|
kind: "doc",
|
|
78
78
|
doc: L,
|
|
79
79
|
heading: e.text
|
|
@@ -96,18 +96,18 @@ function O({ editor: O }) {
|
|
|
96
96
|
O.off("selectionUpdate", e), O.off("update", e), O.off("blur", e);
|
|
97
97
|
};
|
|
98
98
|
}, [O]);
|
|
99
|
-
let U = (
|
|
100
|
-
if (!O || !j || !
|
|
101
|
-
let [
|
|
99
|
+
let U = (e) => {
|
|
100
|
+
if (!O || !j || !e || !k) return;
|
|
101
|
+
let [t, n] = e.kind === "doc" ? [e.heading ? `${e.doc.title} › ${e.heading}` : e.doc.title, a(k, e.doc) + (e.heading ? `#${o(e.heading)}` : "")] : e.kind === "issue" ? [e.issue.identifier, c(k, e.issue.identifier)] : [e.project.name, i(`/${k}/projects/${l(e.project)}`)];
|
|
102
102
|
O.chain().focus().insertContentAt({
|
|
103
103
|
from: j.from,
|
|
104
104
|
to: j.to
|
|
105
105
|
}, [{
|
|
106
106
|
type: "text",
|
|
107
|
-
text:
|
|
107
|
+
text: t,
|
|
108
108
|
marks: [{
|
|
109
109
|
type: "link",
|
|
110
|
-
attrs: { href:
|
|
110
|
+
attrs: { href: n }
|
|
111
111
|
}]
|
|
112
112
|
}, {
|
|
113
113
|
type: "text",
|
|
@@ -119,7 +119,7 @@ function O({ editor: O }) {
|
|
|
119
119
|
onDismiss: () => M(null),
|
|
120
120
|
open: !!j && !!k
|
|
121
121
|
}), G = b(W.setActive);
|
|
122
|
-
return G.current = W.setActive,
|
|
122
|
+
return G.current = W.setActive, d(O, W, !!j && !!k, (e) => !j || e.key !== "Escape" || H.length > 0 ? !1 : (e.preventDefault(), M(null), !0)), !j || !k ? null : /* @__PURE__ */ C(h, {
|
|
123
123
|
at: {
|
|
124
124
|
clientX: j.x,
|
|
125
125
|
clientY: j.y
|
|
@@ -133,7 +133,7 @@ function O({ editor: O }) {
|
|
|
133
133
|
children: H.map((e, t) => {
|
|
134
134
|
let n = e.kind === "doc" ? {
|
|
135
135
|
key: `doc:${e.doc.id}:${e.heading ?? ""}`,
|
|
136
|
-
icon: /* @__PURE__ */ C(
|
|
136
|
+
icon: /* @__PURE__ */ C(u, {
|
|
137
137
|
icon: e.doc.icon,
|
|
138
138
|
className: "size-3.5"
|
|
139
139
|
}),
|
|
@@ -141,7 +141,7 @@ function O({ editor: O }) {
|
|
|
141
141
|
hint: e.heading ? e.doc.title : void 0
|
|
142
142
|
} : e.kind === "issue" ? {
|
|
143
143
|
key: `issue:${e.issue.id}`,
|
|
144
|
-
icon: /* @__PURE__ */ C(
|
|
144
|
+
icon: /* @__PURE__ */ C(p, {
|
|
145
145
|
category: e.issue.status.category,
|
|
146
146
|
step: e.issue.status.step
|
|
147
147
|
}),
|
|
@@ -149,7 +149,7 @@ function O({ editor: O }) {
|
|
|
149
149
|
hint: e.issue.identifier
|
|
150
150
|
} : {
|
|
151
151
|
key: `project:${e.project.id}`,
|
|
152
|
-
icon: /* @__PURE__ */ C(
|
|
152
|
+
icon: /* @__PURE__ */ C(f, {}),
|
|
153
153
|
label: e.project.name,
|
|
154
154
|
hint: A("project")
|
|
155
155
|
};
|
package/components/DocLook.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { useDocActions as n } from "../lib/docs.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { DocIcon as r } from "./DocIcon.js";
|
|
4
|
+
import { DocIconPicker as i } from "./DocIconPicker.js";
|
|
5
|
+
import { iconImageURL as a } from "./EntityIcon.js";
|
|
6
6
|
import { CropDialog as o } from "./ImageUpload.js";
|
|
7
7
|
import { Button as s, ErrorText as c, FileButton as l } from "@parallelworks/ui";
|
|
8
8
|
import { useRef as u, useState as d } from "react";
|
|
@@ -71,8 +71,8 @@ function b(n, r) {
|
|
|
71
71
|
clear: () => o(null)
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
function x({ workspace: e, doc: t, editable:
|
|
75
|
-
let
|
|
74
|
+
function x({ workspace: e, doc: t, editable: r }) {
|
|
75
|
+
let i = p("docs.look"), o = p("common"), f = n(e), _ = y(e, t), v = u(null), b = u(null), [x, S] = d(!1), [C, w] = d(t.coverPosition), T = a(t.cover ?? "");
|
|
76
76
|
if (!T) return null;
|
|
77
77
|
let E = x ? C : t.coverPosition;
|
|
78
78
|
return /* @__PURE__ */ g("div", {
|
|
@@ -106,10 +106,10 @@ function x({ workspace: e, doc: t, editable: i }) {
|
|
|
106
106
|
className: "pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 text-center",
|
|
107
107
|
children: /* @__PURE__ */ h("span", {
|
|
108
108
|
className: "rounded-md bg-background/85 px-2 py-1 text-xs",
|
|
109
|
-
children:
|
|
109
|
+
children: i("dragToReposition")
|
|
110
110
|
})
|
|
111
111
|
}),
|
|
112
|
-
|
|
112
|
+
r && /* @__PURE__ */ h("div", {
|
|
113
113
|
className: `absolute right-4 bottom-3 flex gap-1.5 transition-opacity duration-150 md:right-8 ${x || _.busy ? "" : "opacity-0 group-focus-within/cover:opacity-100 group-hover/cover:opacity-100"}`,
|
|
114
114
|
children: x ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(s, {
|
|
115
115
|
type: "button",
|
|
@@ -126,14 +126,14 @@ function x({ workspace: e, doc: t, editable: i }) {
|
|
|
126
126
|
coverPosition: C
|
|
127
127
|
}), S(!1);
|
|
128
128
|
},
|
|
129
|
-
children:
|
|
129
|
+
children: i("savePosition")
|
|
130
130
|
})] }) : /* @__PURE__ */ g(m, { children: [
|
|
131
131
|
/* @__PURE__ */ h(l, {
|
|
132
132
|
size: "sm",
|
|
133
133
|
accept: "image/png,image/jpeg",
|
|
134
134
|
onFiles: _.upload,
|
|
135
135
|
loading: _.busy,
|
|
136
|
-
children:
|
|
136
|
+
children: i("changeCover")
|
|
137
137
|
}),
|
|
138
138
|
/* @__PURE__ */ h(s, {
|
|
139
139
|
type: "button",
|
|
@@ -141,7 +141,7 @@ function x({ workspace: e, doc: t, editable: i }) {
|
|
|
141
141
|
onClick: () => {
|
|
142
142
|
w(t.coverPosition), S(!0);
|
|
143
143
|
},
|
|
144
|
-
children:
|
|
144
|
+
children: i("reposition")
|
|
145
145
|
}),
|
|
146
146
|
/* @__PURE__ */ h(s, {
|
|
147
147
|
type: "button",
|
|
@@ -150,7 +150,7 @@ function x({ workspace: e, doc: t, editable: i }) {
|
|
|
150
150
|
doc: t,
|
|
151
151
|
cover: ""
|
|
152
152
|
}),
|
|
153
|
-
children:
|
|
153
|
+
children: i("removeCover")
|
|
154
154
|
})
|
|
155
155
|
] })
|
|
156
156
|
}),
|
|
@@ -161,11 +161,11 @@ function x({ workspace: e, doc: t, editable: i }) {
|
|
|
161
161
|
]
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
function S({ workspace: e, doc: t, editable:
|
|
164
|
+
function S({ workspace: e, doc: t, editable: a }) {
|
|
165
165
|
let u = p("docs.look"), d = n(e), f = y(e, t), m = t.icon ?? "", _ = (e) => d.setLook.mutate({
|
|
166
166
|
doc: t,
|
|
167
167
|
icon: e
|
|
168
|
-
}), v = b(e, _), x = /* @__PURE__ */ h(
|
|
168
|
+
}), v = b(e, _), x = /* @__PURE__ */ h(r, {
|
|
169
169
|
icon: m,
|
|
170
170
|
className: "size-14",
|
|
171
171
|
emojiClassName: "text-5xl"
|
|
@@ -173,7 +173,7 @@ function S({ workspace: e, doc: t, editable: r }) {
|
|
|
173
173
|
return /* @__PURE__ */ g("div", {
|
|
174
174
|
className: t.cover ? "-mt-10 md:-mt-12" : "",
|
|
175
175
|
children: [
|
|
176
|
-
m && (
|
|
176
|
+
m && (a ? /* @__PURE__ */ h(i, {
|
|
177
177
|
icon: m,
|
|
178
178
|
onPick: _,
|
|
179
179
|
onUploadFile: v.pick,
|
|
@@ -187,10 +187,10 @@ function S({ workspace: e, doc: t, editable: r }) {
|
|
|
187
187
|
className: "relative inline-block p-1",
|
|
188
188
|
children: x
|
|
189
189
|
})),
|
|
190
|
-
|
|
190
|
+
a && (!m || !t.cover) && /* @__PURE__ */ g("div", {
|
|
191
191
|
className: "flex h-8 items-center gap-1 opacity-0 transition-opacity duration-150 group-hover/doc:opacity-100 focus-within:opacity-100 has-[[aria-expanded=true]]:opacity-100 max-md:opacity-100",
|
|
192
192
|
children: [
|
|
193
|
-
!m && /* @__PURE__ */ h(
|
|
193
|
+
!m && /* @__PURE__ */ h(i, {
|
|
194
194
|
icon: "",
|
|
195
195
|
onPick: _,
|
|
196
196
|
onUploadFile: v.pick,
|