@k2b/ui 0.63.0 → 0.64.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 (332) hide show
  1. package/dist/base.css +6 -3
  2. package/dist/browser/actions/ContextMenu.js +3 -1
  3. package/dist/browser/actions/ContextMenu.js.map +1 -1
  4. package/dist/browser/actions/DragAndDrop.js +26 -5
  5. package/dist/browser/actions/DragAndDrop.js.map +1 -1
  6. package/dist/browser/actions/DropOverlay.js +76 -0
  7. package/dist/browser/actions/DropOverlay.js.map +1 -0
  8. package/dist/browser/actions/Dropdown.js +69 -15
  9. package/dist/browser/actions/Dropdown.js.map +1 -1
  10. package/dist/browser/actions/SortableList.js +338 -85
  11. package/dist/browser/actions/SortableList.js.map +1 -1
  12. package/dist/browser/actions/ViewTabs.js +9 -5
  13. package/dist/browser/actions/ViewTabs.js.map +1 -1
  14. package/dist/browser/actions/drag-and-drop-keyboard.js +211 -0
  15. package/dist/browser/actions/drag-and-drop-keyboard.js.map +1 -0
  16. package/dist/browser/actions/drag-and-drop-messages.js +21 -25
  17. package/dist/browser/actions/drag-and-drop-messages.js.map +1 -1
  18. package/dist/browser/actions/drag-and-drop.js +206 -184
  19. package/dist/browser/actions/drag-and-drop.js.map +1 -1
  20. package/dist/browser/actions/drop-overlay-pages.js +54 -0
  21. package/dist/browser/actions/drop-overlay-pages.js.map +1 -0
  22. package/dist/browser/actions/drop-overlay-view.js +318 -0
  23. package/dist/browser/actions/drop-overlay-view.js.map +1 -0
  24. package/dist/browser/actions/index.js +4 -2
  25. package/dist/browser/actions/index.js.map +1 -1
  26. package/dist/browser/actions/menu-sheet-messages.js +26 -0
  27. package/dist/browser/actions/menu-sheet-messages.js.map +1 -0
  28. package/dist/browser/actions/menu-sheet.js +80 -18
  29. package/dist/browser/actions/menu-sheet.js.map +1 -1
  30. package/dist/browser/actions/menu-submenu-panel.js +392 -0
  31. package/dist/browser/actions/menu-submenu-panel.js.map +1 -0
  32. package/dist/browser/actions/preload-when-idle.js +15 -0
  33. package/dist/browser/actions/preload-when-idle.js.map +1 -0
  34. package/dist/browser/actions/sortable-board.js +107 -0
  35. package/dist/browser/actions/sortable-board.js.map +1 -0
  36. package/dist/browser/actions/sortable-keyboard.js +202 -0
  37. package/dist/browser/actions/sortable-keyboard.js.map +1 -0
  38. package/dist/browser/actions/sortable-list-messages.js +23 -11
  39. package/dist/browser/actions/sortable-list-messages.js.map +1 -1
  40. package/dist/browser/actions/sortable-place.js +26 -0
  41. package/dist/browser/actions/sortable-place.js.map +1 -0
  42. package/dist/browser/chat/ChatDecision.js +499 -463
  43. package/dist/browser/chat/ChatDecision.js.map +1 -1
  44. package/dist/browser/chat/ChatDecisionField.js +311 -0
  45. package/dist/browser/chat/ChatDecisionField.js.map +1 -0
  46. package/dist/browser/chat/index.js +2 -0
  47. package/dist/browser/chat/index.js.map +1 -1
  48. package/dist/browser/chat/types.js.map +1 -1
  49. package/dist/browser/chat-decision-field.js +6 -0
  50. package/dist/browser/chat-decision-field.js.map +1 -0
  51. package/dist/browser/content/DataTable.js +326 -205
  52. package/dist/browser/content/DataTable.js.map +1 -1
  53. package/dist/browser/content/FileName.js +68 -0
  54. package/dist/browser/content/FileName.js.map +1 -0
  55. package/dist/browser/content/ProgressPath.js +30 -25
  56. package/dist/browser/content/ProgressPath.js.map +1 -1
  57. package/dist/browser/content/TaskRow.js +129 -0
  58. package/dist/browser/content/TaskRow.js.map +1 -0
  59. package/dist/browser/content/index.js +2 -0
  60. package/dist/browser/content/index.js.map +1 -1
  61. package/dist/browser/content/progress-path-messages.js +22 -0
  62. package/dist/browser/content/progress-path-messages.js.map +1 -0
  63. package/dist/browser/feedback/dialog-core.js +68 -11
  64. package/dist/browser/feedback/dialog-core.js.map +1 -1
  65. package/dist/browser/feedback/dialog-foot.js +45 -0
  66. package/dist/browser/feedback/dialog-foot.js.map +1 -0
  67. package/dist/browser/inputs/DatePicker.js +369 -716
  68. package/dist/browser/inputs/DatePicker.js.map +1 -1
  69. package/dist/browser/inputs/FileInputs.js +1 -1
  70. package/dist/browser/inputs/FileInputs.js.map +1 -1
  71. package/dist/browser/inputs/NumberInput.js +125 -46
  72. package/dist/browser/inputs/NumberInput.js.map +1 -1
  73. package/dist/browser/inputs/PeriodPicker.js +9 -4
  74. package/dist/browser/inputs/PeriodPicker.js.map +1 -1
  75. package/dist/browser/inputs/TextInput.js +3 -3
  76. package/dist/browser/inputs/TextInput.js.map +1 -1
  77. package/dist/browser/inputs/date-picker-panel.js +420 -0
  78. package/dist/browser/inputs/date-picker-panel.js.map +1 -0
  79. package/dist/browser/inputs/image-crop.js +1 -1
  80. package/dist/browser/inputs/image-crop.js.map +1 -1
  81. package/dist/browser/inputs/image-tools.js +4 -0
  82. package/dist/browser/inputs/image-tools.js.map +1 -0
  83. package/dist/browser/inputs/input-messages.js +8 -2
  84. package/dist/browser/inputs/input-messages.js.map +1 -1
  85. package/dist/browser/internal/field.js +2 -2
  86. package/dist/browser/internal/field.js.map +1 -1
  87. package/dist/browser/internal/renders-something.js +3 -0
  88. package/dist/browser/internal/renders-something.js.map +1 -0
  89. package/dist/browser/intl/messages.js +1 -1
  90. package/dist/browser/intl/messages.js.map +1 -1
  91. package/dist/browser/layout/AppWorkspace.js +16 -8
  92. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  93. package/dist/browser/layout/Breadcrumbs.js +188 -42
  94. package/dist/browser/layout/Breadcrumbs.js.map +1 -1
  95. package/dist/browser/layout/DetailPanel.js +209 -205
  96. package/dist/browser/layout/DetailPanel.js.map +1 -1
  97. package/dist/browser/layout/FloatingPill.js +33 -0
  98. package/dist/browser/layout/FloatingPill.js.map +1 -0
  99. package/dist/browser/layout/PanelDialog.js +176 -88
  100. package/dist/browser/layout/PanelDialog.js.map +1 -1
  101. package/dist/browser/layout/StatusRow.js +174 -0
  102. package/dist/browser/layout/StatusRow.js.map +1 -0
  103. package/dist/browser/layout/app-workspace-controller.js +12 -5
  104. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  105. package/dist/browser/layout/app-workspace-state.js +2 -2
  106. package/dist/browser/layout/app-workspace-state.js.map +1 -1
  107. package/dist/browser/layout/index.js +2 -0
  108. package/dist/browser/layout/index.js.map +1 -1
  109. package/dist/browser/layout/panel-dialog-error.js +44 -0
  110. package/dist/browser/layout/panel-dialog-error.js.map +1 -0
  111. package/dist/browser/layout/panel-sheet-handle.js +86 -0
  112. package/dist/browser/layout/panel-sheet-handle.js.map +1 -0
  113. package/dist/browser/layout/workspace-messages.js +12 -2
  114. package/dist/browser/layout/workspace-messages.js.map +1 -1
  115. package/dist/browser/layout-check.js +232 -0
  116. package/dist/browser/layout-check.js.map +1 -0
  117. package/dist/browser/surfaces/Area.js +205 -0
  118. package/dist/browser/surfaces/Area.js.map +1 -0
  119. package/dist/browser/surfaces/FactGroup.js +148 -0
  120. package/dist/browser/surfaces/FactGroup.js.map +1 -0
  121. package/dist/browser/surfaces/FieldGrid.js +34 -0
  122. package/dist/browser/surfaces/FieldGrid.js.map +1 -0
  123. package/dist/browser/surfaces/NoticeCard.js +69 -57
  124. package/dist/browser/surfaces/NoticeCard.js.map +1 -1
  125. package/dist/browser/surfaces/Placeholder.js +17 -5
  126. package/dist/browser/surfaces/Placeholder.js.map +1 -1
  127. package/dist/browser/surfaces/RowGroup.js +82 -0
  128. package/dist/browser/surfaces/RowGroup.js.map +1 -0
  129. package/dist/browser/surfaces/Section.js +22 -7
  130. package/dist/browser/surfaces/Section.js.map +1 -1
  131. package/dist/browser/surfaces/StatusBadge.js +5 -1
  132. package/dist/browser/surfaces/StatusBadge.js.map +1 -1
  133. package/dist/browser/surfaces/flat-block-messages.js +37 -0
  134. package/dist/browser/surfaces/flat-block-messages.js.map +1 -0
  135. package/dist/browser/surfaces/index.js +4 -0
  136. package/dist/browser/surfaces/index.js.map +1 -1
  137. package/dist/ssr/actions/ContextMenu.js +3 -1
  138. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  139. package/dist/ssr/actions/DragAndDrop.js +26 -5
  140. package/dist/ssr/actions/DragAndDrop.js.map +1 -1
  141. package/dist/ssr/actions/DropOverlay.js +69 -0
  142. package/dist/ssr/actions/DropOverlay.js.map +1 -0
  143. package/dist/ssr/actions/Dropdown.js +69 -15
  144. package/dist/ssr/actions/Dropdown.js.map +1 -1
  145. package/dist/ssr/actions/SortableList.js +293 -71
  146. package/dist/ssr/actions/SortableList.js.map +1 -1
  147. package/dist/ssr/actions/ViewTabs.js +9 -5
  148. package/dist/ssr/actions/ViewTabs.js.map +1 -1
  149. package/dist/ssr/actions/drag-and-drop-keyboard.js +211 -0
  150. package/dist/ssr/actions/drag-and-drop-keyboard.js.map +1 -0
  151. package/dist/ssr/actions/drag-and-drop-messages.js +21 -25
  152. package/dist/ssr/actions/drag-and-drop-messages.js.map +1 -1
  153. package/dist/ssr/actions/drag-and-drop.js +206 -184
  154. package/dist/ssr/actions/drag-and-drop.js.map +1 -1
  155. package/dist/ssr/actions/drop-overlay-pages.js +54 -0
  156. package/dist/ssr/actions/drop-overlay-pages.js.map +1 -0
  157. package/dist/ssr/actions/drop-overlay-view.js +225 -0
  158. package/dist/ssr/actions/drop-overlay-view.js.map +1 -0
  159. package/dist/ssr/actions/index.js +4 -2
  160. package/dist/ssr/actions/index.js.map +1 -1
  161. package/dist/ssr/actions/menu-sheet-messages.js +26 -0
  162. package/dist/ssr/actions/menu-sheet-messages.js.map +1 -0
  163. package/dist/ssr/actions/menu-sheet.js +62 -10
  164. package/dist/ssr/actions/menu-sheet.js.map +1 -1
  165. package/dist/ssr/actions/menu-submenu-panel.js +295 -0
  166. package/dist/ssr/actions/menu-submenu-panel.js.map +1 -0
  167. package/dist/ssr/actions/preload-when-idle.js +15 -0
  168. package/dist/ssr/actions/preload-when-idle.js.map +1 -0
  169. package/dist/ssr/actions/sortable-board.js +107 -0
  170. package/dist/ssr/actions/sortable-board.js.map +1 -0
  171. package/dist/ssr/actions/sortable-keyboard.js +202 -0
  172. package/dist/ssr/actions/sortable-keyboard.js.map +1 -0
  173. package/dist/ssr/actions/sortable-list-messages.js +23 -11
  174. package/dist/ssr/actions/sortable-list-messages.js.map +1 -1
  175. package/dist/ssr/actions/sortable-place.js +26 -0
  176. package/dist/ssr/actions/sortable-place.js.map +1 -0
  177. package/dist/ssr/chat/ChatDecision.js +256 -228
  178. package/dist/ssr/chat/ChatDecision.js.map +1 -1
  179. package/dist/ssr/chat/ChatDecisionField.js +206 -0
  180. package/dist/ssr/chat/ChatDecisionField.js.map +1 -0
  181. package/dist/ssr/chat/index.js +2 -0
  182. package/dist/ssr/chat/index.js.map +1 -1
  183. package/dist/ssr/chat/types.js.map +1 -1
  184. package/dist/ssr/chat-decision-field.js +6 -0
  185. package/dist/ssr/chat-decision-field.js.map +1 -0
  186. package/dist/ssr/content/DataTable.js +93 -50
  187. package/dist/ssr/content/DataTable.js.map +1 -1
  188. package/dist/ssr/content/FileName.js +46 -0
  189. package/dist/ssr/content/FileName.js.map +1 -0
  190. package/dist/ssr/content/ProgressPath.js +14 -8
  191. package/dist/ssr/content/ProgressPath.js.map +1 -1
  192. package/dist/ssr/content/TaskRow.js +95 -0
  193. package/dist/ssr/content/TaskRow.js.map +1 -0
  194. package/dist/ssr/content/index.js +2 -0
  195. package/dist/ssr/content/index.js.map +1 -1
  196. package/dist/ssr/content/progress-path-messages.js +22 -0
  197. package/dist/ssr/content/progress-path-messages.js.map +1 -0
  198. package/dist/ssr/feedback/dialog-core.js +68 -11
  199. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  200. package/dist/ssr/feedback/dialog-foot.js +45 -0
  201. package/dist/ssr/feedback/dialog-foot.js.map +1 -0
  202. package/dist/ssr/inputs/DatePicker.js +94 -263
  203. package/dist/ssr/inputs/DatePicker.js.map +1 -1
  204. package/dist/ssr/inputs/FileInputs.js +1 -1
  205. package/dist/ssr/inputs/FileInputs.js.map +1 -1
  206. package/dist/ssr/inputs/NumberInput.js +114 -44
  207. package/dist/ssr/inputs/NumberInput.js.map +1 -1
  208. package/dist/ssr/inputs/PeriodPicker.js +9 -4
  209. package/dist/ssr/inputs/PeriodPicker.js.map +1 -1
  210. package/dist/ssr/inputs/TextInput.js +3 -3
  211. package/dist/ssr/inputs/TextInput.js.map +1 -1
  212. package/dist/ssr/inputs/date-picker-panel.js +233 -0
  213. package/dist/ssr/inputs/date-picker-panel.js.map +1 -0
  214. package/dist/ssr/inputs/image-crop.js +1 -1
  215. package/dist/ssr/inputs/image-crop.js.map +1 -1
  216. package/dist/ssr/inputs/image-tools.js +4 -0
  217. package/dist/ssr/inputs/image-tools.js.map +1 -0
  218. package/dist/ssr/inputs/input-messages.js +8 -2
  219. package/dist/ssr/inputs/input-messages.js.map +1 -1
  220. package/dist/ssr/internal/field.js +2 -2
  221. package/dist/ssr/internal/field.js.map +1 -1
  222. package/dist/ssr/internal/renders-something.js +3 -0
  223. package/dist/ssr/internal/renders-something.js.map +1 -0
  224. package/dist/ssr/intl/messages.js +1 -1
  225. package/dist/ssr/intl/messages.js.map +1 -1
  226. package/dist/ssr/layout/AppWorkspace.js +16 -8
  227. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  228. package/dist/ssr/layout/Breadcrumbs.js +140 -26
  229. package/dist/ssr/layout/Breadcrumbs.js.map +1 -1
  230. package/dist/ssr/layout/DetailPanel.js +70 -68
  231. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  232. package/dist/ssr/layout/FloatingPill.js +16 -0
  233. package/dist/ssr/layout/FloatingPill.js.map +1 -0
  234. package/dist/ssr/layout/PanelDialog.js +82 -8
  235. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  236. package/dist/ssr/layout/StatusRow.js +93 -0
  237. package/dist/ssr/layout/StatusRow.js.map +1 -0
  238. package/dist/ssr/layout/app-workspace-controller.js +12 -5
  239. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  240. package/dist/ssr/layout/app-workspace-state.js +2 -2
  241. package/dist/ssr/layout/app-workspace-state.js.map +1 -1
  242. package/dist/ssr/layout/index.js +2 -0
  243. package/dist/ssr/layout/index.js.map +1 -1
  244. package/dist/ssr/layout/panel-dialog-error.js +28 -0
  245. package/dist/ssr/layout/panel-dialog-error.js.map +1 -0
  246. package/dist/ssr/layout/panel-sheet-handle.js +66 -0
  247. package/dist/ssr/layout/panel-sheet-handle.js.map +1 -0
  248. package/dist/ssr/layout/workspace-messages.js +12 -2
  249. package/dist/ssr/layout/workspace-messages.js.map +1 -1
  250. package/dist/ssr/layout-check.js +232 -0
  251. package/dist/ssr/layout-check.js.map +1 -0
  252. package/dist/ssr/surfaces/Area.js +147 -0
  253. package/dist/ssr/surfaces/Area.js.map +1 -0
  254. package/dist/ssr/surfaces/FactGroup.js +106 -0
  255. package/dist/ssr/surfaces/FactGroup.js.map +1 -0
  256. package/dist/ssr/surfaces/FieldGrid.js +22 -0
  257. package/dist/ssr/surfaces/FieldGrid.js.map +1 -0
  258. package/dist/ssr/surfaces/NoticeCard.js +7 -5
  259. package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
  260. package/dist/ssr/surfaces/Placeholder.js +15 -4
  261. package/dist/ssr/surfaces/Placeholder.js.map +1 -1
  262. package/dist/ssr/surfaces/RowGroup.js +60 -0
  263. package/dist/ssr/surfaces/RowGroup.js.map +1 -0
  264. package/dist/ssr/surfaces/Section.js +7 -4
  265. package/dist/ssr/surfaces/Section.js.map +1 -1
  266. package/dist/ssr/surfaces/StatusBadge.js +5 -1
  267. package/dist/ssr/surfaces/StatusBadge.js.map +1 -1
  268. package/dist/ssr/surfaces/flat-block-messages.js +37 -0
  269. package/dist/ssr/surfaces/flat-block-messages.js.map +1 -0
  270. package/dist/ssr/surfaces/index.js +4 -0
  271. package/dist/ssr/surfaces/index.js.map +1 -1
  272. package/dist/styles.css +1 -1
  273. package/dist/types/actions/DragAndDrop.d.ts +17 -2
  274. package/dist/types/actions/DropOverlay.d.ts +46 -0
  275. package/dist/types/actions/Dropdown.d.ts +35 -1
  276. package/dist/types/actions/SortableList.d.ts +36 -6
  277. package/dist/types/actions/ViewTabs.d.ts +3 -2
  278. package/dist/types/actions/drag-and-drop-keyboard.d.ts +4 -0
  279. package/dist/types/actions/drag-and-drop-messages.d.ts +8 -10
  280. package/dist/types/actions/drag-and-drop.d.ts +62 -4
  281. package/dist/types/actions/drop-overlay-pages.d.ts +22 -0
  282. package/dist/types/actions/drop-overlay-view.d.ts +12 -0
  283. package/dist/types/actions/index.d.ts +9 -5
  284. package/dist/types/actions/menu-sheet-messages.d.ts +11 -0
  285. package/dist/types/actions/menu-sheet.d.ts +3 -1
  286. package/dist/types/actions/menu-submenu-panel.d.ts +27 -0
  287. package/dist/types/actions/preload-when-idle.d.ts +5 -0
  288. package/dist/types/actions/sortable-board.d.ts +69 -0
  289. package/dist/types/actions/sortable-keyboard.d.ts +7 -0
  290. package/dist/types/actions/sortable-list-messages.d.ts +10 -3
  291. package/dist/types/actions/sortable-place.d.ts +16 -0
  292. package/dist/types/chat/ChatDecision.d.ts +28 -4
  293. package/dist/types/chat/ChatDecisionField.d.ts +45 -0
  294. package/dist/types/chat/index.d.ts +1 -0
  295. package/dist/types/chat/types.d.ts +9 -0
  296. package/dist/types/chat-decision-field.d.ts +5 -0
  297. package/dist/types/content/DataTable.d.ts +19 -0
  298. package/dist/types/content/FileName.d.ts +23 -0
  299. package/dist/types/content/ProgressPath.d.ts +12 -6
  300. package/dist/types/content/TaskRow.d.ts +33 -0
  301. package/dist/types/content/index.d.ts +2 -0
  302. package/dist/types/content/progress-path-messages.d.ts +8 -0
  303. package/dist/types/feedback/dialog-core.d.ts +5 -0
  304. package/dist/types/feedback/dialog-foot.d.ts +9 -0
  305. package/dist/types/inputs/DatePicker.d.ts +3 -21
  306. package/dist/types/inputs/TextInput.d.ts +2 -0
  307. package/dist/types/inputs/date-picker-panel.d.ts +29 -0
  308. package/dist/types/inputs/image-tools.d.ts +1 -0
  309. package/dist/types/inputs/input-messages.d.ts +4 -1
  310. package/dist/types/internal/renders-something.d.ts +2 -0
  311. package/dist/types/layout/AppWorkspace.d.ts +10 -2
  312. package/dist/types/layout/Breadcrumbs.d.ts +10 -5
  313. package/dist/types/layout/FloatingPill.d.ts +20 -0
  314. package/dist/types/layout/PanelDialog.d.ts +19 -0
  315. package/dist/types/layout/StatusRow.d.ts +54 -0
  316. package/dist/types/layout/app-workspace-state.d.ts +2 -2
  317. package/dist/types/layout/index.d.ts +5 -1
  318. package/dist/types/layout/panel-dialog-error.d.ts +9 -0
  319. package/dist/types/layout/panel-sheet-handle.d.ts +8 -0
  320. package/dist/types/layout/workspace-messages.d.ts +5 -0
  321. package/dist/types/layout-check.d.ts +52 -0
  322. package/dist/types/surfaces/Area.d.ts +38 -0
  323. package/dist/types/surfaces/FactGroup.d.ts +33 -0
  324. package/dist/types/surfaces/FieldGrid.d.ts +14 -0
  325. package/dist/types/surfaces/NoticeCard.d.ts +6 -4
  326. package/dist/types/surfaces/Placeholder.d.ts +7 -0
  327. package/dist/types/surfaces/RowGroup.d.ts +20 -0
  328. package/dist/types/surfaces/Section.d.ts +8 -2
  329. package/dist/types/surfaces/StatusBadge.d.ts +2 -1
  330. package/dist/types/surfaces/flat-block-messages.d.ts +16 -0
  331. package/dist/types/surfaces/index.d.ts +9 -1
  332. package/package.json +13 -2
