viewkitjs 0.31.0 → 0.33.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 (449) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/MIGRATION.md +40 -6
  3. package/README.md +1 -1
  4. package/fields/dist/index.d.ts +1 -1
  5. package/fields/dist/index.js +1 -1
  6. package/fields/dist/query/evaluate.d.ts +7 -0
  7. package/fields/dist/query/exact-number.d.ts +8 -2
  8. package/fields/dist/query/exact-number.js +14 -1
  9. package/fields/dist/query/index.d.ts +2 -0
  10. package/fields/dist/query/index.js +2 -0
  11. package/fields/dist/query/list-request.d.ts +148 -0
  12. package/fields/dist/query/list-request.js +125 -0
  13. package/fields/dist/query/saved-view.d.ts +15 -0
  14. package/fields/dist/query/saved-view.js +11 -0
  15. package/fields/dist/query/settings.d.ts +9 -0
  16. package/fields/dist/query/settings.js +9 -0
  17. package/fields/dist/query/sort.js +13 -10
  18. package/fields/dist/registry.js +5 -1
  19. package/fields/dist/types.d.ts +4 -1
  20. package/fields/dist/zod.d.ts +5 -0
  21. package/fields/dist/zod.js +10 -1
  22. package/fields/docs/guides/contact-values.md +12 -0
  23. package/fields/docs/guides/field-types.md +1 -1
  24. package/fields/docs/guides/queries.md +3 -1
  25. package/fields/docs/reference/fields.md +1 -0
  26. package/fields/docs/reference/query.md +66 -0
  27. package/package.json +5 -1
  28. package/postgres/README.md +1 -0
  29. package/postgres/dist/check.js +4 -1
  30. package/postgres/dist/definitions/formula-forms.js +3 -1
  31. package/postgres/dist/definitions/money.js +2 -1
  32. package/postgres/dist/handler.d.ts +53 -0
  33. package/postgres/dist/handler.js +211 -0
  34. package/postgres/dist/ids.d.ts +1 -1
  35. package/postgres/dist/ids.js +19 -1
  36. package/postgres/dist/index.d.ts +1 -0
  37. package/postgres/dist/index.js +1 -0
  38. package/postgres/dist/limits.d.ts +3 -1
  39. package/postgres/dist/limits.js +1 -1
  40. package/postgres/dist/list-fields.d.ts +10 -0
  41. package/postgres/dist/list-fields.js +36 -0
  42. package/postgres/dist/page.js +6 -3
  43. package/postgres/dist/readable.d.ts +4 -0
  44. package/postgres/dist/readable.js +4 -0
  45. package/postgres/dist/refusals.d.ts +9 -2
  46. package/postgres/dist/refusals.js +6 -0
  47. package/postgres/dist/rules.d.ts +15 -1
  48. package/postgres/dist/rules.js +16 -0
  49. package/postgres/dist/sort.js +7 -2
  50. package/postgres/docs/guides/definitions.md +1 -1
  51. package/postgres/docs/guides/field-map.md +3 -3
  52. package/postgres/docs/guides/list-handler.md +99 -0
  53. package/postgres/docs/index.md +1 -0
  54. package/postgres/docs/reference/definitions.md +1 -1
  55. package/postgres/docs/reference/postgres.md +12 -4
  56. package/views/README.md +2 -2
  57. package/views/dist/atoms/RowMenu.d.ts +7 -0
  58. package/views/dist/atoms/RowMenu.js +18 -16
  59. package/views/dist/atoms/ToolbarButton.d.ts +1 -1
  60. package/views/dist/atoms/ToolbarButton.js +4 -3
  61. package/views/dist/atoms/carried.d.ts +5 -0
  62. package/views/dist/atoms/carried.js +7 -0
  63. package/views/dist/atoms/frame-parts.d.ts +6 -0
  64. package/views/dist/atoms/frame-parts.js +15 -0
  65. package/views/dist/atoms/types.d.ts +19 -7
  66. package/views/dist/cells/cell-title.d.ts +3 -1
  67. package/views/dist/cells/cell-title.js +2 -2
  68. package/views/dist/cells/cell-values.js +2 -2
  69. package/views/dist/contract.d.ts +56 -11
  70. package/views/dist/contract.js +148 -0
  71. package/views/dist/controls/alert-dialog/alert-dialog.js +2 -1
  72. package/views/dist/controls/atoms.d.ts +2 -0
  73. package/views/dist/controls/atoms.js +2 -0
  74. package/views/dist/controls/avatar/avatar.d.ts +3 -3
  75. package/views/dist/controls/avatar/avatar.js +1 -1
  76. package/views/dist/controls/avatar/tokens.d.ts +44 -0
  77. package/views/dist/controls/avatar/tokens.js +11 -0
  78. package/views/dist/controls/avatar.css +22 -5
  79. package/views/dist/controls/button/map-button.js +2 -0
  80. package/views/dist/controls/checkbox/checkbox.d.ts +3 -2
  81. package/views/dist/controls/checkbox/checkbox.js +2 -2
  82. package/views/dist/controls/choice/tokens.d.ts +0 -4
  83. package/views/dist/controls/choice/tokens.js +0 -1
  84. package/views/dist/controls/choice.css +3 -3
  85. package/views/dist/controls/compound-editor/compound-editor.d.ts +1 -1
  86. package/views/dist/controls/compound-editor/name-parts.js +4 -4
  87. package/views/dist/controls/compound-editor/place-parts.js +19 -19
  88. package/views/dist/controls/compound-editor/range-parts.js +14 -14
  89. package/views/dist/controls/compound-editor/row.d.ts +3 -1
  90. package/views/dist/controls/compound-editor/row.js +2 -2
  91. package/views/dist/controls/controls.d.ts +8 -0
  92. package/views/dist/controls/controls.js +12 -2
  93. package/views/dist/controls/customize/customize.js +37 -35
  94. package/views/dist/controls/customize/map-customize-body.d.ts +2 -0
  95. package/views/dist/controls/customize/map-customize-body.js +5 -1
  96. package/views/dist/controls/date-editor/date-days.js +2 -2
  97. package/views/dist/controls/date-editor/date-editor.js +18 -18
  98. package/views/dist/controls/date-editor/date-parts.js +6 -6
  99. package/views/dist/controls/date-editor/map-calendar.js +1 -1
  100. package/views/dist/controls/date-editor.css +2 -2
  101. package/views/dist/controls/field/field.d.ts +22 -4
  102. package/views/dist/controls/field/field.js +63 -5
  103. package/views/dist/controls/field/tokens.d.ts +4 -0
  104. package/views/dist/controls/field/tokens.js +1 -0
  105. package/views/dist/controls/field.css +41 -16
  106. package/views/dist/controls/filter-editor/block.d.ts +2 -2
  107. package/views/dist/controls/filter-editor/block.js +5 -5
  108. package/views/dist/controls/filter-editor/filter-editor.js +31 -33
  109. package/views/dist/controls/filter-editor/how.d.ts +3 -1
  110. package/views/dist/controls/filter-editor/map-filter-body.d.ts +1 -0
  111. package/views/dist/controls/filter-editor/map-filter-body.js +7 -3
  112. package/views/dist/controls/filter-editor/map-rules.js +1 -1
  113. package/views/dist/controls/filter-editor/parts.js +2 -1
  114. package/views/dist/controls/glyphs/glyphs.d.ts +10 -0
  115. package/views/dist/controls/glyphs/glyphs.js +173 -0
  116. package/views/dist/controls/group-editor/group-editor.js +15 -13
  117. package/views/dist/controls/index.d.ts +4 -1
  118. package/views/dist/controls/index.js +3 -1
  119. package/views/dist/controls/input/input.js +6 -3
  120. package/views/dist/controls/input/map-input.js +2 -0
  121. package/views/dist/controls/input/tokens.d.ts +4 -0
  122. package/views/dist/controls/input/tokens.js +1 -0
  123. package/views/dist/controls/input.css +31 -3
  124. package/views/dist/controls/internal/editor-parts.js +1 -1
  125. package/views/dist/controls/internal/icons.js +10 -0
  126. package/views/dist/controls/internal/keep-focus.d.ts +2 -0
  127. package/views/dist/controls/internal/keep-focus.js +17 -0
  128. package/views/dist/controls/internal/map-panel-controls.d.ts +8 -0
  129. package/views/dist/controls/internal/map-panel-controls.js +20 -0
  130. package/views/dist/controls/internal/panel-controls.d.ts +50 -0
  131. package/views/dist/controls/internal/panel-controls.js +197 -0
  132. package/views/dist/controls/internal/part-slot.d.ts +12 -0
  133. package/views/dist/controls/internal/part-slot.js +5 -0
  134. package/views/dist/controls/internal/watch-frame.d.ts +2 -0
  135. package/views/dist/controls/internal/watch-frame.js +33 -0
  136. package/views/dist/controls/links-editor/links-editor.d.ts +1 -1
  137. package/views/dist/controls/links-editor/links-editor.js +27 -27
  138. package/views/dist/controls/markdown/map-markdown.d.ts +4 -0
  139. package/views/dist/controls/markdown/map-markdown.js +5 -0
  140. package/views/dist/controls/menu/map-menu.d.ts +2 -2
  141. package/views/dist/controls/menu/map-menu.js +15 -12
  142. package/views/dist/controls/menu/menu.d.ts +2 -0
  143. package/views/dist/controls/menu/menu.js +3 -3
  144. package/views/dist/controls/menu-list/menu-list.d.ts +17 -4
  145. package/views/dist/controls/menu-list/menu-list.js +27 -25
  146. package/views/dist/controls/modal/modal.js +5 -1
  147. package/views/dist/controls/notice/notice.d.ts +3 -1
  148. package/views/dist/controls/notice/notice.js +2 -2
  149. package/views/dist/controls/number-editor/number-editor.d.ts +1 -1
  150. package/views/dist/controls/number-editor/number-editor.js +13 -13
  151. package/views/dist/controls/number-field/number-field.js +5 -3
  152. package/views/dist/controls/pane/pane.d.ts +4 -2
  153. package/views/dist/controls/pane/pane.js +6 -5
  154. package/views/dist/controls/phone-header/header-bar.d.ts +5 -1
  155. package/views/dist/controls/phone-header/header-bar.js +2 -2
  156. package/views/dist/controls/phone-header.css +11 -1
  157. package/views/dist/controls/picker/map-picker.js +3 -0
  158. package/views/dist/controls/picker/picker.d.ts +16 -0
  159. package/views/dist/controls/picker/picker.js +61 -40
  160. package/views/dist/controls/picker/rows.d.ts +4 -0
  161. package/views/dist/controls/picker.css +2 -0
  162. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  163. package/views/dist/controls/popover/map-popover.js +4 -2
  164. package/views/dist/controls/popover/popover.js +2 -1
  165. package/views/dist/controls/quick-filters/quick-filters.js +4 -4
  166. package/views/dist/controls/radio/radio.d.ts +8 -3
  167. package/views/dist/controls/radio/radio.js +22 -5
  168. package/views/dist/controls/radio/tokens.d.ts +44 -0
  169. package/views/dist/controls/radio/tokens.js +11 -0
  170. package/views/dist/controls/radio.css +79 -1
  171. package/views/dist/controls/select/map-select.d.ts +3 -0
  172. package/views/dist/controls/select/map-select.js +8 -0
  173. package/views/dist/controls/select/select.d.ts +7 -0
  174. package/views/dist/controls/select/select.js +12 -6
  175. package/views/dist/controls/select/tokens.d.ts +8 -0
  176. package/views/dist/controls/select/tokens.js +2 -0
  177. package/views/dist/controls/select.css +17 -0
  178. package/views/dist/controls/setting-row/looks.d.ts +1 -1
  179. package/views/dist/controls/setting-row/looks.js +9 -4
  180. package/views/dist/controls/setting-row/setting-row.d.ts +45 -10
  181. package/views/dist/controls/setting-row/setting-row.js +82 -15
  182. package/views/dist/controls/setting-row/tokens.d.ts +74 -2
  183. package/views/dist/controls/setting-row/tokens.js +19 -1
  184. package/views/dist/controls/setting-row.css +135 -14
  185. package/views/dist/controls/sheet/bottom-sheet.d.ts +14 -2
  186. package/views/dist/controls/sheet/bottom-sheet.js +6 -3
  187. package/views/dist/controls/sheet/map-sheet.js +1 -1
  188. package/views/dist/controls/sheet.css +4 -1
  189. package/views/dist/controls/sort-editor/map-sort-body.d.ts +1 -0
  190. package/views/dist/controls/sort-editor/map-sort-body.js +7 -3
  191. package/views/dist/controls/sort-editor/sort-editor.js +25 -26
  192. package/views/dist/controls/sort-editor.css +13 -2
  193. package/views/dist/controls/switch-row/tokens.d.ts +0 -12
  194. package/views/dist/controls/switch-row/tokens.js +0 -3
  195. package/views/dist/controls/switch-row.css +3 -7
  196. package/views/dist/controls/switch.css +17 -7
  197. package/views/dist/controls/tag/tag.d.ts +3 -1
  198. package/views/dist/controls/tag/tag.js +2 -2
  199. package/views/dist/controls/tag/tokens.d.ts +4 -0
  200. package/views/dist/controls/tag/tokens.js +1 -0
  201. package/views/dist/controls/tag-field/tag-field.d.ts +5 -1
  202. package/views/dist/controls/tag-field/tag-field.js +11 -5
  203. package/views/dist/controls/tag-field/tokens.d.ts +16 -0
  204. package/views/dist/controls/tag-field/tokens.js +4 -0
  205. package/views/dist/controls/tag-field.css +19 -0
  206. package/views/dist/controls/tag.css +2 -0
  207. package/views/dist/controls/text-editor/text-editor.d.ts +1 -1
  208. package/views/dist/controls/text-editor/text-editor.js +8 -8
  209. package/views/dist/controls/toolbar/toolbar.d.ts +15 -3
  210. package/views/dist/controls/toolbar/toolbar.js +22 -15
  211. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +14 -0
  212. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +52 -0
  213. package/views/dist/controls/toolbar-button/toolbar-button.d.ts +1 -1
  214. package/views/dist/controls/toolbar-button/toolbar-button.js +2 -3
  215. package/views/dist/controls/toolbar-button.css +4 -0
  216. package/views/dist/controls/toolbar.css +5 -0
  217. package/views/dist/controls/values-editor/values-editor.d.ts +1 -1
  218. package/views/dist/controls/values-editor/values-editor.js +22 -22
  219. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -0
  220. package/views/dist/controls/views-list/map-view-menu.js +25 -0
  221. package/views/dist/controls/views-list/map-views-list-body.d.ts +28 -1
  222. package/views/dist/controls/views-list/map-views-list-body.js +39 -21
  223. package/views/dist/controls/views-list/rules.d.ts +2 -0
  224. package/views/dist/controls/views-list/view-menu.d.ts +7 -0
  225. package/views/dist/controls/views-list/view-menu.js +33 -29
  226. package/views/dist/controls/views-list/views-list.js +4 -4
  227. package/views/dist/controls/views-list/words.d.ts +2 -0
  228. package/views/dist/controls/views-list/words.js +1 -1
  229. package/views/dist/editors/EditorPanel.js +3 -2
  230. package/views/dist/editors/edit-session.js +2 -5
  231. package/views/dist/field-row/FieldRow.d.ts +4 -2
  232. package/views/dist/field-row/FieldRow.js +80 -20
  233. package/views/dist/field-row/FieldRowLane.d.ts +7 -2
  234. package/views/dist/field-row/FieldRowLane.js +4 -3
  235. package/views/dist/field-row/editors/RowEditor.d.ts +12 -0
  236. package/views/dist/field-row/editors/RowEditor.js +31 -1
  237. package/views/dist/field-row/editors/RowValueListEditor.d.ts +5 -1
  238. package/views/dist/field-row/editors/RowValueListEditor.js +4 -1
  239. package/views/dist/field-row/field-row-button.d.ts +5 -0
  240. package/views/dist/field-row/field-row-button.js +2 -0
  241. package/views/dist/fields/binding.d.ts +3 -2
  242. package/views/dist/fields/binding.js +38 -5
  243. package/views/dist/fields/money.d.ts +5 -2
  244. package/views/dist/fields/money.js +14 -2
  245. package/views/dist/grid/chrome/GridColumnMenu.d.ts +4 -2
  246. package/views/dist/grid/chrome/GridColumnMenu.js +3 -2
  247. package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -1
  248. package/views/dist/grid/chrome/GridGroupMenu.js +4 -3
  249. package/views/dist/grid/chrome/GridHeader.d.ts +4 -1
  250. package/views/dist/grid/chrome/GridHeader.js +2 -2
  251. package/views/dist/grid/chrome/GridRow.js +6 -5
  252. package/views/dist/grid/chrome/GridRowCells.js +6 -9
  253. package/views/dist/grid/chrome/GridStructure.d.ts +4 -1
  254. package/views/dist/grid/chrome/GridStructure.js +4 -4
  255. package/views/dist/grid/chrome/GridTable.js +9 -3
  256. package/views/dist/grid/chrome/cell-clipboard.d.ts +4 -2
  257. package/views/dist/grid/chrome/cell-clipboard.js +2 -2
  258. package/views/dist/grid/chrome/cells.js +3 -1
  259. package/views/dist/grid/chrome/grid-column-menu-items.js +1 -1
  260. package/views/dist/grid/chrome/grid-row-menu-items.d.ts +27 -3
  261. package/views/dist/grid/chrome/grid-row-menu-items.js +93 -7
  262. package/views/dist/grid/chrome/grid-row-props.d.ts +7 -2
  263. package/views/dist/grid/chrome/grid-rows-menu.js +34 -6
  264. package/views/dist/grid/chrome/grid-table-props.d.ts +38 -7
  265. package/views/dist/grid/chrome/useGridBatchApi.d.ts +3 -1
  266. package/views/dist/grid/chrome/useGridBatchApi.js +4 -2
  267. package/views/dist/grid/chrome/useGridKeyboard.d.ts +7 -2
  268. package/views/dist/grid/chrome/useGridKeyboard.js +43 -14
  269. package/views/dist/grid/chrome/useGridPendingReconciliation.js +1 -2
  270. package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
  271. package/views/dist/grid/chrome/useGridTableInteractionModel.js +20 -7
  272. package/views/dist/grid/core/clipboard-model.d.ts +3 -1
  273. package/views/dist/grid/core/clipboard-model.js +9 -8
  274. package/views/dist/grid/core/commit-model.d.ts +20 -2
  275. package/views/dist/grid/core/editing-controller.d.ts +21 -0
  276. package/views/dist/grid/core/editing-controller.js +194 -42
  277. package/views/dist/grid/core/editing-model.d.ts +3 -0
  278. package/views/dist/grid/core/editing-model.js +3 -0
  279. package/views/dist/grid/core/edits-sink.d.ts +19 -0
  280. package/views/dist/grid/core/edits-sink.js +2 -0
  281. package/views/dist/grid/core/save-path.d.ts +24 -0
  282. package/views/dist/grid/core/save-path.js +122 -0
  283. package/views/dist/grid/core/spreadsheet-operations.d.ts +3 -0
  284. package/views/dist/grid/core/spreadsheet-operations.js +24 -1
  285. package/views/dist/grid/core/useGridEditing.d.ts +5 -0
  286. package/views/dist/grid/core/useGridEditing.js +6 -0
  287. package/views/dist/grid/index.d.ts +3 -2
  288. package/views/dist/grid/index.js +1 -0
  289. package/views/dist/internal/field-rows.d.ts +26 -0
  290. package/views/dist/internal/field-rows.js +8 -0
  291. package/views/dist/internal/page-close.d.ts +7 -0
  292. package/views/dist/internal/page-close.js +43 -0
  293. package/views/dist/list/answer.d.ts +40 -0
  294. package/views/dist/list/answer.js +43 -0
  295. package/views/dist/list/browser-views-store.d.ts +10 -0
  296. package/views/dist/list/browser-views-store.js +182 -0
  297. package/views/dist/list/bulk-bar.d.ts +7 -0
  298. package/views/dist/list/bulk-bar.js +10 -0
  299. package/views/dist/list/columns.d.ts +24 -0
  300. package/views/dist/list/columns.js +27 -0
  301. package/views/dist/list/edits.d.ts +19 -0
  302. package/views/dist/list/edits.js +56 -0
  303. package/views/dist/list/grid.d.ts +11 -0
  304. package/views/dist/list/grid.js +76 -0
  305. package/views/dist/list/index.d.ts +36 -0
  306. package/views/dist/list/index.js +11 -0
  307. package/views/dist/list/link.d.ts +8 -0
  308. package/views/dist/list/link.js +78 -0
  309. package/views/dist/list/list.d.ts +70 -0
  310. package/views/dist/list/list.js +14 -0
  311. package/views/dist/list/menu.d.ts +31 -0
  312. package/views/dist/list/menu.js +76 -0
  313. package/views/dist/list/parts.d.ts +6 -0
  314. package/views/dist/list/parts.js +66 -0
  315. package/views/dist/list/registry.d.ts +11 -0
  316. package/views/dist/list/registry.js +31 -0
  317. package/views/dist/list/root-base.d.ts +46 -0
  318. package/views/dist/list/root-base.js +137 -0
  319. package/views/dist/list/root.d.ts +41 -0
  320. package/views/dist/list/root.js +168 -0
  321. package/views/dist/list/slot.d.ts +14 -0
  322. package/views/dist/list/slot.js +22 -0
  323. package/views/dist/list/source-answers.d.ts +39 -0
  324. package/views/dist/list/source-answers.js +225 -0
  325. package/views/dist/list/source.d.ts +11 -0
  326. package/views/dist/list/source.js +31 -0
  327. package/views/dist/list/store.d.ts +119 -0
  328. package/views/dist/list/store.js +146 -0
  329. package/views/dist/list/toolbar.d.ts +7 -0
  330. package/views/dist/list/toolbar.js +371 -0
  331. package/views/dist/list/views-axis.d.ts +5 -0
  332. package/views/dist/list/views-axis.js +98 -0
  333. package/views/dist/list/views-store.d.ts +41 -0
  334. package/views/dist/list/views-store.js +1 -0
  335. package/views/dist/list/views.d.ts +72 -0
  336. package/views/dist/list/views.js +411 -0
  337. package/views/dist/model/column-capabilities.d.ts +13 -0
  338. package/views/dist/model/column-capabilities.js +23 -2
  339. package/views/dist/model/column-schema.d.ts +11 -1
  340. package/views/dist/model/preferences.js +1 -1
  341. package/views/dist/model/prefs-buckets.js +1 -1
  342. package/views/dist/model/view-rules.js +1 -0
  343. package/views/dist/panels/index.d.ts +3 -1
  344. package/views/dist/panels/index.js +1 -0
  345. package/views/dist/panels/model.d.ts +2 -0
  346. package/views/dist/panels/react/customize-body.js +1 -0
  347. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +47 -4
  348. package/views/dist/panels/react/toolbar/ReadyToolbar.js +6 -326
  349. package/views/dist/panels/react/toolbar/Toolbar.d.ts +17 -2
  350. package/views/dist/panels/react/toolbar/Toolbar.js +43 -23
  351. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
  352. package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
  353. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -4
  354. package/views/dist/panels/react/toolbar/ToolbarButton.js +7 -1
  355. package/views/dist/panels/react/toolbar/ToolbarFilter.js +1 -1
  356. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -1
  357. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +1 -1
  358. package/views/dist/panels/react/toolbar/ToolbarFilters.js +2 -2
  359. package/views/dist/panels/react/toolbar/ToolbarNew.js +2 -2
  360. package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
  361. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +2 -2
  362. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +3 -1
  363. package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
  364. package/views/dist/panels/react/toolbar/ToolbarSort.js +2 -2
  365. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
  366. package/views/dist/panels/react/toolbar/context.d.ts +20 -3
  367. package/views/dist/panels/react/toolbar/context.js +3 -1
  368. package/views/dist/panels/react/toolbar/panel-part.d.ts +4 -1
  369. package/views/dist/panels/react/toolbar/panel-part.js +5 -3
  370. package/views/dist/panels/react/views-row/FoldingViewRow.d.ts +1 -1
  371. package/views/dist/panels/react/views-row/FoldingViewRow.js +15 -4
  372. package/views/dist/panels/react/views-row/PillGroup.d.ts +5 -2
  373. package/views/dist/panels/react/views-row/PillGroup.js +16 -7
  374. package/views/dist/panels/react/views-row/ViewPicker.js +2 -12
  375. package/views/dist/panels/react/views-row/ViewPickerRow.d.ts +4 -2
  376. package/views/dist/panels/react/views-row/ViewPickerRow.js +9 -5
  377. package/views/dist/panels/react.d.ts +2 -2
  378. package/views/dist/panels/settings/filter-groups.js +6 -1
  379. package/views/dist/panels/toolbar/edit-view.d.ts +7 -1
  380. package/views/dist/panels/toolbar/edit-view.js +14 -0
  381. package/views/dist/panels/toolbar/model.d.ts +5 -0
  382. package/views/dist/panels/toolbar/model.js +7 -3
  383. package/views/dist/panels/view-state.d.ts +5 -3
  384. package/views/dist/panels/views-row/model.d.ts +19 -2
  385. package/views/dist/panels/views-row/model.js +14 -0
  386. package/views/dist/provider/ViewsProvider.d.ts +21 -8
  387. package/views/dist/provider/ViewsProvider.js +40 -5
  388. package/views/dist/provider/components.d.ts +102 -2
  389. package/views/dist/provider/components.js +1 -1
  390. package/views/dist/provider/context.d.ts +6 -2
  391. package/views/dist/provider/context.js +1 -1
  392. package/views/dist/provider/own-control.d.ts +4 -0
  393. package/views/dist/provider/own-control.js +7 -0
  394. package/views/dist/provider/ports.d.ts +19 -12
  395. package/views/dist/provider/ports.js +69 -1
  396. package/views/dist/provider/select-items.d.ts +3 -0
  397. package/views/dist/provider/select-items.js +6 -0
  398. package/views/dist/react.d.ts +4 -2
  399. package/views/dist/react.js +2 -0
  400. package/views/dist/styles.css +503 -136
  401. package/views/dist/styles.unlayered.css +503 -136
  402. package/views/docs/contract.md +292 -34
  403. package/views/docs/controls/avatar.md +11 -0
  404. package/views/docs/controls/choice.md +0 -1
  405. package/views/docs/controls/compound-editor.md +4 -0
  406. package/views/docs/controls/customize.md +6 -0
  407. package/views/docs/controls/date-editor.md +4 -0
  408. package/views/docs/controls/field.md +7 -0
  409. package/views/docs/controls/filter-editor.md +8 -0
  410. package/views/docs/controls/group-editor.md +6 -0
  411. package/views/docs/controls/input.md +5 -0
  412. package/views/docs/controls/links-editor.md +4 -0
  413. package/views/docs/controls/menu-list.md +8 -0
  414. package/views/docs/controls/menu.md +4 -0
  415. package/views/docs/controls/notice.md +4 -0
  416. package/views/docs/controls/number-editor.md +4 -0
  417. package/views/docs/controls/pane.md +4 -0
  418. package/views/docs/controls/picker.md +8 -0
  419. package/views/docs/controls/quick-filters.md +6 -0
  420. package/views/docs/controls/radio.md +20 -1
  421. package/views/docs/controls/select.md +10 -0
  422. package/views/docs/controls/setting-row.md +18 -0
  423. package/views/docs/controls/sheet.md +4 -0
  424. package/views/docs/controls/sort-editor.md +8 -0
  425. package/views/docs/controls/switch-row.md +0 -3
  426. package/views/docs/controls/tag-field.md +4 -0
  427. package/views/docs/controls/tag.md +1 -0
  428. package/views/docs/controls/text-editor.md +4 -0
  429. package/views/docs/controls/values-editor.md +4 -0
  430. package/views/docs/controls/views-list.md +6 -0
  431. package/views/docs/getting-started.md +2 -2
  432. package/views/docs/guides/atoms.md +2 -2
  433. package/views/docs/guides/columns.md +1 -1
  434. package/views/docs/guides/ports.md +1 -1
  435. package/views/docs/guides/the-grid.md +36 -9
  436. package/views/docs/guides/the-provider.md +22 -3
  437. package/views/docs/index.md +1 -0
  438. package/views/docs/reference/controls.md +41 -29
  439. package/views/docs/reference/editors-session.md +1 -1
  440. package/views/docs/reference/field-row.md +9 -1
  441. package/views/docs/reference/grid.md +15 -9
  442. package/views/docs/reference/list.md +357 -0
  443. package/views/docs/reference/looks.md +1 -1
  444. package/views/docs/reference/panels-react.md +17 -12
  445. package/views/docs/reference/panels.md +8 -5
  446. package/views/docs/reference/react.md +24 -16
  447. package/views/docs/reference/views.md +10 -6
  448. package/views/docs/reshaping.md +6 -1
  449. package/views/skills/views/SKILL.md +9 -6
