@threadlabs/looma 0.1.23 → 0.1.25

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 (309) hide show
  1. package/dist/chunk-HNFCGIBP.js +8 -0
  2. package/dist/chunk-NB6DBRXQ.js +323 -0
  3. package/dist/{chunk-GDMQKT5F.js → chunk-UY423IKN.js} +33 -30
  4. package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
  5. package/dist/cjs/icons-BAdjrnhS.js +680 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/looma.cjs.js +1 -1
  8. package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
  9. package/dist/cjs/ui-avatar-group.cjs.entry.js +9 -17
  10. package/dist/cjs/ui-avatar.cjs.entry.js +2 -2
  11. package/dist/cjs/ui-badge.cjs.entry.js +2 -2
  12. package/dist/cjs/ui-button.cjs.entry.js +1 -1
  13. package/dist/cjs/ui-callout.cjs.entry.js +27 -0
  14. package/dist/cjs/ui-checkbox.cjs.entry.js +13 -7
  15. package/dist/cjs/{ui-combobox.cjs.entry.js → ui-chip_2.cjs.entry.js} +29 -4
  16. package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
  17. package/dist/cjs/ui-dialog.cjs.entry.js +44 -8
  18. package/dist/cjs/ui-disclosure.cjs.entry.js +9 -6
  19. package/dist/cjs/ui-editable.cjs.entry.js +100 -0
  20. package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
  21. package/dist/cjs/ui-form-field.cjs.entry.js +59 -4
  22. package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
  23. package/dist/cjs/ui-input.cjs.entry.js +1 -1
  24. package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
  25. package/dist/cjs/ui-menu.cjs.entry.js +14 -9
  26. package/dist/cjs/ui-multi-combobox.cjs.entry.js +158 -0
  27. package/dist/cjs/ui-popover.cjs.entry.js +10 -7
  28. package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
  29. package/dist/cjs/ui-radio.cjs.entry.js +16 -7
  30. package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
  31. package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
  32. package/dist/cjs/ui-select.cjs.entry.js +1 -1
  33. package/dist/cjs/ui-switch.cjs.entry.js +19 -10
  34. package/dist/cjs/ui-tabs.cjs.entry.js +10 -9
  35. package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
  36. package/dist/cjs/ui-toast-region.cjs.entry.js +30 -19
  37. package/dist/cjs/ui-tooltip.cjs.entry.js +12 -8
  38. package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
  39. package/dist/cjs/ui-tree-item.cjs.entry.js +54 -617
  40. package/dist/cjs/ui-tree.cjs.entry.js +123 -11
  41. package/dist/collection/collection-manifest.json +4 -0
  42. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +1 -1
  43. package/dist/collection/components/ui-avatar/ui-avatar.css +4 -4
  44. package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
  45. package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +2 -2
  46. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +8 -16
  47. package/dist/collection/components/ui-badge/ui-badge.css +64 -48
  48. package/dist/collection/components/ui-badge/ui-badge.js +1 -1
  49. package/dist/collection/components/ui-button/ui-button.js +1 -1
  50. package/dist/collection/components/ui-callout/ui-callout.css +74 -0
  51. package/dist/collection/components/ui-callout/ui-callout.js +59 -0
  52. package/dist/collection/components/ui-checkbox/ui-checkbox.js +16 -11
  53. package/dist/collection/components/ui-chip/ui-chip.css +47 -0
  54. package/dist/collection/components/ui-chip/ui-chip.js +67 -0
  55. package/dist/collection/components/ui-combobox/ui-combobox.js +49 -4
  56. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  57. package/dist/collection/components/ui-dialog/ui-dialog.js +49 -13
  58. package/dist/collection/components/ui-disclosure/ui-disclosure.js +12 -10
  59. package/dist/collection/components/ui-editable/ui-editable.css +2 -0
  60. package/dist/collection/components/ui-editable/ui-editable.js +196 -0
  61. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  62. package/dist/collection/components/ui-form-field/ui-form-field.js +59 -4
  63. package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
  64. package/dist/collection/components/ui-input/ui-input.js +1 -1
  65. package/dist/collection/components/ui-menu/ui-menu.css +12 -23
  66. package/dist/collection/components/ui-menu/ui-menu.js +16 -12
  67. package/dist/collection/components/ui-menu-item/ui-menu-item.css +9 -3
  68. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  69. package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.css +29 -0
  70. package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.js +503 -0
  71. package/dist/collection/components/ui-popover/ui-popover.css +14 -5
  72. package/dist/collection/components/ui-popover/ui-popover.js +12 -10
  73. package/dist/collection/components/ui-radio/ui-radio.js +24 -11
  74. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  75. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  76. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  77. package/dist/collection/components/ui-select/ui-select.js +1 -1
  78. package/dist/collection/components/ui-switch/ui-switch.js +22 -14
  79. package/dist/collection/components/ui-tabs/ui-tabs.js +13 -13
  80. package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
  81. package/dist/collection/components/ui-toast-region/ui-toast-region.js +30 -19
  82. package/dist/collection/components/ui-tooltip/ui-tooltip.css +16 -7
  83. package/dist/collection/components/ui-tooltip/ui-tooltip.js +14 -11
  84. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  85. package/dist/collection/components/ui-tree/ui-tree.css +2 -1
  86. package/dist/collection/components/ui-tree/ui-tree.js +122 -10
  87. package/dist/collection/components/ui-tree-item/ui-tree-item.js +61 -44
  88. package/dist/collection/field/editable.js +1 -0
  89. package/dist/collection/field/multi-combobox.js +1 -0
  90. package/dist/collection/icons.js +6 -1
  91. package/dist/collection/utils/controlled-state.js +4 -0
  92. package/dist/components/index.d.ts +8 -0
  93. package/dist/components/index.js +1 -1
  94. package/dist/components/p-B9CzOHvE.js +1 -0
  95. package/dist/components/p-BMgIcOh-.js +1 -0
  96. package/dist/components/p-BVteuP_d.js +1 -0
  97. package/dist/components/p-BnGhGgTH.js +1 -0
  98. package/dist/components/p-C6p-ygxq.js +1 -0
  99. package/dist/components/p-CoFximGM.js +13 -0
  100. package/dist/components/ui-affordance-scope.js +1 -1
  101. package/dist/components/ui-avatar-group.js +1 -1
  102. package/dist/components/ui-avatar.js +1 -1
  103. package/dist/components/ui-badge.js +1 -1
  104. package/dist/components/ui-button.js +1 -1
  105. package/dist/components/ui-callout.d.ts +11 -0
  106. package/dist/components/ui-callout.js +1 -0
  107. package/dist/components/ui-checkbox.js +1 -1
  108. package/dist/components/ui-chip.d.ts +11 -0
  109. package/dist/components/ui-chip.js +1 -0
  110. package/dist/components/ui-combobox.js +1 -1
  111. package/dist/components/ui-context-menu.js +1 -1
  112. package/dist/components/ui-dialog.js +1 -1
  113. package/dist/components/ui-disclosure.js +1 -1
  114. package/dist/components/ui-editable.d.ts +11 -0
  115. package/dist/components/ui-editable.js +1 -0
  116. package/dist/components/ui-floating-action-button.js +1 -1
  117. package/dist/components/ui-form-field.js +1 -1
  118. package/dist/components/ui-icon-button.js +1 -1
  119. package/dist/components/ui-input.js +1 -1
  120. package/dist/components/ui-menu-item.js +1 -1
  121. package/dist/components/ui-menu.js +1 -1
  122. package/dist/components/ui-multi-combobox.d.ts +11 -0
  123. package/dist/components/ui-multi-combobox.js +1 -0
  124. package/dist/components/ui-popover.js +1 -1
  125. package/dist/components/ui-radio-group.js +1 -1
  126. package/dist/components/ui-radio.js +1 -1
  127. package/dist/components/ui-search-result-row.js +1 -1
  128. package/dist/components/ui-search-shell.js +1 -1
  129. package/dist/components/ui-select.js +1 -1
  130. package/dist/components/ui-switch.js +1 -1
  131. package/dist/components/ui-tabs.js +1 -1
  132. package/dist/components/ui-textarea.js +1 -1
  133. package/dist/components/ui-toast-region.js +1 -1
  134. package/dist/components/ui-tooltip.js +1 -1
  135. package/dist/components/ui-top-bar.js +1 -1
  136. package/dist/components/ui-tree-item.js +1 -13
  137. package/dist/components/ui-tree.js +1 -1
  138. package/dist/esm/controlled-state-BnGhGgTH.js +6 -0
  139. package/dist/esm/icons-CoFximGM.js +678 -0
  140. package/dist/esm/loader.js +1 -1
  141. package/dist/esm/looma.js +1 -1
  142. package/dist/esm/ui-affordance-scope.entry.js +1 -1
  143. package/dist/esm/ui-avatar-group.entry.js +9 -17
  144. package/dist/esm/ui-avatar.entry.js +2 -2
  145. package/dist/esm/ui-badge.entry.js +2 -2
  146. package/dist/esm/ui-button.entry.js +1 -1
  147. package/dist/esm/ui-callout.entry.js +25 -0
  148. package/dist/esm/ui-checkbox.entry.js +13 -7
  149. package/dist/esm/{ui-combobox.entry.js → ui-chip_2.entry.js} +30 -6
  150. package/dist/esm/ui-context-menu.entry.js +1 -1
  151. package/dist/esm/ui-dialog.entry.js +44 -8
  152. package/dist/esm/ui-disclosure.entry.js +9 -6
  153. package/dist/esm/ui-editable.entry.js +98 -0
  154. package/dist/esm/ui-floating-action-button.entry.js +1 -1
  155. package/dist/esm/ui-form-field.entry.js +59 -4
  156. package/dist/esm/ui-icon-button.entry.js +1 -1
  157. package/dist/esm/ui-input.entry.js +1 -1
  158. package/dist/esm/ui-menu-item.entry.js +2 -2
  159. package/dist/esm/ui-menu.entry.js +14 -9
  160. package/dist/esm/ui-multi-combobox.entry.js +156 -0
  161. package/dist/esm/ui-popover.entry.js +10 -7
  162. package/dist/esm/ui-radio-group.entry.js +1 -1
  163. package/dist/esm/ui-radio.entry.js +16 -7
  164. package/dist/esm/ui-search-result-row.entry.js +1 -1
  165. package/dist/esm/ui-search-shell.entry.js +1 -1
  166. package/dist/esm/ui-select.entry.js +1 -1
  167. package/dist/esm/ui-switch.entry.js +19 -10
  168. package/dist/esm/ui-tabs.entry.js +10 -9
  169. package/dist/esm/ui-textarea.entry.js +1 -1
  170. package/dist/esm/ui-toast-region.entry.js +30 -19
  171. package/dist/esm/ui-tooltip.entry.js +12 -8
  172. package/dist/esm/ui-top-bar.entry.js +1 -1
  173. package/dist/esm/ui-tree-item.entry.js +54 -617
  174. package/dist/esm/ui-tree.entry.js +123 -11
  175. package/dist/index.cjs +1552 -894
  176. package/dist/index.d.cts +23 -1
  177. package/dist/index.d.ts +23 -1
  178. package/dist/index.js +12 -2
  179. package/dist/looma/looma.esm.js +1 -1
  180. package/dist/looma/p-08f80207.entry.js +1 -0
  181. package/dist/looma/{p-ed368426.entry.js → p-0e1741cb.entry.js} +1 -1
  182. package/dist/looma/p-0ef4bf13.entry.js +1 -0
  183. package/dist/looma/{p-7e0bb7f6.entry.js → p-166f8593.entry.js} +1 -1
  184. package/dist/looma/p-262a542c.entry.js +1 -0
  185. package/dist/looma/{p-13347631.entry.js → p-26d357ae.entry.js} +1 -1
  186. package/dist/looma/p-30f01909.entry.js +1 -0
  187. package/dist/looma/p-393e3e02.entry.js +1 -0
  188. package/dist/looma/p-3a44b9f9.entry.js +1 -0
  189. package/dist/looma/p-558d4f5b.entry.js +1 -0
  190. package/dist/looma/{p-5a87b59d.entry.js → p-5780cefa.entry.js} +1 -1
  191. package/dist/looma/p-5a7261e1.entry.js +1 -0
  192. package/dist/looma/p-5fdcee1d.entry.js +1 -0
  193. package/dist/looma/{p-add36e74.entry.js → p-72338f53.entry.js} +1 -1
  194. package/dist/looma/p-7319c147.entry.js +1 -0
  195. package/dist/looma/p-78b7e466.entry.js +1 -0
  196. package/dist/looma/{p-a90d2821.entry.js → p-7ab661ec.entry.js} +1 -1
  197. package/dist/looma/p-7eb04f09.entry.js +1 -0
  198. package/dist/looma/{p-69a5557b.entry.js → p-81c533f5.entry.js} +1 -1
  199. package/dist/looma/p-87f501cf.entry.js +1 -0
  200. package/dist/looma/p-89e71bbb.entry.js +1 -0
  201. package/dist/looma/{p-8b8840b8.entry.js → p-92cd1841.entry.js} +1 -1
  202. package/dist/looma/{p-f0487ff3.entry.js → p-95eb3b58.entry.js} +1 -1
  203. package/dist/looma/p-96ec4d7a.entry.js +1 -0
  204. package/dist/looma/p-9d2662ca.entry.js +1 -0
  205. package/dist/looma/p-BnGhGgTH.js +1 -0
  206. package/dist/looma/p-CoFximGM.js +13 -0
  207. package/dist/looma/p-add67e4c.entry.js +1 -0
  208. package/dist/looma/p-b6c776fb.entry.js +1 -0
  209. package/dist/looma/p-bcb1b47b.entry.js +1 -0
  210. package/dist/looma/p-d56571a2.entry.js +1 -0
  211. package/dist/looma/{p-582973b5.entry.js → p-d62da01d.entry.js} +1 -1
  212. package/dist/looma/{p-f74e5546.entry.js → p-dbcb479c.entry.js} +1 -1
  213. package/dist/looma/p-e14024bf.entry.js +1 -0
  214. package/dist/looma/{p-5da09f47.entry.js → p-fc180770.entry.js} +1 -1
  215. package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +1 -2
  216. package/dist/types/components/ui-callout/ui-callout.d.ts +6 -0
  217. package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +2 -1
  218. package/dist/types/components/ui-chip/ui-chip.d.ts +8 -0
  219. package/dist/types/components/ui-combobox/ui-combobox.d.ts +4 -0
  220. package/dist/types/components/ui-dialog/ui-dialog.d.ts +7 -1
  221. package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +2 -1
  222. package/dist/types/components/ui-editable/ui-editable.d.ts +24 -0
  223. package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
  224. package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
  225. package/dist/types/components/ui-multi-combobox/ui-multi-combobox.d.ts +47 -0
  226. package/dist/types/components/ui-popover/ui-popover.d.ts +2 -1
  227. package/dist/types/components/ui-radio/ui-radio.d.ts +4 -1
  228. package/dist/types/components/ui-switch/ui-switch.d.ts +2 -1
  229. package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -1
  230. package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +3 -1
  231. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +2 -1
  232. package/dist/types/components/ui-tree/ui-tree.d.ts +12 -0
  233. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +11 -7
  234. package/dist/types/components.d.ts +343 -46
  235. package/dist/types/field/editable.d.ts +5 -0
  236. package/dist/types/field/multi-combobox.d.ts +11 -0
  237. package/dist/types/icons.d.ts +5 -0
  238. package/dist/types/utils/controlled-state.d.ts +4 -0
  239. package/dist/{ui-affordance-scope.entry-VO4C2MZX.js → ui-affordance-scope.entry-VSSP52ZP.js} +2 -2
  240. package/dist/ui-avatar-group.entry-JMCLL6FW.js +51 -0
  241. package/dist/{ui-avatar.entry-T6FU6ZYM.js → ui-avatar.entry-X2YQ3QPG.js} +3 -3
  242. package/dist/ui-badge.entry-OJ6FJJKL.js +22 -0
  243. package/dist/{ui-button.entry-7UXMUGHN.js → ui-button.entry-ZN6JLND7.js} +2 -2
  244. package/dist/ui-callout.entry-7K6NXQ7U.js +32 -0
  245. package/dist/{ui-checkbox.entry-DMZJB3RE.js → ui-checkbox.entry-GUYRVU6O.js} +17 -8
  246. package/dist/{ui-combobox.entry-ZCTPXEES.js → ui-chip_2.entry-M2DOTIGY.js} +32 -7
  247. package/dist/{ui-context-menu.entry-2WMCBGCP.js → ui-context-menu.entry-BM7FHOUJ.js} +5 -5
  248. package/dist/{ui-dialog.entry-WO23XOSW.js → ui-dialog.entry-AZAD37CG.js} +50 -12
  249. package/dist/{ui-disclosure.entry-USX7OUEW.js → ui-disclosure.entry-XDPGKMBK.js} +13 -7
  250. package/dist/ui-editable.entry-S3TE6KFT.js +110 -0
  251. package/dist/{ui-floating-action-button.entry-MXDIN7MV.js → ui-floating-action-button.entry-U7HGA3CS.js} +2 -2
  252. package/dist/ui-form-field.entry-C2ZSP3TM.js +120 -0
  253. package/dist/{ui-icon-button.entry-MJUNXHBU.js → ui-icon-button.entry-P6H2LY7D.js} +2 -2
  254. package/dist/{ui-input.entry-AWG63YIG.js → ui-input.entry-GTNQJCQ2.js} +2 -2
  255. package/dist/ui-menu-item.entry-2HWOGUO5.js +22 -0
  256. package/dist/{ui-menu.entry-IT3GW5TL.js → ui-menu.entry-NZ7ER54K.js} +22 -14
  257. package/dist/ui-multi-combobox.entry-DZ5LLSVQ.js +167 -0
  258. package/dist/{ui-popover.entry-ZQQB4N6E.js → ui-popover.entry-ZOEQMUWG.js} +17 -11
  259. package/dist/{ui-radio-group.entry-V7PCTS7I.js → ui-radio-group.entry-QCQ46EK5.js} +2 -2
  260. package/dist/{ui-radio.entry-JYH6TQBI.js → ui-radio.entry-QAATWUYT.js} +20 -8
  261. package/dist/{ui-search-result-row.entry-JBNYXXUN.js → ui-search-result-row.entry-2I3DH2OT.js} +2 -2
  262. package/dist/{ui-search-shell.entry-TEAWE76O.js → ui-search-shell.entry-7RS55ORF.js} +2 -2
  263. package/dist/{ui-select.entry-F3A6TE2U.js → ui-select.entry-6O4KD4G7.js} +2 -2
  264. package/dist/{ui-switch.entry-MJIICMP2.js → ui-switch.entry-DY5PSHCQ.js} +23 -11
  265. package/dist/{ui-tabs.entry-6REFIUHV.js → ui-tabs.entry-6X56UOUE.js} +14 -10
  266. package/dist/{ui-textarea.entry-OJTXCED7.js → ui-textarea.entry-RDYP6O77.js} +2 -2
  267. package/dist/{ui-toast-region.entry-NOFXLKPS.js → ui-toast-region.entry-EBY42KS5.js} +32 -23
  268. package/dist/{ui-tooltip.entry-COWTWVHX.js → ui-tooltip.entry-PLXMPOKV.js} +19 -12
  269. package/dist/{ui-top-bar.entry-PIAWXJNV.js → ui-top-bar.entry-QKE2DLVD.js} +2 -2
  270. package/dist/ui-tree-item.entry-TC6YWIC6.js +145 -0
  271. package/dist/{ui-tree.entry-XYI3ZFAZ.js → ui-tree.entry-UL6UHCUT.js} +114 -12
  272. package/editor/{chunk-QCOYOVQL.js → chunk-B5WVJOPV.js} +113 -97
  273. package/editor/extensions/index.d.ts +14 -6
  274. package/editor/extensions/index.js +1 -1
  275. package/editor/index.js +1 -1
  276. package/editor.css +37 -20
  277. package/package.json +1 -1
  278. package/styles.css +10 -0
  279. package/tokens.css +3 -0
  280. package/vue/{chunk-JLW23USW.js → chunk-GXQY27K2.js} +112 -17
  281. package/vue/editor/index.d.ts +5 -15
  282. package/vue/editor/index.js +1 -1
  283. package/vue/index.d.ts +442 -116
  284. package/vue/index.js +9 -1
  285. package/dist/components/p-CaietZcq.js +0 -1
  286. package/dist/components/p-DHd18bK7.js +0 -1
  287. package/dist/looma/p-14c081cf.entry.js +0 -1
  288. package/dist/looma/p-25366205.entry.js +0 -1
  289. package/dist/looma/p-2e3aa869.entry.js +0 -1
  290. package/dist/looma/p-40fe7fee.entry.js +0 -1
  291. package/dist/looma/p-446cda76.entry.js +0 -1
  292. package/dist/looma/p-4fc1b005.entry.js +0 -13
  293. package/dist/looma/p-6a8a4736.entry.js +0 -1
  294. package/dist/looma/p-6bf4038b.entry.js +0 -1
  295. package/dist/looma/p-8204fee6.entry.js +0 -1
  296. package/dist/looma/p-8238e0dc.entry.js +0 -1
  297. package/dist/looma/p-99d88efb.entry.js +0 -1
  298. package/dist/looma/p-a27669b1.entry.js +0 -1
  299. package/dist/looma/p-a6ee76b7.entry.js +0 -1
  300. package/dist/looma/p-b6398a6b.entry.js +0 -1
  301. package/dist/looma/p-d50faaff.entry.js +0 -1
  302. package/dist/looma/p-d77278ce.entry.js +0 -1
  303. package/dist/looma/p-d9ec13b7.entry.js +0 -1
  304. package/dist/looma/p-ecf8005f.entry.js +0 -1
  305. package/dist/ui-avatar-group.entry-TAXJRIIU.js +0 -59
  306. package/dist/ui-badge.entry-MZFYNBMJ.js +0 -22
  307. package/dist/ui-form-field.entry-7ZCMEHPY.js +0 -67
  308. package/dist/ui-menu-item.entry-HFTWG62N.js +0 -22
  309. package/dist/ui-tree-item.entry-BSEWNL2O.js +0 -389
