@threadlabs/looma 0.28.22 → 0.29.1

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 (425) hide show
  1. package/components/ui-editor-code-language/ui-editor-code-language.html +1 -1
  2. package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.html +1 -2
  3. package/components/ui-editor-link-form/ui-editor-link-form.html +2 -3
  4. package/components/ui-tooltip/ui-tooltip.html +5 -2
  5. package/dist/index.js +1 -1
  6. package/editor/image-uploads.d.ts +23 -15
  7. package/editor/link-editing.d.ts +4 -4
  8. package/editor/requests.d.ts +43 -0
  9. package/package.json +3 -3
  10. package/styles/ui-action-bar.css +1 -1
  11. package/styles/ui-affordance-scope.css +1 -1
  12. package/styles/ui-avatar-group.css +1 -1
  13. package/styles/ui-avatar.css +1 -1
  14. package/styles/ui-badge.css +1 -1
  15. package/styles/ui-breadcrumb-item.css +1 -1
  16. package/styles/ui-breadcrumbs.css +1 -1
  17. package/styles/ui-button.css +1 -1
  18. package/styles/ui-callout.css +1 -1
  19. package/styles/ui-card.css +1 -1
  20. package/styles/ui-checkbox.css +1 -1
  21. package/styles/ui-cluster.css +1 -1
  22. package/styles/ui-combobox.css +1 -1
  23. package/styles/ui-container.css +1 -1
  24. package/styles/ui-context-menu.css +1 -1
  25. package/styles/ui-cover.css +1 -1
  26. package/styles/ui-description-item.css +1 -1
  27. package/styles/ui-description-list.css +1 -1
  28. package/styles/ui-dialog.css +1 -1
  29. package/styles/ui-disclosure.css +1 -1
  30. package/styles/ui-editable.css +1 -1
  31. package/styles/ui-editor-block-actions.css +1 -1
  32. package/styles/ui-editor-chip-editor.css +1 -1
  33. package/styles/ui-editor-code-language.css +1 -1
  34. package/styles/ui-editor-image-toolbar.css +1 -1
  35. package/styles/ui-editor-insert-table-grid.css +1 -1
  36. package/styles/ui-editor-link-card.css +1 -1
  37. package/styles/ui-editor-link-form.css +1 -1
  38. package/styles/ui-editor-mention-menu-item.css +1 -1
  39. package/styles/ui-editor-mention-menu.css +1 -1
  40. package/styles/ui-editor-slash-menu-group.css +1 -1
  41. package/styles/ui-editor-slash-menu-item.css +1 -1
  42. package/styles/ui-editor-slash-menu.css +1 -1
  43. package/styles/ui-editor-surface.css +1 -1
  44. package/styles/ui-editor-table-context-menu.css +1 -1
  45. package/styles/ui-editor-table-overlay.css +1 -1
  46. package/styles/ui-editor-table-toolbar.css +1 -1
  47. package/styles/ui-editor-toolbar.css +1 -1
  48. package/styles/ui-floating-action-button.css +1 -1
  49. package/styles/ui-form-field.css +1 -1
  50. package/styles/ui-grid.css +1 -1
  51. package/styles/ui-icon-button.css +1 -1
  52. package/styles/ui-icon.css +1 -1
  53. package/styles/ui-image.css +1 -1
  54. package/styles/ui-input-group.css +1 -1
  55. package/styles/ui-input.css +1 -1
  56. package/styles/ui-list-item.css +1 -1
  57. package/styles/ui-list.css +1 -1
  58. package/styles/ui-listbox.css +1 -1
  59. package/styles/ui-menu-group.css +1 -1
  60. package/styles/ui-menu-item.css +1 -1
  61. package/styles/ui-menu.css +1 -1
  62. package/styles/ui-meter.css +1 -1
  63. package/styles/ui-nav-item.css +1 -1
  64. package/styles/ui-page-header.css +1 -1
  65. package/styles/ui-popover.css +1 -1
  66. package/styles/ui-radio-group.css +1 -1
  67. package/styles/ui-radio.css +1 -1
  68. package/styles/ui-reel.css +1 -1
  69. package/styles/ui-scroll-area.css +1 -1
  70. package/styles/ui-search-result-row.css +1 -1
  71. package/styles/ui-search-shell.css +1 -1
  72. package/styles/ui-section.css +1 -1
  73. package/styles/ui-select.css +1 -1
  74. package/styles/ui-separator.css +1 -1
  75. package/styles/ui-sidebar.css +1 -1
  76. package/styles/ui-spinner.css +1 -1
  77. package/styles/ui-stack.css +1 -1
  78. package/styles/ui-status-message.css +1 -1
  79. package/styles/ui-swatch.css +1 -1
  80. package/styles/ui-switch.css +1 -1
  81. package/styles/ui-switcher.css +1 -1
  82. package/styles/ui-table.css +1 -1
  83. package/styles/ui-tabs.css +1 -1
  84. package/styles/ui-text.css +1 -1
  85. package/styles/ui-textarea.css +1 -1
  86. package/styles/ui-toast-region.css +1 -1
  87. package/styles/ui-toast.css +1 -1
  88. package/styles/ui-tooltip.css +7 -2
  89. package/styles/ui-top-bar.css +1 -1
  90. package/styles/ui-tree-item.css +1 -1
  91. package/styles/ui-tree.css +1 -1
  92. package/vanilla/UiActionBar.d.ts +1 -1
  93. package/vanilla/UiActionBar.js +6 -6
  94. package/vanilla/UiAffordanceScope.d.ts +1 -1
  95. package/vanilla/UiAffordanceScope.js +1 -1
  96. package/vanilla/UiAvatar.d.ts +1 -1
  97. package/vanilla/UiAvatar.js +7 -7
  98. package/vanilla/UiAvatarGroup.d.ts +1 -1
  99. package/vanilla/UiAvatarGroup.js +4 -4
  100. package/vanilla/UiBadge.d.ts +1 -1
  101. package/vanilla/UiBadge.js +4 -4
  102. package/vanilla/UiBreadcrumbItem.d.ts +1 -1
  103. package/vanilla/UiBreadcrumbItem.js +3 -3
  104. package/vanilla/UiBreadcrumbs.d.ts +1 -1
  105. package/vanilla/UiBreadcrumbs.js +1 -1
  106. package/vanilla/UiButton.d.ts +1 -1
  107. package/vanilla/UiButton.js +17 -17
  108. package/vanilla/UiCallout.d.ts +1 -1
  109. package/vanilla/UiCallout.js +13 -13
  110. package/vanilla/UiCard.d.ts +1 -1
  111. package/vanilla/UiCard.js +1 -1
  112. package/vanilla/UiCheckbox.d.ts +1 -1
  113. package/vanilla/UiCheckbox.js +6 -6
  114. package/vanilla/UiCluster.d.ts +1 -1
  115. package/vanilla/UiCluster.js +1 -1
  116. package/vanilla/UiCombobox.d.ts +1 -1
  117. package/vanilla/UiCombobox.js +48 -48
  118. package/vanilla/UiContainer.d.ts +1 -1
  119. package/vanilla/UiContainer.js +1 -1
  120. package/vanilla/UiContextMenu.d.ts +1 -1
  121. package/vanilla/UiContextMenu.js +1 -1
  122. package/vanilla/UiCover.d.ts +1 -1
  123. package/vanilla/UiCover.js +1 -1
  124. package/vanilla/UiDescriptionItem.d.ts +1 -1
  125. package/vanilla/UiDescriptionItem.js +4 -4
  126. package/vanilla/UiDescriptionList.d.ts +1 -1
  127. package/vanilla/UiDescriptionList.js +1 -1
  128. package/vanilla/UiDialog.d.ts +1 -1
  129. package/vanilla/UiDialog.js +7 -7
  130. package/vanilla/UiDisclosure.d.ts +1 -1
  131. package/vanilla/UiDisclosure.js +8 -8
  132. package/vanilla/UiEditable.d.ts +1 -1
  133. package/vanilla/UiEditable.js +11 -11
  134. package/vanilla/UiEditorBlockActions.d.ts +1 -1
  135. package/vanilla/UiEditorBlockActions.js +3 -3
  136. package/vanilla/UiEditorChipEditor.d.ts +1 -1
  137. package/vanilla/UiEditorChipEditor.js +4 -4
  138. package/vanilla/UiEditorCodeLanguage.d.ts +1 -1
  139. package/vanilla/UiEditorCodeLanguage.js +7 -12
  140. package/vanilla/UiEditorImageToolbar.d.ts +1 -1
  141. package/vanilla/UiEditorImageToolbar.js +90 -95
  142. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  143. package/vanilla/UiEditorInsertTableGrid.js +7 -7
  144. package/vanilla/UiEditorLinkCard.d.ts +1 -1
  145. package/vanilla/UiEditorLinkCard.js +13 -13
  146. package/vanilla/UiEditorLinkForm.d.ts +1 -1
  147. package/vanilla/UiEditorLinkForm.js +32 -44
  148. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  149. package/vanilla/UiEditorMentionMenu.js +12 -12
  150. package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
  151. package/vanilla/UiEditorMentionMenuItem.js +4 -4
  152. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  153. package/vanilla/UiEditorSlashMenu.js +11 -11
  154. package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
  155. package/vanilla/UiEditorSlashMenuGroup.js +5 -5
  156. package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
  157. package/vanilla/UiEditorSlashMenuItem.js +4 -4
  158. package/vanilla/UiEditorSurface.d.ts +1 -1
  159. package/vanilla/UiEditorSurface.js +1 -1
  160. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  161. package/vanilla/UiEditorTableContextMenu.js +16 -16
  162. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  163. package/vanilla/UiEditorTableOverlay.js +18 -18
  164. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  165. package/vanilla/UiEditorTableToolbar.js +33 -33
  166. package/vanilla/UiEditorToolbar.d.ts +1 -1
  167. package/vanilla/UiEditorToolbar.js +1 -1
  168. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  169. package/vanilla/UiFloatingActionButton.js +1 -1
  170. package/vanilla/UiFormField.d.ts +1 -1
  171. package/vanilla/UiFormField.js +8 -8
  172. package/vanilla/UiGrid.d.ts +1 -1
  173. package/vanilla/UiGrid.js +1 -1
  174. package/vanilla/UiIcon.d.ts +1 -1
  175. package/vanilla/UiIcon.js +4 -4
  176. package/vanilla/UiIconButton.d.ts +1 -1
  177. package/vanilla/UiIconButton.js +4 -4
  178. package/vanilla/UiImage.d.ts +1 -1
  179. package/vanilla/UiImage.js +6 -6
  180. package/vanilla/UiInput.d.ts +1 -1
  181. package/vanilla/UiInput.js +1 -1
  182. package/vanilla/UiInputGroup.d.ts +1 -1
  183. package/vanilla/UiInputGroup.js +6 -6
  184. package/vanilla/UiList.d.ts +1 -1
  185. package/vanilla/UiList.js +1 -1
  186. package/vanilla/UiListItem.d.ts +1 -1
  187. package/vanilla/UiListItem.js +7 -7
  188. package/vanilla/UiListbox.d.ts +1 -1
  189. package/vanilla/UiListbox.js +12 -12
  190. package/vanilla/UiMenu.d.ts +1 -1
  191. package/vanilla/UiMenu.js +1 -1
  192. package/vanilla/UiMenuGroup.d.ts +1 -1
  193. package/vanilla/UiMenuGroup.js +4 -4
  194. package/vanilla/UiMenuItem.d.ts +1 -1
  195. package/vanilla/UiMenuItem.js +11 -11
  196. package/vanilla/UiMeter.d.ts +1 -1
  197. package/vanilla/UiMeter.js +8 -8
  198. package/vanilla/UiNavItem.d.ts +1 -1
  199. package/vanilla/UiNavItem.js +13 -13
  200. package/vanilla/UiPageHeader.d.ts +1 -1
  201. package/vanilla/UiPageHeader.js +8 -8
  202. package/vanilla/UiPopover.d.ts +1 -1
  203. package/vanilla/UiPopover.js +1 -1
  204. package/vanilla/UiRadio.d.ts +1 -1
  205. package/vanilla/UiRadio.js +6 -6
  206. package/vanilla/UiRadioGroup.d.ts +1 -1
  207. package/vanilla/UiRadioGroup.js +4 -4
  208. package/vanilla/UiReel.d.ts +1 -1
  209. package/vanilla/UiReel.js +1 -1
  210. package/vanilla/UiScrollArea.d.ts +1 -1
  211. package/vanilla/UiScrollArea.js +1 -1
  212. package/vanilla/UiSearchResultRow.d.ts +1 -1
  213. package/vanilla/UiSearchResultRow.js +8 -8
  214. package/vanilla/UiSearchShell.d.ts +1 -1
  215. package/vanilla/UiSearchShell.js +8 -8
  216. package/vanilla/UiSection.d.ts +1 -1
  217. package/vanilla/UiSection.js +8 -8
  218. package/vanilla/UiSelect.d.ts +1 -1
  219. package/vanilla/UiSelect.js +1 -1
  220. package/vanilla/UiSeparator.d.ts +1 -1
  221. package/vanilla/UiSeparator.js +1 -1
  222. package/vanilla/UiSidebar.d.ts +1 -1
  223. package/vanilla/UiSidebar.js +4 -4
  224. package/vanilla/UiSpinner.d.ts +1 -1
  225. package/vanilla/UiSpinner.js +2 -2
  226. package/vanilla/UiStack.d.ts +1 -1
  227. package/vanilla/UiStack.js +1 -1
  228. package/vanilla/UiStatusMessage.d.ts +1 -1
  229. package/vanilla/UiStatusMessage.js +7 -7
  230. package/vanilla/UiSwatch.d.ts +1 -1
  231. package/vanilla/UiSwatch.js +1 -1
  232. package/vanilla/UiSwitch.d.ts +1 -1
  233. package/vanilla/UiSwitch.js +6 -6
  234. package/vanilla/UiSwitcher.d.ts +1 -1
  235. package/vanilla/UiSwitcher.js +1 -1
  236. package/vanilla/UiTable.d.ts +1 -1
  237. package/vanilla/UiTable.js +1 -1
  238. package/vanilla/UiTabs.d.ts +1 -1
  239. package/vanilla/UiTabs.js +7 -7
  240. package/vanilla/UiText.d.ts +1 -1
  241. package/vanilla/UiText.js +1 -1
  242. package/vanilla/UiTextarea.d.ts +1 -1
  243. package/vanilla/UiTextarea.js +1 -1
  244. package/vanilla/UiToast.d.ts +1 -1
  245. package/vanilla/UiToast.js +5 -5
  246. package/vanilla/UiToastRegion.d.ts +1 -1
  247. package/vanilla/UiToastRegion.js +8 -8
  248. package/vanilla/UiTooltip.d.ts +1 -1
  249. package/vanilla/UiTooltip.js +9 -8
  250. package/vanilla/UiTopBar.d.ts +1 -1
  251. package/vanilla/UiTopBar.js +6 -6
  252. package/vanilla/UiTree.d.ts +1 -1
  253. package/vanilla/UiTree.js +1 -1
  254. package/vanilla/UiTreeItem.d.ts +1 -1
  255. package/vanilla/UiTreeItem.js +13 -13
  256. package/vue/UiActionBar.vue +8 -5
  257. package/vue/UiAffordanceScope.vue +1 -1
  258. package/vue/UiAvatar.vue +10 -11
  259. package/vue/UiAvatarGroup.vue +2 -3
  260. package/vue/UiBadge.vue +5 -3
  261. package/vue/UiBreadcrumbItem.vue +2 -3
  262. package/vue/UiBreadcrumbs.vue +1 -1
  263. package/vue/UiButton.vue +15 -13
  264. package/vue/UiCallout.vue +8 -15
  265. package/vue/UiCard.vue +1 -1
  266. package/vue/UiCheckbox.vue +5 -4
  267. package/vue/UiCluster.vue +1 -1
  268. package/vue/UiCombobox.vue +25 -27
  269. package/vue/UiContainer.vue +1 -1
  270. package/vue/UiContextMenu.vue +1 -1
  271. package/vue/UiCover.vue +1 -1
  272. package/vue/UiDescriptionItem.vue +1 -1
  273. package/vue/UiDescriptionList.vue +1 -1
  274. package/vue/UiDialog.vue +4 -3
  275. package/vue/UiDisclosure.vue +9 -8
  276. package/vue/UiEditable.vue +13 -9
  277. package/vue/UiEditorBlockActions.vue +5 -4
  278. package/vue/UiEditorChipEditor.vue +7 -9
  279. package/vue/UiEditorCodeLanguage.vue +2 -2
  280. package/vue/UiEditorImageToolbar.vue +25 -32
  281. package/vue/UiEditorInsertTableGrid.vue +1 -1
  282. package/vue/UiEditorLinkCard.vue +17 -20
  283. package/vue/UiEditorLinkForm.vue +21 -23
  284. package/vue/UiEditorMentionMenu.vue +9 -7
  285. package/vue/UiEditorMentionMenuItem.vue +5 -6
  286. package/vue/UiEditorSlashMenu.vue +3 -5
  287. package/vue/UiEditorSlashMenuGroup.vue +1 -1
  288. package/vue/UiEditorSlashMenuItem.vue +5 -6
  289. package/vue/UiEditorSurface.vue +1 -1
  290. package/vue/UiEditorTableContextMenu.vue +4 -7
  291. package/vue/UiEditorTableOverlay.vue +26 -18
  292. package/vue/UiEditorTableToolbar.vue +23 -21
  293. package/vue/UiEditorToolbar.vue +1 -1
  294. package/vue/UiFloatingActionButton.vue +1 -1
  295. package/vue/UiFormField.vue +4 -3
  296. package/vue/UiGrid.vue +1 -1
  297. package/vue/UiIcon.vue +1 -1
  298. package/vue/UiIconButton.vue +4 -3
  299. package/vue/UiImage.vue +4 -7
  300. package/vue/UiInput.vue +1 -1
  301. package/vue/UiInputGroup.vue +7 -5
  302. package/vue/UiList.vue +1 -1
  303. package/vue/UiListItem.vue +10 -7
  304. package/vue/UiListbox.vue +3 -5
  305. package/vue/UiMenu.vue +1 -1
  306. package/vue/UiMenuGroup.vue +2 -3
  307. package/vue/UiMenuItem.vue +15 -10
  308. package/vue/UiMeter.vue +4 -5
  309. package/vue/UiNavItem.vue +19 -13
  310. package/vue/UiPageHeader.vue +8 -7
  311. package/vue/UiPopover.vue +1 -1
  312. package/vue/UiRadio.vue +10 -6
  313. package/vue/UiRadioGroup.vue +1 -1
  314. package/vue/UiReel.vue +1 -1
  315. package/vue/UiScrollArea.vue +1 -1
  316. package/vue/UiSearchResultRow.vue +11 -8
  317. package/vue/UiSearchShell.vue +1 -1
  318. package/vue/UiSection.vue +7 -4
  319. package/vue/UiSelect.vue +1 -1
  320. package/vue/UiSeparator.vue +1 -1
  321. package/vue/UiSidebar.vue +1 -1
  322. package/vue/UiSpinner.vue +1 -1
  323. package/vue/UiStack.vue +1 -1
  324. package/vue/UiStatusMessage.vue +10 -6
  325. package/vue/UiSwatch.vue +1 -1
  326. package/vue/UiSwitch.vue +10 -6
  327. package/vue/UiSwitcher.vue +1 -1
  328. package/vue/UiTable.vue +1 -1
  329. package/vue/UiTabs.vue +3 -3
  330. package/vue/UiText.vue +1 -1
  331. package/vue/UiTextarea.vue +1 -1
  332. package/vue/UiToast.vue +1 -1
  333. package/vue/UiToastRegion.vue +7 -5
  334. package/vue/UiTooltip.vue +10 -5
  335. package/vue/UiTopBar.vue +1 -1
  336. package/vue/UiTree.vue +1 -1
  337. package/vue/UiTreeItem.vue +14 -13
  338. package/vue/chunks/UiActionBar.js +4 -2
  339. package/vue/chunks/UiAffordanceScope.js +1 -1
  340. package/vue/chunks/UiAvatar.js +18 -12
  341. package/vue/chunks/UiAvatarGroup.js +15 -11
  342. package/vue/chunks/UiBadge.js +7 -3
  343. package/vue/chunks/UiBreadcrumbItem.js +10 -6
  344. package/vue/chunks/UiBreadcrumbs.js +1 -1
  345. package/vue/chunks/UiButton.js +10 -2
  346. package/vue/chunks/UiCallout.js +13 -3
  347. package/vue/chunks/UiCard.js +1 -1
  348. package/vue/chunks/UiCheckbox.js +35 -27
  349. package/vue/chunks/UiCluster.js +1 -1
  350. package/vue/chunks/UiCombobox.js +108 -74
  351. package/vue/chunks/UiContainer.js +1 -1
  352. package/vue/chunks/UiContextMenu.js +1 -1
  353. package/vue/chunks/UiCover.js +1 -1
  354. package/vue/chunks/UiDescriptionItem.js +1 -1
  355. package/vue/chunks/UiDescriptionList.js +1 -1
  356. package/vue/chunks/UiDialog.js +14 -10
  357. package/vue/chunks/UiDisclosure.js +3 -1
  358. package/vue/chunks/UiEditable.js +36 -24
  359. package/vue/chunks/UiEditorBlockActions.js +3 -1
  360. package/vue/chunks/UiEditorChipEditor.js +31 -22
  361. package/vue/chunks/UiEditorCodeLanguage.js +1 -1
  362. package/vue/chunks/UiEditorImageToolbar.js +45 -27
  363. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  364. package/vue/chunks/UiEditorLinkCard.js +58 -42
  365. package/vue/chunks/UiEditorLinkForm.js +110 -90
  366. package/vue/chunks/UiEditorMentionMenu.js +23 -14
  367. package/vue/chunks/UiEditorMentionMenuItem.js +6 -2
  368. package/vue/chunks/UiEditorSlashMenu.js +24 -16
  369. package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
  370. package/vue/chunks/UiEditorSlashMenuItem.js +10 -6
  371. package/vue/chunks/UiEditorSurface.js +1 -1
  372. package/vue/chunks/UiEditorTableContextMenu.js +65 -53
  373. package/vue/chunks/UiEditorTableOverlay.js +60 -40
  374. package/vue/chunks/UiEditorTableToolbar.js +100 -74
  375. package/vue/chunks/UiEditorToolbar.js +1 -1
  376. package/vue/chunks/UiFloatingActionButton.js +1 -1
  377. package/vue/chunks/UiFormField.js +7 -3
  378. package/vue/chunks/UiGrid.js +1 -1
  379. package/vue/chunks/UiIcon.js +1 -1
  380. package/vue/chunks/UiIconButton.js +11 -7
  381. package/vue/chunks/UiImage.js +5 -2
  382. package/vue/chunks/UiInput.js +1 -1
  383. package/vue/chunks/UiInputGroup.js +5 -2
  384. package/vue/chunks/UiList.js +1 -1
  385. package/vue/chunks/UiListItem.js +9 -3
  386. package/vue/chunks/UiListbox.js +17 -11
  387. package/vue/chunks/UiMenu.js +1 -1
  388. package/vue/chunks/UiMenuGroup.js +7 -3
  389. package/vue/chunks/UiMenuItem.js +7 -2
  390. package/vue/chunks/UiMeter.js +28 -16
  391. package/vue/chunks/UiNavItem.js +20 -6
  392. package/vue/chunks/UiPageHeader.js +4 -2
  393. package/vue/chunks/UiPopover.js +1 -1
  394. package/vue/chunks/UiRadio.js +32 -24
  395. package/vue/chunks/UiRadioGroup.js +1 -1
  396. package/vue/chunks/UiReel.js +1 -1
  397. package/vue/chunks/UiScrollArea.js +1 -1
  398. package/vue/chunks/UiSearchResultRow.js +6 -2
  399. package/vue/chunks/UiSearchShell.js +1 -1
  400. package/vue/chunks/UiSection.js +15 -7
  401. package/vue/chunks/UiSelect.js +1 -1
  402. package/vue/chunks/UiSeparator.js +1 -1
  403. package/vue/chunks/UiSidebar.js +1 -1
  404. package/vue/chunks/UiSpinner.js +1 -1
  405. package/vue/chunks/UiStack.js +1 -1
  406. package/vue/chunks/UiStatusMessage.js +13 -7
  407. package/vue/chunks/UiSwatch.js +1 -1
  408. package/vue/chunks/UiSwitch.js +33 -25
  409. package/vue/chunks/UiSwitcher.js +1 -1
  410. package/vue/chunks/UiTable.js +1 -1
  411. package/vue/chunks/UiTabs.js +21 -17
  412. package/vue/chunks/UiText.js +1 -1
  413. package/vue/chunks/UiTextarea.js +1 -1
  414. package/vue/chunks/UiToast.js +1 -1
  415. package/vue/chunks/UiToastRegion.js +39 -31
  416. package/vue/chunks/UiTooltip.js +11 -3
  417. package/vue/chunks/UiTopBar.js +1 -1
  418. package/vue/chunks/UiTree.js +1 -1
  419. package/vue/chunks/UiTreeItem.js +25 -15
  420. package/vue/chunks/_plugin-vue_export-helper.js +1 -0
  421. package/vue/components.css +25 -21
  422. package/vue/editor/LoomaEditor.d.ts +90 -32
  423. package/vue/editor/index.d.ts +1 -1
  424. package/vue/editor/index.js +332 -53
  425. package/vue/host.ts +4 -1
