@fusion.dev/helix-headless 0.144.0 → 0.146.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 (319) hide show
  1. package/custom-elements.json +15195 -4240
  2. package/dist/accordion/item/accordion-item.d.ts +62 -12
  3. package/dist/accordion/item/accordion-item.js +41 -10
  4. package/dist/accordion/root/accordion-root.d.ts +14 -5
  5. package/dist/accordion/root/accordion-root.js +7 -1
  6. package/dist/announcement/root/announcement-root.d.ts +24 -3
  7. package/dist/announcement/root/announcement-root.js +39 -2
  8. package/dist/app-header/root/app-header-root.d.ts +12 -0
  9. package/dist/app-header/root/app-header-root.js +13 -1
  10. package/dist/app-header/sectioning.d.ts +9 -0
  11. package/dist/app-header/sectioning.js +27 -0
  12. package/dist/avatar/group/avatar-group.d.ts +20 -14
  13. package/dist/avatar/group/avatar-group.js +17 -19
  14. package/dist/badge/root/badge-root.d.ts +3 -1
  15. package/dist/badge/root/badge-root.js +2 -2
  16. package/dist/bar-chart/root/bar-chart-root.d.ts +18 -1
  17. package/dist/bar-chart/root/bar-chart-root.js +52 -15
  18. package/dist/bar-chart/stack.d.ts +15 -0
  19. package/dist/bar-chart/stack.js +19 -0
  20. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +57 -1
  21. package/dist/breadcrumbs/root/breadcrumbs-root.js +73 -3
  22. package/dist/button/root/button-root.d.ts +26 -0
  23. package/dist/button/root/button-root.js +38 -18
  24. package/dist/button-group/root/button-group-root.d.ts +2 -1
  25. package/dist/button-group/root/button-group-root.js +5 -1
  26. package/dist/canvas/node/canvas-node.d.ts +4 -3
  27. package/dist/canvas/node/canvas-node.js +3 -2
  28. package/dist/canvas/root/canvas-root.d.ts +38 -3
  29. package/dist/canvas/root/canvas-root.js +123 -42
  30. package/dist/card/root/card-root.d.ts +24 -3
  31. package/dist/card/root/card-root.js +20 -8
  32. package/dist/carousel/root/carousel-root.d.ts +133 -4
  33. package/dist/carousel/root/carousel-root.js +174 -24
  34. package/dist/carousel/stops.d.ts +20 -0
  35. package/dist/carousel/stops.js +30 -0
  36. package/dist/chat/composer/chat-composer.d.ts +38 -6
  37. package/dist/chat/composer/chat-composer.js +42 -9
  38. package/dist/chat/message/chat-message.d.ts +32 -1
  39. package/dist/chat/message/chat-message.js +27 -10
  40. package/dist/chat/naming.d.ts +26 -0
  41. package/dist/chat/naming.js +14 -0
  42. package/dist/chat/root/chat-root.d.ts +58 -0
  43. package/dist/chat/root/chat-root.js +43 -3
  44. package/dist/checkbox/root/checkbox-root.d.ts +20 -0
  45. package/dist/checkbox/root/checkbox-root.js +14 -1
  46. package/dist/checkbox-group/root/checkbox-group-root.d.ts +8 -2
  47. package/dist/checkbox-group/root/checkbox-group-root.js +12 -10
  48. package/dist/checkbox-group/select-all.d.ts +27 -0
  49. package/dist/checkbox-group/select-all.js +12 -0
  50. package/dist/code-block/highlight.d.ts +15 -0
  51. package/dist/code-block/highlight.js +4 -0
  52. package/dist/code-block/root/code-block-root.d.ts +57 -2
  53. package/dist/code-block/root/code-block-root.js +63 -8
  54. package/dist/color-input/root/color-input-root.d.ts +3 -0
  55. package/dist/color-input/root/color-input-root.js +6 -3
  56. package/dist/color-picker/root/color-picker-root.d.ts +33 -4
  57. package/dist/color-picker/root/color-picker-root.js +80 -21
  58. package/dist/color-picker/swatches.d.ts +12 -0
  59. package/dist/color-picker/swatches.js +26 -0
  60. package/dist/combobox/root/combobox-root.d.ts +43 -0
  61. package/dist/combobox/root/combobox-root.js +79 -15
  62. package/dist/command/root/command-root.d.ts +16 -1
  63. package/dist/command/root/command-root.js +22 -4
  64. package/dist/copy-button/root/copy-button-root.d.ts +26 -1
  65. package/dist/copy-button/root/copy-button-root.js +12 -5
  66. package/dist/data-table/index.d.ts +1 -1
  67. package/dist/data-table/index.js +1 -1
  68. package/dist/data-table/keys.d.ts +24 -0
  69. package/dist/data-table/keys.js +24 -0
  70. package/dist/data-table/root/data-table-root.d.ts +170 -13
  71. package/dist/data-table/root/data-table-root.js +294 -52
  72. package/dist/data-table/tree.d.ts +55 -0
  73. package/dist/data-table/tree.js +54 -0
  74. package/dist/date-input/root/date-input-root.d.ts +3 -1
  75. package/dist/date-input/root/date-input-root.js +18 -7
  76. package/dist/date-picker/root/date-picker-root.js +12 -6
  77. package/dist/description-list/item/description-list-item.d.ts +17 -2
  78. package/dist/description-list/item/description-list-item.js +15 -2
  79. package/dist/description-list/root/description-list-root.d.ts +27 -1
  80. package/dist/description-list/root/description-list-root.js +26 -1
  81. package/dist/dialog/description.js +15 -1
  82. package/dist/dialog/root/dialog-root.d.ts +8 -2
  83. package/dist/dialog/root/dialog-root.js +16 -1
  84. package/dist/divider/root/divider-root.d.ts +3 -0
  85. package/dist/divider/root/divider-root.js +2 -1
  86. package/dist/donut-chart/root/donut-chart-root.d.ts +31 -0
  87. package/dist/donut-chart/root/donut-chart-root.js +48 -1
  88. package/dist/drawer/reveal.d.ts +8 -0
  89. package/dist/drawer/reveal.js +1 -0
  90. package/dist/drawer/root/drawer-root.d.ts +59 -0
  91. package/dist/drawer/root/drawer-root.js +63 -4
  92. package/dist/drilldown/item/drilldown-item.d.ts +11 -6
  93. package/dist/drilldown/item/drilldown-item.js +8 -5
  94. package/dist/drilldown/root/drilldown-root.d.ts +29 -0
  95. package/dist/drilldown/root/drilldown-root.js +28 -5
  96. package/dist/element-events.generated.js +83 -12
  97. package/dist/empty/root/empty-root.d.ts +3 -1
  98. package/dist/empty/root/empty-root.js +3 -2
  99. package/dist/file-input/root/file-input-root.d.ts +69 -6
  100. package/dist/file-input/root/file-input-root.js +82 -19
  101. package/dist/file-input/screen.d.ts +2 -1
  102. package/dist/filter-input/menu/filter-menu.d.ts +5 -0
  103. package/dist/filter-input/menu/filter-menu.js +16 -4
  104. package/dist/filter-input/root/filter-input-root.d.ts +30 -6
  105. package/dist/filter-input/root/filter-input-root.js +1 -1
  106. package/dist/filter-input/suggest.d.ts +28 -3
  107. package/dist/filter-input/suggest.js +18 -8
  108. package/dist/format-date/root/format-date-root.d.ts +9 -16
  109. package/dist/format-date/root/format-date-root.js +10 -27
  110. package/dist/heatmap/root/heatmap-root.d.ts +24 -13
  111. package/dist/heatmap/root/heatmap-root.js +34 -12
  112. package/dist/icon/root/icon-root.d.ts +12 -1
  113. package/dist/icon/root/icon-root.js +21 -10
  114. package/dist/icon/settle.d.ts +7 -0
  115. package/dist/icon/settle.js +10 -0
  116. package/dist/icon-button/root/icon-button-root.d.ts +2 -0
  117. package/dist/image/root/image-root.d.ts +5 -1
  118. package/dist/image/root/image-root.js +10 -2
  119. package/dist/input/root/input-root.d.ts +13 -3
  120. package/dist/input/root/input-root.js +12 -3
  121. package/dist/kbd/root/kbd-root.d.ts +35 -1
  122. package/dist/kbd/root/kbd-root.js +23 -4
  123. package/dist/legend/root/legend-root.d.ts +55 -8
  124. package/dist/legend/root/legend-root.js +55 -13
  125. package/dist/lightbox/root/lightbox-root.d.ts +49 -6
  126. package/dist/lightbox/root/lightbox-root.js +86 -19
  127. package/dist/lightbox/zoom-controller.d.ts +59 -0
  128. package/dist/lightbox/zoom-controller.js +128 -0
  129. package/dist/lightbox/zoom.d.ts +22 -0
  130. package/dist/lightbox/zoom.js +16 -0
  131. package/dist/line-chart/root/line-chart-root.d.ts +22 -1
  132. package/dist/line-chart/root/line-chart-root.js +21 -1
  133. package/dist/list/item/list-item.d.ts +70 -1
  134. package/dist/list/item/list-item.js +77 -6
  135. package/dist/list/numbering.d.ts +14 -0
  136. package/dist/list/numbering.js +8 -0
  137. package/dist/list/root/list-root.d.ts +155 -9
  138. package/dist/list/root/list-root.js +246 -4
  139. package/dist/list/selection.d.ts +49 -0
  140. package/dist/list/selection.js +30 -0
  141. package/dist/listbox/root/listbox-root.d.ts +37 -1
  142. package/dist/listbox/root/listbox-root.js +49 -4
  143. package/dist/loader/busy.d.ts +10 -0
  144. package/dist/loader/busy.js +11 -0
  145. package/dist/loader/root/loader-root.d.ts +9 -2
  146. package/dist/loader/root/loader-root.js +23 -3
  147. package/dist/map/root/map-root.d.ts +6 -2
  148. package/dist/map/root/map-root.js +5 -2
  149. package/dist/megamenu/root/megamenu-root.d.ts +62 -0
  150. package/dist/megamenu/root/megamenu-root.js +90 -5
  151. package/dist/menu/index.d.ts +1 -0
  152. package/dist/menu/index.js +1 -0
  153. package/dist/menu/item/menu-item.d.ts +87 -11
  154. package/dist/menu/item/menu-item.js +78 -22
  155. package/dist/menu/root/menu-root.d.ts +39 -1
  156. package/dist/menu/root/menu-root.js +65 -8
  157. package/dist/menu/section/menu-section.d.ts +55 -0
  158. package/dist/menu/section/menu-section.js +60 -0
  159. package/dist/meter/root/meter-root.d.ts +20 -1
  160. package/dist/meter/root/meter-root.js +11 -15
  161. package/dist/navigation/root/navigation-root.d.ts +18 -2
  162. package/dist/navigation/root/navigation-root.js +29 -3
  163. package/dist/notifications/root/notifications-root.d.ts +25 -0
  164. package/dist/notifications/root/notifications-root.js +33 -5
  165. package/dist/number-input/root/number-input-root.d.ts +17 -8
  166. package/dist/number-input/root/number-input-root.js +2 -7
  167. package/dist/object-inspector/root/object-inspector-root.d.ts +161 -32
  168. package/dist/object-inspector/root/object-inspector-root.js +264 -123
  169. package/dist/object-inspector/rows.d.ts +75 -0
  170. package/dist/object-inspector/rows.js +119 -0
  171. package/dist/option/root/option-root.d.ts +5 -3
  172. package/dist/outline/levels.d.ts +31 -0
  173. package/dist/outline/levels.js +23 -0
  174. package/dist/outline/root/outline-root.d.ts +86 -3
  175. package/dist/outline/root/outline-root.js +95 -12
  176. package/dist/pagination/size/pagination-size.d.ts +12 -2
  177. package/dist/pagination/size/pagination-size.js +20 -5
  178. package/dist/pin-input/code.d.ts +10 -0
  179. package/dist/pin-input/code.js +13 -0
  180. package/dist/pin-input/root/pin-input-root.d.ts +25 -1
  181. package/dist/pin-input/root/pin-input-root.js +10 -11
  182. package/dist/popover/hide-outside.d.ts +14 -0
  183. package/dist/popover/hide-outside.js +41 -0
  184. package/dist/popover/root/popover-root.d.ts +57 -7
  185. package/dist/popover/root/popover-root.js +58 -3
  186. package/dist/progress/root/progress-root.d.ts +20 -0
  187. package/dist/progress/root/progress-root.js +15 -15
  188. package/dist/qr-code/export.d.ts +26 -1
  189. package/dist/qr-code/export.js +14 -0
  190. package/dist/qr-code/root/qr-code-root.d.ts +19 -5
  191. package/dist/qr-code/root/qr-code-root.js +58 -9
  192. package/dist/quote/marks.d.ts +8 -0
  193. package/dist/quote/marks.js +5 -0
  194. package/dist/quote/root/quote-root.d.ts +14 -2
  195. package/dist/quote/root/quote-root.js +23 -1
  196. package/dist/radio/group/radio-group.d.ts +4 -10
  197. package/dist/radio/group/radio-group.js +5 -10
  198. package/dist/radio/root/radio-root.d.ts +6 -2
  199. package/dist/radio/root/radio-root.js +6 -1
  200. package/dist/rating/root/rating-root.d.ts +10 -5
  201. package/dist/rating/root/rating-root.js +32 -8
  202. package/dist/rating/steps.d.ts +7 -0
  203. package/dist/rating/steps.js +9 -0
  204. package/dist/scatter-chart/fit.d.ts +15 -0
  205. package/dist/scatter-chart/fit.js +35 -0
  206. package/dist/scatter-chart/root/scatter-chart-root.d.ts +21 -1
  207. package/dist/scatter-chart/root/scatter-chart-root.js +30 -17
  208. package/dist/scroll-area/root/scroll-area-root.d.ts +84 -0
  209. package/dist/scroll-area/root/scroll-area-root.js +106 -7
  210. package/dist/scroll-area/scrollbar-controller.d.ts +111 -0
  211. package/dist/scroll-area/scrollbar-controller.js +172 -0
  212. package/dist/scroll-area/scrollbar.d.ts +92 -0
  213. package/dist/scroll-area/scrollbar.js +33 -0
  214. package/dist/select/root/select-root.d.ts +15 -0
  215. package/dist/select/root/select-root.js +18 -6
  216. package/dist/skeleton/root/skeleton-root.d.ts +3 -0
  217. package/dist/skeleton/root/skeleton-root.js +4 -2
  218. package/dist/skip-link/root/skip-link-root.js +2 -2
  219. package/dist/slider/root/slider-root.d.ts +41 -4
  220. package/dist/slider/root/slider-root.js +23 -3
  221. package/dist/sparkline/readings.d.ts +18 -0
  222. package/dist/sparkline/readings.js +19 -0
  223. package/dist/sparkline/root/sparkline-root.d.ts +78 -7
  224. package/dist/sparkline/root/sparkline-root.js +118 -23
  225. package/dist/speed-dial/root/speed-dial-root.js +2 -2
  226. package/dist/splitter/root/splitter-root.d.ts +20 -12
  227. package/dist/splitter/root/splitter-root.js +226 -203
  228. package/dist/splitter/snap.d.ts +9 -0
  229. package/dist/splitter/snap.js +12 -0
  230. package/dist/stat/root/stat-root.d.ts +14 -5
  231. package/dist/stat/root/stat-root.js +21 -5
  232. package/dist/steps/reach.d.ts +20 -0
  233. package/dist/steps/reach.js +15 -0
  234. package/dist/steps/root/steps-root.d.ts +76 -0
  235. package/dist/steps/root/steps-root.js +93 -1
  236. package/dist/steps/step/step.d.ts +45 -2
  237. package/dist/steps/step/step.js +33 -6
  238. package/dist/switch/root/switch-root.d.ts +10 -0
  239. package/dist/table/column/table-column.d.ts +11 -10
  240. package/dist/table/column/table-column.js +8 -19
  241. package/dist/table/root/table-root.d.ts +126 -4
  242. package/dist/table/root/table-root.js +156 -6
  243. package/dist/table/row/table-row.d.ts +47 -1
  244. package/dist/table/row/table-row.js +39 -2
  245. package/dist/tabs/panel/tab-panel.d.ts +22 -5
  246. package/dist/tabs/panel/tab-panel.js +34 -6
  247. package/dist/tabs/root/tabs-root.d.ts +37 -1
  248. package/dist/tabs/root/tabs-root.js +22 -4
  249. package/dist/tabs/tab/tab.d.ts +41 -4
  250. package/dist/tabs/tab/tab.js +49 -3
  251. package/dist/tag/group/tag-group.d.ts +31 -4
  252. package/dist/tag/group/tag-group.js +46 -7
  253. package/dist/tag/root/tag-root.js +9 -2
  254. package/dist/textarea/root/textarea-root.d.ts +28 -1
  255. package/dist/textarea/root/textarea-root.js +40 -1
  256. package/dist/time-input/root/time-input-root.d.ts +5 -1
  257. package/dist/time-input/root/time-input-root.js +16 -8
  258. package/dist/time-picker/root/time-picker-root.d.ts +18 -4
  259. package/dist/time-picker/root/time-picker-root.js +7 -10
  260. package/dist/time-picker/wheel-name.d.ts +9 -0
  261. package/dist/time-picker/wheel-name.js +15 -0
  262. package/dist/timeline/group/timeline-group.d.ts +46 -0
  263. package/dist/timeline/group/timeline-group.js +37 -0
  264. package/dist/timeline/index.d.ts +1 -0
  265. package/dist/timeline/index.js +1 -0
  266. package/dist/timeline/root/timeline-root.d.ts +10 -3
  267. package/dist/toast/item/toast-item.d.ts +24 -18
  268. package/dist/toast/item/toast-item.js +36 -40
  269. package/dist/toast/root/toast-root.d.ts +6 -0
  270. package/dist/toast/root/toast-root.js +16 -1
  271. package/dist/toggle/group/toggle-group.d.ts +24 -3
  272. package/dist/toggle/group/toggle-group.js +34 -5
  273. package/dist/toolbar/root/toolbar-root.d.ts +13 -0
  274. package/dist/toolbar/root/toolbar-root.js +15 -5
  275. package/dist/tooltip/root/tooltip-root.d.ts +13 -2
  276. package/dist/tooltip/root/tooltip-root.js +9 -1
  277. package/dist/tour/back.d.ts +10 -0
  278. package/dist/tour/back.js +8 -0
  279. package/dist/tour/root/tour-root.d.ts +30 -2
  280. package/dist/tour/root/tour-root.js +34 -8
  281. package/dist/tree/item/tree-item.d.ts +61 -4
  282. package/dist/tree/item/tree-item.js +92 -20
  283. package/dist/tree/root/tree-root.d.ts +58 -0
  284. package/dist/tree/root/tree-root.js +80 -16
  285. package/dist/tree/selection.d.ts +24 -0
  286. package/dist/tree/selection.js +13 -0
  287. package/dist/trend/root/trend-root.d.ts +43 -18
  288. package/dist/trend/root/trend-root.js +31 -6
  289. package/dist/video/media-events.d.ts +44 -0
  290. package/dist/video/media-events.js +35 -0
  291. package/dist/video/root/video-root.d.ts +117 -18
  292. package/dist/video/root/video-root.js +93 -47
  293. package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
  294. package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
  295. package/dist/video-playlist/order.d.ts +41 -0
  296. package/dist/video-playlist/order.js +34 -0
  297. package/dist/video-playlist/root/video-playlist-root.d.ts +77 -3
  298. package/dist/video-playlist/root/video-playlist-root.js +60 -16
  299. package/dist/virtual-list/controls.d.ts +4 -0
  300. package/dist/virtual-list/controls.js +30 -0
  301. package/dist/virtual-list/fill.d.ts +22 -0
  302. package/dist/virtual-list/fill.js +23 -0
  303. package/dist/virtual-list/keys.d.ts +15 -0
  304. package/dist/virtual-list/keys.js +24 -0
  305. package/dist/virtual-list/plan.d.ts +49 -0
  306. package/dist/virtual-list/plan.js +16 -0
  307. package/dist/virtual-list/root/virtual-list-root.d.ts +259 -26
  308. package/dist/virtual-list/root/virtual-list-root.js +333 -49
  309. package/lint.json +1 -1
  310. package/package.json +8 -8
  311. package/types/jsx.d.ts +8113 -1394
  312. package/types/svelte.d.ts +2 -0
  313. package/types/vue.d.ts +1678 -353
  314. package/dist/data-table/root/order.d.ts +0 -141
  315. package/dist/data-table/root/order.js +0 -76
  316. package/dist/listbox/range.d.ts +0 -17
  317. package/dist/listbox/range.js +0 -5
  318. package/dist/tag/selection.d.ts +0 -10
  319. package/dist/tag/selection.js +0 -12
