@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.
Files changed (276) hide show
  1. package/README.md +1 -3
  2. package/SKILL.md +2 -8
  3. package/dist/cli-help/design.d.ts +1 -1
  4. package/dist/cli-help/design.d.ts.map +1 -1
  5. package/dist/cli-help/design.js +0 -1
  6. package/dist/cli-help/design.js.map +1 -1
  7. package/dist/cli-help/index.d.ts +1 -1
  8. package/dist/cli-workspace-draw.d.ts.map +1 -1
  9. package/dist/cli-workspace-draw.js +2 -0
  10. package/dist/cli-workspace-draw.js.map +1 -1
  11. package/dist/cli-workspace-runner.d.ts.map +1 -1
  12. package/dist/cli-workspace-runner.js +2 -1
  13. package/dist/cli-workspace-runner.js.map +1 -1
  14. package/dist/corpus-client.d.ts +3 -0
  15. package/dist/corpus-client.d.ts.map +1 -1
  16. package/dist/corpus-client.js +2 -0
  17. package/dist/corpus-client.js.map +1 -1
  18. package/dist/corpus-public-renditions.d.ts +33 -0
  19. package/dist/corpus-public-renditions.d.ts.map +1 -0
  20. package/dist/corpus-public-renditions.js +55 -0
  21. package/dist/corpus-public-renditions.js.map +1 -0
  22. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  23. package/dist/legacy-skill-catalog.js +11 -0
  24. package/dist/legacy-skill-catalog.js.map +1 -1
  25. package/dist/mcp-slate-command.d.ts +0 -2
  26. package/dist/mcp-slate-command.d.ts.map +1 -1
  27. package/dist/mcp-slate-command.js +0 -4
  28. package/dist/mcp-slate-command.js.map +1 -1
  29. package/dist/mcp-slate-resource.d.ts.map +1 -1
  30. package/dist/mcp-slate-resource.js +6 -4
  31. package/dist/mcp-slate-resource.js.map +1 -1
  32. package/dist/mcp-slate-tool-defs.d.ts.map +1 -1
  33. package/dist/mcp-slate-tool-defs.js +8 -6
  34. package/dist/mcp-slate-tool-defs.js.map +1 -1
  35. package/dist/mcp-slate-tools.d.ts.map +1 -1
  36. package/dist/mcp-slate-tools.js +8 -1
  37. package/dist/mcp-slate-tools.js.map +1 -1
  38. package/dist/mcp-slate-ui-copy.d.ts +88 -208
  39. package/dist/mcp-slate-ui-copy.d.ts.map +1 -1
  40. package/dist/mcp-slate-ui-copy.js +58 -159
  41. package/dist/mcp-slate-ui-copy.js.map +1 -1
  42. package/dist/mcp-slate-ui-locales/de-DE.d.ts.map +1 -1
  43. package/dist/mcp-slate-ui-locales/de-DE.js +44 -83
  44. package/dist/mcp-slate-ui-locales/de-DE.js.map +1 -1
  45. package/dist/mcp-slate-ui-locales/es-419.d.ts.map +1 -1
  46. package/dist/mcp-slate-ui-locales/es-419.js +44 -83
  47. package/dist/mcp-slate-ui-locales/es-419.js.map +1 -1
  48. package/dist/mcp-slate-ui-locales/es-ES.d.ts.map +1 -1
  49. package/dist/mcp-slate-ui-locales/es-ES.js +44 -83
  50. package/dist/mcp-slate-ui-locales/es-ES.js.map +1 -1
  51. package/dist/mcp-slate-ui-locales/fr-FR.d.ts.map +1 -1
  52. package/dist/mcp-slate-ui-locales/fr-FR.js +44 -83
  53. package/dist/mcp-slate-ui-locales/fr-FR.js.map +1 -1
  54. package/dist/mcp-slate-ui-locales/hi-IN.d.ts.map +1 -1
  55. package/dist/mcp-slate-ui-locales/hi-IN.js +44 -83
  56. package/dist/mcp-slate-ui-locales/hi-IN.js.map +1 -1
  57. package/dist/mcp-slate-ui-locales/it-IT.d.ts.map +1 -1
  58. package/dist/mcp-slate-ui-locales/it-IT.js +44 -83
  59. package/dist/mcp-slate-ui-locales/it-IT.js.map +1 -1
  60. package/dist/mcp-slate-ui-locales/ja-JP.d.ts.map +1 -1
  61. package/dist/mcp-slate-ui-locales/ja-JP.js +44 -83
  62. package/dist/mcp-slate-ui-locales/ja-JP.js.map +1 -1
  63. package/dist/mcp-slate-ui-locales/ko-KR.d.ts.map +1 -1
  64. package/dist/mcp-slate-ui-locales/ko-KR.js +44 -83
  65. package/dist/mcp-slate-ui-locales/ko-KR.js.map +1 -1
  66. package/dist/mcp-slate-ui-locales/pt-BR.d.ts.map +1 -1
  67. package/dist/mcp-slate-ui-locales/pt-BR.js +44 -83
  68. package/dist/mcp-slate-ui-locales/pt-BR.js.map +1 -1
  69. package/dist/mcp-slate-ui-locales/zh-CN.d.ts.map +1 -1
  70. package/dist/mcp-slate-ui-locales/zh-CN.js +44 -83
  71. package/dist/mcp-slate-ui-locales/zh-CN.js.map +1 -1
  72. package/dist/mcp-slate-ui-locales/zh-TW.d.ts.map +1 -1
  73. package/dist/mcp-slate-ui-locales/zh-TW.js +44 -83
  74. package/dist/mcp-slate-ui-locales/zh-TW.js.map +1 -1
  75. package/dist/mcp-slate-ui-script-bridge.d.ts.map +1 -1
  76. package/dist/mcp-slate-ui-script-bridge.js +19 -7
  77. package/dist/mcp-slate-ui-script-bridge.js.map +1 -1
  78. package/dist/mcp-slate-ui-script-browser.d.ts.map +1 -1
  79. package/dist/mcp-slate-ui-script-browser.js +0 -3
  80. package/dist/mcp-slate-ui-script-browser.js.map +1 -1
  81. package/dist/mcp-slate-ui-script-designs.d.ts +17 -0
  82. package/dist/mcp-slate-ui-script-designs.d.ts.map +1 -0
  83. package/dist/mcp-slate-ui-script-designs.js +365 -0
  84. package/dist/mcp-slate-ui-script-designs.js.map +1 -0
  85. package/dist/mcp-slate-ui-script-edit.d.ts +9 -0
  86. package/dist/mcp-slate-ui-script-edit.d.ts.map +1 -0
  87. package/dist/mcp-slate-ui-script-edit.js +71 -0
  88. package/dist/mcp-slate-ui-script-edit.js.map +1 -0
  89. package/dist/mcp-slate-ui-script-inline.d.ts +3 -9
  90. package/dist/mcp-slate-ui-script-inline.d.ts.map +1 -1
  91. package/dist/mcp-slate-ui-script-inline.js +28 -155
  92. package/dist/mcp-slate-ui-script-inline.js.map +1 -1
  93. package/dist/mcp-slate-ui-script-inspiration-collage.d.ts +13 -12
  94. package/dist/mcp-slate-ui-script-inspiration-collage.d.ts.map +1 -1
  95. package/dist/mcp-slate-ui-script-inspiration-collage.js +24 -24
  96. package/dist/mcp-slate-ui-script-inspiration-collage.js.map +1 -1
  97. package/dist/mcp-slate-ui-script-inspiration-gallery.d.ts +23 -0
  98. package/dist/mcp-slate-ui-script-inspiration-gallery.d.ts.map +1 -0
  99. package/dist/mcp-slate-ui-script-inspiration-gallery.js +221 -0
  100. package/dist/mcp-slate-ui-script-inspiration-gallery.js.map +1 -0
  101. package/dist/mcp-slate-ui-script-inspiration-grid.d.ts +14 -21
  102. package/dist/mcp-slate-ui-script-inspiration-grid.d.ts.map +1 -1
  103. package/dist/mcp-slate-ui-script-inspiration-grid.js +124 -196
  104. package/dist/mcp-slate-ui-script-inspiration-grid.js.map +1 -1
  105. package/dist/mcp-slate-ui-script-inspiration.d.ts +8 -9
  106. package/dist/mcp-slate-ui-script-inspiration.d.ts.map +1 -1
  107. package/dist/mcp-slate-ui-script-inspiration.js +213 -130
  108. package/dist/mcp-slate-ui-script-inspiration.js.map +1 -1
  109. package/dist/mcp-slate-ui-script-l10n.d.ts.map +1 -1
  110. package/dist/mcp-slate-ui-script-l10n.js +2 -0
  111. package/dist/mcp-slate-ui-script-l10n.js.map +1 -1
  112. package/dist/mcp-slate-ui-script-more.d.ts +4 -33
  113. package/dist/mcp-slate-ui-script-more.d.ts.map +1 -1
  114. package/dist/mcp-slate-ui-script-more.js +6 -279
  115. package/dist/mcp-slate-ui-script-more.js.map +1 -1
  116. package/dist/mcp-slate-ui-script-pause.d.ts +10 -6
  117. package/dist/mcp-slate-ui-script-pause.d.ts.map +1 -1
  118. package/dist/mcp-slate-ui-script-pause.js +45 -30
  119. package/dist/mcp-slate-ui-script-pause.js.map +1 -1
  120. package/dist/mcp-slate-ui-script-references.d.ts +19 -0
  121. package/dist/mcp-slate-ui-script-references.d.ts.map +1 -0
  122. package/dist/mcp-slate-ui-script-references.js +102 -0
  123. package/dist/mcp-slate-ui-script-references.js.map +1 -0
  124. package/dist/mcp-slate-ui-script-remote.d.ts +13 -12
  125. package/dist/mcp-slate-ui-script-remote.d.ts.map +1 -1
  126. package/dist/mcp-slate-ui-script-remote.js +46 -27
  127. package/dist/mcp-slate-ui-script-remote.js.map +1 -1
  128. package/dist/mcp-slate-ui-script-scribble.d.ts +2 -2
  129. package/dist/mcp-slate-ui-script-scribble.js +7 -7
  130. package/dist/mcp-slate-ui-script-select.d.ts +4 -9
  131. package/dist/mcp-slate-ui-script-select.d.ts.map +1 -1
  132. package/dist/mcp-slate-ui-script-select.js +13 -37
  133. package/dist/mcp-slate-ui-script-select.js.map +1 -1
  134. package/dist/mcp-slate-ui-script-stage.d.ts +4 -10
  135. package/dist/mcp-slate-ui-script-stage.d.ts.map +1 -1
  136. package/dist/mcp-slate-ui-script-stage.js +28 -141
  137. package/dist/mcp-slate-ui-script-stage.js.map +1 -1
  138. package/dist/mcp-slate-ui-script-state.d.ts +1 -1
  139. package/dist/mcp-slate-ui-script-state.d.ts.map +1 -1
  140. package/dist/mcp-slate-ui-script-state.js +9 -4
  141. package/dist/mcp-slate-ui-script-state.js.map +1 -1
  142. package/dist/mcp-slate-ui-script-viewer.d.ts +18 -0
  143. package/dist/mcp-slate-ui-script-viewer.d.ts.map +1 -0
  144. package/dist/mcp-slate-ui-script-viewer.js +405 -0
  145. package/dist/mcp-slate-ui-script-viewer.js.map +1 -0
  146. package/dist/mcp-slate-ui-script.d.ts +4 -5
  147. package/dist/mcp-slate-ui-script.d.ts.map +1 -1
  148. package/dist/mcp-slate-ui-script.js +12 -13
  149. package/dist/mcp-slate-ui-script.js.map +1 -1
  150. package/dist/mcp-slate-ui-styles-designs.d.ts +10 -0
  151. package/dist/mcp-slate-ui-styles-designs.d.ts.map +1 -0
  152. package/dist/mcp-slate-ui-styles-designs.js +121 -0
  153. package/dist/mcp-slate-ui-styles-designs.js.map +1 -0
  154. package/dist/mcp-slate-ui-styles-inspiration.d.ts +13 -13
  155. package/dist/mcp-slate-ui-styles-inspiration.d.ts.map +1 -1
  156. package/dist/mcp-slate-ui-styles-inspiration.js +67 -33
  157. package/dist/mcp-slate-ui-styles-inspiration.js.map +1 -1
  158. package/dist/mcp-slate-ui-styles-pause.d.ts +2 -2
  159. package/dist/mcp-slate-ui-styles-pause.d.ts.map +1 -1
  160. package/dist/mcp-slate-ui-styles-pause.js +4 -8
  161. package/dist/mcp-slate-ui-styles-pause.js.map +1 -1
  162. package/dist/mcp-slate-ui-styles-stage.d.ts +3 -22
  163. package/dist/mcp-slate-ui-styles-stage.d.ts.map +1 -1
  164. package/dist/mcp-slate-ui-styles-stage.js +6 -74
  165. package/dist/mcp-slate-ui-styles-stage.js.map +1 -1
  166. package/dist/mcp-slate-ui-styles.d.ts +12 -19
  167. package/dist/mcp-slate-ui-styles.d.ts.map +1 -1
  168. package/dist/mcp-slate-ui-styles.js +97 -100
  169. package/dist/mcp-slate-ui-styles.js.map +1 -1
  170. package/dist/mcp-slate-ui.d.ts +12 -12
  171. package/dist/mcp-slate-ui.d.ts.map +1 -1
  172. package/dist/mcp-slate-ui.js +24 -23
  173. package/dist/mcp-slate-ui.js.map +1 -1
  174. package/dist/server.d.ts.map +1 -1
  175. package/dist/server.js +2 -0
  176. package/dist/server.js.map +1 -1
  177. package/dist/slate-actions.d.ts +22 -1
  178. package/dist/slate-actions.d.ts.map +1 -1
  179. package/dist/slate-actions.js +46 -2
  180. package/dist/slate-actions.js.map +1 -1
  181. package/dist/slate-browser-host.d.ts +8 -7
  182. package/dist/slate-browser-host.d.ts.map +1 -1
  183. package/dist/slate-browser-host.js +13 -10
  184. package/dist/slate-browser-host.js.map +1 -1
  185. package/dist/slate-browser-server.d.ts.map +1 -1
  186. package/dist/slate-browser-server.js +10 -4
  187. package/dist/slate-browser-server.js.map +1 -1
  188. package/dist/slate-commit.d.ts.map +1 -1
  189. package/dist/slate-commit.js +12 -5
  190. package/dist/slate-commit.js.map +1 -1
  191. package/dist/slate-handoff.d.ts.map +1 -1
  192. package/dist/slate-handoff.js +2 -3
  193. package/dist/slate-handoff.js.map +1 -1
  194. package/dist/slate-ids.d.ts +2 -1
  195. package/dist/slate-ids.d.ts.map +1 -1
  196. package/dist/slate-ids.js +3 -2
  197. package/dist/slate-ids.js.map +1 -1
  198. package/dist/slate-reference-ids.d.ts.map +1 -1
  199. package/dist/slate-reference-ids.js +1 -0
  200. package/dist/slate-reference-ids.js.map +1 -1
  201. package/dist/slate-round-prompt.d.ts +19 -0
  202. package/dist/slate-round-prompt.d.ts.map +1 -1
  203. package/dist/slate-round-prompt.js +22 -0
  204. package/dist/slate-round-prompt.js.map +1 -1
  205. package/dist/slate-round-runner.d.ts.map +1 -1
  206. package/dist/slate-round-runner.js +16 -12
  207. package/dist/slate-round-runner.js.map +1 -1
  208. package/dist/slate-round-search.d.ts.map +1 -1
  209. package/dist/slate-round-search.js +2 -0
  210. package/dist/slate-round-search.js.map +1 -1
  211. package/dist/slate-runtime.d.ts +3 -0
  212. package/dist/slate-runtime.d.ts.map +1 -1
  213. package/dist/slate-runtime.js +1 -0
  214. package/dist/slate-runtime.js.map +1 -1
  215. package/dist/slate-site-references-capture.d.ts +20 -0
  216. package/dist/slate-site-references-capture.d.ts.map +1 -0
  217. package/dist/slate-site-references-capture.js +119 -0
  218. package/dist/slate-site-references-capture.js.map +1 -0
  219. package/dist/slate-site-references-client.d.ts +35 -0
  220. package/dist/slate-site-references-client.d.ts.map +1 -0
  221. package/dist/slate-site-references-client.js +36 -0
  222. package/dist/slate-site-references-client.js.map +1 -0
  223. package/dist/slate-site-references-local.d.ts +6 -0
  224. package/dist/slate-site-references-local.d.ts.map +1 -0
  225. package/dist/slate-site-references-local.js +63 -0
  226. package/dist/slate-site-references-local.js.map +1 -0
  227. package/dist/slate-site-references-suggest.d.ts +36 -0
  228. package/dist/slate-site-references-suggest.d.ts.map +1 -0
  229. package/dist/slate-site-references-suggest.js +144 -0
  230. package/dist/slate-site-references-suggest.js.map +1 -0
  231. package/dist/slate-site-references.d.ts +57 -0
  232. package/dist/slate-site-references.d.ts.map +1 -0
  233. package/dist/slate-site-references.js +129 -0
  234. package/dist/slate-site-references.js.map +1 -0
  235. package/dist/slate-view-contract.d.ts +29 -1
  236. package/dist/slate-view-contract.d.ts.map +1 -1
  237. package/dist/slate-view.d.ts.map +1 -1
  238. package/dist/slate-view.js +5 -0
  239. package/dist/slate-view.js.map +1 -1
  240. package/dist/slate-workspace-parse.d.ts +2 -0
  241. package/dist/slate-workspace-parse.d.ts.map +1 -1
  242. package/dist/slate-workspace-parse.js +20 -3
  243. package/dist/slate-workspace-parse.js.map +1 -1
  244. package/dist/slate-workspace-types.d.ts +17 -2
  245. package/dist/slate-workspace-types.d.ts.map +1 -1
  246. package/dist/workspace-draw-messages.d.ts +27 -5
  247. package/dist/workspace-draw-messages.d.ts.map +1 -1
  248. package/dist/workspace-draw-messages.js +29 -3
  249. package/dist/workspace-draw-messages.js.map +1 -1
  250. package/dist/workspace-draw-run.d.ts +12 -0
  251. package/dist/workspace-draw-run.d.ts.map +1 -1
  252. package/dist/workspace-draw-run.js +47 -18
  253. package/dist/workspace-draw-run.js.map +1 -1
  254. package/dist/workspace-draw-types.d.ts +2 -1
  255. package/dist/workspace-draw-types.d.ts.map +1 -1
  256. package/dist/workspace-draw-types.js +1 -0
  257. package/dist/workspace-draw-types.js.map +1 -1
  258. package/dist/workspace-runner-main.d.ts +5 -0
  259. package/dist/workspace-runner-main.d.ts.map +1 -1
  260. package/dist/workspace-runner-main.js +15 -3
  261. package/dist/workspace-runner-main.js.map +1 -1
  262. package/open-design.json +2 -13
  263. package/package.json +1 -1
  264. package/skills/12ui-design/SKILL.md +7 -8
  265. package/dist/mcp-slate-ui-script-dialog.d.ts +0 -21
  266. package/dist/mcp-slate-ui-script-dialog.d.ts.map +0 -1
  267. package/dist/mcp-slate-ui-script-dialog.js +0 -351
  268. package/dist/mcp-slate-ui-script-dialog.js.map +0 -1
  269. package/dist/mcp-slate-ui-script-progress.d.ts +0 -7
  270. package/dist/mcp-slate-ui-script-progress.d.ts.map +0 -1
  271. package/dist/mcp-slate-ui-script-progress.js +0 -9
  272. package/dist/mcp-slate-ui-script-progress.js.map +0 -1
  273. package/dist/mcp-slate-ui-styles-dialog.d.ts +0 -20
  274. package/dist/mcp-slate-ui-styles-dialog.d.ts.map +0 -1
  275. package/dist/mcp-slate-ui-styles-dialog.js +0 -87
  276. package/dist/mcp-slate-ui-styles-dialog.js.map +0 -1
