@bud.sh/app 0.3.0 → 0.4.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/dist/client/assets/bud/design.js +1 -1
- package/dist/client/assets/canvas-C8hyPWoT.js +1 -0
- package/dist/client/assets/difference-worker-BfF4_N3e.js +8 -0
- package/dist/client/assets/files-D_Tm7gCK.js +1 -0
- package/dist/client/assets/i18n-BtfXum8P.js +1 -0
- package/dist/client/assets/index-Dpxjiok1.js +2 -0
- package/dist/client/assets/pages-B-_CKvDS.js +1 -0
- package/dist/client/assets/project-branches-DzXdaT9L.js +1 -0
- package/dist/client/assets/project-comments-CQkB2jbE.js +1 -0
- package/dist/client/assets/project-thread-links-BN7zL0AX.js +1 -0
- package/dist/client/assets/{project-threads-DezXiVK6.js → project-threads-CHGG-6fo.js} +104 -104
- package/dist/client/assets/{project-work-CB1JHqGW.js → project-work-L5fYMSOu.js} +1 -1
- package/dist/client/assets/task-design-DYqcqq1b.js +23 -0
- package/dist/client/assets/tasks-A2FKo3_h.js +1 -0
- package/dist/client/assets/tasks-request-DGigNdyK.js +1 -0
- package/dist/client/assets/workspace-CvWmU2RK.js +2 -0
- package/dist/client/index.html +2 -1
- package/dist/hosted/assets/{canvas-C69-96GR.js → canvas-MWtOwaWm.js} +69 -41
- package/dist/hosted/assets/{comment-data-CiDuvXi2.js → comment-data-DsgJWq4n.js} +7195 -1067
- package/dist/hosted/assets/{files-DQL5hzs3.js → files-Wvo11G2A.js} +92 -89
- package/dist/hosted/assets/{pages-DFs7jB6M.js → pages-BAmRFVtU.js} +31 -22
- package/dist/hosted/assets/{project-branches-CffV4IS1.js → project-branches-BNloVosX.js} +5 -5
- package/dist/hosted/assets/{project-thread-links-B1Y2bDUx.js → project-thread-links-BmY8HQXt.js} +12 -12
- package/dist/hosted/assets/{screen-BroBb1Z_.js → screen-QmqmI2Aq.js} +18 -18
- package/dist/hosted/assets/{tasks-mzmNhe2d.js → tasks-C8iWPrWg.js} +29 -29
- package/dist/hosted/assets/{tasks-request-Dcrpd2_8.js → tasks-request-C89fN1dK.js} +7 -7
- package/dist/hosted/hosted.js +48 -29
- package/dist/node/design.js +6235 -139
- package/dist/node/index.js +4 -2
- package/dist/node-host/assets/{canvas-BZhzizzt.js → canvas-D_F8SIlm.js} +70 -42
- package/dist/node-host/assets/{comment-data-nUlI0szN.js → comment-data-q_8INiZz.js} +7221 -1093
- package/dist/node-host/assets/{files-CTzcWGjb.js → files-xazOrNCX.js} +92 -89
- package/dist/node-host/assets/{pages-0aWH7z1j.js → pages-D6VkmdfQ.js} +31 -22
- package/dist/node-host/assets/{project-branches-1zs_0J_y.js → project-branches-C26hwmo3.js} +5 -5
- package/dist/node-host/assets/{project-thread-links-LpUAGcDr.js → project-thread-links-BOzjws5W.js} +12 -12
- package/dist/node-host/assets/{screen-DQoTOWYR.js → screen-Dog-YByu.js} +18 -18
- package/dist/node-host/assets/{tasks-C0WqnM7Q.js → tasks-A1_bpb3_.js} +30 -30
- package/dist/node-host/assets/{tasks-request-Bwky5ORf.js → tasks-request-Bie1PpQP.js} +7 -7
- package/dist/node-host/node-host.js +48 -29
- package/dist/server/assets/{branch-previews-BryeA_kA.js → branch-previews-ClkoJ0lM.js} +4 -2
- package/dist/server/assets/{canvas-D6tIkONI.js → canvas-Dn4RYoU2.js} +70 -42
- package/dist/server/assets/{comment-data-BuArfgcc.js → comment-data-B0OLHBGp.js} +7219 -1091
- package/dist/server/assets/{files-DkrEB48U.js → files-C5Vilfe4.js} +92 -89
- package/dist/server/assets/{listener-oKd5ETMj.js → listener-o1STuLju.js} +43 -29
- package/dist/server/assets/{pages-iEdmK_o2.js → pages-BNa0MHEc.js} +31 -22
- package/dist/server/assets/{project-branches-B7rtrvMl.js → project-branches-GtQYyOH5.js} +5 -5
- package/dist/server/assets/{project-thread-links-ue_ad9IX.js → project-thread-links-Nfz9NIny.js} +12 -12
- package/dist/server/assets/{project-work-6aOyja4v.js → project-work-Cy_BpHwR.js} +2 -2
- package/dist/server/assets/{screen-DMUB9a-K.js → screen-BtcJmZwj.js} +18 -18
- package/dist/server/assets/{server-DN5uwE4k.js → server-CYvuOSBA.js} +1 -1
- package/dist/server/assets/{services-Ber8opFE.js → services-DK4fqrlF.js} +2 -2
- package/dist/server/assets/{tasks-C2oa2wSC.js → tasks-B82tHwyQ.js} +31 -31
- package/dist/server/assets/{tasks-request-Bk5EoY_p.js → tasks-request-BtJBlkxV.js} +7 -6
- package/dist/server/capture.js +1 -1
- package/dist/server/migration.js +3 -3
- package/dist/server/runtime.js +4 -4
- package/dist/server/server.js +3 -3
- package/dist/types/assets/{config-Cuauq8xY.d.ts → config-DIC2cf_S.d.ts} +3 -0
- package/dist/types/assets/{contract-BsCQbbxD.d.ts → contract-CAT-XFNq.d.ts} +3 -1
- package/dist/types/companion.d.ts +1 -1
- package/dist/types/hosted.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/node-host.d.ts +2 -2
- package/dist/types/screen.d.ts +1 -1
- package/package.json +1 -1
- package/dist/client/assets/canvas-DxaIItAs.js +0 -1
- package/dist/client/assets/difference-worker-BpqPBs5g.js +0 -8
- package/dist/client/assets/files-C-7xoSt4.js +0 -1
- package/dist/client/assets/index-GPPa1XPO.js +0 -2
- package/dist/client/assets/pages-BVrTX_Eq.js +0 -1
- package/dist/client/assets/project-branches-DpxQx-T4.js +0 -1
- package/dist/client/assets/project-comments-D897aU5O.js +0 -1
- package/dist/client/assets/project-thread-links-Bp_TseD0.js +0 -1
- package/dist/client/assets/task-design-bktfn_Ok.js +0 -23
- package/dist/client/assets/tasks-Cqfj4fQN.js +0 -1
- package/dist/client/assets/tasks-request-mWMk9pBo.js +0 -1
- package/dist/client/assets/workspace-CznMN7F6.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bi as parseWorkQuery, pn as t, vi as parseWorkItemRef, y as routes, zn as createMultiMatcher } from "./comment-data-DsgJWq4n.js";
|
|
2
2
|
//#region app/client/tasks-request.ts
|
|
3
3
|
var reads = createMultiMatcher();
|
|
4
4
|
var writes = createMultiMatcher();
|
|
@@ -37,7 +37,7 @@ function validEndpoint(url, write) {
|
|
|
37
37
|
* @returns A validated DTO; error responses never become an empty successful view.
|
|
38
38
|
*/
|
|
39
39
|
async function requestTasks(url, token, signal, parse, fetcher = fetch, write) {
|
|
40
|
-
if (!validEndpoint(url, Boolean(write))) throw new Error("
|
|
40
|
+
if (!validEndpoint(url, Boolean(write))) throw new Error(t("app.client.tasksRequest.invalidEndpoint"));
|
|
41
41
|
signal.throwIfAborted();
|
|
42
42
|
let response = await fetcher(url, {
|
|
43
43
|
method: write ? "POST" : "GET",
|
|
@@ -52,7 +52,7 @@ async function requestTasks(url, token, signal, parse, fetcher = fetch, write) {
|
|
|
52
52
|
signal
|
|
53
53
|
});
|
|
54
54
|
let reader = response.body?.getReader();
|
|
55
|
-
if (!reader) throw new Error("
|
|
55
|
+
if (!reader) throw new Error(t("app.client.tasksRequest.emptyResponse"));
|
|
56
56
|
let chunks = [];
|
|
57
57
|
let size = 0;
|
|
58
58
|
try {
|
|
@@ -61,7 +61,7 @@ async function requestTasks(url, token, signal, parse, fetcher = fetch, write) {
|
|
|
61
61
|
let part = await reader.read();
|
|
62
62
|
if (part.done) break;
|
|
63
63
|
size += part.value.byteLength;
|
|
64
|
-
if (size > 4194304) throw new Error("
|
|
64
|
+
if (size > 4194304) throw new Error(t("app.client.tasksRequest.responseTooLarge"));
|
|
65
65
|
chunks.push(part.value);
|
|
66
66
|
}
|
|
67
67
|
} catch (cause) {
|
|
@@ -80,15 +80,15 @@ async function requestTasks(url, token, signal, parse, fetcher = fetch, write) {
|
|
|
80
80
|
try {
|
|
81
81
|
value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
82
82
|
} catch {
|
|
83
|
-
throw new Error("
|
|
83
|
+
throw new Error(t("app.client.tasksRequest.invalidResponse"));
|
|
84
84
|
}
|
|
85
85
|
if (!response.ok) {
|
|
86
|
-
let error = value && typeof value === "object" && "error" in value && typeof value.error === "string" ? value.error.slice(0, 1e3) : "
|
|
86
|
+
let error = value && typeof value === "object" && "error" in value && typeof value.error === "string" ? value.error.slice(0, 1e3) : t("app.client.tasksRequest.loadFailed");
|
|
87
87
|
let code = value && typeof value === "object" && "code" in value && typeof value.code === "string" && /^[a-z][a-z-]{0,63}$/.test(value.code) ? value.code : "request";
|
|
88
88
|
let currentRevision;
|
|
89
89
|
if (value && typeof value === "object" && "currentRevision" in value) {
|
|
90
90
|
let revision = value.currentRevision;
|
|
91
|
-
if (revision !== null && (typeof revision !== "string" || !revision.trim() || revision.length > 256 || revision.includes("\0"))) throw new Error("
|
|
91
|
+
if (revision !== null && (typeof revision !== "string" || !revision.trim() || revision.length > 256 || revision.includes("\0"))) throw new Error(t("app.client.tasksRequest.invalidConflictResponse"));
|
|
92
92
|
currentRevision = revision;
|
|
93
93
|
}
|
|
94
94
|
throw new TaskRequestError(error, code, currentRevision);
|
package/dist/hosted/hosted.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $n as
|
|
2
|
-
import { n as requestTasks } from "./assets/tasks-request-
|
|
1
|
+
import { $n as RESYNC, $t as Button, Ai as parseWorkSchema, An as sanitizeUrlAttribute, Bi as boolean$2, Bn as equal, Ci as parseWorkSyncResult, Cn as resolveMixDescriptors, Ct as legacyConversationHref, Di as parseMessage, Dn as SELF_CLOSING_TAGS, Dt as taskHref, Ei as valueByRole, En as FRAMEWORK_PROPS, Et as selectedTask, Fi as parseWork, Fn as createComponent, G as mergeThreads, Gn as PREVIEW_TILE_HEIGHT, Gt as fileRoutes, Hi as defaulted, Hn as RoutePattern, Ii as record$1, In as createFrameHandle, J as conversationId, Ji as optional$3, Jn as parsePreviewCapture, K as stableJson, Ki as number$2, Kt as pageRoutes, Li as strict$2, Ln as jsx, Mi as WorkValidationError, Mn as shouldStringifyBooleanAttribute, Ni as identifier$3, Nn as Fragment, Oi as parseMessageAuthor, On as isAllowedHostPropName, Pi as nonempty$1, Pn as Frame, Q as text$6, Qn as parsePreviewViewport, Ri as any, Rn as Route, S as writeRows, Si as parseWorkSync, Sn as composeMixedProps, Ti as parseWorkValue, Tn as isEntry, Tt as readConversationLocation, Ui as enum_, Un as MAX_PREVIEW_HEIGHT, V as parseTaskDesign, Vi as createSchema, Vn as joinPatterns, W as CommentMergeError, Wi as fail$11, Wn as PREVIEW_THUMBNAIL_WIDTHS, X as parseCommentThread, Xi as parseSafe, Xn as parsePreviewId, Y as object$2, Yi as parse, Yn as parsePreviewHash, Z as revision$2, Zi as string$2, Zn as parsePreviewPins, Zt as Loader, _ as requestComments, _i as parseWorkItem, _n as ref$1, an as LiveStatus, ar as parseThreadCapabilities, at as FieldCardHeader, b as plainRow, bi as parseWorkQuery, bn as on, ci as MAX_CANVAS_Y, cr as parseThreadInput, ct as initialShellTabs, d as saveWorkspace, di as parseSectionData, dn as isLocale, dr as parseThreadSnapshot, dt as readTabsCookie, er as parseLiveId, fi as parseWorkActionInput, fn as locale, fr as parseThreadStatus, ft as stepShellTab, gi as parseWorkDetail, gt as visitShellTab, hi as parseWorkCreate, hn as Text, ht as tabsCookieValue, ir as parseThread, it as FieldCardContent, ji as statusCategory, jn as serializeStyleObject, jt as legacyFileHref, ki as fieldByRole, kn as normalizeAttributeName, l as projectStore, li as parseElementAnchor, ln as readPreference, lr as parseThreadLinkInput, lt as openShellTab, mi as parseWorkConnection, mn as useLocaleSource, mt as tabsCookieName, n as unavailableComments, nn as ShellTabBar, nr as MAX_THREADS, or as parseThreadFilter, ot as activeTab, pi as parseWorkActivity, pn as t, pr as parseThreadStatusInput, pt as tabHref, q as parseCommentInput$1, qi as object$1, qn as parsePreviewBranch, qt as taskRoutes, r as followThreads, rr as parseAnchor, rt as FieldCard, sn as AppShell, sr as parseThreadId, st as closeShellTab, t as commentsUnavailable, tr as parseWorkChange, ui as parseWorkWorkspace, un as writePreference, ur as parseThreadReplyInput, ut as parseShellTabs, v as projectLive, vi as parseWorkItemRef, vn as appendFlushMarker, wi as parseWorkUpdate, wn as clientEntry, xi as parseWorkSnapshot, xn as normalizeUnsafeHTMLProps, y as routes, yi as parseWorkMutationResult, yn as stripFlushMarkers, yt as conversationDestination, zi as array$2, zn as createMultiMatcher } from "./assets/comment-data-DsgJWq4n.js";
|
|
2
|
+
import { n as requestTasks } from "./assets/tasks-request-C89fN1dK.js";
|
|
3
3
|
import * as Crypto from "node:crypto";
|
|
4
4
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
5
5
|
import * as Path from "node:path";
|
|
@@ -16,6 +16,7 @@ import { pathToFileURL } from "node:url";
|
|
|
16
16
|
import { access, mkdir, mkdtemp, readFile, readdir, realpath, rename, rm, stat, symlink, writeFile } from "node:fs/promises";
|
|
17
17
|
import { gunzipSync, gzipSync } from "node:zlib";
|
|
18
18
|
import { createServer } from "node:net";
|
|
19
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
19
20
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Pipeable.js
|
|
20
21
|
/**
|
|
21
22
|
* The `Pipeable` module defines the shared interface and implementation helpers
|
|
@@ -36808,6 +36809,7 @@ var ConfigFields = check(section("Bud config must export an object.", {
|
|
|
36808
36809
|
files: any(),
|
|
36809
36810
|
logo: any(),
|
|
36810
36811
|
theme: any(),
|
|
36812
|
+
locale: any(),
|
|
36811
36813
|
picker: any(),
|
|
36812
36814
|
branches: any(),
|
|
36813
36815
|
flows: any()
|
|
@@ -36848,7 +36850,7 @@ var BudRoutesSchema = check(list(RouteSchema, "bud.config must define at least o
|
|
|
36848
36850
|
var port = (value) => value === void 0 || Number.isInteger(value) && value >= 0 && value <= 65535;
|
|
36849
36851
|
var remote = (value) => typeof value === "string" && /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(value);
|
|
36850
36852
|
/** A project's config, validated and normalized before Bud starts any listeners. */
|
|
36851
|
-
var BudConfigSchema = delegate(check(delegate(check(delegate(check(delegate(ConfigFields, (config) => ({
|
|
36853
|
+
var BudConfigSchema = delegate(check(delegate(check(check(delegate(check(delegate(ConfigFields, (config) => ({
|
|
36852
36854
|
...config,
|
|
36853
36855
|
routes: parseConfig(BudRoutesSchema, config.routes)
|
|
36854
36856
|
})), ({ port: companion, target }) => port(companion ?? 0) && port(target?.port) ? void 0 : "Ports must be integers between 0 and 65535."), ({ target, ...config }) => {
|
|
@@ -36857,7 +36859,7 @@ var BudConfigSchema = delegate(check(delegate(check(delegate(check(delegate(Conf
|
|
|
36857
36859
|
...config,
|
|
36858
36860
|
targetOrigin: origin ? normalizeOrigin(origin, "target.origin must be an HTTP(S) origin without a path or credentials.") : origin
|
|
36859
36861
|
};
|
|
36860
|
-
}), ({ comments }) => remote(comments?.remote ?? "origin") ? void 0 : "comments.remote must be a Git remote name."), (config) => {
|
|
36862
|
+
}), ({ locale }) => locale === void 0 || locale === "en" || locale === "de" ? void 0 : "locale must be \"en\" or \"de\"."), ({ comments }) => remote(comments?.remote ?? "origin") ? void 0 : "comments.remote must be a Git remote name."), (config) => {
|
|
36861
36863
|
let flows = parseConfig(BudFlowsSchema, config.flows);
|
|
36862
36864
|
let steps = flows.flatMap((flow) => flow.steps.map((step) => flowStepRoute(flow, step)));
|
|
36863
36865
|
let home = config.routes.findIndex((route) => route.path === "/") + 1;
|
|
@@ -36884,6 +36886,7 @@ var BudConfigSchema = delegate(check(delegate(check(delegate(check(delegate(Conf
|
|
|
36884
36886
|
files: parseConfig(BudFilesSchema, config.files),
|
|
36885
36887
|
logo: parseConfig(BudLogoSchema, config.logo),
|
|
36886
36888
|
theme: parseConfig(BudThemeSchema, config.theme),
|
|
36889
|
+
locale: config.locale === void 0 ? "en" : config.locale,
|
|
36887
36890
|
picker: parseConfig(BudPickerSchema, config.picker),
|
|
36888
36891
|
branches: parseConfig(BudBranchesSchema, config.branches)
|
|
36889
36892
|
}));
|
|
@@ -38763,10 +38766,10 @@ function ProjectLiveStatus(handle) {
|
|
|
38763
38766
|
//#endregion
|
|
38764
38767
|
//#region app/client/screens.ts
|
|
38765
38768
|
var builtIns = {
|
|
38766
|
-
"bud:pages": () => import("./assets/pages-
|
|
38767
|
-
"bud:canvas": () => import("./assets/canvas-
|
|
38768
|
-
"bud:tasks": () => import("./assets/tasks-
|
|
38769
|
-
"bud:files": () => import("./assets/files-
|
|
38769
|
+
"bud:pages": () => import("./assets/pages-BAmRFVtU.js"),
|
|
38770
|
+
"bud:canvas": () => import("./assets/canvas-MWtOwaWm.js"),
|
|
38771
|
+
"bud:tasks": () => import("./assets/tasks-C8iWPrWg.js"),
|
|
38772
|
+
"bud:files": () => import("./assets/files-Wvo11G2A.js")
|
|
38770
38773
|
};
|
|
38771
38774
|
/**
|
|
38772
38775
|
* Imports a screen module: a built-in by its key, any other by the URL the server gave it.
|
|
@@ -38852,7 +38855,7 @@ function ScreenHost(handle) {
|
|
|
38852
38855
|
} catch (cause) {
|
|
38853
38856
|
if (handle.signal.aborted) return;
|
|
38854
38857
|
console.error(cause);
|
|
38855
|
-
error = cause instanceof Error && cause.message ? cause.message :
|
|
38858
|
+
error = cause instanceof Error && cause.message ? cause.message : t("app.client.screenHost.couldNotOpen", { label });
|
|
38856
38859
|
}
|
|
38857
38860
|
handle.update();
|
|
38858
38861
|
}
|
|
@@ -38864,7 +38867,7 @@ function ScreenHost(handle) {
|
|
|
38864
38867
|
let context = opened?.context;
|
|
38865
38868
|
let routeError = "";
|
|
38866
38869
|
if (opened && context) try {
|
|
38867
|
-
if (location.routes && !matchScreenRoutes(location.routes, location.href)) throw new Error(
|
|
38870
|
+
if (location.routes && !matchScreenRoutes(location.routes, location.href)) throw new Error(t("app.client.screenHost.noRouteMatches", { href: location.href }));
|
|
38868
38871
|
context = matchScreenContext(opened.screen.routes, {
|
|
38869
38872
|
...context,
|
|
38870
38873
|
active: handle.props.active,
|
|
@@ -38872,7 +38875,7 @@ function ScreenHost(handle) {
|
|
|
38872
38875
|
url: new URL(location.href, context.url.origin)
|
|
38873
38876
|
});
|
|
38874
38877
|
} catch (cause) {
|
|
38875
|
-
routeError = cause instanceof Error ? cause.message : "
|
|
38878
|
+
routeError = cause instanceof Error ? cause.message : t("app.client.screenHost.invalidRoute");
|
|
38876
38879
|
}
|
|
38877
38880
|
return /* @__PURE__ */ jsx("div", {
|
|
38878
38881
|
class: "h-full min-h-0",
|
|
@@ -38889,7 +38892,7 @@ function ScreenHost(handle) {
|
|
|
38889
38892
|
class: "max-w-2xl",
|
|
38890
38893
|
role: "alert",
|
|
38891
38894
|
children: [/* @__PURE__ */ jsx(FieldCardHeader, {
|
|
38892
|
-
title:
|
|
38895
|
+
title: t("app.client.screenHost.didntOpen", { label }),
|
|
38893
38896
|
subtitle: error
|
|
38894
38897
|
}), /* @__PURE__ */ jsx(FieldCardContent, {
|
|
38895
38898
|
class: "flex-col items-start gap-3",
|
|
@@ -38897,17 +38900,17 @@ function ScreenHost(handle) {
|
|
|
38897
38900
|
as: "p",
|
|
38898
38901
|
variant: "ui",
|
|
38899
38902
|
tone: "muted",
|
|
38900
|
-
children: "
|
|
38903
|
+
children: t("app.client.screenHost.fixAndRetry")
|
|
38901
38904
|
}), /* @__PURE__ */ jsx(Button, {
|
|
38902
38905
|
mix: on("click", () => {
|
|
38903
38906
|
if ("error" in module || handle.props.taskDesign && "error" in handle.props.taskDesign) window.location.reload();
|
|
38904
38907
|
else open();
|
|
38905
38908
|
}),
|
|
38906
|
-
children: "
|
|
38909
|
+
children: t("app.client.screenHost.retry")
|
|
38907
38910
|
})]
|
|
38908
38911
|
})]
|
|
38909
38912
|
})
|
|
38910
|
-
}) : /* @__PURE__ */ jsx(Loader, { label:
|
|
38913
|
+
}) : /* @__PURE__ */ jsx(Loader, { label: t("app.client.screenHost.loading", { label }) })
|
|
38911
38914
|
});
|
|
38912
38915
|
};
|
|
38913
38916
|
}
|
|
@@ -38926,11 +38929,11 @@ async function resolveConversation(id, targets, token, signal, fetcher = fetch)
|
|
|
38926
38929
|
id = parseThreadId(id);
|
|
38927
38930
|
let thread = await requestComments(routes.comments.get.href({ id }), token, signal, parseThread, fetcher);
|
|
38928
38931
|
signal.throwIfAborted();
|
|
38929
|
-
if (thread.id !== id) throw new Error("
|
|
38932
|
+
if (thread.id !== id) throw new Error(t("app.client.conversationRoute.anotherDiscussion"));
|
|
38930
38933
|
let destination = conversationDestination(thread);
|
|
38931
38934
|
let target = targets.find((target) => target.module === destination.module);
|
|
38932
|
-
if (!target) throw new Error("
|
|
38933
|
-
if (target.routes && !matchScreenRoutes(target.routes, destination.href)) throw new Error("
|
|
38935
|
+
if (!target) throw new Error(t("app.client.conversationRoute.enableOwningScreen"));
|
|
38936
|
+
if (target.routes && !matchScreenRoutes(target.routes, destination.href)) throw new Error(t("app.client.conversationRoute.locationUnavailable"));
|
|
38934
38937
|
return {
|
|
38935
38938
|
active: target.id,
|
|
38936
38939
|
module: { url: target.module },
|
|
@@ -39005,14 +39008,14 @@ function Workspace(handle) {
|
|
|
39005
39008
|
changed();
|
|
39006
39009
|
try {
|
|
39007
39010
|
let project = handle.props.project;
|
|
39008
|
-
if (!project) throw new Error("
|
|
39011
|
+
if (!project) throw new Error(t("app.client.workspace.connectProjectToOpenDiscussion"));
|
|
39009
39012
|
let next = await resolveConversation(id, handle.props.conversationTargets ?? [], project.token, signal);
|
|
39010
39013
|
if (!signal.aborted && conversation === id) {
|
|
39011
39014
|
presented = next;
|
|
39012
39015
|
hrefs.set(next.active, window.location.pathname);
|
|
39013
39016
|
}
|
|
39014
39017
|
} catch (cause) {
|
|
39015
|
-
if (!signal.aborted) error = cause instanceof Error ? cause.message : "
|
|
39018
|
+
if (!signal.aborted) error = cause instanceof Error ? cause.message : t("app.client.workspace.couldNotOpenDiscussion");
|
|
39016
39019
|
} finally {
|
|
39017
39020
|
if (request === controller && !signal.aborted) {
|
|
39018
39021
|
loading = false;
|
|
@@ -39055,7 +39058,7 @@ function Workspace(handle) {
|
|
|
39055
39058
|
let { pathname } = new URL(href, "http://bud.local");
|
|
39056
39059
|
if (readConversationLocation(href)) return {
|
|
39057
39060
|
href,
|
|
39058
|
-
title: "
|
|
39061
|
+
title: t("app.client.workspace.discussion"),
|
|
39059
39062
|
icon: "message"
|
|
39060
39063
|
};
|
|
39061
39064
|
let match = handle.props.screens.map((item) => ({
|
|
@@ -39217,19 +39220,19 @@ function Workspace(handle) {
|
|
|
39217
39220
|
children: project ? /* @__PURE__ */ jsx("div", {
|
|
39218
39221
|
class: "h-full min-h-0",
|
|
39219
39222
|
mix: mount,
|
|
39220
|
-
children: [loading ? /* @__PURE__ */ jsx(Loader, { label: "
|
|
39223
|
+
children: [loading ? /* @__PURE__ */ jsx(Loader, { label: t("app.client.workspace.openingDiscussion") }) : error ? /* @__PURE__ */ jsx("div", {
|
|
39221
39224
|
class: "p-3 md:p-4",
|
|
39222
39225
|
children: /* @__PURE__ */ jsx(FieldCard, {
|
|
39223
39226
|
class: "max-w-2xl",
|
|
39224
39227
|
role: "alert",
|
|
39225
39228
|
children: [/* @__PURE__ */ jsx(FieldCardHeader, {
|
|
39226
|
-
title:
|
|
39229
|
+
title: t("app.client.workspace.discussionDidntOpen"),
|
|
39227
39230
|
subtitle: error
|
|
39228
39231
|
}), /* @__PURE__ */ jsx(FieldCardContent, { children: /* @__PURE__ */ jsx(Button, {
|
|
39229
39232
|
mix: on("click", () => {
|
|
39230
39233
|
if (conversation) resolve(conversation);
|
|
39231
39234
|
}),
|
|
39232
|
-
children: "
|
|
39235
|
+
children: t("app.client.workspace.retry")
|
|
39233
39236
|
}) })]
|
|
39234
39237
|
})
|
|
39235
39238
|
}) : null, [...opened].map(([id, { module, taskDesign, location }]) => /* @__PURE__ */ jsx("div", {
|
|
@@ -39247,12 +39250,12 @@ function Workspace(handle) {
|
|
|
39247
39250
|
}) : /* @__PURE__ */ jsx(FieldCard, {
|
|
39248
39251
|
class: "max-w-2xl",
|
|
39249
39252
|
children: [/* @__PURE__ */ jsx(FieldCardHeader, {
|
|
39250
|
-
title: "
|
|
39251
|
-
subtitle: "
|
|
39253
|
+
title: t("app.client.workspace.yourProjectSideBySide"),
|
|
39254
|
+
subtitle: t("app.client.workspace.openBudBesideLocalProject")
|
|
39252
39255
|
}), /* @__PURE__ */ jsx(FieldCardContent, { children: /* @__PURE__ */ jsx(Text, {
|
|
39253
39256
|
as: "p",
|
|
39254
39257
|
variant: "ui",
|
|
39255
|
-
children: "
|
|
39258
|
+
children: t("app.client.workspace.startProjectWithBudVitePlugin")
|
|
39256
39259
|
}) })]
|
|
39257
39260
|
})
|
|
39258
39261
|
});
|
|
@@ -39409,7 +39412,7 @@ function createAppController(template, project, runtime) {
|
|
|
39409
39412
|
let title = (conversation ? "Discussion" : screen.label).replace(/[&<>]/g, (character) => `&#${character.charCodeAt(0)};`);
|
|
39410
39413
|
let logo = project?.config.logo;
|
|
39411
39414
|
let shell = logo ? withLogoIcons(template, logo, (theme) => routes.logo.href({ theme })) : template;
|
|
39412
|
-
return new Response(shell.replace("<title>bud.sh</title>", () => `<title>${title} · bud.sh</title>`).replace("</head>", () => project ? `${themeStyle(project.config.theme)}</head>` : "</head>").replace("<!--app-html-->", () => content), { headers: { "Content-Type": "text/html; charset=utf-8" } });
|
|
39415
|
+
return new Response(shell.replace("<html lang=\"en\"", () => `<html lang="${locale()}"`).replace("<title>bud.sh</title>", () => `<title>${title} · bud.sh</title>`).replace("</head>", () => project ? `${themeStyle(project.config.theme)}</head>` : "</head>").replace("<!--app-html-->", () => content), { headers: { "Content-Type": "text/html; charset=utf-8" } });
|
|
39413
39416
|
}
|
|
39414
39417
|
return createController(routes, { actions: {
|
|
39415
39418
|
conversation({ params, request }) {
|
|
@@ -42541,6 +42544,19 @@ function previewAnchors(root) {
|
|
|
42541
42544
|
};
|
|
42542
42545
|
}
|
|
42543
42546
|
//#endregion
|
|
42547
|
+
//#region app/server/locale.ts
|
|
42548
|
+
var requestLocale = new AsyncLocalStorage();
|
|
42549
|
+
useLocaleSource(() => requestLocale.getStore());
|
|
42550
|
+
/**
|
|
42551
|
+
* Runs a request's handling in its language, so what it renders speaks it.
|
|
42552
|
+
* @param value - The request's locale; English when it isn't one of Bud's.
|
|
42553
|
+
* @param handle - The request's handling.
|
|
42554
|
+
* @returns What the handling returns.
|
|
42555
|
+
*/
|
|
42556
|
+
function inLocale(value, handle) {
|
|
42557
|
+
return requestLocale.run(isLocale(value) ? value : "en", handle);
|
|
42558
|
+
}
|
|
42559
|
+
//#endregion
|
|
42544
42560
|
//#region app/server/hosted/contract.ts
|
|
42545
42561
|
/**
|
|
42546
42562
|
* The screens a hosted Bud shows: Pages as captured pictures, and no Files, which need a
|
|
@@ -42696,7 +42712,10 @@ function createHostedApp$1(options) {
|
|
|
42696
42712
|
return made;
|
|
42697
42713
|
};
|
|
42698
42714
|
return {
|
|
42699
|
-
fetch: async (request, context) =>
|
|
42715
|
+
fetch: async (request, context) => {
|
|
42716
|
+
let router = routerFor(hostedAuthor(context?.author));
|
|
42717
|
+
return inLocale(context?.locale ?? config.locale, () => router.fetch(request));
|
|
42718
|
+
},
|
|
42700
42719
|
dispose: () => runtime.dispose()
|
|
42701
42720
|
};
|
|
42702
42721
|
}
|