@@ -5,22 +5,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  var HelixHeadlessObjectInspector_1;
8
- import { AriaForwardController, CopyController, customElement, elementById, fillTemplate, formatNumbers, HelixElement, inlineStep, scrollItemIntoView, searchableById, VirtualizeController, } from '@fusion.dev/helix-core';
8
+ import { AriaForwardController, CopyController, countLabel, customElement, drawStatus, elementById, fillTemplate, formatNumbers, HelixActivateEvent, HelixBeforeActivateEvent, HelixBeforeCloseEvent, HelixBeforeOpenEvent, HelixElement, HelixFilterEvent, HelixFilteredEvent, inlineStep, requestChange, StatusController, scrollItemIntoView, searchableById, treeArrow, VirtualizeController, } from '@fusion.dev/helix-core';
9
9
  import { caretDown, caretRight } from '@fusion.dev/helix-icons';
10
10
  import { html, nothing } from 'lit';
11
11
  import { property, state } from 'lit/decorators.js';
12
+ import { repeat } from 'lit/directives/repeat.js';
12
13
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
13
14
  import { html as staticHtml } from 'lit/static-html.js';
14
15
  import '../../copy-button/index.js';
15
- const branchy = (value) => value !== null && typeof value === 'object';
16
- const entries = (value) => Array.isArray(value) ? value.map((item, at) => [String(at), item]) : Object.entries(value);
17
- const child = (path, key) => `${path}/${key.replaceAll('~', '~0').replaceAll('/', '~1')}`;
16
+ import { cursorFor, entries, flatten, search, seed, siblingBranches, withAncestors, } from '../rows.js';
18
17
  let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends HelixElement {
19
18
  constructor() {
20
19
  super(...arguments);
21
20
  this.copyLabel = 'Copy {name}';
22
21
  this.copyValueLabel = 'Copy value';
23
22
  this.defaultDepth = 1;
23
+ this.filter = '';
24
+ this.filterable = false;
25
+ this.filterLabel = 'Filter';
24
26
  this.for = '';
25
27
  this.itemLabel = '{count} item';
26
28
  this.itemsLabel = '{count} items';
@@ -28,19 +30,24 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
28
30
  this.keysLabel = '{count} keys';
29
31
  this.label = '';
30
32
  this.noCopy = false;
33
+ this.resultLabel = '{count} result';
34
+ this.resultsLabel = '{count} results';
31
35
  this.treeLabel = 'Value';
32
36
  this.value = undefined;
33
37
  this.windowed = false;
34
38
  this.read = undefined;
35
39
  this.opened = new Set();
36
- this.active = 0;
40
+ this.cursor = 0;
37
41
  this.revealing = false;
42
+ this.focusing = false;
43
+ this.hadFocus = false;
38
44
  this.typed = { at: 0, text: '' };
39
45
  this.branches = new Set();
40
46
  this.aria = new AriaForwardController(this, {
41
47
  label: true,
42
48
  target: () => this.partNamed('tree'),
43
49
  });
50
+ this.status = new StatusController(this);
44
51
  this.virtualize = new VirtualizeController(this, {
45
52
  container: () => (this.windowed ? this.partNamed('tree') : null),
46
53
  count: () => this.rows.length,
@@ -52,7 +59,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
52
59
  this.copier = new CopyController(this);
53
60
  this.handleKeydown = (event) => {
54
61
  const rows = this.rows;
55
- const row = rows[this.active];
62
+ const row = rows[this.cursor];
56
63
  if (!row) {
57
64
  return;
58
65
  }
@@ -66,10 +73,10 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
66
73
  }
67
74
  switch (event.key) {
68
75
  case 'ArrowDown':
69
- this.move(this.active + 1);
76
+ this.move(this.cursor + 1);
70
77
  break;
71
78
  case 'ArrowUp':
72
- this.move(this.active - 1);
79
+ this.move(this.cursor - 1);
73
80
  break;
74
81
  case 'Home':
75
82
  this.move(0);
@@ -79,22 +86,23 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
79
86
  break;
80
87
  case 'ArrowRight':
81
88
  case 'ArrowLeft':
82
- if (inlineStep(this, event.key) === 1) {
83
- if (row.branch && !row.open) {
84
- this.toggle(row, true);
85
- }
86
- else if (row.open) {
87
- this.move(this.active + 1);
88
- }
89
- }
90
- else if (row.open) {
91
- this.toggle(row, false);
92
- }
93
- else {
94
- const parent = rows.findLastIndex((candidate, at) => at < this.active && candidate.depth === row.depth - 1);
95
- if (parent >= 0) {
96
- this.move(parent);
89
+ switch (treeArrow(row, inlineStep(this, event.key) === 1 ? 1 : -1)) {
90
+ case 'open':
91
+ case 'close':
92
+ this.toggle(row, !row.open);
93
+ break;
94
+ case 'child':
95
+ this.move(this.cursor + 1);
96
+ break;
97
+ case 'parent': {
98
+ const parent = rows.findLastIndex((candidate, at) => at < this.cursor && candidate.depth === row.depth - 1);
99
+ if (parent >= 0) {
100
+ this.move(parent);
101
+ }
102
+ break;
97
103
  }
104
+ default:
105
+ break;
98
106
  }
99
107
  break;
100
108
  case 'Enter':
@@ -104,7 +112,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
104
112
  }
105
113
  break;
106
114
  case '*':
107
- this.openSiblings(row);
115
+ this.requestOpen(siblingBranches(rows, row), true);
108
116
  break;
109
117
  default:
110
118
  if (event.key.length !== 1 || event.altKey || event.ctrlKey || event.metaKey) {
@@ -114,80 +122,115 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
114
122
  }
115
123
  event.preventDefault();
116
124
  };
117
- }
118
- static { HelixHeadlessObjectInspector_1 = this; }
119
- static { this.ESTIMATE = 24; }
120
- get root() {
121
- return this.value === undefined ? this.read : this.value;
122
- }
123
- flatten() {
124
- const rows = [];
125
- if (this.root === undefined) {
126
- return rows;
127
- }
128
- const visit = (value, path, depth, position, siblings, key) => {
129
- const branch = branchy(value);
130
- const open = branch && this.opened.has(path);
131
- rows.push({
132
- branch,
133
- depth,
134
- open,
135
- path,
136
- position,
137
- siblings,
138
- value,
139
- ...(key === undefined ? {} : { key }),
125
+ this.handleFilterInput = (event) => {
126
+ const field = event.currentTarget;
127
+ const applied = requestChange({
128
+ apply: (value) => {
129
+ this.filter = value;
130
+ },
131
+ event: (value) => new HelixFilterEvent({ value }),
132
+ host: this,
133
+ next: field.value,
140
134
  });
141
- if (open) {
142
- const children = entries(value);
143
- children.forEach(([name, item], at) => {
144
- visit(item, child(path, name), depth + 1, at + 1, children.length, name);
145
- });
135
+ if (applied) {
136
+ this.dispatchEvent(new HelixFilteredEvent({ value: field.value }));
137
+ }
138
+ else {
139
+ field.value = this.filter;
146
140
  }
147
141
  };
148
- visit(this.root, '', 0, 1, 1);
149
- return rows;
150
- }
151
- seed(keep) {
152
- const opened = new Set();
153
- const branches = new Set();
154
- const visit = (value, path, depth) => {
155
- if (!branchy(value)) {
156
- return;
142
+ this.handleFilterKeydown = (event) => {
143
+ if (event.key === 'ArrowDown' && this.rows.length > 0) {
144
+ event.preventDefault();
145
+ this.revealing = true;
146
+ this.focusing = true;
147
+ this.requestUpdate();
157
148
  }
158
- branches.add(path);
159
- const known = keep && this.branches.has(path);
160
- if (known ? this.opened.has(path) : depth < this.defaultDepth) {
161
- opened.add(path);
149
+ };
150
+ this.handleFocusIn = (event) => {
151
+ const index = Number(event.target.dataset?.index);
152
+ if (Number.isInteger(index) && index !== this.cursor) {
153
+ this.move(index);
162
154
  }
163
- for (const [name, item] of entries(value)) {
164
- visit(item, child(path, name), depth + 1);
155
+ };
156
+ this.handleFocusOut = () => {
157
+ if (this.windowed) {
158
+ this.requestUpdate();
165
159
  }
166
160
  };
167
- visit(this.root, '', 0);
161
+ }
162
+ static { HelixHeadlessObjectInspector_1 = this; }
163
+ get active() {
164
+ return this.wanted ?? this.rows[this.cursor]?.path ?? '';
165
+ }
166
+ set active(path) {
167
+ const previous = this.active;
168
+ this.wanted = path;
169
+ this.requestUpdate('active', previous);
170
+ }
171
+ get expanded() {
172
+ return [...this.opened];
173
+ }
174
+ set expanded(paths) {
175
+ const previous = this.expanded;
176
+ this.declared = new Set(paths);
177
+ this.opened = this.declared;
178
+ this.requestUpdate('expanded', previous);
179
+ }
180
+ static { this.ESTIMATE = 24; }
181
+ get root() {
182
+ return this.value === undefined ? this.read : this.value;
183
+ }
184
+ seed(keep) {
185
+ const { branches, opened } = seed(this.root, this.defaultDepth, keep ? this.branches : undefined, this.opened);
168
186
  this.branches = branches;
169
187
  this.opened = opened;
170
188
  if (!keep) {
171
- this.active = 0;
189
+ this.cursor = 0;
172
190
  }
173
191
  }
192
+ openAround(paths) {
193
+ this.opened = withAncestors(this.opened, this.branches, paths);
194
+ }
174
195
  willUpdate(changed) {
175
196
  super.willUpdate(changed);
197
+ this.hadFocus = this.hasFocusedRow();
176
198
  if (this.loadedFor !== this.for && searchableById(this) && !this.hydrating) {
177
199
  this.loadedFor = this.for;
178
200
  this.load();
179
201
  }
180
- const was = this.rows[this.active]?.path;
181
- if (changed.has('value') || changed.has('read') || changed.has('defaultDepth')) {
202
+ const was = this.rows[this.cursor]?.path;
203
+ const written = this.declared;
204
+ this.declared = undefined;
205
+ const fresh = changed.has('value') || changed.has('read');
206
+ if (fresh || changed.has('defaultDepth')) {
182
207
  this.seed(!changed.has('defaultDepth'));
183
208
  }
184
- if (changed.has('value') ||
185
- changed.has('read') ||
186
- changed.has('opened') ||
187
- changed.has('defaultDepth')) {
188
- this.rows = this.flatten();
189
- const found = was === undefined ? -1 : this.rows.findIndex((row) => row.path === was);
190
- this.active = found >= 0 ? found : Math.min(this.active, Math.max(0, this.rows.length - 1));
209
+ if (written) {
210
+ this.opened = written;
211
+ }
212
+ if (fresh || changed.has('filter')) {
213
+ this.found = this.filter.trim() === '' ? undefined : search(this.root, this.filter);
214
+ this.openAround(this.found ?? []);
215
+ }
216
+ const wanted = this.root === undefined ? undefined : this.wanted;
217
+ if (wanted !== undefined) {
218
+ this.wanted = undefined;
219
+ this.openAround([wanted]);
220
+ }
221
+ if (fresh ||
222
+ wanted !== undefined ||
223
+ ['active', 'defaultDepth', 'expanded', 'filter', 'opened'].some((name) => changed.has(name))) {
224
+ this.rows = flatten(this.root, this.opened, this.found);
225
+ this.cursor = cursorFor(this.rows, wanted ?? was, this.cursor, changed.has('filter'));
226
+ }
227
+ if (changed.has('filter') && this.hasUpdated) {
228
+ this.tell();
229
+ }
230
+ }
231
+ tell() {
232
+ if (this.found) {
233
+ this.status.say(countLabel(this.found.size, this.resultLabel, this.resultsLabel, this.lang));
191
234
  }
192
235
  }
193
236
  firstUpdated(changed) {
@@ -203,6 +246,19 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
203
246
  this.revealing = false;
204
247
  this.reveal();
205
248
  }
249
+ const lost = this.hadFocus &&
250
+ !this.hasFocusedRow() &&
251
+ this.ownerDocument.activeElement === this.ownerDocument.body;
252
+ if (this.focusing || lost) {
253
+ this.focusing = false;
254
+ this.focusActive();
255
+ }
256
+ }
257
+ focusActive() {
258
+ const row = this.partNamed('tree')?.querySelector(`[data-index="${this.cursor}"]`);
259
+ if (row && this.shadowRoot?.activeElement !== row) {
260
+ row.focus({ preventScroll: true });
261
+ }
206
262
  }
207
263
  load() {
208
264
  const text = this.for === '' ? '' : (elementById(this, this.for)?.textContent ?? '');
@@ -215,7 +271,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
215
271
  }
216
272
  reveal(attempts = 8) {
217
273
  const tree = this.partNamed('tree');
218
- const row = tree?.querySelector(`[data-index="${this.active}"]`);
274
+ const row = tree?.querySelector(`[data-index="${this.cursor}"]`);
219
275
  if (row) {
220
276
  scrollItemIntoView(row);
221
277
  return;
@@ -227,10 +283,13 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
227
283
  return;
228
284
  }
229
285
  const height = first.offsetHeight || HelixHeadlessObjectInspector_1.ESTIMATE;
230
- const from = Number(this.active > Number(last.dataset.index) ? last.dataset.index : first.dataset.index);
231
- tree.scrollTop += (this.active - from) * height;
286
+ const from = Number(this.cursor > Number(last.dataset.index) ? last.dataset.index : first.dataset.index);
287
+ tree.scrollTop += (this.cursor - from) * height;
232
288
  this.virtualize.measure();
233
- void this.updateComplete.then(() => this.reveal(attempts - 1));
289
+ void this.updateComplete.then(() => {
290
+ this.reveal(attempts - 1);
291
+ this.focusActive();
292
+ });
234
293
  }
235
294
  copyable(row) {
236
295
  if (!row) {
@@ -241,32 +300,68 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
241
300
  }
242
301
  return JSON.stringify(row.value, null, 2) ?? String(row.value);
243
302
  }
244
- toggle(row, open = !row.open) {
245
- const opened = new Set(this.opened);
246
- if (open) {
247
- opened.add(row.path);
303
+ requestOpen(paths, open) {
304
+ if (paths.length === 0) {
305
+ return false;
306
+ }
307
+ const applied = requestChange({
308
+ apply: () => {
309
+ const opened = new Set(this.opened);
310
+ for (const path of paths) {
311
+ if (open) {
312
+ opened.add(path);
313
+ }
314
+ else {
315
+ opened.delete(path);
316
+ }
317
+ }
318
+ this.opened = opened;
319
+ },
320
+ event: (next) => (next ? new HelixBeforeOpenEvent() : new HelixBeforeCloseEvent()),
321
+ host: this,
322
+ next: open,
323
+ });
324
+ if (applied) {
325
+ this.announceToggle(open);
248
326
  }
249
- else {
250
- opened.delete(row.path);
327
+ return applied;
328
+ }
329
+ announceToggle(open) {
330
+ const states = { newState: open ? 'open' : 'closed', oldState: open ? 'closed' : 'open' };
331
+ if (typeof ToggleEvent === 'function') {
332
+ this.dispatchEvent(new ToggleEvent('toggle', states));
333
+ return;
251
334
  }
252
- this.opened = opened;
335
+ const event = new Event('toggle', { bubbles: false, cancelable: false, composed: false });
336
+ Object.assign(event, states);
337
+ this.dispatchEvent(event);
253
338
  }
254
- move(to) {
255
- const last = this.rows.length - 1;
256
- this.active = Math.max(0, Math.min(to, last));
257
- this.revealing = true;
339
+ toggle(row, open = !row.open) {
340
+ this.requestOpen([row.path], open);
258
341
  }
259
- openSiblings(row) {
260
- const parent = row.path.slice(0, row.path.lastIndexOf('/'));
261
- const opened = new Set(this.opened);
262
- for (const one of this.rows) {
263
- if (one.branch &&
264
- one.depth === row.depth &&
265
- one.path.slice(0, one.path.lastIndexOf('/')) === parent) {
266
- opened.add(one.path);
342
+ move(to) {
343
+ const at = Math.max(0, Math.min(to, this.rows.length - 1));
344
+ const path = this.rows[at]?.path;
345
+ if (path === undefined) {
346
+ return false;
347
+ }
348
+ if (at !== this.cursor) {
349
+ const moved = requestChange({
350
+ apply: () => {
351
+ this.cursor = at;
352
+ },
353
+ event: (value) => new HelixBeforeActivateEvent({ value }),
354
+ host: this,
355
+ next: path,
356
+ });
357
+ if (!moved) {
358
+ return false;
267
359
  }
360
+ this.dispatchEvent(new HelixActivateEvent({ value: path }));
268
361
  }
269
- this.opened = opened;
362
+ this.revealing = true;
363
+ this.focusing = true;
364
+ return true;
270
365
  }
271
366
  typeahead(letter) {
272
367
  const now = Date.now();
@@ -275,7 +370,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
275
370
  const wanted = text.toLocaleLowerCase();
276
371
  const repeated = [...wanted].every((one) => one === wanted[0]);
277
372
  const rows = this.rows;
278
- const start = wanted.length === 1 || repeated ? this.active + 1 : this.active;
373
+ const start = wanted.length === 1 || repeated ? this.cursor + 1 : this.cursor;
279
374
  for (let step = 0; step < rows.length; step += 1) {
280
375
  const at = (start + step) % rows.length;
281
376
  const key = rows[at]?.key?.toLocaleLowerCase();
@@ -286,8 +381,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
286
381
  }
287
382
  }
288
383
  handleRowClick(index, row) {
289
- this.active = index;
290
- if (row.branch) {
384
+ if (this.move(index) && row.branch) {
291
385
  this.toggle(row);
292
386
  }
293
387
  }
@@ -324,20 +418,20 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
324
418
  return html `<span part="string" dir="ltr">${String(value)}</span>`;
325
419
  }
326
420
  renderRow(row, index) {
327
- const active = index === this.active;
421
+ const active = index === this.cursor;
328
422
  return html `<div
329
- part="row${active ? ' row-active' : ''}"
330
- role="treeitem"
423
+ part="row${active ? ' row-active' : ''}${row.match ? ' row-match' : ''}"
424
+ role="row"
331
425
  id=${`row-${index}`}
332
426
  data-index=${index}
427
+ tabindex=${active ? '0' : '-1'}
333
428
  aria-level=${row.depth + 1}
334
429
  aria-posinset=${row.position}
335
430
  aria-setsize=${row.siblings}
336
431
  aria-expanded=${row.branch ? String(row.open) : nothing}
337
432
  style=${`--object-inspector-level: ${row.depth}`}
338
433
  @click=${() => this.handleRowClick(index, row)}
339
- >
340
- ${row.branch
434
+ ><div role="gridcell" style="display: contents">${row.branch
341
435
  ? html `<svg
342
436
  part="toggle"
343
437
  ?data-mirror=${!row.open}
@@ -347,9 +441,13 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
347
441
  >
348
442
  ${unsafeSVG((row.open ? caretDown : caretRight).content)}
349
443
  </svg>`
350
- : nothing}${row.key === undefined ? nothing : html `<span part="key">${row.key}</span>: `}${this.renderValue(row)}
444
+ : nothing}${row.key === undefined ? nothing : html `<span part="key">${row.key}</span>: `}${this.renderValue(row)}</div>
351
445
  </div>`;
352
446
  }
447
+ hasFocusedRow() {
448
+ const focused = this.shadowRoot?.activeElement;
449
+ return focused?.getAttribute?.('role') === 'row';
450
+ }
353
451
  renderCopyButton(row) {
354
452
  return staticHtml `<${this.tag('copy-button')}
355
453
  part="copy"
@@ -364,30 +462,55 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
364
462
  }
365
463
  render() {
366
464
  const rows = this.rows;
367
- const { after, before, first, last } = this.windowed
368
- ? this.virtualize.window
369
- : { after: 0, before: 0, first: 0, last: rows.length };
370
- const shown = rows.slice(first, last);
371
- return html `${this.label ? html `<div part="header"><span part="label">${this.label}</span></div>` : nothing}
465
+ const { first, last } = this.windowed ? this.virtualize.window : { first: 0, last: rows.length };
466
+ const kept = this.windowed && (this.cursor < first || this.cursor >= last) && this.hasFocusedRow()
467
+ ? this.cursor
468
+ : undefined;
469
+ const { after, before } = this.windowed
470
+ ? this.virtualize.spacers(kept)
471
+ : { after: 0, before: 0 };
472
+ const shown = rows.slice(first, last).map((row, at) => [row, first + at]);
473
+ const keptRow = kept === undefined ? undefined : rows[kept];
474
+ if (kept !== undefined && keptRow) {
475
+ shown.splice(kept < first ? 0 : shown.length, 0, [keptRow, kept]);
476
+ }
477
+ return html `${this.label ? html `<div part="header"><span part="label">${this.label}</span></div>` : nothing}${this.filterable
478
+ ? html `<input
479
+ part="search-field"
480
+ type="search"
481
+ spellcheck="false"
482
+ .value=${this.filter}
483
+ placeholder=${this.filterLabel}
484
+ aria-label=${this.filterLabel}
485
+ aria-controls="tree"
486
+ @input=${this.handleFilterInput}
487
+ @keydown=${this.handleFilterKeydown}
488
+ />`
489
+ : nothing}
372
490
  <div part="frame">
373
491
  <div
374
492
  part="tree"
375
- role="tree"
376
- tabindex="0"
493
+ id="tree"
494
+ role="treegrid"
377
495
  ?data-scroller=${this.windowed}
378
496
  aria-label=${this.label || this.treeLabel}
379
- aria-activedescendant=${rows.length > 0 ? `row-${this.active}` : nothing}
380
497
  @keydown=${this.handleKeydown}
498
+ @focusin=${this.handleFocusIn}
499
+ @focusout=${this.handleFocusOut}
381
500
  @scroll=${() => this.virtualize.measure()}
382
501
  >
383
502
  ${this.windowed ? html `<div part="before" role="presentation" style="block-size: ${before}px"></div>` : nothing}
384
- ${shown.map((row, at) => this.renderRow(row, first + at))}
503
+ ${repeat(shown, ([row]) => row.path, ([row, at]) => this.renderRow(row, at))}
385
504
  ${this.windowed ? html `<div part="after" role="presentation" style="block-size: ${after}px"></div>` : nothing}
386
505
  </div>
387
- ${this.noCopy ? nothing : this.renderCopyButton(rows[this.active])}
388
- </div>`;
506
+ ${this.noCopy ? nothing : this.renderCopyButton(rows[this.cursor])}
507
+ </div>
508
+ ${drawStatus(this.status)}`;
389
509
  }
390
510
  };
511
+ __decorate([
512
+ property()
513
+ ], HelixHeadlessObjectInspector.prototype, "active", null);
391
514
  __decorate([
392
515
  property({ attribute: 'copy-label' })
393
516
  ], HelixHeadlessObjectInspector.prototype, "copyLabel", void 0);
@@ -397,6 +520,18 @@ __decorate([
397
520
  __decorate([
398
521
  property({ attribute: 'default-depth', type: Number })
399
522
  ], HelixHeadlessObjectInspector.prototype, "defaultDepth", void 0);
523
+ __decorate([
524
+ property({ attribute: false })
525
+ ], HelixHeadlessObjectInspector.prototype, "expanded", null);
526
+ __decorate([
527
+ property()
528
+ ], HelixHeadlessObjectInspector.prototype, "filter", void 0);
529
+ __decorate([
530
+ property({ type: Boolean })
531
+ ], HelixHeadlessObjectInspector.prototype, "filterable", void 0);
532
+ __decorate([
533
+ property({ attribute: 'filter-label' })
534
+ ], HelixHeadlessObjectInspector.prototype, "filterLabel", void 0);
400
535
  __decorate([
401
536
  property()
402
537
  ], HelixHeadlessObjectInspector.prototype, "for", void 0);
@@ -418,6 +553,12 @@ __decorate([
418
553
  __decorate([
419
554
  property({ attribute: 'no-copy', type: Boolean })
420
555
  ], HelixHeadlessObjectInspector.prototype, "noCopy", void 0);
556
+ __decorate([
557
+ property({ attribute: 'result-label' })
558
+ ], HelixHeadlessObjectInspector.prototype, "resultLabel", void 0);
559
+ __decorate([
560
+ property({ attribute: 'results-label' })
561
+ ], HelixHeadlessObjectInspector.prototype, "resultsLabel", void 0);
421
562
  __decorate([
422
563
  property({ attribute: 'tree-label' })
423
564
  ], HelixHeadlessObjectInspector.prototype, "treeLabel", void 0);
@@ -435,7 +576,7 @@ __decorate([
435
576
  ], HelixHeadlessObjectInspector.prototype, "opened", void 0);
436
577
  __decorate([
437
578
  state()
438
- ], HelixHeadlessObjectInspector.prototype, "active", void 0);
579
+ ], HelixHeadlessObjectInspector.prototype, "cursor", void 0);
439
580
  HelixHeadlessObjectInspector = HelixHeadlessObjectInspector_1 = __decorate([
440
581
  customElement('helix-headless-object-inspector')
441
582
  ], HelixHeadlessObjectInspector);
@@ -0,0 +1,75 @@
1
+ /** One visible line of the tree: a value, where it sits, and whether it is open. */
2
+ export interface Row {
3
+ branch: boolean;
4
+ depth: number;
5
+ /** The property name or array index this value is under; absent for the root. */
6
+ key?: string;
7
+ /** Whether its key or its value holds what the tree is filtered by. */
8
+ match: boolean;
9
+ open: boolean;
10
+ path: string;
11
+ position: number;
12
+ siblings: number;
13
+ value: unknown;
14
+ }
15
+ /** Whether a value has entries of its own, an object or an array. */
16
+ export declare const branchy: (value: unknown) => value is object;
17
+ /** A branch's entries, an array's under its indexes. */
18
+ export declare const entries: (value: object) => [string, unknown][];
19
+ /** A child's path under its parent's, escaped the way a JSON Pointer escapes one. */
20
+ export declare const child: (path: string, key: string) => string;
21
+ /**
22
+ * Every branch a path sits inside, from the root down, and not the path itself.
23
+ *
24
+ * The root's path is the empty string, so every other path has it first. A
25
+ * key's own `/` is escaped as `~1`, so cutting at each `/` cuts between keys.
26
+ */
27
+ export declare const ancestorsOf: (path: string) => string[];
28
+ /**
29
+ * The paths of every entry whose key or value holds `query`, ignoring case,
30
+ * across the whole value and not only the open branches.
31
+ *
32
+ * A branch is matched by its key alone: its brackets and its count are drawn,
33
+ * and they are not what a reader is looking for.
34
+ */
35
+ export declare const search: (root: unknown, query: string) => Set<string>;
36
+ /**
37
+ * Every visible row, in order, for a value with `opened` branches open.
38
+ *
39
+ * With `found`, the paths a filter matched, a branch shows only the entries
40
+ * that matched or lead to one, and a matched entry shows everything under it.
41
+ * Position and set size count the entries shown, which is the set a reader
42
+ * hears.
43
+ */
44
+ export declare const flatten: (root: unknown, opened: Set<string>, found?: Set<string>) => Row[];
45
+ /**
46
+ * Which branches are open for a value, by path.
47
+ *
48
+ * Every branch shallower than `depth` opens. A branch in `known`, the
49
+ * branches of the last value, keeps whether it was in `opened`, so a new value
50
+ * keeps the branches a reader opened or closed and only a new one takes the
51
+ * default. Returns the open branches and every branch, for the next value to
52
+ * be told apart from this one.
53
+ */
54
+ export declare const seed: (root: unknown, depth: number, known?: Set<string>, opened?: Set<string>) => {
55
+ branches: Set<string>;
56
+ opened: Set<string>;
57
+ };
58
+ /**
59
+ * Where the active row goes once the rows have moved, as an index into `rows`.
60
+ *
61
+ * Onto `path` where it is still shown. Where a filter just hid it
62
+ * (`filtered`), onto the first match. Otherwise onto the nearest branch around
63
+ * it that is shown. With no path to keep, `cursor` held inside the rows.
64
+ */
65
+ export declare const cursorFor: (rows: readonly Row[], path: string | undefined, cursor: number, filtered: boolean) => number;
66
+ /**
67
+ * The open branches with every branch around each of `paths` opened too,
68
+ * where the value has that branch (`branches`).
69
+ */
70
+ export declare const withAncestors: (opened: ReadonlySet<string>, branches: ReadonlySet<string>, paths: Iterable<string>) => Set<string>;
71
+ /**
72
+ * The branches `*` opens from `row`: every branch at its depth under the same
73
+ * parent, itself included, that is not open yet.
74
+ */
75
+ export declare const siblingBranches: (rows: readonly Row[], row: Row) => string[];