@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.
Files changed (282) 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 +32 -1
  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 +25 -1
  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-script.d.ts +2 -1
  182. package/dist/slate-browser-host-script.d.ts.map +1 -1
  183. package/dist/slate-browser-host-script.js +4 -3
  184. package/dist/slate-browser-host-script.js.map +1 -1
  185. package/dist/slate-browser-host.d.ts +21 -2
  186. package/dist/slate-browser-host.d.ts.map +1 -1
  187. package/dist/slate-browser-host.js +38 -5
  188. package/dist/slate-browser-host.js.map +1 -1
  189. package/dist/slate-browser-server.d.ts +2 -2
  190. package/dist/slate-browser-server.d.ts.map +1 -1
  191. package/dist/slate-browser-server.js +13 -12
  192. package/dist/slate-browser-server.js.map +1 -1
  193. package/dist/slate-commit.d.ts.map +1 -1
  194. package/dist/slate-commit.js +12 -5
  195. package/dist/slate-commit.js.map +1 -1
  196. package/dist/slate-handoff.d.ts.map +1 -1
  197. package/dist/slate-handoff.js +2 -3
  198. package/dist/slate-handoff.js.map +1 -1
  199. package/dist/slate-ids.d.ts +2 -1
  200. package/dist/slate-ids.d.ts.map +1 -1
  201. package/dist/slate-ids.js +3 -2
  202. package/dist/slate-ids.js.map +1 -1
  203. package/dist/slate-reference-ids.d.ts.map +1 -1
  204. package/dist/slate-reference-ids.js +1 -0
  205. package/dist/slate-reference-ids.js.map +1 -1
  206. package/dist/slate-round-prompt.d.ts +19 -0
  207. package/dist/slate-round-prompt.d.ts.map +1 -1
  208. package/dist/slate-round-prompt.js +22 -0
  209. package/dist/slate-round-prompt.js.map +1 -1
  210. package/dist/slate-round-runner.d.ts.map +1 -1
  211. package/dist/slate-round-runner.js +16 -12
  212. package/dist/slate-round-runner.js.map +1 -1
  213. package/dist/slate-round-search.d.ts.map +1 -1
  214. package/dist/slate-round-search.js +2 -0
  215. package/dist/slate-round-search.js.map +1 -1
  216. package/dist/slate-runtime.d.ts +3 -0
  217. package/dist/slate-runtime.d.ts.map +1 -1
  218. package/dist/slate-runtime.js +1 -0
  219. package/dist/slate-runtime.js.map +1 -1
  220. package/dist/slate-site-references-capture.d.ts +20 -0
  221. package/dist/slate-site-references-capture.d.ts.map +1 -0
  222. package/dist/slate-site-references-capture.js +119 -0
  223. package/dist/slate-site-references-capture.js.map +1 -0
  224. package/dist/slate-site-references-client.d.ts +35 -0
  225. package/dist/slate-site-references-client.d.ts.map +1 -0
  226. package/dist/slate-site-references-client.js +36 -0
  227. package/dist/slate-site-references-client.js.map +1 -0
  228. package/dist/slate-site-references-local.d.ts +6 -0
  229. package/dist/slate-site-references-local.d.ts.map +1 -0
  230. package/dist/slate-site-references-local.js +63 -0
  231. package/dist/slate-site-references-local.js.map +1 -0
  232. package/dist/slate-site-references-suggest.d.ts +36 -0
  233. package/dist/slate-site-references-suggest.d.ts.map +1 -0
  234. package/dist/slate-site-references-suggest.js +144 -0
  235. package/dist/slate-site-references-suggest.js.map +1 -0
  236. package/dist/slate-site-references.d.ts +57 -0
  237. package/dist/slate-site-references.d.ts.map +1 -0
  238. package/dist/slate-site-references.js +129 -0
  239. package/dist/slate-site-references.js.map +1 -0
  240. package/dist/slate-view-contract.d.ts +29 -1
  241. package/dist/slate-view-contract.d.ts.map +1 -1
  242. package/dist/slate-view.d.ts.map +1 -1
  243. package/dist/slate-view.js +5 -0
  244. package/dist/slate-view.js.map +1 -1
  245. package/dist/slate-workspace-parse.d.ts +2 -0
  246. package/dist/slate-workspace-parse.d.ts.map +1 -1
  247. package/dist/slate-workspace-parse.js +20 -3
  248. package/dist/slate-workspace-parse.js.map +1 -1
  249. package/dist/slate-workspace-types.d.ts +17 -2
  250. package/dist/slate-workspace-types.d.ts.map +1 -1
  251. package/dist/workspace-draw-messages.d.ts +27 -5
  252. package/dist/workspace-draw-messages.d.ts.map +1 -1
  253. package/dist/workspace-draw-messages.js +29 -3
  254. package/dist/workspace-draw-messages.js.map +1 -1
  255. package/dist/workspace-draw-run.d.ts +12 -0
  256. package/dist/workspace-draw-run.d.ts.map +1 -1
  257. package/dist/workspace-draw-run.js +47 -18
  258. package/dist/workspace-draw-run.js.map +1 -1
  259. package/dist/workspace-draw-types.d.ts +2 -1
  260. package/dist/workspace-draw-types.d.ts.map +1 -1
  261. package/dist/workspace-draw-types.js +1 -0
  262. package/dist/workspace-draw-types.js.map +1 -1
  263. package/dist/workspace-runner-main.d.ts +5 -0
  264. package/dist/workspace-runner-main.d.ts.map +1 -1
  265. package/dist/workspace-runner-main.js +15 -3
  266. package/dist/workspace-runner-main.js.map +1 -1
  267. package/open-design.json +2 -13
  268. package/package.json +1 -1
  269. package/skills/12ui-design/SKILL.md +8 -11
  270. package/skills/12ui-design/scene.md +3 -9
  271. package/dist/mcp-slate-ui-script-dialog.d.ts +0 -21
  272. package/dist/mcp-slate-ui-script-dialog.d.ts.map +0 -1
  273. package/dist/mcp-slate-ui-script-dialog.js +0 -351
  274. package/dist/mcp-slate-ui-script-dialog.js.map +0 -1
  275. package/dist/mcp-slate-ui-script-progress.d.ts +0 -7
  276. package/dist/mcp-slate-ui-script-progress.d.ts.map +0 -1
  277. package/dist/mcp-slate-ui-script-progress.js +0 -9
  278. package/dist/mcp-slate-ui-script-progress.js.map +0 -1
  279. package/dist/mcp-slate-ui-styles-dialog.d.ts +0 -20
  280. package/dist/mcp-slate-ui-styles-dialog.d.ts.map +0 -1
  281. package/dist/mcp-slate-ui-styles-dialog.js +0 -87
  282. 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: the
