@gjermundgaraba-designs/pixel-paper 0.26.0 → 0.27.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 (940) hide show
  1. package/DESIGN.md +28 -3
  2. package/dist/src/adapters/diagram.d.ts +38 -0
  3. package/dist/src/adapters/diagram.d.ts.map +1 -0
  4. package/dist/src/adapters/diagram.js +206 -0
  5. package/dist/src/adapters/mermaid.d.ts +2 -20
  6. package/dist/src/adapters/mermaid.d.ts.map +1 -1
  7. package/dist/src/adapters/mermaid.js +9 -229
  8. package/dist/src/announcer/announcer.d.ts +0 -4
  9. package/dist/src/announcer/announcer.d.ts.map +1 -1
  10. package/dist/src/announcer/announcer.js +19 -18
  11. package/dist/src/attributes/attributes.d.ts.map +1 -1
  12. package/dist/src/{audioFrame/audioFrame.d.ts → audio-frame/audio-frame.d.ts} +1 -1
  13. package/dist/src/audio-frame/audio-frame.d.ts.map +1 -0
  14. package/dist/src/{audioFrame/audioFrame.js → audio-frame/audio-frame.js} +1 -1
  15. package/dist/src/audio-frame/index.d.ts +3 -0
  16. package/dist/src/audio-frame/index.d.ts.map +1 -0
  17. package/dist/src/audio-frame/index.js +1 -0
  18. package/dist/src/banner/banner.d.ts.map +1 -1
  19. package/dist/src/banner/index.d.ts.map +1 -1
  20. package/dist/src/{barChart/barChart.d.ts → bar-chart/bar-chart.d.ts} +2 -2
  21. package/dist/src/bar-chart/bar-chart.d.ts.map +1 -0
  22. package/dist/src/{barChart/barChart.js → bar-chart/bar-chart.js} +40 -35
  23. package/dist/src/bar-chart/index.d.ts +3 -0
  24. package/dist/src/bar-chart/index.d.ts.map +1 -0
  25. package/dist/src/bar-chart/index.js +1 -0
  26. package/dist/src/bench/bench.d.ts.map +1 -1
  27. package/dist/src/bench/index.d.ts.map +1 -1
  28. package/dist/src/board/board.d.ts +45 -46
  29. package/dist/src/board/board.d.ts.map +1 -1
  30. package/dist/src/board/board.js +76 -102
  31. package/dist/src/board/index.d.ts +1 -1
  32. package/dist/src/board/index.d.ts.map +1 -1
  33. package/dist/src/button/button.d.ts +1 -2
  34. package/dist/src/button/button.d.ts.map +1 -1
  35. package/dist/src/button/button.js +7 -5
  36. package/dist/src/button/index.d.ts +1 -1
  37. package/dist/src/button/index.d.ts.map +1 -1
  38. package/dist/src/card/card.d.ts.map +1 -1
  39. package/dist/src/card/card.js +4 -2
  40. package/dist/src/card/index.d.ts.map +1 -1
  41. package/dist/src/{chartTable/chartTable.d.ts → chart-table/chart-table.d.ts} +4 -14
  42. package/dist/src/chart-table/chart-table.d.ts.map +1 -0
  43. package/dist/src/{chartTable/chartTable.js → chart-table/chart-table.js} +9 -16
  44. package/dist/src/chip/chip.d.ts.map +1 -1
  45. package/dist/src/chip/chip.js +4 -2
  46. package/dist/src/chip/index.d.ts.map +1 -1
  47. package/dist/src/choice/choice.d.ts.map +1 -1
  48. package/dist/src/choice/choice.js +3 -1
  49. package/dist/src/choice/index.d.ts.map +1 -1
  50. package/dist/src/choices/choices.d.ts.map +1 -1
  51. package/dist/src/choices/index.d.ts.map +1 -1
  52. package/dist/src/{codeEditor/codeEditor.d.ts → code-editor/code-editor.d.ts} +1 -1
  53. package/dist/src/code-editor/code-editor.d.ts.map +1 -0
  54. package/dist/src/{codeEditor/codeEditor.js → code-editor/code-editor.js} +2 -2
  55. package/dist/src/code-editor/index.d.ts +3 -0
  56. package/dist/src/code-editor/index.d.ts.map +1 -0
  57. package/dist/src/code-editor/index.js +1 -0
  58. package/dist/src/{codeSurface/codeSurface.d.ts → code-surface/code-surface.d.ts} +1 -1
  59. package/dist/src/code-surface/code-surface.d.ts.map +1 -0
  60. package/dist/src/{codeSurface/codeSurface.js → code-surface/code-surface.js} +6 -1
  61. package/dist/src/code-surface/index.d.ts +3 -0
  62. package/dist/src/code-surface/index.d.ts.map +1 -0
  63. package/dist/src/code-surface/index.js +1 -0
  64. package/dist/src/{commandPalette/commandPalette.d.ts → command-palette/command-palette.d.ts} +85 -77
  65. package/dist/src/command-palette/command-palette.d.ts.map +1 -0
  66. package/dist/src/command-palette/command-palette.js +625 -0
  67. package/dist/src/{commandPalette → command-palette}/index.d.ts +2 -2
  68. package/dist/src/command-palette/index.d.ts.map +1 -0
  69. package/dist/src/{commandPalette → command-palette}/index.js +1 -1
  70. package/dist/src/{commandPalette → command-palette}/keys.d.ts +0 -21
  71. package/dist/src/command-palette/keys.d.ts.map +1 -0
  72. package/dist/src/command-palette/keys.js +85 -0
  73. package/dist/src/{commandPalette → command-palette}/match.d.ts +5 -11
  74. package/dist/src/command-palette/match.d.ts.map +1 -0
  75. package/dist/src/{commandPalette → command-palette}/match.js +20 -24
  76. package/dist/src/{commandPalette → command-palette}/message.d.ts +37 -26
  77. package/dist/src/command-palette/message.d.ts.map +1 -0
  78. package/dist/src/{commandPalette → command-palette}/message.js +8 -20
  79. package/dist/src/{confirmDialog/confirmDialog.d.ts → confirm-dialog/confirm-dialog.d.ts} +1 -1
  80. package/dist/src/confirm-dialog/confirm-dialog.d.ts.map +1 -0
  81. package/dist/src/{confirmDialog/confirmDialog.js → confirm-dialog/confirm-dialog.js} +18 -23
  82. package/dist/src/confirm-dialog/index.d.ts +3 -0
  83. package/dist/src/confirm-dialog/index.d.ts.map +1 -0
  84. package/dist/src/{confirmDialog → confirm-dialog}/index.js +1 -1
  85. package/dist/src/{contextMenu/contextMenu.d.ts → context-menu/context-menu.d.ts} +18 -21
  86. package/dist/src/context-menu/context-menu.d.ts.map +1 -0
  87. package/dist/src/{contextMenu/contextMenu.js → context-menu/context-menu.js} +45 -57
  88. package/dist/src/{contextMenu → context-menu}/index.d.ts +2 -2
  89. package/dist/src/context-menu/index.d.ts.map +1 -0
  90. package/dist/src/{contextMenu → context-menu}/index.js +1 -1
  91. package/dist/src/{copyButton/copyButton.d.ts → copy-button/copy-button.d.ts} +5 -7
  92. package/dist/src/copy-button/copy-button.d.ts.map +1 -0
  93. package/dist/src/{copyButton/copyButton.js → copy-button/copy-button.js} +18 -27
  94. package/dist/src/copy-button/index.d.ts +3 -0
  95. package/dist/src/copy-button/index.d.ts.map +1 -0
  96. package/dist/src/copy-button/index.js +1 -0
  97. package/dist/src/crumbs/crumbs.d.ts +1 -1
  98. package/dist/src/crumbs/crumbs.d.ts.map +1 -1
  99. package/dist/src/crumbs/index.d.ts.map +1 -1
  100. package/dist/src/deck/deck.d.ts.map +1 -1
  101. package/dist/src/deck/index.d.ts.map +1 -1
  102. package/dist/src/dialog/dialog.d.ts +6 -14
  103. package/dist/src/dialog/dialog.d.ts.map +1 -1
  104. package/dist/src/dialog/dialog.js +29 -36
  105. package/dist/src/dialog/fold.d.ts +3 -3
  106. package/dist/src/dialog/fold.d.ts.map +1 -1
  107. package/dist/src/dialog/fold.js +5 -4
  108. package/dist/src/dialog/index.d.ts +1 -1
  109. package/dist/src/dialog/index.d.ts.map +1 -1
  110. package/dist/src/disclosure/disclosure.d.ts.map +1 -1
  111. package/dist/src/disclosure/disclosure.js +3 -1
  112. package/dist/src/disclosure/index.d.ts.map +1 -1
  113. package/dist/src/dom/html-element.d.ts +3 -0
  114. package/dist/src/dom/html-element.d.ts.map +1 -0
  115. package/dist/src/dom/html-element.js +6 -0
  116. package/dist/src/drag/drag.d.ts +0 -34
  117. package/dist/src/drag/drag.d.ts.map +1 -1
  118. package/dist/src/drag/drag.js +27 -73
  119. package/dist/src/{dropZone/dropZone.d.ts → drop-zone/drop-zone.d.ts} +3 -3
  120. package/dist/src/drop-zone/drop-zone.d.ts.map +1 -0
  121. package/dist/src/{dropZone/dropZone.js → drop-zone/drop-zone.js} +13 -19
  122. package/dist/src/drop-zone/index.d.ts +3 -0
  123. package/dist/src/drop-zone/index.d.ts.map +1 -0
  124. package/dist/src/drop-zone/index.js +1 -0
  125. package/dist/src/{editableTitle/editableTitle.d.ts → editable-title/editable-title.d.ts} +14 -12
  126. package/dist/src/editable-title/editable-title.d.ts.map +1 -0
  127. package/dist/src/{editableTitle/editableTitle.js → editable-title/editable-title.js} +33 -39
  128. package/dist/src/editable-title/index.d.ts +4 -0
  129. package/dist/src/editable-title/index.d.ts.map +1 -0
  130. package/dist/src/{editableTitle → editable-title}/index.js +1 -1
  131. package/dist/src/{emptyState/emptyState.d.ts → empty-state/empty-state.d.ts} +1 -1
  132. package/dist/src/empty-state/empty-state.d.ts.map +1 -0
  133. package/dist/src/{emptyState/emptyState.js → empty-state/empty-state.js} +5 -2
  134. package/dist/src/empty-state/index.d.ts +3 -0
  135. package/dist/src/empty-state/index.d.ts.map +1 -0
  136. package/dist/src/empty-state/index.js +1 -0
  137. package/dist/src/{errorSummary/errorSummary.d.ts → error-summary/error-summary.d.ts} +2 -2
  138. package/dist/src/error-summary/error-summary.d.ts.map +1 -0
  139. package/dist/src/{errorSummary/errorSummary.js → error-summary/error-summary.js} +7 -5
  140. package/dist/src/error-summary/index.d.ts +3 -0
  141. package/dist/src/error-summary/index.d.ts.map +1 -0
  142. package/dist/src/error-summary/index.js +1 -0
  143. package/dist/src/field/field.d.ts +2 -7
  144. package/dist/src/field/field.d.ts.map +1 -1
  145. package/dist/src/field/field.js +12 -13
  146. package/dist/src/field/index.d.ts.map +1 -1
  147. package/dist/src/{fieldGrid/fieldGrid.d.ts → field-grid/field-grid.d.ts} +1 -1
  148. package/dist/src/field-grid/field-grid.d.ts.map +1 -0
  149. package/dist/src/{fieldGrid/fieldGrid.js → field-grid/field-grid.js} +1 -1
  150. package/dist/src/field-grid/index.d.ts +3 -0
  151. package/dist/src/field-grid/index.d.ts.map +1 -0
  152. package/dist/src/field-grid/index.js +1 -0
  153. package/dist/src/fields/fields.d.ts.map +1 -1
  154. package/dist/src/fields/fields.js +4 -1
  155. package/dist/src/fields/index.d.ts.map +1 -1
  156. package/dist/src/fieldset/fieldset.d.ts.map +1 -1
  157. package/dist/src/fieldset/index.d.ts.map +1 -1
  158. package/dist/src/{fileTree/fileTree.d.ts → file-tree/file-tree.d.ts} +5 -5
  159. package/dist/src/file-tree/file-tree.d.ts.map +1 -0
  160. package/dist/src/file-tree/file-tree.js +242 -0
  161. package/dist/src/file-tree/index.d.ts +3 -0
  162. package/dist/src/file-tree/index.d.ts.map +1 -0
  163. package/dist/src/{fileTree → file-tree}/index.js +1 -1
  164. package/dist/src/{filterChip/filterChip.d.ts → filter-chip/filter-chip.d.ts} +1 -1
  165. package/dist/src/filter-chip/filter-chip.d.ts.map +1 -0
  166. package/dist/src/{filterChip/filterChip.js → filter-chip/filter-chip.js} +11 -7
  167. package/dist/src/filter-chip/index.d.ts +3 -0
  168. package/dist/src/filter-chip/index.d.ts.map +1 -0
  169. package/dist/src/filter-chip/index.js +1 -0
  170. package/dist/src/{filterStrip/filterStrip.d.ts → filter-strip/filter-strip.d.ts} +1 -1
  171. package/dist/src/filter-strip/filter-strip.d.ts.map +1 -0
  172. package/dist/src/{filterStrip/filterStrip.js → filter-strip/filter-strip.js} +1 -1
  173. package/dist/src/filter-strip/index.d.ts +3 -0
  174. package/dist/src/filter-strip/index.d.ts.map +1 -0
  175. package/dist/src/filter-strip/index.js +1 -0
  176. package/dist/src/{flashWord/flashWord.d.ts → flash-word/flash-word.d.ts} +2 -2
  177. package/dist/src/flash-word/flash-word.d.ts.map +1 -0
  178. package/dist/src/{flashWord/flashWord.js → flash-word/flash-word.js} +2 -3
  179. package/dist/src/flash-word/index.d.ts +3 -0
  180. package/dist/src/flash-word/index.d.ts.map +1 -0
  181. package/dist/src/flash-word/index.js +1 -0
  182. package/dist/src/focus/focus.d.ts.map +1 -1
  183. package/dist/src/focus/focus.js +0 -2
  184. package/dist/src/format/format.d.ts +0 -7
  185. package/dist/src/format/format.d.ts.map +1 -1
  186. package/dist/src/format/format.js +7 -16
  187. package/dist/src/format/index.d.ts.map +1 -1
  188. package/dist/src/glyph/glyph.d.ts +1 -2
  189. package/dist/src/glyph/glyph.d.ts.map +1 -1
  190. package/dist/src/glyph/glyph.js +0 -2
  191. package/dist/src/glyph/glyphs.d.ts +19 -4
  192. package/dist/src/glyph/glyphs.d.ts.map +1 -1
  193. package/dist/src/glyph/glyphs.js +2577 -2594
  194. package/dist/src/glyph/index.d.ts.map +1 -1
  195. package/dist/src/group/group.d.ts.map +1 -1
  196. package/dist/src/group/index.d.ts.map +1 -1
  197. package/dist/src/history/history.d.ts +1 -1
  198. package/dist/src/history/history.d.ts.map +1 -1
  199. package/dist/src/history/history.js +6 -3
  200. package/dist/src/history/index.d.ts.map +1 -1
  201. package/dist/src/{iconButton/iconButton.d.ts → icon-button/icon-button.d.ts} +1 -1
  202. package/dist/src/icon-button/icon-button.d.ts.map +1 -0
  203. package/dist/src/{iconButton/iconButton.js → icon-button/icon-button.js} +6 -4
  204. package/dist/src/icon-button/index.d.ts +3 -0
  205. package/dist/src/icon-button/index.d.ts.map +1 -0
  206. package/dist/src/icon-button/index.js +1 -0
  207. package/dist/src/identity/identity.d.ts.map +1 -1
  208. package/dist/src/identity/index.d.ts.map +1 -1
  209. package/dist/src/{imageFrame/imageFrame.d.ts → image-frame/image-frame.d.ts} +1 -1
  210. package/dist/src/image-frame/image-frame.d.ts.map +1 -0
  211. package/dist/src/{imageFrame/imageFrame.js → image-frame/image-frame.js} +19 -12
  212. package/dist/src/image-frame/index.d.ts +3 -0
  213. package/dist/src/image-frame/index.d.ts.map +1 -0
  214. package/dist/src/image-frame/index.js +1 -0
  215. package/dist/src/index.d.ts +41 -41
  216. package/dist/src/index.d.ts.map +1 -1
  217. package/dist/src/index.js +41 -41
  218. package/dist/src/inline-input/index.d.ts +3 -0
  219. package/dist/src/inline-input/index.d.ts.map +1 -0
  220. package/dist/src/{inlineInput → inline-input}/index.js +1 -1
  221. package/dist/src/{inlineInput/inlineInput.d.ts → inline-input/inline-input.d.ts} +8 -12
  222. package/dist/src/inline-input/inline-input.d.ts.map +1 -0
  223. package/dist/src/{inlineInput/inlineInput.js → inline-input/inline-input.js} +60 -75
  224. package/dist/src/key-help/index.d.ts +3 -0
  225. package/dist/src/key-help/index.d.ts.map +1 -0
  226. package/dist/src/{keyHelp → key-help}/index.js +1 -1
  227. package/dist/src/{keyHelp/keyHelp.d.ts → key-help/key-help.d.ts} +7 -7
  228. package/dist/src/key-help/key-help.d.ts.map +1 -0
  229. package/dist/src/{keyHelp/keyHelp.js → key-help/key-help.js} +48 -47
  230. package/dist/src/key-hint/index.d.ts +4 -0
  231. package/dist/src/key-hint/index.d.ts.map +1 -0
  232. package/dist/src/key-hint/index.js +2 -0
  233. package/dist/src/{keyHint/keyHint.d.ts → key-hint/key-hint.d.ts} +2 -2
  234. package/dist/src/key-hint/key-hint.d.ts.map +1 -0
  235. package/dist/src/{keyHint/keyHint.js → key-hint/key-hint.js} +2 -2
  236. package/dist/src/{keyHint/keyLabel.d.ts → key-hint/key-label.d.ts} +2 -3
  237. package/dist/src/key-hint/key-label.d.ts.map +1 -0
  238. package/dist/src/{keyHint/keyLabel.js → key-hint/key-label.js} +29 -24
  239. package/dist/src/keymap/index.d.ts.map +1 -1
  240. package/dist/src/keymap/keymap.d.ts +2 -2
  241. package/dist/src/keymap/keymap.d.ts.map +1 -1
  242. package/dist/src/keymap/keymap.js +3 -1
  243. package/dist/src/keys/keys.d.ts +0 -2
  244. package/dist/src/keys/keys.d.ts.map +1 -1
  245. package/dist/src/keys/keys.js +0 -2
  246. package/dist/src/line-chart/index.d.ts +3 -0
  247. package/dist/src/line-chart/index.d.ts.map +1 -0
  248. package/dist/src/line-chart/index.js +1 -0
  249. package/dist/src/{lineChart/lineChart.d.ts → line-chart/line-chart.d.ts} +2 -2
  250. package/dist/src/line-chart/line-chart.d.ts.map +1 -0
  251. package/dist/src/{lineChart/lineChart.js → line-chart/line-chart.js} +52 -44
  252. package/dist/src/line-diff/diff.d.ts +29 -0
  253. package/dist/src/line-diff/diff.d.ts.map +1 -0
  254. package/dist/src/line-diff/diff.js +85 -0
  255. package/dist/src/line-diff/index.d.ts +5 -0
  256. package/dist/src/line-diff/index.d.ts.map +1 -0
  257. package/dist/src/line-diff/index.js +2 -0
  258. package/dist/src/{lineDiff/lineDiff.d.ts → line-diff/line-diff.d.ts} +1 -1
  259. package/dist/src/line-diff/line-diff.d.ts.map +1 -0
  260. package/dist/src/{lineDiff/lineDiff.js → line-diff/line-diff.js} +26 -19
  261. package/dist/src/{lineDiff → line-diff}/patch.d.ts +5 -9
  262. package/dist/src/line-diff/patch.d.ts.map +1 -0
  263. package/dist/src/{lineDiff → line-diff}/patch.js +54 -62
  264. package/dist/src/link-button/index.d.ts +3 -0
  265. package/dist/src/link-button/index.d.ts.map +1 -0
  266. package/dist/src/link-button/index.js +1 -0
  267. package/dist/src/{linkButton/linkButton.d.ts → link-button/link-button.d.ts} +2 -2
  268. package/dist/src/link-button/link-button.d.ts.map +1 -0
  269. package/dist/src/{linkButton/linkButton.js → link-button/link-button.js} +1 -1
  270. package/dist/src/link-state/index.d.ts +3 -0
  271. package/dist/src/link-state/index.d.ts.map +1 -0
  272. package/dist/src/link-state/index.js +1 -0
  273. package/dist/src/{linkState/linkState.d.ts → link-state/link-state.d.ts} +1 -1
  274. package/dist/src/link-state/link-state.d.ts.map +1 -0
  275. package/dist/src/link-state/link-state.js +24 -0
  276. package/dist/src/live-region/index.d.ts +3 -0
  277. package/dist/src/live-region/index.d.ts.map +1 -0
  278. package/dist/src/live-region/index.js +1 -0
  279. package/dist/src/{liveRegion/liveRegion.d.ts → live-region/live-region.d.ts} +6 -3
  280. package/dist/src/live-region/live-region.d.ts.map +1 -0
  281. package/dist/src/{liveRegion/liveRegion.js → live-region/live-region.js} +7 -5
  282. package/dist/src/loading/index.d.ts.map +1 -1
  283. package/dist/src/loading/loading.d.ts.map +1 -1
  284. package/dist/src/loading/loading.js +5 -1
  285. package/dist/src/mark/index.d.ts.map +1 -1
  286. package/dist/src/mark/mark.d.ts +0 -4
  287. package/dist/src/mark/mark.d.ts.map +1 -1
  288. package/dist/src/mark/mark.js +6 -3
  289. package/dist/src/media/index.d.ts.map +1 -1
  290. package/dist/src/media/media.d.ts +17 -42
  291. package/dist/src/media/media.d.ts.map +1 -1
  292. package/dist/src/media/media.js +106 -104
  293. package/dist/src/menu/index.d.ts.map +1 -1
  294. package/dist/src/menu/item.d.ts +8 -8
  295. package/dist/src/menu/item.d.ts.map +1 -1
  296. package/dist/src/menu/menu.d.ts +2 -5
  297. package/dist/src/menu/menu.d.ts.map +1 -1
  298. package/dist/src/menu/menu.js +19 -30
  299. package/dist/src/menu/slip.d.ts +4 -18
  300. package/dist/src/menu/slip.d.ts.map +1 -1
  301. package/dist/src/menu/slip.js +36 -36
  302. package/dist/src/meter/index.d.ts.map +1 -1
  303. package/dist/src/meter/meter.d.ts +1 -1
  304. package/dist/src/meter/meter.d.ts.map +1 -1
  305. package/dist/src/meter/meter.js +12 -15
  306. package/dist/src/monogram/index.d.ts.map +1 -1
  307. package/dist/src/monogram/monogram.d.ts.map +1 -1
  308. package/dist/src/monogram/monogram.js +9 -8
  309. package/dist/src/nav-strip/index.d.ts +3 -0
  310. package/dist/src/nav-strip/index.d.ts.map +1 -0
  311. package/dist/src/nav-strip/index.js +1 -0
  312. package/dist/src/{navStrip/navStrip.d.ts → nav-strip/nav-strip.d.ts} +3 -6
  313. package/dist/src/nav-strip/nav-strip.d.ts.map +1 -0
  314. package/dist/src/nav-strip/nav-strip.js +25 -0
  315. package/dist/src/notice/index.d.ts.map +1 -1
  316. package/dist/src/notice/notice.d.ts +0 -4
  317. package/dist/src/notice/notice.d.ts.map +1 -1
  318. package/dist/src/notice/notice.js +1 -4
  319. package/dist/src/outcome/index.d.ts.map +1 -1
  320. package/dist/src/outcome/outcome.d.ts.map +1 -1
  321. package/dist/src/outcome/outcome.js +1 -1
  322. package/dist/src/page-head/index.d.ts +3 -0
  323. package/dist/src/page-head/index.d.ts.map +1 -0
  324. package/dist/src/page-head/index.js +1 -0
  325. package/dist/src/{pageHead/pageHead.d.ts → page-head/page-head.d.ts} +1 -1
  326. package/dist/src/page-head/page-head.d.ts.map +1 -0
  327. package/dist/src/{pageHead/pageHead.js → page-head/page-head.js} +1 -1
  328. package/dist/src/panel/index.d.ts.map +1 -1
  329. package/dist/src/panel/panel.d.ts +0 -1
  330. package/dist/src/panel/panel.d.ts.map +1 -1
  331. package/dist/src/panel/panel.js +0 -1
  332. package/dist/src/password-field/index.d.ts +3 -0
  333. package/dist/src/password-field/index.d.ts.map +1 -0
  334. package/dist/src/password-field/index.js +1 -0
  335. package/dist/src/{passwordField/passwordField.d.ts → password-field/password-field.d.ts} +1 -1
  336. package/dist/src/password-field/password-field.d.ts.map +1 -0
  337. package/dist/src/{passwordField/passwordField.js → password-field/password-field.js} +4 -5
  338. package/dist/src/places/index.d.ts.map +1 -1
  339. package/dist/src/places/places.d.ts +3 -4
  340. package/dist/src/places/places.d.ts.map +1 -1
  341. package/dist/src/places/places.js +8 -2
  342. package/dist/src/props-list/index.d.ts +3 -0
  343. package/dist/src/props-list/index.d.ts.map +1 -0
  344. package/dist/src/props-list/index.js +1 -0
  345. package/dist/src/{propsList/propsList.d.ts → props-list/props-list.d.ts} +2 -2
  346. package/dist/src/props-list/props-list.d.ts.map +1 -0
  347. package/dist/src/{propsList/propsList.js → props-list/props-list.js} +2 -2
  348. package/dist/src/prose/index.d.ts.map +1 -1
  349. package/dist/src/prose/prose.d.ts.map +1 -1
  350. package/dist/src/query-chip/index.d.ts +3 -0
  351. package/dist/src/query-chip/index.d.ts.map +1 -0
  352. package/dist/src/query-chip/index.js +1 -0
  353. package/dist/src/{queryChip/queryChip.d.ts → query-chip/query-chip.d.ts} +1 -1
  354. package/dist/src/query-chip/query-chip.d.ts.map +1 -0
  355. package/dist/src/{queryChip/queryChip.js → query-chip/query-chip.js} +7 -4
  356. package/dist/src/{radioChoices → radio-choices}/index.d.ts +2 -2
  357. package/dist/src/radio-choices/index.d.ts.map +1 -0
  358. package/dist/src/{radioChoices → radio-choices}/index.js +1 -1
  359. package/dist/src/{radioChoices/radioChoices.d.ts → radio-choices/radio-choices.d.ts} +3 -3
  360. package/dist/src/radio-choices/radio-choices.d.ts.map +1 -0
  361. package/dist/src/{radioChoices/radioChoices.js → radio-choices/radio-choices.js} +25 -24
  362. package/dist/src/rail/index.d.ts.map +1 -1
  363. package/dist/src/rail/rail.d.ts +16 -32
  364. package/dist/src/rail/rail.d.ts.map +1 -1
  365. package/dist/src/rail/rail.js +97 -65
  366. package/dist/src/reel/index.d.ts +1 -1
  367. package/dist/src/reel/index.d.ts.map +1 -1
  368. package/dist/src/reel/layout.d.ts +12 -54
  369. package/dist/src/reel/layout.d.ts.map +1 -1
  370. package/dist/src/reel/layout.js +120 -145
  371. package/dist/src/reel/reel.d.ts +35 -34
  372. package/dist/src/reel/reel.d.ts.map +1 -1
  373. package/dist/src/reel/reel.js +253 -233
  374. package/dist/src/remote/index.d.ts.map +1 -1
  375. package/dist/src/remote/remote.d.ts +2 -2
  376. package/dist/src/remote/remote.d.ts.map +1 -1
  377. package/dist/src/remote/remote.js +6 -2
  378. package/dist/src/rows/index.d.ts.map +1 -1
  379. package/dist/src/rows/rows.d.ts +2 -2
  380. package/dist/src/rows/rows.d.ts.map +1 -1
  381. package/dist/src/rows/rows.js +16 -7
  382. package/dist/src/scheme/index.d.ts +1 -1
  383. package/dist/src/scheme/index.d.ts.map +1 -1
  384. package/dist/src/scheme/index.js +1 -1
  385. package/dist/src/scheme/{schemeSwitch.d.ts → scheme-switch.d.ts} +2 -2
  386. package/dist/src/scheme/scheme-switch.d.ts.map +1 -0
  387. package/dist/src/scheme/{schemeSwitch.js → scheme-switch.js} +33 -38
  388. package/dist/src/scheme/scheme.d.ts +0 -2
  389. package/dist/src/scheme/scheme.d.ts.map +1 -1
  390. package/dist/src/scheme/scheme.js +0 -2
  391. package/dist/src/secret/index.d.ts.map +1 -1
  392. package/dist/src/secret/secret.d.ts.map +1 -1
  393. package/dist/src/segmented/index.d.ts.map +1 -1
  394. package/dist/src/segmented/segmented.d.ts.map +1 -1
  395. package/dist/src/segmented/segmented.js +14 -3
  396. package/dist/src/select-all/index.d.ts +3 -0
  397. package/dist/src/select-all/index.d.ts.map +1 -0
  398. package/dist/src/select-all/index.js +1 -0
  399. package/dist/src/{selectAll/selectAll.d.ts → select-all/select-all.d.ts} +1 -1
  400. package/dist/src/select-all/select-all.d.ts.map +1 -0
  401. package/dist/src/{selectAll/selectAll.js → select-all/select-all.js} +2 -2
  402. package/dist/src/select-field/index.d.ts +3 -0
  403. package/dist/src/select-field/index.d.ts.map +1 -0
  404. package/dist/src/select-field/index.js +1 -0
  405. package/dist/src/{selectField/selectField.d.ts → select-field/select-field.d.ts} +2 -2
  406. package/dist/src/select-field/select-field.d.ts.map +1 -0
  407. package/dist/src/{selectField/selectField.js → select-field/select-field.js} +10 -7
  408. package/dist/src/sheet/index.d.ts.map +1 -1
  409. package/dist/src/sheet/sheet.d.ts.map +1 -1
  410. package/dist/src/sheet/sheet.js +4 -1
  411. package/dist/src/skip-link/index.d.ts +2 -0
  412. package/dist/src/skip-link/index.d.ts.map +1 -0
  413. package/dist/src/skip-link/index.js +1 -0
  414. package/dist/src/{skipLink/skipLink.d.ts → skip-link/skip-link.d.ts} +1 -3
  415. package/dist/src/skip-link/skip-link.d.ts.map +1 -0
  416. package/dist/src/{skipLink/skipLink.js → skip-link/skip-link.js} +7 -11
  417. package/dist/src/slot/slot.d.ts +1 -4
  418. package/dist/src/slot/slot.d.ts.map +1 -1
  419. package/dist/src/slot/slot.js +3 -3
  420. package/dist/src/sortable/index.d.ts.map +1 -1
  421. package/dist/src/sortable/sortable.d.ts +44 -44
  422. package/dist/src/sortable/sortable.d.ts.map +1 -1
  423. package/dist/src/sortable/sortable.js +60 -93
  424. package/dist/src/stack/index.d.ts.map +1 -1
  425. package/dist/src/stack/stack.d.ts.map +1 -1
  426. package/dist/src/stack/stack.js +0 -2
  427. package/dist/src/stage/index.d.ts.map +1 -1
  428. package/dist/src/stage/stage.d.ts +1 -1
  429. package/dist/src/stage/stage.d.ts.map +1 -1
  430. package/dist/src/stage/stage.js +4 -1
  431. package/dist/src/stat/index.d.ts.map +1 -1
  432. package/dist/src/stat/stat.d.ts +1 -1
  433. package/dist/src/stat/stat.d.ts.map +1 -1
  434. package/dist/src/stat/stat.js +17 -8
  435. package/dist/src/status-bar/index.d.ts +4 -0
  436. package/dist/src/status-bar/index.d.ts.map +1 -0
  437. package/dist/src/status-bar/index.js +2 -0
  438. package/dist/src/{statusBar/statusBar.d.ts → status-bar/status-bar.d.ts} +4 -4
  439. package/dist/src/status-bar/status-bar.d.ts.map +1 -0
  440. package/dist/src/{statusBar/statusBar.js → status-bar/status-bar.js} +5 -6
  441. package/dist/src/subscription/{prefixKeys.d.ts → prefix-keys.d.ts} +1 -2
  442. package/dist/src/subscription/prefix-keys.d.ts.map +1 -0
  443. package/dist/src/subscription/{prefixKeys.js → prefix-keys.js} +2 -5
  444. package/dist/src/table/index.d.ts.map +1 -1
  445. package/dist/src/table/table.d.ts +1 -1
  446. package/dist/src/table/table.d.ts.map +1 -1
  447. package/dist/src/table/table.js +19 -7
  448. package/dist/src/tabs/index.d.ts.map +1 -1
  449. package/dist/src/tabs/tabs.d.ts +4 -4
  450. package/dist/src/tabs/tabs.d.ts.map +1 -1
  451. package/dist/src/tabs/tabs.js +1 -6
  452. package/dist/src/tag/index.d.ts.map +1 -1
  453. package/dist/src/tag/tag.d.ts.map +1 -1
  454. package/dist/src/tag/tag.js +4 -1
  455. package/dist/src/text-button/index.d.ts +3 -0
  456. package/dist/src/text-button/index.d.ts.map +1 -0
  457. package/dist/src/text-button/index.js +1 -0
  458. package/dist/src/{textButton/textButton.d.ts → text-button/text-button.d.ts} +1 -1
  459. package/dist/src/text-button/text-button.d.ts.map +1 -0
  460. package/dist/src/{textButton/textButton.js → text-button/text-button.js} +2 -2
  461. package/dist/src/textarea-field/index.d.ts +3 -0
  462. package/dist/src/textarea-field/index.d.ts.map +1 -0
  463. package/dist/src/textarea-field/index.js +1 -0
  464. package/dist/src/{textareaField/textareaField.d.ts → textarea-field/textarea-field.d.ts} +1 -1
  465. package/dist/src/textarea-field/textarea-field.d.ts.map +1 -0
  466. package/dist/src/{textareaField/textareaField.js → textarea-field/textarea-field.js} +2 -2
  467. package/dist/src/time/index.d.ts.map +1 -1
  468. package/dist/src/time/time.d.ts.map +1 -1
  469. package/dist/src/time/time.js +16 -9
  470. package/dist/src/tips/index.d.ts.map +1 -1
  471. package/dist/src/tips/tips.d.ts +7 -18
  472. package/dist/src/tips/tips.d.ts.map +1 -1
  473. package/dist/src/tips/tips.js +67 -65
  474. package/dist/src/toast/index.d.ts.map +1 -1
  475. package/dist/src/toast/stack.d.ts +1 -8
  476. package/dist/src/toast/stack.d.ts.map +1 -1
  477. package/dist/src/toast/stack.js +5 -18
  478. package/dist/src/toast/toast.d.ts +3 -5
  479. package/dist/src/toast/toast.d.ts.map +1 -1
  480. package/dist/src/toast/toast.js +42 -39
  481. package/dist/src/toc/index.d.ts.map +1 -1
  482. package/dist/src/toc/toc.d.ts +3 -3
  483. package/dist/src/toc/toc.d.ts.map +1 -1
  484. package/dist/src/toc/toc.js +10 -7
  485. package/dist/src/toolbar/index.d.ts.map +1 -1
  486. package/dist/src/toolbar/toolbar.d.ts +1 -1
  487. package/dist/src/toolbar/toolbar.d.ts.map +1 -1
  488. package/dist/src/toolbar/toolbar.js +27 -24
  489. package/dist/src/{topBar/barHeight.d.ts → top-bar/bar-height.d.ts} +1 -2
  490. package/dist/src/top-bar/bar-height.d.ts.map +1 -0
  491. package/dist/src/{topBar/barHeight.js → top-bar/bar-height.js} +20 -13
  492. package/dist/src/top-bar/index.d.ts +4 -0
  493. package/dist/src/top-bar/index.d.ts.map +1 -0
  494. package/dist/src/top-bar/index.js +2 -0
  495. package/dist/src/{topBar/topBar.d.ts → top-bar/top-bar.d.ts} +3 -3
  496. package/dist/src/top-bar/top-bar.d.ts.map +1 -0
  497. package/dist/src/{topBar/topBar.js → top-bar/top-bar.js} +2 -2
  498. package/dist/src/video-frame/index.d.ts +3 -0
  499. package/dist/src/video-frame/index.d.ts.map +1 -0
  500. package/dist/src/video-frame/index.js +1 -0
  501. package/dist/src/{videoFrame/videoFrame.d.ts → video-frame/video-frame.d.ts} +1 -1
  502. package/dist/src/video-frame/video-frame.d.ts.map +1 -0
  503. package/dist/src/{videoFrame/videoFrame.js → video-frame/video-frame.js} +11 -7
  504. package/dist/src/wall/index.d.ts.map +1 -1
  505. package/dist/src/wall/wall.d.ts.map +1 -1
  506. package/dist/src/window/index.d.ts.map +1 -1
  507. package/dist/src/window/window.d.ts +2 -2
  508. package/dist/src/window/window.d.ts.map +1 -1
  509. package/dist/src/window/window.js +4 -2
  510. package/dist/src/wordmark/index.d.ts.map +1 -1
  511. package/dist/src/wordmark/wordmark.d.ts.map +1 -1
  512. package/dist/src/wrap/index.d.ts.map +1 -1
  513. package/dist/src/wrap/wrap.d.ts.map +1 -1
  514. package/package.json +6 -6
  515. package/src/adapters/diagram.ts +278 -0
  516. package/src/adapters/mermaid.ts +13 -273
  517. package/src/announcer/announcer.ts +54 -35
  518. package/src/attributes/attributes.ts +3 -1
  519. package/src/{audioFrame/audioFrame.ts → audio-frame/audio-frame.ts} +4 -6
  520. package/src/audio-frame/index.ts +3 -0
  521. package/src/banner/banner.ts +5 -4
  522. package/src/banner/index.ts +1 -0
  523. package/src/{barChart/barChart.ts → bar-chart/bar-chart.ts} +81 -43
  524. package/src/bar-chart/index.ts +3 -0
  525. package/src/bench/bench.ts +5 -4
  526. package/src/bench/index.ts +1 -0
  527. package/src/board/board.ts +338 -243
  528. package/src/board/index.ts +8 -1
  529. package/src/button/button.ts +24 -16
  530. package/src/button/index.ts +8 -1
  531. package/src/card/card.ts +23 -21
  532. package/src/card/index.ts +1 -0
  533. package/src/chart-table/chart-table.ts +87 -0
  534. package/src/chip/chip.ts +13 -9
  535. package/src/chip/index.ts +1 -0
  536. package/src/choice/choice.ts +13 -7
  537. package/src/choice/index.ts +1 -0
  538. package/src/choices/choices.ts +4 -3
  539. package/src/choices/index.ts +1 -0
  540. package/src/{codeEditor/codeEditor.ts → code-editor/code-editor.ts} +5 -4
  541. package/src/code-editor/index.ts +3 -0
  542. package/src/{codeSurface/codeSurface.ts → code-surface/code-surface.ts} +11 -5
  543. package/src/code-surface/index.ts +3 -0
  544. package/src/{commandPalette/commandPalette.ts → command-palette/command-palette.ts} +470 -295
  545. package/src/{commandPalette → command-palette}/index.ts +12 -2
  546. package/src/{commandPalette → command-palette}/keys.ts +44 -43
  547. package/src/{commandPalette → command-palette}/match.ts +42 -30
  548. package/src/{commandPalette → command-palette}/message.ts +13 -20
  549. package/src/{confirmDialog/confirmDialog.ts → confirm-dialog/confirm-dialog.ts} +51 -46
  550. package/src/{confirmDialog → confirm-dialog}/index.ts +3 -2
  551. package/src/{contextMenu/contextMenu.ts → context-menu/context-menu.ts} +71 -70
  552. package/src/{contextMenu → context-menu}/index.ts +4 -2
  553. package/src/{copyButton/copyButton.ts → copy-button/copy-button.ts} +51 -54
  554. package/src/{copyButton → copy-button}/index.ts +3 -2
  555. package/src/crumbs/crumbs.ts +7 -6
  556. package/src/crumbs/index.ts +1 -0
  557. package/src/deck/deck.ts +4 -3
  558. package/src/deck/index.ts +1 -0
  559. package/src/dialog/dialog.ts +135 -113
  560. package/src/dialog/fold.ts +44 -25
  561. package/src/dialog/index.ts +9 -1
  562. package/src/disclosure/disclosure.ts +14 -8
  563. package/src/disclosure/index.ts +1 -0
  564. package/src/dom/html-element.ts +10 -0
  565. package/src/drag/drag.ts +102 -119
  566. package/src/{dropZone/dropZone.ts → drop-zone/drop-zone.ts} +43 -43
  567. package/src/drop-zone/index.ts +11 -0
  568. package/src/{editableTitle/editableTitle.ts → editable-title/editable-title.ts} +29 -32
  569. package/src/{editableTitle → editable-title}/index.ts +4 -2
  570. package/src/{emptyState/emptyState.ts → empty-state/empty-state.ts} +9 -5
  571. package/src/empty-state/index.ts +3 -0
  572. package/src/{errorSummary/errorSummary.ts → error-summary/error-summary.ts} +16 -7
  573. package/src/error-summary/index.ts +3 -0
  574. package/src/field/field.ts +38 -28
  575. package/src/field/index.ts +1 -0
  576. package/src/{fieldGrid/fieldGrid.ts → field-grid/field-grid.ts} +4 -3
  577. package/src/field-grid/index.ts +3 -0
  578. package/src/fields/fields.ts +9 -5
  579. package/src/fields/index.ts +1 -0
  580. package/src/fieldset/fieldset.ts +6 -5
  581. package/src/fieldset/index.ts +1 -0
  582. package/src/{fileTree/fileTree.ts → file-tree/file-tree.ts} +241 -166
  583. package/src/file-tree/index.ts +12 -0
  584. package/src/{filterChip/filterChip.ts → filter-chip/filter-chip.ts} +32 -13
  585. package/src/filter-chip/index.ts +3 -0
  586. package/src/{filterStrip/filterStrip.ts → filter-strip/filter-strip.ts} +4 -3
  587. package/src/filter-strip/index.ts +3 -0
  588. package/src/{flashWord/flashWord.ts → flash-word/flash-word.ts} +9 -7
  589. package/src/flash-word/index.ts +3 -0
  590. package/src/focus/focus.ts +5 -5
  591. package/src/format/format.ts +37 -31
  592. package/src/format/index.ts +1 -0
  593. package/src/glyph/glyph.ts +7 -6
  594. package/src/glyph/glyphs.ts +2601 -2611
  595. package/src/glyph/index.ts +3 -0
  596. package/src/group/group.ts +4 -3
  597. package/src/group/index.ts +1 -0
  598. package/src/history/history.ts +18 -10
  599. package/src/history/index.ts +1 -0
  600. package/src/{iconButton/iconButton.ts → icon-button/icon-button.ts} +13 -7
  601. package/src/icon-button/index.ts +3 -0
  602. package/src/identity/identity.ts +7 -6
  603. package/src/identity/index.ts +1 -0
  604. package/src/{imageFrame/imageFrame.ts → image-frame/image-frame.ts} +43 -25
  605. package/src/image-frame/index.ts +3 -0
  606. package/src/index.ts +139 -41
  607. package/src/{inlineInput → inline-input}/index.ts +3 -2
  608. package/src/{inlineInput/inlineInput.ts → inline-input/inline-input.ts} +97 -88
  609. package/src/{keyHelp → key-help}/index.ts +3 -2
  610. package/src/{keyHelp/keyHelp.ts → key-help/key-help.ts} +74 -62
  611. package/src/key-hint/index.ts +5 -0
  612. package/src/{keyHint/keyHint.ts → key-hint/key-hint.ts} +10 -5
  613. package/src/{keyHint/keyLabel.ts → key-hint/key-label.ts} +43 -22
  614. package/src/keymap/index.ts +1 -0
  615. package/src/keymap/keymap.ts +23 -9
  616. package/src/keys/keys.ts +0 -2
  617. package/src/line-chart/index.ts +3 -0
  618. package/src/{lineChart/lineChart.ts → line-chart/line-chart.ts} +71 -49
  619. package/src/line-diff/diff.ts +196 -0
  620. package/src/line-diff/index.ts +7 -0
  621. package/src/{lineDiff/lineDiff.ts → line-diff/line-diff.ts} +45 -23
  622. package/src/{lineDiff → line-diff}/patch.ts +104 -76
  623. package/src/link-button/index.ts +3 -0
  624. package/src/{linkButton/linkButton.ts → link-button/link-button.ts} +7 -5
  625. package/src/link-state/index.ts +3 -0
  626. package/src/{linkState/linkState.ts → link-state/link-state.ts} +20 -9
  627. package/src/live-region/index.ts +3 -0
  628. package/src/{liveRegion/liveRegion.ts → live-region/live-region.ts} +15 -11
  629. package/src/loading/index.ts +1 -0
  630. package/src/loading/loading.ts +10 -5
  631. package/src/mark/index.ts +1 -0
  632. package/src/mark/mark.ts +17 -15
  633. package/src/media/index.ts +1 -0
  634. package/src/media/media.ts +255 -157
  635. package/src/menu/index.ts +4 -0
  636. package/src/menu/item.ts +10 -11
  637. package/src/menu/menu.ts +110 -97
  638. package/src/menu/slip.ts +129 -92
  639. package/src/meter/index.ts +1 -0
  640. package/src/meter/meter.ts +52 -33
  641. package/src/monogram/index.ts +1 -0
  642. package/src/monogram/monogram.ts +27 -19
  643. package/src/nav-strip/index.ts +3 -0
  644. package/src/{navStrip/navStrip.ts → nav-strip/nav-strip.ts} +21 -13
  645. package/src/notice/index.ts +1 -0
  646. package/src/notice/notice.ts +24 -16
  647. package/src/outcome/index.ts +1 -0
  648. package/src/outcome/outcome.ts +14 -6
  649. package/src/page-head/index.ts +3 -0
  650. package/src/{pageHead/pageHead.ts → page-head/page-head.ts} +6 -5
  651. package/src/panel/index.ts +1 -0
  652. package/src/panel/panel.ts +6 -6
  653. package/src/password-field/index.ts +3 -0
  654. package/src/{passwordField/passwordField.ts → password-field/password-field.ts} +13 -13
  655. package/src/pixel-paper.css +26 -508
  656. package/src/places/index.ts +1 -0
  657. package/src/places/places.ts +22 -11
  658. package/src/props-list/index.ts +3 -0
  659. package/src/{propsList/propsList.ts → props-list/props-list.ts} +6 -6
  660. package/src/prose/index.ts +1 -0
  661. package/src/prose/prose.ts +4 -4
  662. package/src/query-chip/index.ts +3 -0
  663. package/src/{queryChip/queryChip.ts → query-chip/query-chip.ts} +18 -7
  664. package/src/{radioChoices → radio-choices}/index.ts +3 -2
  665. package/src/{radioChoices/radioChoices.ts → radio-choices/radio-choices.ts} +79 -65
  666. package/src/rail/index.ts +1 -0
  667. package/src/rail/rail.ts +291 -225
  668. package/src/reel/index.ts +8 -1
  669. package/src/reel/layout.ts +393 -238
  670. package/src/reel/reel.ts +750 -452
  671. package/src/remote/index.ts +1 -0
  672. package/src/remote/remote.ts +18 -11
  673. package/src/rows/index.ts +1 -0
  674. package/src/rows/rows.ts +83 -47
  675. package/src/scheme/index.ts +3 -1
  676. package/src/scheme/{schemeSwitch.ts → scheme-switch.ts} +24 -35
  677. package/src/scheme/scheme.ts +4 -4
  678. package/src/secret/index.ts +1 -0
  679. package/src/secret/secret.ts +5 -4
  680. package/src/segmented/index.ts +1 -0
  681. package/src/segmented/segmented.ts +22 -10
  682. package/src/select-all/index.ts +3 -0
  683. package/src/{selectAll/selectAll.ts → select-all/select-all.ts} +9 -8
  684. package/src/{selectField → select-field}/index.ts +3 -2
  685. package/src/{selectField/selectField.ts → select-field/select-field.ts} +25 -11
  686. package/src/sheet/index.ts +1 -0
  687. package/src/sheet/sheet.ts +9 -5
  688. package/src/skip-link/index.ts +1 -0
  689. package/src/{skipLink/skipLink.ts → skip-link/skip-link.ts} +9 -15
  690. package/src/slot/slot.ts +5 -6
  691. package/src/sortable/index.ts +1 -0
  692. package/src/sortable/sortable.ts +287 -206
  693. package/src/stack/index.ts +1 -0
  694. package/src/stack/stack.ts +6 -7
  695. package/src/stage/index.ts +1 -0
  696. package/src/stage/stage.ts +12 -8
  697. package/src/stat/index.ts +1 -0
  698. package/src/stat/stat.ts +39 -20
  699. package/src/status-bar/index.ts +5 -0
  700. package/src/{statusBar/statusBar.ts → status-bar/status-bar.ts} +18 -11
  701. package/src/subscription/{prefixKeys.ts → prefix-keys.ts} +5 -6
  702. package/src/table/index.ts +1 -0
  703. package/src/table/table.ts +49 -24
  704. package/src/tabs/index.ts +1 -0
  705. package/src/tabs/tabs.ts +58 -60
  706. package/src/tag/index.ts +1 -0
  707. package/src/tag/tag.ts +14 -7
  708. package/src/text-button/index.ts +3 -0
  709. package/src/{textButton/textButton.ts → text-button/text-button.ts} +7 -5
  710. package/src/textarea-field/index.ts +3 -0
  711. package/src/{textareaField/textareaField.ts → textarea-field/textarea-field.ts} +15 -7
  712. package/src/time/index.ts +1 -0
  713. package/src/time/time.ts +58 -25
  714. package/src/tips/index.ts +1 -0
  715. package/src/tips/tips.ts +183 -127
  716. package/src/toast/index.ts +3 -0
  717. package/src/toast/stack.ts +22 -23
  718. package/src/toast/toast.ts +168 -100
  719. package/src/toc/index.ts +1 -0
  720. package/src/toc/toc.ts +42 -27
  721. package/src/tokens.css +7 -24
  722. package/src/toolbar/index.ts +1 -0
  723. package/src/toolbar/toolbar.ts +78 -40
  724. package/src/{topBar/barHeight.ts → top-bar/bar-height.ts} +26 -12
  725. package/src/top-bar/index.ts +5 -0
  726. package/src/{topBar/topBar.ts → top-bar/top-bar.ts} +13 -7
  727. package/src/video-frame/index.ts +3 -0
  728. package/src/{videoFrame/videoFrame.ts → video-frame/video-frame.ts} +31 -18
  729. package/src/wall/index.ts +1 -0
  730. package/src/wall/wall.ts +13 -10
  731. package/src/window/index.ts +1 -0
  732. package/src/window/window.ts +15 -9
  733. package/src/wordmark/index.ts +1 -0
  734. package/src/wordmark/wordmark.ts +4 -3
  735. package/src/wrap/index.ts +1 -0
  736. package/src/wrap/wrap.ts +4 -3
  737. package/dist/src/audioFrame/audioFrame.d.ts.map +0 -1
  738. package/dist/src/audioFrame/index.d.ts +0 -3
  739. package/dist/src/audioFrame/index.d.ts.map +0 -1
  740. package/dist/src/audioFrame/index.js +0 -1
  741. package/dist/src/barChart/barChart.d.ts.map +0 -1
  742. package/dist/src/barChart/index.d.ts +0 -3
  743. package/dist/src/barChart/index.d.ts.map +0 -1
  744. package/dist/src/barChart/index.js +0 -1
  745. package/dist/src/chartTable/chartTable.d.ts.map +0 -1
  746. package/dist/src/codeEditor/codeEditor.d.ts.map +0 -1
  747. package/dist/src/codeEditor/index.d.ts +0 -3
  748. package/dist/src/codeEditor/index.d.ts.map +0 -1
  749. package/dist/src/codeEditor/index.js +0 -1
  750. package/dist/src/codeSurface/codeSurface.d.ts.map +0 -1
  751. package/dist/src/codeSurface/index.d.ts +0 -3
  752. package/dist/src/codeSurface/index.d.ts.map +0 -1
  753. package/dist/src/codeSurface/index.js +0 -1
  754. package/dist/src/commandPalette/commandPalette.d.ts.map +0 -1
  755. package/dist/src/commandPalette/commandPalette.js +0 -611
  756. package/dist/src/commandPalette/index.d.ts.map +0 -1
  757. package/dist/src/commandPalette/keys.d.ts.map +0 -1
  758. package/dist/src/commandPalette/keys.js +0 -102
  759. package/dist/src/commandPalette/match.d.ts.map +0 -1
  760. package/dist/src/commandPalette/message.d.ts.map +0 -1
  761. package/dist/src/confirmDialog/confirmDialog.d.ts.map +0 -1
  762. package/dist/src/confirmDialog/index.d.ts +0 -3
  763. package/dist/src/confirmDialog/index.d.ts.map +0 -1
  764. package/dist/src/contextMenu/contextMenu.d.ts.map +0 -1
  765. package/dist/src/contextMenu/index.d.ts.map +0 -1
  766. package/dist/src/copyButton/copyButton.d.ts.map +0 -1
  767. package/dist/src/copyButton/index.d.ts +0 -3
  768. package/dist/src/copyButton/index.d.ts.map +0 -1
  769. package/dist/src/copyButton/index.js +0 -1
  770. package/dist/src/dropZone/dropZone.d.ts.map +0 -1
  771. package/dist/src/dropZone/index.d.ts +0 -3
  772. package/dist/src/dropZone/index.d.ts.map +0 -1
  773. package/dist/src/dropZone/index.js +0 -1
  774. package/dist/src/editableTitle/editableTitle.d.ts.map +0 -1
  775. package/dist/src/editableTitle/index.d.ts +0 -4
  776. package/dist/src/editableTitle/index.d.ts.map +0 -1
  777. package/dist/src/emptyState/emptyState.d.ts.map +0 -1
  778. package/dist/src/emptyState/index.d.ts +0 -3
  779. package/dist/src/emptyState/index.d.ts.map +0 -1
  780. package/dist/src/emptyState/index.js +0 -1
  781. package/dist/src/errorSummary/errorSummary.d.ts.map +0 -1
  782. package/dist/src/errorSummary/index.d.ts +0 -3
  783. package/dist/src/errorSummary/index.d.ts.map +0 -1
  784. package/dist/src/errorSummary/index.js +0 -1
  785. package/dist/src/fieldGrid/fieldGrid.d.ts.map +0 -1
  786. package/dist/src/fieldGrid/index.d.ts +0 -3
  787. package/dist/src/fieldGrid/index.d.ts.map +0 -1
  788. package/dist/src/fieldGrid/index.js +0 -1
  789. package/dist/src/fileTree/fileTree.d.ts.map +0 -1
  790. package/dist/src/fileTree/fileTree.js +0 -230
  791. package/dist/src/fileTree/index.d.ts +0 -3
  792. package/dist/src/fileTree/index.d.ts.map +0 -1
  793. package/dist/src/filterChip/filterChip.d.ts.map +0 -1
  794. package/dist/src/filterChip/index.d.ts +0 -3
  795. package/dist/src/filterChip/index.d.ts.map +0 -1
  796. package/dist/src/filterChip/index.js +0 -1
  797. package/dist/src/filterStrip/filterStrip.d.ts.map +0 -1
  798. package/dist/src/filterStrip/index.d.ts +0 -3
  799. package/dist/src/filterStrip/index.d.ts.map +0 -1
  800. package/dist/src/filterStrip/index.js +0 -1
  801. package/dist/src/flashWord/flashWord.d.ts.map +0 -1
  802. package/dist/src/flashWord/index.d.ts +0 -3
  803. package/dist/src/flashWord/index.d.ts.map +0 -1
  804. package/dist/src/flashWord/index.js +0 -1
  805. package/dist/src/iconButton/iconButton.d.ts.map +0 -1
  806. package/dist/src/iconButton/index.d.ts +0 -3
  807. package/dist/src/iconButton/index.d.ts.map +0 -1
  808. package/dist/src/iconButton/index.js +0 -1
  809. package/dist/src/imageFrame/imageFrame.d.ts.map +0 -1
  810. package/dist/src/imageFrame/index.d.ts +0 -3
  811. package/dist/src/imageFrame/index.d.ts.map +0 -1
  812. package/dist/src/imageFrame/index.js +0 -1
  813. package/dist/src/inlineInput/index.d.ts +0 -3
  814. package/dist/src/inlineInput/index.d.ts.map +0 -1
  815. package/dist/src/inlineInput/inlineInput.d.ts.map +0 -1
  816. package/dist/src/keyHelp/index.d.ts +0 -3
  817. package/dist/src/keyHelp/index.d.ts.map +0 -1
  818. package/dist/src/keyHelp/keyHelp.d.ts.map +0 -1
  819. package/dist/src/keyHint/index.d.ts +0 -4
  820. package/dist/src/keyHint/index.d.ts.map +0 -1
  821. package/dist/src/keyHint/index.js +0 -2
  822. package/dist/src/keyHint/keyHint.d.ts.map +0 -1
  823. package/dist/src/keyHint/keyLabel.d.ts.map +0 -1
  824. package/dist/src/lineChart/index.d.ts +0 -3
  825. package/dist/src/lineChart/index.d.ts.map +0 -1
  826. package/dist/src/lineChart/index.js +0 -1
  827. package/dist/src/lineChart/lineChart.d.ts.map +0 -1
  828. package/dist/src/lineDiff/diff.d.ts +0 -41
  829. package/dist/src/lineDiff/diff.d.ts.map +0 -1
  830. package/dist/src/lineDiff/diff.js +0 -92
  831. package/dist/src/lineDiff/index.d.ts +0 -5
  832. package/dist/src/lineDiff/index.d.ts.map +0 -1
  833. package/dist/src/lineDiff/index.js +0 -2
  834. package/dist/src/lineDiff/lineDiff.d.ts.map +0 -1
  835. package/dist/src/lineDiff/patch.d.ts.map +0 -1
  836. package/dist/src/linkButton/index.d.ts +0 -3
  837. package/dist/src/linkButton/index.d.ts.map +0 -1
  838. package/dist/src/linkButton/index.js +0 -1
  839. package/dist/src/linkButton/linkButton.d.ts.map +0 -1
  840. package/dist/src/linkState/index.d.ts +0 -3
  841. package/dist/src/linkState/index.d.ts.map +0 -1
  842. package/dist/src/linkState/index.js +0 -1
  843. package/dist/src/linkState/linkState.d.ts.map +0 -1
  844. package/dist/src/linkState/linkState.js +0 -14
  845. package/dist/src/liveRegion/index.d.ts +0 -3
  846. package/dist/src/liveRegion/index.d.ts.map +0 -1
  847. package/dist/src/liveRegion/index.js +0 -1
  848. package/dist/src/liveRegion/liveRegion.d.ts.map +0 -1
  849. package/dist/src/navStrip/index.d.ts +0 -3
  850. package/dist/src/navStrip/index.d.ts.map +0 -1
  851. package/dist/src/navStrip/index.js +0 -1
  852. package/dist/src/navStrip/navStrip.d.ts.map +0 -1
  853. package/dist/src/navStrip/navStrip.js +0 -27
  854. package/dist/src/pageHead/index.d.ts +0 -3
  855. package/dist/src/pageHead/index.d.ts.map +0 -1
  856. package/dist/src/pageHead/index.js +0 -1
  857. package/dist/src/pageHead/pageHead.d.ts.map +0 -1
  858. package/dist/src/passwordField/index.d.ts +0 -3
  859. package/dist/src/passwordField/index.d.ts.map +0 -1
  860. package/dist/src/passwordField/index.js +0 -1
  861. package/dist/src/passwordField/passwordField.d.ts.map +0 -1
  862. package/dist/src/propsList/index.d.ts +0 -3
  863. package/dist/src/propsList/index.d.ts.map +0 -1
  864. package/dist/src/propsList/index.js +0 -1
  865. package/dist/src/propsList/propsList.d.ts.map +0 -1
  866. package/dist/src/queryChip/index.d.ts +0 -3
  867. package/dist/src/queryChip/index.d.ts.map +0 -1
  868. package/dist/src/queryChip/index.js +0 -1
  869. package/dist/src/queryChip/queryChip.d.ts.map +0 -1
  870. package/dist/src/radioChoices/index.d.ts.map +0 -1
  871. package/dist/src/radioChoices/radioChoices.d.ts.map +0 -1
  872. package/dist/src/scheme/schemeSwitch.d.ts.map +0 -1
  873. package/dist/src/selectAll/index.d.ts +0 -3
  874. package/dist/src/selectAll/index.d.ts.map +0 -1
  875. package/dist/src/selectAll/index.js +0 -1
  876. package/dist/src/selectAll/selectAll.d.ts.map +0 -1
  877. package/dist/src/selectField/index.d.ts +0 -3
  878. package/dist/src/selectField/index.d.ts.map +0 -1
  879. package/dist/src/selectField/index.js +0 -1
  880. package/dist/src/selectField/selectField.d.ts.map +0 -1
  881. package/dist/src/skipLink/index.d.ts +0 -2
  882. package/dist/src/skipLink/index.d.ts.map +0 -1
  883. package/dist/src/skipLink/index.js +0 -1
  884. package/dist/src/skipLink/skipLink.d.ts.map +0 -1
  885. package/dist/src/statusBar/index.d.ts +0 -4
  886. package/dist/src/statusBar/index.d.ts.map +0 -1
  887. package/dist/src/statusBar/index.js +0 -2
  888. package/dist/src/statusBar/statusBar.d.ts.map +0 -1
  889. package/dist/src/subscription/prefixKeys.d.ts.map +0 -1
  890. package/dist/src/textButton/index.d.ts +0 -3
  891. package/dist/src/textButton/index.d.ts.map +0 -1
  892. package/dist/src/textButton/index.js +0 -1
  893. package/dist/src/textButton/textButton.d.ts.map +0 -1
  894. package/dist/src/textareaField/index.d.ts +0 -3
  895. package/dist/src/textareaField/index.d.ts.map +0 -1
  896. package/dist/src/textareaField/index.js +0 -1
  897. package/dist/src/textareaField/textareaField.d.ts.map +0 -1
  898. package/dist/src/topBar/barHeight.d.ts.map +0 -1
  899. package/dist/src/topBar/index.d.ts +0 -4
  900. package/dist/src/topBar/index.d.ts.map +0 -1
  901. package/dist/src/topBar/index.js +0 -2
  902. package/dist/src/topBar/topBar.d.ts.map +0 -1
  903. package/dist/src/videoFrame/index.d.ts +0 -3
  904. package/dist/src/videoFrame/index.d.ts.map +0 -1
  905. package/dist/src/videoFrame/index.js +0 -1
  906. package/dist/src/videoFrame/videoFrame.d.ts.map +0 -1
  907. package/src/audioFrame/index.ts +0 -2
  908. package/src/barChart/index.ts +0 -2
  909. package/src/chartTable/chartTable.ts +0 -88
  910. package/src/codeEditor/index.ts +0 -2
  911. package/src/codeSurface/index.ts +0 -2
  912. package/src/dropZone/index.ts +0 -2
  913. package/src/emptyState/index.ts +0 -2
  914. package/src/errorSummary/index.ts +0 -2
  915. package/src/fieldGrid/index.ts +0 -2
  916. package/src/fileTree/index.ts +0 -2
  917. package/src/filterChip/index.ts +0 -2
  918. package/src/filterStrip/index.ts +0 -2
  919. package/src/flashWord/index.ts +0 -2
  920. package/src/iconButton/index.ts +0 -2
  921. package/src/imageFrame/index.ts +0 -2
  922. package/src/keyHint/index.ts +0 -3
  923. package/src/lineChart/index.ts +0 -2
  924. package/src/lineDiff/diff.ts +0 -182
  925. package/src/lineDiff/index.ts +0 -4
  926. package/src/linkButton/index.ts +0 -2
  927. package/src/linkState/index.ts +0 -2
  928. package/src/liveRegion/index.ts +0 -2
  929. package/src/navStrip/index.ts +0 -2
  930. package/src/pageHead/index.ts +0 -2
  931. package/src/passwordField/index.ts +0 -2
  932. package/src/propsList/index.ts +0 -2
  933. package/src/queryChip/index.ts +0 -2
  934. package/src/selectAll/index.ts +0 -2
  935. package/src/skipLink/index.ts +0 -1
  936. package/src/statusBar/index.ts +0 -3
  937. package/src/textButton/index.ts +0 -2
  938. package/src/textareaField/index.ts +0 -2
  939. package/src/topBar/index.ts +0 -3
  940. package/src/videoFrame/index.ts +0 -2
