@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
|
@@ -7510,7 +7510,7 @@ var logWithLevel$1 = (level) => (...message) => {
|
|
|
7510
7510
|
return void_$2;
|
|
7511
7511
|
});
|
|
7512
7512
|
};
|
|
7513
|
-
var colors = {
|
|
7513
|
+
var colors$1 = {
|
|
7514
7514
|
bold: "1",
|
|
7515
7515
|
red: "31",
|
|
7516
7516
|
green: "32",
|
|
@@ -7522,7 +7522,7 @@ var colors = {
|
|
|
7522
7522
|
black: "30",
|
|
7523
7523
|
bgBrightRed: "101"
|
|
7524
7524
|
};
|
|
7525
|
-
colors.gray, colors.blue, colors.green, colors.yellow, colors.red, colors.bgBrightRed, colors.black;
|
|
7525
|
+
colors$1.gray, colors$1.blue, colors$1.green, colors$1.yellow, colors$1.red, colors$1.bgBrightRed, colors$1.black;
|
|
7526
7526
|
var defaultDateFormat = (date) => `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}.${date.getMilliseconds().toString().padStart(3, "0")}`;
|
|
7527
7527
|
/** @internal */
|
|
7528
7528
|
var defaultLogger = /*#__PURE__*/ loggerMake(({ cause, date, fiber, logLevel, message }) => {
|
|
@@ -28628,6 +28628,113 @@ var BudLogoSchema = createSchema((value, context) => {
|
|
|
28628
28628
|
return fail(logoMessage, context.path);
|
|
28629
28629
|
});
|
|
28630
28630
|
//#endregion
|
|
28631
|
+
//#region ../project/src/lib/theme.ts
|
|
28632
|
+
/**
|
|
28633
|
+
* Bud's colors and shadows a theme may set, as `--bud-<name>` in its styles. Everything else
|
|
28634
|
+
* Bud derives from them.
|
|
28635
|
+
*/
|
|
28636
|
+
var THEME_TOKENS = Object.freeze([
|
|
28637
|
+
"background",
|
|
28638
|
+
"shell",
|
|
28639
|
+
"main",
|
|
28640
|
+
"canvas",
|
|
28641
|
+
"panel",
|
|
28642
|
+
"board",
|
|
28643
|
+
"editor",
|
|
28644
|
+
"editor-tabs",
|
|
28645
|
+
"foreground",
|
|
28646
|
+
"muted",
|
|
28647
|
+
"primary",
|
|
28648
|
+
"primary-hover",
|
|
28649
|
+
"primary-foreground",
|
|
28650
|
+
"border",
|
|
28651
|
+
"tab-divider",
|
|
28652
|
+
"hover",
|
|
28653
|
+
"selected",
|
|
28654
|
+
"control",
|
|
28655
|
+
"control-active",
|
|
28656
|
+
"control-selected",
|
|
28657
|
+
"card",
|
|
28658
|
+
"menu",
|
|
28659
|
+
"menu-hover",
|
|
28660
|
+
"card-frame",
|
|
28661
|
+
"card-surface",
|
|
28662
|
+
"card-border",
|
|
28663
|
+
"card-frame-border",
|
|
28664
|
+
"card-badge",
|
|
28665
|
+
"overlay-shadow",
|
|
28666
|
+
"tooltip",
|
|
28667
|
+
"board-control",
|
|
28668
|
+
"board-control-hover",
|
|
28669
|
+
"board-card",
|
|
28670
|
+
"control-elevation",
|
|
28671
|
+
"board-elevation",
|
|
28672
|
+
"board-card-elevation",
|
|
28673
|
+
"card-elevation",
|
|
28674
|
+
"board-card-lift",
|
|
28675
|
+
"frame-control",
|
|
28676
|
+
"modal-elevation",
|
|
28677
|
+
"segment-elevation",
|
|
28678
|
+
"control-open-elevation",
|
|
28679
|
+
"board-segment",
|
|
28680
|
+
"scrollbar",
|
|
28681
|
+
"focus",
|
|
28682
|
+
"scrollbar-hover",
|
|
28683
|
+
"tooltip-border",
|
|
28684
|
+
"tooltip-shadow"
|
|
28685
|
+
]);
|
|
28686
|
+
var themeMessage = `theme must be { light, dark }, each mapping Bud's tokens (${THEME_TOKENS.slice(0, 3).join(", ")}, …) to CSS colors or shadows.`;
|
|
28687
|
+
function cssValue(value) {
|
|
28688
|
+
if (typeof value !== "string") return null;
|
|
28689
|
+
let trimmed = value.trim();
|
|
28690
|
+
if (!trimmed || trimmed.length > 300) return null;
|
|
28691
|
+
if (!/^[#a-zA-Z0-9(),.%\s/+-]+$/.test(trimmed) || /url\s*\(/i.test(trimmed)) return null;
|
|
28692
|
+
return trimmed;
|
|
28693
|
+
}
|
|
28694
|
+
function colors(value) {
|
|
28695
|
+
if (value === void 0) return {};
|
|
28696
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
28697
|
+
let result = {};
|
|
28698
|
+
for (let [name, raw] of Object.entries(value)) {
|
|
28699
|
+
let checked = cssValue(raw);
|
|
28700
|
+
if (!THEME_TOKENS.includes(name) || checked === null) return null;
|
|
28701
|
+
result[name] = checked;
|
|
28702
|
+
}
|
|
28703
|
+
return Object.freeze(result);
|
|
28704
|
+
}
|
|
28705
|
+
/** A theme in its one resolved form; Bud's own colors when absent. */
|
|
28706
|
+
var BudThemeSchema = createSchema((value, context) => {
|
|
28707
|
+
if (value === void 0) return { value: {
|
|
28708
|
+
light: {},
|
|
28709
|
+
dark: {}
|
|
28710
|
+
} };
|
|
28711
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return fail(themeMessage, context.path);
|
|
28712
|
+
let { light, dark, ...rest } = value;
|
|
28713
|
+
let resolved = {
|
|
28714
|
+
light: colors(light),
|
|
28715
|
+
dark: colors(dark)
|
|
28716
|
+
};
|
|
28717
|
+
if (Object.keys(rest).length || !resolved.light || !resolved.dark) return fail(themeMessage, context.path);
|
|
28718
|
+
return { value: {
|
|
28719
|
+
light: resolved.light,
|
|
28720
|
+
dark: resolved.dark
|
|
28721
|
+
} };
|
|
28722
|
+
});
|
|
28723
|
+
/**
|
|
28724
|
+
* The theme as styles that follow Bud's own, so its tokens win in each color scheme.
|
|
28725
|
+
* @param theme - The resolved theme.
|
|
28726
|
+
* @returns A `<style>` element, or an empty string for Bud's own colors.
|
|
28727
|
+
*/
|
|
28728
|
+
function themeStyle(theme) {
|
|
28729
|
+
let block = (selector, values) => {
|
|
28730
|
+
let entries = Object.entries(values);
|
|
28731
|
+
if (!entries.length) return "";
|
|
28732
|
+
return `${selector}{${entries.map(([name, value]) => `--bud-${name}:${value};`).join("")}}`;
|
|
28733
|
+
};
|
|
28734
|
+
let css = block(":root:not([data-theme='dark'])", theme.light) + block(":root[data-theme='dark']", theme.dark);
|
|
28735
|
+
return css ? `<style data-bud-theme>${css}</style>` : "";
|
|
28736
|
+
}
|
|
28737
|
+
//#endregion
|
|
28631
28738
|
//#region ../project/src/lib/branches.ts
|
|
28632
28739
|
var message$1 = "branches must be { main?, build?: { install?, build?, serve? } } with a branch name and nonempty shell commands.";
|
|
28633
28740
|
function branch(value) {
|
|
@@ -28976,6 +29083,8 @@ var ConfigFields = check(section("Bud config must export an object.", {
|
|
|
28976
29083
|
previews: any(),
|
|
28977
29084
|
files: any(),
|
|
28978
29085
|
logo: any(),
|
|
29086
|
+
theme: any(),
|
|
29087
|
+
locale: any(),
|
|
28979
29088
|
picker: any(),
|
|
28980
29089
|
branches: any(),
|
|
28981
29090
|
flows: any()
|
|
@@ -29016,7 +29125,7 @@ var BudRoutesSchema = check(list(RouteSchema, "bud.config must define at least o
|
|
|
29016
29125
|
var port = (value) => value === void 0 || Number.isInteger(value) && value >= 0 && value <= 65535;
|
|
29017
29126
|
var remote$1 = (value) => typeof value === "string" && /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(value);
|
|
29018
29127
|
/** A project's config, validated and normalized before Bud starts any listeners. */
|
|
29019
|
-
var BudConfigSchema = delegate(check(delegate(check(delegate(check(delegate(ConfigFields, (config) => ({
|
|
29128
|
+
var BudConfigSchema = delegate(check(delegate(check(check(delegate(check(delegate(ConfigFields, (config) => ({
|
|
29020
29129
|
...config,
|
|
29021
29130
|
routes: parseConfig(BudRoutesSchema, config.routes)
|
|
29022
29131
|
})), ({ port: companion, target }) => port(companion ?? 0) && port(target?.port) ? void 0 : "Ports must be integers between 0 and 65535."), ({ target, ...config }) => {
|
|
@@ -29025,7 +29134,7 @@ var BudConfigSchema = delegate(check(delegate(check(delegate(check(delegate(Conf
|
|
|
29025
29134
|
...config,
|
|
29026
29135
|
targetOrigin: origin ? normalizeOrigin(origin, "target.origin must be an HTTP(S) origin without a path or credentials.") : origin
|
|
29027
29136
|
};
|
|
29028
|
-
}), ({ comments }) => remote$1(comments?.remote ?? "origin") ? void 0 : "comments.remote must be a Git remote name."), (config) => {
|
|
29137
|
+
}), ({ locale }) => locale === void 0 || locale === "en" || locale === "de" ? void 0 : "locale must be \"en\" or \"de\"."), ({ comments }) => remote$1(comments?.remote ?? "origin") ? void 0 : "comments.remote must be a Git remote name."), (config) => {
|
|
29029
29138
|
let flows = parseConfig(BudFlowsSchema, config.flows);
|
|
29030
29139
|
let steps = flows.flatMap((flow) => flow.steps.map((step) => flowStepRoute(flow, step)));
|
|
29031
29140
|
let home = config.routes.findIndex((route) => route.path === "/") + 1;
|
|
@@ -29051,6 +29160,8 @@ var BudConfigSchema = delegate(check(delegate(check(delegate(check(delegate(Conf
|
|
|
29051
29160
|
previews: parseConfig(BudPreviewsSchema, config.previews),
|
|
29052
29161
|
files: parseConfig(BudFilesSchema, config.files),
|
|
29053
29162
|
logo: parseConfig(BudLogoSchema, config.logo),
|
|
29163
|
+
theme: parseConfig(BudThemeSchema, config.theme),
|
|
29164
|
+
locale: config.locale === void 0 ? "en" : config.locale,
|
|
29054
29165
|
picker: parseConfig(BudPickerSchema, config.picker),
|
|
29055
29166
|
branches: parseConfig(BudBranchesSchema, config.branches)
|
|
29056
29167
|
}));
|
|
@@ -33491,4 +33602,4 @@ function branchPreviewsLayer(project, options) {
|
|
|
33491
33602
|
}));
|
|
33492
33603
|
}
|
|
33493
33604
|
//#endregion
|
|
33494
|
-
export {
|
|
33605
|
+
export { publishAll as $, forkUnsafe as $n, provideContext as $t, concat as A, uninterruptible as An, catch_$1 as At, mapError as B, effectDiscard as Bn, forever as Bt, ProcessRunner as C, tap$1 as Cn, as$1 as Ct, as as D, tryPromise as Dn, callback$1 as Dt, FileSystem as E, timeoutOrElse as En, cached as Et, fromEffect as F, currentTimeMillis as Fn, fail$4 as Ft, make$8 as G, mergeAll$1 as Gn, map$2 as Gt, runForEach as H, isLayer as Hn, forkScoped as Ht, fromPubSub as I, build as In, filterOrFail as It, offerUnsafe as J, succeed$3 as Jn, option as Jt, makeUnsafe as K, provide$2 as Kn, mapError$2 as Kt, ignore as L, buildWithMemoMap as Ln, flatMap$1 as Lt, drop as M, void_ as Mn, context as Mt, empty as N, withFiber as Nn, die as Nt, callback as O, try_ as On, catchIf as Ot, filter as P, yieldNow as Pn, ensuring as Pt, publish as Q, close as Qn, provide as Qt, make$7 as R, effect as Rn, flatten$1 as Rt, writeTextAtomic as S, sync as Sn, andThen as St, Path$1 as T, timeoutOption as Tn, asVoid as Tt, tap as U, makeMemoMapUnsafe as Un, gen as Ut, merge as V, empty$2 as Vn, forkIn as Vt, unwrap as W, merge$2 as Wn, ignore$2 as Wt, sliding as X, sync$1 as Xn, orElseSucceed as Xt, shutdown as Y, succeedContext as Yn, orDie as Yt, take as Z, unwrap$4 as Zn, promise as Zt, resolveStorage as _, serviceOption as _n, bytes as _t, followCapture as a, runFork as an, void_$1 as ar, runIn as at, nodeLayer as b, succeedNone as bn, addFinalizer as bt, previewsLayer as c, runPromiseExit as cn, add as cr, String$1 as ct, gitLayer as d, runSync$1 as dn, getOrNull as dr, Union as dt, provideService as en, makeUnsafe$4 as er, shutdown$1 as et, Project as f, runSyncExit as fn, getOrUndefined$1 as fr, decodeEffect as ft, resolveScreenRoutes as g, scoped as gn, TaggedError as gr, optional$1 as gt, defaultScreens as h, scope as hn, some as hr, isPattern as ht, projectFlows as i, runCallbackWith as in, succeed$4 as ir, interrupt as it, debounce as j, uninterruptibleMask as jn, clockWith as jt, changes as k, undefined_$2 as kn, catchTag as kt, PreviewSession as l, runPromiseExitWith as ln, getOption as lr, Struct as lt, projectModuleFile as m, runSyncWith as mn, none as mr, isNonEmpty as mt, branchIndexName as n, retry as nn, doneUnsafe as nr, unbounded$1 as nt, startBranchBuild as o, runForkWith as on, scopeRemoveFinalizerUnsafe as or, ArraySchema as ot, createProjectContext as p, runSyncExitWith as pn, isNone as pr, isMaxLength as pt, offer as q, provideMerge as qn, match as qt, branchPreviewsLayer as r, runCallback as rn, make$23 as rr, await_ as rt, Previews as s, runPromise as sn, Service as sr, Record as st, BranchPreviews as t, result as tn, _await as tr, sliding$1 as tt, Git as u, runPromiseWith as un, make$25 as ur, Undefined as ut, themeStyle as v, sleep as vn, acquireRelease as vt, RuntimePolicy as w, tapError as wn, asSome as wt, readText as x, suspend$2 as xn, all$1 as xt, LOGO_TYPES as y, succeed$2 as yn, acquireUseRelease as yt, mapEffect as z, effectContext as zn, forEach$1 as zt };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { kn as Icon } from "./events-6z5v7Uca.js";
|
|
2
|
-
import { Bt as Button,
|
|
3
|
-
import { n as createProjectComments, r as loadComments, t as defineScreen } from "./screen-
|
|
4
|
-
import { i as pictureKey, n as createProjectPreviews, t as createProjectBranches } from "./project-branches-
|
|
5
|
-
import { t as ProjectThreadLinks } from "./project-thread-links-
|
|
2
|
+
import { Bt as Button, Dn as Text, H as captureCanvasPoint, Rt as Loader, Sn as writePreference, Tn as t, V as CanvasWorkspace, W as BranchSidebar, fn as ToolbarSeparator, gn as IconButton, hn as Select, l as projectStore, pn as WorkspaceLayout, t as commentsUnavailable, ut as conversationHref, vn as Tooltip, xn as readPreference } from "./comment-data-B0OLHBGp.js";
|
|
3
|
+
import { n as createProjectComments, r as loadComments, t as defineScreen } from "./screen-BtcJmZwj.js";
|
|
4
|
+
import { i as pictureKey, n as createProjectPreviews, t as createProjectBranches } from "./project-branches-GtQYyOH5.js";
|
|
5
|
+
import { t as ProjectThreadLinks } from "./project-thread-links-Nfz9NIny.js";
|
|
6
6
|
import { on, ref } from "remix/component";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "remix/component/jsx-runtime";
|
|
8
8
|
//#region app/client/preview-image.tsx
|
|
@@ -160,7 +160,7 @@ function PreviewImage(handle) {
|
|
|
160
160
|
let { thumbnail, slices } = drawn(picture);
|
|
161
161
|
return /* @__PURE__ */ jsxs("div", {
|
|
162
162
|
role: "img",
|
|
163
|
-
"aria-label":
|
|
163
|
+
"aria-label": t("app.client.previewImage.preview", { title: route.title }),
|
|
164
164
|
"data-detail": !view.visible ? "hidden" : slices.length ? "slices" : thumbnail ? "thumbnail" : "pending",
|
|
165
165
|
class: `relative select-none overflow-hidden ${mode === "comment" ? "cursor-crosshair" : ""}`,
|
|
166
166
|
style: { height },
|
|
@@ -210,11 +210,11 @@ function PreviewImage(handle) {
|
|
|
210
210
|
size: 24,
|
|
211
211
|
class: "text-muted"
|
|
212
212
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ jsx(Text, {
|
|
214
214
|
variant: "title",
|
|
215
215
|
weight: "semibold",
|
|
216
216
|
class: "text-ink",
|
|
217
|
-
children:
|
|
217
|
+
children: t("app.client.previewImage.captureFailed", { title: route.title })
|
|
218
218
|
}),
|
|
219
219
|
failure ? /* @__PURE__ */ jsx(Text, {
|
|
220
220
|
variant: "ui",
|
|
@@ -229,7 +229,7 @@ function PreviewImage(handle) {
|
|
|
229
229
|
mix: [stopPan, on("click", () => void previews.refresh(page))],
|
|
230
230
|
children: /* @__PURE__ */ jsx(Text, {
|
|
231
231
|
variant: "ui",
|
|
232
|
-
children: "
|
|
232
|
+
children: t("app.client.previewImage.tryAgain")
|
|
233
233
|
})
|
|
234
234
|
}), /* @__PURE__ */ jsx("a", {
|
|
235
235
|
href: pageUrl,
|
|
@@ -239,7 +239,7 @@ function PreviewImage(handle) {
|
|
|
239
239
|
mix: stopPan,
|
|
240
240
|
children: /* @__PURE__ */ jsx(Text, {
|
|
241
241
|
variant: "ui",
|
|
242
|
-
children: "
|
|
242
|
+
children: t("app.client.previewImage.openPage")
|
|
243
243
|
})
|
|
244
244
|
})]
|
|
245
245
|
})
|
|
@@ -247,7 +247,7 @@ function PreviewImage(handle) {
|
|
|
247
247
|
});
|
|
248
248
|
return /* @__PURE__ */ jsx("div", {
|
|
249
249
|
class: "absolute inset-0 flex items-center justify-center",
|
|
250
|
-
children: /* @__PURE__ */ jsx(Loader, { label:
|
|
250
|
+
children: /* @__PURE__ */ jsx(Loader, { label: t("app.client.previewImage.capturing", { title: route.title }) })
|
|
251
251
|
});
|
|
252
252
|
};
|
|
253
253
|
}
|
|
@@ -280,7 +280,7 @@ function PreviewRefresh(handle) {
|
|
|
280
280
|
})
|
|
281
281
|
}) : null, /* @__PURE__ */ jsx(IconButton, {
|
|
282
282
|
icon: "sync",
|
|
283
|
-
label:
|
|
283
|
+
label: t("app.client.previewImage.refresh", { title: route.title }),
|
|
284
284
|
tooltip: true,
|
|
285
285
|
size: "small",
|
|
286
286
|
iconSize: 13,
|
|
@@ -389,7 +389,7 @@ function compareProjectPictures(options) {
|
|
|
389
389
|
let result = await compare(route.page, route.size).catch((cause) => ({
|
|
390
390
|
state: "failed",
|
|
391
391
|
regions: [],
|
|
392
|
-
error: cause instanceof Error ? cause.message : "
|
|
392
|
+
error: cause instanceof Error ? cause.message : t("app.client.projectDifferences.comparisonFailed")
|
|
393
393
|
}));
|
|
394
394
|
if (signal.aborted) return;
|
|
395
395
|
states.set(route.id, result);
|
|
@@ -429,11 +429,9 @@ function differenceSlots(regions) {
|
|
|
429
429
|
height: Math.max(1, top - gap)
|
|
430
430
|
};
|
|
431
431
|
}
|
|
432
|
-
|
|
433
|
-
changed: "
|
|
434
|
-
|
|
435
|
-
removed: "Removed"
|
|
436
|
-
};
|
|
432
|
+
function kindLabel(kind) {
|
|
433
|
+
return kind === "changed" ? t("app.client.differenceView.changed") : kind === "added" ? t("app.client.differenceView.added") : t("app.client.differenceView.removed");
|
|
434
|
+
}
|
|
437
435
|
function crops(signal) {
|
|
438
436
|
let urls = /* @__PURE__ */ new Map();
|
|
439
437
|
signal.addEventListener("abort", () => {
|
|
@@ -468,7 +466,10 @@ function DifferenceArtboard(handle) {
|
|
|
468
466
|
let visible = viewport?.get(route.id)?.visible ?? true;
|
|
469
467
|
return /* @__PURE__ */ jsx("div", {
|
|
470
468
|
role: "img",
|
|
471
|
-
"aria-label":
|
|
469
|
+
"aria-label": t("app.client.differenceView.artboardLabel", {
|
|
470
|
+
title: route.title,
|
|
471
|
+
label
|
|
472
|
+
}),
|
|
472
473
|
"data-difference": side,
|
|
473
474
|
"data-changes": regions.length,
|
|
474
475
|
class: "relative select-none bg-[var(--bud-main)]",
|
|
@@ -491,11 +492,11 @@ function DifferenceArtboard(handle) {
|
|
|
491
492
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
492
493
|
variant: "ui",
|
|
493
494
|
weight: "medium",
|
|
494
|
-
children:
|
|
495
|
+
children: t("app.client.differenceView.changeNumber", { count: index + 1 })
|
|
495
496
|
}), /* @__PURE__ */ jsx(Text, {
|
|
496
497
|
variant: "ui",
|
|
497
498
|
tone: "muted",
|
|
498
|
-
children:
|
|
499
|
+
children: kindLabel(region.kind)
|
|
499
500
|
})]
|
|
500
501
|
}), crop && span.height > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
501
502
|
class: "relative overflow-hidden",
|
|
@@ -518,7 +519,7 @@ function DifferenceArtboard(handle) {
|
|
|
518
519
|
children: /* @__PURE__ */ jsx(Text, {
|
|
519
520
|
variant: "ui",
|
|
520
521
|
tone: "muted",
|
|
521
|
-
children:
|
|
522
|
+
children: t("app.client.differenceView.notIn", { label })
|
|
522
523
|
})
|
|
523
524
|
})]
|
|
524
525
|
}, index);
|
|
@@ -552,7 +553,10 @@ function DifferenceSlideshow(handle) {
|
|
|
552
553
|
}) }), crop && slide.region[which].height > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
553
554
|
class: "relative",
|
|
554
555
|
children: [/* @__PURE__ */ jsx("img", {
|
|
555
|
-
alt:
|
|
556
|
+
alt: t("app.client.differenceView.artboardLabel", {
|
|
557
|
+
title: slide.route.title,
|
|
558
|
+
label
|
|
559
|
+
}),
|
|
556
560
|
src: url(crop),
|
|
557
561
|
class: "block w-full rounded-lg ring-1 ring-line"
|
|
558
562
|
}), slide.region.kind === "changed" ? /* @__PURE__ */ jsx("div", {
|
|
@@ -568,14 +572,14 @@ function DifferenceSlideshow(handle) {
|
|
|
568
572
|
children: /* @__PURE__ */ jsx(Text, {
|
|
569
573
|
variant: "ui",
|
|
570
574
|
tone: "muted",
|
|
571
|
-
children:
|
|
575
|
+
children: t("app.client.differenceView.notIn", { label })
|
|
572
576
|
})
|
|
573
577
|
})]
|
|
574
578
|
});
|
|
575
579
|
};
|
|
576
580
|
return /* @__PURE__ */ jsxs("section", {
|
|
577
581
|
role: "dialog",
|
|
578
|
-
"aria-label": "
|
|
582
|
+
"aria-label": t("app.client.differenceView.slideshowLabel"),
|
|
579
583
|
class: "bud-surface absolute inset-0 z-40 flex flex-col bg-[var(--bud-main)]",
|
|
580
584
|
mix: ref((node, signal) => {
|
|
581
585
|
node.focus();
|
|
@@ -597,33 +601,39 @@ function DifferenceSlideshow(handle) {
|
|
|
597
601
|
variant: "ui",
|
|
598
602
|
weight: "medium",
|
|
599
603
|
class: "truncate",
|
|
600
|
-
children: slide?.route.title ?? "
|
|
604
|
+
children: slide?.route.title ?? t("app.client.differenceView.noDifferences")
|
|
601
605
|
}), slide ? /* @__PURE__ */ jsx(Text, {
|
|
602
606
|
variant: "ui",
|
|
603
607
|
tone: "muted",
|
|
604
608
|
class: "shrink-0 tabular-nums",
|
|
605
609
|
role: "status",
|
|
606
|
-
children:
|
|
610
|
+
children: t("app.client.differenceView.slideStatus", {
|
|
611
|
+
kind: kindLabel(slide.region.kind),
|
|
612
|
+
change: slide.index + 1,
|
|
613
|
+
count: slide.count,
|
|
614
|
+
index: index + 1,
|
|
615
|
+
total: slides.length
|
|
616
|
+
})
|
|
607
617
|
}) : null]
|
|
608
618
|
}),
|
|
609
619
|
/* @__PURE__ */ jsx(IconButton, {
|
|
610
620
|
tooltip: true,
|
|
611
621
|
icon: "chevron-left",
|
|
612
|
-
label: "
|
|
622
|
+
label: t("app.client.differenceView.previousChange"),
|
|
613
623
|
disabled: slides.length < 2,
|
|
614
624
|
mix: on("click", () => step(-1))
|
|
615
625
|
}),
|
|
616
626
|
/* @__PURE__ */ jsx(IconButton, {
|
|
617
627
|
tooltip: true,
|
|
618
628
|
icon: "chevron-right",
|
|
619
|
-
label: "
|
|
629
|
+
label: t("app.client.differenceView.nextChange"),
|
|
620
630
|
disabled: slides.length < 2,
|
|
621
631
|
mix: on("click", () => step(1))
|
|
622
632
|
}),
|
|
623
633
|
/* @__PURE__ */ jsx(IconButton, {
|
|
624
634
|
tooltip: true,
|
|
625
635
|
icon: "close",
|
|
626
|
-
label: "
|
|
636
|
+
label: t("app.client.differenceView.closeSlideshow"),
|
|
627
637
|
shortcut: "escape",
|
|
628
638
|
mix: on("click", () => handle.props.onClose())
|
|
629
639
|
})
|
|
@@ -737,7 +747,7 @@ function ProjectCanvas(handle) {
|
|
|
737
747
|
function others() {
|
|
738
748
|
let sets = project.workingTree ? [{
|
|
739
749
|
value: "",
|
|
740
|
-
label: "
|
|
750
|
+
label: t("app.client.projectCanvas.workingTree")
|
|
741
751
|
}] : [];
|
|
742
752
|
for (let branch of branches.list.branches) if (branch.active && branch.captured) sets.push({
|
|
743
753
|
value: branch.name,
|
|
@@ -746,7 +756,7 @@ function ProjectCanvas(handle) {
|
|
|
746
756
|
return sets.filter((set) => set.value !== (selected ?? ""));
|
|
747
757
|
}
|
|
748
758
|
function label(set) {
|
|
749
|
-
return set ? set : "
|
|
759
|
+
return set ? set : t("app.client.projectCanvas.workingTree");
|
|
750
760
|
}
|
|
751
761
|
function startComparing() {
|
|
752
762
|
let sets = others();
|
|
@@ -812,7 +822,7 @@ function ProjectCanvas(handle) {
|
|
|
812
822
|
comments.loadThread(id);
|
|
813
823
|
});
|
|
814
824
|
}
|
|
815
|
-
if (!branches.loaded && !branches.error) return /* @__PURE__ */ jsx(Loader, { label: "
|
|
825
|
+
if (!branches.loaded && !branches.error) return /* @__PURE__ */ jsx(Loader, { label: t("app.client.projectCanvas.loadingBranches") });
|
|
816
826
|
let projectKey = `${project.id}:${project.targetOrigin}:${project.routes.map((route) => route.path).join("|")}`;
|
|
817
827
|
let snapshot = {
|
|
818
828
|
...comments.snapshot,
|
|
@@ -859,8 +869,23 @@ function ProjectCanvas(handle) {
|
|
|
859
869
|
if (differences) {
|
|
860
870
|
let { compared: done, total } = differences.progress;
|
|
861
871
|
let missing = artboards.filter(({ artboard }) => differences.get(artboard.id).state === "missing").length;
|
|
862
|
-
status = !differences.done ?
|
|
863
|
-
|
|
872
|
+
status = !differences.done ? t("app.client.projectCanvas.comparingPages", {
|
|
873
|
+
name: beforeLabel,
|
|
874
|
+
done,
|
|
875
|
+
count: total
|
|
876
|
+
}) : changed.length ? missing ? t("app.client.projectCanvas.differentPagesWithMissing", {
|
|
877
|
+
changed: changed.length,
|
|
878
|
+
count: total,
|
|
879
|
+
name: beforeLabel,
|
|
880
|
+
missing
|
|
881
|
+
}) : t("app.client.projectCanvas.differentPages", {
|
|
882
|
+
changed: changed.length,
|
|
883
|
+
count: total,
|
|
884
|
+
name: beforeLabel
|
|
885
|
+
}) : missing ? t("app.client.projectCanvas.noDifferencesWithMissing", {
|
|
886
|
+
name: beforeLabel,
|
|
887
|
+
count: missing
|
|
888
|
+
}) : t("app.client.projectCanvas.noDifferences", { name: beforeLabel });
|
|
864
889
|
}
|
|
865
890
|
let sets = others();
|
|
866
891
|
let icon = (size) => size.mobile || size.width < 600 ? "mobile" : size.width < 1100 ? "tablet" : "desktop";
|
|
@@ -869,14 +894,17 @@ function ProjectCanvas(handle) {
|
|
|
869
894
|
sizes.map((size) => /* @__PURE__ */ jsx(IconButton, {
|
|
870
895
|
tooltip: true,
|
|
871
896
|
icon: icon(size),
|
|
872
|
-
label:
|
|
897
|
+
label: t("app.client.projectCanvas.showViewport", {
|
|
898
|
+
name: size.name,
|
|
899
|
+
width: size.width
|
|
900
|
+
}),
|
|
873
901
|
active: viewport === size.id,
|
|
874
902
|
mix: on("click", () => show(size.id))
|
|
875
903
|
})),
|
|
876
904
|
/* @__PURE__ */ jsx(IconButton, {
|
|
877
905
|
tooltip: true,
|
|
878
906
|
icon: "columns",
|
|
879
|
-
label: "
|
|
907
|
+
label: t("app.client.projectCanvas.showEveryViewport"),
|
|
880
908
|
active: viewport === "all",
|
|
881
909
|
mix: on("click", () => show("all"))
|
|
882
910
|
}),
|
|
@@ -885,13 +913,13 @@ function ProjectCanvas(handle) {
|
|
|
885
913
|
/* @__PURE__ */ jsx(IconButton, {
|
|
886
914
|
tooltip: true,
|
|
887
915
|
icon: "compare",
|
|
888
|
-
label: differences ? "
|
|
916
|
+
label: differences ? t("app.client.projectCanvas.stopComparing") : t("app.client.projectCanvas.showDifferences"),
|
|
889
917
|
active: Boolean(differences),
|
|
890
918
|
disabled: !differences && !sets.length,
|
|
891
919
|
mix: on("click", () => differences ? stopComparing() : startComparing())
|
|
892
920
|
}),
|
|
893
921
|
differences ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Select, {
|
|
894
|
-
label: "
|
|
922
|
+
label: t("app.client.projectCanvas.compareWith"),
|
|
895
923
|
value: comparing ?? "",
|
|
896
924
|
options: sets,
|
|
897
925
|
class: "max-w-48",
|
|
@@ -904,7 +932,7 @@ function ProjectCanvas(handle) {
|
|
|
904
932
|
}), /* @__PURE__ */ jsx(IconButton, {
|
|
905
933
|
tooltip: true,
|
|
906
934
|
icon: "play",
|
|
907
|
-
label: "
|
|
935
|
+
label: t("app.client.projectCanvas.stepThroughDifferences"),
|
|
908
936
|
disabled: !slides.length,
|
|
909
937
|
mix: on("click", () => {
|
|
910
938
|
slide = 0;
|
|
@@ -914,8 +942,8 @@ function ProjectCanvas(handle) {
|
|
|
914
942
|
] });
|
|
915
943
|
return /* @__PURE__ */ jsx(WorkspaceLayout, {
|
|
916
944
|
class: "h-full min-h-0",
|
|
917
|
-
sidebarLabel: "
|
|
918
|
-
mainLabel: "
|
|
945
|
+
sidebarLabel: t("app.client.projectCanvas.branches"),
|
|
946
|
+
mainLabel: t("app.client.projectCanvas.canvas"),
|
|
919
947
|
drawerOpen: drawer,
|
|
920
948
|
onDrawerOpenChange: (open) => {
|
|
921
949
|
drawer = open;
|
|
@@ -1025,7 +1053,7 @@ function ProjectCanvas(handle) {
|
|
|
1025
1053
|
drawer = true;
|
|
1026
1054
|
handle.update();
|
|
1027
1055
|
},
|
|
1028
|
-
sidebarLabel: "
|
|
1056
|
+
sidebarLabel: t("app.client.projectCanvas.branches"),
|
|
1029
1057
|
renderArtboard: (route, state) => {
|
|
1030
1058
|
let side = sides.get(route.id);
|
|
1031
1059
|
if (side) return /* @__PURE__ */ jsx(DifferenceArtboard, {
|