@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,116 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Inspiration tab's page, the same in the card and the workspace:
|
|
3
|
-
* search
|
|
4
|
-
* a line that says how many results the grid shows and why no more, the grid,
|
|
5
|
-
* and, while references are selected, Generate.
|
|
2
|
+
* The Inspiration tab's page, the same in the card and the workspace: one status line (what went wrong, when anything
|
|
3
|
+
* did), the gallery of the search's results, and the tray. The search itself is the prompt card above the tabs.
|
|
6
4
|
*
|
|
7
|
-
* - The
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* is
|
|
16
|
-
* -
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* so the server freezes the selection into the round and the person's agent
|
|
20
|
-
* or the local runner is told the same way. It draws the panel's default
|
|
21
|
-
* count, or the next count up when more references are selected, so every
|
|
22
|
-
* selected reference is drawn from at least once. While a round runs it is
|
|
23
|
-
* off and says why.
|
|
5
|
+
* - The gallery (mcp-slate-ui-script-inspiration-gallery.ts) shows the search the grid follows, a page at a time as
|
|
6
|
+
* the person scrolls; the first search of a workspace without one shows skeleton tiles until it lands, and a new
|
|
7
|
+
* search keeps the old results, dimmed, until the new ones arrive.
|
|
8
|
+
* - The tray holds the picks the next drawing uses, so they stay in sight whatever the grid shows: a small picture of
|
|
9
|
+
* each (a click takes it out) and the one action (how many is said once, in the tab row). While a round waits for its references the picks are
|
|
10
|
+
* that round's, the action is Continue and the countdown shows beside it; otherwise the picks are the selection and
|
|
11
|
+
* the action is Generate: one new round drawn from exactly them, Generate more's own request (`startRound`, which
|
|
12
|
+
* first waits for the selection write), drawing the panel's default count, or the next count up when more are
|
|
13
|
+
* picked, so every pick is drawn from at least once. Either way the screen then moves on to Designs.
|
|
14
|
+
* - In the card the results scroll inside themselves (the host grows the frame and never scrolls the thread, so a long
|
|
15
|
+
* page would push the card out of sight) and the tray sits under them; in the workspace the page scrolls and the tray
|
|
16
|
+
* sticks to the bottom of the window.
|
|
24
17
|
*/
|
|
25
18
|
export const SLATE_UI_INSPIRATION_GRID = String.raw `
|
|
26
|
-
// ---- where a reference was used, from the round records ----
|
|
27
|
-
function labelOrder(a, b) { return a.length - b.length || (a < b ? -1 : a > b ? 1 : 0); }
|
|
28
|
-
function usedText(id) {
|
|
29
|
-
var v = state.view;
|
|
30
|
-
// A round that still waits for the person has used nothing yet: its references are only chosen (the pause).
|
|
31
|
-
var places = v.rounds.slice().sort(function (a, b) { return b.index - a.index; }).filter(function (r) {
|
|
32
|
-
return r.referenceIds.indexOf(id) >= 0 && !(pauseActive() && r.roundId === pause.roundId);
|
|
33
|
-
}).map(function (r) {
|
|
34
|
-
var labels = v.candidates.filter(function (c) { return c.roundId === r.roundId && c.referenceId === id; }).map(function (c) { return c.label; }).sort(labelOrder);
|
|
35
|
-
return t("usedPlace", { options: labels.length, round: r.index, labels: labels.length ? listOf(labels) : "" });
|
|
36
|
-
});
|
|
37
|
-
return places.length ? t("usedIn", { places: places.join(t("usedSeparator")) }) : "";
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// ---- the tiles ----
|
|
41
|
-
function refButton(id) {
|
|
42
|
-
var b = button("", "refbtn");
|
|
43
|
-
b.setAttribute("aria-label", refName(id));
|
|
44
|
-
b.setAttribute("data-ref", id);
|
|
45
|
-
collageShape(b, id);
|
|
46
|
-
// The picture's own skeleton shows until it lands, so a tile that has arrived never flashes a grey square.
|
|
47
|
-
var img = el("img", "thumb empty shimmer");
|
|
48
|
-
img.alt = "";
|
|
49
|
-
b.appendChild(img);
|
|
50
|
-
bindReference(img, id, "thumb");
|
|
51
|
-
var check = el("span", "check");
|
|
52
|
-
check.innerHTML = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>';
|
|
53
|
-
b.appendChild(check);
|
|
54
|
-
var used = usedText(id);
|
|
55
|
-
if (used) {
|
|
56
|
-
b.classList.add("used");
|
|
57
|
-
b.title = used;
|
|
58
|
-
b.appendChild(el("span", "usedbadge", used));
|
|
59
|
-
}
|
|
60
|
-
b.addEventListener("click", function () { toggleRef(id); });
|
|
61
|
-
return b;
|
|
62
|
-
}
|
|
63
|
-
function refSection(heading, title, ids) {
|
|
64
|
-
var sec = el("section", "refsec");
|
|
65
|
-
if (heading) {
|
|
66
|
-
var h = el("h2", "refhead", heading);
|
|
67
|
-
if (title) h.title = title;
|
|
68
|
-
sec.appendChild(h);
|
|
69
|
-
}
|
|
70
|
-
var grid = el("div", "refgrid");
|
|
71
|
-
ids.forEach(function (id) { grid.appendChild(refButton(id)); });
|
|
72
|
-
sec.appendChild(grid);
|
|
73
|
-
return sec;
|
|
74
|
-
}
|
|
75
|
-
// Tiles where the results will land, packed by the same collage, each a 16:10 landscape until the pictures are known.
|
|
76
|
-
var SKELETON_TILES = 12;
|
|
77
|
-
function skeletonSection() {
|
|
78
|
-
var sec = el("section", "refsec");
|
|
79
|
-
var grid = el("div", "refgrid");
|
|
80
|
-
for (var i = 0; i < SKELETON_TILES; i++) {
|
|
81
|
-
var tile = el("div", "skeleton shimmer");
|
|
82
|
-
collageShape(tile, null);
|
|
83
|
-
grid.appendChild(tile);
|
|
84
|
-
}
|
|
85
|
-
sec.appendChild(grid);
|
|
86
|
-
return sec;
|
|
87
|
-
}
|
|
88
|
-
function buildResults(box) {
|
|
89
|
-
var v = state.view;
|
|
90
|
-
var any = false;
|
|
91
|
-
var search = shownSearch();
|
|
92
|
-
// The search's slot: skeleton tiles while it runs, else its references, or the line that it found none.
|
|
93
|
-
// A round that waits for the person comes first, with the references it will be drawn from as they stand now.
|
|
94
|
-
var waiting = pauseRound();
|
|
95
|
-
if (waiting) { box.appendChild(refSection(t("roundHeading", { n: waiting.index }), roundTitle(waiting), pauseChosen())); any = true; }
|
|
96
|
-
if (state.insp.searching) { box.appendChild(skeletonSection()); any = true; }
|
|
97
|
-
else if (search && search.referenceIds.length === 0 && state.insp.noMatch === search.searchId) { box.appendChild(el("div", "placeholder", t("inspirationNoMatches"))); any = true; }
|
|
98
|
-
else if (search && search.referenceIds.length > 0) { box.appendChild(refSection("", "", search.referenceIds)); any = true; }
|
|
99
|
-
v.rounds.slice().sort(function (a, b) { return b.index - a.index; }).forEach(function (round) {
|
|
100
|
-
if (round.referenceIds.length === 0 || (waiting && round.roundId === waiting.roundId)) return;
|
|
101
|
-
box.appendChild(refSection(t("roundHeading", { n: round.index }), roundTitle(round), round.referenceIds));
|
|
102
|
-
any = true;
|
|
103
|
-
});
|
|
104
|
-
if (!any) box.appendChild(el("div", "placeholder", t("inspirationEmpty")));
|
|
105
|
-
}
|
|
106
|
-
// How many the search shows, and, at the cap, that one search returns no more.
|
|
107
|
-
function resultsText() {
|
|
108
|
-
var search = shownSearch();
|
|
109
|
-
if (state.insp.searching || !search || search.referenceIds.length === 0) return "";
|
|
110
|
-
var n = search.referenceIds.length;
|
|
111
|
-
return t(n >= SEARCH_COUNT ? "resultsMax" : "resultsCount", { n: n });
|
|
112
|
-
}
|
|
113
|
-
|
|
114
19
|
// ---- Generate: one new round from exactly the selected references ----
|
|
115
20
|
function generateCount(selected) {
|
|
116
21
|
var want = Math.max(selected, MORE.initial);
|
|
@@ -126,24 +31,69 @@ export const SLATE_UI_INSPIRATION_GRID = String.raw `
|
|
|
126
31
|
startRound(uuid4(), { mode: "new", note: "", count: generateCount(chosen.length) }).then(function () {
|
|
127
32
|
state.insp.generating = false;
|
|
128
33
|
// The new round's options are pending in the designs: show them.
|
|
129
|
-
if (state.tab
|
|
34
|
+
if (state.tab !== "designs") setTab("designs"); else renderAll();
|
|
130
35
|
}, function (err) {
|
|
131
36
|
state.insp.generating = false;
|
|
132
37
|
setInspStatus(errText(err), "err");
|
|
133
38
|
renderAll();
|
|
134
39
|
});
|
|
135
40
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
41
|
+
|
|
42
|
+
// ---- the tray: the picks, how many, and the one action ----
|
|
43
|
+
function trayPick(id) {
|
|
44
|
+
var b = button("", "traypick", function () { toggleRef(id); });
|
|
45
|
+
b.setAttribute("aria-label", t("removeReference", { name: refName(id) }));
|
|
46
|
+
b.title = t("removeReference", { name: refName(id) });
|
|
47
|
+
b.setAttribute("data-pick", id);
|
|
48
|
+
var item = refItem(id);
|
|
49
|
+
var img = el("img", "thumb");
|
|
50
|
+
img.alt = "";
|
|
51
|
+
if (item.thumbUrl) img.src = item.thumbUrl; else item.load(img, "thumb");
|
|
52
|
+
b.appendChild(img);
|
|
53
|
+
var x = el("span", "trayx");
|
|
54
|
+
x.innerHTML = glyph(GLYPH.close, 16, 3);
|
|
55
|
+
b.appendChild(x);
|
|
56
|
+
return b;
|
|
57
|
+
}
|
|
58
|
+
// Continue, from either pane, lets the round go and shows its options drawing, as Generate does.
|
|
59
|
+
function trayGo() {
|
|
60
|
+
if (pauseActive()) setTab("designs"); else generateFromSelection();
|
|
61
|
+
}
|
|
62
|
+
// The tray of a pane (Inspiration, References): the same picks, count, countdown and action in both.
|
|
63
|
+
function buildTray(pane) {
|
|
64
|
+
var tray = el("div", "tray hidden");
|
|
65
|
+
var picks = el("div", "traypicks");
|
|
66
|
+
var clock = el("span", "trayclock");
|
|
67
|
+
clock.setAttribute("data-pause-clock", "");
|
|
68
|
+
clock.setAttribute("role", "timer");
|
|
69
|
+
var go = button("", "primary", trayGo);
|
|
70
|
+
tray.appendChild(picks);
|
|
71
|
+
tray.appendChild(clock);
|
|
72
|
+
tray.appendChild(el("span", "spacer"));
|
|
73
|
+
tray.appendChild(go);
|
|
74
|
+
pane.__tray = tray;
|
|
75
|
+
pane.__trayPicks = picks;
|
|
76
|
+
pane.__trayGo = go;
|
|
77
|
+
return tray;
|
|
78
|
+
}
|
|
79
|
+
function syncTray(pane) {
|
|
80
|
+
var picks = activeSelection();
|
|
81
|
+
var waiting = pauseActive();
|
|
82
|
+
pane.__tray.classList.toggle("hidden", !waiting && picks.length === 0);
|
|
83
|
+
setIfChanged(pane.__trayPicks, JSON.stringify(picks), function (node) { picks.forEach(function (id) { node.appendChild(trayPick(id)); }); });
|
|
84
|
+
pane.__trayGo.textContent = waiting ? t("continueRound") : t("generate");
|
|
85
|
+
if (waiting) {
|
|
86
|
+
pane.__trayGo.setAttribute("data-continue", "");
|
|
87
|
+
pane.__trayGo.disabled = pause.sending || picks.length === 0;
|
|
88
|
+
pane.__trayGo.removeAttribute("title");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
pane.__trayGo.removeAttribute("data-continue");
|
|
140
92
|
var running = moreBusy() && !state.insp.generating;
|
|
141
93
|
var local = localImage();
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
pane.__barText.textContent = line;
|
|
146
|
-
pane.__generate.disabled = state.insp.generating || running || !local.ready;
|
|
94
|
+
pane.__trayGo.disabled = state.insp.generating || running || !local.ready;
|
|
95
|
+
var why = running ? t("roundRunning") : !local.ready ? localReason() : "";
|
|
96
|
+
if (why) pane.__trayGo.title = why; else pane.__trayGo.removeAttribute("title");
|
|
147
97
|
}
|
|
148
98
|
|
|
149
99
|
// ---- the tab ----
|
|
@@ -151,95 +101,73 @@ export const SLATE_UI_INSPIRATION_GRID = String.raw `
|
|
|
151
101
|
pane.__built = true;
|
|
152
102
|
pane.__where = where;
|
|
153
103
|
pane.classList.add("insp", where);
|
|
154
|
-
var row = el("div", "searchrow");
|
|
155
|
-
var input = el("input");
|
|
156
|
-
input.type = "text";
|
|
157
|
-
input.className = "query";
|
|
158
|
-
input.autocomplete = "off";
|
|
159
|
-
input.placeholder = t("inspirationPlaceholder");
|
|
160
|
-
input.setAttribute("aria-label", t("inspirationLabel"));
|
|
161
|
-
input.value = state.query;
|
|
162
|
-
input.addEventListener("input", function () {
|
|
163
|
-
state.query = input.value;
|
|
164
|
-
state.insp.typed = true;
|
|
165
|
-
var panes = document.querySelectorAll(".insp");
|
|
166
|
-
for (var i = 0; i < panes.length; i++) { syncSearchButton(panes[i]); syncHow(panes[i]); }
|
|
167
|
-
});
|
|
168
|
-
input.addEventListener("keydown", function (e) { if (e.key === "Enter") doSearch(); });
|
|
169
|
-
var search = button(t("search"), "primary", doSearch);
|
|
170
|
-
row.appendChild(input);
|
|
171
|
-
row.appendChild(search);
|
|
172
|
-
var how = el("p", "insphow");
|
|
173
104
|
var status = el("div", "status");
|
|
174
105
|
status.setAttribute("data-istatus", "");
|
|
175
106
|
status.setAttribute("role", "status");
|
|
176
107
|
status.setAttribute("aria-live", "polite");
|
|
177
108
|
if (state.inspMsg) { status.textContent = state.inspMsg.text; if (state.inspMsg.kind) status.className = "status " + state.inspMsg.kind; }
|
|
178
|
-
var
|
|
179
|
-
var
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
pane.
|
|
190
|
-
pane.
|
|
191
|
-
pane.
|
|
192
|
-
pane.
|
|
193
|
-
pane.__bar = bar;
|
|
194
|
-
pane.__barText = barText;
|
|
195
|
-
pane.__generate = generate;
|
|
196
|
-
pane.__pause = pauseHost;
|
|
197
|
-
pane.__pauseChoice = pauseChoice;
|
|
198
|
-
pane.appendChild(row);
|
|
199
|
-
pane.appendChild(how);
|
|
109
|
+
var results = el("div", "results");
|
|
110
|
+
var gallery = createGallery({
|
|
111
|
+
where: where,
|
|
112
|
+
root: function () { return where === "card" ? results : null; },
|
|
113
|
+
isSelected: function (id) { return activeSelection().indexOf(id) >= 0; },
|
|
114
|
+
onToggle: toggleRef
|
|
115
|
+
});
|
|
116
|
+
var skeleton = el("div", "skelgrid");
|
|
117
|
+
var empty = el("div", "placeholder");
|
|
118
|
+
results.appendChild(skeleton);
|
|
119
|
+
results.appendChild(gallery.node);
|
|
120
|
+
pane.__results = results;
|
|
121
|
+
pane.__gallery = gallery;
|
|
122
|
+
pane.__skeleton = skeleton;
|
|
123
|
+
pane.__empty = empty;
|
|
200
124
|
pane.appendChild(status);
|
|
201
|
-
pane.appendChild(
|
|
202
|
-
pane.appendChild(pane
|
|
203
|
-
pane.appendChild(bar);
|
|
204
|
-
pane.appendChild(pauseChoice);
|
|
205
|
-
pane.appendChild(pauseHost);
|
|
125
|
+
pane.appendChild(results);
|
|
126
|
+
pane.appendChild(buildTray(pane));
|
|
206
127
|
// The collage is measured: a new width (a resize, a scroll bar, the tab shown again) lays it out again.
|
|
207
|
-
new ResizeObserver(function () {
|
|
128
|
+
new ResizeObserver(function () { gallery.layout(); }).observe(results);
|
|
208
129
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
130
|
+
// What the grid lists, in order, and the key that names the list: a waiting round's own references first (fixed for
|
|
131
|
+
// the whole wait, so a click never moves a tile), then the search the grid follows; a workspace with no search yet
|
|
132
|
+
// lists the references its rounds used, newest round first.
|
|
133
|
+
function gridList() {
|
|
134
|
+
var ids = [];
|
|
135
|
+
var add = function (id) { if (ids.indexOf(id) < 0) ids.push(id); };
|
|
136
|
+
var waiting = pauseRound();
|
|
137
|
+
if (waiting) waiting.referenceIds.forEach(add);
|
|
138
|
+
var search = shownSearch();
|
|
139
|
+
if (search) search.referenceIds.forEach(add);
|
|
140
|
+
else state.view.rounds.slice().sort(function (a, b) { return b.index - a.index; }).forEach(function (r) { r.referenceIds.forEach(add); });
|
|
141
|
+
var key = [state.view.runDir, search ? search.searchId : "rounds", waiting ? waiting.roundId + "=" + waiting.referenceIds.join(",") : "",
|
|
142
|
+
search ? "" : state.view.rounds.map(function (r) { return r.referenceIds.join(","); }).join("|")].join(":");
|
|
143
|
+
return { ids: ids, key: key, search: search };
|
|
213
144
|
}
|
|
214
145
|
function renderInspiration(pane, where) {
|
|
215
146
|
if (!state.view) return;
|
|
216
147
|
if (!pane.__built) buildInspirationShell(pane, where);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
var
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
pane.__pauseChoice.textContent = pauseActive() ? pauseChoiceText() : "";
|
|
241
|
-
pane.__pauseChoice.classList.toggle("hidden", !pauseActive());
|
|
242
|
-
if (pauseActive()) pane.__bar.classList.add("hidden"); else syncGenerate(pane);
|
|
148
|
+
syncSearchRun();
|
|
149
|
+
var list = gridList();
|
|
150
|
+
var searching = state.insp.searching;
|
|
151
|
+
var has = list.ids.length > 0;
|
|
152
|
+
pane.__results.setAttribute("aria-busy", searching ? "true" : "false");
|
|
153
|
+
// A search in flight dims what is there until its results arrive; with nothing there yet, skeleton tiles hold the place.
|
|
154
|
+
pane.classList.toggle("searching", searching && has);
|
|
155
|
+
var skeleton = searching && !has;
|
|
156
|
+
if (skeleton !== !!pane.__skeleton.firstChild) {
|
|
157
|
+
pane.__skeleton.textContent = "";
|
|
158
|
+
if (skeleton) for (var s = 0; s < 12; s++) pane.__skeleton.appendChild(el("div", "skeleton shimmer"));
|
|
159
|
+
}
|
|
160
|
+
var noMatch = !!list.search && list.search.referenceIds.length === 0 && state.insp.noMatch === list.search.searchId;
|
|
161
|
+
var emptyText = searching ? "" : noMatch ? t("inspirationNoMatches") : has ? "" : t("inspirationEmpty");
|
|
162
|
+
// The line is in the results only while it says something.
|
|
163
|
+
pane.__empty.textContent = emptyText;
|
|
164
|
+
if (emptyText && !pane.__empty.parentNode) pane.__results.insertBefore(pane.__empty, pane.__gallery.node);
|
|
165
|
+
else if (!emptyText && pane.__empty.parentNode) pane.__empty.parentNode.removeChild(pane.__empty);
|
|
166
|
+
pane.__gallery.node.classList.toggle("hidden", !has);
|
|
167
|
+
if (has) pane.__gallery.set(list.key, list.ids.map(refItem));
|
|
168
|
+
pane.__gallery.layout();
|
|
169
|
+
pane.__gallery.sync();
|
|
170
|
+
syncTray(pane);
|
|
243
171
|
autoSearch();
|
|
244
172
|
}
|
|
245
173
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script-inspiration-grid.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-grid.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script-inspiration-grid.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2JlD,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How many references
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export declare const SLATE_INSPIRATION_SEARCH_COUNT = 24;
|
|
7
|
-
/**
|
|
8
|
-
* The longest words one search takes, in characters (code points): both servers' inspire tools refuse longer. A round
|
|
9
|
-
* searches with the whole brief and its note, which can be longer, so the box shows the round's words in full and the
|
|
10
|
-
* search takes their first 500 characters, cut at a space, and the tab says so.
|
|
2
|
+
* How many references one Inspiration search asks for, per server: the hosted server's searches carry a depth grant
|
|
3
|
+
* and return a window the grid reveals a page at a time as the person scrolls (`SLATE_LIMITS.searchCountMax` there);
|
|
4
|
+
* the local plugin asks the public tier, which returns at most 24.
|
|
11
5
|
*/
|
|
6
|
+
export declare const SLATE_INSPIRATION_SEARCH_COUNT: {
|
|
7
|
+
readonly remote: 96;
|
|
8
|
+
readonly local: 24;
|
|
9
|
+
};
|
|
10
|
+
/** The longest words one search takes, in characters (code points): both servers' inspire tools refuse longer. */
|
|
12
11
|
export declare const SLATE_INSPIRATION_QUERY_CHARS = 500;
|
|
13
12
|
export declare const SLATE_UI_INSPIRATION: string;
|
|
14
13
|
//# sourceMappingURL=mcp-slate-ui-script-inspiration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-slate-ui-script-inspiration.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-slate-ui-script-inspiration.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;CAA0D,CAAC;AAEtG,kHAAkH;AAClH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AA6VjD,eAAO,MAAM,oBAAoB,QAAkI,CAAC"}
|