@12ui/design 0.2.79 → 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 +32 -1
- 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 +25 -1
- 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-script.d.ts +2 -1
- package/dist/slate-browser-host-script.d.ts.map +1 -1
- package/dist/slate-browser-host-script.js +4 -3
- package/dist/slate-browser-host-script.js.map +1 -1
- package/dist/slate-browser-host.d.ts +21 -2
- package/dist/slate-browser-host.d.ts.map +1 -1
- package/dist/slate-browser-host.js +38 -5
- package/dist/slate-browser-host.js.map +1 -1
- package/dist/slate-browser-server.d.ts +2 -2
- package/dist/slate-browser-server.d.ts.map +1 -1
- package/dist/slate-browser-server.js +13 -12
- 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 +8 -11
- package/skills/12ui-design/scene.md +3 -9
- 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,13 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The inline card:
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* ending with the Generate more tile; an icon-only control opens the
|
|
6
|
-
* workspace. There is no status line: an option being drawn shimmers, one
|
|
7
|
-
* that failed or stopped says why on its tile, and an error about a click
|
|
8
|
-
* shows beside Select. Also the view application, the large image and the
|
|
9
|
-
* thumbnail buttons shared with the workspace, and the tool-result entry
|
|
10
|
-
* point.
|
|
2
|
+
* The inline card: the tabs and an icon-only control that opens the workspace, then the Designs tab
|
|
3
|
+
* (mcp-slate-ui-script-designs.ts) or Inspiration. An error about a click shows in one line under the tab. Also the
|
|
4
|
+
* view application, the render switch between card and workspace, and the tool-result entry point.
|
|
11
5
|
*/
|
|
12
6
|
export const SLATE_UI_INLINE = String.raw `
|
|
13
7
|
// ---- apply a view: selection, announcements, polling, render ----
|
|
@@ -17,24 +11,14 @@ export const SLATE_UI_INLINE = String.raw `
|
|
|
17
11
|
var prev = state.view;
|
|
18
12
|
if (prev && prev.runDir !== view.runDir) {
|
|
19
13
|
state.sel = { candidateId: null, versionId: null, followLatest: true };
|
|
20
|
-
state.
|
|
21
|
-
resetMore();
|
|
14
|
+
state.lv = null;
|
|
22
15
|
state.insp.local = null;
|
|
23
|
-
state.awaitEdit = null;
|
|
24
16
|
pickRestored = null;
|
|
25
17
|
}
|
|
26
18
|
if (prev) announceSettled(prev, view);
|
|
27
19
|
else view.ops.forEach(function (op) { state.lastOpStates[op.opId] = op.state; });
|
|
28
20
|
if (!prev || prev.stamp !== view.stamp) poll.step = 0;
|
|
29
21
|
state.view = view;
|
|
30
|
-
// An edit that was just applied is shown the moment its version exists.
|
|
31
|
-
if (state.awaitEdit) {
|
|
32
|
-
var edited = cand(state.awaitEdit.candidateId);
|
|
33
|
-
if (edited && edited.versionIds.length > state.awaitEdit.count) {
|
|
34
|
-
state.sel = { candidateId: edited.candidateId, versionId: edited.latestVersionId, followLatest: true };
|
|
35
|
-
state.awaitEdit = null;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
22
|
syncStaleLine(view);
|
|
39
23
|
syncPause();
|
|
40
24
|
if (view.pick && pickRestored !== view.runDir) {
|
|
@@ -56,24 +40,22 @@ export const SLATE_UI_INLINE = String.raw `
|
|
|
56
40
|
$("app").classList.toggle("hidden", full);
|
|
57
41
|
$("stage").classList.toggle("hidden", !full);
|
|
58
42
|
if (full) renderStage(); else renderInline();
|
|
59
|
-
|
|
60
|
-
if (state.dialog) updateDialogUi();
|
|
61
|
-
syncMore();
|
|
43
|
+
syncBrief();
|
|
62
44
|
if (pause.opId) syncPauseBars();
|
|
63
45
|
reportSize();
|
|
64
46
|
}
|
|
65
47
|
|
|
66
|
-
// A new language: every container is built again in it on the next render
|
|
67
|
-
//
|
|
48
|
+
// A new language: every container is built again in it on the next render, because each was built in the old words;
|
|
49
|
+
// what the person typed in the prompt stays (state.brief).
|
|
68
50
|
function relocalizeView() {
|
|
69
|
-
if (state.
|
|
70
|
-
|
|
71
|
-
$("hero").__sig = null;
|
|
72
|
-
$("strip").__sig = null;
|
|
51
|
+
if (state.lv) state.lv.built = null;
|
|
52
|
+
$("designs").__sig = null;
|
|
73
53
|
$("pausebar").__pause = null;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
54
|
+
["pane-inspiration", "pane-references"].forEach(function (id) {
|
|
55
|
+
var pane = $(id);
|
|
56
|
+
pane.__built = false;
|
|
57
|
+
pane.textContent = "";
|
|
58
|
+
});
|
|
77
59
|
stageBuilt = false;
|
|
78
60
|
}
|
|
79
61
|
|
|
@@ -86,7 +68,6 @@ export const SLATE_UI_INLINE = String.raw `
|
|
|
86
68
|
return true;
|
|
87
69
|
}
|
|
88
70
|
|
|
89
|
-
// ---- the large image, shared by the card and the workspace ----
|
|
90
71
|
function pickable(version) { return !!version && version.fileState === "ok"; }
|
|
91
72
|
// Why an option has no picture to show, or "" when it has one. One being drawn is named; the shimmer says the rest.
|
|
92
73
|
function optionNote(c) {
|
|
@@ -98,95 +79,6 @@ export const SLATE_UI_INLINE = String.raw `
|
|
|
98
79
|
if (v && v.fileState === "changed") return t("fileChanged");
|
|
99
80
|
return "";
|
|
100
81
|
}
|
|
101
|
-
// The full picture jumps the queue; while it loads, the thumbnail (already fetched) stands in.
|
|
102
|
-
function heroInto(wrap, c, v) {
|
|
103
|
-
wrap.textContent = "";
|
|
104
|
-
wrap.classList.remove("note");
|
|
105
|
-
wrap.style.removeProperty("--ar");
|
|
106
|
-
// The workspace's action row is as wide as the picture, so Select sits under its right edge: the shared parent carries the ratio too.
|
|
107
|
-
var shared = wrap.parentElement;
|
|
108
|
-
if (shared) shared.style.removeProperty("--ar");
|
|
109
|
-
if (!c) return;
|
|
110
|
-
var waitingRef = !v ? pausedRef(c) : null;
|
|
111
|
-
if (waitingRef) { pausedHeroInto(wrap, shared, c, waitingRef); return; }
|
|
112
|
-
if (!v || v.fileState !== "ok") {
|
|
113
|
-
wrap.classList.add("note");
|
|
114
|
-
var reason = !v ? optionNote(c) : v.fileState === "changed" ? t("fileChanged") : t("fileMissing");
|
|
115
|
-
wrap.appendChild(el("div", "heronote" + (drawing(c) ? " shimmer" : ""), reason));
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
wrap.style.setProperty("--ar", String(v.width / v.height));
|
|
119
|
-
if (shared) shared.style.setProperty("--ar", String(v.width / v.height));
|
|
120
|
-
var img = el("img", "heroimg empty");
|
|
121
|
-
img.alt = t("versionName", { label: v.label });
|
|
122
|
-
img.setAttribute("draggable", "false");
|
|
123
|
-
wrap.appendChild(img);
|
|
124
|
-
bindImage(img, v, "full", true);
|
|
125
|
-
var cached = state.thumbs[imageKey(v, "thumb")];
|
|
126
|
-
if (cached) img.src = cached;
|
|
127
|
-
wrap.appendChild(el("span", "badge", v.label));
|
|
128
|
-
if (c.busy) wrap.appendChild(progressBar());
|
|
129
|
-
}
|
|
130
|
-
// An option of a round that waits for the person: the reference it will be drawn from, at that picture's ratio, named.
|
|
131
|
-
function pausedHeroInto(wrap, shared, c, referenceId) {
|
|
132
|
-
var meta = refMeta(referenceId);
|
|
133
|
-
var ratio = meta && meta.width > 0 && meta.height > 0 ? meta.width / meta.height : ratioOf(c);
|
|
134
|
-
wrap.style.setProperty("--ar", String(ratio));
|
|
135
|
-
if (shared) shared.style.setProperty("--ar", String(ratio));
|
|
136
|
-
var img = el("img", "heroimg empty");
|
|
137
|
-
img.alt = t("pauseDrawsFrom", { label: c.label });
|
|
138
|
-
img.setAttribute("draggable", "false");
|
|
139
|
-
wrap.appendChild(img);
|
|
140
|
-
fillImage(img, wantReference(referenceId, "thumb", true));
|
|
141
|
-
wrap.appendChild(el("span", "badge", t("pauseReferenceFor", { label: c.label })));
|
|
142
|
-
}
|
|
143
|
-
function heroSignature(c, v) {
|
|
144
|
-
return JSON.stringify([state.sel, v && [v.sha256, v.fileState, v.label], c && [c.state, c.error, c.busy, drawing(c), optionNote(c), pausedRef(c)]]);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// ---- a thumbnail button for an option: the strip in the card, the selection in the workspace ----
|
|
148
|
-
// The tile has the option's own ratio. With a picture it holds the picture (an <img> only once there is a file to
|
|
149
|
-
// show); being drawn it shimmers; without a picture otherwise it says why on the tile. Its code is always on it.
|
|
150
|
-
function thumbButton(c, cls) {
|
|
151
|
-
var b = button("", cls);
|
|
152
|
-
var selected = state.sel.candidateId === c.candidateId;
|
|
153
|
-
b.setAttribute("aria-label", optionName(c));
|
|
154
|
-
b.setAttribute("aria-pressed", selected ? "true" : "false");
|
|
155
|
-
if (selected) b.classList.add("selected");
|
|
156
|
-
b.setAttribute("data-option", c.label);
|
|
157
|
-
b.style.setProperty("--ar", String(ratioOf(c)));
|
|
158
|
-
var v = latestVersion(c);
|
|
159
|
-
var waitingRef = pausedRef(c);
|
|
160
|
-
if (drawing(c)) b.classList.add("shimmer");
|
|
161
|
-
else if (waitingRef) {
|
|
162
|
-
// Not drawn yet: the tile shows the reference this option will be drawn from.
|
|
163
|
-
b.classList.add("paused");
|
|
164
|
-
b.title = t("pauseDrawsFrom", { label: c.label });
|
|
165
|
-
var ref = el("img", "thumb empty");
|
|
166
|
-
ref.alt = "";
|
|
167
|
-
b.appendChild(ref);
|
|
168
|
-
bindReference(ref, waitingRef, "thumb");
|
|
169
|
-
} else if (c.state === "ready" && v && v.fileState === "ok") {
|
|
170
|
-
var img = el("img", "thumb empty");
|
|
171
|
-
img.alt = "";
|
|
172
|
-
b.appendChild(img);
|
|
173
|
-
bindImage(img, v, "thumb", false);
|
|
174
|
-
} else {
|
|
175
|
-
var note = optionNote(c);
|
|
176
|
-
b.title = note;
|
|
177
|
-
b.classList.add(c.state === "pending" ? "stopped" : "failed");
|
|
178
|
-
var words = el("span", "tilenote");
|
|
179
|
-
words.appendChild(el("span", "", note));
|
|
180
|
-
b.appendChild(words);
|
|
181
|
-
}
|
|
182
|
-
b.appendChild(el("b", "code", c.label));
|
|
183
|
-
b.addEventListener("click", function () { selectCandidate(c.candidateId); });
|
|
184
|
-
return b;
|
|
185
|
-
}
|
|
186
|
-
function thumbSignature(c) {
|
|
187
|
-
var lv = latestVersion(c);
|
|
188
|
-
return [c.candidateId, c.state, c.error, c.latestVersionId, c.versionIds.length, lv ? lv.fileState : "", drawing(c), optionNote(c), ratioOf(c), pausedRef(c)];
|
|
189
|
-
}
|
|
190
82
|
|
|
191
83
|
function renderInline() {
|
|
192
84
|
var v = state.view;
|
|
@@ -197,49 +89,31 @@ export const SLATE_UI_INLINE = String.raw `
|
|
|
197
89
|
if (empty) { reportSize(); return; }
|
|
198
90
|
syncTabs();
|
|
199
91
|
var onDesigns = state.tab === "designs";
|
|
200
|
-
|
|
201
|
-
|
|
92
|
+
// A host without fullscreen opens the large view in the card, in place of the tab.
|
|
93
|
+
var viewing = !!state.lv;
|
|
94
|
+
$("pane-designs").classList.toggle("hidden", !onDesigns || viewing);
|
|
95
|
+
$("pane-inspiration").classList.toggle("hidden", state.tab !== "inspiration" || viewing);
|
|
96
|
+
$("pane-references").classList.toggle("hidden", state.tab !== "references" || viewing);
|
|
97
|
+
$("viewer").classList.toggle("hidden", !viewing);
|
|
98
|
+
renderViewer();
|
|
202
99
|
syncPauseHost($("pausebar"), true);
|
|
203
100
|
if (!onDesigns) {
|
|
204
|
-
|
|
101
|
+
if (state.tab === "references") renderReferences($("pane-references"), "card");
|
|
102
|
+
else renderInspiration($("pane-inspiration"), "card");
|
|
205
103
|
syncControls();
|
|
206
104
|
reportSize();
|
|
207
105
|
return;
|
|
208
106
|
}
|
|
209
|
-
|
|
210
|
-
var sel = selectedVersion();
|
|
211
|
-
setIfChanged($("hero"), heroSignature(c, sel), function (node) { heroInto(node, c, sel); });
|
|
212
|
-
var strip = $("strip");
|
|
213
|
-
// Where keyboard focus sits among the strip's buttons (the thumbnails and the tile), so a rebuild can put it back.
|
|
214
|
-
var focusAt = strip.contains(document.activeElement) ? Array.prototype.indexOf.call(strip.querySelectorAll("button"), document.activeElement) : -1;
|
|
215
|
-
var options = inlineCandidates();
|
|
216
|
-
var rebuilt = setIfChanged(strip, JSON.stringify([state.sel.candidateId, options.map(thumbSignature)]), function (node) {
|
|
217
|
-
options.forEach(function (x) { node.appendChild(thumbButton(x, "thumbbtn")); });
|
|
218
|
-
// The strip wraps onto as many rows as it needs, so the Generate more tile, last, is always in view after the options.
|
|
219
|
-
node.appendChild(moreTile());
|
|
220
|
-
setShape(node, ratioOf(options[0]));
|
|
221
|
-
});
|
|
222
|
-
// Choosing a thumbnail rebuilds the strip: keep keyboard focus at the same place in it.
|
|
223
|
-
var stripButtons = strip.querySelectorAll("button");
|
|
224
|
-
if (rebuilt && focusAt >= 0 && stripButtons[focusAt]) stripButtons[focusAt].focus();
|
|
107
|
+
renderDesigns($("designs"), "card");
|
|
225
108
|
syncControls();
|
|
226
109
|
reportSize();
|
|
227
110
|
}
|
|
228
111
|
|
|
229
112
|
function syncControls() {
|
|
230
|
-
if (!state.view) return;
|
|
231
|
-
var
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
var disabled = !(pickable(v) && !state.busy && !same);
|
|
235
|
-
if (!isFullscreen()) {
|
|
236
|
-
var expand = $("expand");
|
|
237
|
-
expand.classList.toggle("hidden", !canFullscreen());
|
|
238
|
-
expand.disabled = state.view.candidates.length === 0;
|
|
239
|
-
$("select").disabled = disabled;
|
|
240
|
-
$("select").textContent = label;
|
|
241
|
-
}
|
|
242
|
-
if (typeof syncStageControls === "function") syncStageControls(label, disabled);
|
|
113
|
+
if (!state.view || isFullscreen()) return;
|
|
114
|
+
var expand = $("expand");
|
|
115
|
+
expand.classList.toggle("hidden", !canFullscreen());
|
|
116
|
+
expand.disabled = state.view.candidates.length === 0;
|
|
243
117
|
}
|
|
244
118
|
|
|
245
119
|
function expandWorkspace() {
|
|
@@ -251,7 +125,6 @@ export const SLATE_UI_INLINE = String.raw `
|
|
|
251
125
|
}
|
|
252
126
|
|
|
253
127
|
$("expand").addEventListener("click", expandWorkspace);
|
|
254
|
-
$("select").addEventListener("click", function () { doSelect(selectedVersion()); });
|
|
255
128
|
|
|
256
129
|
// ---- tool result: the workspace ----
|
|
257
130
|
function onToolResult(result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script-inline.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inline.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script-inline.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuIxC,CAAC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* The gallery's collage: every page of picture tiles is laid out by the 12ui web gallery's own mosaic band solver,
|
|
3
|
+
* `packMosaicBands` from `mosaic-bands.ts`, whose source is embedded here as is. Each picture keeps its aspect ratio
|
|
4
|
+
* (from the reference's recorded width and height, else its recorded aspect, by the solver's own rule) and every band
|
|
5
|
+
* is exactly as wide as the grid.
|
|
6
6
|
*
|
|
7
7
|
* Only the packing is the screen's (the gallery's is sized for cards with an action strip on a whole page):
|
|
8
8
|
*
|
|
9
|
-
* - a band plans its pictures at least
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* with one reference shows one tile, not one picture as wide as the pane.
|
|
9
|
+
* - a band plans its pictures at least 220 px across in the card and 300 px in the workspace, two across at the least,
|
|
10
|
+
* and holds at most four columns: fairly large thumbnails; the gap is a generous 16 px;
|
|
11
|
+
* - a page with fewer pictures than a row holds is as wide as those pictures would be in a full row, so a short list
|
|
12
|
+
* shows tiles of the usual size, not one picture as wide as the pane.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Each full page is its own block, so revealing the next page never moves a tile already on screen; a short last page
|
|
15
|
+
* takes what joins it (sites arriving one by one), so its rows fill. A block is measured, so
|
|
16
|
+
* it is laid out after it is built and again whenever its width changes (a window resize, the card's scroll bar, the
|
|
17
|
+
* tab shown again). Tiles stay in result order in the document, so the keyboard walks them in the order the search
|
|
18
|
+
* ranked them. Each picture is told its laid-out width (`sizes`), so the browser picks the rendition that fills it.
|
|
18
19
|
*/
|
|
19
20
|
export declare const SLATE_UI_INSPIRATION_COLLAGE: string;
|
|
20
21
|
//# sourceMappingURL=mcp-slate-ui-script-inspiration-collage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script-inspiration-collage.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-collage.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script-inspiration-collage.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-collage.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B,QA8CxC,CAAC"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { packMosaicBands } from './mosaic-bands.js';
|
|
2
2
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* The gallery's collage: every page of picture tiles is laid out by the 12ui web gallery's own mosaic band solver,
|
|
4
|
+
* `packMosaicBands` from `mosaic-bands.ts`, whose source is embedded here as is. Each picture keeps its aspect ratio
|
|
5
|
+
* (from the reference's recorded width and height, else its recorded aspect, by the solver's own rule) and every band
|
|
6
|
+
* is exactly as wide as the grid.
|
|
7
7
|
*
|
|
8
8
|
* Only the packing is the screen's (the gallery's is sized for cards with an action strip on a whole page):
|
|
9
9
|
*
|
|
10
|
-
* - a band plans its pictures at least
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* with one reference shows one tile, not one picture as wide as the pane.
|
|
10
|
+
* - a band plans its pictures at least 220 px across in the card and 300 px in the workspace, two across at the least,
|
|
11
|
+
* and holds at most four columns: fairly large thumbnails; the gap is a generous 16 px;
|
|
12
|
+
* - a page with fewer pictures than a row holds is as wide as those pictures would be in a full row, so a short list
|
|
13
|
+
* shows tiles of the usual size, not one picture as wide as the pane.
|
|
15
14
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Each full page is its own block, so revealing the next page never moves a tile already on screen; a short last page
|
|
16
|
+
* takes what joins it (sites arriving one by one), so its rows fill. A block is measured, so
|
|
17
|
+
* it is laid out after it is built and again whenever its width changes (a window resize, the card's scroll bar, the
|
|
18
|
+
* tab shown again). Tiles stay in result order in the document, so the keyboard walks them in the order the search
|
|
19
|
+
* ranked them. Each picture is told its laid-out width (`sizes`), so the browser picks the rendition that fills it.
|
|
19
20
|
*/
|
|
20
21
|
export const SLATE_UI_INSPIRATION_COLLAGE = String.raw `
|
|
21
22
|
// ---- the collage: the web gallery's mosaic bands (packages/12ui/src/mosaic-bands.ts) ----
|
|
22
23
|
var packMosaicBands = (${packMosaicBands.toString()});
|
|
23
|
-
var COLLAGE = { min: { card:
|
|
24
|
+
var COLLAGE = { min: { card: 220, stage: 300 }, gap: 16, columns: 4 };
|
|
24
25
|
// How a grid of this many pictures packs at this width: the width it takes and the band packing.
|
|
25
26
|
function collagePacking(count, width, where) {
|
|
26
27
|
var gap = COLLAGE.gap;
|
|
@@ -32,36 +33,35 @@ export const SLATE_UI_INSPIRATION_COLLAGE = String.raw `
|
|
|
32
33
|
}
|
|
33
34
|
return { width: width, packing: { columns: Math.min(across, COLLAGE.columns), across: across, gap: gap } };
|
|
34
35
|
}
|
|
35
|
-
// A tile's shape: the reference's recorded aspect and size, or a 16:10 landscape for a skeleton tile.
|
|
36
|
-
function collageShape(node, referenceId) {
|
|
37
|
-
var meta = referenceId && state.view.references ? state.view.references[referenceId] : null;
|
|
38
|
-
node.__shape = meta ? { aspect: meta.aspect, width: meta.width, height: meta.height } : { aspect: "landscape", width: null, height: null };
|
|
39
|
-
}
|
|
40
36
|
function layoutGrid(grid, where, width) {
|
|
41
37
|
var tiles = grid.children;
|
|
42
38
|
var items = [];
|
|
43
39
|
for (var i = 0; i < tiles.length; i++) {
|
|
44
|
-
var shape = tiles[i].__shape;
|
|
40
|
+
var shape = tiles[i].__shape || { aspect: "landscape", width: null, height: null };
|
|
45
41
|
items.push({ id: String(i), aspect: shape.aspect, width: shape.width, height: shape.height });
|
|
46
42
|
}
|
|
47
43
|
var plan = collagePacking(items.length, width, where);
|
|
48
44
|
var layout = packMosaicBands(items, plan.width, plan.packing, 0);
|
|
49
45
|
layout.placements.forEach(function (p) {
|
|
50
|
-
var
|
|
46
|
+
var tile = tiles[Number(p.id)];
|
|
47
|
+
var s = tile.style;
|
|
51
48
|
s.left = p.left + "px";
|
|
52
49
|
s.top = p.top + "px";
|
|
53
50
|
s.width = p.width + "px";
|
|
54
51
|
s.height = p.height + "px";
|
|
52
|
+
var img = tile.querySelector("img");
|
|
53
|
+
if (img) img.sizes = Math.ceil(p.width) + "px";
|
|
55
54
|
});
|
|
56
55
|
grid.style.height = layout.height + "px";
|
|
57
56
|
grid.__laidAt = width;
|
|
58
57
|
}
|
|
59
|
-
// Lays out every
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
// Lays out every block under the node that has a width and was not laid out at it (a hidden pane has none: it is
|
|
59
|
+
// laid out when shown).
|
|
60
|
+
function layoutBlocks(node, where) {
|
|
61
|
+
var grids = node.querySelectorAll(".refgrid");
|
|
62
62
|
for (var i = 0; i < grids.length; i++) {
|
|
63
63
|
var width = grids[i].getBoundingClientRect().width;
|
|
64
|
-
if (width > 0 && grids[i].__laidAt !== width) layoutGrid(grids[i],
|
|
64
|
+
if (width > 0 && grids[i].__laidAt !== width) layoutGrid(grids[i], where, width);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script-inspiration-collage.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-collage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script-inspiration-collage.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-collage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAAA;;2BAE3B,eAAe,CAAC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CpD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The picture gallery and its large view: the Inspiration grid, and the References grid (lane W1) reuses both.
|
|
3
|
+
*
|
|
4
|
+
* `createGallery({ where, root, isSelected, onToggle })` returns `{ node, set(key, items), sync(), layout() }`.
|
|
5
|
+
*
|
|
6
|
+
* - An item is `{ id, label, thumbUrl, imageUrl, title?, sourceUrl?, srcset?, width?, height?, aspect?, load? }`:
|
|
7
|
+
* `thumbUrl` for the tile and `imageUrl` for the large view, straight from their origin (`srcset` lets the browser
|
|
8
|
+
* pick by the tile's laid-out width); `load(img, size)` fills a picture another way when there is no URL.
|
|
9
|
+
* - `set(key, items)`: a new key is a new list (the tiles are built again from the top); the same key with a longer
|
|
10
|
+
* list only adds what is new at the end. The first page shows at once and the next page appears as the person nears
|
|
11
|
+
* the end of the grid (an IntersectionObserver on a marker after the last block, under `root()`, the element that
|
|
12
|
+
* scrolls the grid, or the window), until the list ends. Each page is its own collage block, so nothing already on
|
|
13
|
+
* screen ever moves: not on a click, not when a page is added.
|
|
14
|
+
* - A click toggles the tile (`onToggle`); `sync()` sets every tile's pressed state in place, without a rebuild. A
|
|
15
|
+
* selected tile carries a ring hugging the picture and a check in its corner.
|
|
16
|
+
* - The expand control in a tile's corner, or a double click, opens the large view: the picture as large as the frame
|
|
17
|
+
* allows, previous and next, Select or Selected, Open site for an item with a `sourceUrl`, and close; Escape closes
|
|
18
|
+
* it, the arrow keys step through the list.
|
|
19
|
+
*
|
|
20
|
+
* Fragment of the view's script; String.raw, no backtick, no dollar-brace.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SLATE_UI_INSPIRATION_GALLERY: string;
|
|
23
|
+
//# sourceMappingURL=mcp-slate-ui-script-inspiration-gallery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script-inspiration-gallery.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-gallery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,4BAA4B,QAsMxC,CAAC"}
|