@@ -29,22 +29,19 @@ import {
29
29
  settle as settleDrag,
30
30
  } from "../drag/drag.ts";
31
31
  import * as Glyph from "../glyph/glyph.ts";
32
- import * as IconButton from "../iconButton/iconButton.ts";
32
+ import * as IconButton from "../icon-button/icon-button.ts";
33
33
  import { LOCALE } from "../locale/locale.ts";
34
- import { prefixKeys } from "../subscription/prefixKeys.ts";
35
-
36
- // MODEL
34
+ import { prefixKeys } from "../subscription/prefix-keys.ts";
37
35
 
38
36
  /** Schema for one item as the list knows it: its id, unique in the list, and its name in
39
37
  * words, which the grip and screen readers use. */
40
38
  export const Item = Schema.Struct({ id: Schema.String, label: Schema.String });
39
+
41
40
  export type Item = typeof Item.Type;
42
41
 
43
- /** How the keyboard carries what it holds: said on the grip and once it is picked up. */
44
- const KEYBOARD_MOVES = "Arrow keys move it one place, space drops it, escape cancels.";
42
+ const KEYBOARD_MOVES =
43
+ "Arrow keys move it one place, space drops it, escape cancels.";
45
44
 
46
- /** The words a sortable says. `{item}` stands for the item's label, `{position}` and `{total}`
47
- * for where it is, counted from one. */
48
45
  const COPY = {
49
46
  gripLabel: "Move {item}",
50
47
  gripHelp: `Press space to pick the item up. ${KEYBOARD_MOVES}`,
@@ -57,19 +54,17 @@ const COPY = {
57
54
  };
58
55
 
59
56
  const Press = Schema.Struct({
60
- pointerId: Schema.Number,
61
- clientX: Schema.Number,
62
- clientY: Schema.Number,
57
+ pointerId: Schema.Finite,
58
+ clientX: Schema.Finite,
59
+ clientY: Schema.Finite,
63
60
  });
64
61
 
65
- /** What the list keeps while an item is pressed or held: the item, the items as the view had
66
- * them when it was pressed (a drop is placed against them, and each step is said from them),
67
- * and the pointer that pressed it and where (none for the keyboard). */
68
62
  const Held = Schema.Struct({
69
63
  item: Item,
70
64
  items: Schema.Array(Item),
71
65
  maybePress: Schema.Option(Press),
72
66
  });
67
+
73
68
  type Held = typeof Held.Type;
74
69
 
75
70
  /** Schema for a sortable: the `@foldkit/ui` DragAndDrop it moves items with, whether items may
@@ -79,45 +74,43 @@ export const Model = Schema.Struct({
79
74
  isMovable: Schema.Boolean,
80
75
  maybeHeld: Schema.Option(Held),
81
76
  });
82
- export type Model = typeof Model.Type;
83
77
 
84
- // MESSAGE
78
+ export type Model = typeof Model.Type;
85
79
 
86
80
  /** Union of all Messages a sortable can produce. */
87
81
  export const Message = defineMessageUnion({
88
82
  GotDragAndDropMessage: { message: UiDragAndDrop.Message },
89
83
  PressedItem: {
90
84
  itemId: Schema.String,
91
- pointerId: Schema.Number,
92
- screenX: Schema.Number,
93
- screenY: Schema.Number,
94
- clientX: Schema.Number,
95
- clientY: Schema.Number,
85
+ pointerId: Schema.Finite,
86
+ screenX: Schema.Finite,
87
+ screenY: Schema.Finite,
88
+ clientX: Schema.Finite,
89
+ clientY: Schema.Finite,
96
90
  items: Schema.Array(Item),
97
91
  },
98
92
  PressedGripKey: { itemId: Schema.String, items: Schema.Array(Item) },
99
93
  MovedPointer: {
100
- screenX: Schema.Number,
101
- screenY: Schema.Number,
102
- clientX: Schema.Number,
103
- clientY: Schema.Number,
104
- maybeIndex: Schema.Option(Schema.Number),
94
+ screenX: Schema.Finite,
95
+ screenY: Schema.Finite,
96
+ clientX: Schema.Finite,
97
+ clientY: Schema.Finite,
98
+ maybeIndex: Schema.Option(Schema.Finite),
105
99
  },
106
100
  ReleasedPointer: {
107
- screenX: Schema.Number,
108
- screenY: Schema.Number,
109
- clientX: Schema.Number,
110
- clientY: Schema.Number,
111
- maybeIndex: Schema.Option(Schema.Number),
101
+ screenX: Schema.Finite,
102
+ screenY: Schema.Finite,
103
+ clientX: Schema.Finite,
104
+ clientY: Schema.Finite,
105
+ maybeIndex: Schema.Option(Schema.Finite),
112
106
  },
113
107
  CancelledPointer: {},
114
108
  PressedEscape: {},
115
109
  CompletedAnnounceReorder: {},
116
110
  CompletedSizeLiftedItem: {},
117
111
  });
118
- export type Message = typeof Message.Type;
119
112
 
120
- // OUT MESSAGE
113
+ export type Message = typeof Message.Type;
121
114
 
122
115
  /** Union of OutMessages a sortable reports. `Moved`: an item was dropped somewhere new.
123
116
  * `toIndex` is its place in the list once moved; `maybeAfterItemId` and `maybeBeforeItemId`
@@ -127,15 +120,14 @@ export type Message = typeof Message.Type;
127
120
  export const OutMessage = defineMessageUnion({
128
121
  Moved: {
129
122
  itemId: Schema.String,
130
- fromIndex: Schema.Number,
131
- toIndex: Schema.Number,
123
+ fromIndex: Schema.Finite,
124
+ toIndex: Schema.Finite,
132
125
  maybeAfterItemId: Schema.Option(Schema.String),
133
126
  maybeBeforeItemId: Schema.Option(Schema.String),
134
127
  },
135
128
  });
136
- export type OutMessage = typeof OutMessage.Type;
137
129
 
138
- // INIT
130
+ export type OutMessage = typeof OutMessage.Type;
139
131
 
140
132
  /** Configuration for creating a sortable with `init`. The `id` must be unique in the document;
141
133
  * the list's DOM hooks are scoped by it. */
@@ -148,48 +140,52 @@ export const init = (config: InitConfig): Model => ({
148
140
  maybeHeld: Option.none(),
149
141
  });
150
142
 
151
- // ACCESSORS
152
-
153
- /** The list's id, unique in the document. */
154
143
  const id = (model: Model): string => model.dragAndDrop.id;
155
144
 
156
- // DOM HOOKS
157
-
158
- const itemHook = (model: Model, itemId: string): string => `${id(model)}/${itemId}`;
145
+ const itemHook = (model: Model, itemId: string): string =>
146
+ `${id(model)}/${itemId}`;
159
147
 
160
148
  const GRIP_ATTRIBUTE = "sortable-grip";
161
149
 
162
- // COMMAND
163
-
164
150
  /** Says a step of a move through the page's live region (as `Announcer.Announce` does). */
165
151
  export const AnnounceReorder = Command.define("AnnounceReorder", {
166
152
  args: { text: Schema.String },
167
153
  messages: [Message.CompletedAnnounceReorder],
168
154
  execute: ({ text }) =>
169
- Announcer.announce(text).pipe(Effect.as(Message.CompletedAnnounceReorder())),
155
+ Announcer.announce(text).pipe(
156
+ Effect.as(Message.CompletedAnnounceReorder())
157
+ ),
170
158
  });
171
159
 
172
- // UPDATE
173
-
174
160
  type UpdateReturn = Update.ReturnWithOutMessage<Model, Message, OutMessage>;
175
161
 
176
- const fill = (template: string, item: string, position = 0, total = 0): string =>
162
+ const fill = (
163
+ template: string,
164
+ item: string,
165
+ position = 0,
166
+ total = 0
167
+ ): string =>
177
168
  template
178
169
  .replaceAll("{item}", item)
179
170
  .replaceAll("{position}", position.toLocaleString(LOCALE))
180
171
  .replaceAll("{total}", total.toLocaleString(LOCALE));
181
172
 
182
- const indexOf = (items: ReadonlyArray<Item>, itemId: string): Option.Option<number> =>
173
+ const indexOf = (
174
+ items: readonly Item[],
175
+ itemId: string
176
+ ): Option.Option<number> =>
183
177
  Array.findFirstIndex(items, (item) => item.id === itemId);
184
178
 
185
- /** Where the held item would land, counted among the others (both the keyboard's target and
186
- * the pointer's are), clamped to the list. */
187
179
  const targetIndex = (model: Model, held: Held): Option.Option<number> =>
188
180
  Option.map(UiDragAndDrop.maybeDropTarget(model.dragAndDrop), ({ index }) =>
189
- Math.min(Math.max(index, 0), held.items.length - 1),
181
+ Math.min(Math.max(index, 0), held.items.length - 1)
190
182
  );
191
183
 
192
- const placementOf = (model: Model, held: Held, rawIndex: number): Option.Option<OutMessage> =>
184
+ const placementOf = (
185
+ model: Model,
186
+ held: Held,
187
+ rawIndex: number
188
+ ): Option.Option<OutMessage> =>
193
189
  Option.gen(function* () {
194
190
  const fromIndex = yield* indexOf(held.items, held.item.id);
195
191
  const others = Array.filter(held.items, (item) => item.id !== held.item.id);
@@ -203,8 +199,14 @@ const placementOf = (model: Model, held: Held, rawIndex: number): Option.Option<
203
199
  itemId: held.item.id,
204
200
  fromIndex,
205
201
  toIndex,
206
- maybeAfterItemId: Option.map(Array.get(others, toIndex - 1), (item) => item.id),
207
- maybeBeforeItemId: Option.map(Array.get(others, toIndex), (item) => item.id),
202
+ maybeAfterItemId: Option.map(
203
+ Array.get(others, toIndex - 1),
204
+ (item) => item.id
205
+ ),
206
+ maybeBeforeItemId: Option.map(
207
+ Array.get(others, toIndex),
208
+ (item) => item.id
209
+ ),
208
210
  });
209
211
  });
