@threadlabs/looma 0.28.5 → 0.28.7

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 (453) hide show
  1. package/components/ui-editor-block-actions/ui-editor-block-actions.html +20 -0
  2. package/components/ui-editor-block-actions/ui-editor-block-actions.js +14 -0
  3. package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.html +7 -6
  4. package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.js +2 -1
  5. package/components/ui-editor-link-card/ui-editor-link-card.html +57 -0
  6. package/components/ui-editor-link-card/ui-editor-link-card.js +27 -0
  7. package/components/ui-editor-mention-menu-item/ui-editor-mention-menu-item.html +3 -2
  8. package/dist/index.js +36 -34
  9. package/package.json +3 -2
  10. package/styles/ui-action-bar.css +13 -6
  11. package/styles/ui-affordance-scope.css +12 -5
  12. package/styles/ui-avatar-group.css +17 -10
  13. package/styles/ui-avatar.css +23 -16
  14. package/styles/ui-badge.css +78 -71
  15. package/styles/ui-breadcrumb-item.css +12 -5
  16. package/styles/ui-breadcrumbs.css +10 -3
  17. package/styles/ui-button.css +79 -72
  18. package/styles/ui-callout.css +29 -22
  19. package/styles/ui-card.css +25 -18
  20. package/styles/ui-checkbox.css +45 -37
  21. package/styles/ui-cluster.css +34 -27
  22. package/styles/ui-combobox.css +46 -39
  23. package/styles/ui-container.css +20 -13
  24. package/styles/ui-context-menu.css +17 -10
  25. package/styles/ui-cover.css +12 -5
  26. package/styles/ui-description-item.css +10 -3
  27. package/styles/ui-description-list.css +20 -13
  28. package/styles/ui-dialog.css +44 -35
  29. package/styles/ui-disclosure.css +32 -25
  30. package/styles/ui-editable.css +15 -8
  31. package/styles/ui-editor-block-actions.css +1 -0
  32. package/styles/ui-editor-image-toolbar.css +1 -1
  33. package/styles/ui-editor-insert-table-grid.css +11 -4
  34. package/styles/ui-editor-link-card.css +1 -0
  35. package/styles/ui-editor-mention-menu-item.css +17 -8
  36. package/styles/ui-editor-mention-menu.css +14 -7
  37. package/styles/ui-editor-slash-menu-group.css +10 -3
  38. package/styles/ui-editor-slash-menu-item.css +15 -8
  39. package/styles/ui-editor-slash-menu.css +15 -8
  40. package/styles/ui-editor-surface.css +10 -3
  41. package/styles/ui-editor-table-context-menu.css +17 -10
  42. package/styles/ui-editor-table-overlay.css +17 -10
  43. package/styles/ui-editor-table-toolbar.css +22 -15
  44. package/styles/ui-editor-toolbar.css +18 -11
  45. package/styles/ui-floating-action-button.css +21 -14
  46. package/styles/ui-form-field.css +20 -13
  47. package/styles/ui-grid.css +21 -14
  48. package/styles/ui-icon-button.css +80 -73
  49. package/styles/ui-icon.css +14 -7
  50. package/styles/ui-image.css +25 -18
  51. package/styles/ui-input-group.css +34 -27
  52. package/styles/ui-input.css +42 -35
  53. package/styles/ui-list-item.css +33 -26
  54. package/styles/ui-list.css +22 -15
  55. package/styles/ui-listbox.css +22 -14
  56. package/styles/ui-menu-group.css +10 -3
  57. package/styles/ui-menu-item.css +29 -22
  58. package/styles/ui-menu.css +25 -18
  59. package/styles/ui-meter.css +36 -29
  60. package/styles/ui-nav-item.css +26 -19
  61. package/styles/ui-page-header.css +12 -5
  62. package/styles/ui-popover.css +27 -20
  63. package/styles/ui-radio-group.css +14 -6
  64. package/styles/ui-radio.css +24 -17
  65. package/styles/ui-reel.css +28 -21
  66. package/styles/ui-scroll-area.css +22 -15
  67. package/styles/ui-search-result-row.css +28 -21
  68. package/styles/ui-search-shell.css +24 -17
  69. package/styles/ui-section.css +14 -7
  70. package/styles/ui-select.css +33 -26
  71. package/styles/ui-separator.css +17 -10
  72. package/styles/ui-sidebar.css +35 -28
  73. package/styles/ui-spinner.css +32 -23
  74. package/styles/ui-stack.css +29 -21
  75. package/styles/ui-status-message.css +14 -7
  76. package/styles/ui-switch.css +29 -22
  77. package/styles/ui-switcher.css +27 -20
  78. package/styles/ui-table.css +14 -7
  79. package/styles/ui-tabs.css +24 -17
  80. package/styles/ui-text.css +35 -28
  81. package/styles/ui-textarea.css +37 -30
  82. package/styles/ui-toast-region.css +74 -63
  83. package/styles/ui-toast.css +21 -14
  84. package/styles/ui-tooltip.css +38 -31
  85. package/styles/ui-top-bar.css +19 -12
  86. package/styles/ui-tree-item.css +79 -71
  87. package/styles/ui-tree.css +18 -11
  88. package/vanilla/UiActionBar.d.ts +1 -1
  89. package/vanilla/UiActionBar.js +1 -1
  90. package/vanilla/UiAffordanceScope.d.ts +1 -1
  91. package/vanilla/UiAffordanceScope.js +1 -1
  92. package/vanilla/UiAvatar.d.ts +1 -1
  93. package/vanilla/UiAvatar.js +1 -1
  94. package/vanilla/UiAvatarGroup.d.ts +1 -1
  95. package/vanilla/UiAvatarGroup.js +1 -1
  96. package/vanilla/UiBadge.d.ts +1 -1
  97. package/vanilla/UiBadge.js +1 -1
  98. package/vanilla/UiBreadcrumbItem.d.ts +1 -1
  99. package/vanilla/UiBreadcrumbItem.js +1 -1
  100. package/vanilla/UiBreadcrumbs.d.ts +1 -1
  101. package/vanilla/UiBreadcrumbs.js +1 -1
  102. package/vanilla/UiButton.d.ts +1 -1
  103. package/vanilla/UiButton.js +19 -57
  104. package/vanilla/UiCallout.d.ts +1 -1
  105. package/vanilla/UiCallout.js +25 -73
  106. package/vanilla/UiCard.d.ts +1 -1
  107. package/vanilla/UiCard.js +1 -1
  108. package/vanilla/UiCheckbox.d.ts +1 -1
  109. package/vanilla/UiCheckbox.js +1 -1
  110. package/vanilla/UiCluster.d.ts +1 -1
  111. package/vanilla/UiCluster.js +1 -1
  112. package/vanilla/UiCombobox.d.ts +1 -1
  113. package/vanilla/UiCombobox.js +60 -166
  114. package/vanilla/UiContainer.d.ts +1 -1
  115. package/vanilla/UiContainer.js +1 -1
  116. package/vanilla/UiContextMenu.d.ts +1 -1
  117. package/vanilla/UiContextMenu.js +1 -1
  118. package/vanilla/UiCover.d.ts +1 -1
  119. package/vanilla/UiCover.js +1 -1
  120. package/vanilla/UiDescriptionItem.d.ts +1 -1
  121. package/vanilla/UiDescriptionItem.js +1 -1
  122. package/vanilla/UiDescriptionList.d.ts +1 -1
  123. package/vanilla/UiDescriptionList.js +1 -1
  124. package/vanilla/UiDialog.d.ts +1 -1
  125. package/vanilla/UiDialog.js +4 -10
  126. package/vanilla/UiDisclosure.d.ts +1 -1
  127. package/vanilla/UiDisclosure.js +1 -1
  128. package/vanilla/UiEditable.d.ts +1 -1
  129. package/vanilla/UiEditable.js +7 -19
  130. package/vanilla/UiEditorBlockActions.d.ts +16 -0
  131. package/vanilla/UiEditorBlockActions.js +41 -0
  132. package/vanilla/UiEditorImageToolbar.d.ts +1 -1
  133. package/vanilla/UiEditorImageToolbar.js +2 -2
  134. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  135. package/vanilla/UiEditorInsertTableGrid.js +1 -1
  136. package/vanilla/UiEditorLinkCard.d.ts +20 -0
  137. package/vanilla/UiEditorLinkCard.js +153 -0
  138. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  139. package/vanilla/UiEditorMentionMenu.js +17 -37
  140. package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
  141. package/vanilla/UiEditorMentionMenuItem.js +4 -10
  142. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  143. package/vanilla/UiEditorSlashMenu.js +5 -4
  144. package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
  145. package/vanilla/UiEditorSlashMenuGroup.js +1 -1
  146. package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
  147. package/vanilla/UiEditorSlashMenuItem.js +7 -19
  148. package/vanilla/UiEditorSurface.d.ts +1 -1
  149. package/vanilla/UiEditorSurface.js +1 -1
  150. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  151. package/vanilla/UiEditorTableContextMenu.js +6 -14
  152. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  153. package/vanilla/UiEditorTableOverlay.js +9 -25
  154. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  155. package/vanilla/UiEditorTableToolbar.js +25 -77
  156. package/vanilla/UiEditorToolbar.d.ts +1 -1
  157. package/vanilla/UiEditorToolbar.js +1 -1
  158. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  159. package/vanilla/UiFloatingActionButton.js +1 -1
  160. package/vanilla/UiFormField.d.ts +1 -1
  161. package/vanilla/UiFormField.js +1 -1
  162. package/vanilla/UiGrid.d.ts +1 -1
  163. package/vanilla/UiGrid.js +1 -1
  164. package/vanilla/UiIcon.d.ts +1 -1
  165. package/vanilla/UiIcon.js +15 -47
  166. package/vanilla/UiIconButton.d.ts +1 -1
  167. package/vanilla/UiIconButton.js +4 -10
  168. package/vanilla/UiImage.d.ts +1 -1
  169. package/vanilla/UiImage.js +1 -1
  170. package/vanilla/UiInput.d.ts +1 -1
  171. package/vanilla/UiInput.js +1 -1
  172. package/vanilla/UiInputGroup.d.ts +1 -1
  173. package/vanilla/UiInputGroup.js +1 -1
  174. package/vanilla/UiList.d.ts +1 -1
  175. package/vanilla/UiList.js +1 -1
  176. package/vanilla/UiListItem.d.ts +1 -1
  177. package/vanilla/UiListItem.js +1 -1
  178. package/vanilla/UiListbox.d.ts +1 -1
  179. package/vanilla/UiListbox.js +4 -10
  180. package/vanilla/UiMenu.d.ts +1 -1
  181. package/vanilla/UiMenu.js +1 -1
  182. package/vanilla/UiMenuGroup.d.ts +1 -1
  183. package/vanilla/UiMenuGroup.js +4 -10
  184. package/vanilla/UiMenuItem.d.ts +1 -1
  185. package/vanilla/UiMenuItem.js +4 -10
  186. package/vanilla/UiMeter.d.ts +1 -1
  187. package/vanilla/UiMeter.js +13 -33
  188. package/vanilla/UiNavItem.d.ts +1 -1
  189. package/vanilla/UiNavItem.js +1 -1
  190. package/vanilla/UiPageHeader.d.ts +1 -1
  191. package/vanilla/UiPageHeader.js +1 -1
  192. package/vanilla/UiPopover.d.ts +1 -1
  193. package/vanilla/UiPopover.js +1 -1
  194. package/vanilla/UiRadio.d.ts +1 -1
  195. package/vanilla/UiRadio.js +1 -1
  196. package/vanilla/UiRadioGroup.d.ts +1 -1
  197. package/vanilla/UiRadioGroup.js +1 -1
  198. package/vanilla/UiReel.d.ts +1 -1
  199. package/vanilla/UiReel.js +1 -1
  200. package/vanilla/UiScrollArea.d.ts +1 -1
  201. package/vanilla/UiScrollArea.js +1 -1
  202. package/vanilla/UiSearchResultRow.d.ts +1 -1
  203. package/vanilla/UiSearchResultRow.js +1 -1
  204. package/vanilla/UiSearchShell.d.ts +1 -1
  205. package/vanilla/UiSearchShell.js +1 -1
  206. package/vanilla/UiSection.d.ts +1 -1
  207. package/vanilla/UiSection.js +1 -1
  208. package/vanilla/UiSelect.d.ts +1 -1
  209. package/vanilla/UiSelect.js +1 -1
  210. package/vanilla/UiSeparator.d.ts +1 -1
  211. package/vanilla/UiSeparator.js +1 -1
  212. package/vanilla/UiSidebar.d.ts +1 -1
  213. package/vanilla/UiSidebar.js +1 -1
  214. package/vanilla/UiSpinner.d.ts +1 -1
  215. package/vanilla/UiSpinner.js +1 -1
  216. package/vanilla/UiStack.d.ts +1 -1
  217. package/vanilla/UiStack.js +1 -1
  218. package/vanilla/UiStatusMessage.d.ts +1 -1
  219. package/vanilla/UiStatusMessage.js +1 -1
  220. package/vanilla/UiSwitch.d.ts +1 -1
  221. package/vanilla/UiSwitch.js +1 -1
  222. package/vanilla/UiSwitcher.d.ts +1 -1
  223. package/vanilla/UiSwitcher.js +1 -1
  224. package/vanilla/UiTable.d.ts +1 -1
  225. package/vanilla/UiTable.js +1 -1
  226. package/vanilla/UiTabs.d.ts +1 -1
  227. package/vanilla/UiTabs.js +1 -1
  228. package/vanilla/UiText.d.ts +1 -1
  229. package/vanilla/UiText.js +1 -1
  230. package/vanilla/UiTextarea.d.ts +1 -1
  231. package/vanilla/UiTextarea.js +1 -1
  232. package/vanilla/UiToast.d.ts +1 -1
  233. package/vanilla/UiToast.js +1 -1
  234. package/vanilla/UiToastRegion.d.ts +1 -1
  235. package/vanilla/UiToastRegion.js +1 -1
  236. package/vanilla/UiTooltip.d.ts +1 -1
  237. package/vanilla/UiTooltip.js +1 -1
  238. package/vanilla/UiTopBar.d.ts +1 -1
  239. package/vanilla/UiTopBar.js +1 -1
  240. package/vanilla/UiTree.d.ts +1 -1
  241. package/vanilla/UiTree.js +1 -1
  242. package/vanilla/UiTreeItem.d.ts +1 -1
  243. package/vanilla/UiTreeItem.js +7 -19
  244. package/vanilla/index.js +2 -0
  245. package/vue/UiActionBar.vue +46 -78
  246. package/vue/UiAffordanceScope.vue +27 -66
  247. package/vue/UiAvatar.d.ts +10 -7
  248. package/vue/UiAvatar.vue +100 -218
  249. package/vue/UiAvatarGroup.d.ts +10 -7
  250. package/vue/UiAvatarGroup.vue +78 -160
  251. package/vue/UiBadge.d.ts +1 -1
  252. package/vue/UiBadge.vue +483 -520
  253. package/vue/UiBreadcrumbItem.vue +52 -123
  254. package/vue/UiBreadcrumbs.vue +27 -70
  255. package/vue/UiButton.d.ts +2 -2
  256. package/vue/UiButton.vue +420 -471
  257. package/vue/UiCallout.vue +131 -175
  258. package/vue/UiCard.d.ts +1 -1
  259. package/vue/UiCard.vue +112 -151
  260. package/vue/UiCheckbox.d.ts +13 -10
  261. package/vue/UiCheckbox.vue +160 -221
  262. package/vue/UiCluster.d.ts +1 -1
  263. package/vue/UiCluster.vue +84 -128
  264. package/vue/UiCombobox.d.ts +71 -68
  265. package/vue/UiCombobox.vue +417 -743
  266. package/vue/UiContainer.vue +43 -87
  267. package/vue/UiContextMenu.d.ts +6 -6
  268. package/vue/UiContextMenu.vue +78 -117
  269. package/vue/UiCover.vue +29 -69
  270. package/vue/UiDescriptionItem.vue +39 -82
  271. package/vue/UiDescriptionList.vue +64 -107
  272. package/vue/UiDialog.d.ts +22 -19
  273. package/vue/UiDialog.vue +193 -246
  274. package/vue/UiDisclosure.d.ts +22 -19
  275. package/vue/UiDisclosure.vue +192 -283
  276. package/vue/UiEditable.d.ts +5 -5
  277. package/vue/UiEditable.vue +124 -207
  278. package/vue/UiEditorBlockActions.d.ts +33 -0
  279. package/vue/UiEditorBlockActions.js +2 -0
  280. package/vue/UiEditorBlockActions.vue +125 -0
  281. package/vue/UiEditorImageToolbar.d.ts +2 -2
  282. package/vue/UiEditorImageToolbar.vue +45 -256
  283. package/vue/UiEditorInsertTableGrid.d.ts +2 -2
  284. package/vue/UiEditorInsertTableGrid.vue +98 -266
  285. package/vue/UiEditorLinkCard.d.ts +58 -0
  286. package/vue/UiEditorLinkCard.js +2 -0
  287. package/vue/UiEditorLinkCard.vue +319 -0
  288. package/vue/UiEditorMentionMenu.d.ts +15 -12
  289. package/vue/UiEditorMentionMenu.vue +150 -239
  290. package/vue/UiEditorMentionMenuItem.vue +66 -110
  291. package/vue/UiEditorSlashMenu.d.ts +16 -13
  292. package/vue/UiEditorSlashMenu.vue +172 -253
  293. package/vue/UiEditorSlashMenuGroup.vue +25 -69
  294. package/vue/UiEditorSlashMenuItem.vue +67 -115
  295. package/vue/UiEditorSurface.vue +19 -63
  296. package/vue/UiEditorTableContextMenu.vue +135 -269
  297. package/vue/UiEditorTableOverlay.d.ts +2 -2
  298. package/vue/UiEditorTableOverlay.vue +310 -479
  299. package/vue/UiEditorTableToolbar.d.ts +2 -2
  300. package/vue/UiEditorTableToolbar.vue +182 -357
  301. package/vue/UiEditorToolbar.vue +143 -183
  302. package/vue/UiFloatingActionButton.vue +70 -114
  303. package/vue/UiFormField.d.ts +1 -1
  304. package/vue/UiFormField.vue +76 -117
  305. package/vue/UiGrid.d.ts +1 -1
  306. package/vue/UiGrid.vue +65 -103
  307. package/vue/UiIcon.vue +32 -106
  308. package/vue/UiIconButton.d.ts +2 -2
  309. package/vue/UiIconButton.vue +359 -411
  310. package/vue/UiImage.vue +145 -180
  311. package/vue/UiInput.vue +158 -190
  312. package/vue/UiInputGroup.vue +199 -239
  313. package/vue/UiList.vue +67 -109
  314. package/vue/UiListItem.vue +154 -201
  315. package/vue/UiListbox.d.ts +10 -7
  316. package/vue/UiListbox.vue +86 -260
  317. package/vue/UiMenu.d.ts +11 -11
  318. package/vue/UiMenu.vue +118 -152
  319. package/vue/UiMenuGroup.vue +21 -67
  320. package/vue/UiMenuItem.d.ts +19 -16
  321. package/vue/UiMenuItem.vue +169 -262
  322. package/vue/UiMeter.d.ts +4 -4
  323. package/vue/UiMeter.vue +166 -680
  324. package/vue/UiNavItem.vue +140 -213
  325. package/vue/UiPageHeader.vue +81 -127
  326. package/vue/UiPopover.d.ts +7 -7
  327. package/vue/UiPopover.vue +90 -129
  328. package/vue/UiRadio.d.ts +12 -9
  329. package/vue/UiRadio.vue +91 -149
  330. package/vue/UiRadioGroup.d.ts +2 -2
  331. package/vue/UiRadioGroup.vue +47 -85
  332. package/vue/UiReel.vue +89 -130
  333. package/vue/UiScrollArea.d.ts +1 -1
  334. package/vue/UiScrollArea.vue +78 -119
  335. package/vue/UiSearchResultRow.vue +96 -149
  336. package/vue/UiSearchShell.d.ts +2 -2
  337. package/vue/UiSearchShell.vue +159 -196
  338. package/vue/UiSection.vue +105 -149
  339. package/vue/UiSelect.d.ts +1 -1
  340. package/vue/UiSelect.vue +114 -146
  341. package/vue/UiSeparator.vue +42 -85
  342. package/vue/UiSidebar.d.ts +10 -7
  343. package/vue/UiSidebar.vue +193 -260
  344. package/vue/UiSpinner.vue +54 -130
  345. package/vue/UiStack.vue +66 -107
  346. package/vue/UiStatusMessage.d.ts +1 -1
  347. package/vue/UiStatusMessage.vue +61 -135
  348. package/vue/UiSwitch.d.ts +12 -9
  349. package/vue/UiSwitch.vue +136 -194
  350. package/vue/UiSwitcher.vue +69 -107
  351. package/vue/UiTable.vue +121 -156
  352. package/vue/UiTabs.d.ts +1 -1
  353. package/vue/UiTabs.vue +139 -267
  354. package/vue/UiText.d.ts +4 -4
  355. package/vue/UiText.vue +145 -184
  356. package/vue/UiTextarea.d.ts +2 -2
  357. package/vue/UiTextarea.vue +162 -194
  358. package/vue/UiToast.vue +70 -118
  359. package/vue/UiToastRegion.vue +157 -276
  360. package/vue/UiTooltip.d.ts +21 -18
  361. package/vue/UiTooltip.vue +174 -234
  362. package/vue/UiTopBar.vue +48 -76
  363. package/vue/UiTree.vue +46 -79
  364. package/vue/UiTreeItem.d.ts +18 -15
  365. package/vue/UiTreeItem.vue +526 -668
  366. package/vue/chunks/UiActionBar.js +5 -17
  367. package/vue/chunks/UiAffordanceScope.js +7 -26
  368. package/vue/chunks/UiAvatar.js +20 -74
  369. package/vue/chunks/UiAvatarGroup.js +14 -56
  370. package/vue/chunks/UiBadge.js +10 -28
  371. package/vue/chunks/UiBreadcrumbItem.js +11 -41
  372. package/vue/chunks/UiBreadcrumbs.js +7 -25
  373. package/vue/chunks/UiButton.js +80 -103
  374. package/vue/chunks/UiCallout.js +9 -27
  375. package/vue/chunks/UiCard.js +33 -53
  376. package/vue/chunks/UiCheckbox.js +14 -46
  377. package/vue/chunks/UiCluster.js +13 -31
  378. package/vue/chunks/UiCombobox.js +99 -237
  379. package/vue/chunks/UiContainer.js +9 -27
  380. package/vue/chunks/UiContextMenu.js +7 -26
  381. package/vue/chunks/UiCover.js +7 -25
  382. package/vue/chunks/UiDescriptionItem.js +6 -24
  383. package/vue/chunks/UiDescriptionList.js +9 -27
  384. package/vue/chunks/UiDialog.js +18 -47
  385. package/vue/chunks/UiDisclosure.js +19 -66
  386. package/vue/chunks/UiEditable.js +18 -60
  387. package/vue/chunks/UiEditorBlockActions.js +127 -0
  388. package/vue/chunks/UiEditorImageToolbar.js +40 -127
  389. package/vue/chunks/UiEditorInsertTableGrid.js +14 -112
  390. package/vue/chunks/UiEditorLinkCard.js +356 -0
  391. package/vue/chunks/UiEditorMentionMenu.js +16 -54
  392. package/vue/chunks/UiEditorMentionMenuItem.js +10 -28
  393. package/vue/chunks/UiEditorSlashMenu.js +17 -46
  394. package/vue/chunks/UiEditorSlashMenuGroup.js +7 -25
  395. package/vue/chunks/UiEditorSlashMenuItem.js +16 -31
  396. package/vue/chunks/UiEditorSurface.js +7 -25
  397. package/vue/chunks/UiEditorTableContextMenu.js +25 -102
  398. package/vue/chunks/UiEditorTableOverlay.js +41 -104
  399. package/vue/chunks/UiEditorTableToolbar.js +44 -122
  400. package/vue/chunks/UiEditorToolbar.js +7 -26
  401. package/vue/chunks/UiFloatingActionButton.js +10 -28
  402. package/vue/chunks/UiFormField.js +8 -27
  403. package/vue/chunks/UiGrid.js +10 -28
  404. package/vue/chunks/UiIcon.js +21 -74
  405. package/vue/chunks/UiIconButton.js +18 -50
  406. package/vue/chunks/UiImage.js +14 -33
  407. package/vue/chunks/UiInput.js +12 -31
  408. package/vue/chunks/UiInputGroup.js +10 -29
  409. package/vue/chunks/UiList.js +17 -37
  410. package/vue/chunks/UiListItem.js +12 -30
  411. package/vue/chunks/UiListbox.js +22 -124
  412. package/vue/chunks/UiMenu.js +13 -32
  413. package/vue/chunks/UiMenuGroup.js +8 -26
  414. package/vue/chunks/UiMenuItem.js +35 -80
  415. package/vue/chunks/UiMeter.js +17 -351
  416. package/vue/chunks/UiNavItem.js +23 -57
  417. package/vue/chunks/UiPageHeader.js +7 -25
  418. package/vue/chunks/UiPopover.js +9 -28
  419. package/vue/chunks/UiRadio.js +11 -43
  420. package/vue/chunks/UiRadioGroup.js +13 -32
  421. package/vue/chunks/UiReel.js +10 -28
  422. package/vue/chunks/UiScrollArea.js +10 -29
  423. package/vue/chunks/UiSearchResultRow.js +10 -28
  424. package/vue/chunks/UiSearchShell.js +9 -28
  425. package/vue/chunks/UiSection.js +9 -27
  426. package/vue/chunks/UiSelect.js +10 -29
  427. package/vue/chunks/UiSeparator.js +10 -28
  428. package/vue/chunks/UiSidebar.js +15 -47
  429. package/vue/chunks/UiSpinner.js +8 -44
  430. package/vue/chunks/UiStack.js +12 -30
  431. package/vue/chunks/UiStatusMessage.js +10 -42
  432. package/vue/chunks/UiSwitch.js +11 -43
  433. package/vue/chunks/UiSwitcher.js +9 -28
  434. package/vue/chunks/UiTable.js +7 -26
  435. package/vue/chunks/UiTabs.js +15 -91
  436. package/vue/chunks/UiText.js +148 -168
  437. package/vue/chunks/UiTextarea.js +16 -35
  438. package/vue/chunks/UiToast.js +13 -37
  439. package/vue/chunks/UiToastRegion.js +16 -88
  440. package/vue/chunks/UiTooltip.js +14 -46
  441. package/vue/chunks/UiTopBar.js +5 -17
  442. package/vue/chunks/UiTree.js +13 -32
  443. package/vue/chunks/UiTreeItem.js +34 -90
  444. package/vue/chunks/_plugin-vue_export-helper.js +904 -1
  445. package/vue/chunks/control.js +3 -0
  446. package/vue/chunks/props.js +1 -1
  447. package/vue/components.css +7689 -7617
  448. package/vue/editor/index.js +30 -95
  449. package/vue/editor/primitives.d.ts +8 -2
  450. package/vue/host.ts +999 -14
  451. package/vue/index.d.ts +2 -0
  452. package/vue/index.js +5 -3
  453. package/vue/chunks/host.js +0 -443