@@ -0,0 +1,197 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Button } from "../button/button.js";
5
+ import { Input } from "../input/input.js";
6
+ import { Menu } from "../menu/menu.js";
7
+ import { Popover } from "../popover/popover.js";
8
+ import { Select } from "../select/select.js";
9
+ export const NO_APP_CONTROLS = Object.freeze({});
10
+ export const PanelControlsContext = React.createContext(NO_APP_CONTROLS);
11
+ const OWN = { Button: Button, Select, Menu, Popover, Input: Input };
12
+ export function usePanelControls() {
13
+ const app = React.useContext(PanelControlsContext);
14
+ return React.useMemo(() => (app === NO_APP_CONTROLS ? OWN : {
15
+ Button: app.Button ? AppButton : OWN.Button,
16
+ Select: app.Select ? AppSelect : Select,
17
+ Menu: app.Menu || app.Button ? OpenedMenu : Menu,
18
+ Popover: app.Popover ? AppPopover : Popover,
19
+ Input: app.Input ? AppInput : OWN.Input,
20
+ }), [app]);
21
+ }
22
+ const VARIANT = {
23
+ primary: "default", outline: "outline", soft: "secondary", quiet: "ghost", link: "ghost", text: "ghost", danger: "destructive",
24
+ information: "default", success: "default", warning: "default",
25
+ };
26
+ const SMALL = new Set(["2xs", "xs", "sm", "20", "22", "26", "20x24", "line"]);
27
+ export function buttonPropsOf(p) {
28
+ const { kind, size, shape, look: _look, loading: _loading, render: _render, nativeButton: _native, icon, iconEnd, children, focusableWhenDisabled, disabled, onClick, ...rest } = p;
29
+ const words = children != null && children !== false;
30
+ const inside = icon != null && !words && iconEnd == null ? icon : _jsxs(_Fragment, { children: [icon, children, iconEnd] });
31
+ const held = !!disabled && !!focusableWhenDisabled;
32
+ return {
33
+ ...rest,
34
+ type: rest.type ?? "button",
35
+ variant: VARIANT[kind ?? "outline"],
36
+ size: shape === "icon" || shape === "round" ? "icon" : SMALL.has(size ?? "md") ? "sm" : "default",
37
+ children: inside,
38
+ ...(held ? { "aria-disabled": true } : { disabled, onClick: onClick }),
39
+ };
40
+ }
41
+ function AppButton(p) {
42
+ const Own = React.useContext(PanelControlsContext).Button;
43
+ if (!Own)
44
+ return _jsx(Button, { ...p });
45
+ return _jsx(Own, { ...buttonPropsOf(p) });
46
+ }
47
+ const selectItemsOf = (items) => items.map(({ value, label, line, group, disabled, mark, level }) => ({
48
+ value, label, ...(mark != null ? { icon: mark } : {}), ...(line != null ? { line } : {}), ...(group != null ? { group } : {}),
49
+ ...(disabled ? { disabled } : {}), ...(level ? { level: selectItemsOf(level) } : {}),
50
+ }));
51
+ export function selectPropsOf(p) {
52
+ const { items, value, onValueChange, multiple, placeholder, disabled, open, onOpenChange, search, size, className, opens: _opens, defaultValue: _defaultValue, label: _label, labelAt: _labelAt, note: _note, error: _error, name: _name, required: _required, readOnly: _readOnly, autoComplete: _autoComplete, side: _side, align: _align, listWidth: _listWidth, chips: _chips, clear: _clear, pickerWords: _pickerWords, searchIn: _searchIn, onSearch: _onSearch, loading: _loading, none: _none, create: _create, footer: _footer, empty: _empty, ...rest } = p;
53
+ const { "data-force": _force, saving: _saving, ...passed } = rest;
54
+ const unsaid = Object.entries({ onSearch: _onSearch, loading: _loading, none: _none, create: _create, footer: _footer, empty: _empty, clear: _clear })
55
+ .filter(([, v]) => v != null && v !== false).map(([k]) => k);
56
+ if (unsaid.length)
57
+ warnUnsaid("Select", unsaid, named(p) ?? "");
58
+ return {
59
+ ...passed,
60
+ items: selectItemsOf(items), value: value ?? null, onValueChange: (v) => onValueChange?.(v), size: size === "md" || size === "lg" ? "default" : "sm",
61
+ ...(multiple ? { multiple } : {}), ...(placeholder != null ? { placeholder } : {}), ...(disabled ? { disabled } : {}),
62
+ ...(open !== undefined ? { open } : {}), ...(onOpenChange ? { onOpenChange } : {}), ...(search != null ? { search } : {}),
63
+ ...(className ? { className } : {}),
64
+ };
65
+ }
66
+ function AppSelect(p) {
67
+ const Own = React.useContext(PanelControlsContext).Select;
68
+ if (!Own || p.opens)
69
+ return _jsx(Select, { ...p });
70
+ return _jsx(Own, { ...selectPropsOf(p) });
71
+ }
72
+ const named = (p) => p["aria-label"] ?? p["data-slot"];
73
+ const warned = new Set();
74
+ function warnUnsaid(control, props, name) {
75
+ const key = `${control}:${props.join(",")}:${name}`;
76
+ if (process.env.NODE_ENV === "production" || warned.has(key))
77
+ return;
78
+ warned.add(key);
79
+ console.warn(`ViewKit: the ${control}${name ? ` "${name}"` : ""} is handed ${props.join(", ")}, which the components map's ${control} has no word for, so your ${control} isn't told.`);
80
+ }
81
+ function warnLeftOut(kind, label) {
82
+ if (process.env.NODE_ENV === "production" || warned.has(`${kind}:${label}`))
83
+ return;
84
+ warned.add(`${kind}:${label}`);
85
+ console.warn(`ViewKit: the menu "${label}" holds a "${kind}" row the components map's Menu can't be handed, so your Menu doesn't draw it.`);
86
+ }
87
+ export function menuItemsOf(entries, label) {
88
+ const out = [];
89
+ let line = false;
90
+ const push = (item) => { out.push(line ? { ...item, separatorBefore: true } : item); line = false; };
91
+ entries.forEach((e, at) => {
92
+ if (e.kind === "separator") {
93
+ line = out.length > 0;
94
+ return;
95
+ }
96
+ const slot = e.slot?.slot, key = e.slot?.key ?? String(at);
97
+ if (e.kind === undefined || e.kind === "action") {
98
+ push({ key, label: e.label, ...(e.icon != null ? { icon: e.icon } : {}), ...(e.onSelect ? { onSelect: e.onSelect } : {}), ...(e.danger ? { destructive: true } : {}),
99
+ ...(e.disabled ? { disabled: true, disabledReason: e.disabled } : {}), ...(slot ? { slot } : {}) });
100
+ }
101
+ else if (e.kind === "check") {
102
+ const checked = !!(e.checked ?? e.defaultChecked);
103
+ push({ key, label: e.label, ...(e.icon != null ? { icon: e.icon } : {}), checked, keepOpen: true, onSelect: () => e.onCheckedChange?.(!checked),
104
+ ...(e.disabled ? { disabled: true, disabledReason: e.disabled } : {}), ...(slot ? { slot } : {}) });
105
+ }
106
+ else if (e.kind === "pick") {
107
+ const rows = e.choices.map((c) => {
108
+ const named = c.slot?.slot ?? slot;
109
+ return { key: c.slot?.key ?? c.value, label: c.label, ...(c.mark != null ? { icon: c.mark } : {}), checked: c.value === e.value,
110
+ onSelect: () => e.onChoose?.(c.value), ...(named ? { slot: named } : {}) };
111
+ });
112
+ if (e.heading)
113
+ push({ key: e.slot?.key ?? e.heading, label: e.heading, children: rows, ...(slot ? { slot } : {}) });
114
+ else
115
+ rows.forEach(push);
116
+ }
117
+ else
118
+ warnLeftOut(e.kind, label);
119
+ });
120
+ return out;
121
+ }
122
+ function fillRef(ref, el) {
123
+ if (typeof ref === "function")
124
+ ref(el);
125
+ else if (ref)
126
+ ref.current = el;
127
+ }
128
+ function OpenedMenu(p) {
129
+ const app = React.useContext(PanelControlsContext);
130
+ const [ownOpen, setOwnOpen] = React.useState(!!p.defaultOpen), open = p.open ?? ownOpen;
131
+ const [at, setAt] = React.useState(null);
132
+ const openNow = React.useRef(open), pressedOpen = React.useRef(null);
133
+ React.useLayoutEffect(() => { openNow.current = open; });
134
+ const set = (next, reason = "trigger-press") => {
135
+ openNow.current = next;
136
+ setOwnOpen(next);
137
+ p.onOpenChange?.(next, { reason });
138
+ if (!next && reason !== "outside-press")
139
+ at?.focus({ preventScroll: true });
140
+ };
141
+ if (!p.trigger || p.anchor !== undefined)
142
+ return app.Menu ? _jsx(AnchoredAppMenu, { ...p }) : _jsx(Menu, { ...p });
143
+ const trigger = p.trigger;
144
+ const own = trigger.props.ref;
145
+ const placed = (el) => { setAt(el); fillRef(own, el); };
146
+ function onPointerDown(e) { pressedOpen.current = openNow.current; trigger.props.onPointerDown?.(e); }
147
+ function onClick(e) { trigger.props.onClick?.(e); const was = pressedOpen.current ?? openNow.current; pressedOpen.current = null; set(!was); }
148
+ const opener = React.cloneElement(trigger, { ref: placed, "aria-haspopup": "menu", "aria-expanded": open, "data-state": open ? "open" : "closed", onPointerDown, onClick });
149
+ const Own = app.Menu;
150
+ return (_jsxs(_Fragment, { children: [opener, Own
151
+ ? _jsx(Own, { open: open, onOpenChange: (o, d) => set(o, (d?.reason ?? "none")), anchor: at, items: menuItemsOf(p.entries, p.label), label: p.label, align: p.align, side: p.side, "data-slot": p["data-slot"] })
152
+ : _jsx(Menu, { ...p, trigger: undefined, anchor: at, open: open, finalFocus: false, onOpenChange: (o, d) => set(o, d.reason) })] }));
153
+ }
154
+ function AnchoredAppMenu(p) {
155
+ const Own = React.useContext(PanelControlsContext).Menu;
156
+ const [ownOpen, setOwnOpen] = React.useState(!!p.defaultOpen), open = p.open ?? ownOpen;
157
+ return _jsx(Own, { open: open, onOpenChange: (o, d) => { setOwnOpen(o); p.onOpenChange?.(o, { reason: d?.reason ?? "none" }); }, anchor: (p.anchor ?? null), items: menuItemsOf(p.entries, p.label), label: p.label, align: p.align, side: p.side, "data-slot": p["data-slot"] });
158
+ }
159
+ export function popoverPropsOf(p) {
160
+ const extra = p;
161
+ const unsaid = ["popupData", "onPopupClick", "finalFocus", "defaultOpen"].filter((k) => extra[k] != null);
162
+ if (unsaid.length)
163
+ warnUnsaid("Popover", unsaid, named(p) ?? "");
164
+ const { open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, className, style, children } = p;
165
+ const label = p["aria-label"];
166
+ return {
167
+ open: !!open, onOpenChange: (o, d) => onOpenChange?.(o, { reason: (d?.reason ?? "none") }),
168
+ anchor: (anchor ?? null), children,
169
+ ...(side ? { side } : {}), ...(align ? { align } : {}), ...(sideOffset != null ? { sideOffset } : {}), ...(alignOffset != null ? { alignOffset } : {}),
170
+ ...(initialFocus !== undefined ? { initialFocus: typeof initialFocus === "boolean" ? initialFocus : true } : {}),
171
+ ...(onOutsidePress ? { onOutsidePress } : {}), ...(onEscape ? { onEscape } : {}), ...(className ? { className } : {}), ...(style ? { style } : {}),
172
+ ...(label != null ? { label } : {}),
173
+ };
174
+ }
175
+ function AppPopover(p) {
176
+ const Own = React.useContext(PanelControlsContext).Popover;
177
+ if (!Own || p.trigger)
178
+ return _jsx(Popover, { ...p });
179
+ return _jsx(Own, { ...popoverPropsOf(p) });
180
+ }
181
+ export function inputPropsOf(p) {
182
+ const { size: _size, chrome: _chrome, look: _look, numeric: _numeric, multiline: _multiline, grow: _grow, maxLines: _maxLines, minLines: _minLines, lines: _lines, autofill: _autofill, fills: _fills, saving: _saving, saved: _saved, combobox: _combobox, onValueChange, onChange, ...rest } = p;
183
+ return {
184
+ ...rest,
185
+ chrome: "field",
186
+ onChange: (e) => {
187
+ onChange?.(e);
188
+ onValueChange?.(e.target.value, { event: e.nativeEvent });
189
+ },
190
+ };
191
+ }
192
+ function AppInput(p) {
193
+ const Own = React.useContext(PanelControlsContext).Input;
194
+ if (!Own)
195
+ return _jsx(Input, { ...p });
196
+ return _jsx(Own, { ...inputPropsOf(p) });
197
+ }
@@ -0,0 +1,12 @@
1
+ /** A part's public name, and which one of its kind it is. */
2
+ export type PartSlot = {
3
+ slot: string;
4
+ key?: string;
5
+ index?: number;
6
+ };
7
+ /** The attributes a part's name draws: nothing for what isn't handed. */
8
+ export declare const partAttrs: (p?: PartSlot) => {
9
+ "data-slot"?: string;
10
+ "data-key"?: string;
11
+ "data-index"?: string;
12
+ };
@@ -0,0 +1,5 @@
1
+ export const partAttrs = (p) => {
2
+ if (!p)
3
+ return {};
4
+ return { "data-slot": p.slot, ...(p.key !== undefined ? { "data-key": p.key } : {}), ...(p.index !== undefined ? { "data-index": String(p.index) } : {}) };
5
+ };
@@ -0,0 +1,2 @@
1
+ /** Calls `read` whenever one of `attrs` changes anywhere on the page; returns what stops it. */
2
+ export declare function watchFrame(attrs: readonly string[], read: () => void): () => void;
@@ -0,0 +1,33 @@
1
+ const readers = new Set();
2
+ let watch = null;
3
+ let watched = new Set();
4
+ function tell(changes) {
5
+ for (const r of [...readers])
6
+ if (changes.some((c) => c.attributeName != null && r.attrs.includes(c.attributeName)))
7
+ r.read();
8
+ }
9
+ function connect() {
10
+ const pending = watch?.takeRecords() ?? [];
11
+ watch?.disconnect();
12
+ watch = null;
13
+ if (pending.length)
14
+ tell(pending);
15
+ if (!readers.size) {
16
+ watched = new Set();
17
+ return;
18
+ }
19
+ watched = new Set([...readers].flatMap((r) => r.attrs));
20
+ watch = new MutationObserver(tell);
21
+ watch.observe(document.documentElement, { attributes: true, subtree: true, attributeFilter: [...watched] });
22
+ }
23
+ export function watchFrame(attrs, read) {
24
+ const reader = { attrs, read };
25
+ readers.add(reader);
26
+ if (!watch || attrs.some((a) => !watched.has(a)))
27
+ connect();
28
+ return () => {
29
+ readers.delete(reader);
30
+ if (!readers.size)
31
+ connect();
32
+ };
33
+ }
@@ -70,7 +70,7 @@ export interface LinksEditorAction {
70
70
  export interface LinksEditorParts {
71
71
  body: React.ReactNode;
72
72
  /** On a phone, the Sheet head's ✕ and ✓, or on a step its Back (`onBack`, `close: false`); {} on a computer. */
73
- head: Pick<SheetHeadProps, "close" | "left" | "right" | "onBack">;
73
+ head: Pick<SheetHeadProps, "close" | "left" | "right" | "onBack" | "backSlot">;
74
74
  /** On a phone, the Sheet's title while it stands on a step: a link's field, or a link's fields by the record's name. */
75
75
  title?: string;
76
76
  }
@@ -79,8 +79,8 @@ export function useLinksEditor(props) {
79
79
  asked.current?.(); was = now; });