@@ -1,6 +1,6 @@
1
- import { computed, createApp, defineComponent, h, nextTick, onBeforeUnmount, onMounted, reactive, ref, shallowRef, useId, watch } from "vue";
1
+ import { computed, createApp, defineComponent, h, nextTick, onBeforeUnmount, onMounted, onUpdated, reactive, ref, shallowRef, useId, watch } from "vue";
2
2
  import { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ICONS, createLoomaMentionExtension, createLoomaSlashCommandExtension, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getTableOfContentsEntries, getVisualViewportRect, handleTableAction, handleTableOverlayAction, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeLoomaChipColor, normalizeTableOfContentsConfig } from "@threadlabs/looma/editor";
3
- import { Button, Callout, Card, Checkbox, Cluster, Disclosure, EditorBlockActions, EditorChipEditor, EditorCodeLanguage, EditorImageToolbar, EditorInsertTableGrid, EditorLinkCard, EditorLinkForm, EditorMentionMenu, EditorMentionMenuItem, EditorSlashMenu, EditorSlashMenuGroup, EditorSlashMenuItem, EditorSurface, EditorTableContextMenu, EditorTableOverlay, EditorTableToolbar, EditorToolbar, FormField, Icon, IconButton, Image, Input, List, Menu, MenuItem, Popover, Separator, Stack, Text, Tooltip } from "@threadlabs/looma/vue";
3
+ import { Button, Callout, Card, Checkbox, Cluster, Disclosure, EditorBlockActions, EditorChipEditor, EditorCodeLanguage, EditorImageToolbar, EditorInsertTableGrid, EditorLinkCard, EditorLinkForm, EditorMentionMenu, EditorMentionMenuItem, EditorSlashMenu, EditorSlashMenuGroup, EditorSlashMenuItem, EditorSurface, EditorTableContextMenu, EditorTableOverlay, EditorTableToolbar, EditorToolbar, FormField, Icon, IconButton, Image, Input, List, Menu, MenuItem, Popover, Separator, Stack, StatusMessage, Text, Tooltip } from "@threadlabs/looma/vue";
4
4
  import { Editor, Extension, Node as Node$1, getText, getTextSerializersFromSchema, isNodeSelection, mergeAttributes, nodeInputRule, posToDOMRect } from "@tiptap/core";