package/vue/index.d.ts CHANGED
@@ -19,8 +19,10 @@ export { default as DescriptionList } from "./UiDescriptionList.js";
19
19
  export { default as Dialog } from "./UiDialog.js";
20
20
  export { default as Disclosure } from "./UiDisclosure.js";
21
21
  export { default as Editable } from "./UiEditable.js";
22
+ export { default as EditorBlockActions } from "./UiEditorBlockActions.js";
22
23
  export { default as EditorImageToolbar } from "./UiEditorImageToolbar.js";
23
24
  export { default as EditorInsertTableGrid } from "./UiEditorInsertTableGrid.js";
25
+ export { default as EditorLinkCard } from "./UiEditorLinkCard.js";
24
26
  export { default as EditorMentionMenu } from "./UiEditorMentionMenu.js";
25
27
  export { default as EditorMentionMenuItem } from "./UiEditorMentionMenuItem.js";
26
28
  export { default as EditorSlashMenu } from "./UiEditorSlashMenu.js";
package/vue/index.js CHANGED
@@ -23,6 +23,9 @@ import { t as UiScrollArea_default } from "./chunks/UiScrollArea.js";
23
23
  import { t as UiDialog_default } from "./chunks/UiDialog.js";
24
24
  import { t as UiDisclosure_default } from "./chunks/UiDisclosure.js";
