@threadlabs/looma 0.29.11 → 0.29.13

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 (423) hide show
  1. package/EXPRESSIVE-MARKDOWN.md +90 -0
  2. package/README.md +6 -0
  3. package/components/ui-tabs/ui-tabs.html +2 -2
  4. package/components/ui-tabs/ui-tabs.js +14 -10
  5. package/dist/index.js +1 -1
  6. package/editor/chunks/extensions.js +80 -251
  7. package/editor/chunks/markdown.js +242 -0
  8. package/editor/expressmark.d.ts +31 -0
  9. package/editor/expressmark.js +942 -0
  10. package/editor/extensions/index.js +2 -1
  11. package/editor/extensions/table-of-contents.d.ts +1 -1
  12. package/editor/index.js +2 -1
  13. package/editor/node-views/image.d.ts +10 -0
  14. package/editor/node-views/table-of-contents.d.ts +1 -1
  15. package/package.json +12 -5
  16. package/styles/ui-action-bar.css +1 -1
  17. package/styles/ui-affordance-scope.css +1 -1
  18. package/styles/ui-avatar-group.css +1 -1
  19. package/styles/ui-avatar.css +1 -1
  20. package/styles/ui-badge.css +1 -1
  21. package/styles/ui-breadcrumb-item.css +1 -1
  22. package/styles/ui-breadcrumbs.css +1 -1
  23. package/styles/ui-button.css +1 -1
  24. package/styles/ui-callout.css +1 -1
  25. package/styles/ui-card.css +1 -1
  26. package/styles/ui-checkbox.css +1 -1
  27. package/styles/ui-cluster.css +1 -1
  28. package/styles/ui-combobox.css +1 -1
  29. package/styles/ui-container.css +1 -1
  30. package/styles/ui-context-menu.css +1 -1
  31. package/styles/ui-cover.css +1 -1
  32. package/styles/ui-description-item.css +1 -1
  33. package/styles/ui-description-list.css +1 -1
  34. package/styles/ui-dialog.css +1 -1
  35. package/styles/ui-disclosure.css +1 -1
  36. package/styles/ui-editable.css +1 -1
  37. package/styles/ui-editor-block-actions.css +1 -1
  38. package/styles/ui-editor-chip-editor.css +1 -1
  39. package/styles/ui-editor-code-language.css +1 -1
  40. package/styles/ui-editor-image-toolbar.css +1 -1
  41. package/styles/ui-editor-insert-table-grid.css +1 -1
  42. package/styles/ui-editor-link-card.css +1 -1
  43. package/styles/ui-editor-link-form.css +1 -1
  44. package/styles/ui-editor-mention-menu-item.css +1 -1
  45. package/styles/ui-editor-mention-menu.css +1 -1
  46. package/styles/ui-editor-slash-menu-group.css +1 -1
  47. package/styles/ui-editor-slash-menu-item.css +1 -1
  48. package/styles/ui-editor-slash-menu.css +1 -1
  49. package/styles/ui-editor-surface.css +1 -1
  50. package/styles/ui-editor-table-context-menu.css +1 -1
  51. package/styles/ui-editor-table-overlay.css +1 -1
  52. package/styles/ui-editor-table-toolbar.css +1 -1
  53. package/styles/ui-editor-toolbar.css +1 -1
  54. package/styles/ui-floating-action-button.css +1 -1
  55. package/styles/ui-form-field.css +1 -1
  56. package/styles/ui-grid.css +1 -1
  57. package/styles/ui-icon-button.css +1 -1
  58. package/styles/ui-icon.css +1 -1
  59. package/styles/ui-image.css +1 -1
  60. package/styles/ui-input-group.css +1 -1
  61. package/styles/ui-input.css +1 -1
  62. package/styles/ui-list-item.css +1 -1
  63. package/styles/ui-list.css +1 -1
  64. package/styles/ui-listbox.css +1 -1
  65. package/styles/ui-menu-group.css +1 -1
  66. package/styles/ui-menu-item.css +1 -1
  67. package/styles/ui-menu.css +1 -1
  68. package/styles/ui-meter.css +1 -1
  69. package/styles/ui-nav-item.css +1 -1
  70. package/styles/ui-page-header.css +1 -1
  71. package/styles/ui-popover.css +1 -1
  72. package/styles/ui-radio-group.css +1 -1
  73. package/styles/ui-radio.css +1 -1
  74. package/styles/ui-reel.css +1 -1
  75. package/styles/ui-scroll-area.css +1 -1
  76. package/styles/ui-search-result-row.css +1 -1
  77. package/styles/ui-search-shell.css +1 -1
  78. package/styles/ui-section.css +1 -1
  79. package/styles/ui-select.css +1 -1
  80. package/styles/ui-separator.css +1 -1
  81. package/styles/ui-sidebar.css +1 -1
  82. package/styles/ui-spinner.css +1 -1
  83. package/styles/ui-stack.css +1 -1
  84. package/styles/ui-status-message.css +1 -1
  85. package/styles/ui-swatch.css +1 -1
  86. package/styles/ui-switch.css +1 -1
  87. package/styles/ui-switcher.css +1 -1
  88. package/styles/ui-table.css +1 -1
  89. package/styles/ui-tabs.css +1 -1
  90. package/styles/ui-text.css +1 -1
  91. package/styles/ui-textarea.css +1 -1
  92. package/styles/ui-toast-region.css +1 -1
  93. package/styles/ui-toast.css +1 -1
  94. package/styles/ui-tooltip.css +1 -1
  95. package/styles/ui-top-bar.css +1 -1
  96. package/styles/ui-tree-item.css +1 -1
  97. package/styles/ui-tree.css +1 -1
  98. package/vanilla/UiActionBar.d.ts +1 -1
  99. package/vanilla/UiActionBar.js +1 -1
  100. package/vanilla/UiAffordanceScope.d.ts +1 -1
  101. package/vanilla/UiAffordanceScope.js +1 -1
  102. package/vanilla/UiAvatar.d.ts +1 -1
  103. package/vanilla/UiAvatar.js +1 -1
  104. package/vanilla/UiAvatarGroup.d.ts +1 -1
  105. package/vanilla/UiAvatarGroup.js +1 -1
  106. package/vanilla/UiBadge.d.ts +1 -1
  107. package/vanilla/UiBadge.js +1 -1
  108. package/vanilla/UiBreadcrumbItem.d.ts +1 -1
  109. package/vanilla/UiBreadcrumbItem.js +1 -1
  110. package/vanilla/UiBreadcrumbs.d.ts +1 -1
  111. package/vanilla/UiBreadcrumbs.js +1 -1
  112. package/vanilla/UiButton.d.ts +1 -1
  113. package/vanilla/UiButton.js +1 -1
  114. package/vanilla/UiCallout.d.ts +1 -1
  115. package/vanilla/UiCallout.js +1 -1
  116. package/vanilla/UiCard.d.ts +1 -1
  117. package/vanilla/UiCard.js +1 -1
  118. package/vanilla/UiCheckbox.d.ts +1 -1
  119. package/vanilla/UiCheckbox.js +1 -1
  120. package/vanilla/UiCluster.d.ts +1 -1
  121. package/vanilla/UiCluster.js +1 -1
  122. package/vanilla/UiCombobox.d.ts +1 -1
  123. package/vanilla/UiCombobox.js +1 -1
  124. package/vanilla/UiContainer.d.ts +1 -1
  125. package/vanilla/UiContainer.js +1 -1
  126. package/vanilla/UiContextMenu.d.ts +1 -1
  127. package/vanilla/UiContextMenu.js +1 -1
  128. package/vanilla/UiCover.d.ts +1 -1
  129. package/vanilla/UiCover.js +1 -1
  130. package/vanilla/UiDescriptionItem.d.ts +1 -1
  131. package/vanilla/UiDescriptionItem.js +1 -1
  132. package/vanilla/UiDescriptionList.d.ts +1 -1
  133. package/vanilla/UiDescriptionList.js +1 -1
  134. package/vanilla/UiDialog.d.ts +1 -1
  135. package/vanilla/UiDialog.js +1 -1
  136. package/vanilla/UiDisclosure.d.ts +1 -1
  137. package/vanilla/UiDisclosure.js +1 -1
  138. package/vanilla/UiEditable.d.ts +1 -1
  139. package/vanilla/UiEditable.js +1 -1
  140. package/vanilla/UiEditorBlockActions.d.ts +1 -1
  141. package/vanilla/UiEditorBlockActions.js +1 -1
  142. package/vanilla/UiEditorChipEditor.d.ts +1 -1
  143. package/vanilla/UiEditorChipEditor.js +1 -1
  144. package/vanilla/UiEditorCodeLanguage.d.ts +1 -1
  145. package/vanilla/UiEditorCodeLanguage.js +1 -1
  146. package/vanilla/UiEditorImageToolbar.d.ts +1 -1
  147. package/vanilla/UiEditorImageToolbar.js +1 -1
  148. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  149. package/vanilla/UiEditorInsertTableGrid.js +1 -1
  150. package/vanilla/UiEditorLinkCard.d.ts +1 -1
  151. package/vanilla/UiEditorLinkCard.js +1 -1
  152. package/vanilla/UiEditorLinkForm.d.ts +1 -1
  153. package/vanilla/UiEditorLinkForm.js +1 -1
  154. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  155. package/vanilla/UiEditorMentionMenu.js +1 -1
  156. package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
  157. package/vanilla/UiEditorMentionMenuItem.js +1 -1
  158. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  159. package/vanilla/UiEditorSlashMenu.js +1 -1
  160. package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
  161. package/vanilla/UiEditorSlashMenuGroup.js +1 -1
  162. package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
  163. package/vanilla/UiEditorSlashMenuItem.js +1 -1
  164. package/vanilla/UiEditorSurface.d.ts +1 -1
  165. package/vanilla/UiEditorSurface.js +1 -1
  166. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  167. package/vanilla/UiEditorTableContextMenu.js +1 -1
  168. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  169. package/vanilla/UiEditorTableOverlay.js +1 -1
  170. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  171. package/vanilla/UiEditorTableToolbar.js +1 -1
  172. package/vanilla/UiEditorToolbar.d.ts +1 -1
  173. package/vanilla/UiEditorToolbar.js +1 -1
  174. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  175. package/vanilla/UiFloatingActionButton.js +1 -1
  176. package/vanilla/UiFormField.d.ts +1 -1
  177. package/vanilla/UiFormField.js +1 -1
  178. package/vanilla/UiGrid.d.ts +1 -1
  179. package/vanilla/UiGrid.js +1 -1
  180. package/vanilla/UiIcon.d.ts +1 -1
  181. package/vanilla/UiIcon.js +1 -1
  182. package/vanilla/UiIconButton.d.ts +1 -1
  183. package/vanilla/UiIconButton.js +1 -1
  184. package/vanilla/UiImage.d.ts +1 -1
  185. package/vanilla/UiImage.js +1 -1
  186. package/vanilla/UiInput.d.ts +1 -1
  187. package/vanilla/UiInput.js +1 -1
  188. package/vanilla/UiInputGroup.d.ts +1 -1
  189. package/vanilla/UiInputGroup.js +1 -1
  190. package/vanilla/UiList.d.ts +1 -1
  191. package/vanilla/UiList.js +1 -1
  192. package/vanilla/UiListItem.d.ts +1 -1
  193. package/vanilla/UiListItem.js +1 -1
  194. package/vanilla/UiListbox.d.ts +1 -1
  195. package/vanilla/UiListbox.js +1 -1
  196. package/vanilla/UiMenu.d.ts +1 -1
  197. package/vanilla/UiMenu.js +1 -1
  198. package/vanilla/UiMenuGroup.d.ts +1 -1
  199. package/vanilla/UiMenuGroup.js +1 -1
  200. package/vanilla/UiMenuItem.d.ts +1 -1
  201. package/vanilla/UiMenuItem.js +1 -1
  202. package/vanilla/UiMeter.d.ts +1 -1
  203. package/vanilla/UiMeter.js +1 -1
  204. package/vanilla/UiNavItem.d.ts +1 -1
  205. package/vanilla/UiNavItem.js +1 -1
  206. package/vanilla/UiPageHeader.d.ts +1 -1
  207. package/vanilla/UiPageHeader.js +1 -1
  208. package/vanilla/UiPopover.d.ts +1 -1
  209. package/vanilla/UiPopover.js +1 -1
  210. package/vanilla/UiRadio.d.ts +1 -1
  211. package/vanilla/UiRadio.js +1 -1
  212. package/vanilla/UiRadioGroup.d.ts +1 -1
  213. package/vanilla/UiRadioGroup.js +1 -1
  214. package/vanilla/UiReel.d.ts +1 -1
  215. package/vanilla/UiReel.js +1 -1
  216. package/vanilla/UiScrollArea.d.ts +1 -1
  217. package/vanilla/UiScrollArea.js +1 -1
  218. package/vanilla/UiSearchResultRow.d.ts +1 -1
  219. package/vanilla/UiSearchResultRow.js +1 -1
  220. package/vanilla/UiSearchShell.d.ts +1 -1
  221. package/vanilla/UiSearchShell.js +1 -1
  222. package/vanilla/UiSection.d.ts +1 -1
  223. package/vanilla/UiSection.js +1 -1
  224. package/vanilla/UiSelect.d.ts +1 -1
  225. package/vanilla/UiSelect.js +1 -1
  226. package/vanilla/UiSeparator.d.ts +1 -1
  227. package/vanilla/UiSeparator.js +1 -1
  228. package/vanilla/UiSidebar.d.ts +1 -1
  229. package/vanilla/UiSidebar.js +1 -1
  230. package/vanilla/UiSpinner.d.ts +1 -1
  231. package/vanilla/UiSpinner.js +1 -1
  232. package/vanilla/UiStack.d.ts +1 -1
  233. package/vanilla/UiStack.js +1 -1
  234. package/vanilla/UiStatusMessage.d.ts +1 -1
  235. package/vanilla/UiStatusMessage.js +1 -1
  236. package/vanilla/UiSwatch.d.ts +1 -1
  237. package/vanilla/UiSwatch.js +1 -1
  238. package/vanilla/UiSwitch.d.ts +1 -1
  239. package/vanilla/UiSwitch.js +1 -1
  240. package/vanilla/UiSwitcher.d.ts +1 -1
  241. package/vanilla/UiSwitcher.js +1 -1
  242. package/vanilla/UiTable.d.ts +1 -1
  243. package/vanilla/UiTable.js +1 -1
  244. package/vanilla/UiTabs.d.ts +1 -1
  245. package/vanilla/UiTabs.js +1 -1
  246. package/vanilla/UiText.d.ts +1 -1
  247. package/vanilla/UiText.js +1 -1
  248. package/vanilla/UiTextarea.d.ts +1 -1
  249. package/vanilla/UiTextarea.js +1 -1
  250. package/vanilla/UiToast.d.ts +1 -1
  251. package/vanilla/UiToast.js +1 -1
  252. package/vanilla/UiToastRegion.d.ts +1 -1
  253. package/vanilla/UiToastRegion.js +1 -1
  254. package/vanilla/UiTooltip.d.ts +1 -1
  255. package/vanilla/UiTooltip.js +1 -1
  256. package/vanilla/UiTopBar.d.ts +1 -1
  257. package/vanilla/UiTopBar.js +1 -1
  258. package/vanilla/UiTree.d.ts +1 -1
  259. package/vanilla/UiTree.js +1 -1
  260. package/vanilla/UiTreeItem.d.ts +1 -1
  261. package/vanilla/UiTreeItem.js +1 -1
  262. package/vue/UiActionBar.vue +1 -1
  263. package/vue/UiAffordanceScope.vue +1 -1
  264. package/vue/UiAvatar.vue +1 -1
  265. package/vue/UiAvatarGroup.vue +1 -1
  266. package/vue/UiBadge.vue +1 -1
  267. package/vue/UiBreadcrumbItem.vue +1 -1
  268. package/vue/UiBreadcrumbs.vue +1 -1
  269. package/vue/UiButton.vue +1 -1
  270. package/vue/UiCallout.vue +1 -1
  271. package/vue/UiCard.vue +1 -1
  272. package/vue/UiCheckbox.vue +1 -1
  273. package/vue/UiCluster.vue +1 -1
  274. package/vue/UiCombobox.vue +1 -1
  275. package/vue/UiContainer.vue +1 -1
  276. package/vue/UiContextMenu.vue +1 -1
  277. package/vue/UiCover.vue +1 -1
  278. package/vue/UiDescriptionItem.vue +1 -1
  279. package/vue/UiDescriptionList.vue +1 -1
  280. package/vue/UiDialog.vue +1 -1
  281. package/vue/UiDisclosure.vue +1 -1
  282. package/vue/UiEditable.vue +1 -1
  283. package/vue/UiEditorBlockActions.vue +1 -1
  284. package/vue/UiEditorChipEditor.vue +1 -1
  285. package/vue/UiEditorCodeLanguage.vue +1 -1
  286. package/vue/UiEditorImageToolbar.vue +1 -1
  287. package/vue/UiEditorInsertTableGrid.vue +1 -1
  288. package/vue/UiEditorLinkCard.vue +1 -1
  289. package/vue/UiEditorLinkForm.vue +1 -1
  290. package/vue/UiEditorMentionMenu.vue +1 -1
  291. package/vue/UiEditorMentionMenuItem.vue +1 -1
  292. package/vue/UiEditorSlashMenu.vue +1 -1
  293. package/vue/UiEditorSlashMenuGroup.vue +1 -1
  294. package/vue/UiEditorSlashMenuItem.vue +1 -1
  295. package/vue/UiEditorSurface.vue +1 -1
  296. package/vue/UiEditorTableContextMenu.vue +1 -1
  297. package/vue/UiEditorTableOverlay.vue +1 -1
  298. package/vue/UiEditorTableToolbar.vue +1 -1
  299. package/vue/UiEditorToolbar.vue +1 -1
  300. package/vue/UiFloatingActionButton.vue +1 -1
  301. package/vue/UiFormField.vue +1 -1
  302. package/vue/UiGrid.vue +1 -1
  303. package/vue/UiIcon.vue +1 -1
  304. package/vue/UiIconButton.vue +1 -1
  305. package/vue/UiImage.vue +1 -1
  306. package/vue/UiInput.vue +1 -1
  307. package/vue/UiInputGroup.vue +1 -1
  308. package/vue/UiList.vue +1 -1
  309. package/vue/UiListItem.vue +1 -1
  310. package/vue/UiListbox.vue +1 -1
  311. package/vue/UiMenu.vue +1 -1
  312. package/vue/UiMenuGroup.vue +1 -1
  313. package/vue/UiMenuItem.vue +1 -1
  314. package/vue/UiMeter.vue +1 -1
  315. package/vue/UiNavItem.vue +1 -1
  316. package/vue/UiPageHeader.vue +1 -1
  317. package/vue/UiPopover.vue +1 -1
  318. package/vue/UiRadio.vue +1 -1
  319. package/vue/UiRadioGroup.vue +1 -1
  320. package/vue/UiReel.vue +1 -1
  321. package/vue/UiScrollArea.vue +1 -1
  322. package/vue/UiSearchResultRow.vue +1 -1
  323. package/vue/UiSearchShell.vue +1 -1
  324. package/vue/UiSection.vue +1 -1
  325. package/vue/UiSelect.vue +1 -1
  326. package/vue/UiSeparator.vue +1 -1
  327. package/vue/UiSidebar.vue +1 -1
  328. package/vue/UiSpinner.vue +1 -1
  329. package/vue/UiStack.vue +1 -1
  330. package/vue/UiStatusMessage.vue +1 -1
  331. package/vue/UiSwatch.vue +1 -1
  332. package/vue/UiSwitch.vue +1 -1
  333. package/vue/UiSwitcher.vue +1 -1
  334. package/vue/UiTable.vue +1 -1
  335. package/vue/UiTabs.vue +3 -3
  336. package/vue/UiText.vue +1 -1
  337. package/vue/UiTextarea.vue +1 -1
  338. package/vue/UiToast.vue +1 -1
  339. package/vue/UiToastRegion.vue +1 -1
  340. package/vue/UiTooltip.vue +1 -1
  341. package/vue/UiTopBar.vue +1 -1
  342. package/vue/UiTree.vue +1 -1
  343. package/vue/UiTreeItem.vue +1 -1
  344. package/vue/chunks/UiActionBar.js +1 -1
  345. package/vue/chunks/UiAffordanceScope.js +1 -1
  346. package/vue/chunks/UiAvatar.js +1 -1
  347. package/vue/chunks/UiAvatarGroup.js +1 -1
  348. package/vue/chunks/UiBadge.js +1 -1
  349. package/vue/chunks/UiBreadcrumbItem.js +1 -1
  350. package/vue/chunks/UiBreadcrumbs.js +1 -1
  351. package/vue/chunks/UiButton.js +1 -1
  352. package/vue/chunks/UiCallout.js +1 -1
  353. package/vue/chunks/UiCard.js +1 -1
  354. package/vue/chunks/UiCheckbox.js +1 -1
  355. package/vue/chunks/UiCluster.js +1 -1
  356. package/vue/chunks/UiCombobox.js +1 -1
  357. package/vue/chunks/UiContainer.js +1 -1
  358. package/vue/chunks/UiContextMenu.js +1 -1
  359. package/vue/chunks/UiCover.js +1 -1
  360. package/vue/chunks/UiDescriptionItem.js +1 -1
  361. package/vue/chunks/UiDescriptionList.js +1 -1
  362. package/vue/chunks/UiDialog.js +1 -1
  363. package/vue/chunks/UiDisclosure.js +1 -1
  364. package/vue/chunks/UiEditable.js +1 -1
  365. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  366. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  367. package/vue/chunks/UiEditorMentionMenuItem.js +1 -1
  368. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  369. package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
  370. package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
  371. package/vue/chunks/UiEditorSurface.js +1 -1
  372. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  373. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  374. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  375. package/vue/chunks/UiEditorToolbar.js +1 -1
  376. package/vue/chunks/UiFloatingActionButton.js +1 -1
  377. package/vue/chunks/UiFormField.js +1 -1
  378. package/vue/chunks/UiGrid.js +1 -1
  379. package/vue/chunks/UiIcon.js +1 -1
  380. package/vue/chunks/UiIconButton.js +1 -1
  381. package/vue/chunks/UiImage.js +1 -1
  382. package/vue/chunks/UiInput.js +1 -1
  383. package/vue/chunks/UiInputGroup.js +1 -1
  384. package/vue/chunks/UiList.js +1 -1
  385. package/vue/chunks/UiListItem.js +1 -1
  386. package/vue/chunks/UiListbox.js +1 -1
  387. package/vue/chunks/UiMenu.js +1 -1
  388. package/vue/chunks/UiMenuGroup.js +1 -1
  389. package/vue/chunks/UiMenuItem.js +1 -1
  390. package/vue/chunks/UiMeter.js +1 -1
  391. package/vue/chunks/UiNavItem.js +1 -1
  392. package/vue/chunks/UiPageHeader.js +1 -1
  393. package/vue/chunks/UiPopover.js +1 -1
  394. package/vue/chunks/UiRadio.js +1 -1
  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 +1 -1
  399. package/vue/chunks/UiSearchShell.js +1 -1
  400. package/vue/chunks/UiSection.js +1 -1
  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 +1 -1
  407. package/vue/chunks/UiSwatch.js +1 -1
  408. package/vue/chunks/UiSwitch.js +1 -1
  409. package/vue/chunks/UiSwitcher.js +1 -1
  410. package/vue/chunks/UiTable.js +1 -1
  411. package/vue/chunks/UiTabs.js +3 -3
  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 +1 -1
  416. package/vue/chunks/UiTooltip.js +1 -1
  417. package/vue/chunks/UiTopBar.js +1 -1
  418. package/vue/chunks/UiTree.js +1 -1
  419. package/vue/chunks/UiTreeItem.js +1 -1
  420. package/vue/components.css +197 -37
  421. package/vue/editor/index.js +816 -313
  422. package/vue/host.ts +1 -1
  423. package/vue/editor/image.d.ts +0 -7