3
- * search row, a line that says whose words are in the box, the status line,
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 grid: the search of the words in the box at the top (skeleton tiles
8
- * while it runs, a line when it found nothing), then one section per round,
9
- * newest first, with the references that produced its options. Every grid is
10
- * a collage (`mcp-slate-ui-script-inspiration-collage.ts`): each picture at
11
- * its own aspect ratio, every band as wide as the grid.
12
- * - Every reference a round used carries a badge that says where, from the
13
- * round records only: a reference is used when the round lists it
14
- * (`rounds[].referenceIds`), and the options are those whose `referenceId`
15
- * is it, e.g. "Used in round 1, option B". Nothing is inferred.
16
- * - Generate asks for one new round drawn from exactly the selected
17
- * references: it is Generate more's own request (`startRound`, which first
18
- * waits for the selection write, then `design.slate.run` with a new round),
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 === "inspiration") setTab("designs"); else renderAll();
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
- function syncGenerate(pane) {
137
- var chosen = currentSelected();
138
- pane.__bar.classList.toggle("hidden", chosen.length === 0);
139
- if (chosen.length === 0) return;
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
- var line = t("selectionDraws", { m: chosen.length, n: generateCount(chosen.length) });
143
- if (running) line = t("roundRunning");
144
- else if (!local.ready && localReason()) line = localReason();
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 count = el("p", "insphow inspcount");
179
- var pauseHost = el("div", "pausebar hidden");
180
- var pauseChoice = el("p", "help pausechoice");
181
- pauseChoice.setAttribute("aria-live", "polite");
182
- var bar = el("div", "inspbar hidden");
183
- var barText = el("p", "help");
184
- barText.setAttribute("aria-live", "polite");
185
- var generate = button(t("generate"), "primary", generateFromSelection);
186
- bar.appendChild(barText);
187
- bar.appendChild(generate);
188
- pane.__input = input;
189
- pane.__search = search;
190
- pane.__how = how;
191
- pane.__count = count;
192
- pane.__results = el("div", "results");
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(count);
202
- pane.appendChild(pane.__results);
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 () { layoutResults(pane); }).observe(pane.__results);
128
+ new ResizeObserver(function () { gallery.layout(); }).observe(results);
208
129
  }
209
- function syncHow(pane) {
210
- var text = howText();
211
- pane.__how.textContent = text;
212
- pane.__how.classList.toggle("hidden", !text);
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
- syncQuery();
218
- // The box shows the words, except while the person is in it: their caret and typing are never disturbed.
219
- if (pane.__input.value !== state.query && document.activeElement !== pane.__input) pane.__input.value = state.query;
220
- // Words longer than the field are all in its tooltip.
221
- if (pane.__input.scrollWidth > pane.__input.clientWidth) pane.__input.title = state.query; else pane.__input.removeAttribute("title");
222
- syncSearchButton(pane);
223
- syncHow(pane);
224
- var v = state.view;
225
- var search = shownSearch();
226
- pane.__results.setAttribute("aria-busy", state.insp.searching ? "true" : "false");
227
- var count = resultsText();
228
- pane.__count.textContent = count;
229
- pane.__count.classList.toggle("hidden", !count);
230
- var sig = JSON.stringify([pause.roundId, pauseActive() ? pauseChosen() : null, state.insp.searching, state.insp.noMatch, search && [search.searchId, search.referenceIds],
231
- v.rounds.map(function (r) { return [r.index, r.kind, r.fromVersionId, r.referenceIds]; }),
232
- v.candidates.map(function (c) { return [c.roundId, c.label, c.referenceId]; }), v.references]);
233
- setIfChanged(pane.__results, sig, buildResults);
234
- layoutResults(pane);
235
- var chosen = pauseActive() ? pauseChosen() : currentSelected();
236
- var buttons = pane.__results.querySelectorAll(".refbtn");
237
- for (var i = 0; i < buttons.length; i++) buttons[i].setAttribute("aria-pressed", chosen.indexOf(buttons[i].getAttribute("data-ref")) >= 0 ? "true" : "false");
238
- // While a round waits for the person, the tab's bar is the pause's: how the options take the references, and Continue.
239
- syncPauseHost(pane.__pause, false);
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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4NlD,CAAC"}
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 the Inspiration tab asks one search for: the most the free corpus returns for one query (the
3
- * public tier's cap, which both servers' inspire tools also cap at). The corpus has no paging, so this is all one search
4
- * can show; the tab says so next to the results.
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":"AAIA;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,KAA0B,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAuQjD,eAAO,MAAM,oBAAoB,QAA2F,CAAC"}
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"}