spell-ui 0.8.6 → 0.8.8

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 (722) hide show
  1. package/README-components.md +14 -6
  2. package/README-frameworks.md +22 -12
  3. package/README-migrating.md +7 -6
  4. package/README-runtime.md +14 -13
  5. package/README-site.md +11 -11
  6. package/README-themes.md +38 -11
  7. package/README.md +61 -73
  8. package/dist/Dragging-CMZoLEWQ.js +169 -0
  9. package/dist/Dragging-CMZoLEWQ.js.map +1 -0
  10. package/dist/{MarkdownEngine-CbuT9Mjc.js → MarkdownEngine-CW1WGqNp.js} +122 -100
  11. package/dist/MarkdownEngine-CW1WGqNp.js.map +1 -0
  12. package/dist/{PrefStore-CeaTtjTz.js → PrefStore-Qv0e5y04.js} +22 -22
  13. package/dist/PrefStore-Qv0e5y04.js.map +1 -0
  14. package/dist/ScrollingRow-7n7Z-HIE.js +88 -0
  15. package/dist/ScrollingRow-7n7Z-HIE.js.map +1 -0
  16. package/dist/SitePages-CciwREek.js +51 -0
  17. package/dist/SitePages-CciwREek.js.map +1 -0
  18. package/dist/{SlottedItems-Ch0tzzlL.js → SlottedItems-Du3aJwG1.js} +22 -22
  19. package/dist/{SlottedItems-Ch0tzzlL.js.map → SlottedItems-Du3aJwG1.js.map} +1 -1
  20. package/dist/ThemeDraft-B7NPif4d.js +805 -0
  21. package/dist/ThemeDraft-B7NPif4d.js.map +1 -0
  22. package/dist/TreeMeasure-BVJeGb1L.js +42 -0
  23. package/dist/TreeMeasure-BVJeGb1L.js.map +1 -0
  24. package/dist/UIButton-DFEds67r.js +6 -0
  25. package/dist/UIButton-DFEds67r.js.map +1 -0
  26. package/dist/UIInput-BodVbUoQ.js +6 -0
  27. package/dist/UIInput-BodVbUoQ.js.map +1 -0
  28. package/dist/{UIKeys-DJF2TIKE.js → UIKeys-Rh_gUZjP.js} +10 -9
  29. package/dist/UIKeys-Rh_gUZjP.js.map +1 -0
  30. package/dist/UILabel-DgJUBzB_.js +6 -0
  31. package/dist/UILabel-DgJUBzB_.js.map +1 -0
  32. package/dist/UIMenu-zdcAtwTa.js +42 -0
  33. package/dist/UIMenu-zdcAtwTa.js.map +1 -0
  34. package/dist/{UIRuntime-BBuehGly.js → UIRuntime-KH309p5B.js} +398 -207
  35. package/dist/UIRuntime-KH309p5B.js.map +1 -0
  36. package/dist/_spell-element/DOMElement.d.ts +62 -5
  37. package/dist/_spell-element/MoveAndResize.d.ts +75 -0
  38. package/dist/_spell-element/UIComponent.d.ts +42 -0
  39. package/dist/_spell-element/elements.types.d.ts +47 -0
  40. package/dist/_spell-element/index.d.ts +1 -0
  41. package/dist/_spell-element/vocabulary.types.d.ts +34 -2
  42. package/dist/{runtime → _util}/Api.d.ts +14 -4
  43. package/dist/_util/Dragging.d.ts +148 -0
  44. package/dist/_util/ListSelection.d.ts +46 -0
  45. package/dist/{util → _util}/LoadOnce.d.ts +9 -1
  46. package/dist/_util/ReconnectingSocket.d.ts +51 -0
  47. package/dist/_util/diagram/DiagramColumns.d.ts +14 -0
  48. package/dist/_util/diagram/DiagramLayout.d.ts +119 -0
  49. package/dist/_util/diagram/DiagramSVG.d.ts +17 -0
  50. package/dist/_util/dom.d.ts +10 -0
  51. package/dist/_util/fetching.d.ts +92 -0
  52. package/dist/_util/measures/Dimension.d.ts +63 -0
  53. package/dist/_util/measures/MeasureSystem.d.ts +66 -0
  54. package/dist/_util/measures/dimensions.generated.d.ts +16 -0
  55. package/dist/_util/persist/ColorScheme.d.ts +6 -0
  56. package/dist/_util/persist/ServerPlace.d.ts +42 -0
  57. package/dist/_util/persist/WaitedOnPlace.d.ts +27 -0
  58. package/dist/_util/persist/persist.types.d.ts +21 -2
  59. package/dist/_util/timing.d.ts +10 -1
  60. package/dist/api.js +8 -7
  61. package/dist/api.js.map +1 -1
  62. package/dist/components/ComponentDefinitions.d.ts +29 -0
  63. package/dist/components/components.es.d.ts +13 -0
  64. package/dist/components/components.types.d.ts +113 -8
  65. package/dist/components/ui-accordion/UIAccordion.d.ts +1 -0
  66. package/dist/components/ui-accordion/UIAccordion.en.d.ts +1 -0
  67. package/dist/components/ui-action/UIAction.en.d.ts +5 -1
  68. package/dist/components/ui-ad/UIAd.d.ts +1 -0
  69. package/dist/components/ui-ad/UIAd.en.d.ts +1 -0
  70. package/dist/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
  71. package/dist/components/ui-breadcrumbs/UIBreadcrumb.en.d.ts +1 -0
  72. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
  73. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.en.d.ts +1 -0
  74. package/dist/components/ui-button/UIButton.d.ts +8 -3
  75. package/dist/components/ui-button/UIButton.en.d.ts +9 -4
  76. package/dist/components/ui-button/UIButton.es.d.ts +6 -0
  77. package/dist/components/ui-button/UIButton.fallback.d.ts +8 -3
  78. package/dist/components/ui-button/UIButtons.d.ts +1 -0
  79. package/dist/components/ui-button/UIButtons.en.d.ts +1 -0
  80. package/dist/components/ui-button/UIOr.d.ts +1 -0
  81. package/dist/components/ui-button/UIOr.en.d.ts +1 -0
  82. package/dist/components/ui-calendar/UICalendar.d.ts +6 -0
  83. package/dist/components/ui-calendar/UICalendar.en.d.ts +6 -0
  84. package/dist/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
  85. package/dist/components/ui-card/CardClicks.d.ts +40 -0
  86. package/dist/components/ui-card/UICard.d.ts +41 -0
  87. package/dist/components/ui-card/UICard.en.d.ts +49 -0
  88. package/dist/components/ui-card/UICard.es.d.ts +1 -0
  89. package/dist/components/ui-card/UICards.d.ts +31 -0
  90. package/dist/components/ui-card/UICards.en.d.ts +31 -0
  91. package/dist/components/ui-card/UICards.es.d.ts +8 -0
  92. package/dist/components/ui-checkbox/CheckControl.d.ts +7 -0
  93. package/dist/components/ui-checkbox/UICheckbox.d.ts +7 -0
  94. package/dist/components/ui-checkbox/UICheckbox.en.d.ts +7 -0
  95. package/dist/components/ui-checkbox/UICheckbox.es.d.ts +1 -0
  96. package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
  97. package/dist/components/ui-checkbox/UICheckbox.types.d.ts +5 -0
  98. package/dist/components/ui-checkbox/UIRadio.d.ts +8 -0
  99. package/dist/components/ui-checkbox/UIRadio.en.d.ts +6 -0
  100. package/dist/components/ui-code/UICode.en.d.ts +1 -0
  101. package/dist/components/ui-comment/UIComment.d.ts +1 -0
  102. package/dist/components/ui-comment/UIComment.en.d.ts +1 -0
  103. package/dist/components/ui-comment/UIComments.d.ts +1 -0
  104. package/dist/components/ui-comment/UIComments.en.d.ts +1 -0
  105. package/dist/components/ui-components/PackHotSwap.d.ts +13 -3
  106. package/dist/components/ui-components/UIComponents.d.ts +1 -0
  107. package/dist/components/ui-components/UIComponents.en.d.ts +1 -0
  108. package/dist/components/ui-container/UIContainer.d.ts +11 -0
  109. package/dist/components/ui-container/UIContainer.en.d.ts +7 -0
  110. package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
  111. package/dist/components/ui-diagram/UIDiagram.d.ts +268 -0
  112. package/dist/components/ui-diagram/UIDiagram.en.d.ts +106 -0
  113. package/dist/components/ui-diagram/UIDiagram.es.d.ts +37 -0
  114. package/dist/components/ui-diagram/UIDiagramNode.d.ts +98 -0
  115. package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +38 -0
  116. package/dist/components/ui-diagram/UIDiagramNode.es.d.ts +16 -0
  117. package/dist/components/ui-diagram/index.d.ts +8 -0
  118. package/dist/components/ui-dimension/UIDimension.d.ts +81 -0
  119. package/dist/components/ui-dimension/UIDimension.en.d.ts +54 -0
  120. package/dist/components/ui-dimension/UIDimension.es.d.ts +22 -0
  121. package/dist/components/ui-dimension/index.d.ts +2 -0
  122. package/dist/components/ui-dimmer/UIDimmer.d.ts +6 -1
  123. package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
  124. package/dist/components/ui-dimmer/UIDimmer.es.d.ts +1 -1
  125. package/dist/components/ui-divider/UIDivider.d.ts +2 -0
  126. package/dist/components/ui-divider/UIDivider.en.d.ts +2 -0
  127. package/dist/components/ui-divider/UIDivider.es.d.ts +1 -0
  128. package/dist/components/ui-dropdown/UIDropdown.d.ts +6 -0
  129. package/dist/components/ui-dropdown/UIDropdown.en.d.ts +6 -0
  130. package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
  131. package/dist/components/ui-embed/UIEmbed.d.ts +1 -0
  132. package/dist/components/ui-embed/UIEmbed.en.d.ts +1 -0
  133. package/dist/components/ui-emoji/UIEmoji.d.ts +1 -0
  134. package/dist/components/ui-emoji/UIEmoji.en.d.ts +1 -0
  135. package/dist/components/ui-example/UIExample.en.d.ts +4 -2
  136. package/dist/components/ui-example/UIExample.es.d.ts +3 -2
  137. package/dist/components/ui-feed/UIFeed.d.ts +1 -0
  138. package/dist/components/ui-feed/UIFeed.en.d.ts +1 -0
  139. package/dist/components/ui-feed/UIFeedEvent.d.ts +1 -0
  140. package/dist/components/ui-feed/UIFeedEvent.en.d.ts +1 -0
  141. package/dist/components/ui-flag/UIFlag.d.ts +1 -0
  142. package/dist/components/ui-flag/UIFlag.en.d.ts +1 -0
  143. package/dist/components/ui-flyout/UIFlyout.d.ts +1 -0
  144. package/dist/components/ui-flyout/UIFlyout.en.d.ts +1 -0
  145. package/dist/components/ui-form/FormBinding.d.ts +13 -1
  146. package/dist/components/ui-form/FormFields.d.ts +4 -4
  147. package/dist/components/ui-form/UIField.d.ts +30 -3
  148. package/dist/components/ui-form/UIField.en.d.ts +9 -0
  149. package/dist/components/ui-form/UIField.es.d.ts +6 -0
  150. package/dist/components/ui-form/UIFields.d.ts +1 -0
  151. package/dist/components/ui-form/UIFields.en.d.ts +1 -0
  152. package/dist/components/ui-form/UIForm.d.ts +15 -0
  153. package/dist/components/ui-form/UIForm.en.d.ts +6 -0
  154. package/dist/components/ui-form/UIRepeat.d.ts +1 -0
  155. package/dist/components/ui-form/UIRepeat.en.d.ts +1 -0
  156. package/dist/components/ui-form/index.d.ts +2 -1
  157. package/dist/components/ui-grid/UIColumn.d.ts +1 -0
  158. package/dist/components/ui-grid/UIColumn.en.d.ts +1 -0
  159. package/dist/components/ui-grid/UIGrid.d.ts +1 -0
  160. package/dist/components/ui-grid/UIGrid.en.d.ts +1 -0
  161. package/dist/components/ui-grid/UIRow.d.ts +1 -0
  162. package/dist/components/ui-grid/UIRow.en.d.ts +1 -0
  163. package/dist/components/ui-icon/UIIcon.d.ts +3 -2
  164. package/dist/components/ui-icon/UIIcon.en.d.ts +3 -2
  165. package/dist/components/ui-icon/UIIcons.d.ts +1 -0
  166. package/dist/components/ui-icon/UIIcons.en.d.ts +1 -0
  167. package/dist/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
  168. package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +6 -0
  169. package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
  170. package/dist/components/ui-image/UIImage.d.ts +34 -0
  171. package/dist/components/ui-image/UIImage.en.d.ts +23 -0
  172. package/dist/components/ui-image/UIImage.es.d.ts +2 -0
  173. package/dist/components/ui-image/UIImages.d.ts +1 -0
  174. package/dist/components/ui-image/UIImages.en.d.ts +1 -0
  175. package/dist/components/ui-include/UIInclude.d.ts +1 -0
  176. package/dist/components/ui-include/UIInclude.en.d.ts +1 -0
  177. package/dist/components/ui-input/TextControl.d.ts +7 -0
  178. package/dist/components/ui-input/UIInput.d.ts +22 -3
  179. package/dist/components/ui-input/UIInput.en.d.ts +9 -2
  180. package/dist/components/ui-input/UIInput.es.d.ts +2 -0
  181. package/dist/components/ui-input/UIInput.fallback.d.ts +9 -2
  182. package/dist/components/ui-input/UITextarea.d.ts +20 -0
  183. package/dist/components/ui-input/UITextarea.en.d.ts +15 -0
  184. package/dist/components/ui-input/UITextarea.es.d.ts +4 -0
  185. package/dist/components/ui-item/UIItem.d.ts +27 -4
  186. package/dist/components/ui-item/UIItem.en.d.ts +5 -1
  187. package/dist/components/ui-items/UIItems.d.ts +1 -0
  188. package/dist/components/ui-items/UIItems.en.d.ts +1 -0
  189. package/dist/components/ui-json/JsonChild.d.ts +30 -0
  190. package/dist/components/ui-json/UIJson.d.ts +128 -0
  191. package/dist/components/ui-json/UIJson.en.d.ts +71 -0
  192. package/dist/components/ui-json/UIJson.es.d.ts +12 -0
  193. package/dist/components/ui-json/index.d.ts +3 -0
  194. package/dist/components/ui-keys/UIKeys.d.ts +1 -0
  195. package/dist/components/ui-keys/UIKeys.en.d.ts +1 -0
  196. package/dist/components/ui-label/UILabel.d.ts +2 -0
  197. package/dist/components/ui-label/UILabel.en.d.ts +2 -0
  198. package/dist/components/ui-label/UILabel.es.d.ts +1 -0
  199. package/dist/components/ui-label/UILabels.d.ts +1 -0
  200. package/dist/components/ui-label/UILabels.en.d.ts +1 -0
  201. package/dist/components/ui-list/UIList.d.ts +2 -0
  202. package/dist/components/ui-list/UIList.en.d.ts +2 -0
  203. package/dist/components/ui-list/UIList.es.d.ts +1 -0
  204. package/dist/components/ui-loader/UILoader.d.ts +1 -0
  205. package/dist/components/ui-loader/UILoader.en.d.ts +1 -0
  206. package/dist/components/ui-markdown/MarkdownBox.d.ts +143 -0
  207. package/dist/components/ui-markdown/MarkdownEngine.d.ts +14 -2
  208. package/dist/components/ui-markdown/MarkdownFormats.d.ts +95 -0
  209. package/dist/components/ui-markdown/MarkdownSource.d.ts +57 -0
  210. package/dist/components/ui-markdown/UIMarkdown.d.ts +126 -6
  211. package/dist/components/ui-markdown/UIMarkdown.en.d.ts +111 -8
  212. package/dist/components/ui-markdown/UIMarkdown.es.d.ts +29 -1
  213. package/dist/components/ui-markdown/UIMarkdown.types.d.ts +26 -0
  214. package/dist/components/ui-menu/ScrollingRow.d.ts +79 -0
  215. package/dist/components/ui-menu/TitleFit.d.ts +3 -0
  216. package/dist/components/ui-menu/UIMenu.d.ts +97 -4
  217. package/dist/components/ui-menu/UIMenu.en.d.ts +50 -1
  218. package/dist/components/ui-menu/UIMenu.es.d.ts +4 -0
  219. package/dist/components/ui-message/UIMessage.d.ts +2 -0
  220. package/dist/components/ui-message/UIMessage.en.d.ts +2 -0
  221. package/dist/components/ui-message/UIMessage.es.d.ts +1 -0
  222. package/dist/components/ui-modal/UIModal.d.ts +1 -0
  223. package/dist/components/ui-modal/UIModal.en.d.ts +1 -0
  224. package/dist/components/ui-nag/UINag.d.ts +1 -0
  225. package/dist/components/ui-nag/UINag.en.d.ts +1 -0
  226. package/dist/components/ui-page/UIPage.d.ts +15 -0
  227. package/dist/components/ui-page/UIPage.en.d.ts +15 -0
  228. package/dist/components/ui-page/UIPage.es.d.ts +1 -0
  229. package/dist/components/ui-panel/UIPanel.d.ts +6 -0
  230. package/dist/components/ui-panel/UIPanel.en.d.ts +33 -20
  231. package/dist/components/ui-parts/UIActions.d.ts +1 -0
  232. package/dist/components/ui-parts/UIActions.en.d.ts +1 -0
  233. package/dist/components/ui-parts/UIAuthor.d.ts +1 -0
  234. package/dist/components/ui-parts/UIAuthor.en.d.ts +1 -0
  235. package/dist/components/ui-parts/UIAvatar.d.ts +1 -0
  236. package/dist/components/ui-parts/UIAvatar.en.d.ts +1 -0
  237. package/dist/components/ui-parts/UIContent.d.ts +1 -0
  238. package/dist/components/ui-parts/UIContent.en.d.ts +1 -0
  239. package/dist/components/ui-parts/UIDate.d.ts +1 -0
  240. package/dist/components/ui-parts/UIDate.en.d.ts +1 -0
  241. package/dist/components/ui-parts/UIDescription.d.ts +1 -0
  242. package/dist/components/ui-parts/UIDescription.en.d.ts +1 -0
  243. package/dist/components/ui-parts/UIDetail.d.ts +1 -0
  244. package/dist/components/ui-parts/UIDetail.en.d.ts +1 -0
  245. package/dist/components/ui-parts/UIExtra.d.ts +1 -0
  246. package/dist/components/ui-parts/UIExtra.en.d.ts +1 -0
  247. package/dist/components/ui-parts/UIHeader.d.ts +3 -1
  248. package/dist/components/ui-parts/UIHeader.en.d.ts +3 -1
  249. package/dist/components/ui-parts/UIMeta.d.ts +1 -0
  250. package/dist/components/ui-parts/UIMeta.en.d.ts +1 -0
  251. package/dist/components/ui-parts/UIParts.types.d.ts +15 -1
  252. package/dist/components/ui-parts/UISummary.d.ts +1 -0
  253. package/dist/components/ui-parts/UISummary.en.d.ts +1 -0
  254. package/dist/components/ui-parts/UITitle.d.ts +1 -0
  255. package/dist/components/ui-parts/UITitle.en.d.ts +1 -0
  256. package/dist/components/ui-parts/UIValue.d.ts +1 -0
  257. package/dist/components/ui-parts/UIValue.en.d.ts +1 -0
  258. package/dist/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
  259. package/dist/components/ui-placeholder/UIPlaceholder.en.d.ts +1 -0
  260. package/dist/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
  261. package/dist/components/ui-placeholder/UIPlaceholderHeader.en.d.ts +1 -0
  262. package/dist/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
  263. package/dist/components/ui-placeholder/UIPlaceholderImage.en.d.ts +1 -0
  264. package/dist/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
  265. package/dist/components/ui-placeholder/UIPlaceholderLine.en.d.ts +1 -0
  266. package/dist/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
  267. package/dist/components/ui-placeholder/UIPlaceholderParagraph.en.d.ts +1 -0
  268. package/dist/components/ui-popup/UIPopup.d.ts +30 -3
  269. package/dist/components/ui-popup/UIPopup.en.d.ts +7 -0
  270. package/dist/components/ui-popup/UIPopup.es.d.ts +1 -0
  271. package/dist/components/ui-progress/UIProgress.d.ts +2 -0
  272. package/dist/components/ui-progress/UIProgress.en.d.ts +2 -0
  273. package/dist/components/ui-progress/UIProgress.es.d.ts +1 -0
  274. package/dist/components/ui-property-editor/UIProperty.d.ts +132 -5
  275. package/dist/components/ui-property-editor/UIProperty.en.d.ts +11 -44
  276. package/dist/components/ui-property-editor/UIProperty.es.d.ts +4 -0
  277. package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +38 -0
  278. package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
  279. package/dist/components/ui-property-editor/UIPropertyEditor.es.d.ts +4 -0
  280. package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +33 -0
  281. package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +12 -0
  282. package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +2 -0
  283. package/dist/components/ui-property-editor/UIPropertyGroup.es.d.ts +9 -0
  284. package/dist/components/ui-property-editor/index.d.ts +1 -0
  285. package/dist/components/ui-quote/UIQuote.d.ts +1 -0
  286. package/dist/components/ui-quote/UIQuote.en.d.ts +1 -0
  287. package/dist/components/ui-rail/UIRail.d.ts +1 -0
  288. package/dist/components/ui-rail/UIRail.en.d.ts +1 -0
  289. package/dist/components/ui-rating/UIRating.d.ts +6 -0
  290. package/dist/components/ui-rating/UIRating.en.d.ts +6 -0
  291. package/dist/components/ui-rating/UIRating.fallback.d.ts +6 -0
  292. package/dist/components/ui-reveal/UIReveal.d.ts +1 -0
  293. package/dist/components/ui-reveal/UIReveal.en.d.ts +1 -0
  294. package/dist/components/ui-root/UIRoot.d.ts +18 -3
  295. package/dist/components/ui-root/UIRoot.en.d.ts +15 -0
  296. package/dist/components/ui-root/UIRoot.es.d.ts +1 -0
  297. package/dist/components/ui-search/UISearch.d.ts +48 -7
  298. package/dist/components/ui-search/UISearch.en.d.ts +13 -1
  299. package/dist/components/ui-search/UISearch.es.d.ts +1 -0
  300. package/dist/components/ui-search/UISearch.fallback.d.ts +13 -1
  301. package/dist/components/ui-section/UISection.d.ts +22 -1
  302. package/dist/components/ui-section/UISection.en.d.ts +10 -0
  303. package/dist/components/ui-section/UISection.es.d.ts +1 -0
  304. package/dist/components/ui-section/UISections.d.ts +1 -0
  305. package/dist/components/ui-section/UISections.en.d.ts +1 -0
  306. package/dist/components/ui-segment/UISegment.d.ts +2 -0
  307. package/dist/components/ui-segment/UISegment.en.d.ts +2 -0
  308. package/dist/components/ui-segment/UISegment.es.d.ts +1 -0
  309. package/dist/components/ui-segment/UISegments.d.ts +1 -0
  310. package/dist/components/ui-segment/UISegments.en.d.ts +1 -0
  311. package/dist/components/ui-select/UISelect.d.ts +6 -0
  312. package/dist/components/ui-select/UISelect.en.d.ts +6 -0
  313. package/dist/components/ui-select/UISelect.fallback.d.ts +6 -0
  314. package/dist/components/ui-shape/UIShape.d.ts +23 -2
  315. package/dist/components/ui-shape/UIShape.en.d.ts +8 -0
  316. package/dist/components/ui-shape/UIShape.es.d.ts +1 -0
  317. package/dist/components/ui-shape/UISide.d.ts +4 -0
  318. package/dist/components/ui-shape/UISide.en.d.ts +4 -0
  319. package/dist/components/ui-sidebar/UIPushable.d.ts +1 -0
  320. package/dist/components/ui-sidebar/UIPushable.en.d.ts +1 -0
  321. package/dist/components/ui-sidebar/UIPusher.d.ts +1 -0
  322. package/dist/components/ui-sidebar/UIPusher.en.d.ts +1 -0
  323. package/dist/components/ui-sidebar/UISidebar.d.ts +1 -0
  324. package/dist/components/ui-sidebar/UISidebar.en.d.ts +1 -0
  325. package/dist/components/ui-sides/UISides.d.ts +209 -0
  326. package/dist/components/ui-sides/UISides.en.d.ts +122 -0
  327. package/dist/components/ui-sides/UISides.es.d.ts +30 -0
  328. package/dist/components/ui-sides/UISides.fallback.d.ts +134 -0
  329. package/dist/components/ui-sides/index.d.ts +2 -0
  330. package/dist/components/ui-site-nav/SitePages.d.ts +53 -0
  331. package/dist/components/ui-site-nav/UISiteNav.d.ts +207 -0
  332. package/dist/components/ui-site-nav/UISiteNav.en.d.ts +87 -0
  333. package/dist/components/ui-site-nav/UISiteNav.es.d.ts +29 -0
  334. package/dist/components/ui-site-nav/index.d.ts +1 -0
  335. package/dist/components/ui-site-tabs/UISiteTabs.d.ts +126 -0
  336. package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +49 -0
  337. package/dist/components/ui-site-tabs/UISiteTabs.es.d.ts +18 -0
  338. package/dist/components/ui-site-tabs/index.d.ts +1 -0
  339. package/dist/components/ui-slider/UISlider.d.ts +7 -0
  340. package/dist/components/ui-slider/UISlider.en.d.ts +7 -0
  341. package/dist/components/ui-slider/UISlider.es.d.ts +1 -0
  342. package/dist/components/ui-slider/UISlider.fallback.d.ts +7 -0
  343. package/dist/components/ui-space/UISpace.d.ts +1 -0
  344. package/dist/components/ui-space/UISpace.en.d.ts +1 -0
  345. package/dist/components/ui-split-panel/UISplitPanel.d.ts +175 -0
  346. package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +74 -0
  347. package/dist/components/ui-split-panel/UISplitPanel.es.d.ts +25 -0
  348. package/dist/components/ui-split-panel/index.d.ts +2 -0
  349. package/dist/components/ui-stack/UIStack.d.ts +31 -5
  350. package/dist/components/ui-stack/UIStack.en.d.ts +15 -3
  351. package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
  352. package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
  353. package/dist/components/ui-statistic/UIStatistics.d.ts +1 -0
  354. package/dist/components/ui-statistic/UIStatistics.en.d.ts +1 -0
  355. package/dist/components/ui-step/UIStep.d.ts +1 -0
  356. package/dist/components/ui-step/UIStep.en.d.ts +1 -0
  357. package/dist/components/ui-step/UISteps.d.ts +1 -0
  358. package/dist/components/ui-step/UISteps.en.d.ts +1 -0
  359. package/dist/components/ui-sticky/UISticky.d.ts +4 -0
  360. package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
  361. package/dist/components/ui-tab/UITab.d.ts +8 -0
  362. package/dist/components/ui-tab/UITab.en.d.ts +1 -0
  363. package/dist/components/ui-tab/UITabs.d.ts +107 -16
  364. package/dist/components/ui-tab/UITabs.en.d.ts +40 -1
  365. package/dist/components/ui-tab/UITabs.es.d.ts +4 -0
  366. package/dist/components/ui-table/TableEditing.d.ts +77 -0
  367. package/dist/components/ui-table/UICell.d.ts +1 -0
  368. package/dist/components/ui-table/UICell.en.d.ts +1 -0
  369. package/dist/components/ui-table/UITable.d.ts +145 -5
  370. package/dist/components/ui-table/UITable.en.d.ts +19 -0
  371. package/dist/components/ui-table/UITable.es.d.ts +3 -0
  372. package/dist/components/ui-terms/UITerm.d.ts +1 -0
  373. package/dist/components/ui-terms/UITerm.en.d.ts +1 -0
  374. package/dist/components/ui-terms/UITerms.d.ts +1 -0
  375. package/dist/components/ui-terms/UITerms.en.d.ts +1 -0
  376. package/dist/components/ui-text/UILink.d.ts +11 -0
  377. package/dist/components/ui-text/UILink.en.d.ts +4 -0
  378. package/dist/components/ui-text/UIText.d.ts +7 -0
  379. package/dist/components/ui-text/UIText.en.d.ts +7 -0
  380. package/dist/components/ui-text/UIText.es.d.ts +2 -0
  381. package/dist/components/ui-theme-editor/SavedTheme.d.ts +55 -43
  382. package/dist/components/ui-theme-editor/ThemeDraft.d.ts +15 -0
  383. package/dist/components/ui-theme-editor/UIColorChip.d.ts +1 -0
  384. package/dist/components/ui-theme-editor/UIColorChip.en.d.ts +1 -0
  385. package/dist/components/ui-theme-editor/UIThemeEditor.d.ts +157 -26
  386. package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +79 -6
  387. package/dist/components/ui-theme-editor/UIThemeEditor.es.d.ts +20 -2
  388. package/dist/components/ui-theme-editor/UIThemeEditor.types.d.ts +0 -2
  389. package/dist/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
  390. package/dist/components/ui-theme-editor/UIThemeToken.en.d.ts +1 -0
  391. package/dist/components/ui-theme-menu/HueDropdown.d.ts +47 -0
  392. package/dist/components/ui-theme-menu/ThemeMenu.d.ts +18 -7
  393. package/dist/components/ui-theme-menu/ThemePreference.d.ts +145 -36
  394. package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +118 -7
  395. package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +82 -2
  396. package/dist/components/ui-theme-menu/UIThemeMenu.es.d.ts +21 -1
  397. package/dist/components/ui-theme-menu/UIThemeMenu.types.d.ts +36 -8
  398. package/dist/components/ui-theme-menu/index.d.ts +2 -1
  399. package/dist/components/ui-toast/UIToast.d.ts +1 -0
  400. package/dist/components/ui-toast/UIToast.en.d.ts +1 -0
  401. package/dist/components/ui-toc/UIToc.d.ts +1 -0
  402. package/dist/components/ui-toc/UIToc.en.d.ts +1 -0
  403. package/dist/components/ui-toolbar/UIToolbar.d.ts +13 -10
  404. package/dist/components/ui-toolbar/UIToolbar.en.d.ts +138 -84
  405. package/dist/components/ui-toolbar/UIToolbar.es.d.ts +2 -0
  406. package/dist/components/ui-transition/UITransition.d.ts +1 -0
  407. package/dist/components/ui-transition/UITransition.en.d.ts +1 -0
  408. package/dist/components/ui-tree/UITree.d.ts +162 -0
  409. package/dist/components/ui-tree/UITree.en.d.ts +88 -0
  410. package/dist/components/ui-tree/UITree.es.d.ts +35 -0
  411. package/dist/components/ui-tree/UITreeItem.d.ts +204 -0
  412. package/dist/components/ui-tree/UITreeItem.en.d.ts +142 -0
  413. package/dist/components/ui-tree/UITreeItem.es.d.ts +32 -0
  414. package/dist/components/ui-tree/index.d.ts +3 -0
  415. package/dist/components/ui-tree-diagram/TreeData.d.ts +3 -12
  416. package/dist/components/ui-tree-diagram/TreeLayout.d.ts +54 -21
  417. package/dist/components/ui-tree-diagram/TreeMeasure.d.ts +36 -0
  418. package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +152 -27
  419. package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +47 -7
  420. package/dist/components/ui-tree-diagram/UITreeDiagram.es.d.ts +12 -1
  421. package/dist/components/ui-tree-diagram/UITreeDiagram.types.d.ts +66 -21
  422. package/dist/components/ui-tree-diagram/UITreeNode.d.ts +148 -0
  423. package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +69 -0
  424. package/dist/components/ui-tree-diagram/UITreeNode.es.d.ts +21 -0
  425. package/dist/components/ui-tree-diagram/index.d.ts +4 -2
  426. package/dist/components/ui-video/UIAudio.d.ts +1 -0
  427. package/dist/components/ui-video/UIAudio.en.d.ts +1 -0
  428. package/dist/components/ui-video/UIVideo.d.ts +1 -0
  429. package/dist/components/ui-video/UIVideo.en.d.ts +1 -0
  430. package/dist/components/ui-visibility/UIVisibility.d.ts +1 -0
  431. package/dist/components/ui-visibility/UIVisibility.en.d.ts +1 -0
  432. package/dist/components/ui-zoom/UIZoom.d.ts +1 -0
  433. package/dist/components/ui-zoom/UIZoom.en.d.ts +1 -0
  434. package/dist/{components.es-DmLzT-Bq.js → components.es-BOa_7gFF.js} +498 -109
  435. package/dist/components.es-BOa_7gFF.js.map +1 -0
  436. package/dist/core.d.ts +3 -1
  437. package/dist/core.js +1082 -511
  438. package/dist/core.js.map +1 -1
  439. package/dist/crisp-VfYZlTph.js +6 -0
  440. package/dist/{crisp-CoZRRDuQ.js.map → crisp-VfYZlTph.js.map} +1 -1
  441. package/dist/docs-components/index.d.ts +1 -0
  442. package/dist/docs-components/ui-docs-index/UIDocsIndex.d.ts +89 -0
  443. package/dist/docs-components/ui-docs-index/UIDocsIndex.en.d.ts +43 -0
  444. package/dist/docs-components/ui-docs-index/index.d.ts +2 -0
  445. package/dist/docs-components/ui-docs-nav/UIDocsNav.d.ts +54 -87
  446. package/dist/docs-components/ui-docs-nav/UIDocsNav.types.d.ts +2 -29
  447. package/dist/docs-components/ui-docs-search/SearchIndex.d.ts +8 -2
  448. package/dist/docs-components/ui-docs-search/UIDocsSearch.d.ts +10 -0
  449. package/dist/docs-components/ui-docs-search/UIDocsSearch.en.d.ts +5 -0
  450. package/dist/elements/AddressParameter.d.ts +87 -0
  451. package/dist/elements/DOMFormControl.d.ts +5 -0
  452. package/dist/elements/FormComponent.d.ts +32 -0
  453. package/dist/elements/LoadableBody.d.ts +6 -1
  454. package/dist/elements/LoadableComponent.d.ts +10 -1
  455. package/dist/elements/RootSettings.d.ts +43 -6
  456. package/dist/elements/SpellUISettings.d.ts +1 -0
  457. package/dist/elements/StickyWatch.d.ts +20 -0
  458. package/dist/elements/elements.types.d.ts +15 -0
  459. package/dist/elements/index.d.ts +2 -0
  460. package/dist/forms.js +93 -63
  461. package/dist/forms.js.map +1 -1
  462. package/dist/fruity-BRVlgJZd.js +6 -0
  463. package/dist/fruity-BRVlgJZd.js.map +1 -0
  464. package/dist/{fruity.theme-BJcMiPl1.js → fruity.theme-CbC7Jyvk.js} +2 -2
  465. package/dist/fruity.theme-CbC7Jyvk.js.map +1 -0
  466. package/dist/glass-x9tbbwVq.js +6 -0
  467. package/dist/glass-x9tbbwVq.js.map +1 -0
  468. package/dist/glass.theme-24wY2wH9.js +6 -0
  469. package/dist/glass.theme-24wY2wH9.js.map +1 -0
  470. package/dist/hot.js +530 -24
  471. package/dist/hot.js.map +1 -1
  472. package/dist/index.d.ts +8 -0
  473. package/dist/index.js +91 -81
  474. package/dist/jsx.d.ts +21149 -10377
  475. package/dist/matrix-QY2gWbJ0.js +6 -0
  476. package/dist/{matrix-CqA59hiF.js.map → matrix-QY2gWbJ0.js.map} +1 -1
  477. package/dist/{matrix.theme-jqQZjcq3.js → matrix.theme-_8xtwhDq.js} +2 -2
  478. package/dist/matrix.theme-_8xtwhDq.js.map +1 -0
  479. package/dist/midnight-BxlTQSfw.js +6 -0
  480. package/dist/{midnight-BnoVOrhC.js.map → midnight-BxlTQSfw.js.map} +1 -1
  481. package/dist/mockup-83ELBuVr.js +6 -0
  482. package/dist/mockup-83ELBuVr.js.map +1 -0
  483. package/dist/mockup.theme-DmpBgGBl.js +6 -0
  484. package/dist/mockup.theme-DmpBgGBl.js.map +1 -0
  485. package/dist/paper-M61nUilz.js +6 -0
  486. package/dist/{paper-CynH8ZuT.js.map → paper-M61nUilz.js.map} +1 -1
  487. package/dist/persist.types-D2m6wD-S.js +9 -0
  488. package/dist/persist.types-D2m6wD-S.js.map +1 -0
  489. package/dist/pop-CxXfytjk.js +6 -0
  490. package/dist/{pop-D2i9V_rG.js.map → pop-CxXfytjk.js.map} +1 -1
  491. package/dist/runtime/DataTooltips.d.ts +75 -0
  492. package/dist/runtime/PropertyControls.d.ts +15 -1
  493. package/dist/runtime/Sources.d.ts +16 -4
  494. package/dist/runtime/Styles.d.ts +11 -0
  495. package/dist/runtime/Themes.d.ts +10 -4
  496. package/dist/runtime/UIRuntime.d.ts +4 -1
  497. package/dist/runtime/index.d.ts +1 -1
  498. package/dist/runtime/runtime.types.d.ts +18 -85
  499. package/dist/spell-By5Y3jKP.js +6 -0
  500. package/dist/{spell-BFtLICm7.js.map → spell-By5Y3jKP.js.map} +1 -1
  501. package/dist/{spell.theme-B7AU7SQX.js → spell.theme-DxGj7qHx.js} +2 -2
  502. package/dist/spell.theme-DxGj7qHx.js.map +1 -0
  503. package/dist/styles/CodeThemeFile.d.ts +73 -0
  504. package/dist/styles/StyleGenerator.d.ts +6 -0
  505. package/dist/styles/styles.en.d.ts +141 -3
  506. package/dist/styles/styles.types.d.ts +2 -0
  507. package/dist/{styles.en-RLpYiO5_.js → styles.en-CUUxNwHo.js} +71 -14
  508. package/dist/styles.en-CUUxNwHo.js.map +1 -0
  509. package/dist/styles.js +13 -13
  510. package/dist/styles.js.map +1 -1
  511. package/dist/ui-accordion.js +54 -53
  512. package/dist/ui-accordion.js.map +1 -1
  513. package/dist/ui-action.js +20 -19
  514. package/dist/ui-action.js.map +1 -1
  515. package/dist/ui-ad.js +5 -4
  516. package/dist/ui-ad.js.map +1 -1
  517. package/dist/ui-breadcrumbs.js +15 -13
  518. package/dist/ui-breadcrumbs.js.map +1 -1
  519. package/dist/ui-button.js +132 -125
  520. package/dist/ui-button.js.map +1 -1
  521. package/dist/ui-calendar.js +208 -206
  522. package/dist/ui-calendar.js.map +1 -1
  523. package/dist/ui-card.js +260 -98
  524. package/dist/ui-card.js.map +1 -1
  525. package/dist/ui-checkbox.js +95 -81
  526. package/dist/ui-checkbox.js.map +1 -1
  527. package/dist/ui-code.js +25 -24
  528. package/dist/ui-code.js.map +1 -1
  529. package/dist/ui-comment.js +14 -12
  530. package/dist/ui-comment.js.map +1 -1
  531. package/dist/ui-components.js +7 -6
  532. package/dist/ui-components.js.map +1 -1
  533. package/dist/ui-container.js +24 -12
  534. package/dist/ui-container.js.map +1 -1
  535. package/dist/ui-diagram.js +1328 -0
  536. package/dist/ui-diagram.js.map +1 -0
  537. package/dist/ui-dimension.js +779 -0
  538. package/dist/ui-dimension.js.map +1 -0
  539. package/dist/ui-dimmer.js +36 -34
  540. package/dist/ui-dimmer.js.map +1 -1
  541. package/dist/ui-divider.js +7 -5
  542. package/dist/ui-divider.js.map +1 -1
  543. package/dist/ui-dropdown.js +107 -105
  544. package/dist/ui-dropdown.js.map +1 -1
  545. package/dist/ui-embed.js +36 -35
  546. package/dist/ui-embed.js.map +1 -1
  547. package/dist/ui-emoji.js +10 -9
  548. package/dist/ui-emoji.js.map +1 -1
  549. package/dist/ui-example.js +63 -61
  550. package/dist/ui-example.js.map +1 -1
  551. package/dist/ui-feed.js +12 -10
  552. package/dist/ui-feed.js.map +1 -1
  553. package/dist/ui-flag.js +10 -9
  554. package/dist/ui-flag.js.map +1 -1
  555. package/dist/ui-flyout.js +7 -6
  556. package/dist/ui-flyout.js.map +1 -1
  557. package/dist/ui-form.js +244 -162
  558. package/dist/ui-form.js.map +1 -1
  559. package/dist/ui-grid.js +21 -18
  560. package/dist/ui-grid.js.map +1 -1
  561. package/dist/ui-icon-picker.js +46 -44
  562. package/dist/ui-icon-picker.js.map +1 -1
  563. package/dist/ui-icon.js +17 -14
  564. package/dist/ui-icon.js.map +1 -1
  565. package/dist/ui-image.js +93 -55
  566. package/dist/ui-image.js.map +1 -1
  567. package/dist/ui-include.js +18 -17
  568. package/dist/ui-include.js.map +1 -1
  569. package/dist/ui-input.js +154 -112
  570. package/dist/ui-input.js.map +1 -1
  571. package/dist/ui-item.js +152 -102
  572. package/dist/ui-item.js.map +1 -1
  573. package/dist/ui-items.js +9 -8
  574. package/dist/ui-items.js.map +1 -1
  575. package/dist/ui-json.js +115 -0
  576. package/dist/ui-json.js.map +1 -0
  577. package/dist/ui-keys.js +1 -1
  578. package/dist/ui-label.js +18 -15
  579. package/dist/ui-label.js.map +1 -1
  580. package/dist/ui-list.js +7 -5
  581. package/dist/ui-list.js.map +1 -1
  582. package/dist/ui-loader.js +7 -6
  583. package/dist/ui-loader.js.map +1 -1
  584. package/dist/ui-markdown.js +975 -83
  585. package/dist/ui-markdown.js.map +1 -1
  586. package/dist/ui-menu.js +329 -196
  587. package/dist/ui-menu.js.map +1 -1
  588. package/dist/ui-message.js +20 -18
  589. package/dist/ui-message.js.map +1 -1
  590. package/dist/ui-modal.js +46 -45
  591. package/dist/ui-modal.js.map +1 -1
  592. package/dist/ui-nag.js +19 -18
  593. package/dist/ui-nag.js.map +1 -1
  594. package/dist/ui-page.js +8 -7
  595. package/dist/ui-page.js.map +1 -1
  596. package/dist/ui-panel.js +28 -17
  597. package/dist/ui-panel.js.map +1 -1
  598. package/dist/ui-parts.js +66 -52
  599. package/dist/ui-parts.js.map +1 -1
  600. package/dist/ui-placeholder.js +21 -16
  601. package/dist/ui-placeholder.js.map +1 -1
  602. package/dist/ui-popup.js +113 -84
  603. package/dist/ui-popup.js.map +1 -1
  604. package/dist/ui-progress.js +9 -7
  605. package/dist/ui-progress.js.map +1 -1
  606. package/dist/ui-property-editor.js +706 -203
  607. package/dist/ui-property-editor.js.map +1 -1
  608. package/dist/ui-quote.js +5 -4
  609. package/dist/ui-quote.js.map +1 -1
  610. package/dist/ui-rail.js +5 -4
  611. package/dist/ui-rail.js.map +1 -1
  612. package/dist/ui-rating.js +31 -29
  613. package/dist/ui-rating.js.map +1 -1
  614. package/dist/ui-reveal.js +7 -6
  615. package/dist/ui-reveal.js.map +1 -1
  616. package/dist/ui-root.js +324 -158
  617. package/dist/ui-root.js.map +1 -1
  618. package/dist/ui-search.js +210 -168
  619. package/dist/ui-search.js.map +1 -1
  620. package/dist/ui-section.js +124 -92
  621. package/dist/ui-section.js.map +1 -1
  622. package/dist/ui-segment.js +15 -12
  623. package/dist/ui-segment.js.map +1 -1
  624. package/dist/ui-select.js +83 -81
  625. package/dist/ui-select.js.map +1 -1
  626. package/dist/ui-shape.js +86 -58
  627. package/dist/ui-shape.js.map +1 -1
  628. package/dist/ui-sidebar.js +59 -56
  629. package/dist/ui-sidebar.js.map +1 -1
  630. package/dist/ui-sides.js +325 -0
  631. package/dist/ui-sides.js.map +1 -0
  632. package/dist/ui-site-nav.js +329 -0
  633. package/dist/ui-site-nav.js.map +1 -0
  634. package/dist/ui-site-tabs.js +177 -0
  635. package/dist/ui-site-tabs.js.map +1 -0
  636. package/dist/ui-slider.js +84 -81
  637. package/dist/ui-slider.js.map +1 -1
  638. package/dist/ui-space.js +7 -6
  639. package/dist/ui-space.js.map +1 -1
  640. package/dist/ui-split-panel.js +298 -0
  641. package/dist/ui-split-panel.js.map +1 -0
  642. package/dist/ui-stack.js +47 -23
  643. package/dist/ui-stack.js.map +1 -1
  644. package/dist/ui-statistic.js +15 -13
  645. package/dist/ui-statistic.js.map +1 -1
  646. package/dist/ui-step.js +31 -29
  647. package/dist/ui-step.js.map +1 -1
  648. package/dist/ui-sticky.js +7 -6
  649. package/dist/ui-sticky.js.map +1 -1
  650. package/dist/ui-tab.js +230 -138
  651. package/dist/ui-tab.js.map +1 -1
  652. package/dist/ui-table.js +724 -162
  653. package/dist/ui-table.js.map +1 -1
  654. package/dist/ui-terms.js +12 -10
  655. package/dist/ui-terms.js.map +1 -1
  656. package/dist/ui-text.js +53 -28
  657. package/dist/ui-text.js.map +1 -1
  658. package/dist/ui-theme-editor.js +1018 -1545
  659. package/dist/ui-theme-editor.js.map +1 -1
  660. package/dist/ui-theme-menu-CuIjr8Ou.js +1493 -0
  661. package/dist/ui-theme-menu-CuIjr8Ou.js.map +1 -0
  662. package/dist/ui-toast.js +45 -44
  663. package/dist/ui-toast.js.map +1 -1
  664. package/dist/ui-toc.js +75 -74
  665. package/dist/ui-toc.js.map +1 -1
  666. package/dist/ui-toolbar.js +51 -73
  667. package/dist/ui-toolbar.js.map +1 -1
  668. package/dist/ui-transition.js +12 -11
  669. package/dist/ui-transition.js.map +1 -1
  670. package/dist/ui-tree-diagram.js +676 -197
  671. package/dist/ui-tree-diagram.js.map +1 -1
  672. package/dist/ui-tree.js +625 -0
  673. package/dist/ui-tree.js.map +1 -0
  674. package/dist/ui-video.js +13 -11
  675. package/dist/ui-video.js.map +1 -1
  676. package/dist/ui-visibility.js +26 -25
  677. package/dist/ui-visibility.js.map +1 -1
  678. package/dist/ui-zoom.js +79 -78
  679. package/dist/ui-zoom.js.map +1 -1
  680. package/dist/util/TopLayerTip.d.ts +28 -0
  681. package/dist/util/index.d.ts +5 -2
  682. package/dist/vocabulary/DefaultValues.d.ts +34 -0
  683. package/dist/vocabulary/SharedVocabulary.d.ts +4 -0
  684. package/dist/vocabulary/SharedVocabulary.es.d.ts +7 -0
  685. package/dist/vocabulary/ValueSets.d.ts +18 -0
  686. package/dist/vocabulary/Vocabulary.d.ts +1 -0
  687. package/dist/vocabulary/defaults.generated.d.ts +6 -0
  688. package/dist/vocabulary/index.d.ts +1 -0
  689. package/package.json +1 -1
  690. package/dist/MarkdownEngine-CbuT9Mjc.js.map +0 -1
  691. package/dist/PrefStore-CeaTtjTz.js.map +0 -1
  692. package/dist/UIButton-XkfGqgh6.js +0 -6
  693. package/dist/UIButton-XkfGqgh6.js.map +0 -1
  694. package/dist/UIInput-BUudZstW.js +0 -6
  695. package/dist/UIInput-BUudZstW.js.map +0 -1
  696. package/dist/UIKeys-DJF2TIKE.js.map +0 -1
  697. package/dist/UILabel-C1jy3Yl8.js +0 -6
  698. package/dist/UILabel-C1jy3Yl8.js.map +0 -1
  699. package/dist/UIMenu-Btd-8V3A.js +0 -42
  700. package/dist/UIMenu-Btd-8V3A.js.map +0 -1
  701. package/dist/UIRuntime-BBuehGly.js.map +0 -1
  702. package/dist/components.es-DmLzT-Bq.js.map +0 -1
  703. package/dist/crisp-CoZRRDuQ.js +0 -6
  704. package/dist/fruity-CQFYeRlh.js +0 -6
  705. package/dist/fruity-CQFYeRlh.js.map +0 -1
  706. package/dist/fruity.theme-BJcMiPl1.js.map +0 -1
  707. package/dist/glass-CAfW11kL.js +0 -6
  708. package/dist/glass-CAfW11kL.js.map +0 -1
  709. package/dist/glass.theme-DQcBbtCW.js +0 -6
  710. package/dist/glass.theme-DQcBbtCW.js.map +0 -1
  711. package/dist/matrix-CqA59hiF.js +0 -6
  712. package/dist/matrix.theme-jqQZjcq3.js.map +0 -1
  713. package/dist/midnight-BnoVOrhC.js +0 -6
  714. package/dist/paper-CynH8ZuT.js +0 -6
  715. package/dist/persist.types-CsZxS8TG.js +0 -9
  716. package/dist/persist.types-CsZxS8TG.js.map +0 -1
  717. package/dist/pop-D2i9V_rG.js +0 -6
  718. package/dist/spell-BFtLICm7.js +0 -6
  719. package/dist/spell.theme-B7AU7SQX.js.map +0 -1
  720. package/dist/styles.en-RLpYiO5_.js.map +0 -1
  721. package/dist/ui-theme-menu-DyKZygpV.js +0 -921
  722. package/dist/ui-theme-menu-DyKZygpV.js.map +0 -1