5
5
  import { Editor as Editor$1 } from "@tiptap/vue-3";
6
6
  import { closeHistory } from "@tiptap/pm/history";
@@ -1142,8 +1142,10 @@ function runBlockAction(editor, action) {
1142
1142
  function createImageUploads(options) {
1143
1143
  const { editor } = options;
1144
1144
  const listeners = /* @__PURE__ */ new Set();
1145
+ const batches = /* @__PURE__ */ new Set();
1145
1146
  let state = {
1146
1147
  uploading: false,
1148
+ progress: null,
1147
1149
  failed: null
1148
1150
  };
1149
1151
  const set = (patch) => {
@@ -1153,28 +1155,53 @@ function createImageUploads(options) {
1153
1155
  };
1154
1156
  listeners.forEach((listener) => listener());
1155
1157
  };
1156
- const insertOne = async (file) => {
1158
+ const insertOne = async (file, signal) => {
1157
1159
  const upload = options.upload();
1158
- if (!upload || editor.isDestroyed) return;
1159
- set({ uploading: true });
1160
+ if (!upload || editor.isDestroyed || signal.aborted) return;
1161
+ set({
1162
+ uploading: true,
1163
+ progress: null
1164
+ });
1160
1165
  try {
1161
- const result = await upload(file);
1162
- const image = typeof result === "string" ? { url: result } : result;
1163
- const width = normalizeImageDimension(image.width);
1164
- const height = normalizeImageDimension(image.height);
1165
- if (!editor.isDestroyed) editor.chain().focus().insertContent(imageUploadContent({
1166
- src: image.url,
1167
- alt: image.alt ?? file.name,
1168
- ...width ? { width } : {},
1169
- ...height ? { height } : {},
1170
- ...image.responsive === true ? { responsive: true } : {}
1171
- })).run();
1172
- set({ failed: null });
1166
+ const image = await upload(file, {
1167
+ signal,
1168
+ progress: (loaded, total) => {
1169
+ if (!signal.aborted) set({ progress: {
1170
+ loaded,
1171
+ total
1172
+ } });
1173
+ }
1174
+ });
1175
+ if (image && !signal.aborted && !editor.isDestroyed) {
1176
+ const width = normalizeImageDimension(image.width);
1177
+ const height = normalizeImageDimension(image.height);
1178
+ editor.chain().focus().insertContent(imageUploadContent({
1179
+ src: image.src,
1180
+ alt: image.alt ?? file.name,
1181
+ ...width ? { width } : {},
1182
+ ...height ? { height } : {},
1183
+ ...image.responsive === true ? { responsive: true } : {}
1184
+ })).run();
1185
+ }
1186
+ if (!signal.aborted) set({ failed: null });
1173
1187
  } catch (error) {
1188
+ if (signal.aborted) return;
1174
1189
  set({ failed: file });
1175
1190
  options.onError(error, file);
1176
1191
  } finally {
1177
- set({ uploading: false });
1192
+ set({
1193
+ uploading: false,
1194
+ progress: null
1195
+ });
1196
+ }
1197
+ };
1198
+ const run = async (files) => {
1199
+ const batch = new AbortController();
1200
+ batches.add(batch);
1201
+ try {
1202
+ for (const file of files) await insertOne(file, batch.signal);
1203
+ } finally {
1204
+ batches.delete(batch);
1178
1205
  }
1179
1206
  };
1180
1207
  return {
@@ -1187,15 +1214,146 @@ function createImageUploads(options) {
1187
1214
  listeners.delete(listener);
1188
1215
  };
1189
1216
  },
1190
- async insert(files) {
1191
- for (const file of files) await insertOne(file);
1192
- },
1217
+ insert: run,
1193
1218
  async retry() {
1194
- if (state.failed) await insertOne(state.failed);
1219
+ if (state.failed) await run([state.failed]);
1220
+ },
1221
+ cancel() {
1222
+ batches.forEach((batch) => batch.abort(new DOMException("The upload was canceled.", "AbortError")));
1195
1223
  }
1196
1224
  };
1197
1225
  }
1198
1226
  //#endregion
1227
+ //#region ../../node_modules/.pnpm/@nextwebwg+html-next@1.0.0-alpha.54/node_modules/@nextwebwg/html-next/dist/requests.js
1228
+ /**
1229
+ * Requests: behavior a component asks its consumer for, answered through a native event's
1230
+ * `respondWith` (https://nextwebwg.org/declarative-components/javascript#requests).
1231
+ *
1232
+ * Every HTML Next bundle on a page (the live runtime, compiled modules and framework helpers) keeps
1233
+ * its requests in one record on the document, so any consumer answers any component, and one
1234
+ * document listener relays late responders. Converted framework components carry this module's
1235
+ * source (scripts/generate-literal-source.ts), so it imports nothing.
1236
+ */
1237
+ var ports = /* @__PURE__ */ new WeakMap();
1238
+ var port = (event) => {
1239
+ let found = ports.get(event);
1240
+ if (found === void 0) ports.set(event, found = {});
1241
+ return found;
1242
+ };
1243
+ /** A request as its responders receive it: the nearest one answers with `respondWith`. */
1244
+ var RequestEvent = class extends CustomEvent {
1245
+ /** Aborts when the asker no longer needs the answer, or its component disconnects. */
1246
+ signal;
1247
+ constructor(type, init) {
1248
+ super(type, init);
1249
+ this.signal = init.signal;
1250
+ }
1251
+ /** Answer the request with a value or a promise of one; the event stops propagating. */
1252
+ respondWith(answer) {
1253
+ const recorded = port(this);
1254
+ if (this.eventPhase === 0 || recorded.a !== void 0) throw new DOMException(recorded.a === void 0 ? "A request is answered while it is dispatched." : "The request already has an answer.", "InvalidStateError");
1255
+ recorded.a = [answer];
1256
+ this.stopImmediatePropagation();
1257
+ }
1258
+ /** Report progress to the asker while the request is pending. */
1259
+ progress(loaded, total) {
1260
+ const report = this.signal.aborted ? void 0 : ports.get(this)?.p;
1261
+ try {
1262
+ report?.(loaded, total);
1263
+ } catch (error) {
1264
+ reportError(error);
1265
+ }
1266
+ }
1267
+ };
1268
+ //#endregion
1269
+ //#region src/editor/requests.ts
1270
+ var AskedRequest = class extends RequestEvent {
1271
+ answered = false;
1272
+ answer;
1273
+ report;
1274
+ respondWith(answer) {
1275
+ super.respondWith(answer);
1276
+ this.answered = true;
1277
+ this.answer = answer;
1278
+ }
1279
+ progress(loaded, total) {
1280
+ if (this.signal.aborted) return;
1281
+ try {
1282
+ this.report?.(loaded, total);
1283
+ } catch (error) {
1284
+ reportError(error);
1285
+ }
1286
+ }
1287
+ };
1288
+ /** Settles with `answer`, or rejects with the signal's reason when it aborts first. */
1289
+ var settle = (answer, signal) => new Promise((resolve, reject) => {
1290
+ const abort = () => reject(signal.reason);
1291
+ if (signal.aborted) abort();
1292
+ signal.addEventListener("abort", abort, { once: true });
1293
+ Promise.resolve(answer).then((value) => {
1294
+ signal.removeEventListener("abort", abort);
1295
+ resolve(value);
1296
+ }, (error) => {
1297
+ signal.removeEventListener("abort", abort);
1298
+ reject(error);
1299
+ });
1300
+ });
1301
+ /**
1302
+ * Asks `name` at `root` as an HTML Next component's `host.request` does: dispatches a bubbling,
1303
+ * composed `RequestEvent`, and the nearest responder's answer settles it. A responder that answers
1304
+ * with a value, or no responder at all, settles it at once, so the answer is returned as it is; an
1305
+ * answer given as a promise is returned as a promise.
1306
+ *
1307
+ * @contract Settles `null` when no listener answers during the dispatch, or when the answer is `null`.
1308
+ * @failure Throws when the signal has already aborted. A promised answer rejects with the signal's
1309
+ * reason when it aborts before the answer arrives, and with the answer's own rejection.
1310
+ */
1311
+ function askRequest(root, name, detail, options = {}) {
1312
+ const signal = options.signal ?? new AbortController().signal;
1313
+ signal.throwIfAborted();
1314
+ const event = new AskedRequest(name, {
1315
+ detail: detail ?? null,
1316
+ signal,
1317
+ bubbles: true,
1318
+ composed: true
1319
+ });
1320
+ event.report = options.progress;
1321
+ root.dispatchEvent(event);
1322
+ const answer = event.answered ? event.answer : null;
1323
+ if (!isThenable(answer)) {
1324
+ event.report = void 0;
1325
+ return answer ?? null;
1326
+ }
1327
+ return settle(answer, signal).then((value) => value ?? null).finally(() => {
1328
+ event.report = void 0;
1329
+ });
1330
+ }
1331
+ var isThenable = (value) => typeof value?.then === "function";
1332
+ /** Answers a request event with a responder function, as an HTML Next framework function prop does. */
1333
+ function respondWithFunction(event, responder) {
1334
+ const request = event;
1335
+ request.respondWith(responder(request.detail, {
1336
+ signal: request.signal,
1337
+ progress: (loaded, total) => request.progress(loaded, total)
1338
+ }));
1339
+ }
1340
+ /**
1341
+ * Calls `callback` with the request name when a responder announces itself, as HTML Next's
1342
+ * `respond()` does, on `root`, one of its ancestors, or the document.
1343
+ *
1344
+ * @lifecycle Listens on the document until the returned function is called.
1345
+ */
1346
+ function onResponderAnnounced(root, callback) {
1347
+ const document = root.ownerDocument;
1348
+ const listener = (event) => {
1349
+ const name = event.detail?.name;
1350
+ const target = event.target;
1351
+ if (typeof name === "string" && target instanceof Node && target.contains(root)) callback(name);
1352
+ };
1353
+ document.addEventListener("responder", listener);
1354
+ return () => document.removeEventListener("responder", listener);
1355
+ }
1356
+ //#endregion
1199
1357
  //#region src/editor/formatting-selection.ts
1200
1358
  var HOLD_MS = 500;
1201
1359
  var HOLD_SLOP_PX = 8;
@@ -2816,10 +2974,20 @@ var imageNodeView = ({ editor, node, getPos, decorations }) => {
2816
2974
  };
2817
2975
  //#endregion
2818
2976
  //#region src/vue/editor/LoomaEditor.ts
2977
+ var EDITOR_REQUESTS = {
2978
+ extensions: "extensions",
2979
+ "slash-commands": "slashCommands",
2980
+ "mention-query": "mentionQuery",
2981
+ "link-search": "linkSearch",
2982
+ "link-resolve": "linkResolve",
2983
+ "image-upload": "imageUpload"
2984
+ };
2985
+ var EDITOR_REQUEST_NAMES = Object.keys(EDITOR_REQUESTS);
2819
2986
  var EMPTY_DOCUMENT = {
2820
2987
  type: "doc",
2821
2988
  content: []
2822
2989
  };
2990
+ var uploadProgressText = (progress) => progress && progress.total > 0 ? `Uploading image… ${Math.round(Math.min(1, progress.loaded / progress.total) * 100)}%` : "Uploading image…";
2823
2991
  var editorInstanceSequence = 0;
2824
2992
  var EMPTY_CAPABILITIES = {
2825
2993
  canToggleHeaderRow: false,
@@ -2912,13 +3080,14 @@ var LoomaEditor = defineComponent({
2912
3080
  type: String,
2913
3081
  default: "Document"
2914
3082
  },
3083
+ /** Answers `extensions`: the application's Tiptap extensions, added after Looma's. */
2915
3084
  extensions: {
2916
- type: Array,
2917
- default: () => []
3085
+ type: Function,
3086
+ default: void 0
2918
3087
  },
2919
- /** One inventory for the existing slash extension; an empty array intentionally supplies no commands. */
3088
+ /** Answers `slash-commands`: the slash menu's commands, given the defaults. */
2920
3089
  slashCommands: {
2921
- type: [Array, Function],
3090
+ type: Function,
2922
3091
  default: void 0
2923
3092
  },
2924
3093
  /** Override the lazy built-in catalog with application-owned code grammars. An empty object disables highlighting. */
@@ -2930,7 +3099,8 @@ var LoomaEditor = defineComponent({
2930
3099
  type: Array,
2931
3100
  default: () => []
2932
3101
  },
2933
- mentionProvider: {
3102
+ /** Answers `mention-query`: people to suggest for what the author typed after `@`. */
3103
+ mentionQuery: {
2934
3104
  type: Function,
2935
3105
  default: void 0
2936
3106
  },
@@ -2943,7 +3113,7 @@ var LoomaEditor = defineComponent({
2943
3113
  type: String,
2944
3114
  default: ""
2945
3115
  },
2946
- /** Host-owned search and identity lookup for links to application records. */
3116
+ /** Answers `link-search` and `link-resolve`: host search and identity lookup for links to application records. */
2947
3117
  linkSearch: {
2948
3118
  type: Function,
2949
3119
  default: void 0
@@ -2956,7 +3126,8 @@ var LoomaEditor = defineComponent({
2956
3126
  type: String,
2957
3127
  default: "Item"
2958
3128
  },
2959
- uploadImage: {
3129
+ /** Answers `image-upload`: uploads a pasted, dropped, or chosen image and returns the image to insert. */
3130
+ imageUpload: {
2960
3131
  type: Function,
2961
3132
  default: void 0
2962
3133
  },
@@ -3086,6 +3257,7 @@ var LoomaEditor = defineComponent({
3086
3257
  let uploads;
3087
3258
  const uploadState = shallowRef({
3088
3259
  uploading: false,
3260
+ progress: null,
3089
3261
  failed: null
3090
3262
  });
3091
3263
  const tablePickerOpen = ref(false);
@@ -3182,12 +3354,77 @@ var LoomaEditor = defineComponent({
3182
3354
  chipOpen.value = false;
3183
3355
  if (focusChip) root.value?.querySelector(`#${chipAnchorId}`)?.focus();
3184
3356
  };
3185
- const resolveSlashCommands = () => {
3186
- const defaults = getDefaultSlashCommands(props.uploadImage ? () => fileInput.value?.click() : void 0, openChipEditor, () => openLinkEditor());
3187
- return typeof props.slashCommands === "function" ? props.slashCommands(defaults) : props.slashCommands ?? defaults;
3357
+ const found = reactive(/* @__PURE__ */ new Set());
3358
+ const answers = (name) => {
3359
+ const prop = EDITOR_REQUESTS[name];
3360
+ return typeof props[prop] === "function" || attrs[`on${prop[0].toUpperCase()}${prop.slice(1)}`] != null || found.has(name);
3361
+ };
3362
+ const connection = new AbortController();
3363
+ const ask = (name, detail, options = {}) => {
3364
+ if (!root.value || connection.signal.aborted) return null;
3365
+ const signal = options.signal ? AbortSignal.any([options.signal, connection.signal]) : connection.signal;
3366
+ return askRequest(root.value, name, detail, {
3367
+ ...options,
3368
+ signal
3369
+ });
3370
+ };
3371
+ const latest = /* @__PURE__ */ new Map();
3372
+ const askLatest = (name, detail) => {
3373
+ latest.get(name)?.abort();
3374
+ const controller = new AbortController();
3375
+ latest.set(name, controller);
3376
+ return ask(name, detail, { signal: controller.signal });
3377
+ };
3378
+ const askThen = (name, detail, apply) => {
3379
+ const answer = askLatest(name, detail);
3380
+ if (!(answer instanceof Promise)) return apply(answer);
3381
+ const controller = latest.get(name);
3382
+ answer.then(apply, (error) => {
3383
+ if (controller !== latest.get(name) || connection.signal.aborted) return;
3384
+ reportError(error);
3385
+ apply(null);
3386
+ });
3188
3387
  };
3388
+ let slashDefaults;
3389
+ const defaultSlashCommands = () => {
3390
+ const uploads = answers("image-upload");
3391
+ if (slashDefaults?.uploads !== uploads) slashDefaults = {
3392
+ uploads,
3393
+ commands: getDefaultSlashCommands(uploads ? () => fileInput.value?.click() : void 0, openChipEditor, () => openLinkEditor())
3394
+ };
3395
+ return slashDefaults.commands;
3396
+ };
3397
+ const askSlashCommands = () => {
3398
+ const defaults = defaultSlashCommands();
3399
+ askThen("slash-commands", { defaults: [...defaults] }, (answer) => {
3400
+ const commands = answer ?? defaults;
3401
+ const current = slashExtension.options.commands;
3402
+ if (commands.length === current.length && commands.every((command, index) => command === current[index])) return;
3403
+ slashExtension.options.commands = commands;
3404
+ editor.value?.commands.dismissLoomaSlashMenu();
3405
+ });
3406
+ };
3407
+ let consumerExtensions = [];
3408
+ const askExtensions = () => askThen("extensions", null, (extensions) => {
3409
+ const changed = Boolean(extensions?.length || consumerExtensions.length);
3410
+ consumerExtensions = extensions ?? [];
3411
+ if (!session) build(props.modelValue);
3412
+ else if (changed) rebuild();
3413
+ });
3414
+ let responders = /* @__PURE__ */ new Set();
3415
+ const checkResponders = () => {
3416
+ const current = new Set(EDITOR_REQUEST_NAMES.filter(answers));
3417
+ const arrived = (name) => current.has(name) && !responders.has(name);
3418
+ const extensionsArrived = arrived("extensions");
3419
+ const slashChanged = arrived("slash-commands") || current.has("image-upload") !== responders.has("image-upload");
3420
+ responders = current;
3421
+ if (extensionsArrived) askExtensions();
3422
+ if (slashChanged) askSlashCommands();
3423
+ };
3424
+ onUpdated(checkResponders);
3425
+ let stopAnnouncements;
3189
3426
  const slashExtension = createLoomaSlashCommandExtension({
3190
- commands: resolveSlashCommands(),
3427
+ commands: defaultSlashCommands(),
3191
3428
  onOpenImagePicker: () => fileInput.value?.click(),
3192
3429
  onOpenChipEditor: openChipEditor,
3193
3430
  onOpenLinkEditor: () => openLinkEditor(),
@@ -3196,13 +3433,13 @@ var LoomaEditor = defineComponent({
3196
3433
  }
3197
3434
  });
3198
3435
  const mentionMenuId = `looma-editor-mention-menu-${++editorInstanceSequence}`;
3199
- const mentionExtension = props.extensions.some((extension) => extension.name === "mention") ? null : createLoomaMentionExtension({
3436
+ const mentionExtension = createLoomaMentionExtension({
3200
3437
  limit: props.mentionLimit,
3201
3438
  menuId: mentionMenuId,
3202
- items: async (query, context) => {
3203
- if (props.mentionProvider) return await props.mentionProvider(query, context);
3204
- return props.mentionItems;
3205
- },
3439
+ items: async (query, context) => await askLatest("mention-query", {
3440
+ query,
3441
+ limit: context.limit
3442
+ }) ?? props.mentionItems,
3206
3443
  onStateChange: (state) => {
3207
3444
  Object.assign(mention, state);
3208
3445
  }
@@ -3234,13 +3471,16 @@ var LoomaEditor = defineComponent({
3234
3471
  const loadForCodeBlock = codeHighlighting.loadForCodeBlock;
3235
3472
  const editor = shallowRef();
3236
3473
  let session;
3237
- onMounted(() => {
3474
+ let edited = false;
3475
+ const build = (content) => {
3476
+ edited = false;
3477
+ const consumerMention = consumerExtensions.some((extension) => extension.name === "mention");
3238
3478
  session = createEditorSession({
3239
3479
  extensions: [
3240
3480
  ...getDefaultEditorExtensions({
3241
3481
  placeholder: props.placeholder,
3242
3482
  linkBaseUrl: props.linkBaseUrl,
3243
- mention: mentionExtension ?? false,
3483
+ mention: consumerMention ? false : mentionExtension,
3244
3484
  disableHighlight: props.disableHighlight,
3245
3485
  codeLanguages: props.codeLanguages ?? void 0,
3246
3486
  codeLowlight: codeHighlighting.lowlight,
@@ -3252,9 +3492,9 @@ var LoomaEditor = defineComponent({
3252
3492
  }),
3253
3493
  imageDelivery.extension,
3254
3494
  slashExtension,
3255
- ...props.extensions
3495
+ ...consumerExtensions
3256
3496
  ],
3257
- content: props.modelValue,
3497
+ content,
3258
3498
  editable: props.editable,
3259
3499
  editorProps: {
3260
3500
  nodeViews: { image: () => ({ dom: document.createElement("span") }) },
@@ -3304,6 +3544,7 @@ var LoomaEditor = defineComponent({
3304
3544
  }
3305
3545
  },
3306
3546
  onUpdate: ({ editor: instance }) => {
3547
+ edited = true;
3307
3548
  const value = instance.getJSON();
3308
3549
  emit("update:modelValue", value);
3309
3550
  emit("update", value);
@@ -3316,8 +3557,8 @@ var LoomaEditor = defineComponent({
3316
3557
  editor.value = session.editor;
3317
3558
  const engine = createLinkEditing({
3318
3559
  editor: session.editor,
3319
- search: () => props.linkSearch,
3320
- resolve: () => props.linkResolve,
3560
+ search: () => answers("link-search") ? async (query) => await askLatest("link-search", { query }) ?? [] : null,
3561
+ resolve: () => async (href) => await askLatest("link-resolve", { href }),
3321
3562
  baseUrl: () => props.linkBaseUrl
3322
3563
  });
3323
3564
  engine.subscribe(() => {
@@ -3326,7 +3567,14 @@ var LoomaEditor = defineComponent({
3326
3567
  linkEditing = engine;
3327
3568
  const imageUploads = createImageUploads({
3328
3569
  editor: session.editor,
3329
- upload: () => props.uploadImage,
3570
+ upload: () => async (file, init) => {
3571
+ const image = await ask("image-upload", { file }, init);
3572
+ if (image && !found.has("image-upload")) {
3573
+ found.add("image-upload");
3574
+ checkResponders();
3575
+ }
3576
+ return image;
3577
+ },
3330
3578
  onError: (error, file) => emit("uploadError", error, file)
3331
3579
  });
3332
3580
  imageUploads.subscribe(() => {
@@ -3344,6 +3592,30 @@ var LoomaEditor = defineComponent({
3344
3592
  formattingPopup?.show();
3345
3593
  }
3346
3594
  });
3595
+ };
3596
+ const rebuild = () => {
3597
+ const previous = session;
3598
+ const content = edited ? previous.editor.getJSON() : props.modelValue;
3599
+ linkEditing?.destroy();
3600
+ formatting?.destroy();
3601
+ uploads?.cancel();
3602
+ previous.destroy();
3603
+ build(content);
3604
+ };
3605
+ onMounted(() => {
3606
+ const element = root.value;
3607
+ for (const name of EDITOR_REQUEST_NAMES) element.addEventListener(name, (event) => {
3608
+ const responder = props[EDITOR_REQUESTS[name]];
3609
+ if (typeof responder === "function" && "respondWith" in event) respondWithFunction(event, responder);
3610
+ }, { capture: true });
3611
+ stopAnnouncements = onResponderAnnounced(element, (name) => {
3612
+ if (!(name in EDITOR_REQUESTS)) return;
3613
+ found.add(name);
3614
+ checkResponders();
3615
+ });
3616
+ responders = new Set(EDITOR_REQUEST_NAMES.filter(answers));
3617
+ askExtensions();
3618
+ askSlashCommands();
3347
3619
  });
3348
3620
  const attachDocument = (element) => {
3349
3621
  if (element instanceof HTMLElement) session?.attach(element);
@@ -3351,6 +3623,8 @@ var LoomaEditor = defineComponent({
3351
3623
  onBeforeUnmount(() => {
3352
3624
  const element = session?.editor.options.element;
3353
3625
  element?.parentNode?.replaceChild(element.cloneNode(true), element);
3626
+ connection.abort();
3627
+ stopAnnouncements?.();
3354
3628
  linkEditing?.destroy();
3355
3629
  session?.destroy();
3356
3630
  });
@@ -3384,10 +3658,10 @@ var LoomaEditor = defineComponent({
3384
3658
  ref: setLinkFormRoot,
3385
3659
  class: "looma-editor__link-form",
3386
3660
  existing: Boolean(state.range?.existing),
3387
- searchable: Boolean(props.linkSearch),
3661
+ searchable: answers("link-search"),
3388
3662
  mode: state.mode,
3389
- value: props.linkSearch ? state.query : state.href,
3390
- placeholder: props.linkSearch ? `Search ${props.linkTargetLabel.toLowerCase()}s or paste a URL…` : "https://example.com",
3663
+ value: answers("link-search") ? state.query : state.href,
3664
+ placeholder: answers("link-search") ? `Search ${props.linkTargetLabel.toLowerCase()}s or paste a URL…` : "https://example.com",
3391
3665
  newTab: state.newTab,
3392
3666
  textEditable: state.textEditable,
3393
3667
  text: state.text,
@@ -3437,10 +3711,7 @@ var LoomaEditor = defineComponent({
3437
3711
  onRemove: () => linkEditing?.remove()
3438
3712
  });
3439
3713
  };
3440
- watch([() => props.slashCommands, () => props.uploadImage], () => {
3441
- slashExtension.options.commands = resolveSlashCommands();
3442
- editor.value?.commands.dismissLoomaSlashMenu();
3443
- });
3714
+ watch(() => props.slashCommands, askSlashCommands);
3444
3715
  watch(() => props.editable, (editable) => {
3445
3716
  formatting?.press.cancel();
3446
3717
  formatting?.release();
@@ -4205,7 +4476,7 @@ var LoomaEditor = defineComponent({
4205
4476
  variant: tablePickerOpen.value ? "solid" : "ghost",
4206
4477
  "aria-expanded": tablePickerOpen.value ? "true" : "false"
4207
4478
  }, () => loomaIcon("table")),
4208
- commandButton(uploadState.value.uploading ? "Uploading image" : "Insert image", "image", false, uploadState.value.uploading || !props.uploadImage, () => fileInput.value?.click()),
4479
+ commandButton(uploadState.value.uploading ? "Uploading image" : "Insert image", "image", false, uploadState.value.uploading || !answers("image-upload"), () => fileInput.value?.click()),
4209
4480
  h("span", {
4210
4481
  class: "divider",
4211
4482
  "aria-hidden": "true"
@@ -4396,6 +4667,14 @@ var LoomaEditor = defineComponent({
4396
4667
  "aria-hidden": "true",
4397
4668
  onChange: onFileChange
4398
4669
  }),
4670
+ uploadState.value.uploading ? h(StatusMessage, { kind: "loading" }, {
4671
+ default: () => uploadProgressText(uploadState.value.progress),
4672
+ action: () => h(Button, {
4673
+ size: "sm",
4674
+ variant: "ghost",
4675
+ onClick: () => uploads?.cancel()
4676
+ }, () => "Cancel")
4677
+ }) : null,
4399
4678
  uploadState.value.failed ? h("div", {
4400
4679
  class: "looma-editor__upload-error",
4401
4680
  role: "alert"
package/vue/host.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.53 for Vue 3.5. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.54 for Vue 3.5. Do not edit.
2
2
  import {
3
3
  computed,
4
4
  createTextVNode,
@@ -535,6 +535,8 @@ export interface ComponentHostOptions {
535
535
  readonly data?: Readonly<Record<string, Readable<unknown>>>
536
536
  /** Values inherited through declared context, which a controller reads. */
537
537
  readonly context?: Readonly<Record<string, Readable<unknown>>>
538
+ /** Each named declared script, which a controller reads as `host.scripts`. */
539
+ readonly scripts?: Readonly<Record<string, unknown>>
538
540
  readonly acceptsState?: (name: string, keys: readonly string[], value: unknown) => boolean
539
541
  /** Asks one of the component's declared requests. */
540
542
  request?(
@@ -700,6 +702,7 @@ export function useComponentHost(
700
702
  ),
701
703
  ...(options.acceptsState === undefined ? {} : { acceptsState: options.acceptsState }),
702
704
  }, options.controllerSource?.definition ?? '<component>'),
705
+ scripts: options.scripts ?? Object.freeze({}),
703
706
  on(type: string, callback: (event: Event) => void | (() => void)): () => void {
704
707
  const entry: Subscription = {
705
708
  type,