@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,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
1
|
+
import { zn as Icon } from "./events-BH_rAu7O.js";
|
|
2
|
+
import { Cn as IconButton, Fn as Text, Gt as Loader, K as BranchSidebar, Nn as t, On as readPreference, Sn as Select, Tn as Tooltip, U as CanvasWorkspace, W as captureCanvasPoint, bn as WorkspaceLayout, kn as writePreference, l as projectStore, mt as conversationHref, qt as Button, t as commentsUnavailable, yn as ToolbarSeparator } from "./comment-data-Rg42ToTW.js";
|
|
3
|
+
import { i as pictureKey, n as createProjectPreviews, t as createProjectBranches } from "./project-branches-qG9ACZvo.js";
|
|
4
|
+
import { n as createProjectComments, r as loadComments, t as defineScreen } from "./screen-CBrHPFug.js";
|
|
5
|
+
import { n as ProjectThreadLinks, t as ProjectMakeTask } from "./project-thread-links-CqK0lqCF.js";
|
|
5
6
|
import { on, ref } from "remix/component";
|
|
6
7
|
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
7
8
|
//#region app/client/preview-image.tsx
|
|
@@ -291,6 +292,92 @@ function PreviewRefresh(handle) {
|
|
|
291
292
|
};
|
|
292
293
|
}
|
|
293
294
|
//#endregion
|
|
295
|
+
//#region app/client/task-context.ts
|
|
296
|
+
var CROP = {
|
|
297
|
+
width: 1200,
|
|
298
|
+
height: 800
|
|
299
|
+
};
|
|
300
|
+
var QUALITY = .82;
|
|
301
|
+
/**
|
|
302
|
+
* What a task made from a canvas comment takes along: the page around the comment's point with
|
|
303
|
+
* the point marked, and the element there with its source.
|
|
304
|
+
* @param previews - The canvas's pictures, for the branch the comment is on.
|
|
305
|
+
* @param thread - The discussion.
|
|
306
|
+
* @param sizes - The project's viewports.
|
|
307
|
+
* @returns The context, or undefined when the comment has no picture to take it from.
|
|
308
|
+
*/
|
|
309
|
+
async function canvasTaskContext(previews, thread, sizes) {
|
|
310
|
+
let anchor = thread.anchor;
|
|
311
|
+
if (!anchor || "type" in anchor) return void 0;
|
|
312
|
+
let size = sizes.find((candidate) => candidate.width === anchor.viewport) ?? sizes[0];
|
|
313
|
+
if (!size) return void 0;
|
|
314
|
+
let picture = await previews.picture(anchor.pageId, "light", size);
|
|
315
|
+
if (!picture) return void 0;
|
|
316
|
+
let { capture, images } = picture;
|
|
317
|
+
let pin = capture.pins?.find((entry) => entry.id === thread.id && entry.x !== null);
|
|
318
|
+
let point = pin && pin.x !== null && pin.y !== null ? {
|
|
319
|
+
x: pin.x,
|
|
320
|
+
y: pin.y
|
|
321
|
+
} : {
|
|
322
|
+
x: anchor.offsetX * capture.width,
|
|
323
|
+
y: anchor.offsetY
|
|
324
|
+
};
|
|
325
|
+
let [image, element] = await Promise.all([cropAround(capture, images, point).catch(() => void 0), previews.describe(anchor.pageId, capture, point.x, point.y).catch(() => null)]);
|
|
326
|
+
return {
|
|
327
|
+
...image ? { image } : {},
|
|
328
|
+
element,
|
|
329
|
+
point
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Cuts the page around a point out of a capture's slices and marks the point.
|
|
334
|
+
* @param capture - The capture's size, scale and slices.
|
|
335
|
+
* @param images - The slices' images, top to bottom.
|
|
336
|
+
* @param point - The point in CSS pixels.
|
|
337
|
+
* @returns The JPEG as base64.
|
|
338
|
+
*/
|
|
339
|
+
async function cropAround(capture, images, point) {
|
|
340
|
+
let width = Math.min(CROP.width, capture.width);
|
|
341
|
+
let height = Math.min(CROP.height, capture.height);
|
|
342
|
+
let left = Math.max(0, Math.min(capture.width - width, Math.round(point.x - width / 2)));
|
|
343
|
+
let top = Math.max(0, Math.min(capture.height - height, Math.round(point.y - height / 2)));
|
|
344
|
+
let canvas = new OffscreenCanvas(width, height);
|
|
345
|
+
let context = canvas.getContext("2d");
|
|
346
|
+
if (!context) throw new Error("No canvas.");
|
|
347
|
+
context.fillStyle = "#fff";
|
|
348
|
+
context.fillRect(0, 0, width, height);
|
|
349
|
+
let tileTop = 0;
|
|
350
|
+
for (let [index, tile] of capture.tiles.entries()) {
|
|
351
|
+
let tileBottom = tileTop + tile.height;
|
|
352
|
+
let from = Math.max(top, tileTop);
|
|
353
|
+
let to = Math.min(top + height, tileBottom);
|
|
354
|
+
if (to > from && images[index]) {
|
|
355
|
+
let bitmap = await createImageBitmap(images[index]);
|
|
356
|
+
context.drawImage(bitmap, left * capture.scale, (from - tileTop) * capture.scale, width * capture.scale, (to - from) * capture.scale, 0, from - top, width, to - from);
|
|
357
|
+
bitmap.close();
|
|
358
|
+
}
|
|
359
|
+
tileTop = tileBottom;
|
|
360
|
+
}
|
|
361
|
+
let x = point.x - left;
|
|
362
|
+
let y = point.y - top;
|
|
363
|
+
context.lineWidth = 6;
|
|
364
|
+
context.strokeStyle = "#fff";
|
|
365
|
+
context.beginPath();
|
|
366
|
+
context.arc(x, y, 18, 0, Math.PI * 2);
|
|
367
|
+
context.stroke();
|
|
368
|
+
context.lineWidth = 3;
|
|
369
|
+
context.strokeStyle = "#ef4444";
|
|
370
|
+
context.stroke();
|
|
371
|
+
let blob = await canvas.convertToBlob({
|
|
372
|
+
type: "image/jpeg",
|
|
373
|
+
quality: QUALITY
|
|
374
|
+
});
|
|
375
|
+
let bytes = new Uint8Array(await blob.arrayBuffer());
|
|
376
|
+
let binary = "";
|
|
377
|
+
for (let index = 0; index < bytes.length; index += 32768) binary += String.fromCharCode(...bytes.subarray(index, index + 32768));
|
|
378
|
+
return btoa(binary);
|
|
379
|
+
}
|
|
380
|
+
//#endregion
|
|
294
381
|
//#region app/client/project-differences.ts
|
|
295
382
|
var results = /* @__PURE__ */ new Map();
|
|
296
383
|
function worker() {
|
|
@@ -1008,7 +1095,12 @@ function ProjectCanvas(handle) {
|
|
|
1008
1095
|
await comments.loadThread(thread.id, true);
|
|
1009
1096
|
}
|
|
1010
1097
|
}),
|
|
1011
|
-
renderThreadActions: (thread) => /* @__PURE__ */ jsx(
|
|
1098
|
+
renderThreadActions: (thread) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ProjectMakeTask, {
|
|
1099
|
+
thread,
|
|
1100
|
+
canMake: comments.snapshot.capabilities.link && project.storage.work?.state === "ready",
|
|
1101
|
+
busy: comments.busy,
|
|
1102
|
+
onMake: async (id) => comments.makeTask(id, await canvasTaskContext(previews, thread, sizes).catch(() => void 0))
|
|
1103
|
+
}), /* @__PURE__ */ jsx(ProjectThreadLinks, {
|
|
1012
1104
|
part: "action",
|
|
1013
1105
|
project,
|
|
1014
1106
|
thread,
|
|
@@ -1018,7 +1110,7 @@ function ProjectCanvas(handle) {
|
|
|
1018
1110
|
await comments.load();
|
|
1019
1111
|
await comments.loadThread(thread.id, true);
|
|
1020
1112
|
}
|
|
1021
|
-
}),
|
|
1113
|
+
})] }),
|
|
1022
1114
|
initialThreadId: requestedThread,
|
|
1023
1115
|
loaded: comments.loaded,
|
|
1024
1116
|
busy: comments.busy,
|