210
212
 
@@ -217,8 +219,10 @@ const foldDragAndDropOutMessage = UiDragAndDrop.OutMessage.match<
217
219
  Update.withOutMessage(
218
220
  { model: stepModel },
219
221
  Option.getOrUndefined(
220
- Option.flatMap(stepModel.maybeHeld, (held) => placementOf(stepModel, held, toIndex)),
221
- ),
222
+ Option.flatMap(stepModel.maybeHeld, (held) =>
223
+ placementOf(stepModel, held, toIndex)
224
+ )
225
+ )
222
226
  ),
223
227
  Cancelled: () => (stepModel) => ({ model: stepModel }),
224
228
  });
@@ -235,48 +239,49 @@ const foldDragAndDrop = Update.foldChild({
235
239
  foldOutMessage: foldDragAndDropOutMessage,
236
240
  });
237
241
 
238
- /** What screen readers hear for one step of a move, from the phase before and after it.
239
- * `putBack` is what an item set down without a move says: put back, or cancelled. */
242
+ const positionOf = (index: number): number => index + 1;
243
+
240
244
  const moveText = (
241
245
  held: Held,
242
246
  previous: Model,
243
247
  next: Model,
244
248
  maybeOutMessage: Option.Option<OutMessage>,
245
- putBack: string,
249
+ putBack: string
246
250
  ): Option.Option<string> => {
247
251
  const { label } = held.item;
248
252
  const total = held.items.length;
249
253
  const before = phaseOf(previous.dragAndDrop);
250
254
  const after = phaseOf(next.dragAndDrop);
251
- const position = (index: number): number => index + 1;
252
255
 
253
256
  if (after === "Idle") {
254
257
  return isCarrying(before)
255
258
  ? Option.some(
256
259
  Option.match(maybeOutMessage, {
257
260
  onNone: () => fill(putBack, label),
258
- onSome: ({ toIndex }) => fill(COPY.dropped, label, position(toIndex), total),
259
- }),
261
+ onSome: ({ toIndex }) =>
262
+ fill(COPY.dropped, label, positionOf(toIndex), total),
263
+ })
260
264
  )