@@ -1,13 +1,7 @@
1
1
  /**
2
- * The inline card: one large image of the selected option with a badge,
3
- * Select under it, and the strip of thumbnails (the newest round, plus the
4
- * picked or viewed option of an older round) on as many rows as it takes,
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.dialog = null;
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
- // A dialog that is open follows the view: what this Mac can do now, for one.
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. An open dialog and the Generate more panel
67
- // close, because they were built in the old words; what the person typed in the search box stays (state.query).
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.dialog) { state.dialog = null; if (stageEls.dialog) stageEls.dialog.textContent = ""; }
70
- if (state.more) resetMore();
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
- var pane = $("pane-inspiration");
75
- pane.__built = false;
76
- pane.textContent = "";
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
- $("pane-designs").classList.toggle("hidden", !onDesigns);
201
- $("pane-inspiration").classList.toggle("hidden", onDesigns);
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
- renderInspiration($("pane-inspiration"), "card");
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
- var c = selectedCandidate();
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 v = selectedVersion();
232
- var same = samePick(v);
233
- var label = same ? t("selected") : t("select");
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;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgQxC,CAAC"}
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 Inspiration tab's collage: every grid of reference tiles (and the skeleton tiles of a search in flight) is laid
3
- * out by the 12ui web gallery's own mosaic band solver, `packMosaicBands` from `mosaic-bands.ts`, whose source is
4
- * embedded here as is. Each picture keeps its aspect ratio (from the reference's recorded width and height, else its
5
- * recorded aspect, by the solver's own rule) and every band is exactly as wide as the grid.
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 192 px across in the card and 256 px in the workspace (the old square tiles'
10
- * minimums), two across at the least, and holds at most four columns; the gap is 8 px, room for a selected tile's
11
- * ring;
12
- * - a section with fewer pictures than a row holds is as wide as those pictures would be in a full row, so a round
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
- * The grid is measured, so it is laid out after it is built and again whenever the pane's width changes (a window
16
- * resize, the card's scroll bar, the tab shown again). Tiles stay in result order in the document, so the keyboard
17
- * walks them in the order the search ranked them.
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;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,QA+CxC,CAAC"}
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 Inspiration tab's collage: every grid of reference tiles (and the skeleton tiles of a search in flight) is laid
4
- * out by the 12ui web gallery's own mosaic band solver, `packMosaicBands` from `mosaic-bands.ts`, whose source is
5
- * embedded here as is. Each picture keeps its aspect ratio (from the reference's recorded width and height, else its
6
- * recorded aspect, by the solver's own rule) and every band is exactly as wide as the grid.
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 192 px across in the card and 256 px in the workspace (the old square tiles'
11
- * minimums), two across at the least, and holds at most four columns; the gap is 8 px, room for a selected tile's
12
- * ring;
13
- * - a section with fewer pictures than a row holds is as wide as those pictures would be in a full row, so a round
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
- * The grid is measured, so it is laid out after it is built and again whenever the pane's width changes (a window
17
- * resize, the card's scroll bar, the tab shown again). Tiles stay in result order in the document, so the keyboard
18
- * walks them in the order the search ranked them.
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: 192, stage: 256 }, gap: 8, columns: 4 };
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 s = tiles[Number(p.id)].style;
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 grid in the pane that has a width and was not laid out at it (a hidden pane has none: it is laid out when shown).
60
- function layoutResults(pane) {
61
- var grids = pane.__results.querySelectorAll(".refgrid");
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], pane.__where, width);
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;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAAA;;2BAE3B,eAAe,CAAC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CpD,CAAC"}
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"}