25
25
  import { t as UiEditable_default } from "./chunks/UiEditable.js";
26
+ import { t as UiMenu_default } from "./chunks/UiMenu.js";
27
+ import { t as UiMenuItem_default } from "./chunks/UiMenuItem.js";
28
+ import { t as UiEditorBlockActions_default } from "./chunks/UiEditorBlockActions.js";
26
29
  import { t as UiEditorToolbar_default } from "./chunks/UiEditorToolbar.js";
27
30
  import { t as UiFormField_default } from "./chunks/UiFormField.js";
28
31
  import { t as UiIconButton_default } from "./chunks/UiIconButton.js";
@@ -32,6 +35,7 @@ import { t as UiStack_default } from "./chunks/UiStack.js";
32
35
  import { t as UiText_default } from "./chunks/UiText.js";
33
36
  import { t as UiEditorImageToolbar_default } from "./chunks/UiEditorImageToolbar.js";
34
37
  import { t as UiEditorInsertTableGrid_default } from "./chunks/UiEditorInsertTableGrid.js";
38
+ import { t as UiEditorLinkCard_default } from "./chunks/UiEditorLinkCard.js";
35
39
  import { t as UiEditorMentionMenu_default } from "./chunks/UiEditorMentionMenu.js";
36
40
  import { t as UiEditorMentionMenuItem_default } from "./chunks/UiEditorMentionMenuItem.js";