261
265
  : Option.none();
262
266
  } else if (before === "Pressed" && after === "PointerDragging") {
263
267
  return Option.some(fill(COPY.pickedUp, label));
264
268
  } else if (before === "Idle" && after === "KeyboardDragging") {
265
269
  return Option.map(targetIndex(next, held), (index) =>
266
- fill(COPY.pickedUpByKeyboard, label, position(index), total),
270
+ fill(COPY.pickedUpByKeyboard, label, positionOf(index), total)
267
271
  );
268
272
  } else if (after === "KeyboardDragging") {
269
273
  return pipe(
270
274
  targetIndex(next, held),
271
- Option.filter((index) => !Option.contains(targetIndex(previous, held), index)),
272
- Option.map((index) => fill(COPY.over, label, position(index), total)),
275
+ Option.filter(
276
+ (index) => !Option.contains(targetIndex(previous, held), index)
277
+ ),
278
+ Option.map((index) => fill(COPY.over, label, positionOf(index), total))
273
279
  );
274
- } else {
275
- return Option.none();
276
280
  }
281
+
282
+ return Option.none();
277
283
  };
278
284
 
279
- /** Announces the step a DragAndDrop update took and forgets the held item once it is down. */
280
285
  const settle =
281
286
  (previous: Model, putBack = COPY.putBack) =>
