@bud.sh/app 0.5.0 → 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-ChANGtl-.js → index-DtISWZp9.js} +2 -2
- package/dist/client/assets/pages-BJ-tNJ4J.js +1 -0
- package/dist/client/assets/{project-branches-DO897zM6.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-Lay351p4.js → project-threads-Bv7IDBgi.js} +105 -105
- package/dist/client/assets/project-work-DAE9-olg.js +1 -0
- package/dist/client/assets/{task-design-Avb2RO4w.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-V36732ER.js → canvas-AII16n9i.js} +97 -6
- package/dist/hosted/assets/{comment-data-CF2ZV_3k.js → comment-data-BXfMElfx.js} +2004 -402
- package/dist/hosted/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/hosted/assets/{files-DjSCjfU7.js → files-D_1yeAVO.js} +10 -5
- package/dist/hosted/assets/{pages-BzjzeuPu.js → pages-CN_SbKWA.js} +3 -3
- package/dist/hosted/assets/{project-branches-BT97J9i7.js → project-branches-Bxp0DCwg.js} +1 -1
- package/dist/hosted/assets/{project-thread-links-BRLgByEe.js → project-thread-links-KqQoKBLE.js} +76 -4
- package/dist/{node-host/assets/screen-CZXWJEds.js → hosted/assets/screen-DpAcDUKR.js} +29 -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 -13
- 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-Dc1mYCwQ.js → node-host/assets/canvas-BeDoufy1.js} +97 -7
- package/dist/node-host/assets/{comment-data-DyIZNpfG.js → comment-data-DE2T9yTj.js} +1980 -376
- package/dist/node-host/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/node-host/assets/{files-Dh2TiQZq.js → files-Dl-PTS09.js} +11 -6
- package/dist/node-host/assets/{pages-BxpjbYhs.js → pages-DL2sk6_U.js} +3 -3
- package/dist/node-host/assets/{project-branches-B7HUGiVK.js → project-branches-DGp5ELct.js} +1 -1
- package/dist/{server/assets/project-thread-links-CBOpf6zk.js → node-host/assets/project-thread-links-CgBV3Jcm.js} +76 -5
- package/dist/{hosted/assets/screen-CKp2C7kx.js → node-host/assets/screen-B55yyVfb.js} +29 -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-TRUfxfL5.js → server/assets/canvas-CJWQ-jjv.js} +98 -6
- package/dist/server/assets/{comment-data-CsjukwAW.js → comment-data-Rg42ToTW.js} +1666 -47
- 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-E9mSFeoc.js → files-CPJqKeMo.js} +12 -7
- package/dist/server/assets/{listener-DN5TyOjJ.js → listener-D61O6PzF.js} +708 -12
- package/dist/server/assets/{pages-BBBXyJWV.js → pages-KJY_Ba92.js} +4 -4
- package/dist/server/assets/{project-branches-B0YIK6Ur.js → project-branches-qG9ACZvo.js} +2 -2
- package/dist/{node-host/assets/project-thread-links-CauJF0Cz.js → server/assets/project-thread-links-CqK0lqCF.js} +77 -4
- package/dist/{node-host/assets/tasks-request-ZWmbc8fE.js → server/assets/project-work-DoIwxWMm.js} +87 -2
- package/dist/server/assets/run-BJ8r5jSh.js +572 -0
- package/dist/server/assets/{screen-BIQA2mr4.js → screen-CBrHPFug.js} +30 -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-Cu6R6xxT.js +0 -1
- package/dist/client/assets/difference-worker-jfTSn-Tw.js +0 -8
- package/dist/client/assets/files-js6ElfkU.js +0 -1
- package/dist/client/assets/i18n-DxqFr2mi.js +0 -1
- package/dist/client/assets/index-CFFxP0gS.css +0 -2
- package/dist/client/assets/pages-6_lhiQmz.js +0 -1
- package/dist/client/assets/project-comments-DFFKVpia.js +0 -1
- package/dist/client/assets/project-thread-links-NLFWQRD2.js +0 -1
- package/dist/client/assets/project-work-du0Y-L5Y.js +0 -1
- package/dist/client/assets/tasks-CA-E8bbK.js +0 -1
- package/dist/client/assets/tasks-request-C55IeuiP.js +0 -1
- package/dist/client/assets/workspace-Cw5HvX5d.js +0 -2
- package/dist/hosted/assets/tasks-Dj7AyBJB.js +0 -649
- package/dist/hosted/assets/tasks-request-DZob623r.js +0 -113
- package/dist/node-host/assets/tasks-Bs1IOpeU.js +0 -651
- package/dist/server/assets/project-work-qSKFO5yj.js +0 -88
- package/dist/server/assets/tasks-CiXodsLN.js +0 -652
- package/dist/server/assets/tasks-request-DhwCzpRi.js +0 -115
- package/dist/types/assets/picker-D1Bw3ndx.d.ts +0 -14
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as __toESM } from "./rolldown-runtime-DktXgydw.js";
|
|
2
|
-
import { $
|
|
2
|
+
import { $r as maxFileSaveBytes, A as FileRecoveryDialog, Ar as WorkerPoolWorkerError, At as readReviewLocation, Br as validateResolvedThemeName, Bt as reconcileFileView, Cr as isDiffPlainText, D as FileEditorPanel, Dr as areDiffTargetsEqual, Dt as defaultReviewView, E as ReviewActionDialog, Er as areFilesEqual, Et as defaultReviewPosition, F as defaultFileDestination, Fr as areFileRenderOptionsEqual, Ft as closeFileTab, G as FileSearchPanel, Gr as resolveLanguage, Hr as themeResolver, I as fileActionIntent, Ir as hasResolvedThemes, It as defaultFileView, Jr as parseReviewActionPlan, Kr as areLanguagesAttached, L as mutationFileView, Lr as areThemesEqual, Lt as fileHref, M as FileReviewPanel, Mn as jsx, Mr as markWorkerErrorReported, Mt as reviewComparison, N as codeThemes, Nn as routes, Nr as isFilePlainText, Nt as reviewContextKey, O as defaultEditorPreferences, On as Fragment, Or as WorkerPoolTaskCanceledError, P as FileWorkspace, Pn as fileRoutes, Pr as renderFileWithHighlighter, Pt as reviewHref, Qr as parseFileSaveResult, R as remainingMutationIntent, Rr as getSharedHighlighter, Rt as parseFileView, Sr as reviewConflictIdentity, T as FileConflictPanel, Tr as areDiffRenderOptionsEqual, Ur as getThemes, Vr as attachResolvedThemes, Vt as rememberFile, Wr as getResolvedOrResolveLanguage, Xr as parseReviewActionResult, Yr as parseReviewActionRecoveries, Zr as parseFileSaveRequest, ai as parseReviewRepository, br as createCodeAnchor, ci as parseFileSearchQuery, cn as t, di as parseFileDocument, ei as parseMutationPlan, f as storeDocument, fi as parseFileIndex, fn as ref, ft as codeCommentCounts, gt as isCodeConversation, ii as parseReviewHistory, in as writePreference, j as FileMutationDialog, jr as isHandledWorkerPoolError, jt as rememberReviewPosition, k as parseEditorPreferences, kr as WorkerPoolTerminatedError, kt as parseReviewSession, l as projectStore, li as parseFileSearchResult, m as storedFiles, mt as conversationHref, ni as parseRecoveries, nn as toast, oi as parseReviewSnapshot, p as storedDocument, pi as parseFilePath, q as ConversationSidebar, qr as ResolvedLanguages, ri as parseReviewDiff, rn as readPreference, s as applyFileUpdate, si as parseReviewSource, ti as parseMutationResult, u as saveFiles, ui as parseFileChange, un as Text, v as projectLive, vt as locateCodeConversations, wr as renderDiffWithHighlighter, xr as parseFileUpdate, yt as readConversationLocation, zr as prepareThemeResolution, zt as readFileLocation } from "./comment-data-BXfMElfx.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-DpAcDUKR.js";
|
|
6
|
+
import { n as ProjectThreadLinks, t as ProjectMakeTask } from "./project-thread-links-KqQoKBLE.js";
|
|
7
7
|
//#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
|
|
8
8
|
function getResolvedLanguages(languages) {
|
|
9
9
|
const resolvedLanguages = [];
|
|
@@ -3242,7 +3242,12 @@ function ProjectFileReview(handle) {
|
|
|
3242
3242
|
await comments.loadThread(thread.id, true);
|
|
3243
3243
|
}
|
|
3244
3244
|
}),
|
|
3245
|
-
renderThreadActions: (thread) => /* @__PURE__ */ jsx(
|
|
3245
|
+
renderThreadActions: (thread) => /* @__PURE__ */ jsx(Fragment, { children: [/* @__PURE__ */ jsx(ProjectMakeTask, {
|
|
3246
|
+
thread,
|
|
3247
|
+
canMake: comments.snapshot.capabilities.link && project.storage.work?.state === "ready",
|
|
3248
|
+
busy: comments.busy,
|
|
3249
|
+
onMake: comments.makeTask
|
|
3250
|
+
}), /* @__PURE__ */ jsx(ProjectThreadLinks, {
|
|
3246
3251
|
part: "action",
|
|
3247
3252
|
project,
|
|
3248
3253
|
thread,
|
|
@@ -3252,7 +3257,7 @@ function ProjectFileReview(handle) {
|
|
|
3252
3257
|
await comments.load();
|
|
3253
3258
|
await comments.loadThread(thread.id, true);
|
|
3254
3259
|
}
|
|
3255
|
-
}),
|
|
3260
|
+
})] }),
|
|
3256
3261
|
capabilities: comments.snapshot.capabilities,
|
|
3257
3262
|
selected: selectedThread,
|
|
3258
3263
|
currentPath: handle.props.path,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fn as pageRoutes, Gt as Loader, Kt as Spinner, Mn as jsx, On as Fragment, Qt as IconButton, Zt as Select, aa as string, cn as t, dt as PagesWorkspace, ea as number, fn as ref, hn as on, ia as parseSafe, in as writePreference, l as projectStore, mi as MAX_CANVAS_Y, na as optional, qi as array, rn as readPreference, ta as object, un as Text } from "./comment-data-BXfMElfx.js";
|
|
2
2
|
import { n as workspaceTab, t as followWorkspaceTab } from "../hosted.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-Bxp0DCwg.js";
|
|
4
|
+
import { n as createProjectComments, t as defineScreen } from "./screen-DpAcDUKR.js";
|
|
5
5
|
//#region app/client/page-picture.tsx
|
|
6
6
|
/**
|
|
7
7
|
* A page as its latest captured picture, for Pages where there is no running site: its slices
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $i as nullable, Gn as parsePreview, Ji as boolean, Kn as parsePreviewBranch, Nn as routes, Xn as parsePreviewPins, Zi as enum_, aa as string, c as previewKey, cn as t, ea as number, hi as parseElementAnchor, ia as parseSafe, l as projectStore, qi as array, ta as object, v as projectLive, x as writeRows, y as plainRow } from "./comment-data-BXfMElfx.js";
|
|
2
2
|
//#region app/client/project-previews.ts
|
|
3
3
|
/**
|
|
4
4
|
* A preview's capture in a theme at a viewport. Captures from before viewports existed name
|
package/dist/hosted/assets/{project-thread-links-BRLgByEe.js → project-thread-links-KqQoKBLE.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import {
|
|
1
|
+
import { C as ThreadTaskPicker, Ct as taskHref, Mn as jsx, Nn as routes, On as Fragment, Qt as IconButton, S as ThreadTaskLinks, Tt as taskRole, _ as requestComments, cn as t, fn as ref, gi as parseWorkWorkspace, h as storedWorkspace, hn as on, hr as parseThreadLinkInput, ji as valueByRole, l as projectStore, ur as parseThread, wi as parseWorkItemRef } from "./comment-data-BXfMElfx.js";
|
|
2
|
+
import { a as requestTasks, r as projectWork } from "../hosted.js";
|
|
3
3
|
//#region app/client/project-task-picker.tsx
|
|
4
4
|
/**
|
|
5
5
|
* Loads searchable task choices only while the picker is mounted.
|
|
@@ -162,11 +162,77 @@ async function saveThreadLinks(thread, selected, mutate, signal) {
|
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region app/client/project-thread-links.tsx
|
|
164
164
|
/**
|
|
165
|
+
* Whether a discussion offers Make task: placed on a page or code, without tasks yet, where
|
|
166
|
+
* discussions can link and tasks are stored.
|
|
167
|
+
* @param thread - The discussion.
|
|
168
|
+
* @param canMake - Whether the stores allow it.
|
|
169
|
+
* @returns Whether to offer it.
|
|
170
|
+
*/
|
|
171
|
+
function makeTaskAvailable(thread, canMake) {
|
|
172
|
+
return canMake && thread.anchor !== null && !thread.itemIds.length;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Turns a discussion into a task and opens it, when `makeTaskAvailable` allows.
|
|
176
|
+
* @param handle - The discussion, whether tasks can be made, and the store's operation.
|
|
177
|
+
* @returns The toolbar button, or nothing.
|
|
178
|
+
*/
|
|
179
|
+
function ProjectMakeTask(handle) {
|
|
180
|
+
let making = false;
|
|
181
|
+
return () => {
|
|
182
|
+
let { thread, canMake, busy } = handle.props;
|
|
183
|
+
if (!makeTaskAvailable(thread, canMake)) return null;
|
|
184
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
185
|
+
icon: "task-add",
|
|
186
|
+
label: t("app.client.projectThreadLinks.makeTask"),
|
|
187
|
+
size: "small",
|
|
188
|
+
tooltip: true,
|
|
189
|
+
disabled: busy || making,
|
|
190
|
+
"data-testid": "comment-make-task",
|
|
191
|
+
mix: on("click", async () => {
|
|
192
|
+
making = true;
|
|
193
|
+
handle.update();
|
|
194
|
+
try {
|
|
195
|
+
let task = await handle.props.onMake(thread.id);
|
|
196
|
+
window.location.assign(taskHref(task.id));
|
|
197
|
+
} catch {} finally {
|
|
198
|
+
making = false;
|
|
199
|
+
if (!handle.signal.aborted) handle.update();
|
|
200
|
+
}
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
165
206
|
* Shares task links and their revision-checked editor across task, canvas and code discussions.
|
|
166
207
|
* @param handle - The selected discussion, capability and owning view's refresh callback.
|
|
167
208
|
* @returns Linked tasks and an editor that retains its selection after failed writes.
|
|
168
209
|
*/
|
|
169
210
|
function ProjectThreadLinks(handle) {
|
|
211
|
+
let stored = null;
|
|
212
|
+
let project = handle.props.project;
|
|
213
|
+
projectStore(project).then((store) => {
|
|
214
|
+
if (handle.signal.aborted) return;
|
|
215
|
+
let read = () => {
|
|
216
|
+
let workspace = storedWorkspace(store);
|
|
217
|
+
stored = workspace && {
|
|
218
|
+
schema: workspace.schema,
|
|
219
|
+
items: new Map(workspace.snapshot.items.map((item) => [item.id, {
|
|
220
|
+
id: item.id,
|
|
221
|
+
title: taskRole(item, workspace.schema, "title") || void 0,
|
|
222
|
+
status: taskRole(item, workspace.schema, "status") || void 0
|
|
223
|
+
}])),
|
|
224
|
+
runs: Object.fromEntries(workspace.snapshot.items.flatMap((item) => item.run ? [[item.id, item.run]] : []))
|
|
225
|
+
};
|
|
226
|
+
update();
|
|
227
|
+
};
|
|
228
|
+
let subscriptions = [store.boards.subscribeChanges(read), store.work.subscribeChanges(read)];
|
|
229
|
+
handle.signal.addEventListener("abort", () => {
|
|
230
|
+
for (let subscription of subscriptions) subscription.unsubscribe();
|
|
231
|
+
});
|
|
232
|
+
let work = projectWork(project);
|
|
233
|
+
if (!store.boards.has("board") && handle.props.thread.itemIds.length && project.storage.work?.state === "ready") work.refresh().catch(() => {});
|
|
234
|
+
read();
|
|
235
|
+
});
|
|
170
236
|
let editing = null;
|
|
171
237
|
let needsReview = false;
|
|
172
238
|
let reviewed = false;
|
|
@@ -207,7 +273,13 @@ function ProjectThreadLinks(handle) {
|
|
|
207
273
|
mix: on("click", edit)
|
|
208
274
|
}) : null : /* @__PURE__ */ jsx(ThreadTaskLinks, {
|
|
209
275
|
itemIds: handle.props.thread.itemIds,
|
|
210
|
-
items: handle.props.
|
|
276
|
+
items: handle.props.thread.itemIds.map((id) => ({
|
|
277
|
+
...handle.props.items?.find((item) => item.id === id),
|
|
278
|
+
...stored?.items.get(id),
|
|
279
|
+
id
|
|
280
|
+
})),
|
|
281
|
+
schema: stored?.schema,
|
|
282
|
+
runs: stored?.runs,
|
|
211
283
|
href: taskHref,
|
|
212
284
|
busy: handle.props.busy,
|
|
213
285
|
onEdit: !handle.props.part && handle.props.canLink ? edit : void 0
|
|
@@ -236,4 +308,4 @@ function ProjectThreadLinks(handle) {
|
|
|
236
308
|
}) : null] });
|
|
237
309
|
}
|
|
238
310
|
//#endregion
|
|
239
|
-
export {
|
|
311
|
+
export { ProjectThreadLinks as n, ProjectTaskPicker as r, ProjectMakeTask as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nn as routes, _ as requestComments, _r as parseThreadSnapshot, a as saveThreads, b as writeOptimistically, cn as t, er as predictThreadCreate, fr as parseThreadFilter, g as CommentsRequestError, i as saveThread, l as projectStore, n as unavailableComments, nn as toast, nr as predictThreadReply, o as threadMatches, pr as parseThreadId, rr as predictThreadStatus, tr as predictThreadDelete, ur as parseThread, x as writeRows, y as plainRow } from "./comment-data-BXfMElfx.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) };
|
|
@@ -233,6 +240,10 @@ function createProjectComments(options) {
|
|
|
233
240
|
if (!detailFailures.size) error = "";
|
|
234
241
|
}
|
|
235
242
|
} catch (cause) {
|
|
243
|
+
if (!signal.aborted && turn === generation && cause instanceof CommentsRequestError && cause.code === "not-found") {
|
|
244
|
+
await forget(id);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
236
247
|
if (!signal.aborted && turn === generation) {
|
|
237
248
|
detailFailures.add(id);
|
|
238
249
|
error = cause instanceof Error ? cause.message : t("app.client.projectComments.couldNotLoadDiscussion");
|
|
@@ -381,6 +392,23 @@ function createProjectComments(options) {
|
|
|
381
392
|
};
|
|
382
393
|
},
|
|
383
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
|
+
/**
|
|
384
412
|
* Deletes one of the viewer's messages; its first message deletes the whole discussion.
|
|
385
413
|
* @param threadId - The discussion.
|
|
386
414
|
* @param messageId - The message to delete.
|