@@ -1,11 +1,26 @@
1
1
  import { type JSX } from "solid-js";
2
2
  import { type DragPayload } from "./drag-and-drop";
3
- export type { DragPayload } from "./drag-and-drop";
4
- export { activeDrag } from "./drag-and-drop";
3
+ export type { DragPayload, DragStatus } from "./drag-and-drop";
4
+ export { activeDrag, dragStatus } from "./drag-and-drop";
5
5
  export type DragSourceProps<Type extends string = string> = {
6
6
  /** Read when the drag starts, so a selection can decide what is dragged. */
7
7
  payload: DragPayload<Type>;
8
8
  disabled?: boolean;
9
+ /** How far the mouse or pen moves before the drag starts, in px; 10 by default, 6 for a `DropOverlay` (S7). */
10
+ threshold?: number;
11
+ /**
12
+ * "none": a finger never drags this source, so a long press stays with the host, such as the menu of a
13
+ * `GestureMenu`; the mouse and a pen still drag. "drag" (default): a held finger drags.
14
+ */
15
+ touch?: "drag" | "none";
16
+ /**
17
+ * With `touch: "none"`: a finger held 500 ms, moving at most 8 px, calls this instead of dragging, so the host opens
18
+ * the row's menu there (S7). The release after it never clicks the row.
19
+ */
20
+ onLongPress?: (point: {
21
+ x: number;
22
+ y: number;
23
+ }) => void;
9
24
  class?: string;
10
25
  children: JSX.Element;
11
26
  };