282
287
  (dragAndDropUpdate: UpdateReturn): UpdateReturn =>
@@ -289,30 +294,33 @@ const settle =
289
294
  previous,
290
295
  dragAndDropUpdate.model,
291
296
  Option.fromNullishOr(dragAndDropUpdate.outMessage),
292
- putBack,
293
- ),
297
+ putBack
298
+ )
294
299
  ),
295
- (text) => AnnounceReorder({ text }),
296
- ),
300
+ (text) => AnnounceReorder({ text })
301
+ )
297
302
  );
298
303
 
299
- /** The item `itemId` and its place, when the list may lift it now. */
300
304
  const liftable = (
301
305
  model: Model,
302
- items: ReadonlyArray<Item>,
303
- itemId: string,
306
+ items: readonly Item[],
307
+ itemId: string
304
308
  ): Option.Option<Readonly<{ index: number; item: Item }>> =>
305
309
  Option.filter(
306
310
  Option.map(
307
311
  Array.findFirstWithIndex(items, (item) => item.id === itemId),
308
- ([item, index]) => ({ index, item }),
312
+ ([item, index]) => ({ index, item })
309
313
  ),
310
- () => canLift(model),
314
+ () => canLift(model)
311
315
  );
312
316
 
313
- /** Lifts `held` with the DragAndDrop Message `lift` and says so. */
314
- const lift = (model: Model, held: Held, liftMessage: UiDragAndDrop.Message): UpdateReturn => {
317
+ const lift = (
318
+ model: Model,
319
+ held: Held,
320
+ liftMessage: UiDragAndDrop.Message
321
+ ): UpdateReturn => {
315
322
  const pressed = modifyFields(model, { maybeHeld: () => Option.some(held) });
323
+
316
324
  return settle(pressed)(foldDragAndDrop(pressed, liftMessage));
317
325
  };
318
326
 
@@ -330,43 +338,53 @@ const pointerMove = (model: Model, pointer: PointerAt): UiDragAndDrop.Message =>
330
338
  screenY: pointer.screenY,
331
339
  clientX: pointer.clientX,
332
340
  clientY: pointer.clientY,
333
- maybeDropTarget: Option.map(pointer.maybeIndex, (index) => ({ containerId: id(model), index })),
341
+ maybeDropTarget: Option.map(pointer.maybeIndex, (index) => ({
342
+ containerId: id(model),
343
+ index,
344
+ })),
334
345
  });