@@ -1,14 +1,476 @@
1
1
  import "./rolldown-runtime-CYGlBXrH.js";
2
- import { Bt as e, DOMLoadableElement as t, Ft as n, It as r, LoadableComponent as i, Lt as a, NodeType as o, Rt as s, UI as c, Vt as l, at as ee, ft as te, mt as ne, onChange as u, once as d, proto as re, protoMerged as f, pt as p, state as m, untracked as h, ut as ie, whileConnected as ae, zt as g } from "./core.js";
2
+ import { Bt as e, DOMLoadableElement as t, Ht as n, LoadableComponent as r, Lt as i, NodeType as a, Rt as o, SourceEvent as s, UI as c, Ut as l, Vt as u, after as d, cssState as f, dt as ee, ht as te, mt as ne, onChange as p, once as re, ot as ie, proto as ae, protoMerged as oe, pt as se, state as m, untracked as h, whileConnected as ce, zt as g } from "./core.js";
3
+ import "./ui-button.js";
4
+ import { t as _ } from "./PrefStore-Qv0e5y04.js";
3
5
  import "./ui-loader.js";
4
6
  import "./ui-message.js";
7
+ import "./ui-select.js";
5
8
  import "./ui-code.js";
6
- import { For as oe, Show as se } from "solid-js";
7
- import { addEvent as _, className as ce, createComponent as v, delegateEvents as le, effect as y, insert as b, memo as x, readShallow as S, ref as C, setAttribute as w, template as T } from "@solidjs/web";
8
- //#region src/components/ui-markdown/MarkdownRenderer.ts
9
- var E, ue = [d], D;
10
- E = [d];
11
- var O = class _MarkdownRenderer {
9
+ import { For as le, Show as ue } from "solid-js";
10
+ import { addEvent as v, className as de, createComponent as y, delegateEvents as fe, effect as b, insert as pe, memo as me, readShallow as he, ref as x, setAttribute as S, template as C } from "@solidjs/web";
11
+ //#region src/components/ui-markdown/MarkdownFormats.ts
12
+ var w = class MarkdownFormats {
13
+ static toggle(e, t) {
14
+ let { text: n } = e, { start: r, end: i } = e.start === e.end ? MarkdownFormats.wordAt(e) : e;
15
+ if (r === i) return {
16
+ text: n.slice(0, r) + t + t + n.slice(i),
17
+ start: r + t.length,
18
+ end: r + t.length
19
+ };
20
+ let a = t.length, isWrapped = (e, r) => n.slice(e - a, e) === t && n.slice(r, r + a) === t && (t !== "*" || n[e - a - 1] !== "*" && n[r + a] !== "*" || MarkdownFormats.isTriple(n, e, r));
21
+ if (isWrapped(r, i)) return {
22
+ text: n.slice(0, r - a) + n.slice(r, i) + n.slice(i + a),
23
+ start: r - a,
24
+ end: i - a
25
+ };
26
+ let o = n.slice(r, i);
27
+ if (o.length > 2 * a && o.startsWith(t) && o.endsWith(t)) {
28
+ let e = o.slice(a, -a);
29
+ return {
30
+ text: n.slice(0, r) + e + n.slice(i),
31
+ start: r,
32
+ end: r + e.length
33
+ };
34
+ }
35
+ for (; r < i && /\s/.test(n[r]);) r++;
36
+ for (; i > r && /\s/.test(n[i - 1]);) i--;
37
+ let s = t + n.slice(r, i) + t;
38
+ return {
39
+ text: n.slice(0, r) + s + n.slice(i),
40
+ start: r + a,
41
+ end: i + a
42
+ };
43
+ }
44
+ static link(e, t) {
45
+ let { text: n } = e, r = MarkdownFormats.linkAt(n, e.start);
46
+ if (r) {
47
+ let e = t ? `[${r.words}](${t})` : r.words, i = r.start + +!!t;
48
+ return {
49
+ text: n.slice(0, r.start) + e + n.slice(r.end),
50
+ start: i,
51
+ end: i + r.words.length
52
+ };
53
+ }
54
+ if (!t) return e;
55
+ let i = n.slice(e.start, e.end) || t, a = `[${i}](${t})`;
56
+ return {
57
+ text: n.slice(0, e.start) + a + n.slice(e.end),
58
+ start: e.start + 1,
59
+ end: e.start + 1 + i.length
60
+ };
61
+ }
62
+ static linkAt(e, t) {
63
+ for (let n of e.matchAll(T)) {
64
+ let e = n.index, r = e + n[0].length;
65
+ if (t >= e && t <= r) return {
66
+ start: e,
67
+ end: r,
68
+ words: n[1],
69
+ address: n[2]
70
+ };
71
+ }
72
+ }
73
+ static clear(e) {
74
+ let t = e.start === e.end, n = t ? 0 : e.start, r = t ? e.text.length : e.end, i = e.text.slice(n, r);
75
+ i = i.replace(T, "$1").replace(E, "$1").replace(D, "$1").replace(O, "$1");
76
+ let a = {
77
+ text: e.text.slice(0, n) + i + e.text.slice(r),
78
+ start: n,
79
+ end: n + i.length
80
+ };
81
+ for (let e of ge) {
82
+ let n = a.text.slice(a.start - e.length, a.start) === e;
83
+ !t && n && a.text.slice(a.end, a.end + e.length) === e && (a = MarkdownFormats.toggle(a, e));
84
+ }
85
+ return a;
86
+ }
87
+ static formatsAt(e, t) {
88
+ let n = /* @__PURE__ */ new Set(), inside = (r, i) => {
89
+ for (let a of e.matchAll(r)) t > a.index && t < a.index + a[0].length && n.add(i);
90
+ };
91
+ return inside(E, "bold"), inside(O, "italic"), inside(D, "strikethrough"), inside(T, "link"), n;
92
+ }
93
+ static shapeOf(e, t) {
94
+ if (t.kind === "cell") return;
95
+ let n = e.slice(e.lastIndexOf("\n", t.start - 1) + 1, t.start), r = /^ {0,3}(#{1,6})[ \t]/.exec(n);
96
+ return r ? `h${r[1].length}` : /^\s*\d{1,9}[.)][ \t]/.test(n) ? "numbered" : /^\s*[*+-][ \t]/.test(n) ? "bullet" : "paragraph";
97
+ }
98
+ static reshape(e, t, n, r) {
99
+ let i = e.lastIndexOf("\n", t.start - 1) + 1, a = /^\s*/.exec(e.slice(i, t.start))[0], o = r.startsWith("h") ? n.replace(/\s*\n\s*/g, " ").trim() : n.replace(/\s+$/, ""), s = a + _e[r], c = e.slice(0, i) + s + o + e.slice(t.end), l = r === "paragraph" ? "paragraph" : r.startsWith("h") ? "heading" : "item", u = i + s.length;
100
+ return {
101
+ text: c,
102
+ place: {
103
+ kind: l,
104
+ start: u,
105
+ end: u + o.length
106
+ }
107
+ };
108
+ }
109
+ static runsOf(e) {
110
+ let t = [];
111
+ return MarkdownFormats.cut(e, [], t), t;
112
+ }
113
+ static markdownOf(e) {
114
+ let t = "";
115
+ for (let n of e.childNodes) {
116
+ if (n.nodeType === ye) {
117
+ t += (n.textContent ?? "").replace(/[\\*]/g, "\\$&");
118
+ continue;
119
+ }
120
+ if (n.nodeType !== be) continue;
121
+ let e = n, r = MarkdownFormats.markdownOf(e), i = e.localName;
122
+ i === "br" ? t += "\n" : i === "code" ? t += `\`${e.textContent ?? ""}\`` : i === "a" ? t += `[${r}](${e.getAttribute("href") ?? ""})` : k[i] && r.trim() ? t += k[i] + r + k[i] : t += r;
123
+ }
124
+ return t;
125
+ }
126
+ static wordAt({ text: e, start: t }) {
127
+ let n = t, r = t;
128
+ for (; n > 0 && A.test(e[n - 1]);) n--;
129
+ for (; r < e.length && A.test(e[r]);) r++;
130
+ return {
131
+ start: n,
132
+ end: r
133
+ };
134
+ }
135
+ static isTriple(e, t, n) {
136
+ return e.slice(t - 3, t) === "***" && e.slice(n, n + 3) === "***";
137
+ }
138
+ static cut(e, t, n) {
139
+ let r;
140
+ for (let [t, n, i] of ve) {
141
+ t.lastIndex = 0;
142
+ let a = t.exec(e);
143
+ a && (!r || a.index < r.match.index) && (r = {
144
+ match: a,
145
+ format: n,
146
+ mark: i
147
+ });
148
+ }
149
+ if (!r) {
150
+ e && n.push({
151
+ text: e,
152
+ formats: t,
153
+ isMark: !1
154
+ });
155
+ return;
156
+ }
157
+ let { match: i, format: a, mark: o } = r, s = i[1].match(/(?<!\*)\*(?!\*)/g)?.length ?? 0;
158
+ a === "bold" && s % 2 && e[i.index + i[0].length] === "*" && (i[1] += "*", i[0] += "*"), i.index && n.push({
159
+ text: e.slice(0, i.index),
160
+ formats: t,
161
+ isMark: !1
162
+ });
163
+ let c = [...t, a];
164
+ a === "link" ? (n.push({
165
+ text: "[",
166
+ formats: c,
167
+ isMark: !0
168
+ }), MarkdownFormats.cut(i[1], c, n), n.push({
169
+ text: `](${i[2]})`,
170
+ formats: c,
171
+ isMark: !0
172
+ })) : (n.push({
173
+ text: o,
174
+ formats: c,
175
+ isMark: !0
176
+ }), MarkdownFormats.cut(i[1], c, n), n.push({
177
+ text: o,
178
+ formats: c,
179
+ isMark: !0
180
+ })), MarkdownFormats.cut(e.slice(i.index + i[0].length), t, n);
181
+ }
182
+ }, ge = [
183
+ "**",
184
+ "~~",
185
+ "*"
186
+ ], _e = {
187
+ paragraph: "",
188
+ h1: "# ",
189
+ h2: "## ",
190
+ h3: "### ",
191
+ h4: "#### ",
192
+ h5: "##### ",
193
+ h6: "###### ",
194
+ bullet: "- ",
195
+ numbered: "1. "
196
+ }, T = /\[([^\]\n]*)\]\(([^)\s]*)\)/g, E = /\*\*(?=\S)([^\n]*?\S)\*\*/g, D = /~~(?=\S)([^\n]*?\S)~~/g, O = /(?<!\*)\*(?=[^\s*])([^\n*]*?[^\s*])\*/g, ve = [
197
+ [
198
+ new RegExp(T.source, "g"),
199
+ "link",
200
+ ""
201
+ ],
202
+ [
203
+ new RegExp(E.source, "g"),
204
+ "bold",
205
+ "**"
206
+ ],
207
+ [
208
+ new RegExp(D.source, "g"),
209
+ "strikethrough",
210
+ "~~"
211
+ ],
212
+ [
213
+ new RegExp(O.source, "g"),
214
+ "italic",
215
+ "*"
216
+ ]
217
+ ], k = {
218
+ strong: "**",
219
+ b: "**",
220
+ em: "*",
221
+ i: "*",
222
+ del: "~~",
223
+ s: "~~",
224
+ strike: "~~"
225
+ }, A = /[\p{L}\p{N}_'’-]/u, ye = 3, be = 1, xe = class MarkdownBox {
226
+ props;
227
+ field;
228
+ bar;
229
+ view;
230
+ shape;
231
+ unformattable;
232
+ buttons = /* @__PURE__ */ new Map();
233
+ shapes;
234
+ address;
235
+ linkFor;
236
+ constructor(e) {
237
+ this.props = e;
238
+ let { document: t } = e;
239
+ this.shape = e.shape;
240
+ let n = !!e.renderInline && MarkdownBox.comesBack(e.raw, e.renderInline, t);
241
+ this.unformattable = n ? void 0 : e.texts(e.renderInline ? "formattedOff" : "noFormattedView"), this.view = e.view === "formatted" && !this.unformattable ? "formatted" : "marks", this.field = t.createElement("span"), this.field.setAttribute("role", "textbox"), this.field.setAttribute("aria-label", e.label), this.field.setAttribute("part", e.parts.box), e.kind === "paragraph" && this.field.setAttribute("aria-multiline", "true"), this.field.addEventListener("keydown", this.onKey), this.field.addEventListener("input", this.onInput), this.field.addEventListener("paste", this.onPaste), this.field.addEventListener("focusout", e.onLeave), this.field.ownerDocument.addEventListener("selectionchange", this.onSelectionChange), this.shapes = t.createElement("ui-select"), this.address = t.createElement("input"), this.bar = this.drawBar(), this.draw(e.raw);
242
+ }
243
+ get raw() {
244
+ return this.view === "formatted" ? w.markdownOf(this.field).replace(/\n$/, "") : (this.field.textContent ?? "").replace(/\n$/, "");
245
+ }
246
+ set raw(e) {
247
+ this.draw(e), this.caret = e.length;
248
+ }
249
+ get selection() {
250
+ let e = MarkdownBox.rangeIn(this.field);
251
+ if (e) return {
252
+ start: this.offsetOf(e.startContainer, e.startOffset),
253
+ end: this.offsetOf(e.endContainer, e.endOffset)
254
+ };
255
+ }
256
+ set caret(e) {
257
+ this.select(e, e);
258
+ }
259
+ focus(e) {
260
+ this.field.focus(), this.caret = e ?? (this.field.textContent ?? "").length, this.showPressed();
261
+ }
262
+ remove() {
263
+ this.field.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange), this.field.removeEventListener("focusout", this.props.onLeave), this.bar.remove();
264
+ }
265
+ act(e) {
266
+ if (e === "view") return this.switchView();
267
+ if (e === "link") return this.askAddress();
268
+ if (e === "bullet" || e === "numbered") return this.reshape(this.shape === e ? "paragraph" : e);
269
+ if (this.view === "formatted") this.field.ownerDocument.execCommand(De[e]), e === "clear" && this.field.ownerDocument.execCommand("unlink");
270
+ else {
271
+ let t = this.edit();
272
+ this.apply(e === "clear" ? w.clear(t) : w.toggle(t, Ee[e]));
273
+ }
274
+ this.changed();
275
+ }
276
+ reshape(e) {
277
+ this.shape && (this.shape = e, this.shapes.setAttribute("value", e.startsWith("h") ? e : "paragraph"), this.changed());
278
+ }
279
+ switchView() {
280
+ if (this.unformattable) return;
281
+ let e = this.raw;
282
+ this.view = this.view === "marks" ? "formatted" : "marks", this.draw(e), this.field.focus(), this.caret = (this.field.textContent ?? "").length, this.props.onView(this.view), this.showPressed();
283
+ }
284
+ askAddress() {
285
+ let e = this.edit();
286
+ this.linkFor = e;
287
+ let t = this.view === "marks" ? w.linkAt(e.text, e.start) : void 0, n = this.view === "formatted" ? MarkdownBox.rangeIn(this.field)?.startContainer.parentElement?.closest("a") : void 0;
288
+ this.address.value = t?.address ?? n?.getAttribute("href") ?? "", this.address.hidden = !1, this.address.focus(), this.address.select();
289
+ }
290
+ onAddressKey = (e) => {
291
+ if (e.stopPropagation(), e.key !== "Enter" && e.key !== "Escape") return;
292
+ e.preventDefault();
293
+ let t = this.linkFor;
294
+ if (this.linkFor = void 0, this.address.hidden = !0, this.field.focus(), !t) return;
295
+ if (e.key === "Escape") return this.select(t.start, t.end);
296
+ let n = this.address.value.trim();
297
+ this.view === "formatted" ? (this.select(t.start, t.end), this.field.ownerDocument.execCommand(n ? "createLink" : "unlink", !1, n)) : this.apply(w.link(t, n)), this.changed();
298
+ };
299
+ onKey = (e) => {
300
+ let t = (e.metaKey || e.ctrlKey) && !e.altKey ? ke[`${e.shiftKey ? "shift+" : ""}${e.code}`] : void 0;
301
+ if (t) return e.preventDefault(), e.stopPropagation(), this.act(t);
302
+ if (e.key === "Enter" && e.shiftKey && this.props.kind === "paragraph") {
303
+ e.preventDefault(), e.stopPropagation(), this.field.ownerDocument.execCommand("insertText", !1, "\n");
304
+ return;
305
+ }
306
+ this.props.onKey(e);
307
+ };
308
+ onInput = (e) => {
309
+ if (this.view === "marks" && !e.isComposing) {
310
+ let e = this.selection;
311
+ this.draw(this.field.textContent ?? ""), e && this.select(e.start, e.end);
312
+ }
313
+ this.props.onInput(), this.showPressed();
314
+ };
315
+ onPaste = (e) => {
316
+ e.preventDefault();
317
+ let t = e.clipboardData?.getData("text/plain") ?? "";
318
+ this.field.ownerDocument.execCommand("insertText", !1, t);
319
+ };
320
+ onSelectionChange = () => {
321
+ this.field.isConnected && this.showPressed();
322
+ };
323
+ changed() {
324
+ this.props.onInput(), this.showPressed();
325
+ }
326
+ draw(e) {
327
+ let t = this.field.ownerDocument;
328
+ if (this.field.contentEditable = this.view === "marks" ? "plaintext-only" : "true", this.field.dataset.view = this.view, this.view === "formatted") {
329
+ this.field.innerHTML = this.props.renderInline(e);
330
+ return;
331
+ }
332
+ this.field.replaceChildren(...w.runsOf(e).map((e) => {
333
+ if (!e.isMark && !e.formats.length) return t.createTextNode(e.text);
334
+ let n = t.createElement("span");
335
+ return n.className = [e.isMark ? "md-mark" : "", ...e.formats.map((e) => `md-${e}`)].join(" ").trim(), n.textContent = e.text, n;
336
+ }));
337
+ }
338
+ drawBar() {
339
+ let { document: e, texts: t, parts: n } = this.props, r = e.createElement("span");
340
+ r.setAttribute("part", n.bar), r.setAttribute("role", "toolbar"), r.popover = "manual", r.setAttribute("aria-label", t("formatBar")), r.addEventListener("mousedown", (e) => {
341
+ !e.composedPath().includes(this.shapes) && e.target !== this.address && e.preventDefault();
342
+ });
343
+ for (let n of Se) {
344
+ if (n === "shape") {
345
+ this.shape && r.append(this.drawShapes());
346
+ continue;
347
+ }
348
+ if ((n === "bullet" || n === "numbered") && !this.shape) continue;
349
+ let i = e.createElement("ui-button");
350
+ i.setAttribute("appearance", "basic"), i.setAttribute("size", "small"), i.setAttribute("icon", Te[n]);
351
+ let a = n === "view" && this.unformattable ? this.unformattable : t(n);
352
+ i.setAttribute("title", a), i.setAttribute("aria-label", a), n === "view" && this.unformattable && i.setAttribute("disabled", ""), i.addEventListener("click", () => this.act(n)), this.buttons.set(n, i), r.append(i);
353
+ }
354
+ return this.address.type = "url", this.address.hidden = !0, this.address.placeholder = t("linkAddress"), this.address.setAttribute("aria-label", t("linkAddress")), this.address.addEventListener("keydown", this.onAddressKey), r.append(this.address), r;
355
+ }
356
+ drawShapes() {
357
+ let { document: e, texts: t } = this.props;
358
+ for (let n of Ce) {
359
+ let r = e.createElement("ui-item");
360
+ r.setAttribute("value", n), r.textContent = t(we[n]), this.shapes.append(r);
361
+ }
362
+ return this.shapes.setAttribute("size", "small"), this.shapes.style.setProperty("--ui-select-picker-background", "var(--_ui-markdown-bar-background)"), this.shapes.setAttribute("value", this.shape?.startsWith("h") ? this.shape : "paragraph"), this.shapes.setAttribute("aria-label", t("shape")), this.shapes.title = t("shape"), this.shapes.addEventListener("ui-changed", (e) => {
363
+ let { value: t } = e.detail;
364
+ t !== this.shape && (this.reshape(t), this.field.focus());
365
+ }), this.shapes;
366
+ }
367
+ showPressed() {
368
+ let e = this.formatsNow();
369
+ for (let [t, n] of this.buttons) {
370
+ let r = t === "view" ? this.view === "formatted" : t === "bullet" || t === "numbered" ? this.shape === t : e.has(t);
371
+ n.toggleAttribute("active", r);
372
+ }
373
+ }
374
+ formatsNow() {
375
+ if (this.view === "marks") {
376
+ let e = this.selection;
377
+ return e ? w.formatsAt(this.field.textContent ?? "", e.start) : /* @__PURE__ */ new Set();
378
+ }
379
+ let e = this.field.ownerDocument, t = /* @__PURE__ */ new Set();
380
+ for (let [n, r] of Object.entries(Oe)) r && e.queryCommandState(r) && t.add(n);
381
+ let n = MarkdownBox.rangeIn(this.field)?.startContainer;
382
+ return (n?.nodeType === 1 ? n : n?.parentElement)?.closest("a") && t.add("link"), t;
383
+ }
384
+ edit() {
385
+ let e = this.field.textContent ?? "";
386
+ return {
387
+ text: e,
388
+ ...this.selection ?? {
389
+ start: e.length,
390
+ end: e.length
391
+ }
392
+ };
393
+ }
394
+ apply(e) {
395
+ this.draw(e.text), this.select(e.start, e.end);
396
+ }
397
+ select(e, t) {
398
+ let [n, r] = this.pointAt(e), [i, a] = this.pointAt(t);
399
+ this.field.ownerDocument.getSelection()?.setBaseAndExtent(n, r, i, a);
400
+ }
401
+ pointAt(e) {
402
+ let t = this.field.ownerDocument.createTreeWalker(this.field, NodeFilter.SHOW_TEXT), n = e, r;
403
+ for (let e = t.nextNode(); e; e = t.nextNode()) {
404
+ if (n <= e.data.length) return [e, n];
405
+ n -= e.data.length, r = e;
406
+ }
407
+ return r ? [r, r.data.length] : [this.field, this.field.childNodes.length];
408
+ }
409
+ offsetOf(e, t) {
410
+ let n = this.field.ownerDocument.createRange();
411
+ return n.setStart(this.field, 0), n.setEnd(e, t), n.toString().length;
412
+ }
413
+ static rangeIn(e) {
414
+ let t = e.getRootNode().getSelection?.() ?? e.ownerDocument.getSelection();
415
+ if (!t?.rangeCount) return;
416
+ let n = t.getRangeAt(0);
417
+ return e.contains(n.startContainer) ? n : void 0;
418
+ }
419
+ static comesBack(e, t, n) {
420
+ let r = n.createElement("span");
421
+ return r.innerHTML = t(e), w.markdownOf(r) === e;
422
+ }
423
+ }, Se = [
424
+ "bold",
425
+ "italic",
426
+ "strikethrough",
427
+ "link",
428
+ "shape",
429
+ "bullet",
430
+ "numbered",
431
+ "clear",
432
+ "view"
433
+ ], Ce = [
434
+ "paragraph",
435
+ "h2",
436
+ "h3",
437
+ "h4"
438
+ ], we = {
439
+ paragraph: "shapeParagraph",
440
+ h2: "shapeH2",
441
+ h3: "shapeH3",
442
+ h4: "shapeH4"
443
+ }, Te = {
444
+ bold: "bold",
445
+ italic: "italic",
446
+ strikethrough: "strikethrough",
447
+ link: "link",
448
+ bullet: "list ul",
449
+ numbered: "list ol",
450
+ clear: "eraser",
451
+ view: "eye"
452
+ }, Ee = {
453
+ bold: "**",
454
+ italic: "*",
455
+ strikethrough: "~~"
456
+ }, De = {
457
+ bold: "bold",
458
+ italic: "italic",
459
+ strikethrough: "strikeThrough",
460
+ clear: "removeFormat"
461
+ }, Oe = {
462
+ bold: "bold",
463
+ italic: "italic",
464
+ strikethrough: "strikeThrough",
465
+ link: ""
466
+ }, ke = {
467
+ KeyB: "bold",
468
+ KeyI: "italic",
469
+ KeyK: "link",
470
+ "shift+KeyX": "strikethrough"
471
+ }, j, Ae = [re], M;
472
+ j = [re];
473
+ var N = class _MarkdownRenderer {
12
474
  static load() {
13
475
  return _MarkdownRenderer.engineLoader().then((e) => e.MarkdownEngine.instance);
14
476
  }
@@ -16,9 +478,119 @@ var O = class _MarkdownRenderer {
16
478
  return _MarkdownRenderer.sanitizerLoader().then((e) => e.MarkdownSanitizer.instance);
17
479
  }
18
480
  };