37
41
  import { t as UiEditorSlashMenu_default } from "./chunks/UiEditorSlashMenu.js";
@@ -48,9 +52,7 @@ import { t as UiInputGroup_default } from "./chunks/UiInputGroup.js";
48
52
  import { t as UiList_default } from "./chunks/UiList.js";
49
53
  import { t as UiListItem_default } from "./chunks/UiListItem.js";
50
54
  import { t as UiListbox_default } from "./chunks/UiListbox.js";
51
- import { t as UiMenu_default } from "./chunks/UiMenu.js";
52
55
  import { t as UiMenuGroup_default } from "./chunks/UiMenuGroup.js";
53
- import { t as UiMenuItem_default } from "./chunks/UiMenuItem.js";
54
56
  import { t as UiMeter_default } from "./chunks/UiMeter.js";
55
57
  import { t as UiNavItem_default } from "./chunks/UiNavItem.js";
56
58
  import { t as UiPageHeader_default } from "./chunks/UiPageHeader.js";
@@ -75,4 +77,4 @@ import { t as UiTopBar_default } from "./chunks/UiTopBar.js";
75
77
  import { t as UiTree_default } from "./chunks/UiTree.js";
76
78
  import { t as UiTreeItem_default } from "./chunks/UiTreeItem.js";
