@gjermundgaraba/pixel-paper 0.0.0-stage → 0.1.0

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 (387) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/_virtual/_rolldown/runtime.js +13 -0
  4. package/dist/announcer/announcer.d.ts +35 -0
  5. package/dist/announcer/announcer.js +121 -0
  6. package/dist/announcer/index.d.ts +5 -0
  7. package/dist/announcer/index.js +11 -0
  8. package/dist/attributes/attributes.d.ts +4 -0
  9. package/dist/banner/banner.d.ts +20 -0
  10. package/dist/banner/banner.js +18 -0
  11. package/dist/banner/index.d.ts +5 -0
  12. package/dist/banner/index.js +6 -0
  13. package/dist/bench/bench.d.ts +16 -0
  14. package/dist/bench/bench.js +12 -0
  15. package/dist/bench/index.d.ts +5 -0
  16. package/dist/bench/index.js +6 -0
  17. package/dist/board/board.d.ts +1151 -0
  18. package/dist/board/board.js +449 -0
  19. package/dist/board/index.d.ts +6 -0
  20. package/dist/board/index.js +21 -0
  21. package/dist/button/button.d.ts +54 -0
  22. package/dist/button/button.js +50 -0
  23. package/dist/button/index.d.ts +5 -0
  24. package/dist/button/index.js +9 -0
  25. package/dist/card/card.d.ts +66 -0
  26. package/dist/card/card.js +70 -0
  27. package/dist/card/index.d.ts +5 -0
  28. package/dist/card/index.js +10 -0
  29. package/dist/chip/chip.d.ts +27 -0
  30. package/dist/chip/chip.js +34 -0
  31. package/dist/chip/index.d.ts +5 -0
  32. package/dist/chip/index.js +9 -0
  33. package/dist/choice/choice.d.ts +16 -0
  34. package/dist/choice/choice.js +17 -0
  35. package/dist/choice/index.d.ts +5 -0
  36. package/dist/choice/index.js +6 -0
  37. package/dist/code-editor/code-editor.d.ts +15 -0
  38. package/dist/code-editor/code-editor.js +22 -0
  39. package/dist/code-editor/index.d.ts +5 -0
  40. package/dist/code-editor/index.js +6 -0
  41. package/dist/code-surface/code-surface.d.ts +12 -0
  42. package/dist/code-surface/code-surface.js +12 -0
  43. package/dist/code-surface/index.d.ts +5 -0
  44. package/dist/code-surface/index.js +6 -0
  45. package/dist/command-palette/command-palette.d.ts +579 -0
  46. package/dist/command-palette/command-palette.js +600 -0
  47. package/dist/command-palette/index.d.ts +9 -0
  48. package/dist/command-palette/index.js +32 -0
  49. package/dist/command-palette/keys.d.ts +13 -0
  50. package/dist/command-palette/keys.js +71 -0
  51. package/dist/command-palette/match.d.ts +43 -0
  52. package/dist/command-palette/match.js +45 -0
  53. package/dist/command-palette/message.d.ts +94 -0
  54. package/dist/command-palette/message.js +46 -0
  55. package/dist/confirm-dialog/confirm-dialog.d.ts +287 -0
  56. package/dist/confirm-dialog/confirm-dialog.js +115 -0
  57. package/dist/confirm-dialog/index.d.ts +5 -0
  58. package/dist/confirm-dialog/index.js +17 -0
  59. package/dist/copy-button/copy-button.d.ts +99 -0
  60. package/dist/copy-button/copy-button.js +96 -0
  61. package/dist/copy-button/index.d.ts +5 -0
  62. package/dist/copy-button/index.js +13 -0
  63. package/dist/crumbs/crumbs.d.ts +15 -0
  64. package/dist/crumbs/crumbs.js +11 -0
  65. package/dist/crumbs/index.d.ts +5 -0
  66. package/dist/crumbs/index.js +6 -0
  67. package/dist/deck/deck.d.ts +9 -0
  68. package/dist/deck/deck.js +9 -0
  69. package/dist/deck/index.d.ts +5 -0
  70. package/dist/deck/index.js +6 -0
  71. package/dist/dialog/dialog.d.ts +278 -0
  72. package/dist/dialog/dialog.js +145 -0
  73. package/dist/dialog/fold.d.ts +58 -0
  74. package/dist/dialog/fold.js +63 -0
  75. package/dist/dialog/index.d.ts +6 -0
  76. package/dist/dialog/index.js +21 -0
  77. package/dist/disclosure/disclosure.d.ts +24 -0
  78. package/dist/disclosure/disclosure.js +25 -0
  79. package/dist/disclosure/index.d.ts +5 -0
  80. package/dist/disclosure/index.js +6 -0
  81. package/dist/dom/html-element.js +8 -0
  82. package/dist/drag/drag.d.ts +15 -0
  83. package/dist/drag/drag.js +123 -0
  84. package/dist/drop-zone/drop-zone.d.ts +119 -0
  85. package/dist/drop-zone/drop-zone.js +64 -0
  86. package/dist/drop-zone/index.d.ts +5 -0
  87. package/dist/drop-zone/index.js +14 -0
  88. package/dist/empty-state/empty-state.d.ts +18 -0
  89. package/dist/empty-state/empty-state.js +16 -0
  90. package/dist/empty-state/index.d.ts +5 -0
  91. package/dist/empty-state/index.js +6 -0
  92. package/dist/error-summary/error-summary.d.ts +34 -0
  93. package/dist/error-summary/error-summary.js +33 -0
  94. package/dist/error-summary/index.d.ts +5 -0
  95. package/dist/error-summary/index.js +6 -0
  96. package/dist/field/field.d.ts +35 -0
  97. package/dist/field/field.js +34 -0
  98. package/dist/field/index.d.ts +5 -0
  99. package/dist/field/index.js +6 -0
  100. package/dist/field-grid/field-grid.d.ts +8 -0
  101. package/dist/field-grid/field-grid.js +8 -0
  102. package/dist/field-grid/index.d.ts +5 -0
  103. package/dist/field-grid/index.js +6 -0
  104. package/dist/fields/fields.js +9 -0
  105. package/dist/fieldset/fieldset.d.ts +13 -0
  106. package/dist/fieldset/fieldset.js +13 -0
  107. package/dist/fieldset/index.d.ts +5 -0
  108. package/dist/fieldset/index.js +6 -0
  109. package/dist/filter-chip/filter-chip.d.ts +21 -0
  110. package/dist/filter-chip/filter-chip.js +28 -0
  111. package/dist/filter-chip/index.d.ts +5 -0
  112. package/dist/filter-chip/index.js +6 -0
  113. package/dist/filter-strip/filter-strip.d.ts +12 -0
  114. package/dist/filter-strip/filter-strip.js +13 -0
  115. package/dist/filter-strip/index.d.ts +5 -0
  116. package/dist/filter-strip/index.js +6 -0
  117. package/dist/flash-word/flash-word.d.ts +31 -0
  118. package/dist/flash-word/flash-word.js +31 -0
  119. package/dist/flash-word/index.d.ts +5 -0
  120. package/dist/flash-word/index.js +9 -0
  121. package/dist/focus/focus.d.ts +15 -0
  122. package/dist/focus/focus.js +17 -0
  123. package/dist/focus/index.d.ts +5 -0
  124. package/dist/focus/index.js +9 -0
  125. package/dist/format/format.js +52 -0
  126. package/dist/format/index.d.ts +5 -0
  127. package/dist/format/index.js +6 -0
  128. package/dist/glyph/glyph.d.ts +9 -0
  129. package/dist/glyph/glyph.js +25 -0
  130. package/dist/glyph/glyphs.d.ts +381 -0
  131. package/dist/glyph/glyphs.js +2603 -0
  132. package/dist/glyph/index.d.ts +5 -0
  133. package/dist/glyph/index.js +6 -0
  134. package/dist/group/group.d.ts +8 -0
  135. package/dist/group/group.js +9 -0
  136. package/dist/group/index.d.ts +5 -0
  137. package/dist/group/index.js +6 -0
  138. package/dist/history/history.d.ts +34 -0
  139. package/dist/history/history.js +15 -0
  140. package/dist/history/index.d.ts +5 -0
  141. package/dist/history/index.js +6 -0
  142. package/dist/icon-button/icon-button.d.ts +23 -0
  143. package/dist/icon-button/icon-button.js +23 -0
  144. package/dist/icon-button/index.d.ts +5 -0
  145. package/dist/icon-button/index.js +6 -0
  146. package/dist/identity/identity.d.ts +15 -0
  147. package/dist/identity/identity.js +15 -0
  148. package/dist/identity/index.d.ts +5 -0
  149. package/dist/identity/index.js +6 -0
  150. package/dist/index.d.ts +85 -0
  151. package/dist/index.js +85 -0
  152. package/dist/inline-input/index.d.ts +5 -0
  153. package/dist/inline-input/index.js +20 -0
  154. package/dist/inline-input/inline-input.d.ts +196 -0
  155. package/dist/inline-input/inline-input.js +212 -0
  156. package/dist/key-help/index.d.ts +5 -0
  157. package/dist/key-help/index.js +18 -0
  158. package/dist/key-help/key-help.d.ts +255 -0
  159. package/dist/key-help/key-help.js +137 -0
  160. package/dist/key-hint/index.d.ts +6 -0
  161. package/dist/key-hint/index.js +12 -0
  162. package/dist/key-hint/key-hint.d.ts +13 -0
  163. package/dist/key-hint/key-hint.js +7 -0
  164. package/dist/key-hint/key-label.d.ts +18 -0
  165. package/dist/key-hint/key-label.js +77 -0
  166. package/dist/keymap/keymap.d.ts +11 -0
  167. package/dist/keymap/keymap.js +9 -0
  168. package/dist/keys/keys.js +4 -0
  169. package/dist/line-diff/diff.d.ts +2 -0
  170. package/dist/line-diff/diff.js +73 -0
  171. package/dist/line-diff/index.d.ts +6 -0
  172. package/dist/line-diff/index.js +10 -0
  173. package/dist/line-diff/line-diff.d.ts +21 -0
  174. package/dist/line-diff/line-diff.js +75 -0
  175. package/dist/line-diff/patch.d.ts +15 -0
  176. package/dist/line-diff/patch.js +120 -0
  177. package/dist/link-button/index.d.ts +5 -0
  178. package/dist/link-button/index.js +6 -0
  179. package/dist/link-button/link-button.d.ts +11 -0
  180. package/dist/link-button/link-button.js +10 -0
  181. package/dist/link-state/index.d.ts +5 -0
  182. package/dist/link-state/index.js +6 -0
  183. package/dist/link-state/link-state.d.ts +15 -0
  184. package/dist/link-state/link-state.js +17 -0
  185. package/dist/live-region/index.d.ts +5 -0
  186. package/dist/live-region/index.js +9 -0
  187. package/dist/live-region/live-region.d.ts +39 -0
  188. package/dist/live-region/live-region.js +33 -0
  189. package/dist/loading/index.d.ts +5 -0
  190. package/dist/loading/index.js +6 -0
  191. package/dist/loading/loading.d.ts +19 -0
  192. package/dist/loading/loading.js +16 -0
  193. package/dist/locale/locale.d.ts +3 -0
  194. package/dist/locale/locale.js +5 -0
  195. package/dist/mark/index.d.ts +5 -0
  196. package/dist/mark/index.js +6 -0
  197. package/dist/mark/mark.d.ts +15 -0
  198. package/dist/mark/mark.js +30 -0
  199. package/dist/menu/index.d.ts +7 -0
  200. package/dist/menu/index.js +25 -0
  201. package/dist/menu/item.d.ts +236 -0
  202. package/dist/menu/item.js +19 -0
  203. package/dist/menu/menu.d.ts +206 -0
  204. package/dist/menu/menu.js +208 -0
  205. package/dist/menu/slip.js +163 -0
  206. package/dist/meter/index.d.ts +5 -0
  207. package/dist/meter/index.js +6 -0
  208. package/dist/meter/meter.d.ts +38 -0
  209. package/dist/meter/meter.js +69 -0
  210. package/dist/monogram/monogram.js +33 -0
  211. package/dist/nav-strip/index.d.ts +5 -0
  212. package/dist/nav-strip/index.js +6 -0
  213. package/dist/nav-strip/nav-strip.d.ts +19 -0
  214. package/dist/nav-strip/nav-strip.js +21 -0
  215. package/dist/notice/index.d.ts +5 -0
  216. package/dist/notice/index.js +6 -0
  217. package/dist/notice/notice.d.ts +23 -0
  218. package/dist/notice/notice.js +35 -0
  219. package/dist/outcome/index.d.ts +5 -0
  220. package/dist/outcome/index.js +6 -0
  221. package/dist/outcome/outcome.d.ts +19 -0
  222. package/dist/outcome/outcome.js +14 -0
  223. package/dist/page-head/index.d.ts +5 -0
  224. package/dist/page-head/index.js +6 -0
  225. package/dist/page-head/page-head.d.ts +13 -0
  226. package/dist/page-head/page-head.js +10 -0
  227. package/dist/panel/index.d.ts +5 -0
  228. package/dist/panel/index.js +6 -0
  229. package/dist/panel/panel.d.ts +35 -0
  230. package/dist/panel/panel.js +25 -0
  231. package/dist/password-field/index.d.ts +5 -0
  232. package/dist/password-field/index.js +6 -0
  233. package/dist/password-field/password-field.d.ts +33 -0
  234. package/dist/password-field/password-field.js +39 -0
  235. package/dist/places/index.d.ts +5 -0
  236. package/dist/places/index.js +6 -0
  237. package/dist/places/places.d.ts +32 -0
  238. package/dist/places/places.js +22 -0
  239. package/dist/props-list/index.d.ts +5 -0
  240. package/dist/props-list/index.js +6 -0
  241. package/dist/props-list/props-list.d.ts +18 -0
  242. package/dist/props-list/props-list.js +12 -0
  243. package/dist/prose/index.d.ts +5 -0
  244. package/dist/prose/index.js +6 -0
  245. package/dist/prose/prose.d.ts +14 -0
  246. package/dist/prose/prose.js +6 -0
  247. package/dist/query-chip/index.d.ts +5 -0
  248. package/dist/query-chip/index.js +6 -0
  249. package/dist/query-chip/query-chip.d.ts +18 -0
  250. package/dist/query-chip/query-chip.js +17 -0
  251. package/dist/radio-choices/index.d.ts +5 -0
  252. package/dist/radio-choices/index.js +12 -0
  253. package/dist/radio-choices/radio-choices.d.ts +105 -0
  254. package/dist/radio-choices/radio-choices.js +56 -0
  255. package/dist/rail/index.d.ts +5 -0
  256. package/dist/rail/index.js +22 -0
  257. package/dist/rail/rail.d.ts +403 -0
  258. package/dist/rail/rail.js +355 -0
  259. package/dist/reel/index.d.ts +6 -0
  260. package/dist/reel/index.js +26 -0
  261. package/dist/reel/layout.d.ts +58 -0
  262. package/dist/reel/layout.js +378 -0
  263. package/dist/reel/reel.d.ts +1070 -0
  264. package/dist/reel/reel.js +1019 -0
  265. package/dist/remote/index.d.ts +5 -0
  266. package/dist/remote/index.js +6 -0
  267. package/dist/remote/remote.d.ts +28 -0
  268. package/dist/remote/remote.js +41 -0
  269. package/dist/rows/index.d.ts +5 -0
  270. package/dist/rows/index.js +12 -0
  271. package/dist/rows/rows.d.ts +116 -0
  272. package/dist/rows/rows.js +67 -0
  273. package/dist/scheme/index.d.ts +6 -0
  274. package/dist/scheme/index.js +10 -0
  275. package/dist/scheme/scheme-switch.d.ts +98 -0
  276. package/dist/scheme/scheme-switch.js +118 -0
  277. package/dist/scheme/scheme.d.ts +5 -0
  278. package/dist/scheme/scheme.js +16 -0
  279. package/dist/scheme/script.d.ts +8 -0
  280. package/dist/scheme/script.js +10 -0
  281. package/dist/secret/index.d.ts +5 -0
  282. package/dist/secret/index.js +6 -0
  283. package/dist/secret/secret.d.ts +13 -0
  284. package/dist/secret/secret.js +9 -0
  285. package/dist/segmented/index.d.ts +5 -0
  286. package/dist/segmented/index.js +6 -0
  287. package/dist/segmented/segmented.d.ts +17 -0
  288. package/dist/segmented/segmented.js +17 -0
  289. package/dist/select-field/index.d.ts +5 -0
  290. package/dist/select-field/index.js +6 -0
  291. package/dist/select-field/select-field.d.ts +38 -0
  292. package/dist/select-field/select-field.js +29 -0
  293. package/dist/sheet/index.d.ts +5 -0
  294. package/dist/sheet/index.js +6 -0
  295. package/dist/sheet/sheet.d.ts +16 -0
  296. package/dist/sheet/sheet.js +15 -0
  297. package/dist/skip-link/index.d.ts +5 -0
  298. package/dist/skip-link/index.js +9 -0
  299. package/dist/skip-link/skip-link.d.ts +23 -0
  300. package/dist/skip-link/skip-link.js +36 -0
  301. package/dist/slot/slot.js +8 -0
  302. package/dist/sortable/index.d.ts +5 -0
  303. package/dist/sortable/index.js +16 -0
  304. package/dist/sortable/sortable.d.ts +1125 -0
  305. package/dist/sortable/sortable.js +431 -0
  306. package/dist/stack/index.d.ts +5 -0
  307. package/dist/stack/index.js +6 -0
  308. package/dist/stack/stack.d.ts +15 -0
  309. package/dist/stack/stack.js +12 -0
  310. package/dist/stage/index.d.ts +5 -0
  311. package/dist/stage/index.js +6 -0
  312. package/dist/stage/stage.d.ts +14 -0
  313. package/dist/stage/stage.js +11 -0
  314. package/dist/stat/index.d.ts +5 -0
  315. package/dist/stat/index.js +6 -0
  316. package/dist/stat/stat.d.ts +18 -0
  317. package/dist/stat/stat.js +13 -0
  318. package/dist/status-bar/index.d.ts +6 -0
  319. package/dist/status-bar/index.js +11 -0
  320. package/dist/status-bar/status-bar.d.ts +28 -0
  321. package/dist/status-bar/status-bar.js +19 -0
  322. package/dist/subscription/prefix-keys.js +12 -0
  323. package/dist/table/index.d.ts +5 -0
  324. package/dist/table/index.js +6 -0
  325. package/dist/table/table.d.ts +26 -0
  326. package/dist/table/table.js +18 -0
  327. package/dist/tabs/index.d.ts +5 -0
  328. package/dist/tabs/index.js +14 -0
  329. package/dist/tabs/tabs.d.ts +125 -0
  330. package/dist/tabs/tabs.js +57 -0
  331. package/dist/tag/index.d.ts +5 -0
  332. package/dist/tag/index.js +6 -0
  333. package/dist/tag/tag.d.ts +16 -0
  334. package/dist/tag/tag.js +25 -0
  335. package/dist/text-button/index.d.ts +5 -0
  336. package/dist/text-button/index.js +6 -0
  337. package/dist/text-button/text-button.d.ts +8 -0
  338. package/dist/text-button/text-button.js +12 -0
  339. package/dist/textarea-field/index.d.ts +5 -0
  340. package/dist/textarea-field/index.js +6 -0
  341. package/dist/textarea-field/textarea-field.d.ts +28 -0
  342. package/dist/textarea-field/textarea-field.js +30 -0
  343. package/dist/time/index.d.ts +5 -0
  344. package/dist/time/index.js +9 -0
  345. package/dist/time/time.d.ts +38 -0
  346. package/dist/time/time.js +63 -0
  347. package/dist/tips/index.d.ts +5 -0
  348. package/dist/tips/index.js +14 -0
  349. package/dist/tips/tips.d.ts +339 -0
  350. package/dist/tips/tips.js +308 -0
  351. package/dist/toast/index.d.ts +5 -0
  352. package/dist/toast/index.js +17 -0
  353. package/dist/toast/stack.d.ts +7 -0
  354. package/dist/toast/stack.js +23 -0
  355. package/dist/toast/toast.d.ts +559 -0
  356. package/dist/toast/toast.js +269 -0
  357. package/dist/toc/index.d.ts +5 -0
  358. package/dist/toc/index.js +9 -0
  359. package/dist/toc/toc.d.ts +42 -0
  360. package/dist/toc/toc.js +35 -0
  361. package/dist/top-bar/bar-height.d.ts +26 -0
  362. package/dist/top-bar/bar-height.js +43 -0
  363. package/dist/top-bar/index.d.ts +6 -0
  364. package/dist/top-bar/index.js +12 -0
  365. package/dist/top-bar/top-bar.d.ts +19 -0
  366. package/dist/top-bar/top-bar.js +18 -0
  367. package/dist/wall/index.d.ts +5 -0
  368. package/dist/wall/index.js +9 -0
  369. package/dist/wall/wall.d.ts +16 -0
  370. package/dist/wall/wall.js +15 -0
  371. package/dist/window/index.d.ts +5 -0
  372. package/dist/window/index.js +6 -0
  373. package/dist/window/window.d.ts +28 -0
  374. package/dist/window/window.js +29 -0
  375. package/dist/wordmark/index.d.ts +5 -0
  376. package/dist/wordmark/index.js +6 -0
  377. package/dist/wordmark/wordmark.d.ts +10 -0
  378. package/dist/wordmark/wordmark.js +10 -0
  379. package/dist/wrap/index.d.ts +5 -0
  380. package/dist/wrap/index.js +6 -0
  381. package/dist/wrap/wrap.d.ts +12 -0
  382. package/dist/wrap/wrap.js +9 -0
  383. package/fonts/DepartureMono-Regular.woff2 +0 -0
  384. package/fonts/LICENSE.txt +2 -0
  385. package/package.json +57 -3
  386. package/src/pixel-paper.css +4611 -0
  387. package/src/tokens.css +151 -0
