@bud.sh/app 0.5.1 → 0.6.0
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/README.md +41 -31
- package/dist/client/assets/bud/design.js +1 -1
- package/dist/client/assets/canvas-Bih9EdKJ.js +1 -0
- package/dist/client/assets/difference-worker-Bzg-rizy.js +8 -0
- package/dist/client/assets/dist-CdE5wBkg.js +5 -0
- package/dist/client/assets/files-1dLuoM2f.js +1 -0
- package/dist/client/assets/i18n-CkO6VFI0.js +1 -0
- package/dist/client/assets/index-Cn2mxroU.css +2 -0
- package/dist/client/assets/{index-Dn2pfmXf.js → index-DtISWZp9.js} +2 -2
- package/dist/client/assets/pages-BJ-tNJ4J.js +1 -0
- package/dist/client/assets/{project-branches-CMGRmrqr.js → project-branches-Ce3rXrkc.js} +1 -1
- package/dist/client/assets/project-comments-CPUONfs8.js +1 -0
- package/dist/client/assets/project-thread-links-C-TGkq59.js +1 -0
- package/dist/client/assets/{project-threads-ZbKDh78d.js → project-threads-Bv7IDBgi.js} +105 -105
- package/dist/client/assets/project-work-DAE9-olg.js +1 -0
- package/dist/client/assets/{task-design-BPpc4Gd7.js → task-design-CwySIAOl.js} +3 -3
- package/dist/client/assets/tasks-KWsCLi_h.js +3 -0
- package/dist/client/assets/wasm-inline-DSUyFn1L.js +1 -0
- package/dist/client/assets/workspace-CVdcfaaB.js +2 -0
- package/dist/client/index.html +3 -3
- package/dist/hosted/assets/{canvas-BYTOp1p7.js → canvas-AII16n9i.js} +97 -6
- package/dist/hosted/assets/{comment-data-Cn5y2VxV.js → comment-data-BXfMElfx.js} +1998 -381
- package/dist/hosted/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/hosted/assets/{files-B1P2_24q.js → files-D_1yeAVO.js} +10 -5
- package/dist/hosted/assets/{pages-B0ZlVdci.js → pages-CN_SbKWA.js} +3 -3
- package/dist/hosted/assets/{project-branches-DlCWmfRo.js → project-branches-Bxp0DCwg.js} +1 -1
- package/dist/hosted/assets/{project-thread-links-BZXQ200n.js → project-thread-links-KqQoKBLE.js} +76 -4
- package/dist/{node-host/assets/screen-DapOVrga.js → hosted/assets/screen-DpAcDUKR.js} +25 -1
- package/dist/hosted/assets/tasks-D66LlwxM.js +1423 -0
- package/dist/hosted/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/hosted/hosted.js +7885 -6219
- package/dist/node/assets/Stream-CAm1eJ2n.js +16604 -0
- package/dist/{server/assets/bridge-B_Blt55E.js → node/assets/bridge-DQSBYHmw.js} +124 -290
- package/dist/node/assets/config-9_jWwNBh.js +1067 -0
- package/dist/node/assets/load-config.server-CMVtRVmO.js +261 -0
- package/dist/node/assets/module-3GgtT4Xs.js +308 -0
- package/dist/node/assets/server-DTQFuoX2.js +846 -0
- package/dist/node/assets/src-D-kG1GxB.js +2 -0
- package/dist/node/assets/{src-CerrKjID.js → src-Dwe9APUx.js} +93 -3
- package/dist/node/assets/src-DysjfbM8.js +8592 -0
- package/dist/node/bridge.js +1 -845
- package/dist/node/cli.js +206 -0
- package/dist/node/design.js +811 -8
- package/dist/node/index.js +2 -739
- package/dist/node/plugins.js +5711 -0
- package/dist/node/server.js +1 -6746
- package/dist/node/vite.js +121 -0
- package/dist/{server/assets/canvas-CkMK4hoN.js → node-host/assets/canvas-BeDoufy1.js} +97 -7
- package/dist/node-host/assets/{comment-data-yfWEdDQL.js → comment-data-DE2T9yTj.js} +1974 -355
- package/dist/node-host/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/node-host/assets/{files-anHi-apm.js → files-Dl-PTS09.js} +11 -6
- package/dist/node-host/assets/{pages-CW4aF6dK.js → pages-DL2sk6_U.js} +3 -3
- package/dist/node-host/assets/{project-branches-D7rVCxQX.js → project-branches-DGp5ELct.js} +1 -1
- package/dist/{server/assets/project-thread-links-lLS_rq7c.js → node-host/assets/project-thread-links-CgBV3Jcm.js} +76 -5
- package/dist/{hosted/assets/screen-CfdC3NbR.js → node-host/assets/screen-B55yyVfb.js} +25 -1
- package/dist/node-host/assets/tasks-DZRNkoxe.js +1425 -0
- package/dist/node-host/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/node-host/node-host.js +6127 -4438
- package/dist/server/assets/{branch-previews-ClkoJ0lM.js → branch-previews-DedrpnVR.js} +1555 -673
- package/dist/{node-host/assets/canvas-DxmcFZCh.js → server/assets/canvas-CJWQ-jjv.js} +98 -6
- package/dist/server/assets/{comment-data-NLeHG89b.js → comment-data-Rg42ToTW.js} +1660 -26
- package/dist/server/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/server/assets/{events-iHpLGr3k.js → events-BH_rAu7O.js} +155 -20
- package/dist/server/assets/{files-CRdl489E.js → files-CPJqKeMo.js} +12 -7
- package/dist/server/assets/{listener-BAYn9Q-u.js → listener-D61O6PzF.js} +708 -12
- package/dist/server/assets/{pages-DXVlJlBC.js → pages-KJY_Ba92.js} +4 -4
- package/dist/server/assets/{project-branches-CwTsf6WQ.js → project-branches-qG9ACZvo.js} +2 -2
- package/dist/{node-host/assets/project-thread-links-m-OLpsD9.js → server/assets/project-thread-links-CqK0lqCF.js} +77 -4
- package/dist/{node-host/assets/tasks-request-B0aeNocI.js → server/assets/project-work-DoIwxWMm.js} +87 -2
- package/dist/server/assets/run-BJ8r5jSh.js +572 -0
- package/dist/server/assets/{screen-B1zH_1O3.js → screen-CBrHPFug.js} +26 -2
- package/dist/server/assets/{server-DxK-UB_Z.js → server-Dkbp5stG.js} +1521 -793
- package/dist/server/assets/{services-BRrgXYlT.js → services-BTfig8A8.js} +234 -997
- package/dist/server/assets/tasks-Bgu5Lg9Y.js +1427 -0
- package/dist/server/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/server/capture.js +1 -2
- package/dist/server/migration.js +569 -12
- package/dist/server/runtime.js +7 -5
- package/dist/server/server.js +3 -3
- package/dist/types/assets/{config-DIC2cf_S.d.ts → config-CvcYmE2s.d.ts} +188 -50
- package/dist/types/assets/{contract-CAT-XFNq.d.ts → contract-B7yuuqSn.d.ts} +44 -2
- package/dist/types/assets/{items-CaVkByHk.d.ts → items-BQdaVksf.d.ts} +12 -1
- package/dist/types/assets/memory-state-BBW-FAVA.d.ts +236 -0
- package/dist/types/assets/picker-Be5Gx4WR.d.ts +9 -0
- package/dist/types/assets/{task-design-xJOhRNWh.d.ts → task-design-BDHKFHpp.d.ts} +3 -1
- package/dist/types/bridge.d.ts +1 -1
- package/dist/types/companion.d.ts +3 -3
- package/dist/types/design.d.ts +2 -2
- package/dist/types/hosted.d.ts +3 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/node-host.d.ts +2 -2
- package/dist/types/plugins.d.ts +445 -0
- package/dist/types/screen.d.ts +2 -2
- package/dist/types/server.d.ts +2 -228
- package/dist/types/vite.d.ts +16 -0
- package/package.json +19 -3
- package/dist/client/assets/canvas-8GXJIuDK.js +0 -1
- package/dist/client/assets/difference-worker-C99ychYw.js +0 -8
- package/dist/client/assets/files-DkWt1l9H.js +0 -1
- package/dist/client/assets/i18n-hH_Ba5QO.js +0 -1
- package/dist/client/assets/index-tpHYVXma.css +0 -2
- package/dist/client/assets/pages-BVd6MQmu.js +0 -1
- package/dist/client/assets/project-comments-D1IIQwsW.js +0 -1
- package/dist/client/assets/project-thread-links-DKwe_SYb.js +0 -1
- package/dist/client/assets/project-work-D4DZqBCZ.js +0 -1
- package/dist/client/assets/tasks-Cn0VOZ9Z.js +0 -1
- package/dist/client/assets/tasks-request-BLyOzokZ.js +0 -1
- package/dist/client/assets/workspace-DGErsSg6.js +0 -2
- package/dist/hosted/assets/tasks-_yKh2Z6q.js +0 -649
- package/dist/hosted/assets/tasks-request-CFPLvLc7.js +0 -113
- package/dist/node-host/assets/tasks-BBK_CybR.js +0 -651
- package/dist/server/assets/project-work-CSZlCwH-.js +0 -88
- package/dist/server/assets/tasks-CGdz-uox.js +0 -652
- package/dist/server/assets/tasks-request-D2NBjCTl.js +0 -115
- package/dist/types/assets/picker-D1Bw3ndx.d.ts +0 -14
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { i as __toESM } from "./rolldown-runtime-DktXgydw.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $n as areFileRenderOptionsEqual, A as FileRecoveryDialog, Ar as parseFileIndex, At as readReviewLocation, Bn as reviewConflictIdentity, Bt as reconcileFileView, Cr as parseReviewRepository, D as FileEditorPanel, Dr as parseFileSearchResult, Dt as defaultReviewView, E as ReviewActionDialog, Er as parseFileSearchQuery, Et as defaultReviewPosition, F as defaultFileDestination, Ft as closeFileTab, G as FileSearchPanel, Gn as areDiffTargetsEqual, Hn as renderDiffWithHighlighter, I as fileActionIntent, It as defaultFileView, Jn as WorkerPoolWorkerError, Kn as WorkerPoolTaskCanceledError, L as mutationFileView, Lt as fileHref, M as FileReviewPanel, Mt as reviewComparison, N as codeThemes, Nt as reviewContextKey, O as defaultEditorPreferences, Or as parseFileChange, P as FileWorkspace, Pt as reviewHref, Qn as renderFileWithHighlighter, R as remainingMutationIntent, Rn as createCodeAnchor, Rt as parseFileView, Sr as parseReviewHistory, T as FileConflictPanel, Tr as parseReviewSource, Un as areDiffRenderOptionsEqual, Vn as isDiffPlainText, Vt as rememberFile, Wn as areFilesEqual, Xn as markWorkerErrorReported, Yn as isHandledWorkerPoolError, Zn as isFilePlainText, _r as maxFileSaveBytes, ar as attachResolvedThemes, br as parseRecoveries, cn as t, cr as getResolvedOrResolveLanguage, dr as ResolvedLanguages, er as hasResolvedThemes, f as storeDocument, fn as routes, fr as parseReviewActionPlan, ft as codeCommentCounts, gr as parseFileSaveResult, gt as isCodeConversation, hr as parseFileSaveRequest, in as writePreference, ir as validateResolvedThemeName, j as FileMutationDialog, jr as parseFilePath, jt as rememberReviewPosition, k as parseEditorPreferences, kr as parseFileDocument, kt as parseReviewSession, l as projectStore, lr as resolveLanguage, m as storedFiles, mr as parseReviewActionResult, mt as conversationHref, nn as toast, nr as getSharedHighlighter, or as themeResolver, p as storedDocument, pn as fileRoutes, pr as parseReviewActionRecoveries, q as ConversationSidebar, qn as WorkerPoolTerminatedError, rn as readPreference, rr as prepareThemeResolution, s as applyFileUpdate, sr as getThemes, tr as areThemesEqual, u as saveFiles, un as Text, ur as areLanguagesAttached, v as projectLive, vr as parseMutationPlan, vt as locateCodeConversations, wr as parseReviewSnapshot, xr as parseReviewDiff, yr as parseMutationResult, yt as readConversationLocation, zn as parseFileUpdate, zt as readFileLocation } from "./comment-data-DE2T9yTj.js";
|
|
3
3
|
import { B as DEFAULT_THEMES, C as getFiletypeFromFileName, S as getCustomExtensionsVersion, x as getCustomExtensionsMap } from "./cloneFileDiffMetadata-C1BcNpxN.js";
|
|
4
4
|
import { t as require_lru } from "./lru-C0_oUet4.js";
|
|
5
|
-
import { n as createProjectComments, t as defineScreen } from "./screen-
|
|
6
|
-
import {
|
|
5
|
+
import { n as createProjectComments, t as defineScreen } from "./screen-B55yyVfb.js";
|
|
6
|
+
import { n as ProjectThreadLinks, t as ProjectMakeTask } from "./project-thread-links-CgBV3Jcm.js";
|
|
7
7
|
import { ref } from "remix/component";
|
|
8
|
-
import { jsx, jsxs } from "remix/component/jsx-runtime";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
9
9
|
//#region ../../node_modules/.pnpm/@pierre+diffs@1.5.2_@shikijs+themes@4.5.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.js
|
|
10
10
|
function getResolvedLanguages(languages) {
|
|
11
11
|
const resolvedLanguages = [];
|
|
@@ -3244,7 +3244,12 @@ function ProjectFileReview(handle) {
|
|
|
3244
3244
|
await comments.loadThread(thread.id, true);
|
|
3245
3245
|
}
|
|
3246
3246
|
}),
|
|
3247
|
-
renderThreadActions: (thread) => /* @__PURE__ */ jsx(
|
|
3247
|
+
renderThreadActions: (thread) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ProjectMakeTask, {
|
|
3248
|
+
thread,
|
|
3249
|
+
canMake: comments.snapshot.capabilities.link && project.storage.work?.state === "ready",
|
|
3250
|
+
busy: comments.busy,
|
|
3251
|
+
onMake: comments.makeTask
|
|
3252
|
+
}), /* @__PURE__ */ jsx(ProjectThreadLinks, {
|
|
3248
3253
|
part: "action",
|
|
3249
3254
|
project,
|
|
3250
3255
|
thread,
|
|
@@ -3254,7 +3259,7 @@ function ProjectFileReview(handle) {
|
|
|
3254
3259
|
await comments.load();
|
|
3255
3260
|
await comments.loadThread(thread.id, true);
|
|
3256
3261
|
}
|
|
3257
|
-
}),
|
|
3262
|
+
})] }),
|
|
3258
3263
|
capabilities: comments.snapshot.capabilities,
|
|
3259
3264
|
selected: selectedThread,
|
|
3260
3265
|
currentPath: handle.props.path,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gt as Loader, Kt as Spinner, Mr as MAX_CANVAS_Y, Qt as IconButton, Zt as Select, cn as t, dt as PagesWorkspace, in as writePreference, l as projectStore, mn as pageRoutes, rn as readPreference, un as Text } from "./comment-data-DE2T9yTj.js";
|
|
2
2
|
import { n as workspaceTab, t as followWorkspaceTab } from "../node-host.js";
|
|
3
|
-
import { n as createProjectPreviews, r as locatePreview, t as createProjectBranches } from "./project-branches-
|
|
4
|
-
import { n as createProjectComments, t as defineScreen } from "./screen-
|
|
3
|
+
import { n as createProjectPreviews, r as locatePreview, t as createProjectBranches } from "./project-branches-DGp5ELct.js";
|
|
4
|
+
import { n as createProjectComments, t as defineScreen } from "./screen-B55yyVfb.js";
|
|
5
5
|
import { array, number, object, optional, parseSafe, string } from "remix/data-schema";
|
|
6
6
|
import { on, ref } from "remix/component";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nr as parseElementAnchor, c as previewKey, cn as t, fn as routes, l as projectStore, mi as parsePreviewBranch, pi as parsePreview, v as projectLive, vi as parsePreviewPins, x as writeRows, y as plainRow } from "./comment-data-DE2T9yTj.js";
|
|
2
2
|
import { array, boolean, enum_, nullable, number, object, parseSafe, string } from "remix/data-schema";
|
|
3
3
|
//#region app/client/project-previews.ts
|
|
4
4
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as requestTasks } from "./tasks-request-D2NBjCTl.js";
|
|
1
|
+
import { C as ThreadTaskPicker, Ct as taskHref, Hr as parseWorkItemRef, Nn as parseThreadLinkInput, On as parseThread, Pr as parseWorkWorkspace, Qt as IconButton, S as ThreadTaskLinks, Tt as taskRole, Yr as valueByRole, _ as requestComments, cn as t, fn as routes, h as storedWorkspace, l as projectStore } from "./comment-data-DE2T9yTj.js";
|
|
2
|
+
import { a as requestTasks, r as projectWork } from "../node-host.js";
|
|
4
3
|
import { on, ref } from "remix/component";
|
|
5
4
|
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
6
5
|
//#region app/client/project-task-picker.tsx
|
|
@@ -165,11 +164,77 @@ async function saveThreadLinks(thread, selected, mutate, signal) {
|
|
|
165
164
|
//#endregion
|
|
166
165
|
//#region app/client/project-thread-links.tsx
|
|
167
166
|
/**
|
|
167
|
+
* Whether a discussion offers Make task: placed on a page or code, without tasks yet, where
|
|
168
|
+
* discussions can link and tasks are stored.
|
|
169
|
+
* @param thread - The discussion.
|
|
170
|
+
* @param canMake - Whether the stores allow it.
|
|
171
|
+
* @returns Whether to offer it.
|
|
172
|
+
*/
|
|
173
|
+
function makeTaskAvailable(thread, canMake) {
|
|
174
|
+
return canMake && thread.anchor !== null && !thread.itemIds.length;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Turns a discussion into a task and opens it, when `makeTaskAvailable` allows.
|
|
178
|
+
* @param handle - The discussion, whether tasks can be made, and the store's operation.
|
|
179
|
+
* @returns The toolbar button, or nothing.
|
|
180
|
+
*/
|
|
181
|
+
function ProjectMakeTask(handle) {
|
|
182
|
+
let making = false;
|
|
183
|
+
return () => {
|
|
184
|
+
let { thread, canMake, busy } = handle.props;
|
|
185
|
+
if (!makeTaskAvailable(thread, canMake)) return null;
|
|
186
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
187
|
+
icon: "task-add",
|
|
188
|
+
label: t("app.client.projectThreadLinks.makeTask"),
|
|
189
|
+
size: "small",
|
|
190
|
+
tooltip: true,
|
|
191
|
+
disabled: busy || making,
|
|
192
|
+
"data-testid": "comment-make-task",
|
|
193
|
+
mix: on("click", async () => {
|
|
194
|
+
making = true;
|
|
195
|
+
handle.update();
|
|
196
|
+
try {
|
|
197
|
+
let task = await handle.props.onMake(thread.id);
|
|
198
|
+
window.location.assign(taskHref(task.id));
|
|
199
|
+
} catch {} finally {
|
|
200
|
+
making = false;
|
|
201
|
+
if (!handle.signal.aborted) handle.update();
|
|
202
|
+
}
|
|
203
|
+
})
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
168
208
|
* Shares task links and their revision-checked editor across task, canvas and code discussions.
|
|
169
209
|
* @param handle - The selected discussion, capability and owning view's refresh callback.
|
|
170
210
|
* @returns Linked tasks and an editor that retains its selection after failed writes.
|
|
171
211
|
*/
|
|
172
212
|
function ProjectThreadLinks(handle) {
|
|
213
|
+
let stored = null;
|
|
214
|
+
let project = handle.props.project;
|
|
215
|
+
projectStore(project).then((store) => {
|
|
216
|
+
if (handle.signal.aborted) return;
|
|
217
|
+
let read = () => {
|
|
218
|
+
let workspace = storedWorkspace(store);
|
|
219
|
+
stored = workspace && {
|
|
220
|
+
schema: workspace.schema,
|
|
221
|
+
items: new Map(workspace.snapshot.items.map((item) => [item.id, {
|
|
222
|
+
id: item.id,
|
|
223
|
+
title: taskRole(item, workspace.schema, "title") || void 0,
|
|
224
|
+
status: taskRole(item, workspace.schema, "status") || void 0
|
|
225
|
+
}])),
|
|
226
|
+
runs: Object.fromEntries(workspace.snapshot.items.flatMap((item) => item.run ? [[item.id, item.run]] : []))
|
|
227
|
+
};
|
|
228
|
+
update();
|
|
229
|
+
};
|
|
230
|
+
let subscriptions = [store.boards.subscribeChanges(read), store.work.subscribeChanges(read)];
|
|
231
|
+
handle.signal.addEventListener("abort", () => {
|
|
232
|
+
for (let subscription of subscriptions) subscription.unsubscribe();
|
|
233
|
+
});
|
|
234
|
+
let work = projectWork(project);
|
|
235
|
+
if (!store.boards.has("board") && handle.props.thread.itemIds.length && project.storage.work?.state === "ready") work.refresh().catch(() => {});
|
|
236
|
+
read();
|
|
237
|
+
});
|
|
173
238
|
let editing = null;
|
|
174
239
|
let needsReview = false;
|
|
175
240
|
let reviewed = false;
|
|
@@ -210,7 +275,13 @@ function ProjectThreadLinks(handle) {
|
|
|
210
275
|
mix: on("click", edit)
|
|
211
276
|
}) : null : /* @__PURE__ */ jsx(ThreadTaskLinks, {
|
|
212
277
|
itemIds: handle.props.thread.itemIds,
|
|
213
|
-
items: handle.props.
|
|
278
|
+
items: handle.props.thread.itemIds.map((id) => ({
|
|
279
|
+
...handle.props.items?.find((item) => item.id === id),
|
|
280
|
+
...stored?.items.get(id),
|
|
281
|
+
id
|
|
282
|
+
})),
|
|
283
|
+
schema: stored?.schema,
|
|
284
|
+
runs: stored?.runs,
|
|
214
285
|
href: taskHref,
|
|
215
286
|
busy: handle.props.busy,
|
|
216
287
|
onEdit: !handle.props.part && handle.props.canLink ? edit : void 0
|
|
@@ -239,4 +310,4 @@ function ProjectThreadLinks(handle) {
|
|
|
239
310
|
}) : null] });
|
|
240
311
|
}
|
|
241
312
|
//#endregion
|
|
242
|
-
export {
|
|
313
|
+
export { ProjectThreadLinks as n, ProjectTaskPicker as r, ProjectMakeTask as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { An as parseThreadFilter, Fn as parseThreadSnapshot, On as parseThread, _ as requestComments, a as saveThreads, b as writeOptimistically, bn as predictThreadReply, cn as t, fn as routes, g as CommentsRequestError, i as saveThread, jn as parseThreadId, l as projectStore, n as unavailableComments, nn as toast, o as threadMatches, vn as predictThreadCreate, x as writeRows, xn as predictThreadStatus, y as plainRow, yn as predictThreadDelete } from "./comment-data-DE2T9yTj.js";
|
|
2
2
|
//#region app/client/project-comments.ts
|
|
3
3
|
var viewers = /* @__PURE__ */ new Map();
|
|
4
4
|
function parseViewer(value) {
|
|
@@ -10,6 +10,13 @@ function parseViewer(value) {
|
|
|
10
10
|
};
|
|
11
11
|
throw new TypeError("Invalid viewer.");
|
|
12
12
|
}
|
|
13
|
+
function parseMadeTask(value) {
|
|
14
|
+
if (!value || typeof value !== "object" || !("item" in value) || !("thread" in value) || !value.item || typeof value.item !== "object" || !("id" in value.item) || typeof value.item.id !== "string" || !value.item.id || value.item.id.length > 256) throw new TypeError("Invalid task.");
|
|
15
|
+
return {
|
|
16
|
+
item: { id: value.item.id },
|
|
17
|
+
thread: parseThread(value.thread)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
13
20
|
function parseDeletion(value) {
|
|
14
21
|
if (!value || typeof value !== "object" || !("thread" in value)) throw new TypeError("Invalid deletion.");
|
|
15
22
|
return { thread: value.thread === null ? null : parseThread(value.thread) };
|
|
@@ -385,6 +392,23 @@ function createProjectComments(options) {
|
|
|
385
392
|
};
|
|
386
393
|
},
|
|
387
394
|
/**
|
|
395
|
+
* Turns a discussion into a task in the task store, linked to it.
|
|
396
|
+
* @param threadId - The discussion.
|
|
397
|
+
* @param context - What the canvas found around the comment: a screenshot and its element.
|
|
398
|
+
* @returns The new task's id.
|
|
399
|
+
*/
|
|
400
|
+
async makeTask(threadId, context) {
|
|
401
|
+
requireCapability("link");
|
|
402
|
+
let id = parseThreadId(threadId);
|
|
403
|
+
let made;
|
|
404
|
+
await operate(routes.comments.makeTask.href({ id }), context ? { context } : {}, parseMadeTask, (result) => {
|
|
405
|
+
if (result.thread.id !== id) throw new CommentsRequestError(t("app.client.projectComments.refreshBeforeTryingAgain"), 409, "uncertain");
|
|
406
|
+
made = result.item;
|
|
407
|
+
return merge(result.thread);
|
|
408
|
+
}, t("app.client.projectComments.taskCreated"), id);
|
|
409
|
+
return made;
|
|
410
|
+
},
|
|
411
|
+
/**
|
|
388
412
|
* Deletes one of the viewer's messages; its first message deletes the whole discussion.
|
|
389
413
|
* @param threadId - The discussion.
|
|
390
414
|
* @param messageId - The message to delete.
|