@@ -1,6 +1,6 @@
1
- import { computed, createApp, defineComponent, h, nextTick, onBeforeUnmount, onMounted, onUpdated, reactive, ref, shallowRef, useId, watch } from "vue";
1
+ import { computed, 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, normalizeTableOfContentsConfig } from "@threadlabs/looma/editor";
3
- import { Button, Card, EditorBlockActions, EditorChipEditor, EditorCodeLanguage, EditorImageToolbar, EditorInsertTableGrid, EditorLinkCard, EditorLinkForm, EditorMentionMenu, EditorMentionMenuItem, EditorSlashMenu, EditorSlashMenuGroup, EditorSlashMenuItem, EditorSurface, EditorTableContextMenu, EditorTableOverlay, EditorTableToolbar, EditorToolbar, IconButton, Image, Popover, Stack, StatusMessage, Text, Tooltip } from "@threadlabs/looma/vue";
3
+ import { Button, Card, EditorBlockActions, EditorChipEditor, EditorCodeLanguage, EditorImageToolbar, EditorInsertTableGrid, EditorLinkCard, EditorLinkForm, EditorMentionMenu, EditorMentionMenuItem, EditorSlashMenu, EditorSlashMenuGroup, EditorSlashMenuItem, EditorSurface, EditorTableContextMenu, EditorTableOverlay, EditorTableToolbar, EditorToolbar, IconButton, Popover, 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 { AllSelection, NodeSelection, Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";
@@ -10,8 +10,8 @@ import { RequestEvent, updateComponentProps } from "@nextwebwg/html-next/runtime
10
10
  import "@tiptap/pm/tables";
11
11
  import "@tiptap/pm/transform";
12
12
  import { closeHistory } from "@tiptap/pm/history";
13
- import { IndexedList, NONCONFORMING, acceptProps, armElement, attachGeneratedController, buildTemplate, checkBoolean, checkConstrained, checkFormat, checkInteger, checkNumber, checkObject, checkSelected, checkString, clearRegion, computedCycle, detailCheck, dispatchDeclared, dispose, fillSlot, formatOf, hostState, keywordFormat, manageProps, project, readIndex, readMember, readonlyView, readsChanged, rec, replaceRoot, textCall, toAttribute, toText, trackContainer, truthy, writeAttribute, writeUrlAttribute } from "@nextwebwg/html-next/generated-runtime";
14
13
  import { DOMParser, DOMSerializer, Fragment as Fragment$1 } from "@tiptap/pm/model";
14
+ import { IndexedList, NONCONFORMING, acceptProps, armElement, attachGeneratedController, buildTemplate, checkBoolean, checkConstrained, checkFormat, checkInteger, checkNumber, checkObject, checkSelected, checkString, clearRegion, computedCycle, detailCheck, dispatchDeclared, dispose, fillSlot, formatOf, hostState, keywordFormat, manageProps, project, readIndex, readMember, readonlyView, readsChanged, rec, replaceRoot, textCall, toAttribute, toText, trackContainer, truthy, writeAttribute, writeUrlAttribute } from "@nextwebwg/html-next/generated-runtime";
15
15
  export * from "@threadlabs/looma/editor";
16
16
  //#region src/vue/editor/primitives.ts
17
17
  /** Each Vue editor component's element tag, for tooling that enumerates them. */
@@ -601,7 +601,7 @@ var inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
601
601
  * This extension allows you to insert images.
602
602
  * @see https://www.tiptap.dev/api/nodes/image
603
603
  */
604
- var Image$1 = Node$1.create({
604
+ var Image = Node$1.create({
605
605
  name: "image",
606
606
  addOptions() {
607
607
  return {
@@ -663,7 +663,7 @@ function normalizeImageDimension(value) {
663
663
  function normalizeImagePlacement(value) {
664
664
  return value === "center" || value === "wrap-left" || value === "wrap-right" ? value : "block";
665
665
  }
666
- Image$1.extend({ addAttributes() {
666
+ Image.extend({ addAttributes() {
667
667
  return {
668
668
  ...this.parent?.(),
669
669
  width: {
@@ -2450,7 +2450,7 @@ function setCodeBlockLanguage(editor, pos, value, names) {
2450
2450
  }
2451
2451
  //#endregion
2452
2452
  //#region components/ui-button/ui-button.js
2453
- function connect$9(host) {
2453
+ function connect$10(host) {
2454
2454
  const onClick = (event) => {
2455
2455
  if (!host.props.loading.value && !host.props.pending.value) return;
2456
2456
  event.preventDefault();
@@ -2460,12 +2460,12 @@ function connect$9(host) {
2460
2460
  return () => host.element.removeEventListener("click", onClick, true);
2461
2461
  }
2462
2462
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
2463
- function controller$9(host) {
2464
- host.on("connect", () => connect$9(host));
2463
+ function controller$10(host) {
2464
+ host.on("connect", () => connect$10(host));
2465
2465
  }
2466
2466
  //#endregion
2467
2467
  //#region vanilla/UiButton.js
2468
- var T0$14 = [
2468
+ var T0$15 = [
2469
2469
  "",
2470
2470
  [],
2471
2471
  "\n ",
@@ -2489,8 +2489,8 @@ var T0$14 = [
2489
2489
  ],
2490
2490
  "\n "
2491
2491
  ];
2492
- var T1$14 = ["ui-spinner", ["size", "sm"]];
2493
- var T2$10 = [
2492
+ var T1$15 = ["ui-spinner", ["size", "sm"]];
2493
+ var T2$11 = [
2494
2494
  "",
2495
2495
  [],
2496
2496
  4
@@ -2593,9 +2593,9 @@ var T17$1 = [
2593
2593
  ];
2594
2594
  var T18$1 = ["", []];
2595
2595
  var T19$1 = ["", []];
2596
- var P0$14;
2597
- var P1$14;
2598
- var P2$10;
2596
+ var P0$15;
2597
+ var P1$15;
2598
+ var P2$11;
2599
2599
  var P3$7;
2600
2600
  var P4$6;
2601
2601
  var P5$5;
@@ -2613,7 +2613,7 @@ var P16$1;
2613
2613
  var P17$1;
2614
2614
  var P18$1;
2615
2615
  var P19$1;
2616
- var S$16 = {
2616
+ var S$17 = {
2617
2617
  n: [],
2618
2618
  t: [],
2619
2619
  f: import.meta.url,
@@ -2743,7 +2743,7 @@ var Q$3 = [
2743
2743
  [],
2744
2744
  []
2745
2745
  ];
2746
- var D$16 = {
2746
+ var D$17 = {
2747
2747
  g: "ui-button",
2748
2748
  props: {
2749
2749
  "align": {
@@ -2916,7 +2916,7 @@ var D$16 = {
2916
2916
  }
2917
2917
  }
2918
2918
  };
2919
- var C$9 = (host) => controller$9(host);
2919
+ var C$10 = (host) => controller$10(host);
2920
2920
  function createUiButton(options = {}, html) {
2921
2921
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
2922
2922
  const v = [
@@ -2935,7 +2935,7 @@ function createUiButton(options = {}, html) {
2935
2935
  null,
2936
2936
  null
2937
2937
  ];
2938
- acceptProps(void 0, D$16, S$16.n, v, componentProps, [], html);
2938
+ acceptProps(void 0, D$17, S$17.n, v, componentProps, [], html);
2939
2939
  let a = v[13] === "card" && v[1] === "a" ? 0 : v[13] === "card" ? 1 : v[1] === "a" ? 2 : 3;
2940
2940
  let element;
2941
2941
  if (a === 0) {
@@ -2967,12 +2967,12 @@ function createUiButton(options = {}, html) {
2967
2967
  }
2968
2968
  element.setAttribute("data-component", "ui-button");
2969
2969
  }
2970
- const B = acceptProps(element, D$16, S$16.n, v, componentProps, Q$3[a], html);
2970
+ const B = acceptProps(element, D$17, S$17.n, v, componentProps, Q$3[a], html);
2971
2971
  const m1 = (d) => {
2972
- return { n: (P1$14 ??= buildTemplate(T1$14)).cloneNode(true) };
2972
+ return { n: (P1$15 ??= buildTemplate(T1$15)).cloneNode(true) };
2973
2973
  };
2974
2974
  const m2 = (d) => {
2975
- const n = (P2$10 ??= buildTemplate(T2$10)).cloneNode(true);
2975
+ const n = (P2$11 ??= buildTemplate(T2$11)).cloneNode(true);
2976
2976
  const t0 = n.firstChild;
2977
2977
  const r = {
2978
2978
  n,
@@ -3065,7 +3065,7 @@ function createUiButton(options = {}, html) {
3065
3065
  return { n: (P19$1 ??= buildTemplate(T19$1)).cloneNode(true) };
3066
3066
  };
3067
3067
  const m0 = (n, d) => {
3068
- n.append((P0$14 ??= buildTemplate(T0$14)).cloneNode(true));
3068
+ n.append((P0$15 ??= buildTemplate(T0$15)).cloneNode(true));
3069
3069
  const t0 = n.firstChild.nextSibling;
3070
3070
  const t1 = t0.firstChild;
3071
3071
  const t2 = t1.nextSibling.nextSibling;
@@ -3614,27 +3614,27 @@ function createUiButton(options = {}, html) {
3614
3614
  };
3615
3615
  const I = { B };
3616
3616
  const J = project(I, children, slots);
3617
- attachGeneratedController(element, S$16, v, p, C$9, void 0, I);
3617
+ attachGeneratedController(element, S$17, v, p, C$10, void 0, I);
3618
3618
  manageProps(I);
3619
3619
  return element;
3620
3620
  }
3621
3621
  //#endregion
3622
3622
  //#region vanilla/UiCluster.js
3623
- var T0$13 = [
3623
+ var T0$14 = [
3624
3624
  "",
3625
3625
  [],
3626
3626
  4
3627
3627
  ];
3628
- var T1$13 = ["", []];
3629
- var P0$13;
3630
- var P1$13;
3631
- var S$15 = {
3628
+ var T1$14 = ["", []];
3629
+ var P0$14;
3630
+ var P1$14;
3631
+ var S$16 = {
3632
3632
  n: [],
3633
3633
  t: [],
3634
3634
  f: import.meta.url,
3635
3635
  g: "ui-cluster"
3636
3636
  };
3637
- var D$15 = {
3637
+ var D$16 = {
3638
3638
  g: "ui-cluster",
3639
3639
  props: {
3640
3640
  "align": {
@@ -3757,7 +3757,7 @@ function createUiCluster(options = {}, html) {
3757
3757
  element.setAttribute(name, value === true ? "" : String(value));
3758
3758
  }
3759
3759
  element.setAttribute("data-component", "ui-cluster");
3760
- element.append((P0$13 ??= buildTemplate(T0$13)).cloneNode(true));
3760
+ element.append((P0$14 ??= buildTemplate(T0$14)).cloneNode(true));
3761
3761
  const v = [
3762
3762
  null,
3763
3763
  null,
@@ -3767,9 +3767,9 @@ function createUiCluster(options = {}, html) {
3767
3767
  null,
3768
3768
  null
3769
3769
  ];
3770
- const B = acceptProps(element, D$15, S$15.n, v, componentProps, [], html);
3770
+ const B = acceptProps(element, D$16, S$16.n, v, componentProps, [], html);
3771
3771
  const m1 = (d) => {
3772
- return { n: (P1$13 ??= buildTemplate(T1$13)).cloneNode(true) };
3772
+ return { n: (P1$14 ??= buildTemplate(T1$14)).cloneNode(true) };
3773
3773
  };
3774
3774
  const p0 = (r, c, d) => {
3775
3775
  if (c & 127) {
@@ -3816,7 +3816,7 @@ function createUiCluster(options = {}, html) {
3816
3816
  };
3817
3817
  const I = { B };
3818
3818
  const J = project(I, children, slots);
3819
- attachGeneratedController(element, S$15, v, ((c, d) => p0(R, c, d)), void 0, void 0, I);
3819
+ attachGeneratedController(element, S$16, v, ((c, d) => p0(R, c, d)), void 0, void 0, I);
3820
3820
  manageProps(I);
3821
3821
  return element;
3822
3822
  }
@@ -3857,7 +3857,7 @@ function id(prefix) {
3857
3857
  function descriptionIds(input) {
3858
3858
  return Array.from(new Set((input.getAttribute("aria-describedby") ?? "").split(/\s+/).filter(Boolean)));
3859
3859
  }
3860
- function connect$8(host) {
3860
+ function connect$9(host) {
3861
3861
  const element = host.element;
3862
3862
  let activeInput = null;
3863
3863
  let owned = /* @__PURE__ */ new Set();
@@ -3930,12 +3930,12 @@ function connect$8(host) {
3930
3930
  };
3931
3931
  }
3932
3932
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
3933
- function controller$8(host) {
3934
- host.on("connect", () => connect$8(host));
3933
+ function controller$9(host) {
3934
+ host.on("connect", () => connect$9(host));
3935
3935
  }
3936
3936
  //#endregion
3937
3937
  //#region vanilla/UiFormField.js
3938
- var T0$12 = [
3938
+ var T0$13 = [
3939
3939
  "",
3940
3940
  [],
3941
3941
  "\n ",
@@ -3968,24 +3968,24 @@ var T0$12 = [
3968
3968
  ],
3969
3969
  "\n "
3970
3970
  ];
3971
- var T1$12 = ["", []];
3972
- var T2$9 = ["", []];
3971
+ var T1$13 = ["", []];
3972
+ var T2$10 = ["", []];
3973
3973
  var T3$6 = ["", []];
3974
3974
  var T4$5 = ["", []];
3975
3975
  var T5$4 = ["", []];
3976
- var P0$12;
3977
- var P1$12;
3978
- var P2$9;
3976
+ var P0$13;
3977
+ var P1$13;
3978
+ var P2$10;
3979
3979
  var P3$6;
3980
3980
  var P4$5;
3981
3981
  var P5$4;
3982
- var S$14 = {
3982
+ var S$15 = {
3983
3983
  n: [],
3984
3984
  t: [],
3985
3985
  f: import.meta.url,
3986
3986
  g: "ui-form-field"
3987
3987
  };
3988
- var D$14 = {
3988
+ var D$15 = {
3989
3989
  g: "ui-form-field",
3990
3990
  props: {
3991
3991
  "disabled": {
@@ -4014,7 +4014,7 @@ var D$14 = {
4014
4014
  }
4015
4015
  }
4016
4016
  };
4017
- var C$8 = (host) => controller$8(host);
4017
+ var C$9 = (host) => controller$9(host);
4018
4018
  function createUiFormField(options = {}, html) {
4019
4019
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
4020
4020
  const element = document.createElement("div");
@@ -4023,18 +4023,18 @@ function createUiFormField(options = {}, html) {
4023
4023
  element.setAttribute(name, value === true ? "" : String(value));
4024
4024
  }
4025
4025
  element.setAttribute("data-component", "ui-form-field");
4026
- element.append((P0$12 ??= buildTemplate(T0$12)).cloneNode(true));
4026
+ element.append((P0$13 ??= buildTemplate(T0$13)).cloneNode(true));
4027
4027
  const v = [
4028
4028
  null,
4029
4029
  null,
4030
4030
  null
4031
4031
  ];
4032
- const B = acceptProps(element, D$14, S$14.n, v, componentProps, [], html);
4032
+ const B = acceptProps(element, D$15, S$15.n, v, componentProps, [], html);
4033
4033
  const m1 = (d) => {
4034
- return { n: (P1$12 ??= buildTemplate(T1$12)).cloneNode(true) };
4034
+ return { n: (P1$13 ??= buildTemplate(T1$13)).cloneNode(true) };
4035
4035
  };
4036
4036
  const m2 = (d) => {
4037
- return { n: (P2$9 ??= buildTemplate(T2$9)).cloneNode(true) };
4037
+ return { n: (P2$10 ??= buildTemplate(T2$10)).cloneNode(true) };
4038
4038
  };
4039
4039
  const m3 = (d) => {
4040
4040
  return { n: (P3$6 ??= buildTemplate(T3$6)).cloneNode(true) };
@@ -4144,13 +4144,13 @@ function createUiFormField(options = {}, html) {
4144
4144
  };
4145
4145
  const I = { B };
4146
4146
  const J = project(I, children, slots);
4147
- attachGeneratedController(element, S$14, v, ((c, d) => p0(R, c, d)), C$8, void 0, I);
4147
+ attachGeneratedController(element, S$15, v, ((c, d) => p0(R, c, d)), C$9, void 0, I);
4148
4148
  manageProps(I);
4149
4149
  return element;
4150
4150
  }
4151
4151
  //#endregion
4152
4152
  //#region vanilla/UiIcon.js
4153
- var T0$11 = [
4153
+ var T0$12 = [
4154
4154
  "",
4155
4155
  [],
4156
4156
  "\n ",
@@ -4176,7 +4176,7 @@ var T0$11 = [
4176
4176
  ],
4177
4177
  "\n "
4178
4178
  ];
4179
- var T1$11 = [
4179
+ var T1$12 = [
4180
4180
  "g",
4181
4181
  [],
4182
4182
  1,
@@ -4184,7 +4184,7 @@ var T1$11 = [
4184
4184
  1,
4185
4185
  1
4186
4186
  ];
4187
- var T2$8 = ["path", []];
4187
+ var T2$9 = ["path", []];
4188
4188
  var T3$5 = ["circle", []];
4189
4189
  var T4$4 = [
4190
4190
  "rect",
@@ -4192,14 +4192,14 @@ var T4$4 = [
4192
4192
  "\n "
4193
4193
  ];
4194
4194
  var T5$3 = ["line", []];
4195
- var P0$11;
4196
- var P1$11;
4197
- var P2$8;
4195
+ var P0$12;
4196
+ var P1$12;
4197
+ var P2$9;
4198
4198
  var P3$5;
4199
4199
  var P4$4;
4200
4200
  var P5$3;
4201
4201
  var E = /* @__PURE__ */ new Map();
4202
- var S$13 = {
4202
+ var S$14 = {
4203
4203
  n: ["shapes"],
4204
4204
  t: ["?"],
4205
4205
  f: import.meta.url,
@@ -4207,7 +4207,7 @@ var S$13 = {
4207
4207
  k: 0,
4208
4208
  r: readonlyView
4209
4209
  };
4210
- var D$13 = {
4210
+ var D$14 = {
4211
4211
  g: "ui-icon",
4212
4212
  props: { "name": {
4213
4213
  "required": false,
@@ -4227,9 +4227,9 @@ function createUiIcon(options = {}, html) {
4227
4227
  }
4228
4228
  if (!element.hasAttribute("aria-hidden")) element.setAttribute("aria-hidden", "true");
4229
4229
  element.setAttribute("data-component", "ui-icon");
4230
- element.append((P0$11 ??= buildTemplate(T0$11)).cloneNode(true));
4230
+ element.append((P0$12 ??= buildTemplate(T0$12)).cloneNode(true));
4231
4231
  const v = [void 0, null];
4232
- const B = acceptProps(element, D$13, S$13.n, v, componentProps, [], html);
4232
+ const B = acceptProps(element, D$14, S$14.n, v, componentProps, [], html);
4233
4233
  const X = {
4234
4234
  e: 0,
4235
4235
  g: (j) => g(j),
@@ -5350,7 +5350,7 @@ function createUiIcon(options = {}, html) {
5350
5350
  return next;
5351
5351
  };
5352
5352
  const m1 = (o, j, l) => {
5353
- const n = (P1$11 ??= buildTemplate(T1$11, document, 1)).cloneNode(true);
5353
+ const n = (P1$12 ??= buildTemplate(T1$12, document, 1)).cloneNode(true);
5354
5354
  const t0 = n.firstChild;
5355
5355
  const t1 = t0.nextSibling.nextSibling;
5356
5356
  const t2 = t1.nextSibling.nextSibling;
@@ -5418,7 +5418,7 @@ function createUiIcon(options = {}, html) {
5418
5418
  };
5419
5419
  const m2 = (d, o, u) => {
5420
5420
  const r = {
5421
- n: (P2$8 ??= buildTemplate(T2$8, document, 1)).cloneNode(true),
5421
+ n: (P2$9 ??= buildTemplate(T2$9, document, 1)).cloneNode(true),
5422
5422
  u,
5423
5423
  w: 0,
5424
5424
  v0: null
@@ -5534,13 +5534,13 @@ function createUiIcon(options = {}, html) {
5534
5534
  const t0 = element.firstChild.nextSibling.firstChild;
5535
5535
  const R = { L0: new IndexedList(t0, t0.nextSibling, m1, p1, void 0, "shape") };
5536
5536
  const I = { B };
5537
- attachGeneratedController(element, S$13, v, ((c, d) => p0(R, c, d)), void 0, X, I);
5537
+ attachGeneratedController(element, S$14, v, ((c, d) => p0(R, c, d)), void 0, X, I);
5538
5538
  manageProps(I);
5539
5539
  return element;
5540
5540
  }
5541
5541
  //#endregion
5542
5542
  //#region components/ui-icon-button/ui-icon-button.js
5543
- function connect$7(host) {
5543
+ function connect$8(host) {
5544
5544
  const stop = host.effect(() => {
5545
5545
  if (host.props.anticipatory.value) host.element.setAttribute("data-ui-affordance", "button");
5546
5546
  else host.element.removeAttribute("data-ui-affordance");
@@ -5557,12 +5557,12 @@ function connect$7(host) {
5557
5557
  };
5558
5558
  }
5559
5559
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
5560
- function controller$7(host) {
5561
- host.on("connect", () => connect$7(host));
5560
+ function controller$8(host) {
5561
+ host.on("connect", () => connect$8(host));
5562
5562
  }
5563
5563
  //#endregion
5564
5564
  //#region vanilla/UiIconButton.js
5565
- var T0$10 = [
5565
+ var T0$11 = [
5566
5566
  "",
5567
5567
  [],
5568
5568
  "\n ",
@@ -5575,18 +5575,18 @@ var T0$10 = [
5575
5575
  ],
5576
5576
  "\n "
5577
5577
  ];
5578
- var T1$10 = ["ui-spinner", ["size", "sm"]];
5579
- var T2$7 = ["", []];
5580
- var P0$10;
5581
- var P1$10;
5582
- var P2$7;
5583
- var S$12 = {
5578
+ var T1$11 = ["ui-spinner", ["size", "sm"]];
5579
+ var T2$8 = ["", []];
5580
+ var P0$11;
5581
+ var P1$11;
5582
+ var P2$8;
5583
+ var S$13 = {
5584
5584
  n: [],
5585
5585
  t: [],
5586
5586
  f: import.meta.url,
5587
5587
  g: "ui-icon-button"
5588
5588
  };
5589
- var D$12 = {
5589
+ var D$13 = {
5590
5590
  g: "ui-icon-button",
5591
5591
  props: {
5592
5592
  "anticipatory": {
@@ -5705,7 +5705,7 @@ var D$12 = {
5705
5705
  }
5706
5706
  }
5707
5707
  };
5708
- var C$7 = (host) => controller$7(host);
5708
+ var C$8 = (host) => controller$8(host);
5709
5709
  function createUiIconButton(options = {}, html) {
5710
5710
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
5711
5711
  const element = document.createElement("button");
@@ -5715,7 +5715,7 @@ function createUiIconButton(options = {}, html) {
5715
5715
  }
5716
5716
  if (!element.hasAttribute("type")) element.setAttribute("type", "button");
5717
5717
  element.setAttribute("data-component", "ui-icon-button");
5718
- element.append((P0$10 ??= buildTemplate(T0$10)).cloneNode(true));
5718
+ element.append((P0$11 ??= buildTemplate(T0$11)).cloneNode(true));
5719
5719
  const v = [
5720
5720
  null,
5721
5721
  null,
@@ -5729,12 +5729,12 @@ function createUiIconButton(options = {}, html) {
5729
5729
  null,
5730
5730
  null
5731
5731
  ];
5732
- const B = acceptProps(element, D$12, S$12.n, v, componentProps, [], html);
5732
+ const B = acceptProps(element, D$13, S$13.n, v, componentProps, [], html);
5733
5733
  const m1 = (d) => {
5734
- return { n: (P1$10 ??= buildTemplate(T1$10)).cloneNode(true) };
5734
+ return { n: (P1$11 ??= buildTemplate(T1$11)).cloneNode(true) };
5735
5735
  };
5736
5736
  const m2 = (d) => {
5737
- return { n: (P2$7 ??= buildTemplate(T2$7)).cloneNode(true) };
5737
+ return { n: (P2$8 ??= buildTemplate(T2$8)).cloneNode(true) };
5738
5738
  };
5739
5739
  const p0 = (r, c, d) => {
5740
5740
  if (c & 2) {
@@ -5833,29 +5833,29 @@ function createUiIconButton(options = {}, html) {
5833
5833
  };
5834
5834
  const I = { B };
5835
5835
  const J = project(I, children, slots);
5836
- attachGeneratedController(element, S$12, v, ((c, d) => p0(R, c, d)), C$7, void 0, I);
5836
+ attachGeneratedController(element, S$13, v, ((c, d) => p0(R, c, d)), C$8, void 0, I);
5837
5837
  manageProps(I);
5838
5838
  return element;
5839
5839
  }
5840
5840
  //#endregion
5841
5841
  //#region vanilla/UiList.js
5842
- var T0$9 = [
5842
+ var T0$10 = [
5843
5843
  "",
5844
5844
  [],
5845
5845
  4
5846
5846
  ];
5847
- var T1$9 = ["", []];
5848
- var T2$6 = [
5847
+ var T1$10 = ["", []];
5848
+ var T2$7 = [
5849
5849
  "",
5850
5850
  [],
5851
5851
  4
5852
5852
  ];
5853
5853
  var T3$4 = ["", []];
5854
- var P0$9;
5855
- var P1$9;
5856
- var P2$6;
5854
+ var P0$10;
5855
+ var P1$10;
5856
+ var P2$7;
5857
5857
  var P3$4;
5858
- var S$11 = {
5858
+ var S$12 = {
5859
5859
  n: [],
5860
5860
  t: [],
5861
5861
  f: import.meta.url,
@@ -5889,7 +5889,7 @@ var A$2 = [[
5889
5889
  ]
5890
5890
  ]];
5891
5891
  var Q$2 = [[], []];
5892
- var D$11 = {
5892
+ var D$12 = {
5893
5893
  g: "ui-list",
5894
5894
  props: {
5895
5895
  "as": {
@@ -5954,7 +5954,7 @@ function createUiList(options = {}, html) {
5954
5954
  null,
5955
5955
  null
5956
5956
  ];
5957
- acceptProps(void 0, D$11, S$11.n, v, componentProps, [], html);
5957
+ acceptProps(void 0, D$12, S$12.n, v, componentProps, [], html);
5958
5958
  let a = v[0] === "ol" ? 0 : 1;
5959
5959
  let element;
5960
5960
  if (a === 0) {
@@ -5973,15 +5973,15 @@ function createUiList(options = {}, html) {
5973
5973
  if (!element.hasAttribute("role")) element.setAttribute("role", "list");
5974
5974
  element.setAttribute("data-component", "ui-list");
5975
5975
  }
5976
- const B = acceptProps(element, D$11, S$11.n, v, componentProps, Q$2[a], html);
5976
+ const B = acceptProps(element, D$12, S$12.n, v, componentProps, Q$2[a], html);
5977
5977
  const m1 = (d) => {
5978
- return { n: (P1$9 ??= buildTemplate(T1$9)).cloneNode(true) };
5978
+ return { n: (P1$10 ??= buildTemplate(T1$10)).cloneNode(true) };
5979
5979
  };
5980
5980
  const m3 = (d) => {
5981
5981
  return { n: (P3$4 ??= buildTemplate(T3$4)).cloneNode(true) };
5982
5982
  };
5983
5983
  const m0 = (n, d) => {
5984
- n.append((P0$9 ??= buildTemplate(T0$9)).cloneNode(true));
5984
+ n.append((P0$10 ??= buildTemplate(T0$10)).cloneNode(true));
5985
5985
  const t0 = n.firstChild;
5986
5986
  const r = {
5987
5987
  n,
@@ -6023,7 +6023,7 @@ function createUiList(options = {}, html) {
6023
6023
  } else if (r.b0 !== void 0) r.b0;
6024
6024
  };
6025
6025
  const m2 = (n, d) => {
6026
- n.append((P2$6 ??= buildTemplate(T2$6)).cloneNode(true));
6026
+ n.append((P2$7 ??= buildTemplate(T2$7)).cloneNode(true));
6027
6027
  const t0 = n.firstChild;
6028
6028
  const r = {
6029
6029
  n,
@@ -6090,7 +6090,7 @@ function createUiList(options = {}, html) {
6090
6090
  };
6091
6091
  const I = { B };
6092
6092
  const J = project(I, children, slots);
6093
- attachGeneratedController(element, S$11, v, p, void 0, void 0, I);
6093
+ attachGeneratedController(element, S$12, v, p, void 0, void 0, I);
6094
6094
  manageProps(I);
6095
6095
  return element;
6096
6096
  }
@@ -6767,7 +6767,7 @@ function triggerFor(event) {
6767
6767
  function disabled(item) {
6768
6768
  return item.getAttribute("aria-disabled") === "true" || item.hasAttribute("disabled") || item.getAttribute("disabled") === "true";
6769
6769
  }
6770
- function connect$6(host) {
6770
+ function connect$7(host) {
6771
6771
  const element = host.element;
6772
6772
  const document = element.ownerDocument;
6773
6773
  const overlayId = `ui-menu-${Math.random().toString(36).slice(2, 11)}`;
@@ -6927,12 +6927,12 @@ function connect$6(host) {
6927
6927
  };
6928
6928
  }
6929
6929
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
6930
- function controller$6(host) {
6931
- host.on("connect", () => connect$6(host));
6930
+ function controller$7(host) {
6931
+ host.on("connect", () => connect$7(host));
6932
6932
  }
6933
6933
  //#endregion
6934
6934
  //#region vanilla/UiMenu.js
6935
- var T0$8 = [
6935
+ var T0$9 = [
6936
6936
  "",
6937
6937
  [],
6938
6938
  [
@@ -6941,10 +6941,10 @@ var T0$8 = [
6941
6941
  4
6942
6942
  ]
6943
6943
  ];
6944
- var T1$8 = ["", []];
6945
- var P0$8;
6946
- var P1$8;
6947
- var S$10 = {
6944
+ var T1$9 = ["", []];
6945
+ var P0$9;
6946
+ var P1$9;
6947
+ var S$11 = {
6948
6948
  n: ["internalOpen"],
6949
6949
  t: ["b"],
6950
6950
  f: import.meta.url,
@@ -7036,7 +7036,7 @@ var S$10 = {
7036
7036
  },
7037
7037
  x: dispatchDeclared
7038
7038
  };
7039
- var D$10 = {
7039
+ var D$11 = {
7040
7040
  g: "ui-menu",
7041
7041
  props: {
7042
7042
  "density": {
@@ -7107,7 +7107,7 @@ var D$10 = {
7107
7107
  }
7108
7108
  }
7109
7109
  };
7110
- var C$6 = (host) => controller$6(host);
7110
+ var C$7 = (host) => controller$7(host);
7111
7111
  function createUiMenu(options = {}, html) {
7112
7112
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
7113
7113
  const element = document.createElement("div");
@@ -7118,7 +7118,7 @@ function createUiMenu(options = {}, html) {
7118
7118
  if (!element.hasAttribute("role")) element.setAttribute("role", "menu");
7119
7119
  if (!element.hasAttribute("aria-orientation")) element.setAttribute("aria-orientation", "vertical");
7120
7120
  element.setAttribute("data-component", "ui-menu");
7121
- element.append((P0$8 ??= buildTemplate(T0$8)).cloneNode(true));
7121
+ element.append((P0$9 ??= buildTemplate(T0$9)).cloneNode(true));
7122
7122
  const v = [
7123
7123
  false,
7124
7124
  null,
@@ -7129,9 +7129,9 @@ function createUiMenu(options = {}, html) {
7129
7129
  null,
7130
7130
  null
7131
7131
  ];
7132
- const B = acceptProps(element, D$10, S$10.n, v, componentProps, [], html);
7132
+ const B = acceptProps(element, D$11, S$11.n, v, componentProps, [], html);
7133
7133
  const m1 = (d) => {
7134
- return { n: (P1$8 ??= buildTemplate(T1$8)).cloneNode(true) };
7134
+ return { n: (P1$9 ??= buildTemplate(T1$9)).cloneNode(true) };
7135
7135
  };
7136
7136
  const p0 = (r, c, d) => {
7137
7137
  if (c & 155) {
@@ -7175,10 +7175,10 @@ function createUiMenu(options = {}, html) {
7175
7175
  const I = { B };
7176
7176
  const J = project(I, children, slots);
7177
7177
  I.R = /* @__PURE__ */ new Set();
7178
- attachGeneratedController(element, S$10, v, (c, d) => {
7178
+ attachGeneratedController(element, S$11, v, (c, d) => {
7179
7179
  ((c, d) => p0(R, c, d))(c, d);
7180
7180
  for (const f of I.R) f(c, d);
7181
- }, C$6, void 0, I);
7181
+ }, C$7, void 0, I);
7182
7182
  manageProps(I);
7183
7183
  return element;
7184
7184
  }
@@ -7187,7 +7187,7 @@ function createUiMenu(options = {}, html) {
7187
7187
  function radioScope(item) {
7188
7188
  return item.closest("[role=\"group\"]") ?? item.closest("[role=\"menu\"]");
7189
7189
  }
7190
- function connect$5(host) {
7190
+ function connect$6(host) {
7191
7191
  const item = host.element;
7192
7192
  let external = Boolean(host.props.checked.value);
7193
7193
  host.state.internalChecked = external;
@@ -7238,12 +7238,12 @@ function connect$5(host) {
7238
7238
  };
7239
7239
  }
7240
7240
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
7241
- function controller$5(host) {
7242
- host.on("connect", () => connect$5(host));
7241
+ function controller$6(host) {
7242
+ host.on("connect", () => connect$6(host));
7243
7243
  }
7244
7244
  //#endregion
7245
7245
  //#region vanilla/UiMenuItem.js
7246
- var T0$7 = [
7246
+ var T0$8 = [
7247
7247
  "",
7248
7248
  [],
7249
7249
  "\n ",
@@ -7276,8 +7276,8 @@ var T0$7 = [
7276
7276
  ],
7277
7277
  "\n "
7278
7278
  ];
7279
- var T1$7 = ["", []];
7280
- var T2$5 = ["", []];
7279
+ var T1$8 = ["", []];
7280
+ var T2$6 = ["", []];
7281
7281
  var T3$3 = ["", []];
7282
7282
  var T4$3 = [
7283
7283
  "",
@@ -7329,16 +7329,16 @@ var T5$2 = ["ui-icon", ["name", "check"]];
7329
7329
  var T6$2 = ["", []];
7330
7330
  var T7$2 = ["", []];
7331
7331
  var T8$2 = ["", []];
7332
- var P0$7;
7333
- var P1$7;
7334
- var P2$5;
7332
+ var P0$8;
7333
+ var P1$8;
7334
+ var P2$6;
7335
7335
  var P3$3;
7336
7336
  var P4$3;
7337
7337
  var P5$2;
7338
7338
  var P6$2;
7339
7339
  var P7$2;
7340
7340
  var P8$2;
7341
- var S$9 = {
7341
+ var S$10 = {
7342
7342
  n: ["internalChecked"],
7343
7343
  t: ["b"],
7344
7344
  f: import.meta.url,
@@ -7418,7 +7418,7 @@ var A$1 = [[
7418
7418
  ]
7419
7419
  ]];
7420
7420
  var Q$1 = [[], []];
7421
- var D$9 = {
7421
+ var D$10 = {
7422
7422
  g: "ui-menu-item",
7423
7423
  props: {
7424
7424
  "checked": {
@@ -7485,7 +7485,7 @@ var D$9 = {
7485
7485
  }
7486
7486
  }
7487
7487
  };
7488
- var C$5 = (host) => controller$5(host);
7488
+ var C$6 = (host) => controller$6(host);
7489
7489
  function createUiMenuItem(options = {}, html) {
7490
7490
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
7491
7491
  const v = [
@@ -7497,7 +7497,7 @@ function createUiMenuItem(options = {}, html) {
7497
7497
  null,
7498
7498
  null
7499
7499
  ];
7500
- acceptProps(void 0, D$9, S$9.n, v, componentProps, [], html);
7500
+ acceptProps(void 0, D$10, S$10.n, v, componentProps, [], html);
7501
7501
  let a = truthy(v[3]) && v[5] === "action" ? 0 : 1;
7502
7502
  let element;
7503
7503
  if (a === 0) {
@@ -7518,12 +7518,12 @@ function createUiMenuItem(options = {}, html) {
7518
7518
  if (!element.hasAttribute("tabindex")) element.setAttribute("tabindex", "-1");
7519
7519
  element.setAttribute("data-component", "ui-menu-item");
7520
7520
  }
7521
- const B = acceptProps(element, D$9, S$9.n, v, componentProps, Q$1[a], html);
7521
+ const B = acceptProps(element, D$10, S$10.n, v, componentProps, Q$1[a], html);
7522
7522
  const m1 = (d) => {
7523
- return { n: (P1$7 ??= buildTemplate(T1$7)).cloneNode(true) };
7523
+ return { n: (P1$8 ??= buildTemplate(T1$8)).cloneNode(true) };
7524
7524
  };
7525
7525
  const m2 = (d) => {
7526
- return { n: (P2$5 ??= buildTemplate(T2$5)).cloneNode(true) };
7526
+ return { n: (P2$6 ??= buildTemplate(T2$6)).cloneNode(true) };
7527
7527
  };
7528
7528
  const m3 = (d) => {
7529
7529
  return { n: (P3$3 ??= buildTemplate(T3$3)).cloneNode(true) };
@@ -7541,7 +7541,7 @@ function createUiMenuItem(options = {}, html) {
7541
7541
  return { n: (P8$2 ??= buildTemplate(T8$2)).cloneNode(true) };
7542
7542
  };
7543
7543
  const m0 = (n, d) => {
7544
- n.append((P0$7 ??= buildTemplate(T0$7)).cloneNode(true));
7544
+ n.append((P0$8 ??= buildTemplate(T0$8)).cloneNode(true));
7545
7545
  const t0 = n.firstChild.nextSibling;
7546
7546
  const t1 = t0.firstChild;
7547
7547
  const t2 = t0.nextSibling.nextSibling;
@@ -7772,16 +7772,16 @@ function createUiMenuItem(options = {}, html) {
7772
7772
  const I = { B };
7773
7773
  const J = project(I, children, slots);
7774
7774
  I.R = /* @__PURE__ */ new Set();
7775
- attachGeneratedController(element, S$9, v, (c, d) => {
7775
+ attachGeneratedController(element, S$10, v, (c, d) => {
7776
7776
  p(c, d);
7777
7777
  for (const f of I.R) f(c, d);
7778
- }, C$5, void 0, I);
7778
+ }, C$6, void 0, I);
7779
7779
  manageProps(I);
7780
7780
  return element;
7781
7781
  }
7782
7782
  //#endregion
7783
7783
  //#region components/ui-popover/ui-popover.js
7784
- function connect$4(host) {
7784
+ function connect$5(host) {
7785
7785
  const element = host.element;
7786
7786
  const document = element.ownerDocument;
7787
7787
  const offset = () => {
@@ -7899,12 +7899,12 @@ function connect$4(host) {
7899
7899
  };
7900
7900
  }
7901
7901
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
7902
- function controller$4(host) {
7903
- host.on("connect", () => connect$4(host));
7902
+ function controller$5(host) {
7903
+ host.on("connect", () => connect$5(host));
7904
7904
  }
7905
7905
  //#endregion
7906
7906
  //#region vanilla/UiPopover.js
7907
- var T0$6 = [
7907
+ var T0$7 = [
7908
7908
  "",
7909
7909
  [],
7910
7910
  [
@@ -7913,10 +7913,10 @@ var T0$6 = [
7913
7913
  4
7914
7914
  ]
7915
7915
  ];
7916
- var T1$6 = ["", []];
7917
- var P0$6;
7918
- var P1$6;
7919
- var S$8 = {
7916
+ var T1$7 = ["", []];
7917
+ var P0$7;
7918
+ var P1$7;
7919
+ var S$9 = {
7920
7920
  n: ["internalOpen"],
7921
7921
  t: ["b"],
7922
7922
  f: import.meta.url,
@@ -7987,7 +7987,7 @@ var S$8 = {
7987
7987
  },
7988
7988
  x: dispatchDeclared
7989
7989
  };
7990
- var D$8 = {
7990
+ var D$9 = {
7991
7991
  g: "ui-popover",
7992
7992
  props: {
7993
7993
  "for": {
@@ -8052,7 +8052,7 @@ var D$8 = {
8052
8052
  }
8053
8053
  }
8054
8054
  };
8055
- var C$4 = (host) => controller$4(host);
8055
+ var C$5 = (host) => controller$5(host);
8056
8056
  function createUiPopover(options = {}, html) {
8057
8057
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
8058
8058
  const element = document.createElement("span");
@@ -8061,7 +8061,7 @@ function createUiPopover(options = {}, html) {
8061
8061
  element.setAttribute(name, value === true ? "" : String(value));
8062
8062
  }
8063
8063
  element.setAttribute("data-component", "ui-popover");
8064
- element.append((P0$6 ??= buildTemplate(T0$6)).cloneNode(true));
8064
+ element.append((P0$7 ??= buildTemplate(T0$7)).cloneNode(true));
8065
8065
  const v = [
8066
8066
  false,
8067
8067
  null,
@@ -8069,9 +8069,9 @@ function createUiPopover(options = {}, html) {
8069
8069
  null,
8070
8070
  null
8071
8071
  ];
8072
- const B = acceptProps(element, D$8, S$8.n, v, componentProps, [], html);
8072
+ const B = acceptProps(element, D$9, S$9.n, v, componentProps, [], html);
8073
8073
  const m1 = (d) => {
8074
- return { n: (P1$6 ??= buildTemplate(T1$6)).cloneNode(true) };
8074
+ return { n: (P1$7 ??= buildTemplate(T1$7)).cloneNode(true) };
8075
8075
  };
8076
8076
  const p0 = (r, c, d) => {
8077
8077
  if (c & 17) {
@@ -8103,30 +8103,30 @@ function createUiPopover(options = {}, html) {
8103
8103
  const I = { B };
8104
8104
  const J = project(I, children, slots);
8105
8105
  I.R = /* @__PURE__ */ new Set();
8106
- attachGeneratedController(element, S$8, v, (c, d) => {
8106
+ attachGeneratedController(element, S$9, v, (c, d) => {
8107
8107
  ((c, d) => p0(R, c, d))(c, d);
8108
8108
  for (const f of I.R) f(c, d);
8109
- }, C$4, void 0, I);
8109
+ }, C$5, void 0, I);
8110
8110
  manageProps(I);
8111
8111
  return element;
8112
8112
  }
8113
8113
  //#endregion
8114
8114
  //#region vanilla/UiStack.js
8115
- var T0$5 = [
8115
+ var T0$6 = [
8116
8116
  "",
8117
8117
  [],
8118
8118
  4
8119
8119
  ];
8120
- var T1$5 = ["", []];
8121
- var P0$5;
8122
- var P1$5;
8123
- var S$7 = {
8120
+ var T1$6 = ["", []];
8121
+ var P0$6;
8122
+ var P1$6;
8123
+ var S$8 = {
8124
8124
  n: [],
8125
8125
  t: [],
8126
8126
  f: import.meta.url,
8127
8127
  g: "ui-stack"
8128
8128
  };
8129
- var D$7 = {
8129
+ var D$8 = {
8130
8130
  g: "ui-stack",
8131
8131
  props: {
8132
8132
  "align": {
@@ -8207,7 +8207,7 @@ function createUiStack(options = {}, html) {
8207
8207
  element.setAttribute(name, value === true ? "" : String(value));
8208
8208
  }
8209
8209
  element.setAttribute("data-component", "ui-stack");
8210
- element.append((P0$5 ??= buildTemplate(T0$5)).cloneNode(true));
8210
+ element.append((P0$6 ??= buildTemplate(T0$6)).cloneNode(true));
8211
8211
  const v = [
8212
8212
  null,
8213
8213
  null,
@@ -8215,9 +8215,9 @@ function createUiStack(options = {}, html) {
8215
8215
  null,
8216
8216
  null
8217
8217
  ];
8218
- const B = acceptProps(element, D$7, S$7.n, v, componentProps, [], html);
8218
+ const B = acceptProps(element, D$8, S$8.n, v, componentProps, [], html);
8219
8219
  const m1 = (d) => {
8220
- return { n: (P1$5 ??= buildTemplate(T1$5)).cloneNode(true) };
8220
+ return { n: (P1$6 ??= buildTemplate(T1$6)).cloneNode(true) };
8221
8221
  };
8222
8222
  const p0 = (r, c, d) => {
8223
8223
  if (c & 8) {
@@ -8266,19 +8266,19 @@ function createUiStack(options = {}, html) {
8266
8266
  };
8267
8267
  const I = { B };
8268
8268
  const J = project(I, children, slots);
8269
- attachGeneratedController(element, S$7, v, ((c, d) => p0(R, c, d)), void 0, void 0, I);
8269
+ attachGeneratedController(element, S$8, v, ((c, d) => p0(R, c, d)), void 0, void 0, I);
8270
8270
  manageProps(I);
8271
8271
  return element;
8272
8272
  }
8273
8273
  //#endregion
8274
8274
  //#region vanilla/UiText.js
8275
- var T0$4 = [
8275
+ var T0$5 = [
8276
8276
  "",
8277
8277
  [],
8278
8278
  4
8279
8279
  ];
8280
- var T1$4 = ["", []];
8281
- var T2$4 = [
8280
+ var T1$5 = ["", []];
8281
+ var T2$5 = [
8282
8282
  "",
8283
8283
  [],
8284
8284
  4
@@ -8338,9 +8338,9 @@ var T20 = [
8338
8338
  4
8339
8339
  ];
8340
8340
  var T21 = ["", []];
8341
- var P0$4;
8342
- var P1$4;
8343
- var P2$4;
8341
+ var P0$5;
8342
+ var P1$5;
8343
+ var P2$5;
8344
8344
  var P3$2;
8345
8345
  var P4$2;
8346
8346
  var P5$1;
@@ -8360,7 +8360,7 @@ var P18;
8360
8360
  var P19;
8361
8361
  var P20;
8362
8362
  var P21;
8363
- var S$6 = {
8363
+ var S$7 = {
8364
8364
  n: [],
8365
8365
  t: [],
8366
8366
  f: import.meta.url,
@@ -8612,7 +8612,7 @@ var Q = [
8612
8612
  [],
8613
8613
  []
8614
8614
  ];
8615
- var D$6 = {
8615
+ var D$7 = {
8616
8616
  g: "ui-text",
8617
8617
  props: {
8618
8618
  "align": {
@@ -8796,7 +8796,7 @@ function createUiText(options = {}, html) {
8796
8796
  null,
8797
8797
  null
8798
8798
  ];
8799
- acceptProps(void 0, D$6, S$6.n, v, componentProps, [], html);
8799
+ acceptProps(void 0, D$7, S$7.n, v, componentProps, [], html);
8800
8800
  let a = v[1] === "span" ? 0 : v[1] === "div" ? 1 : v[1] === "small" ? 2 : v[1] === "strong" ? 3 : v[1] === "label" ? 4 : v[1] === "h2" ? 5 : v[1] === "h3" ? 6 : v[1] === "h4" ? 7 : v[1] === "h5" ? 8 : v[1] === "h6" ? 9 : 10;
8801
8801
  let element;
8802
8802
  if (a === 0) {
@@ -8877,9 +8877,9 @@ function createUiText(options = {}, html) {
8877
8877
  }
8878
8878
  element.setAttribute("data-component", "ui-text");
8879
8879
  }
8880
- const B = acceptProps(element, D$6, S$6.n, v, componentProps, Q[a], html);
8880
+ const B = acceptProps(element, D$7, S$7.n, v, componentProps, Q[a], html);
8881
8881
  const m1 = (d) => {
8882
- return { n: (P1$4 ??= buildTemplate(T1$4)).cloneNode(true) };
8882
+ return { n: (P1$5 ??= buildTemplate(T1$5)).cloneNode(true) };
8883
8883
  };
8884
8884
  const m3 = (d) => {
8885
8885
  return { n: (P3$2 ??= buildTemplate(T3$2)).cloneNode(true) };
@@ -8912,7 +8912,7 @@ function createUiText(options = {}, html) {
8912
8912
  return { n: (P21 ??= buildTemplate(T21)).cloneNode(true) };
8913
8913
  };
8914
8914
  const m0 = (n, d) => {
8915
- n.append((P0$4 ??= buildTemplate(T0$4)).cloneNode(true));
8915
+ n.append((P0$5 ??= buildTemplate(T0$5)).cloneNode(true));
8916
8916
  const t0 = n.firstChild;
8917
8917
  const r = {
8918
8918
  n,
@@ -8966,7 +8966,7 @@ function createUiText(options = {}, html) {
8966
8966
  } else if (r.b0 !== void 0) r.b0;
8967
8967
  };
8968
8968
  const m2 = (n, d) => {
8969
- n.append((P2$4 ??= buildTemplate(T2$4)).cloneNode(true));
8969
+ n.append((P2$5 ??= buildTemplate(T2$5)).cloneNode(true));
8970
8970
  const t0 = n.firstChild;
8971
8971
  const r = {
8972
8972
  n,
@@ -9555,14 +9555,14 @@ function createUiText(options = {}, html) {
9555
9555
  };
9556
9556
  const I = { B };
9557
9557
  const J = project(I, children, slots);
9558
- attachGeneratedController(element, S$6, v, p, void 0, void 0, I);
9558
+ attachGeneratedController(element, S$7, v, p, void 0, void 0, I);
9559
9559
  manageProps(I);
9560
9560
  return element;
9561
9561
  }
9562
9562
  //#endregion
9563
9563
  //#region components/ui-tooltip/ui-tooltip.js
9564
9564
  var warmTooltips = /* @__PURE__ */ new WeakMap();
9565
- function connect$3(host) {
9565
+ function connect$4(host) {
9566
9566
  const element = host.element;
9567
9567
  const document = element.ownerDocument;
9568
9568
  const warm = warmTooltips.get(document) ?? {
@@ -9797,12 +9797,12 @@ function connect$3(host) {
9797
9797
  };
9798
9798
  }
9799
9799
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
9800
- function controller$3(host) {
9801
- host.on("connect", () => connect$3(host));
9800
+ function controller$4(host) {
9801
+ host.on("connect", () => connect$4(host));
9802
9802
  }
9803
9803
  //#endregion
9804
9804
  //#region vanilla/UiTooltip.js
9805
- var T0$3 = [
9805
+ var T0$4 = [
9806
9806
  "",
9807
9807
  [],
9808
9808
  [
@@ -9823,12 +9823,12 @@ var T0$3 = [
9823
9823
  "\n "
9824
9824
  ]
9825
9825
  ];
9826
- var T1$3 = ["", []];
9827
- var T2$3 = ["", []];
9828
- var P0$3;
9829
- var P1$3;
9830
- var P2$3;
9831
- var S$5 = {
9826
+ var T1$4 = ["", []];
9827
+ var T2$4 = ["", []];
9828
+ var P0$4;
9829
+ var P1$4;
9830
+ var P2$4;
9831
+ var S$6 = {
9832
9832
  n: ["internalOpen"],
9833
9833
  t: ["b"],
9834
9834
  f: import.meta.url,
@@ -9899,7 +9899,7 @@ var S$5 = {
9899
9899
  },
9900
9900
  x: dispatchDeclared
9901
9901
  };
9902
- var D$5 = {
9902
+ var D$6 = {
9903
9903
  g: "ui-tooltip",
9904
9904
  props: {
9905
9905
  "for": {
@@ -9987,7 +9987,7 @@ var D$5 = {
9987
9987
  }
9988
9988
  }
9989
9989
  };
9990
- var C$3 = (host) => controller$3(host);
9990
+ var C$4 = (host) => controller$4(host);
9991
9991
  function createUiTooltip(options = {}, html) {
9992
9992
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
9993
9993
  const element = document.createElement("span");
@@ -9997,7 +9997,7 @@ function createUiTooltip(options = {}, html) {
9997
9997
  }
9998
9998
  if (!element.hasAttribute("role")) element.setAttribute("role", "tooltip");
9999
9999
  element.setAttribute("data-component", "ui-tooltip");
10000
- element.append((P0$3 ??= buildTemplate(T0$3)).cloneNode(true));
10000
+ element.append((P0$4 ??= buildTemplate(T0$4)).cloneNode(true));
10001
10001
  const v = [
10002
10002
  false,
10003
10003
  null,
@@ -10008,12 +10008,12 @@ function createUiTooltip(options = {}, html) {
10008
10008
  null,
10009
10009
  null
10010
10010
  ];
10011
- const B = acceptProps(element, D$5, S$5.n, v, componentProps, [], html);
10011
+ const B = acceptProps(element, D$6, S$6.n, v, componentProps, [], html);
10012
10012
  const m1 = (d) => {
10013
- return { n: (P1$3 ??= buildTemplate(T1$3)).cloneNode(true) };
10013
+ return { n: (P1$4 ??= buildTemplate(T1$4)).cloneNode(true) };
10014
10014
  };
10015
10015
  const m2 = (d) => {
10016
- return { n: (P2$3 ??= buildTemplate(T2$3)).cloneNode(true) };
10016
+ return { n: (P2$4 ??= buildTemplate(T2$4)).cloneNode(true) };
10017
10017
  };
10018
10018
  const p0 = (r, c, d) => {
10019
10019
  if (c & 1) {
@@ -10069,10 +10069,10 @@ function createUiTooltip(options = {}, html) {
10069
10069
  const I = { B };
10070
10070
  const J = project(I, children, slots);
10071
10071
  I.R = /* @__PURE__ */ new Set();
10072
- attachGeneratedController(element, S$5, v, (c, d) => {
10072
+ attachGeneratedController(element, S$6, v, (c, d) => {
10073
10073
  ((c, d) => p0(R, c, d))(c, d);
10074
10074
  for (const f of I.R) f(c, d);
10075
- }, C$3, void 0, I);
10075
+ }, C$4, void 0, I);
10076
10076
  manageProps(I);
10077
10077
  return element;
10078
10078
  }
@@ -10398,9 +10398,13 @@ async function navigateTableOfContents(editor, id) {
10398
10398
  target.tabIndex = -1;
10399
10399
  target.focus({ preventScroll: true });
10400
10400
  }
10401
+ function importAuthoredNavigation(element, schema) {
10402
+ return DOMParser.fromSchema(schema).parse(element).content;
10403
+ }
10401
10404
  Node$1.create({
10402
10405
  name: "loomaTableOfContents",
10403
10406
  group: "block",
10407
+ content: "block*",
10404
10408
  atom: true,
10405
10409
  selectable: true,
10406
10410
  isolating: true,
@@ -10420,8 +10424,25 @@ Node$1.create({
10420
10424
  }
10421
10425
  };
10422
10426
  },
10423
- parseHTML: () => [{ tag: "nav[data-looma-toc]" }],
10427
+ parseHTML: () => [{
10428
+ tag: "nav[data-looma-toc]",
10429
+ getContent: (element, schema) => {
10430
+ if (!(element instanceof HTMLElement) || !element.hasAttribute("data-authored-body")) return Fragment$1.empty;
10431
+ return importAuthoredNavigation(element, schema);
10432
+ }
10433
+ }],
10424
10434
  renderHTML({ node }) {
10435
+ if (node.childCount) return [
10436
+ "nav",
10437
+ {
10438
+ "data-looma-toc": "",
10439
+ "data-authored-body": "",
10440
+ "data-format": node.attrs.format,
10441
+ "data-depth": node.attrs.depth,
10442
+ "aria-label": "Table of contents"
10443
+ },
10444
+ 0
10445
+ ];
10425
10446
  return contentsHtml(this.editor?.view?.state.doc ?? node, normalizeTableOfContentsConfig$1(node.attrs));
10426
10447
  },
10427
10448
  addCommands() {
@@ -10437,8 +10458,15 @@ Node$1.create({
10437
10458
  dom.contentEditable = "false";
10438
10459
  let current = node;
10439
10460
  const render = () => {
10440
- const { dom: content } = DOMSerializer.renderSpec(document, contentsHtml(editor.state.doc, normalizeTableOfContentsConfig$1(current.attrs)));
10441
- dom.replaceChildren(content);
10461
+ if (current.childCount) {
10462
+ const nav = document.createElement("nav");
10463
+ nav.setAttribute("aria-label", "Table of contents");
10464
+ nav.append(DOMSerializer.fromSchema(editor.schema).serializeFragment(current.content));
10465
+ dom.replaceChildren(nav);
10466
+ } else {
10467
+ const { dom: content } = DOMSerializer.renderSpec(document, contentsHtml(editor.state.doc, normalizeTableOfContentsConfig$1(current.attrs)));
10468
+ dom.replaceChildren(content);
10469
+ }
10442
10470
  };
10443
10471
  dom.addEventListener("click", (event) => {
10444
10472
  const anchor = event.target.closest("a");
@@ -10498,7 +10526,7 @@ var choiceLabel = (field, config) => field === "format" ? FORMAT_LABELS[config.f
10498
10526
  * Composes a table of contents and its settings from Looma's components.
10499
10527
  * @lifecycle The view follows the document and rebuilds its entries when they change; the components
10500
10528
  * disconnect once ProseMirror removes its element, and destroying the view stops following the editor.
10501
- * Only the saved configuration enters editor state.
10529
+ * Imported authored links stay in the node body; automatic TOCs store only configuration.
10502
10530
  */
10503
10531
  var tableOfContentsNodeView = ({ editor, node, getPos }) => {
10504
10532
  const id = `looma-toc-${++tocSequence}`;
@@ -10536,6 +10564,14 @@ var tableOfContentsNodeView = ({ editor, node, getPos }) => {
10536
10564
  }));
10537
10565
  const renderEntries = () => {
10538
10566
  const { format, depth } = config();
10567
+ if (current.childCount) {
10568
+ const signature = JSON.stringify(current.content.toJSON());
10569
+ if (signature !== shown) {
10570
+ shown = signature;
10571
+ entries.replaceChildren(DOMSerializer.fromSchema(editor.schema).serializeFragment(current.content));
10572
+ }
10573
+ return;
10574
+ }
10539
10575
  const found = getTableOfContentsEntries(editor.state.doc, depth);
10540
10576
  const signature = JSON.stringify([format, found.map(({ id: entryId, text, level }) => [
10541
10577
  entryId,
@@ -10709,7 +10745,7 @@ var tableOfContentsNodeView = ({ editor, node, getPos }) => {
10709
10745
  settingsButton,
10710
10746
  popover,
10711
10747
  tooltip
10712
- ]) author.hidden = !editable;
10748
+ ]) author.hidden = !editable || current.childCount > 0;
10713
10749
  if (!editable) setSettingsOpen(false);
10714
10750
  renderEntries();
10715
10751
  };
@@ -10795,7 +10831,7 @@ function trackTrigger(host) {
10795
10831
  }
10796
10832
  //#endregion
10797
10833
  //#region components/ui-checkbox/ui-checkbox.js
10798
- function connect$2(host) {
10834
+ function connect$3(host) {
10799
10835
  const input = host.refs.input;
10800
10836
  describeInput(input, host.refs.description);
10801
10837
  const [trigger, stopTracking] = trackTrigger(host);
@@ -10828,12 +10864,12 @@ function connect$2(host) {
10828
10864
  };
10829
10865
  }
10830
10866
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
10831
- function controller$2(host) {
10832
- host.on("connect", () => connect$2(host));
10867
+ function controller$3(host) {
10868
+ host.on("connect", () => connect$3(host));
10833
10869
  }
10834
10870
  //#endregion
10835
10871
  //#region vanilla/UiCheckbox.js
10836
- var T0$2 = [
10872
+ var T0$3 = [
10837
10873
  "",
10838
10874
  [],
10839
10875
  "\n ",
@@ -10863,12 +10899,12 @@ var T0$2 = [
10863
10899
  ],
10864
10900
  "\n "
10865
10901
  ];
10866
- var T1$2 = ["", []];
10867
- var T2$2 = ["", []];
10868
- var P0$2;
10869
- var P1$2;
10870
- var P2$2;
10871
- var S$4 = {
10902
+ var T1$3 = ["", []];
10903
+ var T2$3 = ["", []];
10904
+ var P0$3;
10905
+ var P1$3;
10906
+ var P2$3;
10907
+ var S$5 = {
10872
10908
  n: ["internalChecked"],
10873
10909
  t: ["b"],
10874
10910
  f: import.meta.url,
@@ -10901,7 +10937,7 @@ var S$4 = {
10901
10937
  ] },
10902
10938
  x: dispatchDeclared
10903
10939
  };
10904
- var D$4 = {
10940
+ var D$5 = {
10905
10941
  g: "ui-checkbox",
10906
10942
  props: {
10907
10943
  "checked": {
@@ -10987,7 +11023,7 @@ var D$4 = {
10987
11023
  }
10988
11024
  }
10989
11025
  };
10990
- var C$2 = (host) => controller$2(host);
11026
+ var C$3 = (host) => controller$3(host);
10991
11027
  function createUiCheckbox(options = {}, html) {
10992
11028
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
10993
11029
  const element = document.createElement("label");
@@ -10996,7 +11032,7 @@ function createUiCheckbox(options = {}, html) {
10996
11032
  element.setAttribute(name, value === true ? "" : String(value));
10997
11033
  }
10998
11034
  element.setAttribute("data-component", "ui-checkbox");
10999
- element.append((P0$2 ??= buildTemplate(T0$2)).cloneNode(true));
11035
+ element.append((P0$3 ??= buildTemplate(T0$3)).cloneNode(true));
11000
11036
  const v = [
11001
11037
  false,
11002
11038
  null,
@@ -11009,12 +11045,12 @@ function createUiCheckbox(options = {}, html) {
11009
11045
  null,
11010
11046
  null
11011
11047
  ];
11012
- const B = acceptProps(element, D$4, S$4.n, v, componentProps, [], html);
11048
+ const B = acceptProps(element, D$5, S$5.n, v, componentProps, [], html);
11013
11049
  const m1 = (d) => {
11014
- return { n: (P1$2 ??= buildTemplate(T1$2)).cloneNode(true) };
11050
+ return { n: (P1$3 ??= buildTemplate(T1$3)).cloneNode(true) };
11015
11051
  };
11016
11052
  const m2 = (d) => {
11017
- return { n: (P2$2 ??= buildTemplate(T2$2)).cloneNode(true) };
11053
+ return { n: (P2$3 ??= buildTemplate(T2$3)).cloneNode(true) };
11018
11054
  };
11019
11055
  const p0 = (r, c, d) => {
11020
11056
  if (c & 32) {
@@ -11129,10 +11165,10 @@ function createUiCheckbox(options = {}, html) {
11129
11165
  const I = { B };
11130
11166
  const J = project(I, children, slots);
11131
11167
  I.R = /* @__PURE__ */ new Set();
11132
- attachGeneratedController(element, S$4, v, (c, d) => {
11168
+ attachGeneratedController(element, S$5, v, (c, d) => {
11133
11169
  ((c, d) => p0(R, c, d))(c, d);
11134
11170
  for (const f of I.R) f(c, d);
11135
- }, C$2, void 0, I);
11171
+ }, C$3, void 0, I);
11136
11172
  manageProps(I);
11137
11173
  I.r["input"] = t0;
11138
11174
  I.r["description"] = t4;
@@ -11174,7 +11210,7 @@ function leaveGroup(document, name, member) {
11174
11210
  if (!members.size) byName.delete(name);
11175
11211
  else ensureOpen(members);
11176
11212
  }
11177
- function connect$1(host) {
11213
+ function connect$2(host) {
11178
11214
  const document = host.element.ownerDocument;
11179
11215
  const [trigger, stopTracking] = trackTrigger(host);
11180
11216
  host.state.contentId = `ui-disclosure-${++disclosures}`;
@@ -11276,12 +11312,12 @@ function connect$1(host) {
11276
11312
  };
11277
11313
  }
11278
11314
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
11279
- function controller$1(host) {
11280
- host.on("connect", () => connect$1(host));
11315
+ function controller$2(host) {
11316
+ host.on("connect", () => connect$2(host));
11281
11317
  }
11282
11318
  //#endregion
11283
11319
  //#region vanilla/UiDisclosure.js
11284
- var T0$1 = [
11320
+ var T0$2 = [
11285
11321
  "",
11286
11322
  [],
11287
11323
  "\n ",
@@ -11336,8 +11372,8 @@ var T0$1 = [
11336
11372
  ],
11337
11373
  "\n "
11338
11374
  ];
11339
- var T1$1 = ["", []];
11340
- var T2$1 = [
11375
+ var T1$2 = ["", []];
11376
+ var T2$2 = [
11341
11377
  "",
11342
11378
  [],
11343
11379
  0
@@ -11348,12 +11384,12 @@ var T3$1 = [
11348
11384
  ["span", ["class", "chevron"]]
11349
11385
  ];
11350
11386
  var T4$1 = ["", []];
11351
- var P0$1;
11352
- var P1$1;
11353
- var P2$1;
11387
+ var P0$2;
11388
+ var P1$2;
11389
+ var P2$2;
11354
11390
  var P3$1;
11355
11391
  var P4$1;
11356
- var S$3 = {
11392
+ var S$4 = {
11357
11393
  n: [
11358
11394
  "internalOpen",
11359
11395
  "contentId",
@@ -11438,7 +11474,7 @@ var S$3 = {
11438
11474
  },
11439
11475
  x: dispatchDeclared
11440
11476
  };
11441
- var D$3 = {
11477
+ var D$4 = {
11442
11478
  g: "ui-disclosure",
11443
11479
  props: {
11444
11480
  "density": {
@@ -11525,7 +11561,7 @@ var D$3 = {
11525
11561
  }
11526
11562
  }
11527
11563
  };
11528
- var C$1 = (host) => controller$1(host);
11564
+ var C$2 = (host) => controller$2(host);
11529
11565
  function createUiDisclosure(options = {}, html) {
11530
11566
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
11531
11567
  const element = document.createElement("div");
@@ -11534,7 +11570,7 @@ function createUiDisclosure(options = {}, html) {
11534
11570
  element.setAttribute(name, value === true ? "" : String(value));
11535
11571
  }
11536
11572
  element.setAttribute("data-component", "ui-disclosure");
11537
- element.append((P0$1 ??= buildTemplate(T0$1)).cloneNode(true));
11573
+ element.append((P0$2 ??= buildTemplate(T0$2)).cloneNode(true));
11538
11574
  const v = [
11539
11575
  false,
11540
11576
  "",
@@ -11550,12 +11586,12 @@ function createUiDisclosure(options = {}, html) {
11550
11586
  null,
11551
11587
  null
11552
11588
  ];
11553
- const B = acceptProps(element, D$3, S$3.n, v, componentProps, [], html);
11589
+ const B = acceptProps(element, D$4, S$4.n, v, componentProps, [], html);
11554
11590
  const m1 = (d) => {
11555
- return { n: (P1$1 ??= buildTemplate(T1$1)).cloneNode(true) };
11591
+ return { n: (P1$2 ??= buildTemplate(T1$2)).cloneNode(true) };
11556
11592
  };
11557
11593
  const m2 = (d) => {
11558
- const n = (P2$1 ??= buildTemplate(T2$1)).cloneNode(true);
11594
+ const n = (P2$2 ??= buildTemplate(T2$2)).cloneNode(true);
11559
11595
  const r = {
11560
11596
  n,
11561
11597
  a0: n.firstChild,
@@ -11709,10 +11745,10 @@ function createUiDisclosure(options = {}, html) {
11709
11745
  const I = { B };
11710
11746
  const J = project(I, children, slots);
11711
11747
  I.R = /* @__PURE__ */ new Set();
11712
- attachGeneratedController(element, S$3, v, (c, d) => {
11748
+ attachGeneratedController(element, S$4, v, (c, d) => {
11713
11749
  ((c, d) => p0(R, c, d))(c, d);
11714
11750
  for (const f of I.R) f(c, d);
11715
- }, C$1, void 0, I);
11751
+ }, C$2, void 0, I);
11716
11752
  manageProps(I);
11717
11753
  I.r["heading"] = t0;
11718
11754
  I.r["trigger"] = t1;
@@ -11721,7 +11757,7 @@ function createUiDisclosure(options = {}, html) {
11721
11757
  }
11722
11758
  //#endregion
11723
11759
  //#region components/ui-input/ui-input.js
11724
- function connect(host) {
11760
+ function connect$1(host) {
11725
11761
  return host.effect(() => {
11726
11762
  const value = host.props.value.value;
11727
11763
  if (value === void 0 || value === null) return;
@@ -11734,18 +11770,18 @@ function connect(host) {
11734
11770
  });
11735
11771
  }
11736
11772
  /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
11737
- function controller(host) {
11738
- host.on("connect", () => connect(host));
11773
+ function controller$1(host) {
11774
+ host.on("connect", () => connect$1(host));
11739
11775
  }
11740
11776
  //#endregion
11741
11777
  //#region vanilla/UiInput.js
11742
- var S$2 = {
11778
+ var S$3 = {
11743
11779
  n: [],
11744
11780
  t: [],
11745
11781
  f: import.meta.url,
11746
11782
  g: "ui-input"
11747
11783
  };
11748
- var D$2 = {
11784
+ var D$3 = {
11749
11785
  g: "ui-input",
11750
11786
  props: {
11751
11787
  "disabled": {
@@ -11941,7 +11977,7 @@ var D$2 = {
11941
11977
  }
11942
11978
  }
11943
11979
  };
11944
- var C = (host) => controller(host);
11980
+ var C$1 = (host) => controller$1(host);
11945
11981
  function createUiInput(options = {}, html) {
11946
11982
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
11947
11983
  const element = document.createElement("input");
@@ -11959,7 +11995,7 @@ function createUiInput(options = {}, html) {
11959
11995
  null,
11960
11996
  null
11961
11997
  ];
11962
- const B = acceptProps(element, D$2, S$2.n, v, componentProps, [], html);
11998
+ const B = acceptProps(element, D$3, S$3.n, v, componentProps, [], html);
11963
11999
  const p0 = (r, c, d) => {
11964
12000
  if (c & 1073741856) {
11965
12001
  const x0 = v[5];
@@ -11967,7 +12003,7 @@ function createUiInput(options = {}, html) {
11967
12003
  if (s0 !== r.v0) writeAttribute(r.n, "type", r.v0 = s0);
11968
12004
  }
11969
12005
  if (c & 1073741920) {
11970
- const x1 = checkSelected(S$2, v[6], v[5], [
12006
+ const x1 = checkSelected(S$3, v[6], v[5], [
11971
12007
  [
11972
12008
  "text",
11973
12009
  "s",
@@ -12090,7 +12126,7 @@ function createUiInput(options = {}, html) {
12090
12126
  v6: void 0
12091
12127
  };
12092
12128
  const I = { B };
12093
- attachGeneratedController(element, S$2, v, ((c, d) => p0(R, c, d)), C, void 0, I);
12129
+ attachGeneratedController(element, S$3, v, ((c, d) => p0(R, c, d)), C$1, void 0, I);
12094
12130
  manageProps(I);
12095
12131
  return element;
12096
12132
  }
@@ -12279,13 +12315,13 @@ var expandNodeView = ({ editor, node, getPos }) => {
12279
12315
  };
12280
12316
  //#endregion
12281
12317
  //#region vanilla/UiSeparator.js
12282
- var S$1 = {
12318
+ var S$2 = {
12283
12319
  n: [],
12284
12320
  t: [],
12285
12321
  f: import.meta.url,
12286
12322
  g: "ui-separator"
12287
12323
  };
12288
- var D$1 = {
12324
+ var D$2 = {
12289
12325
  g: "ui-separator",
12290
12326
  props: {
12291
12327
  "emphasis": {
@@ -12346,7 +12382,7 @@ function createUiSeparator(options = {}, html) {
12346
12382
  null,
12347
12383
  null
12348
12384
  ];
12349
- const B = acceptProps(element, D$1, S$1.n, v, componentProps, [], html);
12385
+ const B = acceptProps(element, D$2, S$2.n, v, componentProps, [], html);
12350
12386
  const p0 = (r, c, d) => {
12351
12387
  if (c & 1073741826) {
12352
12388
  const x0 = v[1];
@@ -12372,7 +12408,7 @@ function createUiSeparator(options = {}, html) {
12372
12408
  v1: void 0
12373
12409
  };
12374
12410
  const I = { B };
12375
- attachGeneratedController(element, S$1, v, ((c, d) => p0(R, c, d)), void 0, void 0, I);
12411
+ attachGeneratedController(element, S$2, v, ((c, d) => p0(R, c, d)), void 0, void 0, I);
12376
12412
  manageProps(I);
12377
12413
  return element;
12378
12414
  }
@@ -12420,7 +12456,7 @@ var dividerNodeView = ({ editor, getPos }) => {
12420
12456
  };
12421
12457
  //#endregion
12422
12458
  //#region vanilla/UiCallout.js
12423
- var T0 = [
12459
+ var T0$1 = [
12424
12460
  "",
12425
12461
  [],
12426
12462
  "\n ",
@@ -12460,7 +12496,7 @@ var T0 = [
12460
12496
  ],
12461
12497
  "\n "
12462
12498
  ];
12463
- var T1 = [
12499
+ var T1$1 = [
12464
12500
  "svg",
12465
12501
  [
12466
12502
  "viewBox",
@@ -12487,7 +12523,7 @@ var T1 = [
12487
12523
  ["path", ["d", "M12 16v-4"]],
12488
12524
  ["path", ["d", "M12 8h.01"]]
12489
12525
  ];
12490
- var T2 = [
12526
+ var T2$1 = [
12491
12527
  "svg",
12492
12528
  [
12493
12529
  "viewBox",
@@ -12626,9 +12662,9 @@ var T8 = [
12626
12662
  0
12627
12663
  ];
12628
12664
  var T9 = ["", []];
12629
- var P0;
12630
- var P1;
12631
- var P2;
12665
+ var P0$1;
12666
+ var P1$1;
12667
+ var P2$1;
12632
12668
  var P3;
12633
12669
  var P4;
12634
12670
  var P5;
@@ -12636,13 +12672,13 @@ var P6;
12636
12672
  var P7;
12637
12673
  var P8;
12638
12674
  var P9;
12639
- var S = {
12675
+ var S$1 = {
12640
12676
  n: [],
12641
12677
  t: [],
12642
12678
  f: import.meta.url,
12643
12679
  g: "ui-callout"
12644
12680
  };
12645
- var D = {
12681
+ var D$1 = {
12646
12682
  g: "ui-callout",
12647
12683
  props: {
12648
12684
  "heading": {
@@ -12687,14 +12723,14 @@ function createUiCallout(options = {}, html) {
12687
12723
  }
12688
12724
  if (!element.hasAttribute("role")) element.setAttribute("role", "note");
12689
12725
  element.setAttribute("data-component", "ui-callout");
12690
- element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
12726
+ element.append((P0$1 ??= buildTemplate(T0$1)).cloneNode(true));
12691
12727
  const v = [null, null];
12692
- const B = acceptProps(element, D, S.n, v, componentProps, [], html);
12728
+ const B = acceptProps(element, D$1, S$1.n, v, componentProps, [], html);
12693
12729
  const m1 = (d) => {
12694
- return { n: (P1 ??= buildTemplate(T1)).cloneNode(true) };
12730
+ return { n: (P1$1 ??= buildTemplate(T1$1)).cloneNode(true) };
12695
12731
  };
12696
12732
  const m2 = (d) => {
12697
- return { n: (P2 ??= buildTemplate(T2)).cloneNode(true) };
12733
+ return { n: (P2$1 ??= buildTemplate(T2$1)).cloneNode(true) };
12698
12734
  };
12699
12735
  const m3 = (d) => {
12700
12736
  return { n: (P3 ??= buildTemplate(T3)).cloneNode(true) };
@@ -12865,7 +12901,7 @@ function createUiCallout(options = {}, html) {
12865
12901
  };
12866
12902
  const I = { B };
12867
12903
  const J = project(I, children, slots);
12868
- attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), void 0, void 0, I);
12904
+ attachGeneratedController(element, S$1, v, ((c, d) => p0(R, c, d)), void 0, void 0, I);
12869
12905
  manageProps(I);
12870
12906
  return element;
12871
12907
  }
@@ -12904,86 +12940,553 @@ var calloutNodeView = ({ node }) => {
12904
12940
  };
12905
12941
  };
12906
12942
  //#endregion
12907
- //#region src/vue/editor/image.ts
12908
- /** Projects the shared image's resize intent into a single document transaction.
12909
- * @ownership Delivery decorations belong to the inner image, never the figure;
12910
- * persisted attributes remain independent of host renditions and drag previews.
12911
- * @lifecycle Each atom owns a Vue app and an editability subscription.
12943
+ //#region components/ui-image/ui-image.js
12944
+ /** Owns transient resize geometry; consumers own persistence and selection.
12945
+ * @lifecycle Pointer capture ends on release, Escape, cancellation, or teardown.
12946
+ * Only release commits a drag, so consumers can make it one undo operation.
12912
12947
  */
12913
- var imageNodeView = ({ editor, node, getPos, decorations }) => {
12914
- const mount = document.createElement("div");
12915
- const current = shallowRef(node);
12916
- const delivery = shallowRef(decorations);
12917
- const selected = ref(false);
12918
- const editable = ref(editor.isEditable);
12919
- const refresh = () => {
12920
- editable.value = editor.isEditable;
12948
+ function connect(host) {
12949
+ const root = host.element;
12950
+ const frame = host.refs.frame;
12951
+ const document = root.ownerDocument;
12952
+ let drag = null;
12953
+ const image = () => frame.querySelector("img");
12954
+ const enabled = () => host.props.selected.value && host.props.resizable.value;
12955
+ const measure = () => {
12956
+ const media = image();
12957
+ const rect = media.getBoundingClientRect();
12958
+ return {
12959
+ width: rect.width,
12960
+ height: rect.height,
12961
+ ratio: (media.naturalHeight || rect.height || 1) / (media.naturalWidth || rect.width || 1)
12962
+ };
12921
12963
  };
12922
- const app = createApp({ render: () => {
12923
- const attrs = current.value.attrs;
12924
- const transient = Object.assign({}, ...delivery.value.map((decoration) => decoration.spec.loomaImageAttributes ?? {}));
12925
- return h(Image, {
12926
- src: transient.src ?? attrs.src,
12927
- alt: attrs.alt ?? "",
12928
- width: attrs.width,
12929
- height: attrs.height,
12930
- placement: normalizeImagePlacement(attrs.placement),
12931
- selected: editable.value && selected.value,
12932
- resizable: editable.value,
12933
- contenteditable: "false",
12934
- "data-looma-image-node": "",
12935
- onClick: (event) => {
12936
- if (event.target.closest("button")) return;
12937
- const position = getPos();
12938
- if (!editor.isEditable || typeof position !== "number") return;
12939
- editor.view.dispatch(editor.state.tr.setSelection(NodeSelection.create(editor.state.doc, position)));
12940
- editor.view.focus();
12941
- },
12942
- onResize: (event) => {
12943
- if (event.detail.phase !== "commit" || !editor.isEditable) return;
12944
- const position = getPos();
12945
- if (typeof position !== "number" || editor.state.doc.nodeAt(position) !== current.value) return;
12946
- const { width, height } = event.detail;
12947
- if (width === current.value.attrs.width && height === current.value.attrs.height) return;
12948
- editor.view.dispatch(closeHistory(editor.state.tr).setNodeMarkup(position, void 0, {
12949
- ...current.value.attrs,
12950
- width,
12951
- height
12952
- }));
12953
- editor.view.dispatch(closeHistory(editor.state.tr));
12954
- }
12955
- }, { media: () => h("img", {
12964
+ const dimensions = (width, ratio) => {
12965
+ const container = root.parentElement;
12966
+ const style = document.defaultView.getComputedStyle(container);
12967
+ const available = container.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
12968
+ const gap = parseFloat(document.defaultView.getComputedStyle(root).paddingLeft) + parseFloat(document.defaultView.getComputedStyle(root).paddingRight);
12969
+ const maximum = Math.max(1, available - gap);
12970
+ const next = Math.round(Math.min(maximum, Math.max(Math.min(32, maximum), width)));
12971
+ return {
12972
+ width: next,
12973
+ height: Math.max(1, Math.round(next * ratio))
12974
+ };
12975
+ };
12976
+ const restore = () => {
12977
+ root.removeAttribute("data-resizing");
12978
+ const width = host.props.width.value;
12979
+ if (width > 0) root.style.setProperty("--_ui-image-width", `${width}px`);
12980
+ else root.style.removeProperty("--_ui-image-width");
12981
+ };
12982
+ const dispatch = (size, phase, trigger) => host.dispatch("resize", {
12983
+ ...size,
12984
+ phase,
12985
+ trigger
12986
+ });
12987
+ const finish = (phase) => {
12988
+ if (!drag) return;
12989
+ const current = drag;
12990
+ drag = null;
12991
+ document.removeEventListener("keydown", onEscape, true);
12992
+ if (current.handle.hasPointerCapture(current.pointer)) current.handle.releasePointerCapture(current.pointer);
12993
+ if (phase === "commit" && !current.moved) phase = "cancel";
12994
+ restore();
12995
+ dispatch(phase === "commit" ? current.size : {
12996
+ width: Math.round(current.width),
12997
+ height: Math.round(current.height)
12998
+ }, phase, "pointer");
12999
+ };
13000
+ const onDown = (event) => {
13001
+ const handle = event.target.closest("[data-corner]");
13002
+ if (!enabled() || !handle || !root.contains(handle) || event.button !== 0 || drag) return;
13003
+ event.preventDefault();
13004
+ const measured = measure();
13005
+ drag = {
13006
+ ...measured,
13007
+ x: event.clientX,
13008
+ y: event.clientY,
13009
+ handle,
13010
+ pointer: event.pointerId,
13011
+ size: dimensions(measured.width, measured.ratio)
13012
+ };
13013
+ handle.setPointerCapture(event.pointerId);
13014
+ document.addEventListener("keydown", onEscape, true);
13015
+ root.setAttribute("data-resizing", "");
13016
+ };
13017
+ const onMove = (event) => {
13018
+ if (!drag || drag.pointer !== event.pointerId) return;
13019
+ const corner = drag.handle.dataset.corner;
13020
+ const dx = (event.clientX - drag.x) * (corner.endsWith("left") ? -1 : 1);
13021
+ const dy = (event.clientY - drag.y) * (corner.startsWith("top") ? -1 : 1);
13022
+ const delta = (dx + drag.ratio * dy) / (1 + drag.ratio * drag.ratio);
13023
+ drag.size = dimensions(drag.width + delta, drag.ratio);
13024
+ drag.moved = drag.size.width !== Math.round(drag.width);
13025
+ root.style.setProperty("--_ui-image-width", `${drag.size.width}px`);
13026
+ dispatch(drag.size, "preview", "pointer");
13027
+ };
13028
+ const onUp = (event) => {
13029
+ if (drag?.pointer === event.pointerId) finish("commit");
13030
+ };
13031
+ const onCancel = (event) => {
13032
+ if (drag?.pointer === event.pointerId) finish("cancel");
13033
+ };
13034
+ const onEscape = (event) => {
13035
+ if (event.key !== "Escape" || !drag) return;
13036
+ event.preventDefault();
13037
+ event.stopPropagation();
13038
+ finish("cancel");
13039
+ };
13040
+ const onKey = (event) => {
13041
+ const handle = event.target.closest?.("[data-corner]");
13042
+ if (!enabled() || !handle || !root.contains(handle) || ![
13043
+ "ArrowLeft",
13044
+ "ArrowRight",
13045
+ "ArrowUp",
13046
+ "ArrowDown"
13047
+ ].includes(event.key)) return;
13048
+ event.preventDefault();
13049
+ event.stopPropagation();
13050
+ const measured = measure();
13051
+ const horizontal = event.key === "ArrowLeft" || event.key === "ArrowRight";
13052
+ const amount = ((event.key === "ArrowLeft" || event.key === "ArrowUp") !== (horizontal ? handle.dataset.corner.endsWith("left") : handle.dataset.corner.startsWith("top")) ? -1 : 1) * (event.shiftKey ? 32 : 8);
13053
+ dispatch(dimensions(measured.width + amount / (horizontal ? 1 : measured.ratio), measured.ratio), "commit", "keyboard");
13054
+ };
13055
+ const stop = host.effect(() => {
13056
+ host.props.width.value;
13057
+ host.props.height.value;
13058
+ host.props.placement.value;
13059
+ if (drag) finish("cancel");
13060
+ restore();
13061
+ enabled();
13062
+ });
13063
+ root.addEventListener("pointerdown", onDown);
13064
+ root.addEventListener("pointermove", onMove);
13065
+ root.addEventListener("pointerup", onUp);
13066
+ root.addEventListener("pointercancel", onCancel);
13067
+ root.addEventListener("lostpointercapture", onCancel);
13068
+ root.addEventListener("keydown", onKey);
13069
+ return () => {
13070
+ stop();
13071
+ if (drag) {
13072
+ const active = drag;
13073
+ drag = null;
13074
+ if (active.handle.hasPointerCapture(active.pointer)) active.handle.releasePointerCapture(active.pointer);
13075
+ }
13076
+ root.removeEventListener("pointerdown", onDown);
13077
+ root.removeEventListener("pointermove", onMove);
13078
+ root.removeEventListener("pointerup", onUp);
13079
+ root.removeEventListener("pointercancel", onCancel);
13080
+ root.removeEventListener("lostpointercapture", onCancel);
13081
+ root.removeEventListener("keydown", onKey);
13082
+ document.removeEventListener("keydown", onEscape, true);
13083
+ };
13084
+ }
13085
+ /** Keep DOM setup and its cleanup tied to each connection, including reconnects. */
13086
+ function controller(host) {
13087
+ host.on("connect", () => connect(host));
13088
+ }
13089
+ //#endregion
13090
+ //#region vanilla/UiImage.js
13091
+ var T0 = [
13092
+ "",
13093
+ [],
13094
+ "\n ",
13095
+ [
13096
+ "div",
13097
+ ["class", "frame"],
13098
+ "\n ",
13099
+ 4,
13100
+ "\n ",
13101
+ [
13102
+ "div",
13103
+ ["class", "handles"],
13104
+ "\n ",
13105
+ ["button", [
13106
+ "type",
13107
+ "button",
13108
+ "class",
13109
+ "handle",
13110
+ "data-corner",
13111
+ "top-left",
13112
+ "aria-label",
13113
+ "Resize image from top left"
13114
+ ]],
13115
+ "\n ",
13116
+ ["button", [
13117
+ "type",
13118
+ "button",
13119
+ "class",
13120
+ "handle",
13121
+ "data-corner",
13122
+ "top-right",
13123
+ "aria-label",
13124
+ "Resize image from top right"
13125
+ ]],
13126
+ "\n ",
13127
+ ["button", [
13128
+ "type",
13129
+ "button",
13130
+ "class",
13131
+ "handle",
13132
+ "data-corner",
13133
+ "bottom-left",
13134
+ "aria-label",
13135
+ "Resize image from bottom left"
13136
+ ]],
13137
+ "\n ",
13138
+ ["button", [
13139
+ "type",
13140
+ "button",
13141
+ "class",
13142
+ "handle",
13143
+ "data-corner",
13144
+ "bottom-right",
13145
+ "aria-label",
13146
+ "Resize image from bottom right"
13147
+ ]],
13148
+ "\n "
13149
+ ],
13150
+ "\n ",
13151
+ 4,
13152
+ "\n "
13153
+ ],
13154
+ "\n "
13155
+ ];
13156
+ var T1 = [
13157
+ "",
13158
+ [],
13159
+ ["img", []]
13160
+ ];
13161
+ var T2 = ["", []];
13162
+ var P0;
13163
+ var P1;
13164
+ var P2;
13165
+ var S = {
13166
+ n: [],
13167
+ t: [],
13168
+ f: import.meta.url,
13169
+ g: "ui-image",
13170
+ d: { "resize": [
13171
+ detailCheck(checkObject([
13172
+ [
13173
+ "width",
13174
+ checkInteger,
13175
+ false
13176
+ ],
13177
+ [
13178
+ "height",
13179
+ checkInteger,
13180
+ false
13181
+ ],
13182
+ [
13183
+ "phase",
13184
+ checkConstrained(checkFormat("keyword", keywordFormat), "keyword", { "values": [
13185
+ "preview",
13186
+ "commit",
13187
+ "cancel"
13188
+ ] }),
13189
+ false
13190
+ ],
13191
+ [
13192
+ "trigger",
13193
+ checkConstrained(checkFormat("keyword", keywordFormat), "keyword", { "values": ["pointer", "keyboard"] }),
13194
+ false
13195
+ ]
13196
+ ], false)),
13197
+ true,
13198
+ true,
13199
+ false
13200
+ ] },
13201
+ x: dispatchDeclared
13202
+ };
13203
+ var D = {
13204
+ g: "ui-image",
13205
+ props: {
13206
+ "alt": {
13207
+ "required": false,
13208
+ "default": "",
13209
+ c: checkString,
13210
+ t: "string",
13211
+ j: 0,
13212
+ m: "s"
13213
+ },
13214
+ "height": {
13215
+ "required": false,
13216
+ c: checkInteger,
13217
+ t: "integer",
13218
+ j: 0,
13219
+ m: "i"
13220
+ },
13221
+ "placement": {
13222
+ "required": false,
13223
+ "values": [
13224
+ "block",
13225
+ "center",
13226
+ "wrap-left",
13227
+ "wrap-right"
13228
+ ],
13229
+ "default": "block",
13230
+ c: checkFormat("keyword", keywordFormat),
13231
+ t: "keyword",
13232
+ j: 0,
13233
+ m: [
13234
+ "p",
13235
+ formatOf(keywordFormat),
13236
+ false
13237
+ ]
13238
+ },
13239
+ "resizable": {
13240
+ "required": false,
13241
+ "default": false,
13242
+ c: checkBoolean,
13243
+ t: "boolean",
13244
+ j: 0,
13245
+ m: "b"
13246
+ },
13247
+ "selected": {
13248
+ "required": false,
13249
+ "default": false,
13250
+ c: checkBoolean,
13251
+ t: "boolean",
13252
+ j: 0,
13253
+ m: "b"
13254
+ },
13255
+ "src": {
13256
+ "required": false,
13257
+ "default": "",
13258
+ c: checkString,
13259
+ t: "string",
13260
+ j: 0,
13261
+ m: "s"
13262
+ },
13263
+ "width": {
13264
+ "required": false,
13265
+ c: checkInteger,
13266
+ t: "integer",
13267
+ j: 0,
13268
+ m: "i"
13269
+ }
13270
+ }
13271
+ };
13272
+ var C = (host) => controller(host);
13273
+ function createUiImage(options = {}, html) {
13274
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
13275
+ const element = document.createElement("figure");
13276
+ for (const [name, value] of Object.entries(attributes)) {
13277
+ if (value === null || value === void 0 || value === false) continue;
13278
+ element.setAttribute(name, value === true ? "" : String(value));
13279
+ }
13280
+ element.setAttribute("data-component", "ui-image");
13281
+ element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
13282
+ const v = [
13283
+ null,
13284
+ null,
13285
+ null,
13286
+ null,
13287
+ null,
13288
+ null,
13289
+ null
13290
+ ];
13291
+ const B = acceptProps(element, D, S.n, v, componentProps, [], html);
13292
+ const m1 = (d) => {
13293
+ const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
13294
+ const r = {
13295
+ n,
13296
+ a0: n.firstChild,
13297
+ v0: null,
13298
+ v1: null,
13299
+ v2: null,
13300
+ v3: null
13301
+ };
13302
+ p1(r, -1, d);
13303
+ return r;
13304
+ };
13305
+ const p1 = (r, c, d) => {
13306
+ if (c & 32) {
13307
+ const x0 = v[5];
13308
+ const s0 = toAttribute(x0, "src");
13309
+ if (s0 !== r.v0) writeUrlAttribute(r.a0, "src", r.v0 = s0);
13310
+ }
13311
+ if (c & 1) {
13312
+ const x1 = v[0];
13313
+ const s1 = toAttribute(x1, "alt");
13314
+ if (s1 !== r.v1) writeAttribute(r.a0, "alt", r.v1 = s1);
13315
+ }
13316
+ if (c & 64) {
13317
+ const x2 = v[6];
13318
+ const s2 = toAttribute(x2, "width");
13319
+ if (s2 !== r.v2) writeAttribute(r.a0, "width", r.v2 = s2);
13320
+ }
13321
+ if (c & 2) {
13322
+ const x3 = v[1];
13323
+ const s3 = toAttribute(x3, "height");
13324
+ if (s3 !== r.v3) writeAttribute(r.a0, "height", r.v3 = s3);
13325
+ }
13326
+ };
13327
+ const m2 = (d) => {
13328
+ return { n: (P2 ??= buildTemplate(T2)).cloneNode(true) };
13329
+ };
13330
+ const p0 = (r, c, d) => {
13331
+ if (c & 24) {
13332
+ const x0 = !(truthy(v[4]) && truthy(v[3]));
13333
+ const s0 = toAttribute(x0, "hidden");
13334
+ if (s0 !== r.v0) writeAttribute(r.a2, "hidden", r.v0 = s0);
13335
+ }
13336
+ if (c & 20) {
13337
+ const s1 = hostState(["placement", "selected"], [v[2], v[4]]);
13338
+ if (s1 !== r.v1) writeAttribute(r.n, "data-ui-image-state", (r.v1 = s1) === "" ? null : s1);
13339
+ }
13340
+ if (r.f0 === void 0) {
13341
+ r.f0 = 1;
13342
+ const at = fillSlot(r.a1, r.e0, "media", J, true, void 0, d);
13343
+ if (Array.isArray(at)) (r.z ??= []).push(() => {
13344
+ at[0].l.delete(at[1]);
13345
+ dispose(at[1]);
13346
+ });
13347
+ else if (at !== void 0) {
13348
+ r.b0 = m1(d);
13349
+ at.before(r.b0.n);
13350
+ }
13351
+ } else if (r.b0 !== void 0) p1(r.b0, c, d);
13352
+ if (r.f1 === void 0) {
13353
+ r.f1 = 1;
13354
+ const at = fillSlot(r.a3, r.e1, "controls", J, false, void 0, d);
13355
+ if (Array.isArray(at)) (r.z ??= []).push(() => {
13356
+ at[0].l.delete(at[1]);
13357
+ dispose(at[1]);
13358
+ });
13359
+ else if (at !== void 0) {
13360
+ r.b1 = m2(d);
13361
+ at.before(r.b1.n);
13362
+ }
13363
+ } else if (r.b1 !== void 0) r.b1;
13364
+ };
13365
+ const t0 = element.firstChild.nextSibling;
13366
+ const t1 = t0.firstChild.nextSibling;
13367
+ const t2 = t1.nextSibling.nextSibling.nextSibling;
13368
+ const t3 = t2.nextSibling.nextSibling;
13369
+ const R = {
13370
+ n: element,
13371
+ a2: t2,
13372
+ v0: null,
13373
+ v1: void 0,
13374
+ a1: t1,
13375
+ e0: t1.nextSibling,
13376
+ b0: void 0,
13377
+ f0: void 0,
13378
+ a3: t3,
13379
+ e1: t3.nextSibling,
13380
+ b1: void 0,
13381
+ f1: void 0
13382
+ };
13383
+ const I = { B };
13384
+ const J = project(I, children, slots);
13385
+ attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), C, void 0, I);
13386
+ manageProps(I);
13387
+ I.r["frame"] = t0;
13388
+ return element;
13389
+ }
13390
+ //#endregion
13391
+ //#region src/editor/node-views/image.ts
13392
+ /** The delivery attributes the editor's decorations lay over the stored ones, such as `srcset`. */
13393
+ var deliveryAttributes = (decorations) => Object.assign({}, ...decorations.map((decoration) => decoration.spec.loomaImageAttributes ?? {}));
13394
+ /**
13395
+ * Projects Image's resize into one document transaction, and draws the stored image with the
13396
+ * delivery attributes laid over it.
13397
+ * @ownership Delivery attributes belong to the inner `img`, never to Image; the stored attributes
13398
+ * stay independent of host renditions and drag previews.
13399
+ * @lifecycle Image disconnects once ProseMirror removes it; destroying the view stops following the
13400
+ * editor's editability.
13401
+ */
13402
+ var imageNodeView = ({ editor, node, getPos, decorations }) => {
13403
+ let current = node;
13404
+ let delivery = deliveryAttributes(decorations);
13405
+ let selected = false;
13406
+ const media = document.createElement("img");
13407
+ let written = /* @__PURE__ */ new Set();
13408
+ const writeMedia = (attrs) => {
13409
+ const next = Object.entries({
12956
13410
  src: attrs.src,
12957
13411
  alt: attrs.alt ?? "",
12958
13412
  title: attrs.title,
12959
13413
  width: attrs.width,
12960
13414
  height: attrs.height,
12961
- ...transient
12962
- }) });
12963
- } });
12964
- app.mount(mount);
12965
- const dom = mount.firstElementChild;
12966
- editor.on("update", refresh);
13415
+ ...delivery
13416
+ }).filter(([, value]) => value !== void 0 && value !== null && value !== false);
13417
+ const names = new Set(next.map(([name]) => name));
13418
+ for (const name of written) if (!names.has(name)) media.removeAttribute(name);
13419
+ for (const [name, value] of next) {
13420
+ const text = value === true ? "" : String(value);
13421
+ if (media.getAttribute(name) !== text) media.setAttribute(name, text);
13422
+ }
13423
+ written = names;
13424
+ };
13425
+ const props = (next) => ({
13426
+ src: delivery.src ?? next.attrs.src,
13427
+ alt: next.attrs.alt ?? "",
13428
+ width: next.attrs.width,
13429
+ height: next.attrs.height,
13430
+ placement: normalizeImagePlacement(next.attrs.placement),
13431
+ selected: editor.isEditable && selected,
13432
+ resizable: editor.isEditable
13433
+ });
13434
+ writeMedia(node.attrs);
13435
+ const image = createUiImage({
13436
+ ...props(node),
13437
+ attributes: {
13438
+ contenteditable: "false",
13439
+ "data-looma-image-node": ""
13440
+ },
13441
+ slots: { media: [media] }
13442
+ });
13443
+ const dom = element(image);
13444
+ const render = () => {
13445
+ writeMedia(current.attrs);
13446
+ updateComponentProps(dom, props(current));
13447
+ };
13448
+ dom.addEventListener("click", (event) => {
13449
+ if (event.target.closest("button")) return;
13450
+ const position = getPos();
13451
+ if (!editor.isEditable || typeof position !== "number") return;
13452
+ editor.view.dispatch(editor.state.tr.setSelection(NodeSelection.create(editor.state.doc, position)));
13453
+ editor.view.focus();
13454
+ });
13455
+ image.addEventListener("resize", (event) => {
13456
+ const { width, height, phase } = event.detail;
13457
+ if (event.target !== dom || phase !== "commit" || !editor.isEditable) return;
13458
+ const position = getPos();
13459
+ if (typeof position !== "number" || editor.state.doc.nodeAt(position) !== current) return;
13460
+ if (width === current.attrs.width && height === current.attrs.height) return;
13461
+ editor.view.dispatch(closeHistory(editor.state.tr).setNodeMarkup(position, void 0, {
13462
+ ...current.attrs,
13463
+ width,
13464
+ height
13465
+ }));
13466
+ editor.view.dispatch(closeHistory(editor.state.tr));
13467
+ });
13468
+ editor.on("update", render);
12967
13469
  return {
12968
13470
  dom,
12969
13471
  update(next, nextDecorations) {
12970
- if (next.type !== current.value.type) return false;
12971
- current.value = next;
12972
- delivery.value = nextDecorations;
12973
- refresh();
13472
+ if (next.type !== current.type) return false;
13473
+ current = next;
13474
+ delivery = deliveryAttributes(nextDecorations);
13475
+ render();
12974
13476
  return true;
12975
13477
  },
12976
13478
  selectNode() {
12977
- selected.value = true;
13479
+ selected = true;
13480
+ render();
12978
13481
  },
12979
13482
  deselectNode() {
12980
- selected.value = false;
13483
+ selected = false;
13484
+ render();
12981
13485
  },
12982
13486
  stopEvent: (event) => event.target instanceof Element && Boolean(event.target.closest("[data-corner]")),
12983
13487
  ignoreMutation: (mutation) => mutation.type !== "selection",
12984
13488
  destroy() {
12985
- editor.off("update", refresh);
12986
- app.unmount();
13489
+ editor.off("update", render);
12987
13490
  }
12988
13491
  };
12989
13492
  };