@@ -0,0 +1,579 @@
1
+ import { Command } from "./match.js";
2
+ import { Message } from "./message.js";
3
+ import { Effect, Option, Schema } from "effect";
4
+ import * as FoldkitCommand from "foldkit/command";
5
+ import { Html } from "foldkit/html";
6
+ import * as Subscription from "foldkit/subscription";
7
+ import * as Update from "foldkit/update";
8
+ /** Schema for a command palette: its Dialog, the commands' query and cursor (kept while a
9
+ * page is open, so Back restores them), the open page, and the choice being picked. A cursor
10
+ * is a row's id, so it holds to its row while the list changes. The rows are the view's
11
+ * (built from its `commands`), so ↑, ↓ and Enter carry what their render showed: its rows,
12
+ * the row it showed the cursor on, and the query and waiting arrows it was rendered with.
13
+ * When that query is the Model's and the render had applied the waiting arrows, those rows
14
+ * are the list, and update steps among them from the Model's cursor. A key pressed before the
15
+ * view caught up (as the palette opens, or just after typing, while the list still shows the
16
+ * last query's rows) cannot name a row yet: `cursorShift` counts the arrows, which the next
17
+ * render applies from the cursor's row, and `isEnterPending` an Enter. Such a key returns
18
+ * `ReportPendingKeys`, which reads the row the next render shows the cursor on: it becomes
19
+ * the cursor, and a waiting Enter acts on it. `renderGeneration` counts the changes to the
20
+ * page, the query and the waiting arrows, so a report from an older render is refused. */
21
+ export declare const Model: Schema.Struct<{
22
+ readonly dialog: Schema.Struct<{
23
+ readonly dialog: Schema.Struct<{
24
+ readonly id: Schema.String;
25
+ readonly isOpen: Schema.Boolean;
26
+ readonly isAnimated: Schema.Boolean;
27
+ readonly animation: Schema.Struct<{
28
+ readonly id: Schema.String;
29
+ readonly isShowing: Schema.Boolean;
30
+ readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
31
+ readonly transitionGeneration: Schema.Number;
32
+ }>;
33
+ readonly maybeFocusSelector: Schema.Option<Schema.String>;
34
+ }>;
35
+ }>;
36
+ readonly query: Schema.String;
37
+ readonly maybeCursor: Schema.Option<Schema.String>;
38
+ readonly cursorShift: Schema.Finite;
39
+ readonly isEnterPending: Schema.Boolean;
40
+ readonly renderGeneration: Schema.Int;
41
+ readonly maybePage: Schema.Option<Schema.Struct<{
42
+ readonly commandId: Schema.String;
43
+ readonly query: Schema.String;
44
+ readonly maybeCursor: Schema.Option<Schema.String>;
45
+ }>>;
46
+ readonly maybePicking: Schema.Option<Schema.String>;
47
+ }>;
48
+ export type Model = typeof Model.Type;
49
+ /** Union of OutMessages a command palette reports. `SelectedCommand`: run this command; the
50
+ * palette has closed first, so what it opens takes focus. `SelectedChoice`: apply this choice
51
+ * of that command's page; the page holds, the row printing the working cursor, until the
52
+ * caller reports back with `pickSucceeded` or `pickFailed`. `Closed`: the reader dismissed
53
+ * the palette (Escape, a press on the veil), even while a pick was out; a write already
54
+ * running keeps running, and its answer no longer changes the palette. */
55
+ export declare const OutMessage: import("foldkit/message").MessageUnion<{
56
+ readonly SelectedCommand: {
57
+ id: Schema.String;
58
+ };
59
+ readonly SelectedChoice: {
60
+ commandId: Schema.String;
61
+ choiceId: Schema.String;
62
+ };
63
+ readonly Closed: {};
64
+ }>;
65
+ export type OutMessage = typeof OutMessage.Type;
66
+ /** Configuration for creating a command palette with `init`. The `id` must be unique in the
67
+ * document. */
68
+ export type InitConfig = Readonly<{
69
+ id: string;
70
+ }>;
71
+ /** Creates a closed command palette. */
72
+ export declare const init: (config: InitConfig) => Model;
73
+ /** The palette's id, unique in the document. */
74
+ export declare const id: (model: Model) => string;
75
+ /** Whether the palette is open. */
76
+ export declare const isOpen: (model: Model) => boolean;
77
+ /** The words in the field: the open page's, or the commands'. A page whose choices are a
78
+ * function of what is typed reads it here. */
79
+ export declare const query: (model: Model) => string;
80
+ /** The command whose page is open. */
81
+ export declare const maybePageId: (model: Model) => Option.Option<string>;
82
+ /** Whether a picked choice is waiting for the caller's answer. */
83
+ export declare const isPicking: (model: Model) => boolean;
84
+ /**
85
+ * Scrolls the cursor's row of the palette `paletteId` (its `id`) into view by the least
86
+ * distance, once the view has rendered. The palette returns it itself as the cursor moves, the
87
+ * query changes or a page opens; an application returns it too when the rows change under an
88
+ * open palette (see `maybeCursorId`), or as it opens one on a page whose cursor may be far
89
+ * down, and resolves it with `Message.CompletedScrollToCursor` in a Scene.
90
+ */
91
+ export declare const ScrollToCursor: FoldkitCommand.CommandDefinitionWithArgs<"ScrollToCursor", {
92
+ paletteId: Schema.String;
93
+ }, Effect.Effect<{
94
+ readonly _tag: "CompletedScrollToCursor";
95
+ }, never, never>>;
96
+ /** Processes a command palette Message and returns the next Model, Commands and OutMessage. */
97
+ export declare const update: (model: Model, message: Message) => Readonly<{
98
+ model: {
99
+ readonly dialog: {
100
+ readonly dialog: {
101
+ readonly id: string;
102
+ readonly isOpen: boolean;
103
+ readonly isAnimated: boolean;
104
+ readonly animation: {
105
+ readonly id: string;
106
+ readonly isShowing: boolean;
107
+ readonly transitionState: "EnterAnimating" | "EnterStart" | "Idle" | "LeaveAnimating" | "LeaveStart";
108
+ readonly transitionGeneration: number;
109
+ };
110
+ readonly maybeFocusSelector: Option.Option<string>;
111
+ };
112
+ };
113
+ readonly query: string;
114
+ readonly maybeCursor: Option.Option<string>;
115
+ readonly cursorShift: number;
116
+ readonly isEnterPending: boolean;
117
+ readonly renderGeneration: number;
118
+ readonly maybePage: Option.Option<{
119
+ readonly commandId: string;
120
+ readonly query: string;
121
+ readonly maybeCursor: Option.Option<string>;
122
+ }>;
123
+ readonly maybePicking: Option.Option<string>;
124
+ };
125
+ commands?: Update.Commands<{
126
+ readonly _tag: "CompletedFocus";
127
+ } | {
128
+ readonly _tag: "CompletedScrollToCursor";
129
+ } | {
130
+ readonly _tag: "CompletedReportPendingKeys";
131
+ readonly renderGeneration: number;
132
+ readonly maybeRow: Option.Option<{
133
+ readonly id: string;
134
+ readonly isHeld: boolean;
135
+ readonly hasPage: boolean;
136
+ }>;
137
+ } | {
138
+ readonly _tag: "ClickedBack";
139
+ } | {
140
+ readonly _tag: "ClickedRow";
141
+ readonly row: {
142
+ readonly id: string;
143
+ readonly isHeld: boolean;
144
+ readonly hasPage: boolean;
145
+ };
146
+ readonly maybeShownPage: Option.Option<string>;
147
+ } | {
148
+ readonly _tag: "GotDialogMessage";
149
+ readonly message: {
150
+ readonly _tag: "GotDialogMessage";
151
+ readonly message: {
152
+ readonly _tag: "CompletedCloseDialog";
153
+ } | {
154
+ readonly _tag: "CompletedReleaseDialogResources";
155
+ } | {
156
+ readonly _tag: "FailedAcquireResources";
157
+ } | {
158
+ readonly _tag: "FailedShowDialog";
159
+ } | {
160
+ readonly _tag: "GotAnimationMessage";
161
+ readonly message: {
162
+ readonly _tag: "CompletedWaitForPaint";
163
+ readonly generation: number;
164
+ } | {
165
+ readonly _tag: "EndedAnimation";
166
+ readonly generation: number;
167
+ } | {
168
+ readonly _tag: "Hid";
169
+ } | {
170
+ readonly _tag: "Showed";
171
+ };
172
+ } | {
173
+ readonly _tag: "RequestedClose";
174
+ } | {
175
+ readonly _tag: "RequestedOpen";
176
+ } | {
177
+ readonly _tag: "SucceededAcquireResources";
178
+ } | {
179
+ readonly _tag: "SucceededShowDialog";
180
+ } | {
181
+ readonly _tag: "Unmounted";
182
+ };
183
+ } | {
184
+ readonly _tag: "PressedActionKey";
185
+ readonly direction: "Next" | "Previous";
186
+ };
187
+ } | {
188
+ readonly _tag: "PressedArrowKey";
189
+ readonly key: "ArrowDown" | "ArrowUp";
190
+ readonly snapshot: {
191
+ readonly maybeShownPage: Option.Option<string>;
192
+ readonly shownQuery: string;
193
+ readonly shownShift: number;
194
+ readonly rows: readonly {
195
+ readonly id: string;
196
+ readonly isHeld: boolean;
197
+ readonly hasPage: boolean;
198
+ }[];
199
+ readonly maybeShownCursor: Option.Option<string>;
200
+ };
201
+ } | {
202
+ readonly _tag: "PressedBackspace";
203
+ readonly maybeShownPage: Option.Option<string>;
204
+ } | {
205
+ readonly _tag: "PressedEarlyArrowKey";
206
+ readonly key: "ArrowDown" | "ArrowUp";
207
+ } | {
208
+ readonly _tag: "PressedEarlyEnter";
209
+ } | {
210
+ readonly _tag: "PressedEnter";
211
+ readonly snapshot: {
212
+ readonly maybeShownPage: Option.Option<string>;
213
+ readonly shownQuery: string;
214
+ readonly shownShift: number;
215
+ readonly rows: readonly {
216
+ readonly id: string;
217
+ readonly isHeld: boolean;
218
+ readonly hasPage: boolean;
219
+ }[];
220
+ readonly maybeShownCursor: Option.Option<string>;
221
+ };
222
+ } | {
223
+ readonly _tag: "UpdatedQuery";
224
+ readonly value: string;
225
+ readonly maybeShownPage: Option.Option<string>;
226
+ }, never>;
227
+ outMessage?: {
228
+ readonly _tag: "Closed";
229
+ } | {
230
+ readonly _tag: "SelectedChoice";
231
+ readonly commandId: string;
232
+ readonly choiceId: string;
233
+ } | {
234
+ readonly _tag: "SelectedCommand";
235
+ readonly id: string;
236
+ };
237
+ }>;
238
+ /** Opens the palette on the commands, with an empty field and the cursor on the first row.
239
+ * Snapshot what the commands act on (the selected item, its title for `scope`) in the
240
+ * caller's Model as it opens, and build `commands` from that snapshot until it closes. */
241
+ export declare const open: (model: Model) => Update.Return<Model, Message>;
242
+ /** Configuration for `openAt`. */
243
+ export type OpenAtConfig = Readonly<{
244
+ /** The command whose page opens, one that has a page. The cursor starts on its `start`,
245
+ * else its `current`. */
246
+ commandId: string;
247
+ }>;
248
+ /** Opens the palette straight on a command's page. Back still leads to the commands. */
249
+ export declare const openAt: (model: Model, config: OpenAtConfig) => Update.Return<Model, Message>;
250
+ /** The caller applied the choice: the palette closes. An answer for a pick that is no longer
251
+ * out (the palette was dismissed, its page left, or a newer pick replaced it) changes
252
+ * nothing; the caller keeps the write it made. */
253
+ export declare const pickSucceeded: (model: Model, choiceId: string) => Update.Return<Model, Message>;
254
+ /** The caller refused the choice: the page stays with its query, focus and the cursor on that
255
+ * choice; say why in the view's `toDetailView`. An answer for a pick that is no longer out
256
+ * changes nothing. */
257
+ export declare const pickFailed: (model: Model, choiceId: string) => Update.Return<Model, Message>;
258
+ /** While the palette is open, takes ↑ ↓ and Enter pressed before its field has focus (the
259
+ * field's own are the view's), on the window, before the page's own key bindings see them,
260
+ * so the keys pressed straight after the one that opened it are not lost. Lift it into the
261
+ * application's Subscriptions, once per palette, with a key prefix of the parent's that no
262
+ * other record on the page uses: `subscriptions("palette")` is keyed `paletteEarlyKeys`. */
263
+ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) => {
264
+ readonly earlyKeys: Subscription.EntryWithoutKeepAlive<{
265
+ readonly dialog: {
266
+ readonly dialog: {
267
+ readonly id: string;
268
+ readonly isOpen: boolean;
269
+ readonly isAnimated: boolean;
270
+ readonly animation: {
271
+ readonly id: string;
272
+ readonly isShowing: boolean;
273
+ readonly transitionState: "EnterAnimating" | "EnterStart" | "Idle" | "LeaveAnimating" | "LeaveStart";
274
+ readonly transitionGeneration: number;
275
+ };
276
+ readonly maybeFocusSelector: Option.Option<string>;
277
+ };
278
+ };
279
+ readonly query: string;
280
+ readonly maybeCursor: Option.Option<string>;
281
+ readonly cursorShift: number;
282
+ readonly isEnterPending: boolean;
283
+ readonly renderGeneration: number;
284
+ readonly maybePage: Option.Option<{
285
+ readonly commandId: string;
286
+ readonly query: string;
287
+ readonly maybeCursor: Option.Option<string>;
288
+ }>;
289
+ readonly maybePicking: Option.Option<string>;
290
+ }, {
291
+ readonly _tag: "CompletedFocus";
292
+ } | {
293
+ readonly _tag: "CompletedScrollToCursor";
294
+ } | {
295
+ readonly _tag: "CompletedReportPendingKeys";
296
+ readonly renderGeneration: number;
297
+ readonly maybeRow: Option.Option<{
298
+ readonly id: string;
299
+ readonly isHeld: boolean;
300
+ readonly hasPage: boolean;
301
+ }>;
302
+ } | {
303
+ readonly _tag: "ClickedBack";
304
+ } | {
305
+ readonly _tag: "ClickedRow";
306
+ readonly row: {
307
+ readonly id: string;
308
+ readonly isHeld: boolean;
309
+ readonly hasPage: boolean;
310
+ };
311
+ readonly maybeShownPage: Option.Option<string>;
312
+ } | {
313
+ readonly _tag: "GotDialogMessage";
314
+ readonly message: {
315
+ readonly _tag: "GotDialogMessage";
316
+ readonly message: {
317
+ readonly _tag: "CompletedCloseDialog";
318
+ } | {
319
+ readonly _tag: "CompletedReleaseDialogResources";
320
+ } | {
321
+ readonly _tag: "FailedAcquireResources";
322
+ } | {
323
+ readonly _tag: "FailedShowDialog";
324
+ } | {
325
+ readonly _tag: "GotAnimationMessage";
326
+ readonly message: {
327
+ readonly _tag: "CompletedWaitForPaint";
328
+ readonly generation: number;
329
+ } | {
330
+ readonly _tag: "EndedAnimation";
331
+ readonly generation: number;
332
+ } | {
333
+ readonly _tag: "Hid";
334
+ } | {
335
+ readonly _tag: "Showed";
336
+ };
337
+ } | {
338
+ readonly _tag: "RequestedClose";
339
+ } | {
340
+ readonly _tag: "RequestedOpen";
341
+ } | {
342
+ readonly _tag: "SucceededAcquireResources";
343
+ } | {
344
+ readonly _tag: "SucceededShowDialog";
345
+ } | {
346
+ readonly _tag: "Unmounted";
347
+ };
348
+ } | {
349
+ readonly _tag: "PressedActionKey";
350
+ readonly direction: "Next" | "Previous";
351
+ };
352
+ } | {
353
+ readonly _tag: "PressedArrowKey";
354
+ readonly key: "ArrowDown" | "ArrowUp";
355
+ readonly snapshot: {
356
+ readonly maybeShownPage: Option.Option<string>;
357
+ readonly shownQuery: string;
358
+ readonly shownShift: number;
359
+ readonly rows: readonly {
360
+ readonly id: string;
361
+ readonly isHeld: boolean;
362
+ readonly hasPage: boolean;
363
+ }[];
364
+ readonly maybeShownCursor: Option.Option<string>;
365
+ };
366
+ } | {
367
+ readonly _tag: "PressedBackspace";
368
+ readonly maybeShownPage: Option.Option<string>;
369
+ } | {
370
+ readonly _tag: "PressedEarlyArrowKey";
371
+ readonly key: "ArrowDown" | "ArrowUp";
372
+ } | {
373
+ readonly _tag: "PressedEarlyEnter";
374
+ } | {
375
+ readonly _tag: "PressedEnter";
376
+ readonly snapshot: {
377
+ readonly maybeShownPage: Option.Option<string>;
378
+ readonly shownQuery: string;
379
+ readonly shownShift: number;
380
+ readonly rows: readonly {
381
+ readonly id: string;
382
+ readonly isHeld: boolean;
383
+ readonly hasPage: boolean;
384
+ }[];
385
+ readonly maybeShownCursor: Option.Option<string>;
386
+ };
387
+ } | {
388
+ readonly _tag: "UpdatedQuery";
389
+ readonly value: string;
390
+ readonly maybeShownPage: Option.Option<string>;
391
+ }, {
392
+ readonly maybeOpenId: Option.Option<string>;
393
+ }, never> & {
394
+ readonly __subscription: never;
395
+ };
396
+ } extends (infer T) ? { readonly [Key in keyof T as `${Prefix}${Capitalize<Key>}`]: T[Key]; } : never;
397
+ /** Per-render inputs passed to `view` through `h.submodel`'s `viewInputs`. */
398
+ export type ViewInputs = Readonly<{
399
+ /** Built from what the caller snapshotted as the palette opened (see `open`). A command
400
+ * that leaves while its page is open sends the reader back to the commands. */
401
+ commands: readonly Command[];
402
+ /** What the commands act on, kept on every page (the selected item's name). Defaults to
403
+ * `"commands"`. */
404
+ scope?: string;
405
+ /** What else can be typed, for the placeholder (`"type a command or a title"`). */
406
+ noun?: string;
407
+ /** Above the list, on the commands and on every page: the application's own content (a
408
+ * sync notice and its retry, why a pick was refused). A function, so its controls send the
409
+ * application's Messages. */
410
+ toDetailView?: () => ReadonlyArray<Html | string>;
411
+ /** The page's live region and toasts while this is the topmost open dialog, `undefined`
412
+ * while it is not (see `Dialog`). */
413
+ toLiveRegionView?: (() => Html) | undefined;
414
+ }>;
415
+ /** The row the cursor is on as the view shows it with `commands`: the row the reader moved it
416
+ * to while that row is listed, else the page's `start` or `current` while the query finds it,
417
+ * else the first row the query finds; none when nothing is listed. Compare it before and after
418
+ * the caller's commands change to know when the cursor fell to another row (its row left) and
419
+ * should be scrolled into view with `ScrollToCursor`; a cursor whose row is still listed keeps
420
+ * it, and the list its scroll. */
421
+ export declare const maybeCursorId: (model: Model, commands: readonly Command[]) => Option.Option<string>;
422
+ /**
423
+ * Type to find a command or a title; one inverted cursor row, moved by ↑ and ↓ only
424
+ * (stopping at the ends; the pointer shades a row but never moves the cursor); Enter or a
425
+ * click selects it, and the palette closes first so what the command opens takes focus. A
426
+ * command with a page opens that page in place: Back, or Backspace in an empty field, returns
427
+ * to the commands with their query and cursor as they were. The choice in force is tagged
428
+ * current and cannot be picked; a picked choice holds the page until the caller answers. Once
429
+ * a query is typed, a polite status says how many rows it finds. Escape closes the whole
430
+ * palette.
431
+ *
432
+ * A pixel-paper Dialog (named "Commands", hung near the top) holding a field built on
433
+ * `@foldkit/ui`'s Input as an ARIA combobox (`aria-activedescendant` on the cursor's row) over
434
+ * an always open `role="listbox"` of `role="option"` rows, grouped under their headings.
435
+ */
436
+ export declare const view: import("foldkit/submodel").View<{
437
+ readonly dialog: {
438
+ readonly dialog: {
439
+ readonly id: string;
440
+ readonly isOpen: boolean;
441
+ readonly isAnimated: boolean;
442
+ readonly animation: {
443
+ readonly id: string;
444
+ readonly isShowing: boolean;
445
+ readonly transitionState: "EnterAnimating" | "EnterStart" | "Idle" | "LeaveAnimating" | "LeaveStart";
446
+ readonly transitionGeneration: number;
447
+ };
448
+ readonly maybeFocusSelector: Option.Option<string>;
449
+ };
450
+ };
451
+ readonly query: string;
452
+ readonly maybeCursor: Option.Option<string>;
453
+ readonly cursorShift: number;
454
+ readonly isEnterPending: boolean;
455
+ readonly renderGeneration: number;
456
+ readonly maybePage: Option.Option<{
457
+ readonly commandId: string;
458
+ readonly query: string;
459
+ readonly maybeCursor: Option.Option<string>;
460
+ }>;
461
+ readonly maybePicking: Option.Option<string>;
462
+ }, {
463
+ readonly _tag: "CompletedFocus";
464
+ } | {
465
+ readonly _tag: "CompletedScrollToCursor";
466
+ } | {
467
+ readonly _tag: "CompletedReportPendingKeys";
468
+ readonly renderGeneration: number;
469
+ readonly maybeRow: Option.Option<{
470
+ readonly id: string;
471
+ readonly isHeld: boolean;
472
+ readonly hasPage: boolean;
473
+ }>;
474
+ } | {
475
+ readonly _tag: "ClickedBack";
476
+ } | {
477
+ readonly _tag: "ClickedRow";
478
+ readonly row: {
479
+ readonly id: string;
480
+ readonly isHeld: boolean;
481
+ readonly hasPage: boolean;
482
+ };
483
+ readonly maybeShownPage: Option.Option<string>;
484
+ } | {
485
+ readonly _tag: "GotDialogMessage";
486
+ readonly message: {
487
+ readonly _tag: "GotDialogMessage";
488
+ readonly message: {
489
+ readonly _tag: "CompletedCloseDialog";
490
+ } | {
491
+ readonly _tag: "CompletedReleaseDialogResources";
492
+ } | {
493
+ readonly _tag: "FailedAcquireResources";
494
+ } | {
495
+ readonly _tag: "FailedShowDialog";
496
+ } | {
497
+ readonly _tag: "GotAnimationMessage";
498
+ readonly message: {
499
+ readonly _tag: "CompletedWaitForPaint";
500
+ readonly generation: number;
501
+ } | {
502
+ readonly _tag: "EndedAnimation";
503
+ readonly generation: number;
504
+ } | {
505
+ readonly _tag: "Hid";
506
+ } | {
507
+ readonly _tag: "Showed";
508
+ };
509
+ } | {
510
+ readonly _tag: "RequestedClose";
511
+ } | {
512
+ readonly _tag: "RequestedOpen";
513
+ } | {
514
+ readonly _tag: "SucceededAcquireResources";
515
+ } | {
516
+ readonly _tag: "SucceededShowDialog";
517
+ } | {
518
+ readonly _tag: "Unmounted";
519
+ };
520
+ } | {
521
+ readonly _tag: "PressedActionKey";
522
+ readonly direction: "Next" | "Previous";
523
+ };
524
+ } | {
525
+ readonly _tag: "PressedArrowKey";
526
+ readonly key: "ArrowDown" | "ArrowUp";
527
+ readonly snapshot: {
528
+ readonly maybeShownPage: Option.Option<string>;
529
+ readonly shownQuery: string;
530
+ readonly shownShift: number;
531
+ readonly rows: readonly {
532
+ readonly id: string;
533
+ readonly isHeld: boolean;
534
+ readonly hasPage: boolean;
535
+ }[];
536
+ readonly maybeShownCursor: Option.Option<string>;
537
+ };
538
+ } | {
539
+ readonly _tag: "PressedBackspace";
540
+ readonly maybeShownPage: Option.Option<string>;
541
+ } | {
542
+ readonly _tag: "PressedEarlyArrowKey";
543
+ readonly key: "ArrowDown" | "ArrowUp";
544
+ } | {
545
+ readonly _tag: "PressedEarlyEnter";
546
+ } | {
547
+ readonly _tag: "PressedEnter";
548
+ readonly snapshot: {
549
+ readonly maybeShownPage: Option.Option<string>;
550
+ readonly shownQuery: string;
551
+ readonly shownShift: number;
552
+ readonly rows: readonly {
553
+ readonly id: string;
554
+ readonly isHeld: boolean;
555
+ readonly hasPage: boolean;
556
+ }[];
557
+ readonly maybeShownCursor: Option.Option<string>;
558
+ };
559
+ } | {
560
+ readonly _tag: "UpdatedQuery";
561
+ readonly value: string;
562
+ readonly maybeShownPage: Option.Option<string>;
563
+ }, Readonly<{
564
+ /** Built from what the caller snapshotted as the palette opened (see `open`). A command
565
+ * that leaves while its page is open sends the reader back to the commands. */
566
+ commands: readonly Command[];
567
+ /** What the commands act on, kept on every page (the selected item's name). Defaults to
568
+ * `"commands"`. */
569
+ scope?: string;
570
+ /** What else can be typed, for the placeholder (`"type a command or a title"`). */
571
+ noun?: string;
572
+ /** Above the list, on the commands and on every page: the application's own content (a
573
+ * sync notice and its retry, why a pick was refused). A function, so its controls send the
574
+ * application's Messages. */
575
+ toDetailView?: () => ReadonlyArray<Html | string>;
576
+ /** The page's live region and toasts while this is the topmost open dialog, `undefined`
577
+ * while it is not (see `Dialog`). */
578
+ toLiveRegionView?: (() => Html) | undefined;
579
+ }>>;