@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
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The three dialogs of the workspace: Edit (a drawing over the image, an
|
|
3
|
-
* optional instruction, or both), Branch (an optional description of what to
|
|
4
|
-
* build) and Convert (which format, with only the options that format has).
|
|
5
|
-
* Each is opened by its button, confirmed by one verb (Apply, Send, Send) and
|
|
6
|
-
* closed by Cancel or Escape; Select has no dialog, and Generate more is a
|
|
7
|
-
* panel, not a dialog (mcp-slate-ui-script-more.ts).
|
|
8
|
-
*
|
|
9
|
-
* Common rules: a title, fields, one line that says what will happen, an error
|
|
10
|
-
* line (role alert, empty by default), then Cancel and the primary. The
|
|
11
|
-
* primary keeps its label and disables while a call is in flight; on success
|
|
12
|
-
* the dialog closes at once. One id is minted when the dialog opens (the op id
|
|
13
|
-
* of Edit, the hand-off id of Branch and Convert), so a double click sends one
|
|
14
|
-
* request.
|
|
15
|
-
*
|
|
16
|
-
* Edit starts work through the run tool, which returns as soon as the work is
|
|
17
|
-
* committed; Branch and Convert hand off to the agent through sendHandoff.
|
|
18
|
-
* Nothing here shows or asks for money.
|
|
19
|
-
*/
|
|
20
|
-
export const SLATE_UI_DIALOG = String.raw `
|
|
21
|
-
// Catalogue keys: the dialog's title is its button's verb, and its primary says what confirming does.
|
|
22
|
-
var DIALOG_TITLES = { edit: "edit", branch: "branch", convert: "convert" };
|
|
23
|
-
var DIALOG_VERBS = { edit: "apply", branch: "send", convert: "send" };
|
|
24
|
-
|
|
25
|
-
function field(labelText, control, id) {
|
|
26
|
-
var wrap = el("div", "field");
|
|
27
|
-
var label = el("label", "lbl", labelText);
|
|
28
|
-
if (id) label.setAttribute("for", id);
|
|
29
|
-
wrap.appendChild(label);
|
|
30
|
-
wrap.appendChild(control);
|
|
31
|
-
return wrap;
|
|
32
|
-
}
|
|
33
|
-
function group(labelText, control) {
|
|
34
|
-
var wrap = el("div", "field");
|
|
35
|
-
wrap.appendChild(el("span", "lbl", labelText));
|
|
36
|
-
wrap.appendChild(control);
|
|
37
|
-
return wrap;
|
|
38
|
-
}
|
|
39
|
-
// One muted line under a control: what it does, or what will happen.
|
|
40
|
-
function helpLine(text) { return el("p", "help", text); }
|
|
41
|
-
function textarea(id, rows, placeholder, max, onInput, ariaLabel) {
|
|
42
|
-
var area = el("textarea");
|
|
43
|
-
area.id = id;
|
|
44
|
-
area.setAttribute("rows", String(rows));
|
|
45
|
-
area.placeholder = placeholder;
|
|
46
|
-
area.setAttribute("aria-label", ariaLabel);
|
|
47
|
-
area.setAttribute("maxlength", String(max));
|
|
48
|
-
area.addEventListener("input", function () { onInput(area.value); updateDialogUi(); });
|
|
49
|
-
return area;
|
|
50
|
-
}
|
|
51
|
-
function radioRow(name, options, current, onChange) {
|
|
52
|
-
var row = el("div", "radios");
|
|
53
|
-
row.setAttribute("role", "radiogroup");
|
|
54
|
-
options.forEach(function (opt) {
|
|
55
|
-
var label = el("label", "radio");
|
|
56
|
-
var input = el("input");
|
|
57
|
-
input.type = "radio";
|
|
58
|
-
input.name = name;
|
|
59
|
-
input.value = String(opt.value);
|
|
60
|
-
input.checked = opt.value === current;
|
|
61
|
-
if (opt.disabled) input.disabled = true;
|
|
62
|
-
input.addEventListener("change", function () { onChange(opt.value); updateDialogUi(); });
|
|
63
|
-
label.appendChild(input);
|
|
64
|
-
label.appendChild(el("span", "", opt.label));
|
|
65
|
-
row.appendChild(label);
|
|
66
|
-
});
|
|
67
|
-
return row;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// ---- the edit instruction, counted as the servers count it: UTF-8 bytes of the words, control characters stripped ----
|
|
71
|
-
var EDIT_PROMPT_MAX_BYTES = __EDIT_PROMPT_MAX_BYTES__;
|
|
72
|
-
function editWords(text) { return String(text || "").replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, "").trim(); }
|
|
73
|
-
function utf8Bytes(text) {
|
|
74
|
-
var n = 0;
|
|
75
|
-
for (var i = 0; i < text.length; i++) {
|
|
76
|
-
var c = text.charCodeAt(i);
|
|
77
|
-
if (c < 0x80) n += 1;
|
|
78
|
-
else if (c < 0x800) n += 2;
|
|
79
|
-
else if (c >= 0xd800 && c <= 0xdbff && i + 1 < text.length && text.charCodeAt(i + 1) >= 0xdc00 && text.charCodeAt(i + 1) <= 0xdfff) { n += 4; i++; }
|
|
80
|
-
else n += 3;
|
|
81
|
-
}
|
|
82
|
-
return n;
|
|
83
|
-
}
|
|
84
|
-
// How many characters must go from the end of the instruction for it to fit; 0 when it fits.
|
|
85
|
-
function editOverBy(text) {
|
|
86
|
-
var words = editWords(text);
|
|
87
|
-
var over = utf8Bytes(words) - EDIT_PROMPT_MAX_BYTES;
|
|
88
|
-
if (over <= 0) return 0;
|
|
89
|
-
var chars = Array.from(words);
|
|
90
|
-
var cut = 0;
|
|
91
|
-
while (over > 0 && chars.length > 0) { over -= utf8Bytes(chars.pop()); cut++; }
|
|
92
|
-
return cut;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// ---- what this Mac can do now ----
|
|
96
|
-
function localImage() { return (state.view && state.view.local && state.view.local.image) || { ready: false, reason: null }; }
|
|
97
|
-
// Why this Mac cannot draw, in the person's language when the server named it by code.
|
|
98
|
-
function localReason() { var local = localImage(); return serverText(local.reasonL10n, local.reason); }
|
|
99
|
-
|
|
100
|
-
// ---- open and close ----
|
|
101
|
-
function openDialog(kind, opener) {
|
|
102
|
-
if (state.dialog || !state.view) return;
|
|
103
|
-
var v = selectedVersion();
|
|
104
|
-
if (!v) return;
|
|
105
|
-
if (kind === "edit" && !v.editable) return;
|
|
106
|
-
state.dialog = {
|
|
107
|
-
kind: kind, id: uuid4(), versionId: v.versionId, opener: opener,
|
|
108
|
-
prompt: "", explanation: "",
|
|
109
|
-
format: CONVERT.choices[0].value, quality: "standard", width: "", layouts: "standard",
|
|
110
|
-
strokes: [], current: null, committing: false, error: "", els: {}
|
|
111
|
-
};
|
|
112
|
-
mountDialog();
|
|
113
|
-
}
|
|
114
|
-
function closeDialog() {
|
|
115
|
-
var d = state.dialog;
|
|
116
|
-
if (!d) return;
|
|
117
|
-
state.dialog = null;
|
|
118
|
-
stageEls.dialog.textContent = "";
|
|
119
|
-
if (d.opener && d.opener.isConnected !== false && d.opener.focus) d.opener.focus();
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// ---- what each dialog would send ----
|
|
123
|
-
// The instruction is optional when the edit carries marks: a drawing alone is sent with no words and the server infers them.
|
|
124
|
-
function editAction(d) {
|
|
125
|
-
var action = { kind: "edit", versionId: d.versionId };
|
|
126
|
-
var words = d.prompt.trim();
|
|
127
|
-
if (words) action.prompt = words;
|
|
128
|
-
if (d.strokes.length > 0) action.strokes = d.strokes.map(function (s) { return s.map(function (p) { return [p[0], p[1]]; }); });
|
|
129
|
-
return action;
|
|
130
|
-
}
|
|
131
|
-
// The hosted server takes the marked image from the screen (there is no server-side compositing), so an edit with
|
|
132
|
-
// strokes carries it; the local server draws its own from the strokes.
|
|
133
|
-
function editActionFor(d, version) {
|
|
134
|
-
var action = editAction(d);
|
|
135
|
-
if (TARGET !== "remote" || d.strokes.length === 0) return Promise.resolve(action);
|
|
136
|
-
return compositeMarked(version, d.strokes).then(function (marked) {
|
|
137
|
-
action.annotated = marked;
|
|
138
|
-
return action;
|
|
139
|
-
}, function (err) { throw new Error(t("markFailed", { detail: errText(err) })); });
|
|
140
|
-
}
|
|
141
|
-
function convertChoice(d) { return CONVERT.choices.filter(function (c) { return c.value === d.format; })[0]; }
|
|
142
|
-
// An empty width is fine (the service picks); anything else must be a whole number the CLI accepts.
|
|
143
|
-
function widthOf(d) {
|
|
144
|
-
var t = d.width.trim();
|
|
145
|
-
if (!t) return { ok: true, value: null };
|
|
146
|
-
var n = Number(t);
|
|
147
|
-
var ok = /^[0-9]+$/.test(t) && n >= 1 && n <= CONVERT.maxWidth;
|
|
148
|
-
return { ok: ok, value: ok ? n : null };
|
|
149
|
-
}
|
|
150
|
-
function convertOptions(d) {
|
|
151
|
-
var choice = convertChoice(d);
|
|
152
|
-
// The hosted server has one engine and two outputs; nothing else is a choice.
|
|
153
|
-
if (TARGET === "remote") return { engine: "local", output: choice.output };
|
|
154
|
-
if (choice.engine === "local") return { engine: "local", output: choice.output };
|
|
155
|
-
var options = { engine: "service", output: choice.output, model: d.quality };
|
|
156
|
-
var width = widthOf(d);
|
|
157
|
-
if (width.value !== null) options.width = width.value;
|
|
158
|
-
if (choice.output === "html") options.responsiveQuality = d.layouts;
|
|
159
|
-
return options;
|
|
160
|
-
}
|
|
161
|
-
function dialogReady(d) {
|
|
162
|
-
var v = ver(d.versionId);
|
|
163
|
-
// An edit needs a drawing, words or both; Branch has no required field.
|
|
164
|
-
if (d.kind === "edit") return localImage().ready && !!v && v.editable && (d.strokes.length > 0 || !!d.prompt.trim()) && editOverBy(d.prompt) === 0;
|
|
165
|
-
if (d.kind === "branch") return true;
|
|
166
|
-
return !!convertChoice(d) && widthOf(d).ok;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// ---- send ----
|
|
170
|
-
function runAction(action, opId) {
|
|
171
|
-
return callTool(TOOLS.run, { runDir: state.view.runDir, opId: opId, action: action }).then(function (result) {
|
|
172
|
-
var sc = result.structuredContent || {};
|
|
173
|
-
if (sc.view) applyView(sc.view, true);
|
|
174
|
-
// The hosted server draws nothing: the workspace runner on the person's Mac does, or else the person's agent,
|
|
175
|
-
// which is told here (best effort, like Select) only when no runner holds the workspace.
|
|
176
|
-
if (TARGET === "remote") remoteAfterRun(action, opId, sc.runner);
|
|
177
|
-
return sc;
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
function commitDialog() {
|
|
181
|
-
var d = state.dialog;
|
|
182
|
-
if (!d || d.committing || !dialogReady(d)) return;
|
|
183
|
-
d.committing = true;
|
|
184
|
-
d.error = "";
|
|
185
|
-
updateDialogUi();
|
|
186
|
-
var version = ver(d.versionId);
|
|
187
|
-
var work;
|
|
188
|
-
if (d.kind === "branch") work = sendHandoff("branch", version, d.id, { explanation: d.explanation.trim() });
|
|
189
|
-
else if (d.kind === "convert") work = sendHandoff("convert", version, d.id, convertOptions(d));
|
|
190
|
-
else {
|
|
191
|
-
var edited = cand(version.candidateId);
|
|
192
|
-
work = editActionFor(d, version).then(function (action) { return runAction(action, d.id); }).then(function () {
|
|
193
|
-
// The new version is shown the moment it lands.
|
|
194
|
-
state.awaitEdit = { candidateId: version.candidateId, count: edited ? edited.versionIds.length : 0 };
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
work.then(function () {
|
|
198
|
-
closeDialog();
|
|
199
|
-
}, function (err) {
|
|
200
|
-
if (state.dialog !== d) return;
|
|
201
|
-
d.committing = false;
|
|
202
|
-
d.error = errText(err);
|
|
203
|
-
updateDialogUi();
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// ---- the dialog's elements ----
|
|
208
|
-
function editBody(d, box) {
|
|
209
|
-
var v = ver(d.versionId);
|
|
210
|
-
var wrap = el("div", "imgwrap");
|
|
211
|
-
wrap.style.setProperty("--ar", String(v.width / v.height));
|
|
212
|
-
var img = el("img", "stageimg empty");
|
|
213
|
-
img.alt = t("versionName", { label: v.label });
|
|
214
|
-
img.setAttribute("draggable", "false");
|
|
215
|
-
wrap.appendChild(img);
|
|
216
|
-
bindImage(img, v, "full", true);
|
|
217
|
-
var cached = state.thumbs[imageKey(v, "thumb")];
|
|
218
|
-
if (cached) img.src = cached;
|
|
219
|
-
scribbleAttach(wrap, d);
|
|
220
|
-
box.appendChild(wrap);
|
|
221
|
-
// Under the image: the hint that it can be drawn on, and the two drawing controls.
|
|
222
|
-
var tools = el("div", "dialogtools");
|
|
223
|
-
tools.appendChild(el("p", "hint", t("scribbleHint")));
|
|
224
|
-
d.els.undo = button(t("undo"), "", function () { scribbleUndo(d); });
|
|
225
|
-
d.els.clear = button(t("clear"), "", function () { scribbleClear(d); });
|
|
226
|
-
tools.appendChild(d.els.undo);
|
|
227
|
-
tools.appendChild(d.els.clear);
|
|
228
|
-
box.appendChild(tools);
|
|
229
|
-
box.appendChild(textarea("dialogedit", 3, t("editPlaceholder"), 6000, function (value) { d.prompt = value; }, t("editAria")));
|
|
230
|
-
d.els.help = helpLine("");
|
|
231
|
-
box.appendChild(d.els.help);
|
|
232
|
-
}
|
|
233
|
-
function branchBody(d, box) {
|
|
234
|
-
box.appendChild(textarea("dialogbranch", 4, t("branchPlaceholder"), 2000, function (value) { d.explanation = value; }, t("branchAria")));
|
|
235
|
-
box.appendChild(helpLine(t("branchHelp")));
|
|
236
|
-
}
|
|
237
|
-
function convertBody(d, box) {
|
|
238
|
-
var select = el("select");
|
|
239
|
-
select.id = "dialogformat";
|
|
240
|
-
var service = el("optgroup");
|
|
241
|
-
service.setAttribute("label", t("serviceGroup"));
|
|
242
|
-
CONVERT.choices.forEach(function (choice) {
|
|
243
|
-
var option = el("option", "", choice.labelKey ? t(choice.labelKey) : choice.label);
|
|
244
|
-
option.setAttribute("value", choice.value);
|
|
245
|
-
if (choice.value === d.format) option.setAttribute("selected", "");
|
|
246
|
-
(choice.engine === "local" ? select : service).appendChild(option);
|
|
247
|
-
});
|
|
248
|
-
if (service.childNodes.length > 0) select.appendChild(service);
|
|
249
|
-
select.addEventListener("change", function () { d.format = select.value; updateDialogUi(); });
|
|
250
|
-
box.appendChild(field(t("convertLabel"), select, "dialogformat"));
|
|
251
|
-
// One line that follows the choice: what the person gets.
|
|
252
|
-
d.els.formatHelp = helpLine("");
|
|
253
|
-
box.appendChild(d.els.formatHelp);
|
|
254
|
-
// The hosted server builds from the image and has nothing else to ask: no quality, width or layouts.
|
|
255
|
-
if (TARGET === "remote") return;
|
|
256
|
-
// Only the options the chosen format has are shown; the rest are hidden, not disabled. Each says what it does in one line.
|
|
257
|
-
d.els.quality = group(t("qualityLabel"), radioRow("quality", [{ value: "fast", label: t("fast") }, { value: "standard", label: t("standard") }, { value: "pro", label: t("pro") }], d.quality, function (value) { d.quality = value; }));
|
|
258
|
-
d.els.quality.appendChild(helpLine(t("qualityHelp")));
|
|
259
|
-
var width = el("input");
|
|
260
|
-
width.type = "number";
|
|
261
|
-
width.id = "dialogwidth";
|
|
262
|
-
width.setAttribute("min", "1");
|
|
263
|
-
width.setAttribute("max", String(CONVERT.maxWidth));
|
|
264
|
-
width.setAttribute("placeholder", t("widthPlaceholder"));
|
|
265
|
-
width.setAttribute("inputmode", "numeric");
|
|
266
|
-
width.addEventListener("input", function () { d.width = width.value; updateDialogUi(); });
|
|
267
|
-
d.els.width = field(t("widthLabel"), width, "dialogwidth");
|
|
268
|
-
d.els.width.appendChild(helpLine(t("widthHelp")));
|
|
269
|
-
d.els.layouts = group(t("layoutsLabel"), radioRow("layouts", [{ value: "standard", label: t("standard") }, { value: "pro", label: t("pro") }], d.layouts, function (value) { d.layouts = value; }));
|
|
270
|
-
d.els.layouts.appendChild(helpLine(t("layoutsHelp")));
|
|
271
|
-
[d.els.quality, d.els.width, d.els.layouts].forEach(function (node) { box.appendChild(node); });
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
function mountDialog() {
|
|
275
|
-
var d = state.dialog;
|
|
276
|
-
var host = stageEls.dialog;
|
|
277
|
-
host.textContent = "";
|
|
278
|
-
var backdrop = el("div", "modal");
|
|
279
|
-
backdrop.addEventListener("click", function (e) { if (e.target === backdrop && !d.committing) closeDialog(); });
|
|
280
|
-
var box = el("div", "modalbox" + (d.kind === "edit" ? " wide" : ""));
|
|
281
|
-
box.setAttribute("role", "dialog");
|
|
282
|
-
box.setAttribute("aria-modal", "true");
|
|
283
|
-
box.setAttribute("aria-label", t(DIALOG_TITLES[d.kind]));
|
|
284
|
-
box.appendChild(el("h2", "", t(DIALOG_TITLES[d.kind])));
|
|
285
|
-
if (d.kind === "edit") editBody(d, box);
|
|
286
|
-
else if (d.kind === "branch") branchBody(d, box);
|
|
287
|
-
else convertBody(d, box);
|
|
288
|
-
d.els.alert = el("p", "alert");
|
|
289
|
-
d.els.alert.setAttribute("role", "alert");
|
|
290
|
-
box.appendChild(d.els.alert);
|
|
291
|
-
var buttons = el("div", "dialogbtns");
|
|
292
|
-
buttons.appendChild(el("span", "spacer"));
|
|
293
|
-
buttons.appendChild(button(t("cancel"), "", closeDialog));
|
|
294
|
-
d.els.primary = button(t(DIALOG_VERBS[d.kind]), "primary", commitDialog);
|
|
295
|
-
buttons.appendChild(d.els.primary);
|
|
296
|
-
box.appendChild(buttons);
|
|
297
|
-
backdrop.appendChild(box);
|
|
298
|
-
host.appendChild(backdrop);
|
|
299
|
-
d.els.box = box;
|
|
300
|
-
updateDialogUi();
|
|
301
|
-
var first = box.querySelector("textarea") || box.querySelector("select") || box.querySelector("input:checked") || d.els.primary;
|
|
302
|
-
if (first && first.focus) first.focus();
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
function updateDialogUi() {
|
|
306
|
-
var d = state.dialog;
|
|
307
|
-
if (!d || !d.els.primary) return;
|
|
308
|
-
d.els.primary.disabled = d.committing || !dialogReady(d);
|
|
309
|
-
// A dialog that cannot run on this Mac says why, in the same line an error would use.
|
|
310
|
-
var local = localImage();
|
|
311
|
-
var blockedByLocal = d.kind === "edit" && !local.ready;
|
|
312
|
-
var tooLong = d.kind === "edit" ? editOverBy(d.prompt) : 0;
|
|
313
|
-
d.els.alert.textContent = d.error || (blockedByLocal ? localReason() : "") || (tooLong > 0 ? t("editTooLong", { n: tooLong }) : "");
|
|
314
|
-
d.els.alert.classList.toggle("hidden", !d.els.alert.textContent);
|
|
315
|
-
if (d.els.undo) d.els.undo.disabled = d.strokes.length === 0 || d.committing;
|
|
316
|
-
if (d.els.clear) d.els.clear.disabled = d.strokes.length === 0 || d.committing;
|
|
317
|
-
if (d.els.help) {
|
|
318
|
-
var marksOnly = d.strokes.length > 0 && !d.prompt.trim();
|
|
319
|
-
d.els.help.textContent = marksOnly ? t("editHelpMarks") : t("editHelp", { label: (ver(d.versionId) || {}).label || "" });
|
|
320
|
-
}
|
|
321
|
-
if (d.kind === "convert") {
|
|
322
|
-
var choice = convertChoice(d);
|
|
323
|
-
d.els.formatHelp.textContent = choice && CONVERT.descriptionKeys[choice.value] ? t(CONVERT.descriptionKeys[choice.value]) : "";
|
|
324
|
-
}
|
|
325
|
-
if (d.kind === "convert" && TARGET !== "remote") {
|
|
326
|
-
var isLocal = !!choice && choice.engine === "local";
|
|
327
|
-
d.els.quality.classList.toggle("hidden", isLocal);
|
|
328
|
-
d.els.width.classList.toggle("hidden", isLocal);
|
|
329
|
-
d.els.layouts.classList.toggle("hidden", isLocal || choice.output !== "html");
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
// Escape closes; Tab stays inside the dialog.
|
|
334
|
-
document.addEventListener("keydown", function (e) {
|
|
335
|
-
var d = state.dialog;
|
|
336
|
-
if (!d) return;
|
|
337
|
-
if (e.key === "Escape" && !d.committing) { closeDialog(); return; }
|
|
338
|
-
if (e.key !== "Tab" || !d.els.box) return;
|
|
339
|
-
var items = Array.prototype.filter.call(d.els.box.querySelectorAll("button, textarea, input, select"), function (n) {
|
|
340
|
-
if (n.disabled) return false;
|
|
341
|
-
for (var node = n; node && node.classList; node = node.parentElement) if (node.classList.contains("hidden")) return false;
|
|
342
|
-
return true;
|
|
343
|
-
});
|
|
344
|
-
if (items.length === 0) return;
|
|
345
|
-
var first = items[0];
|
|
346
|
-
var last = items[items.length - 1];
|
|
347
|
-
if (e.shiftKey && document.activeElement === first) { last.focus(); if (e.preventDefault) e.preventDefault(); }
|
|
348
|
-
else if (!e.shiftKey && document.activeElement === last) { first.focus(); if (e.preventDefault) e.preventDefault(); }
|
|
349
|
-
});
|
|
350
|
-
`;
|
|
351
|
-
//# sourceMappingURL=mcp-slate-ui-script-dialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script-dialog.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-dialog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0UxC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The hairline that sits under the large image while work runs on its option.
|
|
3
|
-
* There is no measured duration, so it never estimates: it is indeterminate,
|
|
4
|
-
* and the words (the band, the status line) carry what is happening.
|
|
5
|
-
*/
|
|
6
|
-
export declare const SLATE_UI_PROGRESS: string;
|
|
7
|
-
//# sourceMappingURL=mcp-slate-ui-script-progress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script-progress.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAE7B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The hairline that sits under the large image while work runs on its option.
|
|
3
|
-
* There is no measured duration, so it never estimates: it is indeterminate,
|
|
4
|
-
* and the words (the band, the status line) carry what is happening.
|
|
5
|
-
*/
|
|
6
|
-
export const SLATE_UI_PROGRESS = String.raw `
|
|
7
|
-
function progressBar() { return el("span", "hair indeterminate"); }
|
|
8
|
-
`;
|
|
9
|
-
//# sourceMappingURL=mcp-slate-ui-script-progress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script-progress.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE1C,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The dialogs (Edit, Branch, Convert), the scribble layer of Edit and, at the
|
|
3
|
-
* end, the Inspiration tab (mcp-slate-ui-styles-inspiration.ts). A dialog is a
|
|
4
|
-
* centred box over a dimmed workspace; it scrolls inside itself when the window
|
|
5
|
-
* is short, and fills the width on a phone.
|
|
6
|
-
*/
|
|
7
|
-
export declare const SLATE_UI_DIALOG_STYLES: string;
|
|
8
|
-
/**
|
|
9
|
-
* The Generate more tile and its panel. The tile is quiet but findable: a
|
|
10
|
-
* dashed border in the secondary text colour, a plus and the words "Generate
|
|
11
|
-
* more", no fill. In the card's strip it is one more tile of the thumbnails' grid, as wide as a column and with the
|
|
12
|
-
* newest round's ratio; in the workspace it is a slim bar on top of the selection (mcp-slate-ui-styles-stage.ts).
|
|
13
|
-
* The panel is one bordered block under the tile:
|
|
14
|
-
* heading, one helper line, the "Based on" switch, the selected inspiration as
|
|
15
|
-
* small chips, a note, the count and the two buttons. In the card, the script
|
|
16
|
-
* shortens the large image by the panel's height while it is open (an inline
|
|
17
|
-
* --cap), or folds it when too little would be left.
|
|
18
|
-
*/
|
|
19
|
-
export declare const SLATE_UI_MORE_STYLES: string;
|
|
20
|
-
//# sourceMappingURL=mcp-slate-ui-styles-dialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-styles-dialog.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-styles-dialog.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAqBJ,CAAC;AAEhC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,QA6ChC,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { SLATE_UI_INSPIRATION_STYLES } from './mcp-slate-ui-styles-inspiration.js';
|
|
2
|
-
/**
|
|
3
|
-
* The dialogs (Edit, Branch, Convert), the scribble layer of Edit and, at the
|
|
4
|
-
* end, the Inspiration tab (mcp-slate-ui-styles-inspiration.ts). A dialog is a
|
|
5
|
-
* centred box over a dimmed workspace; it scrolls inside itself when the window
|
|
6
|
-
* is short, and fills the width on a phone.
|
|
7
|
-
*/
|
|
8
|
-
export const SLATE_UI_DIALOG_STYLES = String.raw `
|
|
9
|
-
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .45); overflow: auto; }
|
|
10
|
-
.modalbox { display: flex; flex-direction: column; gap: 12px; width: min(520px, 100%); max-height: calc(100vh - 32px); min-width: 0; padding: 16px; overflow: auto; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--bg); color: var(--text); }
|
|
11
|
-
.modalbox.wide { width: min(880px, 100%); }
|
|
12
|
-
.modalbox h2 { margin: 0; font-size: 15px; }
|
|
13
|
-
.modalbox textarea { width: 100%; min-width: 0; padding: 8px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); resize: vertical; }
|
|
14
|
-
.modalbox textarea:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
|
|
15
|
-
.radios { display: flex; flex-wrap: wrap; gap: 6px 14px; }
|
|
16
|
-
.radio { display: inline-flex; align-items: center; gap: 6px; }
|
|
17
|
-
/* One muted line: what a control does, or what will happen. */
|
|
18
|
-
.help { margin: 0; font-size: 12px; color: var(--text2); overflow-wrap: anywhere; }
|
|
19
|
-
.field > .help { margin-top: 4px; }
|
|
20
|
-
.hint { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 12px; color: var(--text2); }
|
|
21
|
-
.alert { margin: 0; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
|
|
22
|
-
.dialogbtns, .dialogtools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
23
|
-
.dialogbtns button, .dialogtools button { padding: 8px 12px; }
|
|
24
|
-
.dialogtools .hint { margin-right: auto; }
|
|
25
|
-
/* The image of Edit, sized to the picture itself (a height cap of 60 percent of the window), so the scribble layer over it is exactly over the picture. */
|
|
26
|
-
.imgwrap { position: relative; width: min(100%, calc(60vh * var(--ar, 1.5))); aspect-ratio: var(--ar, 1.5); margin: 0 auto; min-width: 0; border-radius: var(--radius); background: var(--bg3); overflow: hidden; touch-action: none; }
|
|
27
|
-
.stageimg { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; }
|
|
28
|
-
.scribble { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
|
|
29
|
-
${SLATE_UI_INSPIRATION_STYLES}`;
|
|
30
|
-
/**
|
|
31
|
-
* The Generate more tile and its panel. The tile is quiet but findable: a
|
|
32
|
-
* dashed border in the secondary text colour, a plus and the words "Generate
|
|
33
|
-
* more", no fill. In the card's strip it is one more tile of the thumbnails' grid, as wide as a column and with the
|
|
34
|
-
* newest round's ratio; in the workspace it is a slim bar on top of the selection (mcp-slate-ui-styles-stage.ts).
|
|
35
|
-
* The panel is one bordered block under the tile:
|
|
36
|
-
* heading, one helper line, the "Based on" switch, the selected inspiration as
|
|
37
|
-
* small chips, a note, the count and the two buttons. In the card, the script
|
|
38
|
-
* shortens the large image by the panel's height while it is open (an inline
|
|
39
|
-
* --cap), or folds it when too little would be left.
|
|
40
|
-
*/
|
|
41
|
-
export const SLATE_UI_MORE_STYLES = String.raw `
|
|
42
|
-
button.moretile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none; padding: 0; border: 1px dashed var(--text2); border-radius: 6px; background: none; color: var(--text2); font-size: 12px; font-weight: 500; line-height: 1.2; }
|
|
43
|
-
button.moretile:hover:not(:disabled), button.moretile[aria-expanded="true"] { color: var(--text); border-color: var(--text); }
|
|
44
|
-
button.moretile:disabled { opacity: .35; }
|
|
45
|
-
.strip .moretile { width: 100%; aspect-ratio: var(--ar, 1.5); align-self: start; }
|
|
46
|
-
.morepanel { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
|
|
47
|
-
#more:not(:empty) { padding-top: 10px; }
|
|
48
|
-
#card .hero.folded { display: none; }
|
|
49
|
-
.morehead { margin: 0; font-size: 13px; font-weight: 600; }
|
|
50
|
-
/* The switch drops under its words when the panel is too narrow for both (the workspace's 168 px column), so no word of
|
|
51
|
-
"Based on A" breaks mid-word. */
|
|
52
|
-
.moreswitch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; cursor: pointer; }
|
|
53
|
-
.morethumb { display: block; flex: none; width: 40px; height: 40px; border-radius: 4px; background: var(--bg3); object-fit: contain; object-position: center; }
|
|
54
|
-
.moreswitchtext { flex: 1 1 6em; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
|
|
55
|
-
.moreswitch input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 36px; height: 20px; margin: 0 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: var(--bg3); cursor: pointer; }
|
|
56
|
-
.moreswitch input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text2); transition: transform .12s; }
|
|
57
|
-
.moreswitch input[type="checkbox"]:checked { background: var(--inverse); border-color: var(--inverse); }
|
|
58
|
-
.moreswitch input[type="checkbox"]:checked::after { transform: translateX(16px); background: var(--inverse-text); }
|
|
59
|
-
.moreswitch input[type="checkbox"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
60
|
-
.moreswitch input[type="checkbox"]:disabled { opacity: .45; cursor: default; }
|
|
61
|
-
.morechips { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
|
|
62
|
-
.morechips .lbl { margin: 0; }
|
|
63
|
-
.refchips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
|
|
64
|
-
.refchip { position: relative; flex: none; width: 48px; height: 48px; }
|
|
65
|
-
.refchipimg { display: block; width: 100%; height: 100%; border-radius: 4px; background: var(--bg3); object-fit: contain; object-position: center; }
|
|
66
|
-
button.refchipx { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 50%; background: var(--inverse); color: var(--inverse-text); border-color: var(--bg); }
|
|
67
|
-
/* The field is as tall as its placeholder needs at this width (a hidden twin of the words sets the row's height, in the
|
|
68
|
-
textarea's own font and padding), so a narrow column never cuts the placeholder off. */
|
|
69
|
-
.notewrap { display: grid; min-width: 0; }
|
|
70
|
-
.notewrap::after { content: attr(data-placeholder) "\200b"; grid-area: 1 / 1; visibility: hidden; padding: 9px 11px; font: inherit; white-space: pre-wrap; overflow-wrap: break-word; pointer-events: none; }
|
|
71
|
-
.notewrap textarea { grid-area: 1 / 1; }
|
|
72
|
-
.morepanel textarea { width: 100%; min-width: 0; padding: 8px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); resize: vertical; }
|
|
73
|
-
.morepanel textarea:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
|
|
74
|
-
.morerow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
|
|
75
|
-
.morebtns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; margin-left: auto; }
|
|
76
|
-
.morerow button { min-width: 0; max-width: 100%; padding: 8px 10px; overflow-wrap: anywhere; }
|
|
77
|
-
.seg { display: flex; flex: 1 1 auto; min-width: 0; max-width: 260px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
|
|
78
|
-
.morehost .seg { max-width: none; flex-basis: 100%; }
|
|
79
|
-
.segopt { position: relative; display: block; flex: 1 1 0; min-width: 22px; }
|
|
80
|
-
.segopt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
|
|
81
|
-
.segopt span { display: block; padding: 7px 2px; text-align: center; font-weight: 600; }
|
|
82
|
-
.segopt input:checked + span { background: var(--inverse); color: var(--inverse-text); }
|
|
83
|
-
.segopt input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: -2px; }
|
|
84
|
-
.morepanel .alert { margin: 0; }
|
|
85
|
-
@media (prefers-reduced-motion: reduce) { .moreswitch input[type="checkbox"]::after { transition: none; } }
|
|
86
|
-
`;
|
|
87
|
-
//# sourceMappingURL=mcp-slate-ui-styles-dialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-styles-dialog.js","sourceRoot":"","sources":["../src/mcp-slate-ui-styles-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;EAqB9C,2BAA2B,EAAE,CAAC;AAEhC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C7C,CAAC"}
|