80
80
  seenRef.current.observe(el);
81
81
  }, []);
82
- const more = onMore && !doing ? _jsxs("div", { ref: moreRef, className: "o-links-editor-loading", children: [_jsx(Spinner, { size: 16, label: "" }), _jsx("span", { children: w.loadingMore })] }) : null;
83
- const doingNote = doing === "searching" ? w.searching : doing === "failed" ? _jsxs(_Fragment, { children: [w.failed, onRetry && _jsx(Button, { kind: "quiet", size: "2xs", className: "o-links-editor-retry", onClick: onRetry, children: w.retry })] }) : null;
82
+ const more = onMore && !doing ? _jsxs("div", { ref: moreRef, className: "o-links-editor-loading", "data-slot": "vk-links-note", children: [_jsx(Spinner, { size: 16, label: "" }), _jsx("span", { children: w.loadingMore })] }) : null;
83
+ const doingNote = doing === "searching" ? w.searching : doing === "failed" ? _jsxs(_Fragment, { children: [w.failed, onRetry && _jsx(Button, { kind: "quiet", size: "2xs", className: "o-links-editor-retry", "data-slot": "vk-links-retry", onClick: onRetry, children: w.retry })] }) : null;
84
84
  const byValue = (value) => records.find((r) => r.value === value) ?? { value, label: links.find((l) => l.value === value)?.label ?? value };