335
346
 
336
- /** Drops a carried item where the pointer is let go, read again there: the page may have
337
- * scrolled under a still pointer since it last moved. A press that never moved is let go
338
- * as it is, so it stays a press. */
347
+ const isPointerCarrying = (model: Model): boolean =>
348
+ phaseOf(model.dragAndDrop) === "PointerDragging";
349
+
350
+ const rereadPointerAtRelease = (
351
+ model: Model,
352
+ pointer: PointerAt
353
+ ): UpdateReturn => foldDragAndDrop(model, pointerMove(model, pointer));
354
+
339
355
  const release = (model: Model, pointer: PointerAt): UpdateReturn => {
340
- if (phaseOf(model.dragAndDrop) !== "PointerDragging") {
356
+ if (!isPointerCarrying(model)) {
341
357
  return foldDragAndDrop(model, releasedPointer());
342
358
  }
343
359
 
344
- const moved = foldDragAndDrop(model, pointerMove(model, pointer));
360
+ const moved = rereadPointerAtRelease(model, pointer);
345
361
  const released = foldDragAndDrop(moved.model, releasedPointer());
362
+
346
363
  return Update.withOutMessage(
347
364
  {
348
365
  model: released.model,
349
366
  commands: [...(moved.commands ?? []), ...(released.commands ?? [])],
350
367
  },
351
- released.outMessage,
368
+ released.outMessage
352
369
  );
353
370
  };
354
371
 
355
372
  const cancelDrag = (model: Model): UpdateReturn =>
356
373
  settle(model, COPY.cancelled)(foldDragAndDrop(model, cancelledDrag()));
357
374
 
358
- const updateDragAndDrop = (model: Model, message: UiDragAndDrop.Message): UpdateReturn =>
375
+ const updateDragAndDrop = (
376
+ model: Model,
377
+ message: UiDragAndDrop.Message
378
+ ): UpdateReturn =>
359
379
  Match.value(message).pipe(
360
380
  Match.withReturnType<UpdateReturn>(),
361
- // Tab while an item is held reaches DragAndDrop as a step to another list: the list has
362
- // no other, so it stays
363
381
  Match.tag("PressedArrowKey", ({ direction }) =>
364
382
  direction === "NextContainer" || direction === "PreviousContainer"
365
383
  ? { model }
366
- : settle(model)(foldDragAndDrop(model, message)),
384
+ : settle(model)(foldDragAndDrop(model, message))
367
385
  ),
368
386
  Match.tag("CancelledDrag", () => cancelDrag(model)),
369
- Match.orElse(() => settle(model)(foldDragAndDrop(model, message))),
387
+ Match.orElse(() => settle(model)(foldDragAndDrop(model, message)))
370
388
  );
371
389
 
372
390
  /** Processes a sortable Message and returns the next Model, Commands and OutMessage. */
@@ -374,20 +392,32 @@ export const update = (model: Model, message: Message) =>
374
392
  Message.match<UpdateReturn>(message, {
375
393
  GotDragAndDropMessage: ({ message: dragAndDropMessage }) =>
376
394
  updateDragAndDrop(model, dragAndDropMessage),
377
- PressedItem: ({ itemId, pointerId, screenX, screenY, clientX, clientY, items }) =>
395
+ PressedItem: ({
396
+ itemId,
397
+ pointerId,
398
+ screenX,
399
+ screenY,
400
+ clientX,
401
+ clientY,
402
+ items,
403
+ }) =>
378
404
  Option.match(liftable(model, items, itemId), {
379
405
  onNone: () => ({ model }),
380
406
  onSome: ({ index, item }) =>
381
407
  lift(
382
408
  model,
383
- { item, items, maybePress: Option.some({ pointerId, clientX, clientY }) },
409
+ {
410
+ item,
411
+ items,
412
+ maybePress: Option.some({ pointerId, clientX, clientY }),
413
+ },
384
414
  pressedDraggable({
385
415
  itemId: itemHook(model, itemId),
386
416
  containerId: id(model),
387
417
  index,
388
418
  screenX,
389
419
  screenY,
390
- }),
420
+ })
391
421
  ),
392
422
  }),
393
423
  PressedGripKey: ({ itemId, items }) =>
@@ -401,52 +431,49 @@ export const update = (model: Model, message: Message) =>
401
431
  itemId: itemHook(model, itemId),
402
432
  containerId: id(model),
403
433
  index,
404
- }),
434
+ })
405
435
  ),
