@12ui/design 0.2.80 → 0.2.81
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 +1 -3
- package/SKILL.md +2 -8
- package/dist/cli-help/design.d.ts +1 -1
- package/dist/cli-help/design.d.ts.map +1 -1
- package/dist/cli-help/design.js +0 -1
- package/dist/cli-help/design.js.map +1 -1
- package/dist/cli-help/index.d.ts +1 -1
- package/dist/cli-workspace-draw.d.ts.map +1 -1
- package/dist/cli-workspace-draw.js +2 -0
- package/dist/cli-workspace-draw.js.map +1 -1
- package/dist/cli-workspace-runner.d.ts.map +1 -1
- package/dist/cli-workspace-runner.js +2 -1
- package/dist/cli-workspace-runner.js.map +1 -1
- package/dist/corpus-client.d.ts +3 -0
- package/dist/corpus-client.d.ts.map +1 -1
- package/dist/corpus-client.js +2 -0
- package/dist/corpus-client.js.map +1 -1
- package/dist/corpus-public-renditions.d.ts +33 -0
- package/dist/corpus-public-renditions.d.ts.map +1 -0
- package/dist/corpus-public-renditions.js +55 -0
- package/dist/corpus-public-renditions.js.map +1 -0
- package/dist/legacy-skill-catalog.d.ts.map +1 -1
- package/dist/legacy-skill-catalog.js +11 -0
- package/dist/legacy-skill-catalog.js.map +1 -1
- package/dist/mcp-slate-command.d.ts +0 -2
- package/dist/mcp-slate-command.d.ts.map +1 -1
- package/dist/mcp-slate-command.js +0 -4
- package/dist/mcp-slate-command.js.map +1 -1
- package/dist/mcp-slate-resource.d.ts.map +1 -1
- package/dist/mcp-slate-resource.js +6 -4
- package/dist/mcp-slate-resource.js.map +1 -1
- package/dist/mcp-slate-tool-defs.d.ts.map +1 -1
- package/dist/mcp-slate-tool-defs.js +8 -6
- package/dist/mcp-slate-tool-defs.js.map +1 -1
- package/dist/mcp-slate-tools.d.ts.map +1 -1
- package/dist/mcp-slate-tools.js +8 -1
- package/dist/mcp-slate-tools.js.map +1 -1
- package/dist/mcp-slate-ui-copy.d.ts +88 -208
- package/dist/mcp-slate-ui-copy.d.ts.map +1 -1
- package/dist/mcp-slate-ui-copy.js +58 -159
- package/dist/mcp-slate-ui-copy.js.map +1 -1
- package/dist/mcp-slate-ui-locales/de-DE.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/de-DE.js +44 -83
- package/dist/mcp-slate-ui-locales/de-DE.js.map +1 -1
- package/dist/mcp-slate-ui-locales/es-419.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/es-419.js +44 -83
- package/dist/mcp-slate-ui-locales/es-419.js.map +1 -1
- package/dist/mcp-slate-ui-locales/es-ES.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/es-ES.js +44 -83
- package/dist/mcp-slate-ui-locales/es-ES.js.map +1 -1
- package/dist/mcp-slate-ui-locales/fr-FR.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/fr-FR.js +44 -83
- package/dist/mcp-slate-ui-locales/fr-FR.js.map +1 -1
- package/dist/mcp-slate-ui-locales/hi-IN.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/hi-IN.js +44 -83
- package/dist/mcp-slate-ui-locales/hi-IN.js.map +1 -1
- package/dist/mcp-slate-ui-locales/it-IT.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/it-IT.js +44 -83
- package/dist/mcp-slate-ui-locales/it-IT.js.map +1 -1
- package/dist/mcp-slate-ui-locales/ja-JP.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/ja-JP.js +44 -83
- package/dist/mcp-slate-ui-locales/ja-JP.js.map +1 -1
- package/dist/mcp-slate-ui-locales/ko-KR.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/ko-KR.js +44 -83
- package/dist/mcp-slate-ui-locales/ko-KR.js.map +1 -1
- package/dist/mcp-slate-ui-locales/pt-BR.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/pt-BR.js +44 -83
- package/dist/mcp-slate-ui-locales/pt-BR.js.map +1 -1
- package/dist/mcp-slate-ui-locales/zh-CN.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/zh-CN.js +44 -83
- package/dist/mcp-slate-ui-locales/zh-CN.js.map +1 -1
- package/dist/mcp-slate-ui-locales/zh-TW.d.ts.map +1 -1
- package/dist/mcp-slate-ui-locales/zh-TW.js +44 -83
- package/dist/mcp-slate-ui-locales/zh-TW.js.map +1 -1
- package/dist/mcp-slate-ui-script-bridge.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-bridge.js +19 -7
- package/dist/mcp-slate-ui-script-bridge.js.map +1 -1
- package/dist/mcp-slate-ui-script-browser.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-browser.js +0 -3
- package/dist/mcp-slate-ui-script-browser.js.map +1 -1
- package/dist/mcp-slate-ui-script-designs.d.ts +17 -0
- package/dist/mcp-slate-ui-script-designs.d.ts.map +1 -0
- package/dist/mcp-slate-ui-script-designs.js +365 -0
- package/dist/mcp-slate-ui-script-designs.js.map +1 -0
- package/dist/mcp-slate-ui-script-edit.d.ts +9 -0
- package/dist/mcp-slate-ui-script-edit.d.ts.map +1 -0
- package/dist/mcp-slate-ui-script-edit.js +71 -0
- package/dist/mcp-slate-ui-script-edit.js.map +1 -0
- package/dist/mcp-slate-ui-script-inline.d.ts +3 -9
- package/dist/mcp-slate-ui-script-inline.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-inline.js +28 -155
- package/dist/mcp-slate-ui-script-inline.js.map +1 -1
- package/dist/mcp-slate-ui-script-inspiration-collage.d.ts +13 -12
- package/dist/mcp-slate-ui-script-inspiration-collage.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-inspiration-collage.js +24 -24
- package/dist/mcp-slate-ui-script-inspiration-collage.js.map +1 -1
- package/dist/mcp-slate-ui-script-inspiration-gallery.d.ts +23 -0
- package/dist/mcp-slate-ui-script-inspiration-gallery.d.ts.map +1 -0
- package/dist/mcp-slate-ui-script-inspiration-gallery.js +221 -0
- package/dist/mcp-slate-ui-script-inspiration-gallery.js.map +1 -0
- package/dist/mcp-slate-ui-script-inspiration-grid.d.ts +14 -21
- package/dist/mcp-slate-ui-script-inspiration-grid.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-inspiration-grid.js +124 -196
- package/dist/mcp-slate-ui-script-inspiration-grid.js.map +1 -1
- package/dist/mcp-slate-ui-script-inspiration.d.ts +8 -9
- package/dist/mcp-slate-ui-script-inspiration.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-inspiration.js +213 -130
- package/dist/mcp-slate-ui-script-inspiration.js.map +1 -1
- package/dist/mcp-slate-ui-script-l10n.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-l10n.js +2 -0
- package/dist/mcp-slate-ui-script-l10n.js.map +1 -1
- package/dist/mcp-slate-ui-script-more.d.ts +4 -33
- package/dist/mcp-slate-ui-script-more.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-more.js +6 -279
- package/dist/mcp-slate-ui-script-more.js.map +1 -1
- package/dist/mcp-slate-ui-script-pause.d.ts +10 -6
- package/dist/mcp-slate-ui-script-pause.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-pause.js +45 -30
- package/dist/mcp-slate-ui-script-pause.js.map +1 -1
- package/dist/mcp-slate-ui-script-references.d.ts +19 -0
- package/dist/mcp-slate-ui-script-references.d.ts.map +1 -0
- package/dist/mcp-slate-ui-script-references.js +102 -0
- package/dist/mcp-slate-ui-script-references.js.map +1 -0
- package/dist/mcp-slate-ui-script-remote.d.ts +13 -12
- package/dist/mcp-slate-ui-script-remote.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-remote.js +46 -27
- package/dist/mcp-slate-ui-script-remote.js.map +1 -1
- package/dist/mcp-slate-ui-script-scribble.d.ts +2 -2
- package/dist/mcp-slate-ui-script-scribble.js +7 -7
- package/dist/mcp-slate-ui-script-select.d.ts +4 -9
- package/dist/mcp-slate-ui-script-select.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-select.js +13 -37
- package/dist/mcp-slate-ui-script-select.js.map +1 -1
- package/dist/mcp-slate-ui-script-stage.d.ts +4 -10
- package/dist/mcp-slate-ui-script-stage.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-stage.js +28 -141
- package/dist/mcp-slate-ui-script-stage.js.map +1 -1
- package/dist/mcp-slate-ui-script-state.d.ts +1 -1
- package/dist/mcp-slate-ui-script-state.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script-state.js +9 -4
- package/dist/mcp-slate-ui-script-state.js.map +1 -1
- package/dist/mcp-slate-ui-script-viewer.d.ts +18 -0
- package/dist/mcp-slate-ui-script-viewer.d.ts.map +1 -0
- package/dist/mcp-slate-ui-script-viewer.js +405 -0
- package/dist/mcp-slate-ui-script-viewer.js.map +1 -0
- package/dist/mcp-slate-ui-script.d.ts +4 -5
- package/dist/mcp-slate-ui-script.d.ts.map +1 -1
- package/dist/mcp-slate-ui-script.js +12 -13
- package/dist/mcp-slate-ui-script.js.map +1 -1
- package/dist/mcp-slate-ui-styles-designs.d.ts +10 -0
- package/dist/mcp-slate-ui-styles-designs.d.ts.map +1 -0
- package/dist/mcp-slate-ui-styles-designs.js +121 -0
- package/dist/mcp-slate-ui-styles-designs.js.map +1 -0
- package/dist/mcp-slate-ui-styles-inspiration.d.ts +13 -13
- package/dist/mcp-slate-ui-styles-inspiration.d.ts.map +1 -1
- package/dist/mcp-slate-ui-styles-inspiration.js +67 -33
- package/dist/mcp-slate-ui-styles-inspiration.js.map +1 -1
- package/dist/mcp-slate-ui-styles-pause.d.ts +2 -2
- package/dist/mcp-slate-ui-styles-pause.d.ts.map +1 -1
- package/dist/mcp-slate-ui-styles-pause.js +4 -8
- package/dist/mcp-slate-ui-styles-pause.js.map +1 -1
- package/dist/mcp-slate-ui-styles-stage.d.ts +3 -22
- package/dist/mcp-slate-ui-styles-stage.d.ts.map +1 -1
- package/dist/mcp-slate-ui-styles-stage.js +6 -74
- package/dist/mcp-slate-ui-styles-stage.js.map +1 -1
- package/dist/mcp-slate-ui-styles.d.ts +12 -19
- package/dist/mcp-slate-ui-styles.d.ts.map +1 -1
- package/dist/mcp-slate-ui-styles.js +97 -100
- package/dist/mcp-slate-ui-styles.js.map +1 -1
- package/dist/mcp-slate-ui.d.ts +12 -12
- package/dist/mcp-slate-ui.d.ts.map +1 -1
- package/dist/mcp-slate-ui.js +24 -23
- package/dist/mcp-slate-ui.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/dist/slate-actions.d.ts +22 -1
- package/dist/slate-actions.d.ts.map +1 -1
- package/dist/slate-actions.js +46 -2
- package/dist/slate-actions.js.map +1 -1
- package/dist/slate-browser-host.d.ts +8 -7
- package/dist/slate-browser-host.d.ts.map +1 -1
- package/dist/slate-browser-host.js +13 -10
- package/dist/slate-browser-host.js.map +1 -1
- package/dist/slate-browser-server.d.ts.map +1 -1
- package/dist/slate-browser-server.js +10 -4
- package/dist/slate-browser-server.js.map +1 -1
- package/dist/slate-commit.d.ts.map +1 -1
- package/dist/slate-commit.js +12 -5
- package/dist/slate-commit.js.map +1 -1
- package/dist/slate-handoff.d.ts.map +1 -1
- package/dist/slate-handoff.js +2 -3
- package/dist/slate-handoff.js.map +1 -1
- package/dist/slate-ids.d.ts +2 -1
- package/dist/slate-ids.d.ts.map +1 -1
- package/dist/slate-ids.js +3 -2
- package/dist/slate-ids.js.map +1 -1
- package/dist/slate-reference-ids.d.ts.map +1 -1
- package/dist/slate-reference-ids.js +1 -0
- package/dist/slate-reference-ids.js.map +1 -1
- package/dist/slate-round-prompt.d.ts +19 -0
- package/dist/slate-round-prompt.d.ts.map +1 -1
- package/dist/slate-round-prompt.js +22 -0
- package/dist/slate-round-prompt.js.map +1 -1
- package/dist/slate-round-runner.d.ts.map +1 -1
- package/dist/slate-round-runner.js +16 -12
- package/dist/slate-round-runner.js.map +1 -1
- package/dist/slate-round-search.d.ts.map +1 -1
- package/dist/slate-round-search.js +2 -0
- package/dist/slate-round-search.js.map +1 -1
- package/dist/slate-runtime.d.ts +3 -0
- package/dist/slate-runtime.d.ts.map +1 -1
- package/dist/slate-runtime.js +1 -0
- package/dist/slate-runtime.js.map +1 -1
- package/dist/slate-site-references-capture.d.ts +20 -0
- package/dist/slate-site-references-capture.d.ts.map +1 -0
- package/dist/slate-site-references-capture.js +119 -0
- package/dist/slate-site-references-capture.js.map +1 -0
- package/dist/slate-site-references-client.d.ts +35 -0
- package/dist/slate-site-references-client.d.ts.map +1 -0
- package/dist/slate-site-references-client.js +36 -0
- package/dist/slate-site-references-client.js.map +1 -0
- package/dist/slate-site-references-local.d.ts +6 -0
- package/dist/slate-site-references-local.d.ts.map +1 -0
- package/dist/slate-site-references-local.js +63 -0
- package/dist/slate-site-references-local.js.map +1 -0
- package/dist/slate-site-references-suggest.d.ts +36 -0
- package/dist/slate-site-references-suggest.d.ts.map +1 -0
- package/dist/slate-site-references-suggest.js +144 -0
- package/dist/slate-site-references-suggest.js.map +1 -0
- package/dist/slate-site-references.d.ts +57 -0
- package/dist/slate-site-references.d.ts.map +1 -0
- package/dist/slate-site-references.js +129 -0
- package/dist/slate-site-references.js.map +1 -0
- package/dist/slate-view-contract.d.ts +29 -1
- package/dist/slate-view-contract.d.ts.map +1 -1
- package/dist/slate-view.d.ts.map +1 -1
- package/dist/slate-view.js +5 -0
- package/dist/slate-view.js.map +1 -1
- package/dist/slate-workspace-parse.d.ts +2 -0
- package/dist/slate-workspace-parse.d.ts.map +1 -1
- package/dist/slate-workspace-parse.js +20 -3
- package/dist/slate-workspace-parse.js.map +1 -1
- package/dist/slate-workspace-types.d.ts +17 -2
- package/dist/slate-workspace-types.d.ts.map +1 -1
- package/dist/workspace-draw-messages.d.ts +27 -5
- package/dist/workspace-draw-messages.d.ts.map +1 -1
- package/dist/workspace-draw-messages.js +29 -3
- package/dist/workspace-draw-messages.js.map +1 -1
- package/dist/workspace-draw-run.d.ts +12 -0
- package/dist/workspace-draw-run.d.ts.map +1 -1
- package/dist/workspace-draw-run.js +47 -18
- package/dist/workspace-draw-run.js.map +1 -1
- package/dist/workspace-draw-types.d.ts +2 -1
- package/dist/workspace-draw-types.d.ts.map +1 -1
- package/dist/workspace-draw-types.js +1 -0
- package/dist/workspace-draw-types.js.map +1 -1
- package/dist/workspace-runner-main.d.ts +5 -0
- package/dist/workspace-runner-main.d.ts.map +1 -1
- package/dist/workspace-runner-main.js +15 -3
- package/dist/workspace-runner-main.js.map +1 -1
- package/open-design.json +2 -13
- package/package.json +1 -1
- package/skills/12ui-design/SKILL.md +7 -8
- package/dist/mcp-slate-ui-script-dialog.d.ts +0 -21
- package/dist/mcp-slate-ui-script-dialog.d.ts.map +0 -1
- package/dist/mcp-slate-ui-script-dialog.js +0 -351
- package/dist/mcp-slate-ui-script-dialog.js.map +0 -1
- package/dist/mcp-slate-ui-script-progress.d.ts +0 -7
- package/dist/mcp-slate-ui-script-progress.d.ts.map +0 -1
- package/dist/mcp-slate-ui-script-progress.js +0 -9
- package/dist/mcp-slate-ui-script-progress.js.map +0 -1
- package/dist/mcp-slate-ui-styles-dialog.d.ts +0 -20
- package/dist/mcp-slate-ui-styles-dialog.d.ts.map +0 -1
- package/dist/mcp-slate-ui-styles-dialog.js +0 -87
- package/dist/mcp-slate-ui-styles-dialog.js.map +0 -1
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The large view, like Design Lab's: one design at full size over the workspace. A slim bar names it (its code, where
|
|
3
|
+
* it came from) with previous, next and close; under it the design, which zooms with the wheel or a pinch around the
|
|
4
|
+
* pointer, pans by dragging (horizontal wheel and Shift+wheel pan too), and has minus, the zoom level (a tap toggles
|
|
5
|
+
* 100 percent and fit), plus and fit; under that the labelled actions: Edit, Branch and Build this.
|
|
6
|
+
*
|
|
7
|
+
* Edit and branch open a bar in place of the actions, so nothing covers the design:
|
|
8
|
+
* - Edit: draw on the design (the scribble layer, mcp-slate-ui-script-scribble.ts; the view fits the design while
|
|
9
|
+
* drawing) and/or type a change, then Enter. The edit runs at once and the view closes onto the Designs tab, where
|
|
10
|
+
* the new version is already a loading tile next to its source.
|
|
11
|
+
* - Branch: optional page names, comma separated, then Enter. It draws those pages (or four the model chooses) of the
|
|
12
|
+
* same product from this design; they land as a branch section of the Designs tab.
|
|
13
|
+
*
|
|
14
|
+
* Keys: Escape leaves the bar, then the view; left and right step; plus, minus, 0 (fit) and 1 (100 percent) zoom.
|
|
15
|
+
* In the workspace the view covers the frame; in a card whose host has no fullscreen it opens in the card instead.
|
|
16
|
+
*/
|
|
17
|
+
export const SLATE_UI_VIEWER = String.raw `
|
|
18
|
+
var ZOOM_MAX = 8;
|
|
19
|
+
var BRANCH_DEFAULT_PAGES = 4;
|
|
20
|
+
var BRANCH_MAX_PAGES = 8;
|
|
21
|
+
var PAGE_NAME_CHARS = 60;
|
|
22
|
+
|
|
23
|
+
// Open the view on a version, optionally straight onto its edit or branch bar. From the card it asks for the workspace.
|
|
24
|
+
function openViewer(versionId, mode) {
|
|
25
|
+
var v = ver(versionId);
|
|
26
|
+
if (!v) return;
|
|
27
|
+
state.lv = { versionId: versionId, mode: mode || null, scale: 1, x: 0, y: 0, fitted: true, prompt: "", pages: "", strokes: [], current: null, committing: false, error: "", id: uuid4(), els: {} };
|
|
28
|
+
if (!isFullscreen() && canFullscreen()) { requestMode("fullscreen"); }
|
|
29
|
+
renderAll();
|
|
30
|
+
}
|
|
31
|
+
function closeViewer() {
|
|
32
|
+
if (!state.lv || state.lv.committing) return;
|
|
33
|
+
state.lv = null;
|
|
34
|
+
viewerHost().textContent = "";
|
|
35
|
+
renderAll();
|
|
36
|
+
}
|
|
37
|
+
function viewerHost() {
|
|
38
|
+
if (isFullscreen()) { if (!stageBuilt) buildStageSkeleton(); return stageEls.viewer; }
|
|
39
|
+
return $("viewer");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function lvVersion() { return state.lv ? ver(state.lv.versionId) : null; }
|
|
43
|
+
function stepViewer(delta) {
|
|
44
|
+
var lv = state.lv;
|
|
45
|
+
if (!lv || lv.mode) return;
|
|
46
|
+
var order = viewerOrder();
|
|
47
|
+
var at = order.findIndex(function (x) { return x.versionId === lv.versionId; });
|
|
48
|
+
var next = order[at + delta];
|
|
49
|
+
if (!next) return;
|
|
50
|
+
lv.versionId = next.versionId;
|
|
51
|
+
lv.fitted = true;
|
|
52
|
+
lv.error = "";
|
|
53
|
+
lv.built = null;
|
|
54
|
+
renderViewer();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ---- render: built once per version and bar, zoom moves the picture without a rebuild ----
|
|
58
|
+
function renderViewer() {
|
|
59
|
+
var lv = state.lv;
|
|
60
|
+
var host = viewerHost();
|
|
61
|
+
if (!host) return;
|
|
62
|
+
if (!lv) { host.textContent = ""; return; }
|
|
63
|
+
var v = lvVersion();
|
|
64
|
+
if (!v) { state.lv = null; host.textContent = ""; return; }
|
|
65
|
+
var c = cand(v.candidateId);
|
|
66
|
+
var sig = JSON.stringify([v.versionId, v.sha256, lv.mode, samePick(v), state.busy, v.editable, localImage().ready, moreBusy(), viewerOrder().map(function (x) { return x.versionId; })]);
|
|
67
|
+
if (lv.built === sig && host.firstChild) { syncViewerForm(); return; }
|
|
68
|
+
lv.built = sig;
|
|
69
|
+
host.textContent = "";
|
|
70
|
+
var box = el("div", "lv");
|
|
71
|
+
box.setAttribute("role", "dialog");
|
|
72
|
+
box.setAttribute("aria-modal", "true");
|
|
73
|
+
box.setAttribute("aria-label", tileName(c, v));
|
|
74
|
+
|
|
75
|
+
var bar = el("div", "lvbar");
|
|
76
|
+
var tag = el("span", "dtag");
|
|
77
|
+
tag.appendChild(el("b", "code", v.label));
|
|
78
|
+
var from = parentLabel(v);
|
|
79
|
+
if (from) tag.appendChild(el("span", "dfrom", t("fromLabel", { label: from })));
|
|
80
|
+
var page = pageName(c);
|
|
81
|
+
if (page) tag.appendChild(el("span", "dpage", page));
|
|
82
|
+
if (samePick(v)) { var chosen = el("span", "dchosen inline"); chosen.innerHTML = svgIcon(ICON.choose, 13); chosen.appendChild(el("span", "sr", t("chosen"))); tag.appendChild(chosen); }
|
|
83
|
+
bar.appendChild(tag);
|
|
84
|
+
bar.appendChild(el("span", "spacer"));
|
|
85
|
+
var order = viewerOrder();
|
|
86
|
+
var at = order.findIndex(function (x) { return x.versionId === v.versionId; });
|
|
87
|
+
var prev = iconAction(t("previous"), ICON.left, function () { stepViewer(-1); });
|
|
88
|
+
prev.disabled = at <= 0 || !!lv.mode;
|
|
89
|
+
var next = iconAction(t("next"), ICON.right, function () { stepViewer(1); });
|
|
90
|
+
next.disabled = at < 0 || at >= order.length - 1 || !!lv.mode;
|
|
91
|
+
bar.appendChild(prev);
|
|
92
|
+
bar.appendChild(el("span", "lvcount", (at + 1) + " / " + order.length));
|
|
93
|
+
bar.appendChild(next);
|
|
94
|
+
bar.appendChild(iconAction(t("close"), ICON.close, closeViewer));
|
|
95
|
+
box.appendChild(bar);
|
|
96
|
+
|
|
97
|
+
var port = el("div", "lvport" + (lv.mode === "edit" ? " drawing" : ""));
|
|
98
|
+
port.style.setProperty("--ar", String(v.width / v.height));
|
|
99
|
+
var stageBox = el("div", "lvstage");
|
|
100
|
+
stageBox.style.width = v.width + "px";
|
|
101
|
+
stageBox.style.height = v.height + "px";
|
|
102
|
+
var img = el("img", "lvimg empty");
|
|
103
|
+
img.alt = tileName(c, v);
|
|
104
|
+
img.setAttribute("draggable", "false");
|
|
105
|
+
var cached = state.fulls[imageKey(v, "full")] || state.thumbs[imageKey(v, "thumb")];
|
|
106
|
+
if (cached) { img.src = cached; img.classList.remove("empty"); }
|
|
107
|
+
bindImage(img, v, "full", true);
|
|
108
|
+
stageBox.appendChild(img);
|
|
109
|
+
port.appendChild(stageBox);
|
|
110
|
+
if (lv.mode === "edit") scribbleAttach(stageBox, lv);
|
|
111
|
+
var zoom = el("div", "lvzoom");
|
|
112
|
+
zoom.appendChild(iconAction(t("zoomOut"), ICON.minus, function () { zoomBy(1 / 1.25); }));
|
|
113
|
+
lv.els.level = button("", "lvlevel", function () { if (Math.abs(lv.scale - 1) < 0.001) fitViewer(); else zoomTo(1); });
|
|
114
|
+
lv.els.level.setAttribute("aria-label", t("zoomActual"));
|
|
115
|
+
lv.els.level.title = t("zoomActual");
|
|
116
|
+
zoom.appendChild(lv.els.level);
|
|
117
|
+
zoom.appendChild(iconAction(t("zoomIn"), ICON.plus, function () { zoomBy(1.25); }));
|
|
118
|
+
zoom.appendChild(iconAction(t("zoomFit"), ICON.fit, fitViewer));
|
|
119
|
+
if (lv.mode !== "edit") port.appendChild(zoom);
|
|
120
|
+
box.appendChild(port);
|
|
121
|
+
lv.els.port = port;
|
|
122
|
+
lv.els.stage = stageBox;
|
|
123
|
+
bindZoom(port);
|
|
124
|
+
|
|
125
|
+
var foot = el("div", "lvfoot");
|
|
126
|
+
if (lv.mode === "edit") foot.appendChild(editForm(v));
|
|
127
|
+
else if (lv.mode === "branch") foot.appendChild(branchForm(v));
|
|
128
|
+
else foot.appendChild(viewerActions(v));
|
|
129
|
+
lv.els.alert = el("p", "alert");
|
|
130
|
+
lv.els.alert.setAttribute("role", "alert");
|
|
131
|
+
foot.appendChild(lv.els.alert);
|
|
132
|
+
box.appendChild(foot);
|
|
133
|
+
host.appendChild(box);
|
|
134
|
+
applyZoom();
|
|
135
|
+
syncViewerForm();
|
|
136
|
+
var first = foot.querySelector("input") || foot.querySelector("button:not([disabled])");
|
|
137
|
+
if (first && first.focus && lv.mode) first.focus();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function viewerActions(v) {
|
|
141
|
+
var row = el("div", "lvacts");
|
|
142
|
+
row.setAttribute("role", "toolbar");
|
|
143
|
+
row.setAttribute("aria-label", t("actionsFor", { name: v.label }));
|
|
144
|
+
var edit = wordAction(t("edit"), ICON.edit, function () { setViewerMode("edit"); });
|
|
145
|
+
edit.disabled = !v.editable || !localImage().ready;
|
|
146
|
+
if (!v.editable && v.editBlockedReason) edit.title = serverText(v.editBlockedL10n, v.editBlockedReason);
|
|
147
|
+
var branch = wordAction(t("branch"), ICON.branch, function () { setViewerMode("branch"); });
|
|
148
|
+
branch.disabled = !localImage().ready;
|
|
149
|
+
// Build this: the one primary action. It records the pick and hands the build to the agent.
|
|
150
|
+
var choose = wordAction(samePick(v) ? t("chosen") : t("choose"), ICON.convert, function () { doSelect(v); }, "choose primary");
|
|
151
|
+
choose.setAttribute("aria-pressed", samePick(v) ? "true" : "false");
|
|
152
|
+
choose.disabled = state.busy || !pickable(v);
|
|
153
|
+
[edit, branch, choose].forEach(function (b) { row.appendChild(b); });
|
|
154
|
+
return row;
|
|
155
|
+
}
|
|
156
|
+
function setViewerMode(mode) {
|
|
157
|
+
var lv = state.lv;
|
|
158
|
+
if (!lv || lv.committing) return;
|
|
159
|
+
lv.mode = mode;
|
|
160
|
+
lv.error = "";
|
|
161
|
+
lv.strokes = [];
|
|
162
|
+
lv.current = null;
|
|
163
|
+
lv.fitted = true;
|
|
164
|
+
lv.built = null;
|
|
165
|
+
renderViewer();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// The bar's own mark at its left, so it reads as edit or branch once the field holds words.
|
|
169
|
+
function modeMark(path) { var mark = el("span", "lvmode"); mark.setAttribute("aria-hidden", "true"); mark.innerHTML = svgIcon(path, 16); return mark; }
|
|
170
|
+
// Enter applies on its own keydown: a host frame sandboxed without allow-forms (the browser workspace) never submits a form.
|
|
171
|
+
function enterApplies(input) {
|
|
172
|
+
input.addEventListener("keydown", function (e) {
|
|
173
|
+
if (e.key !== "Enter" || e.isComposing) return;
|
|
174
|
+
e.preventDefault();
|
|
175
|
+
commitViewer();
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
// ---- edit: draw and/or type, then Enter ----
|
|
179
|
+
function editForm(v) {
|
|
180
|
+
var lv = state.lv;
|
|
181
|
+
var form = el("form", "lvform");
|
|
182
|
+
form.setAttribute("aria-label", t("edit"));
|
|
183
|
+
form.appendChild(modeMark(ICON.edit));
|
|
184
|
+
var input = el("input");
|
|
185
|
+
input.type = "text";
|
|
186
|
+
input.className = "lvinput";
|
|
187
|
+
input.placeholder = t("editChange");
|
|
188
|
+
input.setAttribute("aria-label", t("editChange"));
|
|
189
|
+
input.setAttribute("maxlength", "6000");
|
|
190
|
+
input.value = lv.prompt;
|
|
191
|
+
input.addEventListener("input", function () { lv.prompt = input.value; lv.error = ""; syncViewerForm(); });
|
|
192
|
+
enterApplies(input);
|
|
193
|
+
lv.els.undo = iconAction(t("undo"), ICON.undo, function () { scribbleUndo(lv); });
|
|
194
|
+
lv.els.apply = iconAction(t("apply"), ICON.send, function () { commitViewer(); }, "go");
|
|
195
|
+
form.appendChild(lv.els.undo);
|
|
196
|
+
form.appendChild(input);
|
|
197
|
+
form.appendChild(lv.els.apply);
|
|
198
|
+
form.appendChild(iconAction(t("cancel"), ICON.close, function () { setViewerMode(null); }));
|
|
199
|
+
form.addEventListener("submit", function (e) { e.preventDefault(); commitViewer(); });
|
|
200
|
+
return form;
|
|
201
|
+
}
|
|
202
|
+
// ---- branch: optional page names ----
|
|
203
|
+
function branchPages(text) {
|
|
204
|
+
return String(text || "").split(/[,\n;]/).map(function (p) { return p.replace(/\s+/g, " ").trim().slice(0, PAGE_NAME_CHARS); }).filter(Boolean).slice(0, BRANCH_MAX_PAGES);
|
|
205
|
+
}
|
|
206
|
+
function branchForm(v) {
|
|
207
|
+
var lv = state.lv;
|
|
208
|
+
var form = el("form", "lvform");
|
|
209
|
+
form.setAttribute("aria-label", t("branch"));
|
|
210
|
+
form.appendChild(modeMark(ICON.branch));
|
|
211
|
+
var input = el("input");
|
|
212
|
+
input.type = "text";
|
|
213
|
+
input.className = "lvinput";
|
|
214
|
+
input.placeholder = t("branchPages");
|
|
215
|
+
input.setAttribute("aria-label", t("branchPages"));
|
|
216
|
+
input.value = lv.pages;
|
|
217
|
+
input.addEventListener("input", function () { lv.pages = input.value; });
|
|
218
|
+
enterApplies(input);
|
|
219
|
+
lv.els.apply = iconAction(t("branch"), ICON.send, function () { commitViewer(); }, "go");
|
|
220
|
+
form.appendChild(input);
|
|
221
|
+
form.appendChild(lv.els.apply);
|
|
222
|
+
form.appendChild(iconAction(t("cancel"), ICON.close, function () { setViewerMode(null); }));
|
|
223
|
+
form.addEventListener("submit", function (e) { e.preventDefault(); commitViewer(); });
|
|
224
|
+
return form;
|
|
225
|
+
}
|
|
226
|
+
function viewerReady() {
|
|
227
|
+
var lv = state.lv;
|
|
228
|
+
var v = lvVersion();
|
|
229
|
+
if (!lv || !v || lv.committing || !localImage().ready) return false;
|
|
230
|
+
if (lv.mode === "edit") return v.editable && (lv.strokes.length > 0 || !!editWords(lv.prompt)) && editOverBy(lv.prompt) === 0;
|
|
231
|
+
if (lv.mode === "branch") return true;
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
function syncViewerForm() {
|
|
235
|
+
var lv = state.lv;
|
|
236
|
+
if (!lv || !lv.els) return;
|
|
237
|
+
if (lv.els.apply) lv.els.apply.disabled = !viewerReady();
|
|
238
|
+
if (lv.els.undo) lv.els.undo.disabled = lv.strokes.length === 0 || lv.committing;
|
|
239
|
+
if (lv.els.alert) {
|
|
240
|
+
var tooLong = lv.mode === "edit" ? editOverBy(lv.prompt) : 0;
|
|
241
|
+
lv.els.alert.textContent = lv.error || (lv.mode && !localImage().ready ? localReason() : "") || (tooLong > 0 ? t("editTooLong", { n: tooLong }) : "");
|
|
242
|
+
lv.els.alert.classList.toggle("hidden", !lv.els.alert.textContent);
|
|
243
|
+
}
|
|
244
|
+
if (lv.els.port) lv.els.port.classList.toggle("busy", lv.committing);
|
|
245
|
+
}
|
|
246
|
+
// The scribble layer reports each change of its strokes here.
|
|
247
|
+
function scribbleChanged(d) { if (d === state.lv) syncViewerForm(); }
|
|
248
|
+
|
|
249
|
+
function commitViewer() {
|
|
250
|
+
var lv = state.lv;
|
|
251
|
+
if (!viewerReady()) return;
|
|
252
|
+
var v = lvVersion();
|
|
253
|
+
lv.committing = true;
|
|
254
|
+
lv.error = "";
|
|
255
|
+
syncViewerForm();
|
|
256
|
+
var work;
|
|
257
|
+
if (lv.mode === "edit") {
|
|
258
|
+
var d = { versionId: v.versionId, prompt: lv.prompt, strokes: lv.strokes };
|
|
259
|
+
work = editActionFor(d, v).then(function (action) { return runAction(action, lv.id); });
|
|
260
|
+
} else {
|
|
261
|
+
var pages = branchPages(lv.pages);
|
|
262
|
+
var action = { kind: "round", mode: "branch", fromVersionId: v.versionId };
|
|
263
|
+
if (pages.length) action.pages = pages; else action.count = BRANCH_DEFAULT_PAGES;
|
|
264
|
+
work = runAction(action, lv.id);
|
|
265
|
+
}
|
|
266
|
+
work.then(function () {
|
|
267
|
+
lv.committing = false;
|
|
268
|
+
if (state.lv === lv) { state.lv = null; viewerHost().textContent = ""; }
|
|
269
|
+
state.tab = "designs";
|
|
270
|
+
syncTabs();
|
|
271
|
+
renderAll();
|
|
272
|
+
}, function (err) {
|
|
273
|
+
lv.committing = false;
|
|
274
|
+
if (state.lv !== lv) return;
|
|
275
|
+
lv.error = errText(err);
|
|
276
|
+
syncViewerForm();
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// ---- zoom and pan ----
|
|
281
|
+
function portSize() {
|
|
282
|
+
var lv = state.lv;
|
|
283
|
+
var r = lv && lv.els.port ? lv.els.port.getBoundingClientRect() : null;
|
|
284
|
+
return r && r.width > 0 && r.height > 0 ? { w: r.width, h: r.height } : null;
|
|
285
|
+
}
|
|
286
|
+
function fitScale() {
|
|
287
|
+
var v = lvVersion();
|
|
288
|
+
var size = portSize();
|
|
289
|
+
if (!v || !size) return 1;
|
|
290
|
+
return Math.min(size.w / v.width, size.h / v.height);
|
|
291
|
+
}
|
|
292
|
+
function clampPan() {
|
|
293
|
+
var lv = state.lv;
|
|
294
|
+
var v = lvVersion();
|
|
295
|
+
var size = portSize();
|
|
296
|
+
if (!v || !size) return;
|
|
297
|
+
var w = v.width * lv.scale;
|
|
298
|
+
var h = v.height * lv.scale;
|
|
299
|
+
// Smaller than the port: centred on that axis. Larger: no gap at either edge.
|
|
300
|
+
lv.x = w <= size.w ? (size.w - w) / 2 : Math.min(0, Math.max(size.w - w, lv.x));
|
|
301
|
+
lv.y = h <= size.h ? (size.h - h) / 2 : Math.min(0, Math.max(size.h - h, lv.y));
|
|
302
|
+
}
|
|
303
|
+
function applyZoom() {
|
|
304
|
+
var lv = state.lv;
|
|
305
|
+
if (!lv || !lv.els.stage) return;
|
|
306
|
+
if (lv.fitted) lv.scale = fitScale();
|
|
307
|
+
clampPan();
|
|
308
|
+
lv.els.stage.style.transform = "translate(" + lv.x + "px, " + lv.y + "px) scale(" + lv.scale + ")";
|
|
309
|
+
if (lv.els.level) lv.els.level.textContent = Math.round(lv.scale * 100) + "%";
|
|
310
|
+
}
|
|
311
|
+
function fitViewer() { var lv = state.lv; if (!lv) return; lv.fitted = true; applyZoom(); }
|
|
312
|
+
function zoomAround(next, cx, cy) {
|
|
313
|
+
var lv = state.lv;
|
|
314
|
+
if (!lv || lv.mode === "edit") return;
|
|
315
|
+
var size = portSize();
|
|
316
|
+
if (!size) return;
|
|
317
|
+
var min = Math.min(fitScale(), 1);
|
|
318
|
+
var scale = Math.max(min, Math.min(ZOOM_MAX, next));
|
|
319
|
+
var px = cx === undefined ? size.w / 2 : cx;
|
|
320
|
+
var py = cy === undefined ? size.h / 2 : cy;
|
|
321
|
+
lv.x = px - (px - lv.x) * (scale / lv.scale);
|
|
322
|
+
lv.y = py - (py - lv.y) * (scale / lv.scale);
|
|
323
|
+
lv.scale = scale;
|
|
324
|
+
lv.fitted = false;
|
|
325
|
+
applyZoom();
|
|
326
|
+
}
|
|
327
|
+
function zoomBy(factor, cx, cy) { var lv = state.lv; if (lv) zoomAround(lv.scale * factor, cx, cy); }
|
|
328
|
+
function zoomTo(scale) { zoomAround(scale); }
|
|
329
|
+
function bindZoom(port) {
|
|
330
|
+
var pointers = {};
|
|
331
|
+
var pinch = null;
|
|
332
|
+
function local(e) { var r = port.getBoundingClientRect(); return { x: e.clientX - r.left, y: e.clientY - r.top }; }
|
|
333
|
+
port.addEventListener("wheel", function (e) {
|
|
334
|
+
var lv = state.lv;
|
|
335
|
+
if (!lv || lv.mode === "edit") return;
|
|
336
|
+
if (e.preventDefault) e.preventDefault();
|
|
337
|
+
var p = local(e);
|
|
338
|
+
var dx = e.deltaMode === 1 ? e.deltaX * 16 : e.deltaX;
|
|
339
|
+
var dy = e.deltaMode === 1 ? e.deltaY * 16 : e.deltaY;
|
|
340
|
+
// A trackpad pinch arrives as a wheel with ctrlKey; vertical zooms around the pointer; horizontal and Shift pan.
|
|
341
|
+
if (e.ctrlKey) { zoomBy(Math.exp(-dy * 0.01), p.x, p.y); return; }
|
|
342
|
+
if (e.shiftKey || Math.abs(dx) > Math.abs(dy)) { lv.x -= e.shiftKey && !dx ? 0 : dx; lv.y -= e.shiftKey ? dy : 0; lv.fitted = false; applyZoom(); return; }
|
|
343
|
+
zoomBy(Math.exp(-dy * 0.002), p.x, p.y);
|
|
344
|
+
}, { passive: false });
|
|
345
|
+
port.addEventListener("dblclick", function (e) {
|
|
346
|
+
var lv = state.lv;
|
|
347
|
+
if (!lv || lv.mode === "edit") return;
|
|
348
|
+
var p = local(e);
|
|
349
|
+
if (Math.abs(lv.scale - 1) < 0.001) fitViewer(); else zoomAround(1, p.x, p.y);
|
|
350
|
+
});
|
|
351
|
+
port.addEventListener("pointerdown", function (e) {
|
|
352
|
+
var lv = state.lv;
|
|
353
|
+
if (!lv || lv.mode === "edit" || (e.target && e.target.closest && e.target.closest("button"))) return;
|
|
354
|
+
pointers[e.pointerId] = local(e);
|
|
355
|
+
var ids = Object.keys(pointers);
|
|
356
|
+
if (ids.length === 2) {
|
|
357
|
+
var a = pointers[ids[0]], b = pointers[ids[1]];
|
|
358
|
+
pinch = { d: Math.hypot(a.x - b.x, a.y - b.y) || 1, scale: lv.scale };
|
|
359
|
+
}
|
|
360
|
+
if (port.setPointerCapture) { try { port.setPointerCapture(e.pointerId); } catch (err) { /* best effort */ } }
|
|
361
|
+
port.classList.add("grabbing");
|
|
362
|
+
});
|
|
363
|
+
port.addEventListener("pointermove", function (e) {
|
|
364
|
+
var lv = state.lv;
|
|
365
|
+
var last = pointers[e.pointerId];
|
|
366
|
+
if (!lv || !last) return;
|
|
367
|
+
var p = local(e);
|
|
368
|
+
pointers[e.pointerId] = p;
|
|
369
|
+
var ids = Object.keys(pointers);
|
|
370
|
+
if (ids.length === 2 && pinch) {
|
|
371
|
+
var a = pointers[ids[0]], b = pointers[ids[1]];
|
|
372
|
+
var d = Math.hypot(a.x - b.x, a.y - b.y) || 1;
|
|
373
|
+
zoomAround(pinch.scale * d / pinch.d, (a.x + b.x) / 2, (a.y + b.y) / 2);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
lv.x += p.x - last.x;
|
|
377
|
+
lv.y += p.y - last.y;
|
|
378
|
+
lv.fitted = false;
|
|
379
|
+
applyZoom();
|
|
380
|
+
});
|
|
381
|
+
function up(e) {
|
|
382
|
+
delete pointers[e.pointerId];
|
|
383
|
+
if (Object.keys(pointers).length < 2) pinch = null;
|
|
384
|
+
if (Object.keys(pointers).length === 0) port.classList.remove("grabbing");
|
|
385
|
+
}
|
|
386
|
+
port.addEventListener("pointerup", up);
|
|
387
|
+
port.addEventListener("pointercancel", up);
|
|
388
|
+
}
|
|
389
|
+
window.addEventListener("resize", function () { if (state.lv) applyZoom(); });
|
|
390
|
+
|
|
391
|
+
document.addEventListener("keydown", function (e) {
|
|
392
|
+
var lv = state.lv;
|
|
393
|
+
if (!lv) return;
|
|
394
|
+
var typing = e.target && e.target.tagName === "INPUT";
|
|
395
|
+
if (e.key === "Escape") { if (lv.committing) return; if (lv.mode) setViewerMode(null); else closeViewer(); return; }
|
|
396
|
+
if (typing || lv.mode) return;
|
|
397
|
+
if (e.key === "ArrowLeft") stepViewer(-1);
|
|
398
|
+
else if (e.key === "ArrowRight") stepViewer(1);
|
|
399
|
+
else if (e.key === "+" || e.key === "=") zoomBy(1.25);
|
|
400
|
+
else if (e.key === "-") zoomBy(1 / 1.25);
|
|
401
|
+
else if (e.key === "0") fitViewer();
|
|
402
|
+
else if (e.key === "1") zoomTo(1);
|
|
403
|
+
});
|
|
404
|
+
`;
|
|
405
|
+
//# sourceMappingURL=mcp-slate-ui-script-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script-viewer.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-viewer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmYxC,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The workspace view's script, assembled from single-purpose fragments that
|
|
3
3
|
* share one scope: bridge (host protocol), state (view state, picture queue,
|
|
4
|
-
* polling, what the ops say), l10n (the person's language and every word, `t(key)`),
|
|
5
|
-
* the
|
|
6
|
-
* (fullscreen), pause (the inspiration pause of the hosted server), dialog (Edit, Branch and Convert), more (the Generate more tile and its panel), scribble (the drawing layer of Edit), the hosted and browser targets' words, then the handshake, last, so every function and
|
|
4
|
+
* polling, what the ops say), l10n (the person's language and every word, `t(key)`), inline (the card), select (Select), inspiration (the tabs and the Inspiration tab), stage
|
|
5
|
+
* (fullscreen), pause (the inspiration pause of the hosted server), edit (what the large view's Edit sends), more (the Generate more tile and its panel), scribble (the drawing layer of Edit), the hosted and browser targets' words, then the handshake, last, so every function and
|
|
7
6
|
* variable exists before the first message can arrive. The tool names come
|
|
8
7
|
* from the view contract (SLATE_UI_TOOLS), not from the server's own module.
|
|
9
8
|
*
|
|
@@ -19,8 +18,8 @@
|
|
|
19
18
|
export type SlateUiTarget = 'local' | 'remote' | 'browser';
|
|
20
19
|
/**
|
|
21
20
|
* The script for one target. The fragments are the same for both; the target is a constant they read (`TARGET`), and
|
|
22
|
-
* only the places the two servers differ branch on it: what the agent is told, how a running op reads
|
|
23
|
-
*
|
|
21
|
+
* only the places the two servers differ branch on it: what the agent is told, how a running op reads and what the
|
|
22
|
+
* edit carries.
|
|
24
23
|
*/
|
|
25
24
|
export declare const buildSlateUiScript: (target: SlateUiTarget) => string;
|
|
26
25
|
export declare const SLATE_UI_SCRIPT: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AA2B3D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,aAAa,KAAG,MAuB/C,CAAC;AAEb,eAAO,MAAM,eAAe,QAA8B,CAAC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { SLATE_BROWSER_PAGE_KEYS,
|
|
1
|
+
import { SLATE_BROWSER_PAGE_KEYS, SLATE_MORE_COUNTS } from './mcp-slate-ui-copy.js';
|
|
2
2
|
import { SLATE_UI_LOCALES } from './mcp-slate-ui-locales/index.js';
|
|
3
3
|
import { SLATE_EDIT_PROMPT_MAX_BYTES, SLATE_UI_TOOLS } from './slate-view-contract.js';
|
|
4
4
|
import { SLATE_UI_BRIDGE } from './mcp-slate-ui-script-bridge.js';
|
|
5
5
|
import { SLATE_UI_BROWSER } from './mcp-slate-ui-script-browser.js';
|
|
6
|
-
import {
|
|
6
|
+
import { SLATE_UI_DESIGNS } from './mcp-slate-ui-script-designs.js';
|
|
7
|
+
import { SLATE_UI_EDIT } from './mcp-slate-ui-script-edit.js';
|
|
7
8
|
import { SLATE_UI_INLINE } from './mcp-slate-ui-script-inline.js';
|
|
8
9
|
import { SLATE_UI_INSPIRATION } from './mcp-slate-ui-script-inspiration.js';
|
|
9
10
|
import { buildSlateUiL10n } from './mcp-slate-ui-script-l10n.js';
|
|
10
11
|
import { SLATE_UI_MORE } from './mcp-slate-ui-script-more.js';
|
|
11
12
|
import { SLATE_UI_NO_PAUSE, SLATE_UI_PAUSE } from './mcp-slate-ui-script-pause.js';
|
|
12
|
-
import {
|
|
13
|
+
import { SLATE_UI_REFERENCES } from './mcp-slate-ui-script-references.js';
|
|
13
14
|
import { SLATE_UI_REMOTE } from './mcp-slate-ui-script-remote.js';
|
|
14
15
|
import { SLATE_UI_SCRIBBLE } from './mcp-slate-ui-script-scribble.js';
|
|
15
16
|
import { SLATE_UI_SELECT } from './mcp-slate-ui-script-select.js';
|
|
16
17
|
import { SLATE_UI_STAGE } from './mcp-slate-ui-script-stage.js';
|
|
17
18
|
import { SLATE_UI_STATE } from './mcp-slate-ui-script-state.js';
|
|
19
|
+
import { SLATE_UI_VIEWER } from './mcp-slate-ui-script-viewer.js';
|
|
18
20
|
/**
|
|
19
21
|
* Every shipped catalogue as the screen carries it: all keys but the words of the browser page around it (that page
|
|
20
22
|
* carries its own, SLATE_BROWSER_PAGE_KEYS; the title is both's).
|
|
@@ -40,29 +42,26 @@ const HANDSHAKE = String.raw `
|
|
|
40
42
|
`;
|
|
41
43
|
/**
|
|
42
44
|
* The script for one target. The fragments are the same for both; the target is a constant they read (`TARGET`), and
|
|
43
|
-
* only the places the two servers differ branch on it: what the agent is told, how a running op reads
|
|
44
|
-
*
|
|
45
|
+
* only the places the two servers differ branch on it: what the agent is told, how a running op reads and what the
|
|
46
|
+
* edit carries.
|
|
45
47
|
*/
|
|
46
48
|
export const buildSlateUiScript = (target) => [
|
|
47
49
|
'"use strict";',
|
|
48
50
|
'(function () {',
|
|
49
51
|
SLATE_UI_BRIDGE
|
|
50
52
|
.replace('__TOOLS__', () => JSON.stringify(SLATE_UI_TOOLS))
|
|
51
|
-
.replace('__TARGET__', () => JSON.stringify(target))
|
|
52
|
-
.replace('__CONVERT__', () => JSON.stringify({
|
|
53
|
-
choices: target === 'remote' ? SLATE_REMOTE_CONVERT_CHOICES : SLATE_CONVERT_CHOICES,
|
|
54
|
-
descriptionKeys: target === 'remote' ? SLATE_REMOTE_CONVERT_DESCRIPTION_KEYS : SLATE_CONVERT_DESCRIPTION_KEYS,
|
|
55
|
-
maxWidth: SLATE_CONVERT_MAX_WIDTH,
|
|
56
|
-
})),
|
|
53
|
+
.replace('__TARGET__', () => JSON.stringify(target)),
|
|
57
54
|
SLATE_UI_STATE,
|
|
58
55
|
buildSlateUiL10n(screenMessages()),
|
|
59
|
-
SLATE_UI_PROGRESS,
|
|
60
56
|
SLATE_UI_INLINE,
|
|
61
57
|
SLATE_UI_SELECT,
|
|
62
58
|
SLATE_UI_INSPIRATION,
|
|
59
|
+
SLATE_UI_REFERENCES,
|
|
63
60
|
target === 'remote' ? SLATE_UI_PAUSE : SLATE_UI_NO_PAUSE,
|
|
61
|
+
SLATE_UI_DESIGNS,
|
|
62
|
+
SLATE_UI_VIEWER,
|
|
64
63
|
SLATE_UI_STAGE,
|
|
65
|
-
|
|
64
|
+
SLATE_UI_EDIT.replace('__EDIT_PROMPT_MAX_BYTES__', () => JSON.stringify(SLATE_EDIT_PROMPT_MAX_BYTES)),
|
|
66
65
|
SLATE_UI_MORE.replace('__MORE__', () => JSON.stringify(SLATE_MORE_COUNTS)),
|
|
67
66
|
SLATE_UI_SCRIBBLE,
|
|
68
67
|
SLATE_UI_REMOTE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAsBlE;;;GAGG;AACH,MAAM,cAAc,GAAG,GAA2C,EAAE;IAClE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAS,uBAAuB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC;IAC3F,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC;QAClF,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;KACxF,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;CAY3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAqB,EAAU,EAAE,CAAC;IACnE,eAAe;IACf,gBAAgB;IAChB,eAAe;SACZ,OAAO,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;SAC1D,OAAO,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtD,cAAc;IACd,gBAAgB,CAAC,cAAc,EAAE,CAAC;IAClC,eAAe;IACf,eAAe;IACf,oBAAoB;IACpB,mBAAmB;IACnB,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,iBAAiB;IACxD,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,aAAa,CAAC,OAAO,CAAC,2BAA2B,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;IACrG,aAAa,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC1E,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,SAAS;IACT,OAAO;CACR,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Designs tab and the large view. Tiles are large and keep the frame's shape (`--ar` per tile); a grid's columns
|
|
3
|
+
* are no narrower than `--tile` times the square root of its ratio (`--shape`), so a 3:2 design is about 160 px wide on
|
|
4
|
+
* a phone (two across), 220 px in a card (three across) and 300 px in the workspace (four across at 1440 px). Under
|
|
5
|
+
* each picture is one row: the code (and where it came from, or its page) at the left, the four icon actions at the
|
|
6
|
+
* right, so nothing covers the design. The chosen design has the selection's own language: a thick ring in the host's
|
|
7
|
+
* accent and a filled check on the picture.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SLATE_UI_DESIGNS_STYLES: string;
|
|
10
|
+
//# sourceMappingURL=mcp-slate-ui-styles-designs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-styles-designs.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-styles-designs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,QA+GnC,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Designs tab and the large view. Tiles are large and keep the frame's shape (`--ar` per tile); a grid's columns
|
|
3
|
+
* are no narrower than `--tile` times the square root of its ratio (`--shape`), so a 3:2 design is about 160 px wide on
|
|
4
|
+
* a phone (two across), 220 px in a card (three across) and 300 px in the workspace (four across at 1440 px). Under
|
|
5
|
+
* each picture is one row: the code (and where it came from, or its page) at the left, the four icon actions at the
|
|
6
|
+
* right, so nothing covers the design. The chosen design has the selection's own language: a thick ring in the host's
|
|
7
|
+
* accent and a filled check on the picture.
|
|
8
|
+
*/
|
|
9
|
+
export const SLATE_UI_DESIGNS_STYLES = String.raw `
|
|
10
|
+
.designs { --tile: 130px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
|
|
11
|
+
@container (min-width: 480px) { .designs { --tile: 180px; } }
|
|
12
|
+
#stage .designs { --tile: 245px; }
|
|
13
|
+
@media (max-width: 639px) { #stage .designs { --tile: 130px; } }
|
|
14
|
+
|
|
15
|
+
/* The bar: how many a round draws, and More. */
|
|
16
|
+
.dbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; margin-left: auto; }
|
|
17
|
+
.dbar .alert { flex-basis: 100%; text-align: right; }
|
|
18
|
+
.dbar .alert:empty { display: none; }
|
|
19
|
+
.seg.count { display: inline-flex; flex: none; padding: 2px; border-radius: 999px; background: var(--fill); }
|
|
20
|
+
button.segbtn { min-width: 40px; padding: 4px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text2); font-variant-numeric: tabular-nums; }
|
|
21
|
+
button.segbtn[aria-checked="true"] { background: var(--bg); color: var(--text); box-shadow: var(--elev); }
|
|
22
|
+
.morebtn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px 7px 12px; border-radius: 999px; }
|
|
23
|
+
|
|
24
|
+
/* A round: a small head (number, what fed it, a status dot), then its grid. */
|
|
25
|
+
.dsec { min-width: 0; }
|
|
26
|
+
.dhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; min-height: 36px; margin-bottom: 10px; }
|
|
27
|
+
.dtitle { flex: none; margin: 0; font-size: 13px; font-weight: 600; }
|
|
28
|
+
.dbranchicon { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-solid); color: var(--inverse-text); }
|
|
29
|
+
.feed { display: inline-flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; }
|
|
30
|
+
.feedimg { display: block; flex: none; width: 34px; height: 24px; border-radius: 4px; background: var(--fill); object-fit: cover; }
|
|
31
|
+
.feedimg.design { width: 36px; outline: 2px solid var(--ring); outline-offset: 1px; margin-right: 4px; }
|
|
32
|
+
.feedimg:not([src]) { visibility: hidden; }
|
|
33
|
+
.feedmore { flex: none; font-size: 11px; color: var(--text2); padding-left: 2px; }
|
|
34
|
+
.dnote { min-width: 0; flex: 0 1 auto; font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
35
|
+
.dstat { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
|
|
36
|
+
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
|
|
37
|
+
.dot.run { background: var(--ring); animation: pulse 1.2s ease-in-out infinite; }
|
|
38
|
+
.dot.err { background: var(--danger); }
|
|
39
|
+
@keyframes pulse { 50% { opacity: .3; } }
|
|
40
|
+
.earlier { align-self: center; color: var(--text2); }
|
|
41
|
+
.dsec.branch .dgrid { padding-left: 14px; border-left: 2px solid var(--ring); margin-left: 10px; }
|
|
42
|
+
|
|
43
|
+
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--tile) * var(--shape, 1.22))), 1fr)); gap: 14px 12px; align-items: start; min-width: 0; }
|
|
44
|
+
#stage .dgrid { gap: 20px 16px; }
|
|
45
|
+
|
|
46
|
+
/* A tile: the picture, then its row. */
|
|
47
|
+
.dtile { position: relative; min-width: 0; }
|
|
48
|
+
button.dface { position: relative; display: block; width: 100%; aspect-ratio: var(--ar, 1.5); padding: 0; border: 0; border-radius: var(--radius); background: var(--fill); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border2); cursor: zoom-in; transition: box-shadow .12s; }
|
|
49
|
+
button.dface:hover:not(:disabled) { background: var(--fill); }
|
|
50
|
+
button.dface:disabled { opacity: 1; cursor: default; }
|
|
51
|
+
.dface .thumb { width: 100%; height: 100%; object-fit: contain; background: var(--fill); }
|
|
52
|
+
.dface .thumb:not([src]) { visibility: hidden; }
|
|
53
|
+
.dtile:hover .dface:not(:disabled) { box-shadow: inset 0 0 0 1px var(--border); }
|
|
54
|
+
.dtile.paused .dface { opacity: .55; }
|
|
55
|
+
.dtile.failed .dface { background: var(--bg); }
|
|
56
|
+
.failed .tilenote { color: var(--danger); }
|
|
57
|
+
/* Under the picture: its letter and, where there is one, where it came from; the words shorten with an ellipsis (the full words are the tag's title). */
|
|
58
|
+
.dmeta { display: flex; flex-wrap: nowrap; align-items: center; gap: 0 4px; min-width: 0; min-height: 28px; margin-top: 4px; }
|
|
59
|
+
.dtag { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 100%; flex: 1 1 auto; overflow: hidden; white-space: nowrap; }
|
|
60
|
+
.dtag .code { position: static; flex: none; padding: 0 7px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 12px; font-weight: 600; line-height: 20px; }
|
|
61
|
+
.dfrom { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--text2); }
|
|
62
|
+
.dpage { min-width: 0; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
|
|
63
|
+
.spin { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2.5px solid var(--border); border-top-color: var(--text2); border-radius: 50%; animation: spin .9s linear infinite; }
|
|
64
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
65
|
+
.dtile.loading .dtag .code { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text2); }
|
|
66
|
+
/* The tile's one action: a labelled pill over the picture's top right, on hover or keyboard focus, always on a touch screen. */
|
|
67
|
+
.dpick { position: absolute; right: 8px; top: 8px; z-index: 2; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--bg); color: var(--text); font-size: 12px; font-weight: 600; box-shadow: var(--elev); opacity: 0; transition: opacity .12s; }
|
|
68
|
+
button.dpick:hover:not(:disabled) { background: var(--bg); }
|
|
69
|
+
.dpick.on, button.dpick.on:hover:not(:disabled) { background: var(--accent-solid); color: var(--inverse-text); }
|
|
70
|
+
.dtile:hover .dpick, .dtile:focus-within .dpick { opacity: 1; }
|
|
71
|
+
@media (hover: none) { .dpick { opacity: 1; } }
|
|
72
|
+
|
|
73
|
+
/* The chosen design: the selection's ring and filled check, as on the inspiration tiles. */
|
|
74
|
+
.dtile.chosen .dface { box-shadow: 0 0 0 3px var(--ring); }
|
|
75
|
+
.dchosen { position: absolute; left: 10px; top: 10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-solid); color: var(--inverse-text); pointer-events: none; box-shadow: 0 0 0 2px var(--bg); }
|
|
76
|
+
.dchosen.inline { position: static; flex: none; width: 22px; height: 22px; box-shadow: none; }
|
|
77
|
+
|
|
78
|
+
/* Icon actions. */
|
|
79
|
+
button.ia { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text2); }
|
|
80
|
+
button.ia:hover:not(:disabled) { background: var(--fill); color: var(--text); }
|
|
81
|
+
button.ia.choose[aria-pressed="true"], button.ia.choose[aria-pressed="true"]:hover { background: var(--accent-solid); color: var(--inverse-text); }
|
|
82
|
+
button.ia.big { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
|
|
83
|
+
button.ia.big:hover:not(:disabled) { background: var(--fill); }
|
|
84
|
+
button.ia.big.choose[aria-pressed="true"] { border-color: var(--accent-solid); }
|
|
85
|
+
button.ia.big.wide { display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 0 16px; font-size: var(--fs-sm); font-weight: 600; }
|
|
86
|
+
button.ia.big.wide.primary, button.ia.big.wide.primary:hover:not(:disabled) { background: var(--inverse); color: var(--inverse-text); border-color: var(--inverse); }
|
|
87
|
+
button.ia.big.wide.primary:hover:not(:disabled) { opacity: .88; }
|
|
88
|
+
button.ia.go { background: var(--inverse); color: var(--inverse-text); border-radius: 999px; width: 34px; height: 34px; }
|
|
89
|
+
button.ia.go:hover:not(:disabled) { background: var(--inverse); color: var(--inverse-text); opacity: .85; }
|
|
90
|
+
|
|
91
|
+
/* The large view. */
|
|
92
|
+
.lv { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
|
|
93
|
+
#stage .lv { position: fixed; inset: 0; z-index: 15; padding: 12px 16px 14px; background: var(--bg); }
|
|
94
|
+
.lvbar { display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 36px; }
|
|
95
|
+
.lvbar .dtag { flex: 0 1 auto; }
|
|
96
|
+
.lvcount { flex: none; min-width: 52px; text-align: center; font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
|
|
97
|
+
.lvport { position: relative; min-width: 0; overflow: hidden; border-radius: 12px; background: var(--fill); touch-action: none; cursor: grab; user-select: none; }
|
|
98
|
+
#stage .lvport { flex: 1 1 auto; min-height: 0; }
|
|
99
|
+
#viewer .lvport { width: 100%; aspect-ratio: var(--ar, 1.5); }
|
|
100
|
+
.lvport.grabbing { cursor: grabbing; }
|
|
101
|
+
.lvport.drawing { cursor: crosshair; }
|
|
102
|
+
.lvport.busy { opacity: .6; }
|
|
103
|
+
.lvstage { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: var(--elev-lg); }
|
|
104
|
+
.lvimg { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
|
|
105
|
+
.lvimg:not([src]) { visibility: hidden; }
|
|
106
|
+
.lvzoom { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); box-shadow: var(--elev); }
|
|
107
|
+
.lvlevel { min-width: 58px; padding: 4px 6px; border: 0; background: transparent; font-size: 12px; font-variant-numeric: tabular-nums; }
|
|
108
|
+
.lvfoot { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
|
|
109
|
+
.alert { margin: 0; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
|
|
110
|
+
.lvfoot .alert:empty { display: none; }
|
|
111
|
+
.lvacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
|
|
112
|
+
.lvform { display: flex; align-items: center; gap: 4px; width: min(720px, 100%); padding: 4px 4px 4px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); }
|
|
113
|
+
.lvform:focus-within { border-color: var(--ring); }
|
|
114
|
+
.lvmode { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-solid); color: var(--inverse-text); }
|
|
115
|
+
input.lvinput { flex: 1 1 auto; min-width: 0; padding: 8px 6px; border: 0; background: transparent; color: var(--text); font: inherit; }
|
|
116
|
+
input.lvinput:focus-visible { outline: none; }
|
|
117
|
+
@media (prefers-reduced-motion: reduce) { .dot.run { animation: none; } button.dface { transition: none; } .dpick { transition: none; } .spin { animation-duration: 2.4s; } }
|
|
118
|
+
/* The scribble layer of the large view's edit lies exactly over the picture. */
|
|
119
|
+
.scribble { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
|
|
120
|
+
`;
|
|
121
|
+
//# sourceMappingURL=mcp-slate-ui-styles-designs.js.map
|