85
85
  const [root, setRoot] = React.useState(null);
86
86
  const searchBox = React.useRef(null), list = React.useRef(null);
@@ -223,27 +223,27 @@ export function useLinksEditor(props) {
223
223
  .filter(Boolean).join(" · ");
224
224
  const rowWords = (f, v) => { const s = said(f, v, w.yes); return f.kind === "yes-no" ? (v === true ? w.yes : w.no) : s === "–" ? w.none : s; };
225
225
  const openList = (value, field) => setTop({ link: value, field });
226
- const fieldRow = (l, name, f) => (f.kind === "yes-no" ? (_jsxs(FieldRow, { className: "o-links-editor-open", "data-field": f.id, children: [_jsx("span", { className: "o-links-editor-open-name", children: f.label }), _jsx(Switch, { size: "lg", className: "o-links-editor-switch", checked: l.values[f.id] === true, "aria-label": w.fieldAt(f.label, name), onCheckedChange: (c) => setField(l.value, f.id, c) })] }, f.id)) : (_jsxs(FieldRow, { as: "button", className: "o-links-editor-open", "data-field": f.id, "aria-label": w.fieldAt(f.label, name), onClick: () => openList(l.value, f.id), children: [_jsx("span", { className: "o-links-editor-open-name", children: f.label }), _jsx("span", { className: "o-links-editor-open-value", children: rowWords(f, l.values[f.id]) }), glyph(MORE, "o-links-editor-open-mark")] }, f.id)));
226
+ const fieldRow = (l, name, f) => (f.kind === "yes-no" ? (_jsxs(FieldRow, { className: "o-links-editor-open", "data-slot": "vk-links-field", "data-key": f.id, "data-field": f.id, children: [_jsx("span", { className: "o-links-editor-open-name", children: f.label }), _jsx(Switch, { size: "lg", className: "o-links-editor-switch", "data-slot": "vk-links-control", "data-key": f.id, checked: l.values[f.id] === true, "aria-label": w.fieldAt(f.label, name), onCheckedChange: (c) => setField(l.value, f.id, c) })] }, f.id)) : (_jsxs(FieldRow, { as: "button", className: "o-links-editor-open", "data-slot": "vk-links-field", "data-key": f.id, "data-field": f.id, "aria-label": w.fieldAt(f.label, name), onClick: () => openList(l.value, f.id), children: [_jsx("span", { className: "o-links-editor-open-name", children: f.label }), _jsx("span", { className: "o-links-editor-open-value", children: rowWords(f, l.values[f.id]) }), glyph(MORE, "o-links-editor-open-mark")] }, f.id)));
227
227
  const card = (r) => {
228
228
  const l = links.find((x) => x.value === r.value), name = r.label, leads = lead != null && lead.value === r.value;
229
229
  const said_ = holds(l);
230
- return (_jsxs(FieldRows, { look: CARD, className: "o-links-editor-card", "data-link": r.value, role: "listitem", "aria-label": name, children: [_jsxs(FieldRow, { as: "div", className: "o-links-editor-card-head", children: [_jsx(Face, { record: r, size: 24 }), _jsxs("span", { className: "o-links-editor-card-name", children: [_jsx("span", { children: name }), leads && _jsx("span", { className: "o-links-editor-lead-word", children: lead.label })] }), !several
231
- ? _jsx(Menu, { label: w.linkMenu(name), align: "end", entries: [...(lead && !leads ? [{ icon: _jsx(Icon, { name: "star" }), label: w.setLead(lead.label), onSelect: () => setLead(r.value) }] : []), { icon: glyph(UNLINK), label: w.unlink, danger: true, onSelect: () => unlink(r.value) }], trigger: _jsx(Button, { kind: "quiet", shape: "icon", size: "40x44", look: DOTS_LOOK, className: "o-links-editor-more", "aria-label": w.actionsFor(name), icon: glyph(DOTS) }) })
232
- : _jsx(Button, { kind: "quiet", shape: "icon", size: "40x44", look: DOTS_LOOK, className: "o-links-editor-config", "aria-label": w.editLink(name), "aria-haspopup": "dialog", icon: _jsx(Icon, { name: "settings", size: 20 }), onClick: () => setFieldsOf(r.value) })] }), !several ? one && fieldRow(l, name, one) : _jsx("div", { className: "o-links-editor-card-line", "data-none": said_ ? undefined : "", children: said_ || w.noDetails })] }, r.value));
230
+ return (_jsxs(FieldRows, { look: CARD, className: "o-links-editor-card", "data-slot": "vk-links-row", "data-key": r.value, "data-link": r.value, role: "listitem", "aria-label": name, children: [_jsxs(FieldRow, { as: "div", className: "o-links-editor-card-head", children: [_jsx(Face, { record: r, size: 24 }), _jsxs("span", { className: "o-links-editor-card-name", "data-slot": "vk-links-name", children: [_jsx("span", { children: name }), leads && _jsx("span", { className: "o-links-editor-lead-word", children: lead.label })] }), !several
231
+ ? _jsx(Menu, { label: w.linkMenu(name), align: "end", entries: [...(lead && !leads ? [{ icon: _jsx(Icon, { name: "star" }), label: w.setLead(lead.label), onSelect: () => setLead(r.value), slot: { slot: "vk-links-action", key: "lead" } }] : []), { icon: glyph(UNLINK), label: w.unlink, danger: true, onSelect: () => unlink(r.value), slot: { slot: "vk-links-action", key: "unlink" } }], trigger: _jsx(Button, { kind: "quiet", shape: "icon", size: "40x44", look: DOTS_LOOK, className: "o-links-editor-more", "data-slot": "vk-links-more", "aria-label": w.actionsFor(name), icon: glyph(DOTS) }) })
232
+ : _jsx(Button, { kind: "quiet", shape: "icon", size: "40x44", look: DOTS_LOOK, className: "o-links-editor-config", "data-slot": "vk-links-config", "aria-label": w.editLink(name), "aria-haspopup": "dialog", icon: _jsx(Icon, { name: "settings", size: 20 }), onClick: () => setFieldsOf(r.value) })] }), !several ? one && fieldRow(l, name, one) : _jsx("div", { className: "o-links-editor-card-line", "data-none": said_ ? undefined : "", children: said_ || w.noDetails })] }, r.value));
233
233
  };
234
234
  const topLink = top ? links.find((l) => l.value === top.link) : undefined, topField = top ? fields.find((f) => f.id === top.field) : undefined;
235
235
  const fieldsLink = fieldsOf ? links.find((l) => l.value === fieldsOf) : undefined;
236
236
  const fieldsName = fieldsOf ? byValue(fieldsOf).label : "";
237
237
  const listStep = top && topLink && topField ? top : null;
238
238
  const fieldsStep = several ? fieldsLink ?? null : null;
239
- const body = (_jsx("div", { ref: placeRoot, className: "o-links-editor", "data-kit": "links-editor", ...mark, "data-links-form": "phone", "data-links-shape": "table", "data-links-fields": several ? "several" : "one", tabIndex: -1, "data-links-step": listStep ? "list" : fieldsStep ? "fields" : undefined, style: sheetRoom ? { "--links-room": `${sheetRoom.height}px`, "--links-under": `${sheetRoom.under}px` } : undefined, children: listStep && topLink && topField ? (_jsx(StepList, { ...listOf(topLink, topField), draft: "shell", form: "phone", onDone: () => setTop(null) }, `${listStep.link}-${listStep.field}`)) : fieldsStep ? _jsxs(_Fragment, { children: [_jsxs(FieldRows, { look: FIELDS, className: "o-links-editor-fields", "data-link": fieldsStep.value, children: [fields.map((f) => f.kind === "yes-no"
240
- ? _jsx(FieldRow, { label: f.label, "data-field": f.id, children: _jsx(Switch, { size: "lg", className: "o-links-editor-switch", checked: fieldsStep.values[f.id] === true, "aria-label": w.fieldAt(f.label, fieldsName), onCheckedChange: (c) => setField(fieldsStep.value, f.id, c) }) }, f.id)
241
- : _jsxs(FieldRow, { as: "button", label: f.label, className: "o-links-editor-open", "data-field": f.id, "aria-label": w.fieldAt(f.label, fieldsName), onClick: () => openList(fieldsStep.value, f.id), children: [_jsx("span", { className: "o-links-editor-open-value", children: rowWords(f, fieldsStep.values[f.id]) }), glyph(MORE, "o-links-editor-open-mark")] }, f.id)), lead && _jsx(FieldRow, { label: lead.label, "data-field": "lead", children: _jsx(Switch, { size: "lg", className: "o-links-editor-switch", checked: lead.value === fieldsStep.value, "aria-label": w.isLead(fieldsName, lead.label), onCheckedChange: (c) => { if (c)
242
- setLead(fieldsStep.value); } }) })] }), _jsx(FieldRows, { look: FIELDS, className: "o-links-editor-fields-foot", children: _jsx(FieldRow, { as: "button", className: "o-links-editor-unlink", onClick: () => { const v = fieldsStep.value; setFieldsOf(null); unlink(v); }, children: w.unlink }) })] }) : _jsxs(_Fragment, { children: [linked.length > 0 && _jsx("div", { className: "o-links-editor-cards", role: "list", "aria-label": label, children: linked.map(card) }), (rest.length > 0 || actions.length > 0) && _jsxs(_Fragment, { children: [_jsx("div", { className: "o-links-editor-label", children: addWords }), _jsxs(FieldRows, { look: ADDS, className: "o-links-editor-adds", role: "list", "aria-label": addWords, children: [rest.map((r) => (_jsxs(FieldRow, { as: "button", className: "o-links-editor-add", "data-record": r.value, role: "listitem", "aria-label": w.linkName(r.label), onClick: () => link(r.value), children: [_jsx(Face, { record: r, size: 40 }), _jsx("span", { className: "o-links-editor-add-name", children: r.label }), glyph(PLUS, "o-links-editor-add-mark")] }, r.value))), actions.map((a) => (_jsxs(FieldRow, { as: "button", className: "o-links-editor-add o-links-editor-action", role: "listitem", onClick: a.onSelect, children: [a.icon != null && _jsx("span", { className: "o-links-editor-action-mark", children: a.icon }), _jsx("span", { className: "o-links-editor-add-name", children: a.label })] }, a.key)))] }), more] }), doingNote ? _jsx("div", { className: "o-links-editor-note", children: doingNote }) : _jsxs(_Fragment, { children: [!rest.length && query.trim() && !linked.length && _jsx("div", { className: "o-links-editor-note", children: w.nothingMatchesTyped(query.trim()) }), !rest.length && !query.trim() && linked.length > 0 && _jsx("div", { className: "o-links-editor-note", children: w.everythingLinked })] }), _jsx("div", { className: "o-links-editor-bar", children: _jsxs(InputGroup, { size: "lg", className: "o-links-editor-pill", children: [_jsx(InputGroupAddon, { side: "start", children: glyph(SEARCH) }), _jsx(Input, { autofill: false, ref: searchBox, className: "o-links-editor-input", placeholder: search, "aria-label": search, value: query, onValueChange: (v) => typeQuery(v) })] }) })] }) }));
239
+ const body = (_jsx("div", { ref: placeRoot, className: "o-links-editor", "data-slot": "vk-links", "data-kit": "links-editor", ...mark, "data-links-form": "phone", "data-links-shape": "table", "data-links-fields": several ? "several" : "one", tabIndex: -1, "data-links-step": listStep ? "list" : fieldsStep ? "fields" : undefined, style: sheetRoom ? { "--links-room": `${sheetRoom.height}px`, "--links-under": `${sheetRoom.under}px` } : undefined, children: listStep && topLink && topField ? (_jsx(StepList, { ...listOf(topLink, topField), draft: "shell", form: "phone", onDone: () => setTop(null) }, `${listStep.link}-${listStep.field}`)) : fieldsStep ? _jsxs(_Fragment, { children: [_jsxs(FieldRows, { look: FIELDS, className: "o-links-editor-fields", "data-link": fieldsStep.value, children: [fields.map((f) => f.kind === "yes-no"
240
+ ? _jsx(FieldRow, { label: f.label, "data-slot": "vk-links-field", "data-key": f.id, "data-field": f.id, children: _jsx(Switch, { size: "lg", className: "o-links-editor-switch", "data-slot": "vk-links-control", "data-key": f.id, checked: fieldsStep.values[f.id] === true, "aria-label": w.fieldAt(f.label, fieldsName), onCheckedChange: (c) => setField(fieldsStep.value, f.id, c) }) }, f.id)
241
+ : _jsxs(FieldRow, { as: "button", label: f.label, className: "o-links-editor-open", "data-slot": "vk-links-field", "data-key": f.id, "data-field": f.id, "aria-label": w.fieldAt(f.label, fieldsName), onClick: () => openList(fieldsStep.value, f.id), children: [_jsx("span", { className: "o-links-editor-open-value", children: rowWords(f, fieldsStep.values[f.id]) }), glyph(MORE, "o-links-editor-open-mark")] }, f.id)), lead && _jsx(FieldRow, { label: lead.label, "data-slot": "vk-links-lead", "data-field": "lead", children: _jsx(Switch, { size: "lg", className: "o-links-editor-switch", "data-slot": "vk-links-control", "data-key": "lead", checked: lead.value === fieldsStep.value, "aria-label": w.isLead(fieldsName, lead.label), onCheckedChange: (c) => { if (c)
242
+ setLead(fieldsStep.value); } }) })] }), _jsx(FieldRows, { look: FIELDS, className: "o-links-editor-fields-foot", children: _jsx(FieldRow, { as: "button", className: "o-links-editor-unlink", "data-slot": "vk-links-unlink", onClick: () => { const v = fieldsStep.value; setFieldsOf(null); unlink(v); }, children: w.unlink }) })] }) : _jsxs(_Fragment, { children: [linked.length > 0 && _jsx("div", { className: "o-links-editor-cards", "data-slot": "vk-links-rows", role: "list", "aria-label": label, children: linked.map(card) }), (rest.length > 0 || actions.length > 0) && _jsxs(_Fragment, { children: [_jsx("div", { className: "o-links-editor-label", children: addWords }), _jsxs(FieldRows, { look: ADDS, className: "o-links-editor-adds", "data-slot": "vk-links-offers", role: "list", "aria-label": addWords, children: [rest.map((r) => (_jsxs(FieldRow, { as: "button", className: "o-links-editor-add", "data-slot": "vk-links-offer", "data-key": r.value, "data-record": r.value, role: "listitem", "aria-label": w.linkName(r.label), onClick: () => link(r.value), children: [_jsx(Face, { record: r, size: 40 }), _jsx("span", { className: "o-links-editor-add-name", children: r.label }), glyph(PLUS, "o-links-editor-add-mark")] }, r.value))), actions.map((a) => (_jsxs(FieldRow, { as: "button", className: "o-links-editor-add o-links-editor-action", "data-slot": "vk-links-offer-action", "data-key": a.key, role: "listitem", onClick: a.onSelect, children: [a.icon != null && _jsx("span", { className: "o-links-editor-action-mark", children: a.icon }), _jsx("span", { className: "o-links-editor-add-name", children: a.label })] }, a.key)))] }), more] }), doingNote ? _jsx("div", { className: "o-links-editor-note", "data-slot": "vk-links-note", children: doingNote }) : _jsxs(_Fragment, { children: [!rest.length && query.trim() && !linked.length && _jsx("div", { className: "o-links-editor-note", "data-slot": "vk-links-note", children: w.nothingMatchesTyped(query.trim()) }), !rest.length && !query.trim() && linked.length > 0 && _jsx("div", { className: "o-links-editor-note", "data-slot": "vk-links-note", children: w.everythingLinked })] }), _jsx("div", { className: "o-links-editor-bar", children: _jsxs(InputGroup, { size: "lg", className: "o-links-editor-pill", "data-slot": "vk-links-search", children: [_jsx(InputGroupAddon, { side: "start", children: glyph(SEARCH) }), _jsx(Input, { autofill: false, ref: searchBox, className: "o-links-editor-input", placeholder: search, "aria-label": search, value: query, onValueChange: (v) => typeQuery(v) })] }) })] }) }));
243
243
  if (listStep && topField)
244
- return { body, head: { onBack: () => setTop(null), close: false }, title: topField.label };
244
+ return { body, head: { onBack: () => setTop(null), backSlot: "vk-editor-back", close: false }, title: topField.label };
245
245
  if (fieldsStep)
246
- return { body, head: { onBack: () => setFieldsOf(null), close: false }, title: fieldsName };
246
+ return { body, head: { onBack: () => setFieldsOf(null), backSlot: "vk-editor-back", close: false }, title: fieldsName };
247
247
  return { body, head: decide.head };
248
248
  }