406
436
  }),
407
- MovedPointer: (pointer) => settle(model)(foldDragAndDrop(model, pointerMove(model, pointer))),
437
+ MovedPointer: (pointer) =>
438
+ settle(model)(foldDragAndDrop(model, pointerMove(model, pointer))),
408
439
  ReleasedPointer: (pointer) => settle(model)(release(model, pointer)),
409
- CancelledPointer: () => settle(model)(foldDragAndDrop(model, cancelledDrag())),
440
+ CancelledPointer: () =>
441
+ settle(model)(foldDragAndDrop(model, cancelledDrag())),
410
442
  PressedEscape: () => cancelDrag(model),
411
443
  CompletedAnnounceReorder: () => ({ model }),
412
444
  CompletedSizeLiftedItem: () => ({ model }),
413
445
  });
414
446
 
415
- // CAPABILITIES
416
-
417
447
  /** Lets items move, or stops them: while work runs, nothing moves. Stopping cancels an item
418
448
  * that is pressed or held, so no `Moved` arrives for it. */
419
449
  export const setMovable = (model: Model, isMovable: boolean): UpdateReturn => {
420
450
  const next = modifyFields(model, { isMovable: () => isMovable });
451
+
421
452
  return isMovable ? { model: next } : cancelDrag(next);
422
453
  };
423
454
 
424
- // SUBSCRIPTION
425
-
426
- // NOTE: @foldkit/ui gap: DragAndDrop's pointer resolves a drop along one axis, which a
427
- // wrapping grid cannot use, so the list reads the pointer itself and hands DragAndDrop its
428
- // moves and release.
429
- /** Where a pointer at this point would drop the held item in the list `listId`: none when the
430
- * pointer is not over it. */
431
455
  const pointerIndex = (
432
456
  listId: string,
433
457
  heldHook: string,
434
458
  clientX: number,
435
- clientY: number,
459
+ clientY: number
436
460
  ): Option.Option<number> =>
437
461
  pipe(
438
462
  Array.findFirst(
439
463
  document.elementsFromPoint(clientX, clientY),
440
- (element) => element.getAttribute("data-droppable-id") === listId,
464
+ (element) =>
465
+ element instanceof HTMLElement &&
466
+ element.dataset["droppableId"] === listId
441
467
  ),
442
- Option.map((list) => insertionIndex(list, heldHook, clientX, clientY)),
468
+ Option.map((list) => insertionIndex(list, heldHook, clientX, clientY))
443
469
  );
444
470
 
445
471
  const PointerHold = Schema.Struct({
446
472
  listId: Schema.String,
447
473
  heldHook: Schema.String,
448
- pointerId: Schema.Number,
474
+ pointerId: Schema.Finite,
449
475
  });
476
+
450
477
  type PointerHold = typeof PointerHold.Type;
451
478
 
452
479
  const pointerAt = (hold: PointerHold, event: PointerEvent): PointerAt => ({
@@ -454,10 +481,14 @@ const pointerAt = (hold: PointerHold, event: PointerEvent): PointerAt => ({
454
481
  screenY: event.screenY,
455
482
  clientX: event.clientX,
456
483
  clientY: event.clientY,
457
- maybeIndex: pointerIndex(hold.listId, hold.heldHook, event.clientX, event.clientY),
484
+ maybeIndex: pointerIndex(
485
+ hold.listId,
486
+ hold.heldHook,
487
+ event.clientX,
488
+ event.clientY
489
+ ),
458
490
  });
459
491
 
460
- /** The pressing pointer's moves, release and cancel; another pointer's are not the list's. */
461
492
  const pointerMessages = (hold: PointerHold): Stream.Stream<Message> =>
462
493
  dragMessages<Message>(hold.pointerId, {
463
494
  moved: (event) => Message.MovedPointer(pointerAt(hold, event)),
@@ -476,12 +507,13 @@ const pointerSubscriptions = Subscription.make<Model, Message>()((entry) => ({
476
507
  listId: id(model),
477
508
  heldHook: itemHook(model, item.id),
478
509
  pointerId,
479
- })),
510
+ }))
480
511
  ),
481
512
  () => {
482
513
  const phase = phaseOf(model.dragAndDrop);
514
+
483
515
  return phase === "Pressed" || phase === "PointerDragging";
484
- },
516
+ }
485
517
  ),
486
518
  }),
487
519
  dependenciesToStream: ({ maybeHold }) =>
@@ -489,13 +521,10 @@ const pointerSubscriptions = Subscription.make<Model, Message>()((entry) => ({
489
521
  onNone: () => Stream.empty,
490
522
  onSome: (hold) => Stream.merge(pointerMessages(hold), markDragging),
491
523
  }),
492
- },
524
+ }
493
525
  ),
494
526
  }));
495
527
 
