@bud.sh/app 0.2.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 +159 -31
- package/dist/node/design.js +6235 -139
- package/dist/node/index.js +99 -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 +1765 -1630
- package/dist/server/assets/{branch-previews-C_TVt_HQ.js → branch-previews-ClkoJ0lM.js} +116 -5
- 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-BVbFsnmX.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-DUBjmaBw.js → server-CYvuOSBA.js} +1 -1
- package/dist/server/assets/{services-Og5rcF50.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-BzzRLcL-.d.ts → config-DIC2cf_S.d.ts} +27 -1
- package/dist/types/assets/{contract-jA5pqK6h.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 +7 -1
- 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-sj6mWw9-.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-9KxFcfyV.js +0 -2
package/dist/node/index.js
CHANGED
|
@@ -202,6 +202,99 @@ var BudLogoSchema = createSchema((value, context) => {
|
|
|
202
202
|
return fail(logoMessage, context.path);
|
|
203
203
|
});
|
|
204
204
|
//#endregion
|
|
205
|
+
//#region ../project/src/lib/theme.ts
|
|
206
|
+
/**
|
|
207
|
+
* Bud's colors and shadows a theme may set, as `--bud-<name>` in its styles. Everything else
|
|
208
|
+
* Bud derives from them.
|
|
209
|
+
*/
|
|
210
|
+
var THEME_TOKENS = Object.freeze([
|
|
211
|
+
"background",
|
|
212
|
+
"shell",
|
|
213
|
+
"main",
|
|
214
|
+
"canvas",
|
|
215
|
+
"panel",
|
|
216
|
+
"board",
|
|
217
|
+
"editor",
|
|
218
|
+
"editor-tabs",
|
|
219
|
+
"foreground",
|
|
220
|
+
"muted",
|
|
221
|
+
"primary",
|
|
222
|
+
"primary-hover",
|
|
223
|
+
"primary-foreground",
|
|
224
|
+
"border",
|
|
225
|
+
"tab-divider",
|
|
226
|
+
"hover",
|
|
227
|
+
"selected",
|
|
228
|
+
"control",
|
|
229
|
+
"control-active",
|
|
230
|
+
"control-selected",
|
|
231
|
+
"card",
|
|
232
|
+
"menu",
|
|
233
|
+
"menu-hover",
|
|
234
|
+
"card-frame",
|
|
235
|
+
"card-surface",
|
|
236
|
+
"card-border",
|
|
237
|
+
"card-frame-border",
|
|
238
|
+
"card-badge",
|
|
239
|
+
"overlay-shadow",
|
|
240
|
+
"tooltip",
|
|
241
|
+
"board-control",
|
|
242
|
+
"board-control-hover",
|
|
243
|
+
"board-card",
|
|
244
|
+
"control-elevation",
|
|
245
|
+
"board-elevation",
|
|
246
|
+
"board-card-elevation",
|
|
247
|
+
"card-elevation",
|
|
248
|
+
"board-card-lift",
|
|
249
|
+
"frame-control",
|
|
250
|
+
"modal-elevation",
|
|
251
|
+
"segment-elevation",
|
|
252
|
+
"control-open-elevation",
|
|
253
|
+
"board-segment",
|
|
254
|
+
"scrollbar",
|
|
255
|
+
"focus",
|
|
256
|
+
"scrollbar-hover",
|
|
257
|
+
"tooltip-border",
|
|
258
|
+
"tooltip-shadow"
|
|
259
|
+
]);
|
|
260
|
+
var themeMessage = `theme must be { light, dark }, each mapping Bud's tokens (${THEME_TOKENS.slice(0, 3).join(", ")}, …) to CSS colors or shadows.`;
|
|
261
|
+
function cssValue(value) {
|
|
262
|
+
if (typeof value !== "string") return null;
|
|
263
|
+
let trimmed = value.trim();
|
|
264
|
+
if (!trimmed || trimmed.length > 300) return null;
|
|
265
|
+
if (!/^[#a-zA-Z0-9(),.%\s/+-]+$/.test(trimmed) || /url\s*\(/i.test(trimmed)) return null;
|
|
266
|
+
return trimmed;
|
|
267
|
+
}
|
|
268
|
+
function colors(value) {
|
|
269
|
+
if (value === void 0) return {};
|
|
270
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
271
|
+
let result = {};
|
|
272
|
+
for (let [name, raw] of Object.entries(value)) {
|
|
273
|
+
let checked = cssValue(raw);
|
|
274
|
+
if (!THEME_TOKENS.includes(name) || checked === null) return null;
|
|
275
|
+
result[name] = checked;
|
|
276
|
+
}
|
|
277
|
+
return Object.freeze(result);
|
|
278
|
+
}
|
|
279
|
+
/** A theme in its one resolved form; Bud's own colors when absent. */
|
|
280
|
+
var BudThemeSchema = createSchema((value, context) => {
|
|
281
|
+
if (value === void 0) return { value: {
|
|
282
|
+
light: {},
|
|
283
|
+
dark: {}
|
|
284
|
+
} };
|
|
285
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return fail(themeMessage, context.path);
|
|
286
|
+
let { light, dark, ...rest } = value;
|
|
287
|
+
let resolved = {
|
|
288
|
+
light: colors(light),
|
|
289
|
+
dark: colors(dark)
|
|
290
|
+
};
|
|
291
|
+
if (Object.keys(rest).length || !resolved.light || !resolved.dark) return fail(themeMessage, context.path);
|
|
292
|
+
return { value: {
|
|
293
|
+
light: resolved.light,
|
|
294
|
+
dark: resolved.dark
|
|
295
|
+
} };
|
|
296
|
+
});
|
|
297
|
+
//#endregion
|
|
205
298
|
//#region ../project/src/lib/branches.ts
|
|
206
299
|
var message = "branches must be { main?, build?: { install?, build?, serve? } } with a branch name and nonempty shell commands.";
|
|
207
300
|
function branch(value) {
|
|
@@ -550,6 +643,8 @@ var ConfigFields = check(section("Bud config must export an object.", {
|
|
|
550
643
|
previews: any(),
|
|
551
644
|
files: any(),
|
|
552
645
|
logo: any(),
|
|
646
|
+
theme: any(),
|
|
647
|
+
locale: any(),
|
|
553
648
|
picker: any(),
|
|
554
649
|
branches: any(),
|
|
555
650
|
flows: any()
|
|
@@ -589,7 +684,7 @@ function routePath(path) {
|
|
|
589
684
|
var BudRoutesSchema = check(list(RouteSchema, "bud.config must define at least one route.", 1), (routes) => new Set(routes.map((route) => route.id)).size !== routes.length || new Set(routes.map((route) => route.path)).size !== routes.length ? "Canvas route IDs and paths must be unique." : void 0);
|
|
590
685
|
var port = (value) => value === void 0 || Number.isInteger(value) && value >= 0 && value <= 65535;
|
|
591
686
|
var remote = (value) => typeof value === "string" && /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(value);
|
|
592
|
-
delegate(check(delegate(check(delegate(check(delegate(ConfigFields, (config) => ({
|
|
687
|
+
delegate(check(delegate(check(check(delegate(check(delegate(ConfigFields, (config) => ({
|
|
593
688
|
...config,
|
|
594
689
|
routes: parseConfig(BudRoutesSchema, config.routes)
|
|
595
690
|
})), ({ port: companion, target }) => port(companion ?? 0) && port(target?.port) ? void 0 : "Ports must be integers between 0 and 65535."), ({ target, ...config }) => {
|
|
@@ -598,7 +693,7 @@ delegate(check(delegate(check(delegate(check(delegate(ConfigFields, (config) =>
|
|
|
598
693
|
...config,
|
|
599
694
|
targetOrigin: origin ? normalizeOrigin(origin, "target.origin must be an HTTP(S) origin without a path or credentials.") : origin
|
|
600
695
|
};
|
|
601
|
-
}), ({ comments }) => remote(comments?.remote ?? "origin") ? void 0 : "comments.remote must be a Git remote name."), (config) => {
|
|
696
|
+
}), ({ 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) => {
|
|
602
697
|
let flows = parseConfig(BudFlowsSchema, config.flows);
|
|
603
698
|
let steps = flows.flatMap((flow) => flow.steps.map((step) => flowStepRoute(flow, step)));
|
|
604
699
|
let home = config.routes.findIndex((route) => route.path === "/") + 1;
|
|
@@ -624,6 +719,8 @@ delegate(check(delegate(check(delegate(check(delegate(ConfigFields, (config) =>
|
|
|
624
719
|
previews: parseConfig(BudPreviewsSchema, config.previews),
|
|
625
720
|
files: parseConfig(BudFilesSchema, config.files),
|
|
626
721
|
logo: parseConfig(BudLogoSchema, config.logo),
|
|
722
|
+
theme: parseConfig(BudThemeSchema, config.theme),
|
|
723
|
+
locale: config.locale === void 0 ? "en" : config.locale,
|
|
627
724
|
picker: parseConfig(BudPickerSchema, config.picker),
|
|
628
725
|
branches: parseConfig(BudBranchesSchema, config.branches)
|
|
629
726
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $t as Button, H as CanvasWorkspace, U as captureCanvasPoint, Zt as Loader, bt as conversationHref,
|
|
2
|
-
import { n as createProjectComments, r as loadComments, t as defineScreen } from "./screen-
|
|
3
|
-
import { i as pictureKey, n as createProjectPreviews, t as createProjectBranches } from "./project-branches-
|
|
4
|
-
import { t as ProjectThreadLinks } from "./project-thread-links-
|
|
1
|
+
import { $t as Button, H as CanvasWorkspace, U as captureCanvasPoint, Zt as Loader, bt as conversationHref, en as ToolbarSeparator, et as BranchSidebar, gn as Icon, hn as Text, in as IconButton, l as projectStore, ln as readPreference, on as Tooltip, pn as t, rn as Select, t as commentsUnavailable, tn as WorkspaceLayout, un as writePreference } from "./comment-data-q_8INiZz.js";
|
|
2
|
+
import { n as createProjectComments, r as loadComments, t as defineScreen } from "./screen-Dog-YByu.js";
|
|
3
|
+
import { i as pictureKey, n as createProjectPreviews, t as createProjectBranches } from "./project-branches-C26hwmo3.js";
|
|
4
|
+
import { t as ProjectThreadLinks } from "./project-thread-links-BOzjws5W.js";
|
|
5
5
|
import { on, ref } from "remix/component";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
7
7
|
//#region app/client/preview-image.tsx
|
|
@@ -159,7 +159,7 @@ function PreviewImage(handle) {
|
|
|
159
159
|
let { thumbnail, slices } = drawn(picture);
|
|
160
160
|
return /* @__PURE__ */ jsxs("div", {
|
|
161
161
|
role: "img",
|
|
162
|
-
"aria-label":
|
|
162
|
+
"aria-label": t("app.client.previewImage.preview", { title: route.title }),
|
|
163
163
|
"data-detail": !view.visible ? "hidden" : slices.length ? "slices" : thumbnail ? "thumbnail" : "pending",
|
|
164
164
|
class: `relative select-none overflow-hidden ${mode === "comment" ? "cursor-crosshair" : ""}`,
|
|
165
165
|
style: { height },
|
|
@@ -209,11 +209,11 @@ function PreviewImage(handle) {
|
|
|
209
209
|
size: 24,
|
|
210
210
|
class: "text-muted"
|
|
211
211
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ jsx(Text, {
|
|
213
213
|
variant: "title",
|
|
214
214
|
weight: "semibold",
|
|
215
215
|
class: "text-ink",
|
|
216
|
-
children:
|
|
216
|
+
children: t("app.client.previewImage.captureFailed", { title: route.title })
|
|
217
217
|
}),
|
|
218
218
|
failure ? /* @__PURE__ */ jsx(Text, {
|
|
219
219
|
variant: "ui",
|
|
@@ -228,7 +228,7 @@ function PreviewImage(handle) {
|
|
|
228
228
|
mix: [stopPan, on("click", () => void previews.refresh(page))],
|
|
229
229
|
children: /* @__PURE__ */ jsx(Text, {
|
|
230
230
|
variant: "ui",
|
|
231
|
-
children: "
|
|
231
|
+
children: t("app.client.previewImage.tryAgain")
|
|
232
232
|
})
|
|
233
233
|
}), /* @__PURE__ */ jsx("a", {
|
|
234
234
|
href: pageUrl,
|
|
@@ -238,7 +238,7 @@ function PreviewImage(handle) {
|
|
|
238
238
|
mix: stopPan,
|
|
239
239
|
children: /* @__PURE__ */ jsx(Text, {
|
|
240
240
|
variant: "ui",
|
|
241
|
-
children: "
|
|
241
|
+
children: t("app.client.previewImage.openPage")
|
|
242
242
|
})
|
|
243
243
|
})]
|
|
244
244
|
})
|
|
@@ -246,7 +246,7 @@ function PreviewImage(handle) {
|
|
|
246
246
|
});
|
|
247
247
|
return /* @__PURE__ */ jsx("div", {
|
|
248
248
|
class: "absolute inset-0 flex items-center justify-center",
|
|
249
|
-
children: /* @__PURE__ */ jsx(Loader, { label:
|
|
249
|
+
children: /* @__PURE__ */ jsx(Loader, { label: t("app.client.previewImage.capturing", { title: route.title }) })
|
|
250
250
|
});
|
|
251
251
|
};
|
|
252
252
|
}
|
|
@@ -279,7 +279,7 @@ function PreviewRefresh(handle) {
|
|
|
279
279
|
})
|
|
280
280
|
}) : null, /* @__PURE__ */ jsx(IconButton, {
|
|
281
281
|
icon: "sync",
|
|
282
|
-
label:
|
|
282
|
+
label: t("app.client.previewImage.refresh", { title: route.title }),
|
|
283
283
|
tooltip: true,
|
|
284
284
|
size: "small",
|
|
285
285
|
iconSize: 13,
|
|
@@ -388,7 +388,7 @@ function compareProjectPictures(options) {
|
|
|
388
388
|
let result = await compare(route.page, route.size).catch((cause) => ({
|
|
389
389
|
state: "failed",
|
|
390
390
|
regions: [],
|
|
391
|
-
error: cause instanceof Error ? cause.message : "
|
|
391
|
+
error: cause instanceof Error ? cause.message : t("app.client.projectDifferences.comparisonFailed")
|
|
392
392
|
}));
|
|
393
393
|
if (signal.aborted) return;
|
|
394
394
|
states.set(route.id, result);
|
|
@@ -428,11 +428,9 @@ function differenceSlots(regions) {
|
|
|
428
428
|
height: Math.max(1, top - gap)
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
|
-
|
|
432
|
-
changed: "
|
|
433
|
-
|
|
434
|
-
removed: "Removed"
|
|
435
|
-
};
|
|
431
|
+
function kindLabel(kind) {
|
|
432
|
+
return kind === "changed" ? t("app.client.differenceView.changed") : kind === "added" ? t("app.client.differenceView.added") : t("app.client.differenceView.removed");
|
|
433
|
+
}
|
|
436
434
|
function crops(signal) {
|
|
437
435
|
let urls = /* @__PURE__ */ new Map();
|
|
438
436
|
signal.addEventListener("abort", () => {
|
|
@@ -467,7 +465,10 @@ function DifferenceArtboard(handle) {
|
|
|
467
465
|
let visible = viewport?.get(route.id)?.visible ?? true;
|
|
468
466
|
return /* @__PURE__ */ jsx("div", {
|
|
469
467
|
role: "img",
|
|
470
|
-
"aria-label":
|
|
468
|
+
"aria-label": t("app.client.differenceView.artboardLabel", {
|
|
469
|
+
title: route.title,
|
|
470
|
+
label
|
|
471
|
+
}),
|
|
471
472
|
"data-difference": side,
|
|
472
473
|
"data-changes": regions.length,
|
|
473
474
|
class: "relative select-none bg-[var(--bud-main)]",
|
|
@@ -490,11 +491,11 @@ function DifferenceArtboard(handle) {
|
|
|
490
491
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
491
492
|
variant: "ui",
|
|
492
493
|
weight: "medium",
|
|
493
|
-
children:
|
|
494
|
+
children: t("app.client.differenceView.changeNumber", { count: index + 1 })
|
|
494
495
|
}), /* @__PURE__ */ jsx(Text, {
|
|
495
496
|
variant: "ui",
|
|
496
497
|
tone: "muted",
|
|
497
|
-
children:
|
|
498
|
+
children: kindLabel(region.kind)
|
|
498
499
|
})]
|
|
499
500
|
}), crop && span.height > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
500
501
|
class: "relative overflow-hidden",
|
|
@@ -517,7 +518,7 @@ function DifferenceArtboard(handle) {
|
|
|
517
518
|
children: /* @__PURE__ */ jsx(Text, {
|
|
518
519
|
variant: "ui",
|
|
519
520
|
tone: "muted",
|
|
520
|
-
children:
|
|
521
|
+
children: t("app.client.differenceView.notIn", { label })
|
|
521
522
|
})
|
|
522
523
|
})]
|
|
523
524
|
}, index);
|
|
@@ -551,7 +552,10 @@ function DifferenceSlideshow(handle) {
|
|
|
551
552
|
}) }), crop && slide.region[which].height > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
552
553
|
class: "relative",
|
|
553
554
|
children: [/* @__PURE__ */ jsx("img", {
|
|
554
|
-
alt:
|
|
555
|
+
alt: t("app.client.differenceView.artboardLabel", {
|
|
556
|
+
title: slide.route.title,
|
|
557
|
+
label
|
|
558
|
+
}),
|
|
555
559
|
src: url(crop),
|
|
556
560
|
class: "block w-full rounded-lg ring-1 ring-line"
|
|
557
561
|
}), slide.region.kind === "changed" ? /* @__PURE__ */ jsx("div", {
|
|
@@ -567,14 +571,14 @@ function DifferenceSlideshow(handle) {
|
|
|
567
571
|
children: /* @__PURE__ */ jsx(Text, {
|
|
568
572
|
variant: "ui",
|
|
569
573
|
tone: "muted",
|
|
570
|
-
children:
|
|
574
|
+
children: t("app.client.differenceView.notIn", { label })
|
|
571
575
|
})
|
|
572
576
|
})]
|
|
573
577
|
});
|
|
574
578
|
};
|
|
575
579
|
return /* @__PURE__ */ jsxs("section", {
|
|
576
580
|
role: "dialog",
|
|
577
|
-
"aria-label": "
|
|
581
|
+
"aria-label": t("app.client.differenceView.slideshowLabel"),
|
|
578
582
|
class: "bud-surface absolute inset-0 z-40 flex flex-col bg-[var(--bud-main)]",
|
|
579
583
|
mix: ref((node, signal) => {
|
|
580
584
|
node.focus();
|
|
@@ -596,33 +600,39 @@ function DifferenceSlideshow(handle) {
|
|
|
596
600
|
variant: "ui",
|
|
597
601
|
weight: "medium",
|
|
598
602
|
class: "truncate",
|
|
599
|
-
children: slide?.route.title ?? "
|
|
603
|
+
children: slide?.route.title ?? t("app.client.differenceView.noDifferences")
|
|
600
604
|
}), slide ? /* @__PURE__ */ jsx(Text, {
|
|
601
605
|
variant: "ui",
|
|
602
606
|
tone: "muted",
|
|
603
607
|
class: "shrink-0 tabular-nums",
|
|
604
608
|
role: "status",
|
|
605
|
-
children:
|
|
609
|
+
children: t("app.client.differenceView.slideStatus", {
|
|
610
|
+
kind: kindLabel(slide.region.kind),
|
|
611
|
+
change: slide.index + 1,
|
|
612
|
+
count: slide.count,
|
|
613
|
+
index: index + 1,
|
|
614
|
+
total: slides.length
|
|
615
|
+
})
|
|
606
616
|
}) : null]
|
|
607
617
|
}),
|
|
608
618
|
/* @__PURE__ */ jsx(IconButton, {
|
|
609
619
|
tooltip: true,
|
|
610
620
|
icon: "chevron-left",
|
|
611
|
-
label: "
|
|
621
|
+
label: t("app.client.differenceView.previousChange"),
|
|
612
622
|
disabled: slides.length < 2,
|
|
613
623
|
mix: on("click", () => step(-1))
|
|
614
624
|
}),
|
|
615
625
|
/* @__PURE__ */ jsx(IconButton, {
|
|
616
626
|
tooltip: true,
|
|
617
627
|
icon: "chevron-right",
|
|
618
|
-
label: "
|
|
628
|
+
label: t("app.client.differenceView.nextChange"),
|
|
619
629
|
disabled: slides.length < 2,
|
|
620
630
|
mix: on("click", () => step(1))
|
|
621
631
|
}),
|
|
622
632
|
/* @__PURE__ */ jsx(IconButton, {
|
|
623
633
|
tooltip: true,
|
|
624
634
|
icon: "close",
|
|
625
|
-
label: "
|
|
635
|
+
label: t("app.client.differenceView.closeSlideshow"),
|
|
626
636
|
shortcut: "escape",
|
|
627
637
|
mix: on("click", () => handle.props.onClose())
|
|
628
638
|
})
|
|
@@ -736,7 +746,7 @@ function ProjectCanvas(handle) {
|
|
|
736
746
|
function others() {
|
|
737
747
|
let sets = project.workingTree ? [{
|
|
738
748
|
value: "",
|
|
739
|
-
label: "
|
|
749
|
+
label: t("app.client.projectCanvas.workingTree")
|
|
740
750
|
}] : [];
|
|
741
751
|
for (let branch of branches.list.branches) if (branch.active && branch.captured) sets.push({
|
|
742
752
|
value: branch.name,
|
|
@@ -745,7 +755,7 @@ function ProjectCanvas(handle) {
|
|
|
745
755
|
return sets.filter((set) => set.value !== (selected ?? ""));
|
|
746
756
|
}
|
|
747
757
|
function label(set) {
|
|
748
|
-
return set ? set : "
|
|
758
|
+
return set ? set : t("app.client.projectCanvas.workingTree");
|
|
749
759
|
}
|
|
750
760
|
function startComparing() {
|
|
751
761
|
let sets = others();
|
|
@@ -811,7 +821,7 @@ function ProjectCanvas(handle) {
|
|
|
811
821
|
comments.loadThread(id);
|
|
812
822
|
});
|
|
813
823
|
}
|
|
814
|
-
if (!branches.loaded && !branches.error) return /* @__PURE__ */ jsx(Loader, { label: "
|
|
824
|
+
if (!branches.loaded && !branches.error) return /* @__PURE__ */ jsx(Loader, { label: t("app.client.projectCanvas.loadingBranches") });
|
|
815
825
|
let projectKey = `${project.id}:${project.targetOrigin}:${project.routes.map((route) => route.path).join("|")}`;
|
|
816
826
|
let snapshot = {
|
|
817
827
|
...comments.snapshot,
|
|
@@ -858,8 +868,23 @@ function ProjectCanvas(handle) {
|
|
|
858
868
|
if (differences) {
|
|
859
869
|
let { compared: done, total } = differences.progress;
|
|
860
870
|
let missing = artboards.filter(({ artboard }) => differences.get(artboard.id).state === "missing").length;
|
|
861
|
-
status = !differences.done ?
|
|
862
|
-
|
|
871
|
+
status = !differences.done ? t("app.client.projectCanvas.comparingPages", {
|
|
872
|
+
name: beforeLabel,
|
|
873
|
+
done,
|
|
874
|
+
count: total
|
|
875
|
+
}) : changed.length ? missing ? t("app.client.projectCanvas.differentPagesWithMissing", {
|
|
876
|
+
changed: changed.length,
|
|
877
|
+
count: total,
|
|
878
|
+
name: beforeLabel,
|
|
879
|
+
missing
|
|
880
|
+
}) : t("app.client.projectCanvas.differentPages", {
|
|
881
|
+
changed: changed.length,
|
|
882
|
+
count: total,
|
|
883
|
+
name: beforeLabel
|
|
884
|
+
}) : missing ? t("app.client.projectCanvas.noDifferencesWithMissing", {
|
|
885
|
+
name: beforeLabel,
|
|
886
|
+
count: missing
|
|
887
|
+
}) : t("app.client.projectCanvas.noDifferences", { name: beforeLabel });
|
|
863
888
|
}
|
|
864
889
|
let sets = others();
|
|
865
890
|
let icon = (size) => size.mobile || size.width < 600 ? "mobile" : size.width < 1100 ? "tablet" : "desktop";
|
|
@@ -868,14 +893,17 @@ function ProjectCanvas(handle) {
|
|
|
868
893
|
sizes.map((size) => /* @__PURE__ */ jsx(IconButton, {
|
|
869
894
|
tooltip: true,
|
|
870
895
|
icon: icon(size),
|
|
871
|
-
label:
|
|
896
|
+
label: t("app.client.projectCanvas.showViewport", {
|
|
897
|
+
name: size.name,
|
|
898
|
+
width: size.width
|
|
899
|
+
}),
|
|
872
900
|
active: viewport === size.id,
|
|
873
901
|
mix: on("click", () => show(size.id))
|
|
874
902
|
})),
|
|
875
903
|
/* @__PURE__ */ jsx(IconButton, {
|
|
876
904
|
tooltip: true,
|
|
877
905
|
icon: "columns",
|
|
878
|
-
label: "
|
|
906
|
+
label: t("app.client.projectCanvas.showEveryViewport"),
|
|
879
907
|
active: viewport === "all",
|
|
880
908
|
mix: on("click", () => show("all"))
|
|
881
909
|
}),
|
|
@@ -884,13 +912,13 @@ function ProjectCanvas(handle) {
|
|
|
884
912
|
/* @__PURE__ */ jsx(IconButton, {
|
|
885
913
|
tooltip: true,
|
|
886
914
|
icon: "compare",
|
|
887
|
-
label: differences ? "
|
|
915
|
+
label: differences ? t("app.client.projectCanvas.stopComparing") : t("app.client.projectCanvas.showDifferences"),
|
|
888
916
|
active: Boolean(differences),
|
|
889
917
|
disabled: !differences && !sets.length,
|
|
890
918
|
mix: on("click", () => differences ? stopComparing() : startComparing())
|
|
891
919
|
}),
|
|
892
920
|
differences ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Select, {
|
|
893
|
-
label: "
|
|
921
|
+
label: t("app.client.projectCanvas.compareWith"),
|
|
894
922
|
value: comparing ?? "",
|
|
895
923
|
options: sets,
|
|
896
924
|
class: "max-w-48",
|
|
@@ -903,7 +931,7 @@ function ProjectCanvas(handle) {
|
|
|
903
931
|
}), /* @__PURE__ */ jsx(IconButton, {
|
|
904
932
|
tooltip: true,
|
|
905
933
|
icon: "play",
|
|
906
|
-
label: "
|
|
934
|
+
label: t("app.client.projectCanvas.stepThroughDifferences"),
|
|
907
935
|
disabled: !slides.length,
|
|
908
936
|
mix: on("click", () => {
|
|
909
937
|
slide = 0;
|
|
@@ -913,8 +941,8 @@ function ProjectCanvas(handle) {
|
|
|
913
941
|
] });
|
|
914
942
|
return /* @__PURE__ */ jsx(WorkspaceLayout, {
|
|
915
943
|
class: "h-full min-h-0",
|
|
916
|
-
sidebarLabel: "
|
|
917
|
-
mainLabel: "
|
|
944
|
+
sidebarLabel: t("app.client.projectCanvas.branches"),
|
|
945
|
+
mainLabel: t("app.client.projectCanvas.canvas"),
|
|
918
946
|
drawerOpen: drawer,
|
|
919
947
|
onDrawerOpenChange: (open) => {
|
|
920
948
|
drawer = open;
|
|
@@ -1024,7 +1052,7 @@ function ProjectCanvas(handle) {
|
|
|
1024
1052
|
drawer = true;
|
|
1025
1053
|
handle.update();
|
|
1026
1054
|
},
|
|
1027
|
-
sidebarLabel: "
|
|
1055
|
+
sidebarLabel: t("app.client.projectCanvas.branches"),
|
|
1028
1056
|
renderArtboard: (route, state) => {
|
|
1029
1057
|
let side = sides.get(route.id);
|
|
1030
1058
|
if (side) return /* @__PURE__ */ jsx(DifferenceArtboard, {
|