19
- D = a(null), n(D, 9, "load", ue, O), n(D, 9, "loadSanitizer", E, O), r(D, O), l(D, 3, O), s(O, "MarkdownRenderer"), e(O, "engineLoader", /* @__PURE__ */ s(() => import("./MarkdownEngine-CbuT9Mjc.js"), "engineLoader")), e(O, "sanitizerLoader", /* @__PURE__ */ s(() => import("./MarkdownSanitizer-zTnnbrLe.js"), "sanitizerLoader"));
20
- var k = O, A = {
481
+ M = g(null), i(M, 9, "load", Ae, N), i(M, 9, "loadSanitizer", j, N), o(M, N), l(M, 3, N), e(N, "MarkdownRenderer"), n(N, "engineLoader", /* @__PURE__ */ e(() => import("./MarkdownEngine-CW1WGqNp.js"), "engineLoader")), n(N, "sanitizerLoader", /* @__PURE__ */ e(() => import("./MarkdownSanitizer-zTnnbrLe.js"), "sanitizerLoader"));
482
+ var P = N, F = class MarkdownSource {
483
+ static placesOf(e, t) {
484
+ let n = [], add = (e, t, r, i) => {
485
+ e[I] = n.length, n.push({
486
+ kind: t,
487
+ start: r,
488
+ end: i
489
+ });
490
+ }, r = 0;
491
+ for (let n of e) {
492
+ let e = t.startsWith(n.raw, r) ? r : t.indexOf(n.raw, r);
493
+ if (e < 0) break;
494
+ MarkdownSource.visit(n, t, e, add), r = e + n.raw.length;
495
+ }
496
+ return n;
497
+ }
498
+ static placeOf(e) {
499
+ return e[I];
500
+ }
501
+ static replace(e, t, n) {
502
+ let r = t.kind === "paragraph" ? n.replace(/\s+$/, "") : n.replace(/\s*\n\s*/g, " ").trim(), i = t.kind === "cell" ? r.replace(Pe, "\\|") : r;
503
+ return e.slice(0, t.start) + i + e.slice(t.end);
504
+ }
505
+ static visit(e, t, n, r) {
506
+ e.type === "paragraph" ? MarkdownSource.paragraph(e, n, r) : e.type === "heading" ? MarkdownSource.heading(e, n, r) : e.type === "table" ? MarkdownSource.table(e, n, r) : e.type === "list" && MarkdownSource.list(e, t, n, n + e.raw.length, r);
507
+ }
508
+ static paragraph(e, t, n) {
509
+ let { from: r, to: i } = MarkdownSource.trimmed(e.raw);
510
+ i > r && n(e, "paragraph", t + r, t + i);
511
+ }
512
+ static heading(e, t, n) {
513
+ let r = je.exec(e.raw.split("\n")[0]);
514
+ if (r) {
515
+ let i = r[2];
516
+ i && n(e, "heading", t + r[1].length, t + r[1].length + i.length);
517
+ return;
518
+ }
519
+ let i = Me.exec(e.raw);
520
+ if (!i) return;
521
+ let { from: a, to: o } = MarkdownSource.trimmed(e.raw.slice(0, i.index));
522
+ o > a && n(e, "heading", t + a, t + o);
523
+ }
524
+ static table(e, t, n) {
525
+ let r = MarkdownSource.linesOf(e.raw), i = [
526
+ e.header,
527
+ null,
528
+ ...e.rows
529
+ ];
530
+ for (let [e, a] of r.entries()) {
531
+ let r = i[e];
532
+ if (r) for (let [e, i] of MarkdownSource.cellsOf(a.text).entries()) {
533
+ let o = r[e];
534
+ o && n(o, "cell", t + a.start + i.from, t + a.start + i.to);
535
+ }
536
+ }
537
+ }
538
+ static list(e, t, n, r, i) {
539
+ let a = n;
540
+ for (let n of e.items) {
541
+ let e = n.raw.split("\n")[0].trim(), o = t.indexOf(e, a);
542
+ if (o < 0 || o >= r) return;
543
+ a = o + e.length;
544
+ let [s, ...c] = n.tokens.filter((e) => e.type !== "space" && e.type !== "checkbox"), l = Ne.exec(e), u = !!s && !s.raw.trim().includes("\n"), d = c.every((e) => e.type === "list");
545
+ if (l && u && d && (s.type === "text" || s.type === "paragraph")) {
546
+ let t = e.slice(l[0].length).replace(/\s+$/, "");
547
+ t && i(n, "item", o + l[0].length, o + l[0].length + t.length);
548
+ }
549
+ for (let e of c) {
550
+ if (e.type !== "list") break;
551
+ MarkdownSource.list(e, t, a, r, i);
552
+ }
553
+ }
554
+ }
555
+ static trimmed(e) {
556
+ return {
557
+ from: e.length - e.trimStart().length,
558
+ to: e.trimEnd().length
559
+ };
560
+ }
561
+ static linesOf(e) {
562
+ let t = [], n = 0;
563
+ for (let r of e.split("\n")) r.trim() && t.push({
564
+ text: r,
565
+ start: n
566
+ }), n += r.length + 1;
567
+ return t;
568
+ }
569
+ static cellsOf(e) {
570
+ let t = [];
571
+ for (let n = 0; n < e.length; n++) e[n] === "\\" ? n++ : e[n] === "|" && t.push(n);
572
+ let n = [
573
+ -1,
574
+ ...t,
575
+ e.length
576
+ ], r = [];
577
+ for (let i = 0; i < n.length - 1; i++) {
578
+ let a = n[i] + 1, o = n[i + 1], s = e.slice(a, o);
579
+ if ((i === 0 || i === n.length - 2) && !s.trim() && t.length) continue;
580
+ let c = s.length - s.trimStart().length, l = s.trim().length;
581
+ r.push(l ? {
582
+ from: a + c,
583
+ to: a + c + l
584
+ } : {
585
+ from: a + Math.min(1, s.length),
586
+ to: a + Math.min(1, s.length)
587
+ });
588
+ }
589
+ return r;
590
+ }
591
+ }, I = "uiPlace", je = /^( {0,3}#{1,6}(?:[ \t]+|$))(.*?)(?:[ \t]+#+)?[ \t]*$/, Me = /\n {0,3}(?:=+|-+)[ \t]*\n*$/, Ne = /^(?:[*+-]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/, Pe = /(?<!\\)\|/g, Fe = {
21
592
  tag: "ui-markdown",
593
+ icon: "markdown",
22
594
  topics: [
23
595
  "text",
24
596
  "typography",
@@ -36,7 +608,7 @@ var k = O, A = {
36
608
  noun: "markdown",
37
609
  description: "Markdown renders GitHub-flavoured markdown -- tables, task lists, code blocks -- from the element's own text or a file on this site.",
38
610
  attributes: [
39
- ...ee,
611
+ ...ie,
40
612
  {
41
613
  name: "size",
42
614
  group: "appearance",
@@ -66,8 +638,9 @@ var k = O, A = {
66
638
  {
67
639
  name: "editable",
68
640
  group: "behaviour",
69
- kind: "boolean",
70
- description: "Write / Preview tabs: a text box for the markdown, and its preview. Each edit is a `ui-changed`; `save()` writes it."
641
+ kind: "keyOrValueAndKey",
642
+ values: ["tabs"],
643
+ description: "Edit the text where it's drawn: ⌥-click (Alt-click) a paragraph, a heading, a list item or a table cell, and it becomes a box holding its markdown; Enter or a click away keeps it, Tab moves to the next, Escape puts it back, and 5 seconds without typing keeps it too. Holding ⌥ outlines what can be edited. `editable=\"tabs\"`: Write / Preview tabs instead, a text box for the whole markdown and its preview. Each edit is a `ui-changed`, and `save()` writes it: in place, each edit is saved as it's kept."
71
644
  },
72
645
  {
73
646
  name: "sanitized",
@@ -76,53 +649,181 @@ var k = O, A = {
76
649
  description: "Sanitize the rendered markup with DOMPurify (its own lazy chunk, loaded only then): no scripts, event handlers or `javascript:` links. Set it for text you didn't write; without it, raw HTML is kept as written."
77
650
  }
78
651
  ],
79
- events: [...ie, {
652
+ events: [...ee, {
80
653
  name: "ui-drawn",
81
654
  detail: "{ headings: { level: number, text: string, id: string }[] }",
82
655
  description: "Rendered; `headings` (also the `headings` property) lists its headings, e.g. for a table of contents."
83
656
  }],
84
657
  slots: [],
85
658
  parts: [
86
- ...te,
659
+ ...se,
87
660
  {
88
661
  name: "body",
89
662
  description: "The `<article>` holding the rendered markdown."
90
663
  },
91
664
  {
92
665
  name: "tabs",
93
- description: "`editable`: the Write / Preview tab list."
666
+ description: "`editable=\"tabs\"`: the Write / Preview tab list."
94
667
  },
95
668
  {
96
669
  name: "tab",
97
- description: "`editable`: each tab button."
670
+ description: "`editable=\"tabs\"`: each tab button."
98
671
  },
99
672
  {
100
673
  name: "editor",
101
- description: "`editable`: the `<textarea>` holding the markdown."
674
+ description: "`editable=\"tabs\"`: the `<textarea>` holding the markdown."
675
+ },
676
+ {
677
+ name: "edit-bar",
678
+ description: "`editable`: the formatting bar above the open box."
679
+ },
680
+ {
681
+ name: "edit-box",
682
+ description: "`editable`: the box a piece becomes while it's edited in place, holding its markdown."
102
683
  }
103
684
  ],
104
- states: [...p],
105
- texts: [
685
+ states: [
106
686
  ...ne,
687
+ {
688
+ name: "placing",
689
+ description: "`editable`: ⌥ is held, so what can be edited in place is outlined."
690
+ },
691
+ {
692
+ name: "editing",
693
+ description: "`editable`: a piece is being edited in place."
694
+ }
695
+ ],
696
+ texts: [
697
+ ...te,
107
698
  {
108
699
  key: "write",
109
700
  text: "Write",
110
- description: "`editable`: the editing tab."
701
+ description: "`editable=\"tabs\"`: the editing tab."
111
702
  },
112
703
  {
113
704
  key: "preview",
114
705
  text: "Preview",
115
- description: "`editable`: the preview tab."
706
+ description: "`editable=\"tabs\"`: the preview tab."
116
707
  },
117
708
  {
118
709
  key: "editor",
119
710
  text: "Markdown",
120
- description: "`editable`: accessible name of the text box."
711
+ description: "`editable=\"tabs\"`: accessible name of the text box."
712
+ },
713
+ {
714
+ key: "editBox",
715
+ text: "Edit {kind}",
716
+ description: "`editable`: accessible name of the box a piece becomes."
717
+ },
718
+ {
719
+ key: "paragraph",
720
+ text: "paragraph",
721
+ description: "`editable`: a paragraph, in `editBox`."
722
+ },
723
+ {
724
+ key: "heading",
725
+ text: "heading",
726
+ description: "`editable`: a heading, in `editBox`."
727
+ },
728
+ {
729
+ key: "item",
730
+ text: "list item",
731
+ description: "`editable`: a list item, in `editBox`."
732
+ },
733
+ {
734
+ key: "cell",
735
+ text: "table cell",
736
+ description: "`editable`: a table cell, in `editBox`."
737
+ },
738
+ {
739
+ key: "formatBar",
740
+ text: "Formatting",
741
+ description: "`editable`: accessible name of the formatting bar."
742
+ },
743
+ {
744
+ key: "bold",
745
+ text: "Bold (⌘B)",
746
+ description: "`editable`: the bar's bold button."
747
+ },
748
+ {
749
+ key: "italic",
750
+ text: "Italic (⌘I)",
751
+ description: "`editable`: the bar's italic button."
752
+ },
753
+ {
754
+ key: "strikethrough",
755
+ text: "Strikethrough (⌘⇧X)",
756
+ description: "`editable`: the bar's strikethrough button."
757
+ },
758
+ {
759
+ key: "link",
760
+ text: "Link (⌘K)",
761
+ description: "`editable`: the bar's link button."
762
+ },
763
+ {
764
+ key: "linkAddress",
765
+ text: "Link address: Enter puts it on, empty takes it off",
766
+ description: "`editable`: the link's address field."
767
+ },
768
+ {
769
+ key: "shape",
770
+ text: "Paragraph or heading",
771
+ description: "`editable`: the bar's shape menu."
772
+ },
773
+ {
774
+ key: "shapeParagraph",
775
+ text: "Paragraph",
776
+ description: "`editable`: the shape menu's paragraph."
777
+ },
778
+ {
779
+ key: "shapeH2",
780
+ text: "Heading 2",
781
+ description: "`editable`: the shape menu's `##`."
782
+ },
783
+ {
784
+ key: "shapeH3",
785
+ text: "Heading 3",
786
+ description: "`editable`: the shape menu's `###`."
787
+ },
788
+ {
789
+ key: "shapeH4",
790
+ text: "Heading 4",
791
+ description: "`editable`: the shape menu's `####`."
792
+ },
793
+ {
794
+ key: "bullet",
795
+ text: "Bulleted list",
796
+ description: "`editable`: the bar's bulleted list button."
797
+ },
798
+ {
799
+ key: "numbered",
800
+ text: "Numbered list",
801
+ description: "`editable`: the bar's numbered list button."
802
+ },
803
+ {
804
+ key: "clear",
805
+ text: "Clear formatting",
806
+ description: "`editable`: the bar's clear formatting button."
807
+ },
808
+ {
809
+ key: "view",
810
+ text: "Show it formatted, without its marks",
811
+ description: "`editable`: the bar's view switch."
812
+ },
813
+ {
814
+ key: "formattedOff",
815
+ text: "This text can't show formatted: written back, it wouldn't be the same",
816
+ description: "`editable`: the switch's tooltip, for a piece whose markdown wouldn't come back exactly."
817
+ },
818
+ {
819
+ key: "noFormattedView",
820
+ text: "This markdown's engine has no formatted view",
821
+ description: "`editable`: the switch's tooltip, for a subclass's engine without `renderInline()`."
121
822
  }
122
823
  ]
123
- }, de = "@layer ui.components.markdown.types{:host{--_ui-markdown-editor-border:var(--ui-markdown-editor-border,var(--ui-border-color));--_ui-markdown-editor-background:var(--ui-markdown-editor-background,var(--ui-surface));--_ui-markdown-color:var(--ui-markdown-color,var(--ui-text-color));--_ui-markdown-muted:var(--ui-markdown-muted,var(--ui-text-muted));--_ui-markdown-radius:var(--ui-markdown-radius,var(--ui-radius));display:block}.ui.markdown{--_ui-markdown-color:var(--ui-markdown-color,var(--ui-text-color));--_ui-markdown-muted:var(--ui-markdown-muted,var(--ui-text-muted));--_ui-markdown-line-height:var(--ui-markdown-line-height,1.6);--_ui-markdown-heading-color:var(--ui-markdown-heading-color,var(--ui-text-color));--_ui-markdown-heading-font-family:var(--ui-markdown-heading-font-family,initial);--_ui-markdown-heading-weight:var(--ui-markdown-heading-weight,600);--_ui-markdown-heading-line-height:var(--ui-markdown-heading-line-height,1.25);--_ui-markdown-heading-margin:var(--ui-markdown-heading-margin,1.5em 1em);--_ui-markdown-heading-rule:var(--ui-markdown-heading-rule,1px solid var(--_ui-markdown-rule-color));--_ui-markdown-heading-rule-gap:var(--ui-markdown-heading-rule-gap,.3em);--_ui-markdown-heading-scroll-margin:var(--ui-markdown-heading-scroll-margin,0);--_ui-markdown-h1-size:var(--ui-markdown-h1-size,2em);--_ui-markdown-h2-size:var(--ui-markdown-h2-size,1.5em);--_ui-markdown-h3-size:var(--ui-markdown-h3-size,1.25em);--_ui-markdown-strong-color:var(--ui-markdown-strong-color,initial);--_ui-markdown-code-color:var(--ui-markdown-code-color,initial);--_ui-markdown-link-color:var(--ui-markdown-link-color,var(--ui-link));--_ui-markdown-rule-color:var(--ui-markdown-rule-color,var(--ui-border-color));--_ui-markdown-hr-height:var(--ui-markdown-hr-height,.25em);--_ui-markdown-table-border:var(--ui-markdown-table-border,var(--ui-border-color));--_ui-markdown-stripe:var(--ui-markdown-stripe,var(--ui-surface-muted));--_ui-markdown-blockquote-color:var(--ui-markdown-blockquote-color,var(--ui-text-muted));--_ui-markdown-blockquote-border:var(--ui-markdown-blockquote-border,var(--ui-border-color-strong));--_ui-markdown-code-background:var(--ui-markdown-code-background,var(--ui-surface-strong));--_ui-markdown-radius:var(--ui-markdown-radius,var(--ui-radius));color:var(--_ui-markdown-color);font-size:calc(var(--ui-font-size) * var(--ui-scale,1));line-height:var(--_ui-markdown-line-height);overflow-wrap:break-word;display:block}}@layer ui.components.markdown.content{.ui.markdown :is(p,ul,ol,blockquote,table,pre,ui-code,details,hr){margin-block:0 1em}.ui.markdown :is(h1,h2,h3,h4,h5,h6){margin-block:var(--_ui-markdown-heading-margin);color:var(--_ui-markdown-heading-color);font-family:var(--_ui-markdown-heading-font-family,inherit);font-weight:var(--_ui-markdown-heading-weight);line-height:var(--_ui-markdown-heading-line-height);scroll-margin-top:var(--_ui-markdown-heading-scroll-margin)}.ui.markdown :is(h1,h2){border-block-end:var(--_ui-markdown-heading-rule);padding-block-end:var(--_ui-markdown-heading-rule-gap)}.ui.markdown h1{font-size:var(--_ui-markdown-h1-size)}.ui.markdown h2{font-size:var(--_ui-markdown-h2-size)}.ui.markdown h3{font-size:var(--_ui-markdown-h3-size)}.ui.markdown h4{font-size:1em}.ui.markdown h5{font-size:.875em}.ui.markdown h6{color:var(--_ui-markdown-muted);font-size:.85em}.ui.markdown a{color:var(--_ui-markdown-link-color);text-underline-offset:.15em;text-decoration:underline}.ui.markdown :is(ul,ol){padding-inline-start:2em}.ui.markdown :is(ul,ol) :is(ul,ol){margin-block-end:0}.ui.markdown li+li{margin-block-start:.25em}.ui.markdown li:has(>input[type=checkbox]){list-style:none}.ui.markdown li>input[type=checkbox]{vertical-align:middle;margin-inline:-1.4em .4em}.ui.markdown blockquote{border-inline-start:.25em solid var(--_ui-markdown-blockquote-border);color:var(--_ui-markdown-blockquote-color);margin-inline:0;padding:0 1em}.ui.markdown hr{height:var(--_ui-markdown-hr-height);background:var(--_ui-markdown-rule-color);border:0;margin-block:1.5em}.ui.markdown table:not(ui-table>table){border-collapse:collapse;width:max-content;max-width:100%;display:block;overflow:auto}.ui.markdown :is(th,td):not(ui-table *){border:1px solid var(--_ui-markdown-table-border);padding:.4em .8em}.ui.markdown th:not(ui-table *){font-weight:600}.ui.markdown tbody tr:nth-child(2n):not(ui-table *){background:var(--_ui-markdown-stripe)}.ui.markdown :is(strong,b){color:var(--_ui-markdown-strong-color,inherit)}.ui.markdown :not(pre)>code{border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-code-background);color:var(--_ui-markdown-code-color,inherit);font-family:var(--ui-font-family-mono);padding:.125em .375em;font-size:.85em}.ui.markdown :not(pre)>code.short{white-space:nowrap}.ui.markdown img{max-width:100%;height:auto}.ui.markdown del{color:var(--_ui-markdown-muted)}.ui.markdown ui-code{display:block}.ui.markdown :is(ui-header,ui-list,ui-message,ui-segment,ui-table,ui-divider){margin-block:0 1em;display:block}.ui.markdown ui-header{margin-block-start:1.5em}.ui.markdown ui-list ui-list{margin-block-end:0}.ui.markdown>:first-child{margin-block-start:0}.ui.markdown>:last-child{margin-block-end:0}[part~=tabs]{border-block-end:1px solid var(--_ui-markdown-editor-border);gap:.25em;display:flex}[part~=tab]{color:var(--_ui-markdown-muted);font:inherit;cursor:pointer;background:0 0;border:1px solid #0000;border-start-start-radius:var(--_ui-markdown-radius);border-start-end-radius:var(--_ui-markdown-radius);margin-block-end:-1px;padding:.5em 1em}[part~=tab][aria-selected=true]{border-color:var(--_ui-markdown-editor-border);border-block-end-color:var(--_ui-markdown-editor-background);background:var(--_ui-markdown-editor-background);color:var(--_ui-markdown-color)}[part~=editor]{box-sizing:border-box;border:1px solid var(--_ui-markdown-editor-border);border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-editor-background);width:100%;min-height:12em;color:var(--_ui-markdown-color);font-family:var(--ui-font-family-mono);resize:vertical;padding:.75em;font-size:.875em;line-height:1.5;display:block}[part~=tabs]~section{margin-block-start:.75em}}@layer ui.components.markdown.variations,ui.components.markdown.states;", fe = /* @__PURE__ */ T("<section><article>"), pe = /* @__PURE__ */ T("<nav>"), me = /* @__PURE__ */ T("<button type=button>"), he = /* @__PURE__ */ T("<section><textarea>"), j, M, N, P, F, I, L, R, z, B, V, H, U, W, G, K = class _DOMMarkdownElement extends (M = t, j = [h], M) {
824
+ }, Ie = "@layer ui.components.markdown.types{:host{--_ui-markdown-editor-border:var(--ui-markdown-editor-border,var(--ui-border-color));--_ui-markdown-editor-background:var(--ui-markdown-editor-background,var(--ui-surface));--_ui-markdown-color:var(--ui-markdown-color,var(--ui-text-color));--_ui-markdown-muted:var(--ui-markdown-muted,var(--ui-text-muted));--_ui-markdown-radius:var(--ui-markdown-radius,var(--ui-radius));--_ui-markdown-measure:var(--ui-markdown-measure,none);display:block}.ui.markdown{--_ui-markdown-color:var(--ui-markdown-color,var(--ui-text-color));--_ui-markdown-muted:var(--ui-markdown-muted,var(--ui-text-muted));--_ui-markdown-line-height:var(--ui-markdown-line-height,1.6);--_ui-markdown-heading-color:var(--ui-markdown-heading-color,var(--ui-text-color));--_ui-markdown-heading-font-family:var(--ui-markdown-heading-font-family,initial);--_ui-markdown-heading-weight:var(--ui-markdown-heading-weight,600);--_ui-markdown-heading-line-height:var(--ui-markdown-heading-line-height,1.25);--_ui-markdown-heading-margin:var(--ui-markdown-heading-margin,1.5em 1em);--_ui-markdown-heading-rule:var(--ui-markdown-heading-rule,1px solid var(--_ui-markdown-rule-color));--_ui-markdown-heading-rule-gap:var(--ui-markdown-heading-rule-gap,.3em);--_ui-markdown-heading-scroll-margin:var(--ui-markdown-heading-scroll-margin,0);--_ui-markdown-h1-size:var(--ui-markdown-h1-size,2em);--_ui-markdown-h2-size:var(--ui-markdown-h2-size,1.5em);--_ui-markdown-h3-size:var(--ui-markdown-h3-size,1.25em);--_ui-markdown-strong-color:var(--ui-markdown-strong-color,initial);--_ui-markdown-code-color:var(--ui-markdown-code-color,initial);--_ui-markdown-link-color:var(--ui-markdown-link-color,var(--ui-link));--_ui-markdown-rule-color:var(--ui-markdown-rule-color,var(--ui-border-color));--_ui-markdown-hr-height:var(--ui-markdown-hr-height,.25em);--_ui-markdown-table-border:var(--ui-markdown-table-border,var(--ui-border-color));--_ui-markdown-stripe:var(--ui-markdown-stripe,var(--ui-surface-muted));--_ui-markdown-blockquote-color:var(--ui-markdown-blockquote-color,var(--ui-text-muted));--_ui-markdown-blockquote-border:var(--ui-markdown-blockquote-border,var(--ui-border-color-strong));--_ui-markdown-code-background:var(--ui-markdown-code-background,var(--ui-surface-strong));--_ui-markdown-radius:var(--ui-markdown-radius,var(--ui-radius));--_ui-markdown-measure:var(--ui-markdown-measure,none);color:var(--_ui-markdown-color);font-size:calc(var(--ui-font-size) * var(--ui-scale,1));line-height:var(--_ui-markdown-line-height);overflow-wrap:break-word;display:block}}@layer ui.components.markdown.content{.ui.markdown :is(p,ul,ol,blockquote,table,pre,ui-code,details,hr){margin-block:0 1em}.ui.markdown>:is(p,ul,ol,blockquote){max-width:var(--_ui-markdown-measure)}.ui.markdown :is(h1,h2,h3,h4,h5,h6){margin-block:var(--_ui-markdown-heading-margin);color:var(--_ui-markdown-heading-color);font-family:var(--_ui-markdown-heading-font-family,inherit);font-weight:var(--_ui-markdown-heading-weight);line-height:var(--_ui-markdown-heading-line-height);scroll-margin-top:var(--_ui-markdown-heading-scroll-margin)}.ui.markdown :is(h1,h2){border-block-end:var(--_ui-markdown-heading-rule);padding-block-end:var(--_ui-markdown-heading-rule-gap)}.ui.markdown h1{font-size:var(--_ui-markdown-h1-size)}.ui.markdown h2{font-size:var(--_ui-markdown-h2-size)}.ui.markdown h3{font-size:var(--_ui-markdown-h3-size)}.ui.markdown h4{font-size:1em}.ui.markdown h5{font-size:.875em}.ui.markdown h6{color:var(--_ui-markdown-muted);font-size:.85em}.ui.markdown a{color:var(--_ui-markdown-link-color);text-underline-offset:.15em;text-decoration:underline}.ui.markdown :is(ul,ol){padding-inline-start:2em}.ui.markdown :is(ul,ol) :is(ul,ol){margin-block-end:0}.ui.markdown li+li{margin-block-start:.25em}.ui.markdown li:has(>input[type=checkbox]){list-style:none}.ui.markdown li>input[type=checkbox]{vertical-align:middle;margin-inline:-1.4em .4em}.ui.markdown blockquote{border-inline-start:.25em solid var(--_ui-markdown-blockquote-border);color:var(--_ui-markdown-blockquote-color);margin-inline:0;padding:0 1em}.ui.markdown hr{height:var(--_ui-markdown-hr-height);background:var(--_ui-markdown-rule-color);border:0;margin-block:1.5em}.ui.markdown table:not(ui-table>table){border-collapse:collapse;width:max-content;max-width:100%;display:block;overflow:auto}.ui.markdown :is(th,td):not(ui-table *){border:1px solid var(--_ui-markdown-table-border);padding:.4em .8em}.ui.markdown th:not(ui-table *){font-weight:600}.ui.markdown tbody tr:nth-child(2n):not(ui-table *){background:var(--_ui-markdown-stripe)}.ui.markdown :is(strong,b){color:var(--_ui-markdown-strong-color,inherit)}.ui.markdown :not(pre)>code{border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-code-background);color:var(--_ui-markdown-code-color,inherit);font-family:var(--ui-font-family-mono);padding:.125em .375em;font-size:.85em}.ui.markdown :not(pre)>code.short{white-space:nowrap}.ui.markdown img{max-width:100%;height:auto}.ui.markdown del{color:var(--_ui-markdown-muted)}.ui.markdown ui-code{display:block}.ui.markdown :is(ui-header,ui-list,ui-message,ui-segment,ui-table,ui-divider){margin-block:0 1em;display:block}.ui.markdown ui-header{margin-block-start:1.5em}.ui.markdown ui-list ui-list{margin-block-end:0}.ui.markdown>:first-child{margin-block-start:0}.ui.markdown>:last-child{margin-block-end:0}[part~=tabs]{border-block-end:1px solid var(--_ui-markdown-editor-border);gap:.25em;display:flex}[part~=tab]{color:var(--_ui-markdown-muted);font:inherit;cursor:pointer;background:0 0;border:1px solid #0000;border-start-start-radius:var(--_ui-markdown-radius);border-start-end-radius:var(--_ui-markdown-radius);margin-block-end:-1px;padding:.5em 1em}[part~=tab][aria-selected=true]{border-color:var(--_ui-markdown-editor-border);border-block-end-color:var(--_ui-markdown-editor-background);background:var(--_ui-markdown-editor-background);color:var(--_ui-markdown-color)}[part~=editor]{box-sizing:border-box;border:1px solid var(--_ui-markdown-editor-border);border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-editor-background);width:100%;min-height:12em;color:var(--_ui-markdown-color);font-family:var(--ui-font-family-mono);resize:vertical;padding:.75em;font-size:.875em;line-height:1.5;display:block}.ui.tabs.editable.markdown{margin-block-start:.75em}}@layer ui.components.markdown.variations;@layer ui.components.markdown.states{:host{--_ui-markdown-edit-color:var(--ui-markdown-edit-color,var(--ui-primary));--_ui-markdown-bar-background:var(--ui-markdown-bar-background,var(--ui-background))}:host(:state(placing)) .ui.editable.markdown [data-ui-place]{outline:1px dashed color-mix(in oklch, var(--_ui-markdown-edit-color) 70%, transparent);outline-offset:-1px;cursor:text}.ui.editable.markdown [part~=edit-box]{outline:2px solid var(--_ui-markdown-edit-color);outline-offset:1px;background:color-mix(in oklch, var(--_ui-markdown-edit-color) 6%, transparent);font-family:var(--ui-font-family-mono);white-space:pre-wrap;overflow-wrap:anywhere;anchor-name:--ui-markdown-box;border-radius:2px;font-size:.92em}.ui.editable.markdown [part~=edit-box][data-view=formatted]{font-family:inherit;font-size:inherit}[part~=edit-box] .md-mark{opacity:.4;font-style:normal;font-weight:400}[part~=edit-box] .md-bold{font-weight:700}[part~=edit-box] .md-italic{font-style:italic}[part~=edit-box] .md-strikethrough{text-decoration:line-through}[part~=edit-box] .md-link{color:var(--_ui-markdown-link-color,var(--ui-link))}[part~=edit-bar]{color:inherit;position-anchor:--ui-markdown-box;position-area:block-start span-inline-end;position-try-fallbacks:flip-block;z-index:10;border:1px solid var(--_ui-markdown-editor-border);border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-bar-background);backdrop-filter:blur(12px);align-items:center;gap:2px;margin-block:6px;margin-inline:0;padding:3px;font-size:.875em;display:flex;position:fixed;inset:auto;overflow:visible;box-shadow:0 2px 8px oklch(0% none none/.12)}[part~=edit-bar] input{font:inherit;border:1px solid var(--_ui-markdown-editor-border);border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-editor-background);color:var(--_ui-markdown-color);inline-size:18em;padding:.2em .4em}}", Le = /* @__PURE__ */ C("<section><article>"), Re = /* @__PURE__ */ C("<nav>"), ze = /* @__PURE__ */ C("<button type=button>"), Be = /* @__PURE__ */ C("<section><textarea>"), L, R, z, Ve, He, Ue, We, Ge, Ke, qe, Je, Ye, Xe, Ze, Qe, $e, et, tt, nt, B, V, H, U, W, G, K = class _DOMMarkdownElement extends (R = t, L = [h], R) {
124
825
  constructor() {
125
- super(...arguments), l(N, 5, this);
826
+ super(...arguments), l(z, 5, this);
126
827
  }
127
828
  get headings() {
128
829
  return this.component?.headings ?? [];
@@ -131,73 +832,103 @@ var k = O, A = {
131
832
  return this.component?.reveal(e) ?? !1;
132
833
  }
133
834
  };
134
- N = a(M), n(N, 2, "headings", j, K), r(N, K), s(K, "DOMMarkdownElement");
135
- var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("textToShow", "skipTitle", "loadStatus", "editable", "shownTab", "breaks", "headingOffset", "sanitized")], R = [m], L = [h], I = [u("textToShow")], F = [m], P = [ae], H) {
835
+ z = g(R), i(z, 2, "headings", L, K), o(z, K), e(K, "DOMMarkdownElement");
836
+ var rt = K, q = class _UIMarkdown extends (B = r, nt = [ae], tt = [oe], et = [p("textToShow", "skipTitle", "loadStatus", "editable", "shownTab", "breaks", "headingOffset", "sanitized")], $e = [m], Qe = [h], Ze = [p("textToShow")], Xe = [m], Ye = [f("placing")], Je = [m], qe = [f("editing")], Ke = [ce], Ge = [h], We = [h], Ue = [h], He = [m], Ve = [ce], B) {
136
837
  constructor() {
137
- super(...arguments), l(U, 5, this), e(this, "body"), e(this, "ticket", 0), e(this, "rendered", /* @__PURE__ */ new WeakMap()), g(this, W, l(U, 8, this, X)), l(U, 11, this), e(this, "textBox"), e(this, "tabButtons", /* @__PURE__ */ new Map()), e(this, "keepTextBox", l(U, 24, this, /* @__PURE__ */ s((e) => {
838
+ super(...arguments), l(V, 5, this), n(this, "body"), n(this, "ticket", 0), n(this, "rendered", /* @__PURE__ */ new WeakMap()), u(this, H, l(V, 8, this, X)), l(V, 11, this), n(this, "textBox"), n(this, "tabButtons", /* @__PURE__ */ new Map()), n(this, "keepTextBox", l(V, 32, this, /* @__PURE__ */ e((e) => {
138
839
  this.textBox = e, e.value = this.textToShow;
139
- }, "keepTextBox"))), l(U, 27, this), e(this, "onInput", /* @__PURE__ */ s((e) => {
840
+ }, "keepTextBox"))), l(V, 35, this), n(this, "onInput", /* @__PURE__ */ e((e) => {
140
841
  this.content = e.currentTarget.value;
141
- }, "onInput")), e(this, "onTabKeyDown", /* @__PURE__ */ s((e) => {
142
- c.focus.arrowKey(e, {
143
- container: e.currentTarget,
144
- items: /* @__PURE__ */ s(() => Q.map((e) => this.tabButtons.get(e)), "items"),
842
+ }, "onInput")), n(this, "onTabKeyDown", /* @__PURE__ */ e((t) => {
843
+ c.focus.arrowKey(t, {
844
+ container: t.currentTarget,
845
+ items: /* @__PURE__ */ e(() => Q.map((e) => this.tabButtons.get(e)), "items"),
145
846
  orientation: "horizontal",
146
847
  tabindex: "left alone",
147
- onChange: /* @__PURE__ */ s((e, t) => this.shownTab = Q[t], "onChange")
848
+ onChange: /* @__PURE__ */ e((e, t) => this.shownTab = Q[t], "onChange")
148
849
  });
149
- }, "onTabKeyDown")), g(this, G, l(U, 12, this, [])), l(U, 15, this), e(this, "hasRendered", !1), e(this, "onClick", /* @__PURE__ */ s((e) => {
150
- let t = e.target.closest?.(De), n = t && _UIMarkdown.idForHash(t.getAttribute("href"));
850
+ }, "onTabKeyDown")), u(this, U, l(V, 12, this, !1)), l(V, 15, this), u(this, W, l(V, 16, this)), l(V, 19, this), n(this, "places", []), n(this, "placesOffset", 0), n(this, "isRenderWaiting", !1), n(this, "keepTimer"), n(this, "engine"), n(this, "saves", Promise.resolve()), n(this, "onBoxKey", l(V, 36, this, /* @__PURE__ */ e((e) => {
851
+ e.stopPropagation();
852
+ let t = this.box;
853
+ if (!t) return;
854
+ let n = e.key === "Enter" && e.shiftKey && t.place.kind === "paragraph", r = e.shiftKey ? void 0 : ct[e.key];
855
+ if (r !== void 0) t.editor.caret = r === "start" ? 0 : (t.editor.field.textContent ?? "").length;
856
+ else if (e.key === "Escape") this.putBack();
857
+ else if (e.key === "Enter" && !n) this.keep("close");
858
+ else if (e.key === "Tab") this.keep(e.shiftKey ? "previous" : "next");
859
+ else return;
860
+ e.preventDefault();
861
+ }, "onBoxKey"))), l(V, 39, this), n(this, "onBoxInput", l(V, 40, this, /* @__PURE__ */ e(() => {
862
+ this.keepTimer?.cancel(), this.keepTimer = d(st, () => void this.keep("open"));
863
+ }, "onBoxInput"))), l(V, 43, this), n(this, "onBoxLeft", l(V, 44, this, /* @__PURE__ */ e((e) => {
864
+ let t = this.box, n = e.relatedTarget;
865
+ t && !t.editor.field.contains(n) && !t.editor.bar.contains(n) && this.keep("close");
866
+ }, "onBoxLeft"))), l(V, 47, this), u(this, G, l(V, 20, this, [])), l(V, 23, this), n(this, "hasRendered", !1), n(this, "onClick", /* @__PURE__ */ e((e) => {
867
+ if (this.editsInPlace && e.altKey && this.openAt(e)) return e.preventDefault();
868
+ let t = e.target.closest?.(St), n = t && _UIMarkdown.idForHash(t.getAttribute("href"));
151
869
  n && this.reveal(n) && e.preventDefault();
152
870
  }, "onClick"));
153
871
  }
154
872
  onMarkdownChanged() {
155
- let e = !this.editable || this.shownTab === Z;
156
- this.loadStatus === "loaded" && e && this.renderMarkdown({
157
- text: this.skipTitle ? this.textToShow.replace(ge, "") : this.textToShow,
158
- isEditable: this.editable,
873
+ this.renderNow();
874
+ }
875
+ renderNow() {
876
+ let e = !this.hasTabs || this.shownTab === Z;
877
+ if (this.loadStatus !== "loaded" || !e) return;
878
+ if (this.box) {
879
+ this.isRenderWaiting = !0;
880
+ return;
881
+ }
882
+ let t = this.textToShow, n = this.skipTitle ? t.replace(dt, "") : t;
883
+ return this.placesOffset = t.length - n.length, this.renderMarkdown({
884
+ text: n,
885
+ isEditable: !!this.editable,
159
886
  options: {
160
887
  breaks: !!this.breaks,
161
888
  headingOffset: Number(this.headingOffset) || 0,
162
- sanitized: !!this.sanitized
889
+ sanitized: !!this.sanitized,
890
+ places: this.editsInPlace
163
891
  }
164
892
  });
165
893
  }
166
894
  renderContent() {
167
895
  let e = this;
168
- return [v(se, {
896
+ return [y(ue, {
169
897
  get when() {
170
- return e.editable;
898
+ return e.hasTabs;
171
899
  },
172
900
  get children() {
173
- return [x(() => e.tabs()), x(() => e.editor())];
901
+ return [me(() => e.tabs()), me(() => e.editor())];
174
902
  }
175
903
  }), (() => {
176
- var t = fe(), n = t.firstChild;
177
- return _(n, "click", e.onClick, !0), C(() => (t) => {
904
+ var t = Le(), n = t.firstChild;
905
+ return v(n, "click", e.onClick, !0), x(() => (t) => {
178
906
  e.body = t;
179
- }, n), y(() => ({
907
+ }, n), b(() => ({
180
908
  e: _UIMarkdown.panelId(Z),
181
- t: e.editable ? $.panel : void 0,
182
- a: e.editable ? _UIMarkdown.tabId(Z) : void 0,
183
- o: e.editable && e.shownTab !== Z ? !0 : void 0,
184
- i: S(e.rootClass),
909
+ t: e.hasTabs ? $.panel : void 0,
910
+ a: e.hasTabs ? _UIMarkdown.tabId(Z) : void 0,
911
+ o: e.hasTabs && e.shownTab !== Z ? !0 : void 0,
912
+ i: he(e.rootClass),
185
913
  n: e.partForName("body")
186
914
  }), ({ e, t: r, a: i, o: a, i: o, n: s }, c) => {
187
- e !== c?.e && w(t, "id", e), r !== c?.t && w(t, "role", r), i !== c?.a && w(t, "aria-labelledby", i), a !== c?.o && w(t, "hidden", a), ce(n, o, c?.i), s !== c?.n && w(n, "part", s);
915
+ e !== c?.e && S(t, "id", e), r !== c?.t && S(t, "role", r), i !== c?.a && S(t, "aria-labelledby", i), a !== c?.o && S(t, "hidden", a), de(n, o, c?.i), s !== c?.n && S(n, "part", s);
188
916
  }), t;
189
917
  })()];
190
918
  }
919
+ get hasTabs() {
920
+ return this.editable === ot;
921
+ }
191
922
  tabs() {
192
923
  let e = this;
193
- var t = pe();
194
- return _(t, "keydown", e.onTabKeyDown, !0), b(t, v(oe, {
924
+ var t = Re();
925
+ return v(t, "keydown", e.onTabKeyDown, !0), pe(t, y(le, {
195
926
  each: Q,
196
927
  children: (t) => (() => {
197
- var n = me();
198
- return n._$$click = () => e.shownTab = t, C(() => (n) => {
928
+ var n = ze();
929
+ return n._$$click = () => e.shownTab = t, x(() => (n) => {
199
930
  e.tabButtons.set(t, n);
200
- }, n), b(n, () => e.translationForKey(t)), y(() => ({
931
+ }, n), pe(n, () => e.translationForKey(t)), b(() => ({
201
932
  e: _UIMarkdown.tabId(t),
202
933
  t: $.tab,
203
934
  a: e.partForName("tab"),
@@ -205,22 +936,22 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
205
936
  i: _UIMarkdown.panelId(t),
206
937
  n: e.shownTab === t ? 0 : -1
207
938
  }), ({ e, t, a: r, o: i, i: a, n: o }, s) => {
208
- e !== s?.e && w(n, "id", e), t !== s?.t && w(n, "role", t), r !== s?.a && w(n, "part", r), i !== s?.o && w(n, "aria-selected", i), a !== s?.i && w(n, "aria-controls", a), o !== s?.n && w(n, "tabindex", o);
939
+ e !== s?.e && S(n, "id", e), t !== s?.t && S(n, "role", t), r !== s?.a && S(n, "part", r), i !== s?.o && S(n, "aria-selected", i), a !== s?.i && S(n, "aria-controls", a), o !== s?.n && S(n, "tabindex", o);
209
940
  }), n;
210
941
  })()
211
- })), y(() => ({
942
+ })), b(() => ({
212
943
  e: e.partForName("tabs"),
213
944
  t: $.list
214
945
  }), ({ e, t: n }, r) => {
215
- e !== r?.e && w(t, "part", e), n !== r?.t && w(t, "role", n);
946
+ e !== r?.e && S(t, "part", e), n !== r?.t && S(t, "role", n);
216
947
  }), t;
217
948
  }
218
949
  editor() {
219
950
  let e = this;
220
- var t = he(), n = t.firstChild;
221
- _(n, "input", e.onInput, !0);
951
+ var t = Be(), n = t.firstChild;
952
+ v(n, "input", e.onInput, !0);
222
953
  var r = e.keepTextBox;
223
- return typeof r == "function" || Array.isArray(r) ? C(() => r, n) : e.keepTextBox = n, y(() => ({
954
+ return typeof r == "function" || Array.isArray(r) ? x(() => r, n) : e.keepTextBox = n, b(() => ({
224
955
  e: _UIMarkdown.panelId(X),
225
956
  t: $.panel,
226
957
  a: _UIMarkdown.tabId(X),
@@ -228,12 +959,157 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
228
959
  i: e.partForName("editor"),
229
960
  n: e.translationForKey("editor")
230
961
  }), ({ e, t: r, a: i, o: a, i: o, n: s }, c) => {
231
- e !== c?.e && w(t, "id", e), r !== c?.t && w(t, "role", r), i !== c?.a && w(t, "aria-labelledby", i), a !== c?.o && w(t, "hidden", a), o !== c?.i && w(n, "part", o), s !== c?.n && w(n, "aria-label", s);
962
+ e !== c?.e && S(t, "id", e), r !== c?.t && S(t, "role", r), i !== c?.a && S(t, "aria-labelledby", i), a !== c?.o && S(t, "hidden", a), o !== c?.i && S(n, "part", o), s !== c?.n && S(n, "aria-label", s);
232
963
  }), t;
233
964
  }
234
965
  onTextChanged(e) {
235
966
  this.textBox && this.textBox.value !== e && (this.textBox.value = e);
236
967
  }
968
+ get editsInPlace() {
969
+ return this.editable === !0;
970
+ }
971
+ get isPlacing() {
972
+ return this.editsInPlace && this.isOptionHeld;
973
+ }
974
+ get isEditingInPlace() {
975
+ return !!this.box;
976
+ }
977
+ followOptionKey() {
978
+ let t = new AbortController(), n = { signal: t.signal }, r = /* @__PURE__ */ e((e) => this.isOptionHeld = e.altKey, "follow");
979
+ return window.addEventListener("keydown", r, n), window.addEventListener("keyup", r, n), window.addEventListener("blur", () => this.isOptionHeld = !1, n), () => t.abort();
980
+ }
981
+ openAt(e) {
982
+ let t = e.target;
983
+ if (this.box?.editor.field.contains(t)) return !1;
984
+ let n = t.closest?.(Y);
985
+ return !n || !this.body?.contains(n) ? !1 : (this.open(n, {
986
+ x: e.clientX,
987
+ y: e.clientY
988
+ }), !0);
989
+ }
990
+ async open(e, t) {
991
+ this.box && await this.keep("close");
992
+ let n = this.places[Number(e.getAttribute(J))];
993
+ if (!n || !e.isConnected) return;
994
+ let r = this.textToShow, i = n.start + this.placesOffset, a = n.end + this.placesOffset, o = r.slice(i, a), s = _UIMarkdown.holderOf(e), c = _UIMarkdown.ownNodes(s), l = t ? this.caretFor(s, o, t) : o.length, u = w.shapeOf(r, {
995
+ ...n,
996
+ start: i,
997
+ end: a
998
+ }), d = this.boxFor(n.kind, o, u);
999
+ s.insertBefore(d.field, c[0] ?? null);
1000
+ for (let e of c) e.remove();
1001
+ this.domElement.shadowRoot?.append(d.bar), d.bar.showPopover(), this.box = {
1002
+ piece: e,
1003
+ editor: d,
1004
+ own: c,
1005
+ place: {
1006
+ ...n,
1007
+ start: i,
1008
+ end: a
1009
+ },
1010
+ raw: o,
1011
+ opened: o,
1012
+ shape: u,
1013
+ openedShape: u,
1014
+ base: r
1015
+ }, d.focus(d.view === "marks" ? l : void 0);
1016
+ }
1017
+ boxFor(t, n, r) {
1018
+ let i = this.engine;
1019
+ return new xe({
1020
+ document: this.domElement.ownerDocument,
1021
+ kind: t,
1022
+ raw: n,
1023
+ shape: r,
1024
+ label: this.translationForKey("editBox", { kind: this.translationForKey(t) }),
1025
+ parts: {
1026
+ box: this.partForName("edit-box"),
1027
+ bar: this.partForName("edit-bar")
1028
+ },
1029
+ texts: /* @__PURE__ */ e((e) => this.translationForKey(e), "texts"),
1030
+ view: _UIMarkdown.chosenView,
1031
+ renderInline: i?.renderInline ? (e) => i.renderInline(e) : void 0,
1032
+ onKey: this.onBoxKey,
1033
+ onInput: this.onBoxInput,
1034
+ onLeave: this.onBoxLeft,
1035
+ onView: /* @__PURE__ */ e((e) => _UIMarkdown.chosenView = e, "onView")
1036
+ });
1037
+ }
1038
+ static get chosenView() {
1039
+ return _.getAt(at) === "formatted" ? "formatted" : "marks";
1040
+ }
1041
+ static set chosenView(e) {
1042
+ _.setAt(at, e);
1043
+ }
1044
+ async keep(e) {
1045
+ let t = this.box;
1046
+ if (!t) return;
1047
+ this.keepTimer?.cancel();
1048
+ let n = t.editor.raw, r = this.textToShow, i = t.place.start;
1049
+ if (r !== t.base) {
1050
+ let e = r.indexOf(t.raw);
1051
+ if (e < 0 || r.includes(t.raw, e + 1)) return this.onKeepConflict();
1052
+ i = e;
1053
+ }
1054
+ let a = {
1055
+ ...t.place,
1056
+ start: i,
1057
+ end: i + t.raw.length
1058
+ }, o = t.editor.shape, s = o && o !== t.shape ? w.reshape(r, a, n, o) : void 0, c = s?.text ?? F.replace(r, a, n), l = e === "next" || e === "previous" ? this.neighbourOf(t.piece, e) : void 0, u = l && this.startInNext(l, a, c.length - r.length);
1059
+ if (c !== r && (t.place = s?.place ?? {
1060
+ ...a,
1061
+ end: c.length - (r.length - a.end)
1062
+ }, t.raw = c.slice(t.place.start, t.place.end), t.shape = o, t.base = c, this.content = c, this.saveInTurn()), e === "open") return;
1063
+ let d = this.close(t) ?? (c === r ? void 0 : this.renderNow());
1064
+ if (u === void 0) return;
1065
+ await d;
1066
+ let f = [...this.body?.querySelectorAll(Y) ?? []].find((e) => this.places[Number(e.getAttribute(J))]?.start === u);
1067
+ f && await this.open(f);
1068
+ }
1069
+ saveInTurn() {
1070
+ this.saves = this.saves.then(() => this.save()).catch(() => !1);
1071
+ }
1072
+ async putBack() {
1073
+ let e = this.box;
1074
+ if (e) {
1075
+ if (e.raw === e.opened && e.shape === e.openedShape) return void this.close(e);
1076
+ e.editor.raw = e.opened, e.openedShape && e.editor.reshape(e.openedShape), await this.keep("close");
1077
+ }
1078
+ }
1079
+ close(e) {
1080
+ if (this.keepTimer?.cancel(), this.box = void 0, e.editor.remove(), e.editor.field.replaceWith(...e.own), this.isRenderWaiting) return this.isRenderWaiting = !1, this.renderNow();
1081
+ }
1082
+ onKeepConflict() {
1083
+ let e = /* @__PURE__ */ Error("<ui-markdown>: this text changed while it was edited; copy what you typed, and reload");
1084
+ this.sendSourceEvent(s.error, {
1085
+ kind: "conflict",
1086
+ source: this.source || void 0,
1087
+ error: e
1088
+ });
1089
+ }
1090
+ neighbourOf(e, t) {
1091
+ let n = [...this.body?.querySelectorAll(Y) ?? []];
1092
+ return n[n.indexOf(e) + (t === "next" ? 1 : -1)];
1093
+ }
1094
+ startInNext(e, t, n) {
1095
+ let r = this.places[Number(e.getAttribute(J))];
1096
+ if (!r) return;
1097
+ let i = r.start + this.placesOffset;
1098
+ return (i >= t.end ? i + n : i) - this.placesOffset;
1099
+ }
1100
+ caretFor(e, t, n) {
1101
+ let r = this.domElement.shadowRoot, i = this.domElement.ownerDocument.caretPositionFromPoint?.(n.x, n.y, { shadowRoots: r ? [r] : [] });
1102
+ if (!i || !e.contains(i.offsetNode)) return t.length;
1103
+ let a = this.domElement.ownerDocument.createRange();
1104
+ a.setStart(e, 0), a.setEnd(i.offsetNode, i.offset);
1105
+ let o = 0;
1106
+ for (let e of a.toString()) {
1107
+ let n = t.indexOf(e, o);
1108
+ if (n < 0) return t.length;
1109
+ o = n + 1;
1110
+ }
1111
+ return o;
1112
+ }
237
1113
  reveal(e) {
238
1114
  return this.scrollTo(e) ? (history.replaceState(history.state, "", `#${e}`), !0) : !1;
239
1115
  }
@@ -250,31 +1126,32 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
250
1126
  return t?.scrollIntoView(), !!t;
251
1127
  }
252
1128
  loadEngine() {
253
- return k.load();
1129
+ return P.load();
254
1130
  }
255
1131
  async renderMarkdown({ text: e, options: t, isEditable: n }) {
256
1132
  let r = ++this.ticket;
257
1133
  try {
258
1134
  await c.load();
259
- let [i, a] = await Promise.all([this.loadEngine(), t.sanitized ? k.loadSanitizer() : void 0]);
1135
+ let [i, a] = await Promise.all([this.loadEngine(), t.sanitized ? P.loadSanitizer() : void 0]);
260
1136
  if (r !== this.ticket || !this.body) return;
261
- let { html: o, headings: s } = i.render(e, t), l = a ? a.sanitize(o, { uiTags: !!i.drawsUITags }) : this.domElement.ownerDocument.createRange().createContextualFragment(o);
262
- this.upgradeCode(l), this.keepShortCode(l), this.labelTaskItems(l), this.resolveUrls(l), n ? this.patchBody(this.body, l) : this.body.replaceChildren(l), this.headings = s, this.send("ui-drawn", { headings: s }), this.hasRendered || (this.hasRendered = !0, this.onHashChange());
1137
+ this.engine = i;
1138
+ let { html: o, headings: s, places: l } = i.render(e, t), u = a ? a.sanitize(o, { uiTags: !!i.drawsUITags }) : this.domElement.ownerDocument.createRange().createContextualFragment(o);
1139
+ this.upgradeCode(u), this.keepShortCode(u), this.labelTaskItems(u), this.resolveUrls(u), n ? this.patchBody(this.body, u) : this.body.replaceChildren(u), this.places = l ?? [], this.headings = s, this.send("ui-drawn", { headings: s }), this.hasRendered || (this.hasRendered = !0, this.onHashChange());
263
1140
  } catch (e) {
264
1141
  r === this.ticket && this.onLoadError(e, "render");
265
1142
  }
266
1143
  }
267
1144
  upgradeCode(e) {
268
- for (let t of e.querySelectorAll(_e)) {
269
- let e = t.parentElement, n = this.domElement.ownerDocument.createElement(Se), r = xe.exec(t.className)?.[1];
270
- r && n.setAttribute(Ce, r), n.setAttribute(we, ""), n.textContent = (t.textContent ?? "").replace(/\n$/, ""), e.replaceWith(n);
1145
+ for (let t of e.querySelectorAll(ft)) {
1146
+ let e = t.parentElement, n = this.domElement.ownerDocument.createElement(_t), r = gt.exec(t.className)?.[1];
1147
+ r && n.setAttribute(vt, r), n.setAttribute(yt, ""), n.textContent = (t.textContent ?? "").replace(/\n$/, ""), e.replaceWith(n);
271
1148
  }
272
1149
  }
273
1150
  keepShortCode(e) {
274
- for (let t of e.querySelectorAll(ve)) (t.textContent ?? "").length <= ye && t.classList.add(be);
1151
+ for (let t of e.querySelectorAll(pt)) (t.textContent ?? "").length <= mt && t.classList.add(ht);
275
1152
  }
276
1153
  labelTaskItems(e) {
277
- for (let t of e.querySelectorAll(Te)) {
1154
+ for (let t of e.querySelectorAll(bt)) {
278
1155
  let e = t.parentElement.textContent?.trim();
279
1156
  e && t.setAttribute("aria-label", e);
280
1157
  }
@@ -283,7 +1160,7 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
283
1160
  let t = this.source || void 0;
284
1161
  if (!t) return;
285
1162
  let n = new URL(t, this.domElement.ownerDocument.baseURI);
286
- for (let t of Ee) for (let r of e.querySelectorAll(`[${t}]`)) {
1163
+ for (let t of xt) for (let r of e.querySelectorAll(`[${t}]`)) {
287
1164
  let e = r.getAttribute(t);
288
1165
  if (!e.startsWith("#")) try {
289
1166
  r.setAttribute(t, new URL(e, n).href);
@@ -306,8 +1183,20 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
306
1183
  return;
307
1184
  }
308
1185
  }
1186
+ static holderOf(e) {
1187
+ let t = e.firstElementChild;
1188
+ return e.localName === "li" && t?.localName === "p" ? t : e;
1189
+ }
1190
+ static ownNodes(e) {
1191
+ let t = [];
1192
+ for (let n of e.childNodes) {
1193
+ if (n.nodeType === a.element && lt.test(n.localName)) break;
1194
+ n.nodeType === a.element && n.matches(ut) || t.push(n);
1195
+ }
1196
+ return t;
1197
+ }
309
1198
  static markupFor(e) {
310
- let t = e.nodeType === o.element ? e.outerHTML : e.textContent;
1199
+ let t = e.nodeType === a.element ? e.outerHTML : e.textContent;
311
1200
  return `${e.nodeType}:${t}`;
312
1201
  }
313
1202
  static tabId(e) {
@@ -317,24 +1206,27 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
317
1206
  return `ui-markdown-${e}-panel`;
318
1207
  }
319
1208
  };
320
- U = a(H), W = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), n(U, 1, "onMarkdownChanged", z, J), n(U, 4, "shownTab", R, J, W), n(U, 1, "onTextChanged", I, J), n(U, 4, "headings", F, J, G), n(U, 1, "followHash", P, J), n(U, 13, "vocabulary", V, J), n(U, 13, "elementSetup", B, J), n(U, 5, "keepTextBox", L, J), r(U, J), s(J, "UIMarkdown"), e(J, "vocabulary", l(U, 16, J, A)), l(U, 19, J), e(J, "elementSetup", l(U, 20, J, {
321
- styleSheets: { markdown: de },
322
- DOMElement: q,
1209
+ V = g(B), H = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), i(V, 1, "onMarkdownChanged", et, q), i(V, 4, "shownTab", $e, q, H), i(V, 1, "onTextChanged", Ze, q), i(V, 4, "isOptionHeld", Xe, q, U), i(V, 2, "isPlacing", Ye, q), i(V, 4, "box", Je, q, W), i(V, 2, "isEditingInPlace", qe, q), i(V, 1, "followOptionKey", Ke, q), i(V, 4, "headings", He, q, G), i(V, 1, "followHash", Ve, q), i(V, 13, "vocabulary", nt, q), i(V, 13, "elementSetup", tt, q), i(V, 5, "keepTextBox", Qe, q), i(V, 5, "onBoxKey", Ge, q), i(V, 5, "onBoxInput", We, q), i(V, 5, "onBoxLeft", Ue, q), o(V, q), e(q, "UIMarkdown"), n(q, "vocabulary", l(V, 24, q, Fe)), l(V, 27, q), n(q, "elementSetup", l(V, 28, q, {
1210
+ styleSheets: { markdown: Ie },
1211
+ DOMElement: rt,
323
1212
  delegatesFocus: !1
324
- })), l(U, 23, J);
325
- var Y = J, X = "write", Z = "preview", Q = [X, Z], $ = {
1213
+ })), l(V, 31, q);
1214
+ var it = q, at = "ui-markdown:edit-view", ot = "tabs", J = "data-ui-place", Y = `[${J}]`, st = 5, ct = {
1215
+ Home: "start",
1216
+ End: "end"
1217
+ }, lt = /^(ul|ol)$/, ut = "input[type=checkbox]", X = "write", Z = "preview", Q = [X, Z], $ = {
326
1218
  list: "tablist",
327
1219
  tab: "tab",
328
1220
  panel: "tabpanel"
329
- }, ge = /^(?:[ \t]*\n)*[ ]{0,3}(?:#(?=[ \t\n]|$)[^\n]*|[^\s][^\n]*\n[ ]{0,3}=+[ \t]*)(?:\n|$)/, _e = "pre > code", ve = ":not(pre) > code", ye = 28, be = "short", xe = /\blanguage-(\S+)/, Se = "ui-code", Ce = "language", we = "copy", Te = "li > input[type=checkbox], ui-item > ui-checkbox", Ee = ["href", "src"], De = "a[href^='#']";
1221
+ }, dt = /^(?:[ \t]*\n)*[ ]{0,3}(?:#(?=[ \t\n]|$)[^\n]*|[^\s][^\n]*\n[ ]{0,3}=+[ \t]*)(?:\n|$)/, ft = "pre > code", pt = ":not(pre) > code", mt = 28, ht = "short", gt = /\blanguage-(\S+)/, _t = "ui-code", vt = "language", yt = "copy", bt = "li > input[type=checkbox], ui-item > ui-checkbox", xt = ["href", "src"], St = "a[href^='#']";
330
1222
  //#endregion
331
1223
  //#region src/components/ui-markdown/index.ts
332
- le([
1224
+ fe([
333
1225
  "click",
334
1226
  "keydown",
335
1227
  "input"
336
- ]), Y.define();
1228
+ ]), it.define();
337
1229
  //#endregion
338
- export { q as DOMMarkdownElement, k as MarkdownRenderer, Y as UIMarkdown };
1230
+ export { rt as DOMMarkdownElement, P as MarkdownRenderer, it as UIMarkdown, F as t };
339
1231
 
340
1232
  //# sourceMappingURL=ui-markdown.js.map