496
- // NOTE: @foldkit/ui gap: DragAndDrop's Subscription keys are fixed, so two of its users on a
497
- // page would share them. The list lifts the ones it uses under its own names, behind the
498
- // parent's prefix.
499
528
  const dragSubscriptions = Subscription.lift({
500
529
  keyboard: UiDragAndDrop.subscriptions.documentKeyboard,
501
530
  autoScroll: UiDragAndDrop.subscriptions.autoScroll,
@@ -507,7 +536,7 @@ const dragSubscriptions = Subscription.lift({
507
536
  const sortableSubscriptions = Subscription.aggregate(
508
537
  pointerSubscriptions,
509
538
  escapeSubscriptions<Model, Message>(Message.PressedEscape()),
510
- dragSubscriptions,
539
+ dragSubscriptions
511
540
  );
512
541
 
513
542
  /** A held item follows the pointer, the arrows and Space move and drop it, Escape puts it back
@@ -518,22 +547,28 @@ const sortableSubscriptions = Subscription.aggregate(
518
547
  export const subscriptions = <Prefix extends string>(keyPrefix: Prefix) =>
519
548
  prefixKeys(keyPrefix, sortableSubscriptions);
520
549
 
521
- // LIFTED ITEM
522
-
523
550
  /** Sizes the copy that follows the pointer to the item it lifts, and keeps the pointer where
524
551
  * it pressed the item. Measures the item once, when the copy appears. */
525
552
  export const SizeLiftedItem = Mount.define("SizeLiftedItem", {
526
- args: { itemHook: Schema.String, pressX: Schema.Number, pressY: Schema.Number },
553
+ args: {
554
+ itemHook: Schema.String,
555
+ pressX: Schema.Finite,
556
+ pressY: Schema.Finite,
557
+ },
527
558
  messages: [Message.CompletedSizeLiftedItem],
528
559
  execute: ({ element, itemHook: hook, pressX, pressY }) =>
529
560
  Effect.sync(() => {
530
- measureLift(element, `[data-sortable-id="${CSS.escape(hook)}"]`, pressX, pressY);
561
+ measureLift(
562
+ element,
563
+ `[data-sortable-id="${CSS.escape(hook)}"]`,
564
+ pressX,
565
+ pressY
566
+ );
567
+
531
568
  return Message.CompletedSizeLiftedItem();
532
569
  }),
533
570
  });
534
571
 
535
- // VIEW
536
-
537
572
  /** How the items lay out: a column of rows, tiles that wrap, or the parent's own panels. */
538
573
  export type Layout = "List" | "Grid" | "Panels";
539
574
 
@@ -550,7 +585,7 @@ export type ItemRender = Readonly<{
550
585
  /** Per-render inputs passed to `view` through `h.submodel`'s `viewInputs`. The `to*` members
551
586
  * are functions because they may carry the parent's handlers. */
552
587
  export type ViewInputs = Readonly<{
553
- items: ReadonlyArray<Item>;
588
+ items: readonly Item[];
554
589
  /** Names the list for screen readers. */
555
590
  label: string;
556
591
  /** `"List"` (the default): rows between 1px rules, for a flush panel. `"Grid"`: tiles that
@@ -562,62 +597,80 @@ export type ViewInputs = Readonly<{
562
597
  isReadOnly?: boolean;
563
598
  /** One item's content, beside its grip. Also called for the held copy, with
564
599
  * `render.isLifted`. */
565
- toItemView: (item: Item, render: ItemRender) => ReadonlyArray<Html>;
600
+ toItemView: (item: Item, render: ItemRender) => readonly Html[];
566
601
  }>;
567
602
 
568
603
  type ListInfo = Readonly<{
569
604
  model: Model;
570
605
  layout: Layout;
571
606
  isMovable: boolean;
572
- items: ReadonlyArray<Item>;
607
+ items: readonly Item[];
573
608
  maybeDropMark: Option.Option<DropMark>;
574
- toItemView: (item: Item, render: ItemRender) => ReadonlyArray<Html>;
609
+ toItemView: (item: Item, render: ItemRender) => readonly Html[];
575
610
  }>;
576
611
 
577
612
  const helpId = (model: Model): string => `${id(model)}-grip-help`;
578
613
 
579
614
  const isHeldItem = (model: Model, itemId: string): boolean =>
580
615
  UiDragAndDrop.isDragging(model.dragAndDrop) &&
581
- Option.contains(UiDragAndDrop.maybeDraggedItemId(model.dragAndDrop), itemHook(model, itemId));
616
+ Option.contains(
617
+ UiDragAndDrop.maybeDraggedItemId(model.dragAndDrop),
618
+ itemHook(model, itemId)
619
+ );
582
620
 
583
621
  const liftedGrip = <ParentMessage>(h: HtmlBuilder<ParentMessage>): Html =>
584
- h.span([h.Class("iconbtn quiet"), h.AriaHidden(true)], [Glyph.view({ name: "grip" }, h)]);
622
+ h.span(
623
+ [h.Class("iconbtn quiet"), h.AriaHidden(true)],
624
+ [Glyph.view({ name: "grip" }, h)]
625
+ );
585
626
 
586
- /** The item's content beside its grip, or, in a layout where the item places its grip,
587
- * alone. */
588
627
  const itemContents = <ParentMessage>(
589
628
  info: ListInfo,
590
629
  item: Item,
591
630
  render: ItemRender,
592
- h: HtmlBuilder<ParentMessage>,
593
- ): ReadonlyArray<Html> => {
631
+ h: HtmlBuilder<ParentMessage>
632
+ ): readonly Html[] => {
594
633
  const body = h.div([h.Class("sortable-body")], info.toItemView(item, render));
634
+
595
635
  return info.layout === "Panels" ? [body] : [render.grip, body];
596
636
  };
597
637
 
598
638
  const liftedView = <ParentMessage>(
599
639
  info: ListInfo,
600
640
  item: Item,
601
- h: HtmlBuilder<ParentMessage>,
641
+ h: HtmlBuilder<ParentMessage>
602
642
  ): Html =>
603
643
  h.div(
604
644
  [h.Class("sortable-item lifted")],
605
- itemContents(info, item, { isLifted: true, grip: liftedGrip(h) }, h),
645
+ itemContents(info, item, { isLifted: true, grip: liftedGrip(h) }, h)
606
646
  );
607
647
 
608
- const gripView = (info: ListInfo, item: Item, h: HtmlBuilder<Message>): Html => {
648
+ const gripView = (
649
+ info: ListInfo,
650
+ item: Item,
651
+ h: HtmlBuilder<Message>
652
+ ): Html => {
609
653
  const { model, isMovable, items } = info;
610
654
  const isIdleNow = phaseOf(model.dragAndDrop) === "Idle";
611
655
 
612
656
  const onGripKey: Attribute<Message> = h.OnKeyDownPreventDefault((key) =>
613
657
  Option.liftPredicate(
614
658
  Message.PressedGripKey({ itemId: item.id, items }),
615
- () => isIdleNow && (key === " " || key === "Enter"),
616
- ),
659
+ () => isIdleNow && (key === " " || key === "Enter")
660
+ )
617
661
  );
618
662
 
619
663
  const onGripPress: Attribute<Message> = h.OnPointerDown(
620
- (_pointerType, button, screenX, screenY, _time, clientX, clientY, pointerId) =>
664
+ (
665
+ _pointerType,
666
+ button,
667
+ screenX,
668
+ screenY,
669
+ _time,
670
+ clientX,
671
+ clientY,
672
+ pointerId
673
+ ) =>
621
674
  Option.liftPredicate(
622
675
  Message.PressedItem({
623
676
  itemId: item.id,
@@ -628,14 +681,10 @@ const gripView = (info: ListInfo, item: Item, h: HtmlBuilder<Message>): Html =>
628
681
  clientY,
629
682
  items,
630
683
  }),
631
- () => isIdleNow && button === LEFT_BUTTON,
632
- ),
684
+ () => isIdleNow && button === LEFT_BUTTON
685
+ )
633
686
  );
634
687
 
635
- // NOTE: @foldkit/ui gap: DragAndDrop's `draggable` bundle forces `role="option"`, which a
636
- // plain list's items are not. So the grip carries the ui's `data-draggable-id` by hand, and
637
- // FocusItem finds the grip by it. While moves are held the grip stays, held, so the focus
638
- // of a keyboard hold that stopping cancels has somewhere to return.
639
688
  return IconButton.view(
640
689
  {
641
690
  glyph: "grip",
@@ -651,14 +700,12 @@ const gripView = (info: ListInfo, item: Item, h: HtmlBuilder<Message>): Html =>
651
700
  ...(isMovable ? [onGripKey, onGripPress] : []),
652
701
  ],
653
702
  },
654
- h,
703
+ h
655
704
  );
656
705
  };
657
706
 
658
707
  type DropMark = Readonly<{ itemId: string; side: "Before" | "After" }>;
659
708
 
660
- /** Where a pointer would drop the held item, marked on the item it would land beside: before
661
- * the other item at its target, or after the last. None where it already was. */
662
709
  const dropMarkOf = (model: Model): Option.Option<DropMark> =>
663
710
  pipe(
664
711
  model.maybeHeld,
@@ -666,9 +713,15 @@ const dropMarkOf = (model: Model): Option.Option<DropMark> =>
666
713
  Option.flatMap((held) =>
667
714
  pipe(
668
715
  targetIndex(model, held),
669
- Option.filter((index) => !Option.contains(indexOf(held.items, held.item.id), index)),
716
+ Option.filter(
717
+ (index) => !Option.contains(indexOf(held.items, held.item.id), index)
718
+ ),
670
719
  Option.flatMap((index) => {
671
- const others = Array.filter(held.items, (item) => item.id !== held.item.id);
720
+ const others = Array.filter(
721
+ held.items,
722
+ (item) => item.id !== held.item.id
723
+ );
724
+
672
725
  return Option.orElse(
673
726
  Option.map(Array.get(others, index), (item): DropMark => ({
674
727
  itemId: item.id,
@@ -678,11 +731,11 @@ const dropMarkOf = (model: Model): Option.Option<DropMark> =>
678
731
  Option.map(Array.last(others), (item): DropMark => ({
679
732
  itemId: item.id,
680
733
  side: "After",
681
- })),
734
+ }))
682
735
  );
683
- }),
684
- ),
685
- ),
736
+ })
737
+ )
738
+ )
686
739
  );
687
740
 
688
741
  const dropClass = (info: ListInfo, item: Item): string =>
@@ -690,8 +743,9 @@ const dropClass = (info: ListInfo, item: Item): string =>
690
743
  Option.filter(info.maybeDropMark, ({ itemId }) => itemId === item.id),
691
744
  {
692
745
  onNone: () => "",
693
- onSome: ({ side }) => (side === "Before" ? " drop-before" : " drop-after"),
694
- },
746
+ onSome: ({ side }) =>
747
+ side === "Before" ? " drop-before" : " drop-after",
748
+ }
695
749
  );
696
750
 
697
751
  const itemClass = (info: ListInfo, item: Item): string =>
@@ -700,20 +754,35 @@ const itemClass = (info: ListInfo, item: Item): string =>
700
754
  const itemView = (info: ListInfo, item: Item, h: HtmlBuilder<Message>): Html =>
701
755
  h.keyed("li")(
702
756
  item.id,
703
- [...UiDragAndDrop.sortable(itemHook(info.model, item.id)), h.Class(itemClass(info, item))],
704
- itemContents(info, item, { isLifted: false, grip: gripView(info, item, h) }, h),
757
+ [
758
+ ...UiDragAndDrop.sortable(itemHook(info.model, item.id)),
759
+ h.Class(itemClass(info, item)),
760
+ ],
761
+ itemContents(
762
+ info,
763
+ item,
764
+ { isLifted: false, grip: gripView(info, item, h) },
765
+ h
766
+ )
705
767
  );
706
768
 
707
- /** The items in order, with the held item's copy where the keyboard would drop it: before the
708
- * other item at its target, or last. The copy carries no `data-sortable-id`, so it is not
709
- * counted as an item. */
710
- const itemsView = (info: ListInfo, h: HtmlBuilder<Message>): ReadonlyArray<Html> => {
769
+ const itemsView = (
770
+ info: ListInfo,
771
+ h: HtmlBuilder<Message>
772
+ ): readonly Html[] => {
711
773
  const { model, items } = info;
712
- const rows = Array.map(items, (item) => ({ item, html: itemView(info, item, h) }));
774
+
775
+ const rows = Array.map(items, (item) => ({
776
+ item,
777
+ html: itemView(info, item, h),
778
+ }));
779
+
713
780
  const maybeSlot = pipe(
714
781
  model.maybeHeld,
715
782
  Option.filter(() => phaseOf(model.dragAndDrop) === "KeyboardDragging"),
716
- Option.flatMap((held) => Option.map(targetIndex(model, held), (index) => ({ held, index }))),
783
+ Option.flatMap((held) =>
784
+ Option.map(targetIndex(model, held), (index) => ({ held, index }))
785
+ )
717
786
  );
718
787
 
719
788
  return Option.match(maybeSlot, {
@@ -722,8 +791,9 @@ const itemsView = (info: ListInfo, h: HtmlBuilder<Message>): ReadonlyArray<Html>
722
791
  const slot = h.keyed("li")(
723
792
  "sortable-slot",
724
793
  [h.Class("sortable-slot"), h.AriaHidden(true), h.Inert(true)],
725
- [liftedView(info, held.item, h)],
794
+ [liftedView(info, held.item, h)]
726
795
  );
796
+
727
797
  const others = Array.filter(rows, ({ item }) => item.id !== held.item.id);
728
798
  const maybeBefore = Array.get(others, index);
729
799
 
@@ -731,15 +801,19 @@ const itemsView = (info: ListInfo, h: HtmlBuilder<Message>): ReadonlyArray<Html>
731
801
  onNone: () => [...Array.map(rows, ({ html }) => html), slot],
732
802
  onSome: (before) =>
733
803
  Array.flatMap(rows, ({ item, html }) =>
734
- item.id === before.item.id ? [slot, html] : [html],
804
+ item.id === before.item.id ? [slot, html] : [html]
735
805
  ),
736
806
  });
737
807
  },
738
808
  });
739
809
  };
740
810
 
741
- const liftedCopyView = (info: ListInfo, h: HtmlBuilder<Message>): ReadonlyArray<Html> => {
811
+ const liftedCopyView = (
812
+ info: ListInfo,
813
+ h: HtmlBuilder<Message>
814
+ ): readonly Html[] => {
742
815
  const { model } = info;
816
+
743
817
  const maybeLifted = Option.all({
744
818
  style: UiDragAndDrop.ghostStyle(model.dragAndDrop),
745
819
  held: model.maybeHeld,
@@ -759,12 +833,12 @@ const liftedCopyView = (info: ListInfo, h: HtmlBuilder<Message>): ReadonlyArray<
759
833
  itemHook: itemHook(model, held.item.id),
760
834
  pressX: press.clientX,
761
835
  pressY: press.clientY,
762
- }),
836
+ })
763
837
  ),
764
838
  ],
765
- [liftedView(info, held.item, h)],
766
- ),
767
- ),
839
+ [liftedView(info, held.item, h)]
840
+ )
841
+ )
768
842
  );
769
843
  };
770
844
 
@@ -774,7 +848,7 @@ const layoutClass = (layout: Layout): string =>
774
848
  Match.when("List", () => "sortable"),
775
849
  Match.when("Grid", () => "sortable grid"),
776
850
  Match.when("Panels", () => "sortable panels"),
777
- Match.exhaustive,
851
+ Match.exhaustive
778
852
  );
779
853
 
780
854
  /**
@@ -791,33 +865,40 @@ const layoutClass = (layout: Layout): string =>
791
865
  * Lift `subscriptions(keyPrefix)` into the application's, or nothing follows the pointer or
792
866
  * the keys.
793
867
  */
794
- export const view = defineView<Model, Message, ViewInputs>((model, viewInputs, h): Html => {
795
- const { items, label, layout = "List", isReadOnly = false, toItemView } = viewInputs;
796
- const info: ListInfo = {
797
- model,
798
- layout,
799
- isMovable: model.isMovable && !isReadOnly,
800
- items,
801
- maybeDropMark: dropMarkOf(model),
802
- toItemView,
803
- };
804
-
805
- return h.div(
806
- [h.Class(layoutClass(layout))],
807
- [
808
- // NOTE: Safari takes list semantics from a list printed without markers, so the list
809
- // says it is one
810
- h.ul(
811
- [
812
- h.DataAttribute("droppable-id", id(model)),
813
- h.Role("list"),
814
- h.AriaLabel(label),
815
- h.Class("sortable-items"),
816
- ],
817
- itemsView(info, h),
818
- ),
819
- h.p([h.Id(helpId(model)), h.Class("sr-only")], [COPY.gripHelp]),
820
- ...liftedCopyView(info, h),
821
- ],
822
- );
823
- });
868
+ export const view = defineView<Model, Message, ViewInputs>(
869
+ (model, viewInputs, h): Html => {
870
+ const {
871
+ items,
872
+ label,
873
+ layout = "List",
874
+ isReadOnly = false,
875
+ toItemView,
876
+ } = viewInputs;
877
+
878
+ const info: ListInfo = {
879
+ model,
880
+ layout,
881
+ isMovable: model.isMovable && !isReadOnly,
882
+ items,
883
+ maybeDropMark: dropMarkOf(model),
884
+ toItemView,
885
+ };
886
+
887
+ return h.div(
888
+ [h.Class(layoutClass(layout))],
889
+ [
890
+ h.ul(
891
+ [
892
+ h.DataAttribute("droppable-id", id(model)),
893
+ h.Role("list"),
894
+ h.AriaLabel(label),
895
+ h.Class("sortable-items"),
896
+ ],
897
+ itemsView(info, h)
898
+ ),
899
+ h.p([h.Id(helpId(model)), h.Class("sr-only")], [COPY.gripHelp]),
900
+ ...liftedCopyView(info, h),
901
+ ]
902
+ );
903
+ }
904
+ );