@@ -53,7 +53,7 @@ function createHoverIntent(delay, onIntent) {
53
53
  };
54
54
  }
55
55
 
56
- const uiTreeCss = () => `:host{--ui-tree-indent:16px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter, 22px)}::slotted(ui-tree-item){--ui-tree-indent:inherit}`;
56
+ const uiTreeCss = () => `:host{--ui-tree-indent:16px;--ui-tree-gutter:0px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter)}::slotted(ui-tree-item){--ui-tree-indent:inherit}`;
57
57
 
58
58
  const UITree = class {
59
59
  constructor(hostRef) {
@@ -71,6 +71,8 @@ const UITree = class {
71
71
  rejectedPosition = null;
72
72
  rejection = null;
73
73
  hoverIntent = null;
74
+ structureObserver = null;
75
+ tabStop = null;
74
76
  componentDidLoad() {
75
77
  this.hoverIntent = createHoverIntent(this.hoverExpandDelay, this.expandTarget);
76
78
  this.host.addEventListener('dragstart', this.onDragStart);
@@ -81,6 +83,11 @@ const UITree = class {
81
83
  this.host.addEventListener('drop', this.onDrop);
82
84
  this.host.addEventListener('dragend', this.onDragEnd);
83
85
  this.host.addEventListener('keydown', this.onKeyDown);
86
+ this.host.addEventListener('focusin', this.onFocusIn);
87
+ this.host.addEventListener('ui-tree-expansion-change', this.onExpansionChange);
88
+ this.syncStructuralLevels();
89
+ this.structureObserver = new MutationObserver(this.syncStructuralLevels);
90
+ this.structureObserver.observe(this.host, { childList: true, subtree: true });
84
91
  }
85
92
  disconnectedCallback() {
86
93
  this.hoverIntent?.destroy();
@@ -92,10 +99,44 @@ const UITree = class {
92
99
  this.host.removeEventListener('drop', this.onDrop);
93
100
  this.host.removeEventListener('dragend', this.onDragEnd);
94
101
  this.host.removeEventListener('keydown', this.onKeyDown);
102
+ this.host.removeEventListener('focusin', this.onFocusIn);
103
+ this.host.removeEventListener('ui-tree-expansion-change', this.onExpansionChange);
104
+ this.structureObserver?.disconnect();
105
+ this.structureObserver = null;
106
+ }
107
+ syncStructuralLevels = () => {
108
+ for (const item of Array.from(this.host.querySelectorAll('ui-tree-item'))) {
109
+ item.dispatchEvent(new CustomEvent('ui-tree-structure-sync'));
110
+ }
111
+ this.syncTabStop();
112
+ };
113
+ syncTabStop(preferred) {
114
+ const items = this.visibleItems();
115
+ const next = preferred && items.includes(preferred)
116
+ ? preferred
117
+ : this.tabStop && items.includes(this.tabStop)
118
+ ? this.tabStop
119
+ : items[0] ?? null;
120
+ this.tabStop = next;
121
+ for (const item of items) {
122
+ item.dispatchEvent(new CustomEvent('ui-tree-roving-tab-stop', {
123
+ detail: { active: item === next },
124
+ }));
125
+ }
95
126
  }
96
127
  itemFromEvent(event) {
97
128
  return event.composedPath().find(node => (node instanceof HTMLElement && node.localName === 'ui-tree-item')) ?? null;
98
129
  }
130
+ eventTargetsInteractiveContent(event) {
131
+ for (const node of event.composedPath()) {
132
+ if (node instanceof HTMLElement && node.localName === 'ui-tree-item')
133
+ break;
134
+ if (node instanceof HTMLElement && node.matches('a, button, input, select, textarea, [role="button"], [role="link"]')) {
135
+ return true;
136
+ }
137
+ }
138
+ return false;
139
+ }
99
140
  itemId(item) {
100
141
  return item.itemId || item.getAttribute('item-id') || '';
101
142
  }
@@ -143,9 +184,23 @@ const UITree = class {
143
184
  const dropDepth = item.getAttribute('drop-depth');
144
185
  if (dropDepth !== null)
145
186
  return Number(dropDepth);
146
- if (item.depth !== undefined)
147
- return item.depth;
148
- return Number(item.getAttribute('depth')) || 1;
187
+ return Number(item.getAttribute('aria-level')) || 1;
188
+ }
189
+ subtreeDepth(item) {
190
+ if (item.subtreeDepth !== undefined)
191
+ return Math.max(0, Math.floor(item.subtreeDepth));
192
+ const override = item.getAttribute('subtree-depth');
193
+ if (override !== null)
194
+ return Math.max(0, Math.floor(Number(override)));
195
+ return Array.from(item.querySelectorAll('ui-tree-item')).reduce((deepest, descendant) => {
196
+ let nesting = 0;
197
+ let ancestor = descendant.parentElement?.closest('ui-tree-item') ?? null;
198
+ while (ancestor && ancestor !== item) {
199
+ nesting += 1;
200
+ ancestor = ancestor.parentElement?.closest('ui-tree-item') ?? null;
201
+ }
202
+ return ancestor === item ? Math.max(deepest, nesting + 1) : deepest;
203
+ }, 0);
149
204
  }
150
205
  dropRejection(source, target, position) {
151
206
  // A tree item can never move into (or beside) one of its own descendants.
@@ -165,9 +220,9 @@ const UITree = class {
165
220
  return { reason: 'incompatible' };
166
221
  }
167
222
  const maxDepth = Math.max(0, Math.floor(this.maxDepth));
168
- if (maxDepth > 0 && source.subtreeDepth !== undefined) {
223
+ if (maxDepth > 0) {
169
224
  const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
170
- const subtreeDepth = Math.max(0, Math.floor(source.subtreeDepth));
225
+ const subtreeDepth = this.subtreeDepth(source);
171
226
  const resultingDepth = targetDepth + (position === 'inside' ? 1 : 0) + subtreeDepth;
172
227
  if (resultingDepth > maxDepth)
173
228
  return { reason: 'max-depth', maxDepth, resultingDepth };
@@ -363,7 +418,35 @@ const UITree = class {
363
418
  return Array.from(this.host.querySelectorAll('ui-tree-item'))
364
419
  .filter(item => item.getClientRects().length > 0 && !item.hasAttribute('disabled'));
365
420
  }
421
+ parentItem(item) {
422
+ const parent = item.parentElement?.closest('ui-tree-item') ?? null;
423
+ return parent && this.host.contains(parent) ? parent : null;
424
+ }
425
+ firstVisibleChild(item, items) {
426
+ return items.find(candidate => this.parentItem(candidate) === item) ?? null;
427
+ }
428
+ focusItem(item) {
429
+ this.syncTabStop(item);
430
+ item.focus();
431
+ }
432
+ requestExpansion(item, expanded) {
433
+ item.dispatchEvent(new CustomEvent('ui-tree-request-expanded', {
434
+ detail: { expanded, trigger: 'keyboard' },
435
+ }));
436
+ }
437
+ onFocusIn = (event) => {
438
+ if (this.eventTargetsInteractiveContent(event))
439
+ return;
440
+ const item = this.itemFromEvent(event);
441
+ if (item)
442
+ this.syncTabStop(item);
443
+ };
444
+ onExpansionChange = () => {
445
+ requestAnimationFrame(() => this.syncTabStop());
446
+ };
366
447
  onKeyDown = (event) => {
448
+ if (this.eventTargetsInteractiveContent(event))
449
+ return;
367
450
  const current = this.itemFromEvent(event);
368
451
  if (!current)
369
452
  return;
@@ -371,14 +454,43 @@ const UITree = class {
371
454
  const index = items.indexOf(current);
372
455
  if (index < 0)
373
456
  return;
374
- const next = event.key === 'ArrowDown' ? items[index + 1] : event.key === 'ArrowUp' ? items[index - 1] : null;
375
- if (!next)
457
+ const next = event.key === 'ArrowDown' ? items[index + 1]
458
+ : event.key === 'ArrowUp' ? items[index - 1]
459
+ : event.key === 'Home' ? items[0]
460
+ : event.key === 'End' ? items.at(-1)
461
+ : null;
462
+ if (next) {
463
+ event.preventDefault();
464
+ this.focusItem(next);
376
465
  return;
377
- event.preventDefault();
378
- next.focus();
466
+ }
467
+ if (event.key === 'ArrowLeft') {
468
+ if (current.getAttribute('aria-expanded') === 'true') {
469
+ event.preventDefault();
470
+ this.requestExpansion(current, false);
471
+ }
472
+ else if (this.parentItem(current)) {
473
+ event.preventDefault();
474
+ this.focusItem(this.parentItem(current));
475
+ }
476
+ return;
477
+ }
478
+ if (event.key === 'ArrowRight') {
479
+ if (current.getAttribute('aria-expanded') === 'false') {
480
+ event.preventDefault();
481
+ this.requestExpansion(current, true);
482
+ }
483
+ else if (current.getAttribute('aria-expanded') === 'true') {
484
+ const child = this.firstVisibleChild(current, items);
485
+ if (child) {
486
+ event.preventDefault();
487
+ this.focusItem(child);
488
+ }
489
+ }
490
+ }
379
491
  };
380
492
  render() {
381
- return (h(Host, { key: '474c2154d2abe3c76eee9c36bf552390089df6e8', role: "tree", "aria-label": this.label || 'Tree' }, h("slot", { key: '93aedd02f984dd33b5efc811fef417d1199917bd' })));
493
+ return (h(Host, { key: '7efbf793fe63471006df57f0045a5fe995c81440', role: "tree", "aria-label": this.label || 'Tree' }, h("slot", { key: '1804e391796e7451c93cb58258e0e23ec3ad98c7' })));
382
494
  }
383
495
  };
384
496
  UITree.style = uiTreeCss();