@@ -0,0 +1,46 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type DragPayload } from "./drag-and-drop";
3
+ /** One place to drop on, in a level of a `DropOverlay`. */
4
+ export type DropOverlayTile = {
5
+ /** Stable within its level. */
6
+ id: string;
7
+ label: string;
8
+ /** A short second line, such as "Others stay responsible". */
9
+ description?: string;
10
+ /** Tabler class, such as "ti ti-folder". */
11
+ icon?: string;
12
+ /** Drawn in place of the icon, such as a person's avatar. */
13
+ leading?: JSX.Element;
14
+ /** The tile takes nothing now, and this says why, such as "Already here"; it is shown in place of `description`. */
15
+ disabled?: string;
16
+ /** Resting on the tile opens this level; "Back" returns. */
17
+ opens?: string;
18
+ /** Runs when the item is dropped on the tile. Without it, the tile only opens its level. */
19
+ onDrop?: (payload: DragPayload) => void;
20
+ };
21
+ export type DropOverlayLevel = {
22
+ /** Names the level above its tiles, such as "Move to folder · Recently used"; the first level needs none. */
23
+ title?: string;
24
+ tiles: readonly DropOverlayTile[];
25
+ };
26
+ export type DropOverlayProps = {
27
+ /** The payload types the overlay takes; it shows while such an item is dragged. */
28
+ accept: readonly string[];
29
+ /** The tiles of a level for the dragged item; the overlay starts with "root". */
30
+ level: (id: string, payload: DragPayload) => DropOverlayLevel;
31
+ /** Added to the help line, such as "Folders on the left work too". */
32
+ hint?: string;
33
+ /**
34
+ * A drag of an item the overlay takes ended without a drop: Escape, leaving the window, letting go on the
35
+ * "nothing happens" area or outside every target. The host shows its note, such as "Cancelled, nothing changed".
36
+ */
37
+ onCancel?: (payload: DragPayload) => void;
38
+ class?: string;
39
+ };
40
+ /**
41
+ * Drop targets that cover the host's main area while an item it takes is dragged: levels of large tiles, resting on a
42
+ * tile opens the next level, and an area where letting go changes nothing. Place it in a positioned box over the list
43
+ * it serves; it takes no space and moves nothing. The overlay is for the pointer; give every target a menu entry too.
44
+ * Its code loads while the page is idle and on every press of a drag source, so the first drag shows it at once.
45
+ */
46
+ export declare function DropOverlay(props: DropOverlayProps): JSX.Element;
@@ -56,7 +56,20 @@ export type DropdownAction = (DropdownActionBase & {
56
56
  action?: never;
57
57
  href?: never;
58
58
  external?: never;
59
- });
59
+ }) | DropdownSubmenu;
60
+ /**
61
+ * A row that opens a further menu beside it, marked with "▸" (K16). The submenu stands level with its row and turns
62
+ * to the other side or upwards where room ends. It opens after the pointer rests on the row for 150 ms, on click, and
63
+ * with Right or Enter; Left and Escape close one level. Moving the pointer towards it closes nothing. On a phone the
64
+ * sheet shows one level at a time, with Back at its top. A menu has at most three levels: a submenu row on the third
65
+ * level is not offered.
66
+ */
67
+ export type DropdownSubmenu = DropdownActionBase & {
68
+ submenu: readonly DropdownItem[];
69
+ action?: never;
70
+ href?: never;
71
+ external?: never;
72
+ };
60
73
  /** A second, smaller action at the end of a row, such as "Only" beside a checkbox; it keeps the menu open. */