249
249
  const stepLink = step ? links.find((l) => l.value === step) : undefined;
@@ -253,18 +253,18 @@ export function useLinksEditor(props) {
253
253
  const control = (f) => {
254
254
  const v = stepLink.values[f.id], words = w.fieldAt(f.label, name);
255
255
  if (f.kind === "yes-no")
256
- return _jsx(Switch, { size: "md", checked: v === true, "aria-label": words, onCheckedChange: (c) => setField(step, f.id, c) });
256
+ return _jsx(Switch, { size: "md", "data-slot": "vk-links-control", "data-key": f.id, checked: v === true, "aria-label": words, onCheckedChange: (c) => setField(step, f.id, c) });
257
257
  if (f.kind === "several")
258
- return _jsx(Select, { size: "sm", multiple: true, listWidth: "rows", items: offered(f, v), value: heldOf(v), placeholder: w.none, "aria-label": words, onValueChange: (next) => tickFrom(step, f, Array.isArray(next) ? next : []) });
259
- return _jsx(Select, { size: "sm", listWidth: "rows", items: offered(f, v), value: typeof v === "string" ? v : null, placeholder: w.none, "aria-label": words, onValueChange: (next) => setField(step, f.id, typeof next === "string" ? next : null) });
258
+ return _jsx(Select, { size: "sm", "data-slot": "vk-links-control", "data-key": f.id, multiple: true, listWidth: "rows", items: offered(f, v), value: heldOf(v), placeholder: w.none, "aria-label": words, onValueChange: (next) => tickFrom(step, f, Array.isArray(next) ? next : []) });
259
+ return _jsx(Select, { size: "sm", "data-slot": "vk-links-control", "data-key": f.id, listWidth: "rows", items: offered(f, v), value: typeof v === "string" ? v : null, placeholder: w.none, "aria-label": words, onValueChange: (next) => setField(step, f.id, typeof next === "string" ? next : null) });
260
260
  };
261
- const body = (_jsxs("div", { ref: setRoot, className: "o-links-editor", "data-kit": "links-editor", ...mark, "data-links-form": "computer", "data-links-shape": "table", "data-links-fields": several ? "several" : "one", "data-links-step": "", role: "group", "aria-label": name, tabIndex: -1, onKeyDown: (e) => {
261
+ const body = (_jsxs("div", { ref: setRoot, className: "o-links-editor", "data-slot": "vk-links", "data-kit": "links-editor", ...mark, "data-links-form": "computer", "data-links-shape": "table", "data-links-fields": several ? "several" : "one", "data-links-step": "", role: "group", "aria-label": name, tabIndex: -1, onKeyDown: (e) => {
262
262
  if (e.key !== "Escape" || e.target.closest?.("[aria-expanded='true']"))
263
263
  return;
264
264
  e.preventDefault();
265
265
  e.stopPropagation();
266
266
  leave();
267
- }, children: [_jsxs("div", { className: "o-links-editor-step-head o-popup-line", children: [_jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", className: "o-links-editor-back", "aria-label": w.backTo(label), icon: glyph(BACK), onClick: leave }), _jsx(Face, { record: record, size: 20 }), _jsx("span", { className: "o-links-editor-step-name", children: name })] }), _jsx("div", { className: "o-links-editor-fields", "data-link": step, children: fields.map((f) => (_jsxs("div", { className: "o-links-editor-field", "data-field": f.id, children: [_jsx("span", { className: "o-links-editor-field-label", children: f.label }), _jsx("span", { className: "o-links-editor-field-control", "data-kind": f.kind, children: control(f) })] }, f.id))) }), _jsx("div", { className: "o-links-editor-step-foot", children: _jsx(Button, { kind: "quiet", size: "2xs", className: "o-links-editor-unlink", onClick: () => unlink(step), children: w.unlink }) })] }));
267
+ }, children: [_jsxs("div", { className: "o-links-editor-step-head o-popup-line", "data-slot": "vk-links-step", children: [_jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", className: "o-links-editor-back", "data-slot": "vk-links-back", "aria-label": w.backTo(label), icon: glyph(BACK), onClick: leave }), _jsx(Face, { record: record, size: 20 }), _jsx("span", { className: "o-links-editor-step-name", children: name })] }), _jsx("div", { className: "o-links-editor-fields", "data-link": step, children: fields.map((f) => (_jsxs("div", { className: "o-links-editor-field", "data-slot": "vk-links-field", "data-key": f.id, "data-field": f.id, children: [_jsx("span", { className: "o-links-editor-field-label", children: f.label }), _jsx("span", { className: "o-links-editor-field-control", "data-kind": f.kind, children: control(f) })] }, f.id))) }), _jsx("div", { className: "o-links-editor-step-foot", children: _jsx(Button, { kind: "quiet", size: "2xs", className: "o-links-editor-unlink", "data-slot": "vk-links-unlink", onClick: () => unlink(step), children: w.unlink }) })] }));
268
268
  return { body, head: {} };
269
269
  }
270
270
  const keepArrows = (e) => { if (e.key.startsWith("Arrow"))
@@ -294,17 +294,17 @@ export function useLinksEditor(props) {
294
294
  };
295
295
  const short = (l, name, f) => {
296
296
  const words = saidShort(f, l.values[f.id], w.yes), standing = shownList?.link === l.value && shownList.field === f.id;
297
- const button = (_jsx(Button, { kind: "quiet", size: "2xs", className: "o-links-editor-short", "data-field": f.id, "data-none": words ? undefined : "", "aria-label": w.fieldAt(f.label, name), iconEnd: _jsx(Icon, { name: "down" }), "data-popup-open": standing ? "" : undefined, children: words || f.label }));
297
+ const button = (_jsx(Button, { kind: "quiet", size: "2xs", className: "o-links-editor-short", "data-slot": "vk-links-value", "data-key": f.id, "data-field": f.id, "data-none": words ? undefined : "", "aria-label": w.fieldAt(f.label, name), iconEnd: _jsx(Icon, { name: "down" }), "data-popup-open": standing ? "" : undefined, children: words || f.label }));
298
298
  if (standing)
299
299
  return button;
300
- return (_jsx(Popover, { trigger: button, open: open?.link === l.value && open.field === f.id, onOpenChange: (o) => setOpen(o ? { link: l.value, field: f.id } : null), side: "bottom", align: "start", className: "o-links-editor-pop", "aria-label": w.fieldAt(f.label, name), ...(props.popupData ? { popupData: props.popupData } : {}), children: _jsx(Picker, { ...listOf(l, f), form: "computer", onDone: () => setOpen(null) }) }));
300
+ return (_jsx(Popover, { trigger: button, open: open?.link === l.value && open.field === f.id, onOpenChange: (o) => setOpen(o ? { link: l.value, field: f.id } : null), side: "bottom", align: "start", className: "o-links-editor-pop", "aria-label": w.fieldAt(f.label, name), popupData: { ...props.popupData, "data-slot": "vk-links-pop", "data-key": f.id }, children: _jsx(Picker, { ...listOf(l, f), form: "computer", onDone: () => setOpen(null) }) }));
301
301
  };
302
- const cell = (l, name, f) => (_jsx("span", { className: "o-links-editor-cell", "data-field": f.id, "data-kind": f.kind, onKeyDown: keepArrows, children: one && f.kind === "yes-no" ? _jsx(Switch, { size: "sm", checked: l.values[f.id] === true, "aria-label": w.fieldAt(f.label, name), onCheckedChange: (c) => setField(l.value, f.id, c) })
302
+ const cell = (l, name, f) => (_jsx("span", { className: "o-links-editor-cell", "data-slot": "vk-links-field", "data-key": f.id, "data-field": f.id, "data-kind": f.kind, onKeyDown: keepArrows, children: one && f.kind === "yes-no" ? _jsx(Switch, { size: "sm", "data-slot": "vk-links-control", "data-key": f.id, checked: l.values[f.id] === true, "aria-label": w.fieldAt(f.label, name), onCheckedChange: (c) => setField(l.value, f.id, c) })
303
303
  : one ? short(l, name, f) : said(f, l.values[f.id], w.yes) }, f.id));
304
304
  const row = (r) => {
305
305
  const l = links.find((x) => x.value === r.value), name = r.label;
306
- return (_jsxs("div", { className: "o-links-editor-row", "data-link": r.value, role: "group", "aria-label": name, children: [_jsxs("span", { className: "o-links-editor-who", children: [_jsx(Face, { record: r, size: 20 }), _jsx("span", { className: "o-links-editor-name", children: name })] }), fields.map((f) => cell(l, name, f)), lead && _jsx("span", { className: "o-links-editor-lead", children: _jsx(Radio, { value: r.value, "aria-label": w.isLead(name, lead.label) }) }), _jsx("span", { className: "o-links-editor-end", onKeyDown: keepArrows, children: !several ? _jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", look: END_LOOK, "aria-label": w.unlinkName(name), icon: glyph(X), onClick: () => unlink(r.value) })
307
- : _jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", look: END_LOOK, className: "o-links-editor-config", "aria-label": w.editLink(name), icon: _jsx(Icon, { name: "settings" }), onClick: () => { setOpen(null); stepPressed.current = true; setStep(r.value); } }) })] }, r.value));
306
+ return (_jsxs("div", { className: "o-links-editor-row", "data-slot": "vk-links-row", "data-key": r.value, "data-link": r.value, role: "group", "aria-label": name, children: [_jsxs("span", { className: "o-links-editor-who", "data-slot": "vk-links-name", children: [_jsx(Face, { record: r, size: 20 }), _jsx("span", { className: "o-links-editor-name", children: name })] }), fields.map((f) => cell(l, name, f)), lead && _jsx("span", { className: "o-links-editor-lead", "data-slot": "vk-links-lead", children: _jsx(Radio, { value: r.value, "data-slot": "vk-links-control", "data-key": "lead", "aria-label": w.isLead(name, lead.label) }) }), _jsx("span", { className: "o-links-editor-end", onKeyDown: keepArrows, children: !several ? _jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", look: END_LOOK, "aria-label": w.unlinkName(name), icon: glyph(X), "data-slot": "vk-links-remove", onClick: () => unlink(r.value) })
307
+ : _jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", look: END_LOOK, className: "o-links-editor-config", "data-slot": "vk-links-config", "aria-label": w.editLink(name), icon: _jsx(Icon, { name: "settings" }), onClick: () => { setOpen(null); stepPressed.current = true; setStep(r.value); } }) })] }, r.value));
308
308
  };
309
309
  const rows = linked.map(row);
310
310
  const message = doingNote ?? (!lights && (query.trim() ? (!linked.length ? w.nothingMatches : null) : linked.length ? w.everythingLinked : null));
@@ -314,14 +314,14 @@ export function useLinksEditor(props) {
314
314
  return null;
315
315
  return (_jsx("div", { className: "o-links-editor-shown o-list o-smooth o-smooth-ease", "data-links-shown": "list", ...phoneMark(small), style: shownAt ? { top: shownAt.top, left: shownAt.left } : { visibility: "hidden" }, children: _jsx(Picker, { ...listOf(l, f), form: "computer", standing: true }) }));
316
316
  })() : null;
317
- const body = (_jsxs("div", { ref: setRoot, className: "o-links-editor", "data-kit": "links-editor", ...mark, "data-links-form": "computer", "data-links-shape": "table", "data-links-fields": several ? "several" : "one", role: "group", "aria-label": label, tabIndex: -1, style: room ? { paddingBottom: room } : undefined, children: [_jsxs("div", { className: "o-links-editor-search o-popup-line", children: [glyph(SEARCH), _jsx(Input, { chrome: "bare", autofill: false, ref: searchBox, className: "o-links-editor-input", placeholder: search, "aria-label": search, role: "combobox", "aria-expanded": lights > 0, "aria-autocomplete": "list", "aria-controls": lights ? `${ids}-add` : undefined, "aria-activedescendant": litAt != null ? `${ids}-add-${litAt}` : undefined, value: query, onValueChange: (v) => { typeQuery(v); setLit(v.trim() ? 0 : null); }, onKeyDown: keys })] }), _jsxs("div", { ref: placeList, className: "o-links-editor-list", "data-head": linked.length ? "" : undefined, "data-held": open ? "" : undefined, children: [linked.length > 0 && _jsxs(_Fragment, { children: [_jsxs("div", { className: "o-links-editor-head", "aria-hidden": "true", children: [_jsx("span", { className: "o-links-editor-who", children: kind }), fields.map((f) => _jsx("span", { className: "o-links-editor-cell", "data-field": f.id, "data-kind": f.kind, children: f.label }, f.id)), lead && _jsx("span", { className: "o-links-editor-lead", children: lead.label }), _jsx("span", { className: "o-links-editor-end" })] }), lead
318
- ? _jsx(RadioGroup, { className: "o-links-editor-rows", "aria-label": lead.label, value: lead.value, onValueChange: (v) => setLead(v), children: rows })
319
- : _jsx("div", { className: "o-links-editor-rows", children: rows })] }), linked.length > 0 && lights > 0 && _jsx("div", { className: "o-list-sep", role: "presentation" }), lights > 0 && _jsxs("div", { id: `${ids}-add`, role: "listbox", "aria-label": w.addTo(label), className: "o-links-editor-adds", onPointerLeave: () => setLit(query.trim() ? 0 : null), children: [linked.length > 0 && _jsx("div", { className: "o-list-heading", "aria-hidden": "true", children: w.add }), rest.map((r, i) => (_jsxs("div", { id: `${ids}-add-${i}`, role: "option", "aria-selected": i === litAt, className: "o-list-row o-smooth o-smooth-ease o-links-editor-add", "data-record": r.value, ...phoneMark(small), "data-highlighted": i === litAt ? "" : undefined, onPointerMove: () => { if (!open && doing !== "searching" && i !== litAt)
317
+ const body = (_jsxs("div", { ref: setRoot, className: "o-links-editor", "data-slot": "vk-links", "data-kit": "links-editor", ...mark, "data-links-form": "computer", "data-links-shape": "table", "data-links-fields": several ? "several" : "one", role: "group", "aria-label": label, tabIndex: -1, style: room ? { paddingBottom: room } : undefined, children: [_jsxs("div", { className: "o-links-editor-search o-popup-line", "data-slot": "vk-links-search", children: [glyph(SEARCH), _jsx(Input, { chrome: "bare", autofill: false, ref: searchBox, className: "o-links-editor-input", placeholder: search, "aria-label": search, role: "combobox", "aria-expanded": lights > 0, "aria-autocomplete": "list", "aria-controls": lights ? `${ids}-add` : undefined, "aria-activedescendant": litAt != null ? `${ids}-add-${litAt}` : undefined, value: query, onValueChange: (v) => { typeQuery(v); setLit(v.trim() ? 0 : null); }, onKeyDown: keys })] }), _jsxs("div", { ref: placeList, className: "o-links-editor-list", "data-slot": "vk-links-list", "data-head": linked.length ? "" : undefined, "data-held": open ? "" : undefined, children: [linked.length > 0 && _jsxs(_Fragment, { children: [_jsxs("div", { className: "o-links-editor-head", "data-slot": "vk-links-head", "aria-hidden": "true", children: [_jsx("span", { className: "o-links-editor-who", "data-slot": "vk-links-name", children: kind }), fields.map((f) => _jsx("span", { className: "o-links-editor-cell", "data-slot": "vk-links-field", "data-key": f.id, "data-field": f.id, "data-kind": f.kind, children: f.label }, f.id)), lead && _jsx("span", { className: "o-links-editor-lead", "data-slot": "vk-links-lead", children: lead.label }), _jsx("span", { className: "o-links-editor-end" })] }), lead
318
+ ? _jsx(RadioGroup, { className: "o-links-editor-rows", "data-slot": "vk-links-rows", "aria-label": lead.label, value: lead.value, onValueChange: (v) => setLead(v), children: rows })
319
+ : _jsx("div", { className: "o-links-editor-rows", "data-slot": "vk-links-rows", children: rows })] }), linked.length > 0 && lights > 0 && _jsx("div", { className: "o-list-sep", role: "presentation" }), lights > 0 && _jsxs("div", { id: `${ids}-add`, role: "listbox", "aria-label": w.addTo(label), className: "o-links-editor-adds", "data-slot": "vk-links-offers", onPointerLeave: () => setLit(query.trim() ? 0 : null), children: [linked.length > 0 && _jsx("div", { className: "o-list-heading", "aria-hidden": "true", children: w.add }), rest.map((r, i) => (_jsxs("div", { id: `${ids}-add-${i}`, role: "option", "aria-selected": i === litAt, className: "o-list-row o-smooth o-smooth-ease o-links-editor-add", "data-slot": "vk-links-offer", "data-key": r.value, "data-record": r.value, ...phoneMark(small), "data-highlighted": i === litAt ? "" : undefined, onPointerMove: () => { if (!open && doing !== "searching" && i !== litAt)
320
320
  setLit(i); }, onMouseDown: (e) => e.preventDefault(), onClick: () => link(r.value), children: [_jsx(Face, { record: r, size: 20 }), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: r.label }) })] }, r.value))), actions.map((a, j) => {
321
321
  const i = rest.length + j;
322
- return (_jsxs("div", { id: `${ids}-add-${i}`, role: "option", "aria-selected": i === litAt, className: "o-list-row o-smooth o-smooth-ease o-links-editor-add o-links-editor-action", ...phoneMark(small), "data-highlighted": i === litAt ? "" : undefined, onPointerMove: () => { if (!open && doing !== "searching" && i !== litAt)
322
+ return (_jsxs("div", { id: `${ids}-add-${i}`, role: "option", "aria-selected": i === litAt, className: "o-list-row o-smooth o-smooth-ease o-links-editor-add o-links-editor-action", "data-slot": "vk-links-offer-action", "data-key": a.key, ...phoneMark(small), "data-highlighted": i === litAt ? "" : undefined, onPointerMove: () => { if (!open && doing !== "searching" && i !== litAt)
323
323
  setLit(i); }, onMouseDown: (e) => e.preventDefault(), onClick: a.onSelect, children: [a.icon != null && _jsx("span", { className: "o-links-editor-action-mark", children: a.icon }), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: a.label }) })] }, a.key));
324
- })] }), more, message && _jsx("div", { className: "o-links-editor-message", children: message })] }), shown] }));
324
+ })] }), more, message && _jsx("div", { className: "o-links-editor-message", "data-slot": "vk-links-note", children: message })] }), shown] }));
325
325
  return { body, head: {} };
326
326
  }
327
327
  export function LinksEditor(props) {
@@ -0,0 +1,4 @@
1
+ export declare function MapMarkdown({ source, className }: {
2
+ source: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const KEEP_LINES = { whiteSpace: "pre-wrap", overflowWrap: "anywhere" };
3
+ export function MapMarkdown({ source, className }) {
4
+ return (_jsx("div", { className: className, style: KEEP_LINES, children: source }));
5
+ }
@@ -5,7 +5,7 @@ import type { MenuEntry } from "../menu-list/menu-list.js";
5
5
  * its row is a level in, its choices when its rows are ticks that close, its actions otherwise; a group in place is its rows
6
6
  * under its heading, a pick when they are ticks that close; a link and an action as they are. A row's detail, its value in
7
7
  * words, rides to a level's end and a choice's. Nothing here closes the menu: the Menu's rows close it as ViewKit's do. */
8
- export declare function menuEntries(items: ViewsMenuItem[], notNow?: string): MenuEntry[];
8
+ export declare function menuEntries(items: ViewsMenuItem[], notNow?: string, rowSlot?: string): MenuEntry[];
9
9
  /** ViewKit's menu, drawn as the Menu at its anchor with no trigger. Every menu ViewKit opens names itself; centred or unsaid,
10
10
  * it opens at its anchor's start. */
11
- export declare function MapMenu({ open, onOpenChange, anchor, items, side, align, label }: ViewsMenuProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function MapMenu({ open, onOpenChange, anchor, items, side, align, label, "data-slot": slot }: ViewsMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -4,17 +4,19 @@ import { resolveViewsMessage } from "../../contract.js";
4
4
  import { ViewsContext } from "../../provider/context.js";
5
5
  import { menuWordsOf } from "../picker/map-picker.js";
6
6
  import { Menu } from "./menu.js";
7
+ import { markOwnControl } from "../../provider/own-control.js";
7
8
  const NO_REASON = "Not now";
8
9
  const closingTick = (item) => item.checked !== undefined && !item.keepOpen && !item.children && !item.href && !item.disabled;
9
- function choiceOf(run) {
10
+ function choiceOf(run, rowSlot) {
10
11
  return {
11
12
  value: run.find((i) => i.checked)?.key ?? "",
12
- choices: run.map((i) => ({ value: i.key, label: i.label, mark: i.icon, ...(i.detail != null && { detail: i.detail }) })),
13
+ choices: run.map((i) => ({ value: i.key, label: i.label, mark: i.icon, ...(i.detail != null && { detail: i.detail }), ...named(rowSlot, i.key, i.slot) })),
13
14
  onChoose: (key) => run.find((i) => i.key === key)?.onSelect?.(),
14
15
  };
15
16
  }
17
+ const named = (rowSlot, key, own) => (own ? { slot: { slot: own, key } } : rowSlot ? { slot: { slot: rowSlot, key } } : {});
16
18
  const onlyTicks = (items) => (items.length > 0 && items.every(closingTick) && !items.slice(1).some((i) => i.separatorBefore) ? items : null);
17
- export function menuEntries(items, notNow = NO_REASON) {
19
+ export function menuEntries(items, notNow = NO_REASON, rowSlot) {
18
20
  const out = [];
19
21
  for (let at = 0; at < items.length;) {
20
22
  const item = items[at];
@@ -24,7 +26,7 @@ export function menuEntries(items, notNow = NO_REASON) {
24
26
  const run = [item];
25
27
  while (at + run.length < items.length && closingTick(items[at + run.length]) && !items[at + run.length].separatorBefore)
26
28
  run.push(items[at + run.length]);
27
- out.push({ kind: "pick", ...choiceOf(run) });
29
+ out.push({ kind: "pick", ...choiceOf(run, rowSlot) });
28
30
  at += run.length;
29
31
  continue;
30
32
  }
@@ -32,22 +34,23 @@ export function menuEntries(items, notNow = NO_REASON) {
32
34
  const ticks = item.children ? onlyTicks(item.children) : null;
33
35
  if (item.children && item.beside)
34
36
  out.push(ticks
35
- ? { kind: "choices", icon: item.icon ?? null, label: item.label, ...choiceOf(ticks), ...(item.detail != null && { detail: item.detail }) }
36
- : { kind: "actions", icon: item.icon ?? null, label: item.label, entries: menuEntries(item.children, notNow), ...(item.detail != null && { detail: item.detail }) });
37
+ ? { kind: "choices", icon: item.icon ?? null, label: item.label, ...choiceOf(ticks, rowSlot), ...(item.detail != null && { detail: item.detail }), ...named(rowSlot, item.key, item.slot) }
38
+ : { kind: "actions", icon: item.icon ?? null, label: item.label, entries: menuEntries(item.children, notNow, rowSlot), ...(item.detail != null && { detail: item.detail }), ...named(rowSlot, item.key, item.slot) });
37
39
  else if (item.children)
38
- out.push(ticks ? { kind: "pick", heading: item.label, ...choiceOf(ticks) } : { kind: "group", heading: item.label, entries: menuEntries(item.children, notNow) });
40
+ out.push(ticks ? { kind: "pick", heading: item.label, ...choiceOf(ticks, rowSlot) } : { kind: "group", heading: item.label, entries: menuEntries(item.children, notNow, rowSlot) });
39
41
  else if (item.checked !== undefined)
40
- out.push({ kind: "check", label: item.label, checked: item.checked, onCheckedChange: () => item.onSelect?.(), disabled: item.disabled ? item.disabledReason ?? notNow : undefined });
42
+ out.push({ kind: "check", label: item.label, ...(item.icon != null && { icon: item.icon }), checked: item.checked, onCheckedChange: () => item.onSelect?.(), disabled: item.disabled ? item.disabledReason ?? notNow : undefined, ...named(rowSlot, item.key, item.slot) });
41
43
  else if (item.href)
42
- out.push({ kind: "link", icon: item.icon ?? null, label: item.label, href: item.href, onSelect: () => item.onSelect?.() });
44
+ out.push({ kind: "link", icon: item.icon ?? null, label: item.label, href: item.href, onSelect: () => item.onSelect?.(), ...named(rowSlot, item.key, item.slot) });
43
45
  else
44
46
  out.push({ icon: item.icon ?? null, label: item.label, onSelect: item.onSelect, danger: item.destructive, disabled: item.disabled ? item.disabledReason ?? notNow : undefined,
45
- keys: item.shortcut ? [item.shortcut] : undefined });
47
+ keys: item.shortcut ? [item.shortcut] : undefined, ...(item.render && { body: item.render() }), ...named(rowSlot, item.key, item.slot) });
46
48
  }
47
49
  return out;
48
50
  }
49
- export function MapMenu({ open, onOpenChange, anchor, items, side, align, label }) {
51
+ export function MapMenu({ open, onOpenChange, anchor, items, side, align, label, "data-slot": slot }) {
50
52
  const say = React.useContext(ViewsContext)?.messages ?? resolveViewsMessage;
51
53
  const words = React.useMemo(() => menuWordsOf(say), [say]);
52
- return _jsx(Menu, { words: words, entries: menuEntries(items, say({ key: "views.menus.not-now" })), label: label ?? "", open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align === "center" || align === undefined ? "start" : align });
54
+ return _jsx(Menu, { words: words, entries: menuEntries(items, say({ key: "views.menus.not-now" }), slot ? `${slot}-row` : undefined), "data-slot": slot, label: label ?? "", open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align === "center" || align === undefined ? "start" : align });
53
55
  }
56
+ markOwnControl(MapMenu);
@@ -17,6 +17,8 @@ export interface MenuProps {
17
17
  words?: MenuWords;
18
18
  /** What the menu is for, to screen readers ("Acme Robotics — service portal redesign"). */
19
19
  label: string;
20
+ /** Its public name where a panel names it (VK-988: `vk-view-menu`), on its popup on a computer. */
21
+ "data-slot"?: string;
20
22
  /** What opens it: the ⋯ button by default (MenuDots), named "Actions for <label>". */
21
23
  trigger?: React.ReactElement;
22
24
  /** Where it opens when nothing of its own opens it: an element, a ref to one, or a point on the page (a right-click's),
@@ -44,7 +44,7 @@ function levelOf(entries, label) {
44
44
  }
45
45
  return undefined;
46
46
  }
47
- const pickerItems = (choices) => choices.map((c) => ({ value: c.value, label: c.label, line: c.detail, as: c.mark ? { mark: c.mark } : undefined }));
47
+ const pickerItems = (choices) => choices.map((c) => ({ value: c.value, label: c.label, line: c.detail, as: c.mark ? { mark: c.mark } : undefined, ...(c.slot ? { slot: c.slot } : {}) }));
48
48
  const NO_WORDS = {};
49
49
  const MenuWordsContext = React.createContext(NO_WORDS);
50
50
  function LevelPicker({ entry }) {
@@ -84,10 +84,10 @@ export function Menu(props) {
84
84
  return useSheetMenus() && !props.popup ? _jsx(MenuSheet, { ...props }) : _jsx(MenuPopup, { ...props });
85
85
  }
86
86
  export const useSheetMenus = () => { const phone = usePhone(), screen = React.useContext(PhoneHost); return phone || !!screen; };
87
- function MenuPopup({ entries, label, trigger, anchor, align = "end", side, open, defaultOpen, onOpenChange, finalFocus, standing }) {
87
+ function MenuPopup({ entries, label, trigger, anchor, align = "end", side, open, defaultOpen, onOpenChange, finalFocus, standing, "data-slot": slot }) {
88
88
  const { ref, host } = usePickHost(), anchored = anchor !== undefined, point = !!anchor && !isElement(anchor) && !("current" in anchor);
89
89
  const [at, setAt] = React.useState(null), mark = phoneMark(usePhoneForm());
90
- return (_jsxs(BaseMenu.Root, { open: open, defaultOpen: defaultOpen, modal: !standing, onOpenChange: onOpenChange ? (o, d) => onOpenChange(o, { reason: closeReasonOf(d.reason) }) : undefined, children: [_jsx("span", { ref: ref, hidden: true }), !anchored && _jsx(BaseMenu.Trigger, { render: trigger ?? _jsx(MenuDots, { label: `Actions for ${label}` }) }), _jsx(BaseMenu.Portal, { container: host, className: "o-menu-portal", children: _jsx(BaseMenu.Positioner, { ref: setAt, className: "o-list-positioner", sideOffset: point ? 0 : spacingPx(1, at ?? host), side: side, align: align, collisionPadding: spacingPx(2, at ?? host), anchor: anchored ? positionerAnchor(anchor) : undefined, children: _jsx(BaseMenu.Popup, { className: "o-list o-menu o-smooth o-smooth-ease", "aria-label": label, "data-kit": "menu", ...mark, finalFocus: finalFocus, children: _jsx(MenuScroll, { children: _jsx(MenuListRows, { entries: entries, host: host }) }) }) }) })] }));
90
+ return (_jsxs(BaseMenu.Root, { open: open, defaultOpen: defaultOpen, modal: !standing, onOpenChange: onOpenChange ? (o, d) => onOpenChange(o, { reason: closeReasonOf(d.reason) }) : undefined, children: [_jsx("span", { ref: ref, hidden: true }), !anchored && _jsx(BaseMenu.Trigger, { render: trigger ?? _jsx(MenuDots, { label: `Actions for ${label}` }) }), _jsx(BaseMenu.Portal, { container: host, className: "o-menu-portal", children: _jsx(BaseMenu.Positioner, { ref: setAt, className: "o-list-positioner", sideOffset: point ? 0 : spacingPx(1, at ?? host), side: side, align: align, collisionPadding: spacingPx(2, at ?? host), anchor: anchored ? positionerAnchor(anchor) : undefined, children: _jsx(BaseMenu.Popup, { className: "o-list o-menu o-smooth o-smooth-ease", "aria-label": label, "data-slot": slot, "data-kit": "menu", ...mark, finalFocus: finalFocus, children: _jsx(MenuScroll, { children: _jsx(MenuListRows, { entries: entries, host: host }) }) }) }) })] }));
91
91
  }
92
92
  export function ContextMenu(props) {
93
93
  return useSheetMenus() ? _jsx(ContextMenuSheet, { ...props }) : _jsx(ContextMenuPopup, { ...props });