77
79
  import { trackInputModality } from "@threadlabs/looma/components/shared/input-modality.js";
78
- export { UiActionBar_default as ActionBar, UiAffordanceScope_default as AffordanceScope, UiAvatar_default as Avatar, UiAvatarGroup_default as AvatarGroup, UiBadge_default as Badge, UiBreadcrumbItem_default as BreadcrumbItem, UiBreadcrumbs_default as Breadcrumbs, UiButton_default as Button, UiCallout_default as Callout, UiCard_default as Card, UiCheckbox_default as Checkbox, UiCluster_default as Cluster, UiCombobox_default as Combobox, UiContainer_default as Container, UiContextMenu_default as ContextMenu, UiCover_default as Cover, UiDescriptionItem_default as DescriptionItem, UiDescriptionList_default as DescriptionList, UiDialog_default as Dialog, UiDisclosure_default as Disclosure, UiEditable_default as Editable, UiEditorImageToolbar_default as EditorImageToolbar, UiEditorInsertTableGrid_default as EditorInsertTableGrid, UiEditorMentionMenu_default as EditorMentionMenu, UiEditorMentionMenuItem_default as EditorMentionMenuItem, UiEditorSlashMenu_default as EditorSlashMenu, UiEditorSlashMenuGroup_default as EditorSlashMenuGroup, UiEditorSlashMenuItem_default as EditorSlashMenuItem, UiEditorSurface_default as EditorSurface, UiEditorTableContextMenu_default as EditorTableContextMenu, UiEditorTableOverlay_default as EditorTableOverlay, UiEditorTableToolbar_default as EditorTableToolbar, UiEditorToolbar_default as EditorToolbar, UiFloatingActionButton_default as FloatingActionButton, UiFormField_default as FormField, UiGrid_default as Grid, UiIcon_default as Icon, UiIconButton_default as IconButton, UiImage_default as Image, UiInput_default as Input, UiInputGroup_default as InputGroup, UiList_default as List, UiListItem_default as ListItem, UiListbox_default as Listbox, UiMenu_default as Menu, UiMenuGroup_default as MenuGroup, UiMenuItem_default as MenuItem, UiMeter_default as Meter, UiNavItem_default as NavItem, UiPageHeader_default as PageHeader, UiPopover_default as Popover, UiRadio_default as Radio, UiRadioGroup_default as RadioGroup, UiReel_default as Reel, UiScrollArea_default as ScrollArea, UiSearchResultRow_default as SearchResultRow, UiSearchShell_default as SearchShell, UiSection_default as Section, UiSelect_default as Select, UiSeparator_default as Separator, UiSidebar_default as Sidebar, UiSpinner_default as Spinner, UiStack_default as Stack, UiStatusMessage_default as StatusMessage, UiSwitch_default as Switch, UiSwitcher_default as Switcher, UiTable_default as Table, UiTabs_default as Tabs, UiText_default as Text, UiTextarea_default as Textarea, UiToast_default as Toast, UiToastRegion_default as ToastRegion, UiTooltip_default as Tooltip, UiTopBar_default as TopBar, UiTree_default as Tree, UiTreeItem_default as TreeItem, trackInputModality };
80
+ export { UiActionBar_default as ActionBar, UiAffordanceScope_default as AffordanceScope, UiAvatar_default as Avatar, UiAvatarGroup_default as AvatarGroup, UiBadge_default as Badge, UiBreadcrumbItem_default as BreadcrumbItem, UiBreadcrumbs_default as Breadcrumbs, UiButton_default as Button, UiCallout_default as Callout, UiCard_default as Card, UiCheckbox_default as Checkbox, UiCluster_default as Cluster, UiCombobox_default as Combobox, UiContainer_default as Container, UiContextMenu_default as ContextMenu, UiCover_default as Cover, UiDescriptionItem_default as DescriptionItem, UiDescriptionList_default as DescriptionList, UiDialog_default as Dialog, UiDisclosure_default as Disclosure, UiEditable_default as Editable, UiEditorBlockActions_default as EditorBlockActions, UiEditorImageToolbar_default as EditorImageToolbar, UiEditorInsertTableGrid_default as EditorInsertTableGrid, UiEditorLinkCard_default as EditorLinkCard, UiEditorMentionMenu_default as EditorMentionMenu, UiEditorMentionMenuItem_default as EditorMentionMenuItem, UiEditorSlashMenu_default as EditorSlashMenu, UiEditorSlashMenuGroup_default as EditorSlashMenuGroup, UiEditorSlashMenuItem_default as EditorSlashMenuItem, UiEditorSurface_default as EditorSurface, UiEditorTableContextMenu_default as EditorTableContextMenu, UiEditorTableOverlay_default as EditorTableOverlay, UiEditorTableToolbar_default as EditorTableToolbar, UiEditorToolbar_default as EditorToolbar, UiFloatingActionButton_default as FloatingActionButton, UiFormField_default as FormField, UiGrid_default as Grid, UiIcon_default as Icon, UiIconButton_default as IconButton, UiImage_default as Image, UiInput_default as Input, UiInputGroup_default as InputGroup, UiList_default as List, UiListItem_default as ListItem, UiListbox_default as Listbox, UiMenu_default as Menu, UiMenuGroup_default as MenuGroup, UiMenuItem_default as MenuItem, UiMeter_default as Meter, UiNavItem_default as NavItem, UiPageHeader_default as PageHeader, UiPopover_default as Popover, UiRadio_default as Radio, UiRadioGroup_default as RadioGroup, UiReel_default as Reel, UiScrollArea_default as ScrollArea, UiSearchResultRow_default as SearchResultRow, UiSearchShell_default as SearchShell, UiSection_default as Section, UiSelect_default as Select, UiSeparator_default as Separator, UiSidebar_default as Sidebar, UiSpinner_default as Spinner, UiStack_default as Stack, UiStatusMessage_default as StatusMessage, UiSwitch_default as Switch, UiSwitcher_default as Switcher, UiTable_default as Table, UiTabs_default as Tabs, UiText_default as Text, UiTextarea_default as Textarea, UiToast_default as Toast, UiToastRegion_default as ToastRegion, UiTooltip_default as Tooltip, UiTopBar_default as TopBar, UiTree_default as Tree, UiTreeItem_default as TreeItem, trackInputModality };
@@ -1,443 +0,0 @@
1
- import { Fragment, computed, getCurrentInstance, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, shallowRef, useSlots, watchEffect } from "vue";
2
- //#region .build/vue/host.ts
3
- function controllerNamespaces(options, source) {
4
- const reported = /* @__PURE__ */ new Set();
5
- const nested = /* @__PURE__ */ new WeakMap();
6
- const eventType = typeof Event === "undefined" ? void 0 : Object.getOwnPropertyDescriptor(Event.prototype, "type").get;
7
- const eventBrands = /* @__PURE__ */ new WeakMap();
8
- const nativeEvent = (value) => {
9
- if (!("type" in value) || eventType === void 0) return false;
10
- const known = eventBrands.get(value);
11
- if (known !== void 0) return known;
12
- let accepted = false;
13
- try {
14
- eventType.call(value);
15
- accepted = true;
16
- } catch {}
17
- eventBrands.set(value, accepted);
18
- return accepted;
19
- };
20
- const warn = (path, readonly) => {
21
- if (reported.has(path)) return;
22
- reported.add(path);
23
- console.warn(source + ": HR007: Destination " + path + (readonly ? " is read-only." : " does not satisfy its declared type."));
24
- };
25
- const write = (name, keys, value, readonly, apply) => {
26
- if (readonly || options.acceptsState?.(name, keys, value) === false) warn([name, ...keys].join("."), readonly);
27
- else apply();
28
- return true;
29
- };
30
- const wrap = (value, name, keys, readonly) => {
31
- if (value === null || typeof value !== "object" || nativeEvent(value)) return value;
32
- const path = [name, ...keys].join(".");
33
- let paths = nested.get(value);
34
- if (paths === void 0) nested.set(value, paths = /* @__PURE__ */ new Map());
35
- const known = paths.get(path);
36
- if (known !== void 0) return known;
37
- const surface = readonly ? Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value)) : value;
38
- if (readonly && Array.isArray(value)) surface.length = value.length;
39
- const proxy = new Proxy(surface, {
40
- get: (_target, key) => wrap(Reflect.get(value, key), name, [...keys, String(key)], readonly),
41
- set: (_target, key, next) => write(name, [...keys, String(key)], next, readonly, () => {
42
- const previous = Reflect.get(value, key);
43
- if (Reflect.set(value, key, next) && !Object.is(previous, next)) options.changed?.(name);
44
- }),
45
- has: (_target, key) => Reflect.has(value, key),
46
- ownKeys: () => Reflect.ownKeys(value),
47
- getOwnPropertyDescriptor: (_target, key) => {
48
- if (readonly && Array.isArray(value) && key === "length") {
49
- surface.length = value.length;
50
- return Reflect.getOwnPropertyDescriptor(surface, key);
51
- }
52
- const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
53
- return descriptor === void 0 ? void 0 : readonly ? {
54
- ...descriptor,
55
- configurable: true
56
- } : descriptor;
57
- },
58
- deleteProperty: (_target, key) => write(name, [...keys, String(key)], void 0, readonly, () => {
59
- if (Reflect.has(value, key) && Reflect.deleteProperty(value, key)) options.changed?.(name);
60
- }),
61
- defineProperty: (_target, key, descriptor) => {
62
- if (readonly || !("value" in descriptor) || options.acceptsState?.(name, [...keys, String(key)], descriptor.value) === false) {
63
- warn([
64
- name,
65
- ...keys,
66
- String(key)
67
- ].join("."), readonly);
68
- return false;
69
- }
70
- const changed = Reflect.defineProperty(value, key, descriptor);
71
- if (changed) options.changed?.(name);
72
- return changed;
73
- }
74
- });
75
- paths.set(path, proxy);
76
- return proxy;
77
- };
78
- return {
79
- state: new Proxy({}, {
80
- get: (_target, name) => {
81
- if (typeof name !== "string") return void 0;
82
- if (Object.hasOwn(options.state, name)) return wrap(options.state[name].get(), name, [], false);
83
- if (Object.hasOwn(options.computed, name)) return wrap(options.computed[name](), name, [], true);
84
- },
85
- set: (_target, name, value) => write(String(name), [], value, typeof name !== "string" || !Object.hasOwn(options.state, name), () => options.state[String(name)].set(value)),
86
- deleteProperty: (_target, name) => {
87
- warn(String(name), true);
88
- return true;
89
- },
90
- defineProperty: (_target, name) => {
91
- warn(String(name), true);
92
- return false;
93
- },
94
- has: (_target, name) => typeof name === "string" && (Object.hasOwn(options.state, name) || Object.hasOwn(options.computed, name))
95
- }),
96
- data: new Proxy({}, {
97
- get: (_target, name) => typeof name === "string" && Object.hasOwn(options.data ?? {}, name) ? wrap(options.data[name](), "data." + name, [], true) : void 0,
98
- set: (_target, name, value) => write("data." + String(name), [], value, true, () => {}),
99
- deleteProperty: (_target, name) => {
100
- warn("data." + String(name), true);
101
- return true;
102
- },
103
- defineProperty: (_target, name) => {
104
- warn("data." + String(name), true);
105
- return false;
106
- },
107
- has: (_target, name) => typeof name === "string" && Object.hasOwn(options.data ?? {}, name)
108
- })
109
- };
110
- }
111
- function dispatchToTargets(recorded, send) {
112
- const targets = (recorded instanceof Set ? [...recorded] : Array.isArray(recorded) ? [...recorded] : [recorded]).map((ref) => ref?.nodeType === 1 ? ref : ref?.$el).filter((element) => element?.nodeType === 1 && element.isConnected).sort((a, b) => a === b ? 0 : a.compareDocumentPosition(b) & 4 ? -1 : 1);
113
- for (const target of targets) if (target.isConnected) send(target);
114
- }
115
- var runtimeKey = Symbol.for("@nextwebwg/html-next.runtime.v1");
116
- function observeConnection(element, check) {
117
- const document = element.ownerDocument;
118
- const state = document[runtimeKey] ??= {};
119
- let hub = state.mutationHub;
120
- if (hub === void 0) {
121
- const Observer = document.defaultView?.MutationObserver ?? MutationObserver;
122
- const subscribers = /* @__PURE__ */ new Set();
123
- const observer = new Observer((mutations) => {
124
- for (const notify of Array.from(subscribers)) notify(mutations);
125
- });
126
- hub = {
127
- observer,
128
- subscribers
129
- };
130
- state.mutationHub = hub;
131
- observer.observe(document, {
132
- childList: true,
133
- subtree: true
134
- });
135
- }
136
- const shared = hub;
137
- const subscriber = () => check();
138
- shared.subscribers.add(subscriber);
139
- return () => {
140
- shared.subscribers.delete(subscriber);
141
- if (shared.subscribers.size === 0 && state.mutationHub === shared) {
142
- shared.observer.disconnect();
143
- delete state.mutationHub;
144
- }
145
- };
146
- }
147
- /** Keep native focus on the corresponding control when a root-level $match replaces its element. */
148
- function preserveRootFocus(root) {
149
- const focusable = "a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]";
150
- let previous = null;
151
- let active = null;
152
- let focusIndex = -1;
153
- onBeforeUpdate(() => {
154
- previous = root.value;
155
- active = previous?.ownerDocument.activeElement ?? null;
156
- focusIndex = previous !== null && active !== null && active !== previous && previous.contains(active) ? Array.from(previous.querySelectorAll(focusable)).indexOf(active) : -1;
157
- });
158
- onUpdated(() => {
159
- const next = root.value;
160
- if (previous === null || next === null || previous === next) return;
161
- (active === previous ? next : active?.isConnected === true && next.contains(active) ? active : focusIndex >= 0 ? next.querySelectorAll(focusable)[focusIndex] : void 0)?.focus?.({ preventScroll: true });
162
- });
163
- }
164
- /** Vue does not promise a `v-for` ref array in source order, and the host does. */
165
- function inDocumentOrder(elements) {
166
- return [...elements].sort((a, b) => (a.compareDocumentPosition(b) & 4) !== 0 ? -1 : 1);
167
- }
168
- /** Slot content flattened to the elements Vue mounted for it, descending through fragments. */
169
- function slottedElements(nodes) {
170
- const elements = [];
171
- for (const node of nodes) if (node.type === Fragment && Array.isArray(node.children)) elements.push(...slottedElements(node.children));
172
- else if (node.el instanceof Element) elements.push(node.el);
173
- return elements;
174
- }
175
- /**
176
- * The controller host, built from Vue refs, effects, and lifecycle. Reads and writes reach the
177
- * component's own refs, so a controller's change renders as any other Vue change does. Vue
178
- * hooks cover mount/unmount; a shared native observer also detects external root detachment
179
- * and reinsertion without treating an in-tree move as a new connection.
180
- */
181
- function useComponentHost(controllerLoader, options) {
182
- const { root, dispatch, props, propInputs = () => null, propNames = [], refs = {}, state = {}, computed: computedValues = {}, data = {}, context = {} } = options;
183
- const vueSlots = useSlots();
184
- const component = getCurrentInstance();
185
- const report = (error) => {
186
- const handler = component?.appContext.config.errorHandler;
187
- if (handler === void 0) queueMicrotask(() => {
188
- throw error;
189
- });
190
- else handler(error, component?.proxy ?? null, "HTML Next controller");
191
- };
192
- const controllerDiagnostic = (code, reason) => {
193
- const edge = options.controllerSource;
194
- const source = edge?.definition ? new URL(edge.definition, document.baseURI).href : void 0;
195
- const url = new URL(edge?.specifier ?? "", source ?? document.baseURI).href;
196
- const message = code === "HJ002" ? "Controller module `" + url + "` must default-export a function." : "Controller module `" + url + "` failed to load: " + (reason instanceof Error ? reason.message : String(reason)) + ".";
197
- return Object.assign(/* @__PURE__ */ new Error((source === void 0 ? "" : source + ": ") + code + ": " + message), {
198
- name: "HtmlDiagnosticError",
199
- diagnostic: Object.freeze({
200
- code,
201
- message,
202
- ...source === void 0 ? {} : { source }
203
- })
204
- });
205
- };
206
- let controllerModule;
207
- const loadControllerModule = () => controllerModule ??= Promise.resolve().then(controllerLoader).then((candidate) => {
208
- if (typeof candidate?.default !== "function") throw controllerDiagnostic("HJ002");
209
- return candidate;
210
- }).catch((error) => {
211
- if (error instanceof Error && "diagnostic" in error) throw error;
212
- throw controllerDiagnostic("HJ001", error);
213
- });
214
- const stops = [];
215
- const connected = shallowRef(false);
216
- const pauses = /* @__PURE__ */ new Map();
217
- const subscriptions = /* @__PURE__ */ new Set();
218
- const activate = (entry) => {
219
- if (entry.type === "connect") entry.cleanup = entry.callback(new Event("connect"));
220
- else if (entry.type !== "disconnect") {
221
- entry.target = root.value ?? void 0;
222
- entry.target?.addEventListener(entry.type, entry.callback);
223
- }
224
- };
225
- const deactivate = (entry, disconnecting) => {
226
- entry.target?.removeEventListener(entry.type, entry.callback);
227
- entry.target = void 0;
228
- const cleanup = entry.cleanup;
229
- entry.cleanup = void 0;
230
- cleanup?.();
231
- if (disconnecting && entry.type === "disconnect") entry.callback(new Event("disconnect"));
232
- };
233
- const propHandles = Object.create(null);
234
- for (const name of propNames) {
235
- const validity = () => options.propValidity?.(name);
236
- propHandles[name] = Object.freeze({
237
- get value() {
238
- return props?.value[name];
239
- },
240
- get inputValue() {
241
- return propInputs(name);
242
- },
243
- get validity() {
244
- return validity();
245
- },
246
- validate: validity
247
- });
248
- }
249
- const host = {
250
- get element() {
251
- return root.value;
252
- },
253
- get root() {
254
- return root.value;
255
- },
256
- ...controllerNamespaces({
257
- state: Object.fromEntries(Object.entries(state).map(([name, value]) => [name, {
258
- get: () => value.value,
259
- set: (next) => {
260
- value.value = next;
261
- }
262
- }])),
263
- computed: Object.fromEntries([...Object.entries(computedValues), ...Object.entries(context)].map(([name, value]) => [name, () => value.value])),
264
- data: Object.fromEntries(Object.entries(data).map(([name, value]) => [name, () => value.value])),
265
- acceptsState: options.acceptsState
266
- }, options.controllerSource?.definition ?? "<component>"),
267
- on(type, callback) {
268
- const entry = {
269
- type,
270
- callback
271
- };
272
- subscriptions.add(entry);
273
- if (connected.value) activate(entry);
274
- return () => {
275
- if (subscriptions.delete(entry)) deactivate(entry, false);
276
- };
277
- },
278
- props: Object.freeze(propHandles),
279
- refs: Object.defineProperties({}, Object.fromEntries(Object.entries(refs).map(([name, ref]) => [name, {
280
- enumerable: true,
281
- get: () => Array.isArray(ref.value) ? inDocumentOrder(ref.value) : ref.value
282
- }]))),
283
- slots: new Proxy({}, {
284
- get: (_target, name) => {
285
- if (typeof name !== "string") return void 0;
286
- const render = vueSlots[name];
287
- return render === void 0 ? [] : slottedElements(render());
288
- },
289
- has: (_target, name) => typeof name === "string" && vueSlots[name] !== void 0
290
- }),
291
- signal(initialValue) {
292
- const value = shallowRef(initialValue);
293
- return {
294
- get: () => value.value,
295
- set: (next) => {
296
- value.value = next;
297
- },
298
- update: (next) => {
299
- value.value = next(value.value);
300
- }
301
- };
302
- },
303
- computed(compute) {
304
- const value = computed(compute);
305
- return { get: () => value.value };
306
- },
307
- effect(run) {
308
- let cleanup;
309
- const pause = () => {
310
- const previous = cleanup;
311
- cleanup = void 0;
312
- previous?.();
313
- };
314
- const stop = watchEffect(() => {
315
- pause();
316
- if (connected.value) cleanup = run();
317
- }, { flush: "post" });
318
- const dispose = () => {
319
- stop();
320
- pause();
321
- pauses.delete(dispose);
322
- };
323
- pauses.set(dispose, pause);
324
- stops.push(dispose);
325
- return dispose;
326
- },
327
- dispatch
328
- };
329
- let cleanup;
330
- let started;
331
- let stopObserving;
332
- let connection = 0;
333
- let initialized = false;
334
- let unmounted = false;
335
- const disconnect = () => {
336
- if (!connected.value) return;
337
- connected.value = false;
338
- connection += 1;
339
- for (const pause of pauses.values()) pause();
340
- for (const entry of subscriptions) deactivate(entry, true);
341
- cleanup?.();
342
- cleanup = void 0;
343
- };
344
- const synchronize = () => {
345
- if (unmounted) return;
346
- if (root.value?.isConnected !== true) {
347
- disconnect();
348
- return;
349
- }
350
- if (connected.value) {
351
- for (const entry of subscriptions) if (entry.type !== "connect" && entry.type !== "disconnect" && entry.target !== root.value) {
352
- deactivate(entry, false);
353
- activate(entry);
354
- }
355
- return;
356
- }
357
- connected.value = true;
358
- for (const entry of subscriptions) activate(entry);
359
- if (initialized) return;
360
- const current = ++connection;
361
- started = loadControllerModule().then(async (loaded) => {
362
- if (!connected.value || current !== connection || initialized) return loaded;
363
- initialized = true;
364
- const result = await loaded.default(host);
365
- if (typeof result === "function") {
366
- if (!connected.value || current !== connection) result();
367
- else cleanup = result;
368
- }
369
- return loaded;
370
- });
371
- started.catch(report);
372
- };
373
- onMounted(() => {
374
- if (root.value === null) return;
375
- stopObserving = observeConnection(root.value, () => {
376
- try {
377
- synchronize();
378
- } catch (error) {
379
- report(error);
380
- }
381
- });
382
- synchronize();
383
- });
384
- onUpdated(synchronize);
385
- onBeforeUnmount(() => {
386
- unmounted = true;
387
- stopObserving?.();
388
- disconnect();
389
- for (const stop of stops.splice(0)) stop();
390
- subscriptions.clear();
391
- });
392
- return host;
393
- }
394
- var HtmlDiagnosticError = class extends Error {
395
- diagnostic;
396
- constructor(code, message) {
397
- super(code + ": " + message);
398
- this.name = "HtmlDiagnosticError";
399
- this.diagnostic = Object.freeze({
400
- code,
401
- message
402
- });
403
- }
404
- };
405
- /** Reports declared CustomEvents to Vue and dispatches them through the DOM. */
406
- function createDispatch(root, emit, options = {}) {
407
- const { declared = {}, checks = {}, modeled = [] } = options;
408
- const reported = /* @__PURE__ */ new Map();
409
- return (name, detail, targets) => {
410
- const check = checks[name];
411
- if (detail !== void 0 && check !== void 0 && !check(detail)) throw new HtmlDiagnosticError("HR002", `Event \`${name}\` detail does not satisfy its declared type.`);
412
- if (targets !== void 0) {
413
- let accepted = true;
414
- dispatchToTargets(targets, (target) => {
415
- if (!target.dispatchEvent(new CustomEvent(name, {
416
- bubbles: true,
417
- composed: true,
418
- ...declared[name],
419
- detail
420
- }))) accepted = false;
421
- });
422
- return accepted;
423
- }
424
- if (detail !== null && typeof detail === "object") for (const prop of modeled) {
425
- if (!(prop in detail)) continue;
426
- const value = detail[prop];
427
- if (reported.has(prop) && Object.is(reported.get(prop), value)) continue;
428
- if (reported.size === 0) queueMicrotask(() => reported.clear());
429
- reported.set(prop, value);
430
- emit?.(`update:${prop}`, value);
431
- }
432
- const event = new CustomEvent(name, {
433
- bubbles: true,
434
- composed: true,
435
- ...declared[name],
436
- detail
437
- });
438
- if (check !== void 0) emit?.(name, event);
439
- return root.value?.dispatchEvent(event) ?? true;
440
- };
441
- }
442
- //#endregion
443
- export { preserveRootFocus as n, useComponentHost as r, createDispatch as t };