61
74
  export type DropdownSecondaryAction = {
62
75
  label: string;
@@ -197,6 +210,15 @@ export type DropdownItemProps = {
197
210
  onSelect?: () => void;
198
211
  class?: string;
199
212
  };
213
+ export type MenuContextValue = {
214
+ close: (restoreFocus?: boolean) => void;
215
+ /** `option` inside a searchable menu's list box, whose field keeps the focus. */
216
+ role: "menuitem" | "option";
217
+ /** 1 for the menu itself, 2 and 3 for its submenus. */
218
+ depth: number;
219
+ /** In a phone sheet, a submenu row shows its entries in place of the sheet's instead of a menu beside it. */
220
+ drill?: (item: DropdownSubmenu, row: HTMLElement) => void;
221
+ };
200
222
  export declare const dropdownPosition: (trigger: Pick<DOMRect, "left" | "top" | "right" | "bottom">, menu: Pick<DOMRect, "width" | "height">, position: DropdownPosition, viewport: {
201
223
  width: number;
202
224
  height: number;
@@ -204,11 +226,23 @@ export declare const dropdownPosition: (trigger: Pick<DOMRect, "left" | "top" |
204
226
  left: number;
205
227
  top: number;
206
228
  };
229
+ export declare const itemContent: (props: {
230
+ description?: string;
231
+ descriptionVisual?: () => JSX.Element;
232
+ icon?: string;
233
+ image?: string;
234
+ trailing?: JSX.Element;
235
+ children: JSX.Element;
236
+ }) => JSX.Element;
207
237
  export declare function DropdownItem(props: DropdownItemProps): JSX.Element;
208
238
  export declare function DropdownItems(props: {
209
239
  items: readonly DropdownItem[];
210
240
  close: (restoreFocus?: boolean) => void;
211
241
  role?: "menuitem" | "option";
242
+ /** Internal: the level of a submenu's entries, 1 for the menu itself. */
243
+ depth?: number;
244
+ /** Internal: a phone sheet shows a submenu's entries in its own place. */
245
+ drill?: (item: DropdownSubmenu, row: HTMLElement) => void;
212
246
  }): JSX.Element;
213
247
  /**
214
248
  * Internal: content in place of the entries, as `CommandMenu` renders its command list. It reports where the focus
@@ -1,18 +1,40 @@
1
1
  import { type JSX } from "solid-js";
2
+ import type { DropdownSection } from "./Dropdown";
3
+ import { type SortableMove } from "./sortable-board";
4
+ export type { SortableMove } from "./sortable-board";
2
5
  export type SortableListProps<Item> = {
3
6
  items: readonly Item[];
4
7
  /** Stable identity of an item. Rows are keyed by it, so a newer copy of an item keeps its row and focus. */
5
8
  itemKey: (item: Item) => string;
6
- /** Names the item for its handle, the drag preview, and announcements. */
9
+ /** Names the item for its handle and in announcements. */
7
10
  itemLabel: (item: Item) => string;
8
- /** Tabler class for the drag preview; defaults to the grip. */
11
+ /** Tabler class for a label preview; the drag preview shows the row itself, so this shows only without it. */
9
12
  itemIcon?: (item: Item) => string | undefined;
10
- /** Moves the item to `index` of the list as it is now. The host owns the order and saves it. */
11
- onMove: (key: string, index: number) => void;
13
+ /**
14
+ * Moves the item to `index` of this list as it is after the move. For a row from another list of the `group`,
15
+ * `move.from` names that list, and the host takes the row out of it. The host owns the order and saves it.
16
+ */
17
+ onMove: (key: string, index: number, move: SortableMove) => void;
12
18
  /** Names the list for assistive technology. */
13
19
  label?: string;
14
20
  disabled?: boolean;
15
21
  class?: string;
22
+ /**
23
+ * Lists that share a group exchange rows, such as the columns of a board: a row moves by pointer, keyboard, or the
24
+ * `useSortableMoveMenu` entries. On a phone such lists do not drag; the move menu moves there.
25
+ */
26
+ group?: string;
27
+ /** Names this list inside its group, in `SortableMove`; defaults to a generated key. */
28
+ listKey?: string;
29
+ /** Names the list in announcements and the status line, such as "Done"; defaults to `label`. */
30
+ listLabel?: string;
31
+ /**
32
+ * The list is sorted: returns the index at which `key`, coming from list `from`, lands among this list's items
33
+ * without it. The line shows that place wherever the pointer is.
34
+ */
35
+ placement?: (key: string, from: string) => number;
36
+ /** "row" drags the whole row, for cards; "handle" (default) only the grip. The keyboard always uses the grip. */
37
+ dragBy?: "handle" | "row";
16
38
  /**
17
39
  * Renders one row, once per key; place `handle` where the row's grip belongs. Read the item through `item`, which
18
40
  * always returns the current copy, so the row updates in place and its grip keeps focus.
@@ -20,7 +42,15 @@ export type SortableListProps<Item> = {
20
42
  children: (item: () => Item, handle: JSX.Element) => JSX.Element;
21
43
  };
22
44
  /**
23
- * An ordered list whose rows move by their grip: drag it, or focus it and use the arrow keys, Home, or End. Moves go
24
- * through `onMove`; the list renders `items` as given, so the host's order is the only order.
45
+ * An ordered list whose rows move by pointer or keyboard. While a row moves it stays dimmed in place and a line shows
46
+ * where it lands; no other row moves before the drop. Space on the grip lifts the row, the arrow keys choose the
47
+ * place (left and right reach the other lists of the `group`), Enter drops, and Escape cancels; the arrow keys alone
48
+ * move the row one step at once. Moves go through `onMove`; the list renders `items` as given.
25
49
  */
26
50
  export declare function SortableList<Item>(props: SortableListProps<Item>): JSX.Element;
51
+ /**
52
+ * "Move to" entries for a row of `group`, one per other list: the way to move on a phone, where such lists do not
53
+ * drag, and a second way everywhere. Put the section into the row's `Dropdown` or `GestureMenu`. Undefined when the
54
+ * row is in no list of the group or no other list takes it.
55
+ */
56
+ export declare function useSortableMoveMenu(group: string): (key: string) => DropdownSection | undefined;
@@ -21,8 +21,9 @@ export type ViewTabsProps = {
21
21
  /** At most this many views before More (default 5). */
22
22
  max?: number;
23
23
  /**
24
- * The strip shows only the views that fit its room and counts the rest in More, instead of scrolling them. The open
25
- * view and pinned views stay. Pair it with a larger `max` so a wide head shows more views.
24
+ * The strip shows only the views that fit its room and counts the rest in More, instead of scrolling them (K15, the
25
+ * default). The open view and pinned views stay. Pair it with a larger `max` so a wide head shows more views.
26
+ * `false` lets the strip scroll sideways instead.
26
27
  */
27
28
  fit?: boolean;
28
29
  class?: string;
@@ -0,0 +1,4 @@
1
+ import { type DragPayload } from "./drag-and-drop";
2
+ import type { DragAndDropMessages } from "./drag-and-drop-messages";
3
+ export declare const checkDragKeyboardMessages: () => import("@k2b/stdlib").CatalogIssue[];
4
+ export declare const startKeyboardDrag: (input: DragPayload, origin: HTMLElement, messages: DragAndDropMessages, locale: string) => (() => void);
@@ -2,15 +2,6 @@ declare const dragAndDropMessages: import("@k2b/stdlib").Catalog<{
2
2
  pickedUp: ({ label }: {
3
3
  label: string;
4
4
  }) => string;
5
- pickedUpKeyboard: ({ label, count }: {
6
- label: string;
7
- count: number;
8
- }) => string;
9
- choice: ({ target, index, count }: {
10
- target: string;
11
- index: number;
12
- count: number;
13
- }) => string;
14
5
  over: ({ target }: {
15
6
  target: string;
16
7
  }) => string;
@@ -25,9 +16,16 @@ declare const dragAndDropMessages: import("@k2b/stdlib").Catalog<{
25
16
  cancelled: ({ label }: {
26
17
  label: string;
27
18
  }) => string;
28
- noTarget: ({ label }: {
19
+ statusLead: ({ label, count }: {
29
20
  label: string;
21
+ count: number;
22
+ }) => string;
23
+ statusOver: ({ target }: {
24
+ target: string;
30
25
  }) => string;
26
+ statusIdle: string;
27
+ unavailable: string;
28
+ overlayUnavailable: string;
31
29
  }>;
32
30
  export type DragAndDropMessages = ReturnType<(typeof dragAndDropMessages)["resolve"]>["t"];
33
31
  export declare const useDragAndDropMessages: () => (() => DragAndDropMessages);
@@ -11,28 +11,86 @@ export type DragPayload<Type extends string = string> = {
11
11
  /** More than one item is dragged: shown as a count on the preview. */
12
12
  count?: number;
13
13
  };
14
+ export declare const setActiveDrag: (payload: DragPayload | undefined) => DragPayload<string> | undefined;
14
15
  /** Reactive payload of the drag in progress, or undefined. */
15
16
  export declare const activeDrag: () => DragPayload | undefined;
16
- /** Internal hand-over to the gesture menu that owns this press. */
17
+ /**
18
+ * What the drag in progress moves and where it goes, in words a status line can show; the same words reach screen
19
+ * readers through the live region. `lead` names what moves, `detail` where it goes and how to cancel.
20
+ */
21
+ export type DragStatus = {
22
+ lead: string;
23
+ detail: string;
24
+ };
25
+ export declare const writeDragStatus: (status: DragStatus | undefined) => DragStatus | undefined;
26
+ /** Reactive status of the drag in progress, for a status line; undefined while nothing is dragged. */
27
+ export declare const dragStatus: () => DragStatus | undefined;
28
+ /** Internal: SortableList states the exact place, which a plain target cannot. */
29
+ export declare const setDragStatus: (status: DragStatus | undefined) => DragStatus | undefined;
30
+ /** Internal: told when a drag or keyboard pickup ends, and whether something took it; for a host's "nothing changed" note. */
31
+ export declare const onDragEnd: (listener: (payload: DragPayload, dropped: boolean) => void) => (() => void);
32
+ export declare const notifyDragEnd: (payload: DragPayload, dropped: boolean) => void;
33
+ /** Internal: the preview of the pointer drag in progress, such as for a drop overlay that shows it compact. */
34
+ export declare const currentPreview: () => HTMLElement | undefined;
35
+ /** Internal: told about every press on a drag source, before any drag, so code a drag needs can load in time. */
36
+ export declare const onPointerPress: (listener: () => void) => (() => void);
17
37
  export declare const onPointerDragStart: (listener: (pointerId: number) => void) => (() => void);
18
- type Target = {
38
+ export type Target = {
19
39
  element: HTMLElement;
20
40
  accept: readonly string[];
21
41
  label: string;
22
42
  messages: DragAndDropMessages;
23
43
  disabled?: boolean;
24
44
  drop: (payload: DragPayload) => void;
45
+ /**
46
+ * Internal: told where the pointer is while it rests over this target, and `undefined` when it leaves. It may
47
+ * return the viewport y of a line it shows, which the preview then keeps clear of.
48
+ */
49
+ hover?: (point: {
50
+ x: number;
51
+ y: number;
52
+ } | undefined) => number | undefined;
53
+ /** Internal: letting go here changes nothing, like letting go outside every target; for a "Drop here: nothing happens" area. */
54
+ cancels?: boolean;
55
+ };
56
+ export type Session = {
57
+ payload: DragPayload;
58
+ origin: HTMLElement;
59
+ cancel: () => void;
60
+ targetsChanged?: () => void;
61
+ };
62
+ export type Engine = {
63
+ targets: Set<Target>;
64
+ byElement: WeakMap<Element, Target>;
65
+ session?: Session;
66
+ abandonPress?: () => void;
25
67
  };
68
+ export declare const engineFor: (doc: Document) => Engine;
69
+ export declare const accepts: (target: Target, payload: DragPayload) => boolean;
70
+ export declare const mark: (target: Target, payload?: DragPayload) => void;
26
71
  /** Speaks through the drag live region of `origin`'s container; SortableList shares it for keyboard moves. */
27
72
  export declare const announce: (origin: HTMLElement, text: string) => void;
28
73
  export declare const registerDropTarget: (element: HTMLElement, initial: Omit<Target, "element">) => {
29
74
  update(next: Omit<Target, "element">): void;
30
75
  dispose(): void;
31
76
  };
77
+ export declare const statusFor: (messages: DragAndDropMessages, payload: DragPayload, over?: Target) => DragStatus;
78
+ export declare const clearSession: (engine: Engine, session: Session, source?: HTMLElement) => void;
32
79
  export declare const bindDragSource: (source: HTMLElement, read: () => {
33
80
  payload: DragPayload;
34
81
  disabled?: boolean;
35
82
  messages: DragAndDropMessages;
83
+ /** Internal: the element the preview shows a copy of, such as a sortable row; else the preview is a label. */
84
+ preview?: HTMLElement;
85
+ /** Internal: how long a finger holds before it lifts, in ms; `HOLD_MS` by default. */
86
+ hold?: number;
87
+ /** How far the mouse or pen moves before the drag starts, in px; `SLOP` by default. */
88
+ threshold?: number;
89
+ /** "none": a finger never drags this source; its press stays with the host, such as a long-press menu. */
90
+ touch?: "drag" | "none";
91
+ /** With `touch: "none"`: a finger held 500 ms, moving at most 8 px, calls this instead of dragging (S7). */
92
+ onLongPress?: (point: {
93
+ x: number;
94
+ y: number;
95
+ }) => void;
36
96
  }) => (() => void);
37
- export declare const startKeyboardDrag: (input: DragPayload, origin: HTMLElement, messages: DragAndDropMessages) => (() => void);
38
- export {};
@@ -0,0 +1,22 @@
1
+ import type { DropOverlayLevel, DropOverlayTile } from "./DropOverlay";
2
+ /** Words of the levels that `dropOverlayPages` makes; the application owns them. */
3
+ export type DropOverlayPageLabels = {
4
+ /** Title of the first level, such as "Assign to someone else · Frequent". */
5
+ title?: string;
6
+ /** Title of the level behind "more", such as "Assign to someone else · More". */
7
+ moreTitle?: string;
8
+ /** The tile that leads on, such as `More ${count} people`. */
9
+ more: (count: number) => string;
10
+ /** A tile for a range of names, such as `${first} – ${last}`. */
11
+ range: (first: string, last: string, count: number) => string;
12
+ };
13
+ /**
14
+ * Splits a long list of tiles over levels (S7): `id` shows the first `first` tiles (11) and "More N"; behind it come
15
+ * the rest, or, when they do not fit one level, ranges of at most `size` tiles (12) in the given order, each a
16
+ * level of its own. Returns the level for a level id it made, else undefined, so a `DropOverlay`'s `level` can ask
17
+ * it first.
18
+ */
19
+ export declare const dropOverlayPages: (id: string, tiles: readonly DropOverlayTile[], labels: DropOverlayPageLabels, { first, size }?: {
20
+ first?: number;
21
+ size?: number;
22
+ }) => ((level: string) => DropOverlayLevel | undefined);
@@ -0,0 +1,12 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { DropOverlayProps } from "./DropOverlay";
3
+ import { type DragPayload } from "./drag-and-drop";
4
+ /** Resting this long on a tile with a level opens it (S7). */
5
+ export declare const DWELL_MS = 450;
6
+ /** New tiles take nothing for this long, so a tile that appears under the pointer is never hit by accident (S7). */
7
+ export declare const ARM_MS = 220;
8
+ export declare const checkDropOverlayMessages: () => import("@k2b/stdlib").CatalogIssue[];
9
+ export declare function DropOverlayView(props: {
10
+ overlay: DropOverlayProps;
11
+ payload: () => DragPayload;
12
+ }): JSX.Element;
@@ -9,10 +9,14 @@ export { CopyButton } from "./CopyButton";
9
9
  export type { CommandContext, CommandItem, CommandSource, CommandStep } from "./command-items";
10
10
  export type { DisclosureProps } from "./Disclosure";
11
11
  export { Disclosure } from "./Disclosure";
12
- export type { DragPayload, DragSourceProps, DropTargetProps } from "./DragAndDrop";
13
- export { activeDrag, DragSource, DropTarget, useKeyboardDrag } from "./DragAndDrop";
14
- export type { DropdownAction, DropdownActionBase, DropdownAnchor, DropdownChoice, DropdownItemProps, DropdownPosition, DropdownProps, DropdownReturnFocus, DropdownSearch, DropdownSection, DropdownTriggerProps, } from "./Dropdown";
12
+ export type { DragPayload, DragSourceProps, DragStatus, DropTargetProps } from "./DragAndDrop";
13
+ export { activeDrag, DragSource, DropTarget, dragStatus, useKeyboardDrag } from "./DragAndDrop";
14
+ export type { DropdownAction, DropdownActionBase, DropdownAnchor, DropdownChoice, DropdownItemProps, DropdownPosition, DropdownProps, DropdownReturnFocus, DropdownSearch, DropdownSection, DropdownSubmenu, DropdownTriggerProps, } from "./Dropdown";
15
15
  export { Dropdown, DropdownItem, dropdownPosition } from "./Dropdown";
16
+ export type { DropOverlayLevel, DropOverlayProps, DropOverlayTile } from "./DropOverlay";
17
+ export { DropOverlay } from "./DropOverlay";
18
+ export type { DropOverlayPageLabels } from "./drop-overlay-pages";
19
+ export { dropOverlayPages } from "./drop-overlay-pages";
16
20
  export type { FilterChipOption, FilterChipProps, FilterChipSection, FilterToggleProps } from "./FilterChip";
17
21
  export { FilterChip, FilterToggle } from "./FilterChip";
18
22
  export type { GestureKind, GestureMenuAction, GestureMenuItem, GestureMenuProps, GestureMenuSection } from "./GestureMenu";
@@ -25,8 +29,8 @@ export type { SelectionActionProps, SelectionActionSelection } from "./Selection
25
29
  export { SelectionAction } from "./SelectionAction";
26
30
  export type { SelectionToolbarProps } from "./SelectionToolbar";
27
31
  export { SelectionToolbar } from "./SelectionToolbar";
28
- export type { SortableListProps } from "./SortableList";
29
- export { SortableList } from "./SortableList";
32
+ export type { SortableListProps, SortableMove } from "./SortableList";
33
+ export { SortableList, useSortableMoveMenu } from "./SortableList";
30
34
  export type { SplitButtonProps } from "./SplitButton";
31
35
  export { SplitButton } from "./SplitButton";
32
36
  export type { SpotlightButtonProps, SpotlightButtonVariant, SpotlightSearchOptions, SpotlightSearchResolver, } from "./SpotlightSearch";
@@ -0,0 +1,11 @@
1
+ /** The phone menu sheet's own words; they load with the sheet, so menus without one do not carry them. */
2
+ declare const menuSheetMessages: import("@k2b/stdlib").Catalog<{
3
+ menuBack: ({ menu }: {
4
+ menu: string;
5
+ }) => string;
6
+ }>;
7
+ export type MenuSheetMessages = ReturnType<(typeof menuSheetMessages)["resolve"]>["t"];
8
+ /** Resolved from the inherited render locale. */
9
+ export declare const useMenuSheetMessages: () => (() => MenuSheetMessages);
10
+ export declare const checkMenuSheetMessages: () => import("@k2b/stdlib").CatalogIssue[];
11
+ export {};
@@ -1,11 +1,13 @@
1
1
  import { type JSX } from "solid-js";
2
- import type { DropdownItem, DropdownSearch } from "./Dropdown";
2
+ import type { DropdownItem, DropdownSearch, DropdownSubmenu } from "./Dropdown";
3
3
  export { PHONE_SHEET_QUERY, prefersMenuSheet } from "./phone-sheet";
4
4
  export type MenuSheetOptions = {
5
5
  /** Renders the rows: the dropdown's own `DropdownItems`, passed in so this module does not import it back. */
6
6
  Items: (props: {
7
7
  items: readonly DropdownItem[];
8
8
  close: (restoreFocus?: boolean) => void;
9
+ depth?: number;
10
+ drill?: (item: DropdownSubmenu, row: HTMLElement) => void;
9
11
  }) => JSX.Element;
10
12
  items: readonly DropdownItem[];
11
13
  /** Names the sheet and its menu. */
@@ -0,0 +1,27 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { DropdownItems, DropdownSubmenu, itemContent, MenuContextValue } from "./Dropdown";
3
+ type Box = Pick<DOMRect, "left" | "top" | "right" | "bottom">;
4
+ /**
5
+ * Where a submenu stands: beside its row, its first row level with it, on the side that has room; without room on
6
+ * either side it keeps to the viewport. Too low, it rises until its last row is level with its row's bottom.
7
+ */
8
+ export declare const placeSubmenu: (row: Box, parent: Pick<DOMRect, "left" | "right">, menu: {
9
+ width: number;
10
+ height: number;
11
+ }, viewport: {
12
+ width: number;
13
+ height: number;
14
+ }, rtl?: boolean) => {
15
+ left: number;
16
+ top: number;
17
+ side: "left" | "right";
18
+ };
19
+ /** A row with "▸" that opens its submenu beside it, or in a phone sheet in the sheet's place (K16). */
20
+ export declare function SubmenuRow(props: {
21
+ item: DropdownSubmenu;
22
+ /** The level's menu: handed in, so this module needs nothing of the menu's code at run time. */
23
+ menu: MenuContextValue;
24
+ Items: typeof DropdownItems;
25
+ content: typeof itemContent;
26
+ }): JSX.Element;
27
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Runs `load` once the browser is idle, or after 200 ms where it has no idle callback, so code that a gesture needs is
3
+ * there before the first gesture. Returns the cancel.
4
+ */
5
+ export declare const preloadWhenIdle: (win: Window, load: () => void) => (() => void);
@@ -0,0 +1,69 @@
1
+ import type { DragAndDropMessages } from "./drag-and-drop-messages";
2
+ import type { SortableListMessages } from "./sortable-list-messages";
3
+ /** The lists of each group and the row on its way, shared by SortableList, its keyboard module, and the move menu. */
4
+ /** One move a list reports through `onMove`. */
5
+ export type SortableMove = {
6
+ /** The `listKey` the row came from. */
7
+ from: string;
8
+ /** The `listKey` the row goes to; the same as `from` for a move inside one list. */
9
+ to: string;
10
+ /** The row's index in `from` before the move. */
11
+ fromIndex: number;
12
+ /** Moves the row back where it came from, through the lists' own `onMove`; for the "Undo" of the host's toast. */
13
+ undo: () => void;
14
+ };
15
+ export type Entry = {
16
+ group: string;
17
+ key: string;
18
+ label: () => string;
19
+ list: HTMLUListElement;
20
+ area: HTMLElement;
21
+ keys: () => readonly string[];
22
+ disabled: () => boolean;
23
+ placement: () => ((key: string, from: string) => number) | undefined;
24
+ onMove: (key: string, index: number, move: SortableMove) => void;
25
+ messages: () => SortableListMessages;
26
+ };
27
+ /** A row on its way: lifted from `from`, and while it is over a list, `index` of `to` is where it would land. */
28
+ export type Lift = {
29
+ group: string;
30
+ key: string;
31
+ label: string;
32
+ from: string;
33
+ fromIndex: number;
34
+ to?: string;
35
+ index?: number;
36
+ keyboard: boolean;
37
+ messages: DragAndDropMessages;
38
+ };
39
+ export declare const groups: Map<string, Set<Entry>>;
40
+ export declare const registry: () => undefined;
41
+ export declare const touchRegistry: () => undefined;
42
+ export declare const lift: () => Lift | undefined;
43
+ export declare const setLift: (next: Lift | undefined) => Lift | undefined;
44
+ /**
45
+ * The keyboard lift in progress, set by the keyboard module: `end` stops it quietly before a drop, `cancel` stops it
46
+ * and says so.
47
+ */
48
+ export declare const keyboardLift: {
49
+ end?: () => void;
50
+ cancel?: () => void;
51
+ };
52
+ export declare const listsOf: (group: string) => Entry[];
53
+ export declare const find: (group: string, key: string | undefined) => Entry | undefined;
54
+ export declare const placesIn: (entry: Entry, key: string) => number;
55
+ /** Where the row lands in `entry`: the sorted place, or the one the gap shows. */
56
+ export declare const landing: (entry: Entry, state: Lift, gap: number) => number;
57
+ export declare const place: (entry: Entry, state: Lift, index: number) => {
58
+ position: number;
59
+ count: number;
60
+ list: string;
61
+ };
62
+ export declare const showStatus: (state: Lift) => void;
63
+ export declare const moveOf: (group: string, key: string, from: string, to: string, fromIndex: number, index: number) => SortableMove;
64
+ /** The lift lands where it already is: no line, no tint, nothing to commit. */
65
+ export declare const staying: (state: Lift) => boolean;
66
+ /** Hands the move to the target list; false when nothing would change. */
67
+ export declare const commit: (state: Lift) => boolean;
68
+ /** The grip of `key` takes focus again once the host has rendered the move, also in another list of the group. */
69
+ export declare const refocus: (group: string, key: string, attempt?: number) => void;
@@ -0,0 +1,7 @@
1
+ import type { DragAndDropMessages } from "./drag-and-drop-messages";
2
+ import { type Entry, type Lift } from "./sortable-board";
3
+ export declare const checkSortableKeyboardMessages: () => import("@k2b/stdlib").CatalogIssue[];
4
+ /** Lifts `key` of `entry`: nothing moves yet; the line and the status show the place. */
5
+ export declare const startLift: (entry: Entry, key: string, label: string, locale: string, messages: DragAndDropMessages) => void;
6
+ /** Keys while a row is lifted: choose a place, drop, or cancel. Nothing moves until the drop. */
7
+ export declare const liftedKey: (event: KeyboardEvent, state: Lift, entry: Entry) => void;
@@ -1,13 +1,20 @@
1
+ type Place = {
2
+ position: number;
3
+ count: number;
4
+ list: string;
5
+ };
1
6
  declare const sortableListMessages: import("@k2b/stdlib").Catalog<{
2
7
  handle: ({ label }: {
3
8
  label: string;
4
9
  }) => string;
5
10
  hint: string;
6
- moved: ({ label, position, count }: {
7
- label: string;
11
+ position: ({ position, count, list }: Place) => string;
12
+ statusPlace: ({ position, list }: {
8
13
  position: number;
9
- count: number;
14
+ list: string;
10
15
  }) => string;
16
+ statusStay: string;
17
+ moveTo: string;
11
18
  }>;
12
19
  export type SortableListMessages = ReturnType<(typeof sortableListMessages)["resolve"]>["t"];
13
20
  export declare const useSortableListMessages: () => (() => SortableListMessages);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Where a moved row lands, as plain numbers. A "gap" is a place between rendered rows, 0 above the first and `rows`
3
+ * below the last; the rendered rows still include the moved one, which stays in place until it is dropped. An
4
+ * "index" is the row's position after the move, the one `onMove` receives.
5
+ */
6
+ /** How far below the pointer the line may sit; the preview hangs further down, so it never covers the line. */
7
+ export declare const LINE_REACH = 8;
8
+ /** The gap above the first row that does not end above the pointer (plus the reach). */
9
+ export declare const gapAt: (bottoms: readonly number[], y: number) => number;
10
+ /** The index a drop into `gap` gives; `from` is the moved row's index in this list, or -1 when it comes from another. */
11
+ export declare const indexForGap: (gap: number, from: number) => number;
12
+ /** The gap whose line shows `index`; landing where it is shows the line on the moved row's upper edge. */
13
+ export declare const gapForIndex: (index: number, from: number) => number;
14
+ /** Places in a list of `rows` rows: one more when the moved row comes from another list. */
15
+ export declare const placeCount: (rows: number, own: boolean) => number;
16
+ export declare const clampIndex: (index: number, count: number) => number;