@onereach/ui-components 4.3.12 → 4.4.0-beta.2673.0

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 (419) hide show
  1. package/dist/bundled/v2/components/OrCode/OrCode.js +6 -3792
  2. package/dist/bundled/v2/components/OrCode/index.js +6 -2
  3. package/dist/bundled/v2/components/OrCode/lang.js +3941 -3
  4. package/dist/bundled/v2/components/OrCode/theme.js +2 -1
  5. package/dist/bundled/v2/components/OrConfirm/OrConfirm.js +2 -1
  6. package/dist/bundled/v2/components/OrConfirm/index.js +2 -1
  7. package/dist/bundled/v2/components/OrConfirmV3/OrConfirm.js +1 -1
  8. package/dist/bundled/v2/components/OrConfirmV3/index.js +1 -1
  9. package/dist/bundled/v2/components/OrModal/OrModal.js +3 -1346
  10. package/dist/bundled/v2/components/OrModal/index.js +1 -0
  11. package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +2136 -0
  12. package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +209 -0
  13. package/dist/bundled/v2/components/OrRichTextEditorV3/index.d.ts +1 -0
  14. package/dist/bundled/v2/components/OrRichTextEditorV3/index.js +69 -0
  15. package/dist/bundled/v2/components/OrRichTextEditorV3/styles.d.ts +6 -0
  16. package/dist/bundled/v2/components/OrRichTextEditorV3/styles.js +38 -0
  17. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.d.ts +3 -0
  18. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +46 -0
  19. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.d.ts +27 -0
  20. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +184 -0
  21. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/index.d.ts +1 -0
  22. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/index.js +5 -0
  23. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/theme.d.ts +24 -0
  24. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/theme.js +190 -0
  25. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/types.d.ts +19 -0
  26. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/types.js +1 -0
  27. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/markdown.d.ts +3 -0
  28. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/markdown.js +5 -0
  29. package/dist/bundled/v2/components/OrSelectV3/OrSelect.js +1 -2
  30. package/dist/bundled/v2/components/OrTextV3/OrText.vue.d.ts +2 -2
  31. package/dist/bundled/v2/components/OrTextarea/OrTextarea.vue.d.ts +2 -2
  32. package/dist/bundled/v2/components/OrTextareaV3/OrTextarea.vue.d.ts +2 -2
  33. package/dist/bundled/v2/components/OrTextbox/OrTextbox.vue.d.ts +2 -2
  34. package/dist/bundled/v2/components/OrTimePickerV3/OrTimePicker.vue.d.ts +2 -2
  35. package/dist/bundled/v2/components/OrToast/OrToast.vue.d.ts +2 -2
  36. package/dist/bundled/v2/components/OrToastV3/OrToast.vue.d.ts +2 -2
  37. package/dist/bundled/v2/components/OrTooltip/OrTooltip.vue.d.ts +2 -2
  38. package/dist/bundled/v2/components/OrTooltipV3/OrTooltip.vue.d.ts +2 -2
  39. package/dist/bundled/v2/components/index.d.ts +1 -0
  40. package/dist/bundled/v2/components/index.js +16 -3
  41. package/dist/bundled/{v3/index-cf2c3c27.js → v2/index-0d224ae5.js} +3 -115
  42. package/dist/bundled/v2/index-1182caa8.js +9633 -0
  43. package/dist/bundled/v2/index-85c2efe8.js +7122 -0
  44. package/dist/bundled/{v3/OrCode.vue_vue_type_script_lang-74060519.js → v2/index-d92d0b48.js} +14 -235
  45. package/dist/bundled/{v3/lang-0fb8f78b.js → v2/index-e9f6b2d8.js} +73 -4009
  46. package/dist/bundled/v2/index.es-3f39f316.js +115 -0
  47. package/dist/bundled/v2/index.js +19 -6
  48. package/dist/bundled/v2/markdown-d704b3a8.js +17975 -0
  49. package/dist/bundled/{v3/OrModal.vue_vue_type_script_lang-ae842e5b.js → v2/useFocusTrap-48767a70.js} +3 -106
  50. package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-7e29b3d0.js +237 -0
  51. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-e5a8f92a.js → OrConfirm.vue_vue_type_script_lang-4eaa8470.js} +2 -2
  52. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-23e4ce08.js → OrConfirm.vue_vue_type_script_lang-dca252a7.js} +1 -1
  53. package/dist/bundled/v3/OrModal.vue_vue_type_script_lang-2c009ee0.js +108 -0
  54. package/dist/bundled/v3/OrRichTextEditor.vue_vue_type_script_lang-55afeb38.js +1861 -0
  55. package/dist/bundled/v3/components/OrAvatar/OrAvatar.vue.d.ts +26 -11
  56. package/dist/bundled/v3/components/OrAvatarV3/OrAvatar.vue.d.ts +24 -8
  57. package/dist/bundled/v3/components/OrBottomSheetV3/OrBottomSheet.vue.d.ts +33 -20
  58. package/dist/bundled/v3/components/OrButton/OrButton.vue.d.ts +51 -16
  59. package/dist/bundled/v3/components/OrButtonV2/OrButton.vue.d.ts +57 -20
  60. package/dist/bundled/v3/components/OrButtonV3/OrButton.vue.d.ts +35 -15
  61. package/dist/bundled/v3/components/OrCard/OrCard.vue.d.ts +15 -7
  62. package/dist/bundled/v3/components/OrCardCollection/OrCardCollection.vue.d.ts +47 -21
  63. package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.vue.d.ts +70 -22
  64. package/dist/bundled/v3/components/OrCardV3/OrCard.vue.d.ts +7 -4
  65. package/dist/bundled/v3/components/OrCarousel/OrCarousel.vue.d.ts +676 -126
  66. package/dist/bundled/v3/components/OrCarouselItem/OrCarouselItem.vue.d.ts +1 -1
  67. package/dist/bundled/v3/components/OrCheckbox/OrCheckbox.vue.d.ts +35 -15
  68. package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +24 -6
  69. package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +43 -17
  70. package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.vue.d.ts +53 -23
  71. package/dist/bundled/v3/components/OrChip/OrChip.vue.d.ts +25 -9
  72. package/dist/bundled/v3/components/OrChips/OrChips.vue.d.ts +51 -24
  73. package/dist/bundled/v3/components/OrCode/OrCode.js +10 -6
  74. package/dist/bundled/v3/components/OrCode/OrCode.vue.d.ts +69 -24
  75. package/dist/bundled/v3/components/OrCode/index.js +8 -4
  76. package/dist/bundled/v3/components/OrCode/lang.js +3941 -3
  77. package/dist/bundled/v3/components/OrCode/theme.js +2 -1
  78. package/dist/bundled/v3/components/OrCollapse/OrCollapse.vue.d.ts +39 -17
  79. package/dist/bundled/v3/components/OrColorPicker/OrColorPicker.vue.d.ts +31 -13
  80. package/dist/bundled/v3/components/OrCombinedInputV3/OrCombinedInput.vue.d.ts +30 -8
  81. package/dist/bundled/v3/components/OrConfirm/OrConfirm.js +5 -4
  82. package/dist/bundled/v3/components/OrConfirm/OrConfirm.vue.d.ts +84 -23
  83. package/dist/bundled/v3/components/OrConfirm/index.js +4 -3
  84. package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.js +3 -3
  85. package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.vue.d.ts +91 -29
  86. package/dist/bundled/v3/components/OrConfirmV3/index.js +2 -2
  87. package/dist/bundled/v3/components/OrDatePickerV3/OrDatePicker.vue.d.ts +81 -25
  88. package/dist/bundled/v3/components/OrDateTimePicker/OrDateTimePicker.vue.d.ts +177 -68
  89. package/dist/bundled/v3/components/OrDateTimePickerV3/OrDateTimePicker.vue.d.ts +105 -31
  90. package/dist/bundled/v3/components/OrEmptyStateV3/OrEmptyState.vue.d.ts +28 -11
  91. package/dist/bundled/v3/components/OrError/OrError.vue.d.ts +8 -4
  92. package/dist/bundled/v3/components/OrErrorTagV3/OrErrorTag.vue.d.ts +7 -4
  93. package/dist/bundled/v3/components/OrErrorV3/OrError.vue.d.ts +18 -9
  94. package/dist/bundled/v3/components/OrExpansionPanelV3/OrExpansionPanel.vue.d.ts +35 -14
  95. package/dist/bundled/v3/components/OrFabV3/OrFab.vue.d.ts +20 -8
  96. package/dist/bundled/v3/components/OrFloating/OrFloating.vue.d.ts +46 -15
  97. package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.vue.d.ts +30 -10
  98. package/dist/bundled/v3/components/OrHint/OrHint.vue.d.ts +8 -4
  99. package/dist/bundled/v3/components/OrHintV3/OrHint.vue.d.ts +18 -9
  100. package/dist/bundled/v3/components/OrIcon/OrIcon.vue.d.ts +44 -16
  101. package/dist/bundled/v3/components/OrIconButtonV2/OrIconButton.vue.d.ts +43 -13
  102. package/dist/bundled/v3/components/OrIconButtonV3/OrIconButton.vue.d.ts +52 -16
  103. package/dist/bundled/v3/components/OrIconV3/OrIcon.vue.d.ts +18 -7
  104. package/dist/bundled/v3/components/OrInlineInputBoxV3/OrInlineInputBox.vue.d.ts +16 -7
  105. package/dist/bundled/v3/components/OrInlineInputV3/OrInlineInput.vue.d.ts +83 -39
  106. package/dist/bundled/v3/components/OrInlineTextEdit/OrInlineTextEdit.vue.d.ts +95 -43
  107. package/dist/bundled/v3/components/OrInlineTextareaV3/OrInlineTextarea.vue.d.ts +79 -39
  108. package/dist/bundled/v3/components/OrInput/OrInput.vue.d.ts +87 -36
  109. package/dist/bundled/v3/components/OrInputBoxV3/OrInputBox.vue.d.ts +22 -7
  110. package/dist/bundled/v3/components/OrInputV3/OrInput.vue.d.ts +85 -34
  111. package/dist/bundled/v3/components/OrLabel/OrLabel.vue.d.ts +20 -9
  112. package/dist/bundled/v3/components/OrLabelV3/OrLabel.vue.d.ts +24 -9
  113. package/dist/bundled/v3/components/OrLinkV3/OrLink.vue.d.ts +24 -7
  114. package/dist/bundled/v3/components/OrList/OrList.vue.d.ts +47 -21
  115. package/dist/bundled/v3/components/OrListOfInputs/OrListOfInputs.vue.d.ts +27 -11
  116. package/dist/bundled/v3/components/OrLoader/OrLoader.vue.d.ts +26 -10
  117. package/dist/bundled/v3/components/OrLoaderV3/OrLoader.vue.d.ts +34 -13
  118. package/dist/bundled/v3/components/OrMenuItemV3/OrMenuItem.vue.d.ts +34 -13
  119. package/dist/bundled/v3/components/OrMenuV3/OrMenu.vue.d.ts +43 -16
  120. package/dist/bundled/v3/components/OrModal/OrModal.js +3 -2
  121. package/dist/bundled/v3/components/OrModal/OrModal.vue.d.ts +38 -14
  122. package/dist/bundled/v3/components/OrModal/index.js +2 -1
  123. package/dist/bundled/v3/components/OrModalV3/OrModal.vue.d.ts +31 -15
  124. package/dist/bundled/v3/components/OrNotification/OrNotification.vue.d.ts +27 -9
  125. package/dist/bundled/v3/components/OrNotificationV3/OrNotification.vue.d.ts +20 -9
  126. package/dist/bundled/v3/components/OrNumberInput/OrNumberInput.vue.d.ts +70 -24
  127. package/dist/bundled/v3/components/OrOverflowMenu/OrOverflowMenu.vue.d.ts +31 -13
  128. package/dist/bundled/v3/components/OrOverlay/OrOverlay.vue.d.ts +16 -6
  129. package/dist/bundled/v3/components/OrOverlayV3/OrOverlay.vue.d.ts +14 -7
  130. package/dist/bundled/v3/components/OrPaginationV3/OrPagination.vue.d.ts +75 -27
  131. package/dist/bundled/v3/components/OrPassword/OrPassword.vue.d.ts +63 -22
  132. package/dist/bundled/v3/components/OrPopoverV3/OrPopover.vue.d.ts +74 -27
  133. package/dist/bundled/v3/components/OrProgress/OrProgress.vue.d.ts +56 -20
  134. package/dist/bundled/v3/components/OrProgressV3/OrProgress.vue.d.ts +62 -25
  135. package/dist/bundled/v3/components/OrRadio/OrRadio.vue.d.ts +35 -13
  136. package/dist/bundled/v3/components/OrRadioGroup/OrRadioGroup.vue.d.ts +26 -9
  137. package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +32 -6
  138. package/dist/bundled/v3/components/OrRadioV3/OrRadio.vue.d.ts +49 -21
  139. package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +273 -0
  140. package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +209 -0
  141. package/dist/bundled/v3/components/OrRichTextEditorV3/index.d.ts +1 -0
  142. package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +85 -0
  143. package/dist/bundled/v3/components/OrRichTextEditorV3/styles.d.ts +6 -0
  144. package/dist/bundled/v3/components/OrRichTextEditorV3/styles.js +38 -0
  145. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.d.ts +3 -0
  146. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +46 -0
  147. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.d.ts +27 -0
  148. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +184 -0
  149. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.d.ts +1 -0
  150. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.js +5 -0
  151. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.d.ts +24 -0
  152. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.js +190 -0
  153. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/types.d.ts +19 -0
  154. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/types.js +1 -0
  155. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.d.ts +3 -0
  156. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.js +5 -0
  157. package/dist/bundled/v3/components/OrSearch/OrSearch.vue.d.ts +65 -23
  158. package/dist/bundled/v3/components/OrSearchV3/OrSearch.vue.d.ts +41 -17
  159. package/dist/bundled/v3/components/OrSegmentedControlV3/OrSegmentedControl.vue.d.ts +25 -9
  160. package/dist/bundled/v3/components/OrSelect/OrSelect.vue.d.ts +77 -28
  161. package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +1 -2
  162. package/dist/bundled/v3/components/OrSelectV3/OrSelect.vue.d.ts +115 -37
  163. package/dist/bundled/v3/components/OrSidebar/OrSidebar.vue.d.ts +33 -14
  164. package/dist/bundled/v3/components/OrSidebarV3/OrSidebar.vue.d.ts +63 -28
  165. package/dist/bundled/v3/components/OrSkeletonCircle/OrSkeletonCircle.vue.d.ts +20 -9
  166. package/dist/bundled/v3/components/OrSkeletonCircleV3/OrSkeletonCircle.vue.d.ts +28 -13
  167. package/dist/bundled/v3/components/OrSkeletonRect/OrSkeletonRect.vue.d.ts +22 -9
  168. package/dist/bundled/v3/components/OrSkeletonRectV3/OrSkeletonRect.vue.d.ts +26 -11
  169. package/dist/bundled/v3/components/OrSkeletonText/OrSkeletonText.vue.d.ts +26 -10
  170. package/dist/bundled/v3/components/OrSkeletonTextV3/OrSkeletonText.vue.d.ts +40 -16
  171. package/dist/bundled/v3/components/OrSlider/OrSlider.vue.d.ts +91 -35
  172. package/dist/bundled/v3/components/OrSortHeaderV3/OrSortHeader.vue.d.ts +25 -13
  173. package/dist/bundled/v3/components/OrStepper/OrStepper.vue.d.ts +43 -16
  174. package/dist/bundled/v3/components/OrSwitch/OrSwitch.vue.d.ts +33 -12
  175. package/dist/bundled/v3/components/OrSwitchV3/OrSwitch.vue.d.ts +53 -22
  176. package/dist/bundled/v3/components/OrTab/OrTab.vue.d.ts +22 -9
  177. package/dist/bundled/v3/components/OrTabHeaderItem/OrTabHeaderItem.vue.d.ts +29 -13
  178. package/dist/bundled/v3/components/OrTabV3/OrTab.vue.d.ts +17 -10
  179. package/dist/bundled/v3/components/OrTabs/OrTabs.vue.d.ts +17 -4
  180. package/dist/bundled/v3/components/OrTabsV3/OrTabs.vue.d.ts +69 -24
  181. package/dist/bundled/v3/components/OrTag/OrTag.vue.d.ts +27 -10
  182. package/dist/bundled/v3/components/OrTagV3/OrTag.vue.d.ts +23 -12
  183. package/dist/bundled/v3/components/OrTeleport/OrTeleport.vue3.vue.d.ts +10 -4
  184. package/dist/bundled/v3/components/OrTeleportV3/OrTeleport.vue3.vue.d.ts +10 -4
  185. package/dist/bundled/v3/components/OrTextV3/OrText.vue.d.ts +24 -11
  186. package/dist/bundled/v3/components/OrTextarea/OrTextarea.vue.d.ts +85 -37
  187. package/dist/bundled/v3/components/OrTextareaV3/OrTextarea.vue.d.ts +73 -32
  188. package/dist/bundled/v3/components/OrTextbox/OrTextbox.vue.d.ts +137 -55
  189. package/dist/bundled/v3/components/OrTimePickerV3/OrTimePicker.vue.d.ts +79 -25
  190. package/dist/bundled/v3/components/OrToast/OrToast.vue.d.ts +31 -11
  191. package/dist/bundled/v3/components/OrToastContainer/OrToastContainer.vue.d.ts +55 -25
  192. package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.vue.d.ts +54 -24
  193. package/dist/bundled/v3/components/OrToastV3/OrToast.vue.d.ts +38 -16
  194. package/dist/bundled/v3/components/OrTooltip/OrTooltip.vue.d.ts +33 -14
  195. package/dist/bundled/v3/components/OrTooltipContent/OrTooltipContent.vue.d.ts +10 -4
  196. package/dist/bundled/v3/components/OrTooltipV3/OrTooltip.vue.d.ts +37 -13
  197. package/dist/bundled/v3/components/index.d.ts +1 -0
  198. package/dist/bundled/v3/components/index.js +21 -7
  199. package/dist/bundled/v3/directives/dropdown-close.d.ts +1 -3
  200. package/dist/bundled/v3/directives/dropdown-open.d.ts +1 -3
  201. package/dist/bundled/v3/hooks/useResponsive/useResponsive.d.ts +2 -2
  202. package/dist/bundled/{v2/index-cf2c3c27.js → v3/index-0d224ae5.js} +3 -115
  203. package/dist/bundled/v3/index-1182caa8.js +9633 -0
  204. package/dist/bundled/v3/index-85c2efe8.js +7122 -0
  205. package/dist/bundled/v3/index-d92d0b48.js +3805 -0
  206. package/dist/bundled/{v2/lang-0fb8f78b.js → v3/index-e9f6b2d8.js} +73 -4009
  207. package/dist/bundled/v3/index.es-3f39f316.js +115 -0
  208. package/dist/bundled/v3/index.js +25 -11
  209. package/dist/bundled/v3/markdown-d704b3a8.js +17975 -0
  210. package/dist/bundled/v3/useFocusTrap-48767a70.js +1348 -0
  211. package/dist/esm/v2/OrRichTextEditor-3a078ea0.js +849 -0
  212. package/dist/esm/v2/{OrSelect-9d6b3363.js → OrSelect-9c8f96b2.js} +1 -2
  213. package/dist/esm/v2/codemirrorView-be2c7423.js +353 -0
  214. package/dist/esm/v2/components/index.d.ts +1 -0
  215. package/dist/esm/v2/components/index.js +25 -1
  216. package/dist/esm/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +209 -0
  217. package/dist/esm/v2/components/or-rich-text-editor-v3/index.d.ts +1 -0
  218. package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +59 -0
  219. package/dist/esm/v2/components/or-rich-text-editor-v3/styles.d.ts +6 -0
  220. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +3 -0
  221. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +27 -0
  222. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +1 -0
  223. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.js +7 -0
  224. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/theme.d.ts +24 -0
  225. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +19 -0
  226. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/markdown.d.ts +3 -0
  227. package/dist/esm/v2/components/or-select-v3/index.js +1 -1
  228. package/dist/esm/v2/components/or-text-v3/OrText.vue.d.ts +2 -2
  229. package/dist/esm/v2/components/or-textarea/OrTextarea.vue.d.ts +2 -2
  230. package/dist/esm/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +2 -2
  231. package/dist/esm/v2/components/or-textbox/OrTextbox.vue.d.ts +2 -2
  232. package/dist/esm/v2/components/or-time-picker-v3/OrTimePicker.vue.d.ts +2 -2
  233. package/dist/esm/v2/components/or-toast/OrToast.vue.d.ts +2 -2
  234. package/dist/esm/v2/components/or-toast/or-toast-container/OrToastContainer.vue.d.ts +2 -2
  235. package/dist/esm/v2/components/or-toast-v3/OrToast.vue.d.ts +2 -2
  236. package/dist/esm/v2/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue.d.ts +2 -2
  237. package/dist/esm/v2/components/or-tooltip/OrTooltip.vue.d.ts +2 -2
  238. package/dist/esm/v2/components/or-tooltip/or-tooltip-content/OrTooltipContent.vue.d.ts +2 -2
  239. package/dist/esm/v2/components/or-tooltip-v3/OrTooltip.vue.d.ts +2 -2
  240. package/dist/esm/v2/index.js +25 -1
  241. package/dist/esm/v3/OrRichTextEditor-7264ad21.js +807 -0
  242. package/dist/esm/v3/{OrSelect-3dbddc6b.js → OrSelect-b1d7651a.js} +1 -2
  243. package/dist/esm/v3/codemirrorView-be2c7423.js +353 -0
  244. package/dist/esm/v3/components/index.d.ts +1 -0
  245. package/dist/esm/v3/components/index.js +25 -1
  246. package/dist/esm/v3/components/or-avatar/OrAvatar.vue.d.ts +26 -11
  247. package/dist/esm/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +24 -8
  248. package/dist/esm/v3/components/or-bottom-sheet-v3/OrBottomSheet.vue.d.ts +33 -20
  249. package/dist/esm/v3/components/or-button/OrButton.vue.d.ts +51 -16
  250. package/dist/esm/v3/components/or-button-v2/OrButton.vue.d.ts +57 -20
  251. package/dist/esm/v3/components/or-button-v3/OrButton.vue.d.ts +35 -15
  252. package/dist/esm/v3/components/or-card/OrCard.vue.d.ts +15 -7
  253. package/dist/esm/v3/components/or-card-collection/OrCardCollection.vue.d.ts +47 -21
  254. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +70 -22
  255. package/dist/esm/v3/components/or-card-collection-v3/partials/OrCardCollectionView.vue3.vue.d.ts +14 -6
  256. package/dist/esm/v3/components/or-card-v3/OrCard.vue.d.ts +7 -4
  257. package/dist/esm/v3/components/or-carousel/OrCarousel.vue.d.ts +676 -126
  258. package/dist/esm/v3/components/or-carousel/or-carousel-item/OrCarouselItem.vue.d.ts +1 -1
  259. package/dist/esm/v3/components/or-checkbox/OrCheckbox.vue.d.ts +35 -15
  260. package/dist/esm/v3/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +24 -6
  261. package/dist/esm/v3/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +43 -17
  262. package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +53 -23
  263. package/dist/esm/v3/components/or-chips/OrChips.vue.d.ts +51 -24
  264. package/dist/esm/v3/components/or-chips/or-chip/OrChip.vue.d.ts +25 -9
  265. package/dist/esm/v3/components/or-chips/partials/OrChipsInput.vue.d.ts +37 -17
  266. package/dist/esm/v3/components/or-code/OrCode.vue.d.ts +69 -24
  267. package/dist/esm/v3/components/or-collapse/OrCollapse.vue.d.ts +39 -17
  268. package/dist/esm/v3/components/or-color-picker/OrColorPicker.vue.d.ts +31 -13
  269. package/dist/esm/v3/components/or-combined-input-v3/OrCombinedInput.vue.d.ts +30 -8
  270. package/dist/esm/v3/components/or-confirm/OrConfirm.vue.d.ts +84 -23
  271. package/dist/esm/v3/components/or-confirm-v3/OrConfirm.vue.d.ts +91 -29
  272. package/dist/esm/v3/components/or-date-picker-v3/OrDatePicker.vue.d.ts +81 -25
  273. package/dist/esm/v3/components/or-date-time-picker/OrDateTimePicker.vue.d.ts +177 -68
  274. package/dist/esm/v3/components/or-date-time-picker/partials/OrDateTimePickerCalendarItem.vue.d.ts +33 -12
  275. package/dist/esm/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +105 -31
  276. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-control/OrDateTimePickerDateControl.vue.d.ts +28 -11
  277. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts +39 -17
  278. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/OrDateTimePickerMobileControl.vue.d.ts +15 -7
  279. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +85 -23
  280. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/OrDateTimePickerPopoverFooter.vue.d.ts +11 -7
  281. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/OrDateTimePickerPopoverHeader.vue.d.ts +7 -4
  282. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-control/OrDateTimePickerTimeControl.vue.d.ts +28 -11
  283. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +37 -15
  284. package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +28 -11
  285. package/dist/esm/v3/components/or-error/OrError.vue.d.ts +8 -4
  286. package/dist/esm/v3/components/or-error-tag-v3/OrErrorTag.vue.d.ts +7 -4
  287. package/dist/esm/v3/components/or-error-v3/OrError.vue.d.ts +18 -9
  288. package/dist/esm/v3/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +35 -14
  289. package/dist/esm/v3/components/or-fab-v3/OrFab.vue.d.ts +20 -8
  290. package/dist/esm/v3/components/or-floating/OrFloating.vue.d.ts +46 -15
  291. package/dist/esm/v3/components/or-form-group-v3/OrFormGroup.vue.d.ts +30 -10
  292. package/dist/esm/v3/components/or-hint/OrHint.vue.d.ts +8 -4
  293. package/dist/esm/v3/components/or-hint-v3/OrHint.vue.d.ts +18 -9
  294. package/dist/esm/v3/components/or-icon/OrIcon.vue.d.ts +44 -16
  295. package/dist/esm/v3/components/or-icon-button-v2/OrIconButton.vue.d.ts +43 -13
  296. package/dist/esm/v3/components/or-icon-button-v2/partials/OrTooltipWrapper.vue.d.ts +10 -8
  297. package/dist/esm/v3/components/or-icon-button-v3/OrIconButton.vue.d.ts +52 -16
  298. package/dist/esm/v3/components/or-icon-v3/OrIcon.vue.d.ts +18 -7
  299. package/dist/esm/v3/components/or-inline-input-box-v3/OrInlineInputBox.vue.d.ts +16 -7
  300. package/dist/esm/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +83 -39
  301. package/dist/esm/v3/components/or-inline-text-edit/OrInlineTextEdit.vue.d.ts +95 -43
  302. package/dist/esm/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +79 -39
  303. package/dist/esm/v3/components/or-input/OrInput.vue.d.ts +87 -36
  304. package/dist/esm/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +22 -7
  305. package/dist/esm/v3/components/or-input-v3/OrInput.vue.d.ts +85 -34
  306. package/dist/esm/v3/components/or-label/OrLabel.vue.d.ts +20 -9
  307. package/dist/esm/v3/components/or-label-v3/OrLabel.vue.d.ts +24 -9
  308. package/dist/esm/v3/components/or-link-v3/OrLink.vue.d.ts +24 -7
  309. package/dist/esm/v3/components/or-list/OrList.vue.d.ts +47 -21
  310. package/dist/esm/v3/components/or-list-of-inputs/OrListOfInputs.vue.d.ts +27 -11
  311. package/dist/esm/v3/components/or-loader/OrLoader.vue.d.ts +26 -10
  312. package/dist/esm/v3/components/or-loader-v3/OrLoader.vue.d.ts +34 -13
  313. package/dist/esm/v3/components/or-menu-item-v3/OrMenuItem.vue.d.ts +34 -13
  314. package/dist/esm/v3/components/or-menu-v3/OrMenu.vue.d.ts +43 -16
  315. package/dist/esm/v3/components/or-modal/OrModal.vue.d.ts +38 -14
  316. package/dist/esm/v3/components/or-modal-v3/OrModal.vue.d.ts +31 -15
  317. package/dist/esm/v3/components/or-notification/OrNotification.vue.d.ts +27 -9
  318. package/dist/esm/v3/components/or-notification-v3/OrNotification.vue.d.ts +20 -9
  319. package/dist/esm/v3/components/or-number-input/OrNumberInput.vue.d.ts +70 -24
  320. package/dist/esm/v3/components/or-overflow-menu/OrOverflowMenu.vue.d.ts +31 -13
  321. package/dist/esm/v3/components/or-overflow-menu/partials/OrOverflowMenuItem.vue.d.ts +23 -7
  322. package/dist/esm/v3/components/or-overlay/OrOverlay.vue.d.ts +16 -6
  323. package/dist/esm/v3/components/or-overlay-v3/OrOverlay.vue.d.ts +14 -7
  324. package/dist/esm/v3/components/or-pagination-v3/OrPagination.vue.d.ts +75 -27
  325. package/dist/esm/v3/components/or-password/OrPassword.vue.d.ts +63 -22
  326. package/dist/esm/v3/components/or-popover-v3/OrPopover.vue.d.ts +74 -27
  327. package/dist/esm/v3/components/or-progress/OrProgress.vue.d.ts +56 -20
  328. package/dist/esm/v3/components/or-progress-v3/OrProgress.vue.d.ts +62 -25
  329. package/dist/esm/v3/components/or-radio/OrRadio.vue.d.ts +35 -13
  330. package/dist/esm/v3/components/or-radio-group/OrRadioGroup.vue.d.ts +26 -9
  331. package/dist/esm/v3/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +32 -6
  332. package/dist/esm/v3/components/or-radio-v3/OrRadio.vue.d.ts +49 -21
  333. package/dist/esm/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +209 -0
  334. package/dist/esm/v3/components/or-rich-text-editor-v3/index.d.ts +1 -0
  335. package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +57 -0
  336. package/dist/esm/v3/components/or-rich-text-editor-v3/styles.d.ts +6 -0
  337. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +3 -0
  338. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +27 -0
  339. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +1 -0
  340. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.js +7 -0
  341. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/theme.d.ts +24 -0
  342. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +19 -0
  343. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/markdown.d.ts +3 -0
  344. package/dist/esm/v3/components/or-search/OrSearch.vue.d.ts +65 -23
  345. package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +41 -17
  346. package/dist/esm/v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +25 -9
  347. package/dist/esm/v3/components/or-segmented-control-v3/partials/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +20 -8
  348. package/dist/esm/v3/components/or-select/OrSelect.vue.d.ts +77 -28
  349. package/dist/esm/v3/components/or-select/partials/OrSelectContent.vue.d.ts +49 -18
  350. package/dist/esm/v3/components/or-select/partials/OrSelectContentEmpty.vue.d.ts +16 -4
  351. package/dist/esm/v3/components/or-select/partials/OrSelectContentOptions.vue.d.ts +67 -13
  352. package/dist/esm/v3/components/or-select/partials/OrSelectInput.vue.d.ts +41 -16
  353. package/dist/esm/v3/components/or-select/partials/OrSelectInputValue.vue.d.ts +35 -16
  354. package/dist/esm/v3/components/or-select/partials/OrSelectMain.vue.d.ts +71 -24
  355. package/dist/esm/v3/components/or-select/partials/OrSelectOption.vue.d.ts +19 -7
  356. package/dist/esm/v3/components/or-select/partials/OrSelectSearchOptions.vue.d.ts +24 -11
  357. package/dist/esm/v3/components/or-select-v3/OrSelect.vue.d.ts +115 -37
  358. package/dist/esm/v3/components/or-select-v3/index.js +1 -1
  359. package/dist/esm/v3/components/or-sidebar/OrSidebar.vue.d.ts +33 -14
  360. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +63 -28
  361. package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue.d.ts +23 -10
  362. package/dist/esm/v3/components/or-skeleton/or-skeleton-circle/OrSkeletonCircle.vue.d.ts +20 -9
  363. package/dist/esm/v3/components/or-skeleton/or-skeleton-rect/OrSkeletonRect.vue.d.ts +22 -9
  364. package/dist/esm/v3/components/or-skeleton/or-skeleton-text/OrSkeletonText.vue.d.ts +26 -10
  365. package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-circle-v3/OrSkeletonCircle.vue.d.ts +28 -13
  366. package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-rect-v3/OrSkeletonRect.vue.d.ts +26 -11
  367. package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-text-v3/OrSkeletonText.vue.d.ts +40 -16
  368. package/dist/esm/v3/components/or-slider/OrSlider.vue.d.ts +91 -35
  369. package/dist/esm/v3/components/or-sort-header-v3/OrSortHeader.vue.d.ts +25 -13
  370. package/dist/esm/v3/components/or-stepper/OrStepper.vue.d.ts +43 -16
  371. package/dist/esm/v3/components/or-stepper/partials/OrStepperButtonOptions.vue.d.ts +20 -4
  372. package/dist/esm/v3/components/or-stepper/partials/OrStepperOptionHorizontal.vue.d.ts +26 -4
  373. package/dist/esm/v3/components/or-stepper/partials/OrStepperOptionVertical.vue.d.ts +26 -4
  374. package/dist/esm/v3/components/or-stepper/partials/OrStepperTitle.vue.d.ts +22 -6
  375. package/dist/esm/v3/components/or-stepper/partials/StatusIcon.vue.d.ts +12 -6
  376. package/dist/esm/v3/components/or-switch/OrSwitch.vue.d.ts +33 -12
  377. package/dist/esm/v3/components/or-switch-v3/OrSwitch.vue.d.ts +53 -22
  378. package/dist/esm/v3/components/or-tab/OrTab.vue.d.ts +22 -9
  379. package/dist/esm/v3/components/or-tab-header-item/OrTabHeaderItem.vue.d.ts +29 -13
  380. package/dist/esm/v3/components/or-tab-v3/OrTab.vue.d.ts +17 -10
  381. package/dist/esm/v3/components/or-tabs/OrTabs.vue.d.ts +17 -4
  382. package/dist/esm/v3/components/or-tabs-v3/OrTabs.vue.d.ts +69 -24
  383. package/dist/esm/v3/components/or-tag/OrTag.vue.d.ts +27 -10
  384. package/dist/esm/v3/components/or-tag-v3/OrTag.vue.d.ts +23 -12
  385. package/dist/esm/v3/components/or-teleport/OrTeleport.vue3.vue.d.ts +10 -4
  386. package/dist/esm/v3/components/or-teleport-v3/OrTeleport.vue3.vue.d.ts +10 -4
  387. package/dist/esm/v3/components/or-text-v3/OrText.vue.d.ts +24 -11
  388. package/dist/esm/v3/components/or-textarea/OrTextarea.vue.d.ts +85 -37
  389. package/dist/esm/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +73 -32
  390. package/dist/esm/v3/components/or-textbox/OrTextbox.vue.d.ts +137 -55
  391. package/dist/esm/v3/components/or-time-picker-v3/OrTimePicker.vue.d.ts +79 -25
  392. package/dist/esm/v3/components/or-toast/OrToast.vue.d.ts +31 -11
  393. package/dist/esm/v3/components/or-toast/or-toast-container/OrToastContainer.vue.d.ts +55 -25
  394. package/dist/esm/v3/components/or-toast-v3/OrToast.vue.d.ts +38 -16
  395. package/dist/esm/v3/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue.d.ts +54 -24
  396. package/dist/esm/v3/components/or-tooltip/OrTooltip.vue.d.ts +33 -14
  397. package/dist/esm/v3/components/or-tooltip/or-tooltip-content/OrTooltipContent.vue.d.ts +10 -4
  398. package/dist/esm/v3/components/or-tooltip-v3/OrTooltip.vue.d.ts +37 -13
  399. package/dist/esm/v3/directives/dropdown-close.d.ts +1 -3
  400. package/dist/esm/v3/directives/dropdown-open.d.ts +1 -3
  401. package/dist/esm/v3/hooks/useResponsive/useResponsive.d.ts +2 -2
  402. package/dist/esm/v3/index.js +25 -1
  403. package/package.json +25 -5
  404. package/src/components/index.ts +1 -0
  405. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.docs.mdx +7 -0
  406. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +123 -0
  407. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +722 -0
  408. package/src/components/or-rich-text-editor-v3/index.ts +1 -0
  409. package/src/components/or-rich-text-editor-v3/styles.ts +55 -0
  410. package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.ts +40 -0
  411. package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.ts +254 -0
  412. package/src/components/or-rich-text-editor-v3/utils/codemirror/index.ts +1 -0
  413. package/src/components/or-rich-text-editor-v3/utils/codemirror/theme.ts +213 -0
  414. package/src/components/or-rich-text-editor-v3/utils/codemirror/types.ts +22 -0
  415. package/src/components/or-rich-text-editor-v3/utils/markdown.ts +117 -0
  416. package/src/components/or-select-v3/OrSelect.stories3.ts +1 -39
  417. package/src/components/or-select-v3/OrSelect.vue +0 -1
  418. /package/dist/bundled/v2/{index-968c331a.js → index-f6664cb1.js} +0 -0
  419. /package/dist/bundled/v3/{index-968c331a.js → index-f6664cb1.js} +0 -0
@@ -0,0 +1,1861 @@
1
+ import { defineComponent, ref, onMounted, onBeforeUnmount, computed, watch } from 'vue-demi';
2
+ import { u as useFocusTrap } from './useFocusTrap-48767a70.js';
3
+ import { useResizeObserver, onClickOutside } from '@vueuse/core';
4
+ import { B as Blockquote, a as Bold, b as BulletList, C as CodeBlock, H as HardBreak, I as Italic, L as ListItem, O as OrderedList, P as Paragraph, S as Strike, s as serialize, d as deserialize, U as Underline, c as Link, e as Highlight } from './markdown-d704b3a8.js';
5
+ import { EditorContainer, ToolbarContainer, Toolbar, ToolbarButtonFocused, ToolbarButton, EditorInput } from './components/OrRichTextEditorV3/styles.js';
6
+ import { M as Mark, m as mergeAttributes, a as markInputRule, b as markPasteRule, N as Node, E as Extension, k as keydownHandler, D as DecorationSet, c as Decoration, d as callOrReturn, g as getExtensionField, t as textblockTypeInputRule, n as nodeInputRule, e as Editor } from './index-1182caa8.js';
7
+ import { P as Plugin, d as dropPoint, S as Selection, N as NodeSelection, F as Fragment, a as Slice, T as TextSelection, b as PluginKey, M as Mapping } from './index-85c2efe8.js';
8
+ import codemirrorNode from './components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js';
9
+ import './components/OrIconButtonV3/OrIconButton.js';
10
+ import './components/OrLabelV3/OrLabel.js';
11
+ import './components/OrMenuItemV3/OrMenuItem.js';
12
+ import './components/OrMenuV3/OrMenu.js';
13
+ import './components/OrModalV3/OrModal.js';
14
+ import { s as script$5 } from './OrModal.vue_vue_type_script_lang-0c36a3de.js';
15
+ import './components/OrInputV3/OrInput.js';
16
+ import './components/OrButtonV3/OrButton.js';
17
+ import { s as script$1 } from './OrIconButton.vue_vue_type_script_lang-e786c9e5.js';
18
+ import { s as script$2 } from './OrLabel.vue_vue_type_script_lang-3e11ab8a.js';
19
+ import { s as script$3 } from './OrMenuItem.vue_vue_type_script_lang-b338d68a.js';
20
+ import { s as script$4 } from './OrMenu.vue_vue_type_script_lang-a18d3c8d.js';
21
+ import { s as script$6 } from './OrInput.vue_vue_type_script_lang-223ac3b9.js';
22
+ import { s as script$7 } from './OrButton.vue_vue_type_script_lang-f58fa1b8.js';
23
+
24
+ const inputRegex = /(?:^|\s)((?:`)((?:[^`]+))(?:`))$/;
25
+ const pasteRegex = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/g;
26
+ const Code = Mark.create({
27
+ name: 'code',
28
+ addOptions() {
29
+ return {
30
+ HTMLAttributes: {}
31
+ };
32
+ },
33
+ excludes: '_',
34
+ code: true,
35
+ exitable: true,
36
+ parseHTML() {
37
+ return [{
38
+ tag: 'code'
39
+ }];
40
+ },
41
+ renderHTML(_ref) {
42
+ let {
43
+ HTMLAttributes
44
+ } = _ref;
45
+ return ['code', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
46
+ },
47
+ addCommands() {
48
+ return {
49
+ setCode: () => _ref2 => {
50
+ let {
51
+ commands
52
+ } = _ref2;
53
+ return commands.setMark(this.name);
54
+ },
55
+ toggleCode: () => _ref3 => {
56
+ let {
57
+ commands
58
+ } = _ref3;
59
+ return commands.toggleMark(this.name);
60
+ },
61
+ unsetCode: () => _ref4 => {
62
+ let {
63
+ commands
64
+ } = _ref4;
65
+ return commands.unsetMark(this.name);
66
+ }
67
+ };
68
+ },
69
+ addKeyboardShortcuts() {
70
+ return {
71
+ 'Mod-e': () => this.editor.commands.toggleCode()
72
+ };
73
+ },
74
+ addInputRules() {
75
+ return [markInputRule({
76
+ find: inputRegex,
77
+ type: this.type
78
+ })];
79
+ },
80
+ addPasteRules() {
81
+ return [markPasteRule({
82
+ find: pasteRegex,
83
+ type: this.type
84
+ })];
85
+ }
86
+ });
87
+
88
+ const Document = Node.create({
89
+ name: 'doc',
90
+ topNode: true,
91
+ content: 'block+'
92
+ });
93
+
94
+ /**
95
+ Create a plugin that, when added to a ProseMirror instance,
96
+ causes a decoration to show up at the drop position when something
97
+ is dragged over the editor.
98
+
99
+ Nodes may add a `disableDropCursor` property to their spec to
100
+ control the showing of a drop cursor inside them. This may be a
101
+ boolean or a function, which will be called with a view and a
102
+ position, and should return a boolean.
103
+ */
104
+ function dropCursor() {
105
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
106
+ return new Plugin({
107
+ view(editorView) {
108
+ return new DropCursorView(editorView, options);
109
+ }
110
+ });
111
+ }
112
+ class DropCursorView {
113
+ constructor(editorView, options) {
114
+ var _a;
115
+ this.editorView = editorView;
116
+ this.cursorPos = null;
117
+ this.element = null;
118
+ this.timeout = -1;
119
+ this.width = (_a = options.width) !== null && _a !== void 0 ? _a : 1;
120
+ this.color = options.color === false ? undefined : options.color || "black";
121
+ this.class = options.class;
122
+ this.handlers = ["dragover", "dragend", "drop", "dragleave"].map(name => {
123
+ let handler = e => {
124
+ this[name](e);
125
+ };
126
+ editorView.dom.addEventListener(name, handler);
127
+ return {
128
+ name,
129
+ handler
130
+ };
131
+ });
132
+ }
133
+ destroy() {
134
+ this.handlers.forEach(_ref => {
135
+ let {
136
+ name,
137
+ handler
138
+ } = _ref;
139
+ return this.editorView.dom.removeEventListener(name, handler);
140
+ });
141
+ }
142
+ update(editorView, prevState) {
143
+ if (this.cursorPos != null && prevState.doc != editorView.state.doc) {
144
+ if (this.cursorPos > editorView.state.doc.content.size) this.setCursor(null);else this.updateOverlay();
145
+ }
146
+ }
147
+ setCursor(pos) {
148
+ if (pos == this.cursorPos) return;
149
+ this.cursorPos = pos;
150
+ if (pos == null) {
151
+ this.element.parentNode.removeChild(this.element);
152
+ this.element = null;
153
+ } else {
154
+ this.updateOverlay();
155
+ }
156
+ }
157
+ updateOverlay() {
158
+ let $pos = this.editorView.state.doc.resolve(this.cursorPos);
159
+ let isBlock = !$pos.parent.inlineContent,
160
+ rect;
161
+ if (isBlock) {
162
+ let before = $pos.nodeBefore,
163
+ after = $pos.nodeAfter;
164
+ if (before || after) {
165
+ let node = this.editorView.nodeDOM(this.cursorPos - (before ? before.nodeSize : 0));
166
+ if (node) {
167
+ let nodeRect = node.getBoundingClientRect();
168
+ let top = before ? nodeRect.bottom : nodeRect.top;
169
+ if (before && after) top = (top + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2;
170
+ rect = {
171
+ left: nodeRect.left,
172
+ right: nodeRect.right,
173
+ top: top - this.width / 2,
174
+ bottom: top + this.width / 2
175
+ };
176
+ }
177
+ }
178
+ }
179
+ if (!rect) {
180
+ let coords = this.editorView.coordsAtPos(this.cursorPos);
181
+ rect = {
182
+ left: coords.left - this.width / 2,
183
+ right: coords.left + this.width / 2,
184
+ top: coords.top,
185
+ bottom: coords.bottom
186
+ };
187
+ }
188
+ let parent = this.editorView.dom.offsetParent;
189
+ if (!this.element) {
190
+ this.element = parent.appendChild(document.createElement("div"));
191
+ if (this.class) this.element.className = this.class;
192
+ this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;";
193
+ if (this.color) {
194
+ this.element.style.backgroundColor = this.color;
195
+ }
196
+ }
197
+ this.element.classList.toggle("prosemirror-dropcursor-block", isBlock);
198
+ this.element.classList.toggle("prosemirror-dropcursor-inline", !isBlock);
199
+ let parentLeft, parentTop;
200
+ if (!parent || parent == document.body && getComputedStyle(parent).position == "static") {
201
+ parentLeft = -pageXOffset;
202
+ parentTop = -pageYOffset;
203
+ } else {
204
+ let rect = parent.getBoundingClientRect();
205
+ parentLeft = rect.left - parent.scrollLeft;
206
+ parentTop = rect.top - parent.scrollTop;
207
+ }
208
+ this.element.style.left = rect.left - parentLeft + "px";
209
+ this.element.style.top = rect.top - parentTop + "px";
210
+ this.element.style.width = rect.right - rect.left + "px";
211
+ this.element.style.height = rect.bottom - rect.top + "px";
212
+ }
213
+ scheduleRemoval(timeout) {
214
+ clearTimeout(this.timeout);
215
+ this.timeout = setTimeout(() => this.setCursor(null), timeout);
216
+ }
217
+ dragover(event) {
218
+ if (!this.editorView.editable) return;
219
+ let pos = this.editorView.posAtCoords({
220
+ left: event.clientX,
221
+ top: event.clientY
222
+ });
223
+ let node = pos && pos.inside >= 0 && this.editorView.state.doc.nodeAt(pos.inside);
224
+ let disableDropCursor = node && node.type.spec.disableDropCursor;
225
+ let disabled = typeof disableDropCursor == "function" ? disableDropCursor(this.editorView, pos, event) : disableDropCursor;
226
+ if (pos && !disabled) {
227
+ let target = pos.pos;
228
+ if (this.editorView.dragging && this.editorView.dragging.slice) {
229
+ let point = dropPoint(this.editorView.state.doc, target, this.editorView.dragging.slice);
230
+ if (point != null) target = point;
231
+ }
232
+ this.setCursor(target);
233
+ this.scheduleRemoval(5000);
234
+ }
235
+ }
236
+ dragend() {
237
+ this.scheduleRemoval(20);
238
+ }
239
+ drop() {
240
+ this.scheduleRemoval(20);
241
+ }
242
+ dragleave(event) {
243
+ if (event.target == this.editorView.dom || !this.editorView.dom.contains(event.relatedTarget)) this.setCursor(null);
244
+ }
245
+ }
246
+
247
+ const Dropcursor = Extension.create({
248
+ name: 'dropCursor',
249
+ addOptions() {
250
+ return {
251
+ color: 'currentColor',
252
+ width: 1,
253
+ class: undefined
254
+ };
255
+ },
256
+ addProseMirrorPlugins() {
257
+ return [dropCursor(this.options)];
258
+ }
259
+ });
260
+
261
+ /**
262
+ Gap cursor selections are represented using this class. Its
263
+ `$anchor` and `$head` properties both point at the cursor position.
264
+ */
265
+ class GapCursor extends Selection {
266
+ /**
267
+ Create a gap cursor.
268
+ */
269
+ constructor($pos) {
270
+ super($pos, $pos);
271
+ }
272
+ map(doc, mapping) {
273
+ let $pos = doc.resolve(mapping.map(this.head));
274
+ return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
275
+ }
276
+ content() {
277
+ return Slice.empty;
278
+ }
279
+ eq(other) {
280
+ return other instanceof GapCursor && other.head == this.head;
281
+ }
282
+ toJSON() {
283
+ return {
284
+ type: "gapcursor",
285
+ pos: this.head
286
+ };
287
+ }
288
+ /**
289
+ @internal
290
+ */
291
+ static fromJSON(doc, json) {
292
+ if (typeof json.pos != "number") throw new RangeError("Invalid input for GapCursor.fromJSON");
293
+ return new GapCursor(doc.resolve(json.pos));
294
+ }
295
+ /**
296
+ @internal
297
+ */
298
+ getBookmark() {
299
+ return new GapBookmark(this.anchor);
300
+ }
301
+ /**
302
+ @internal
303
+ */
304
+ static valid($pos) {
305
+ let parent = $pos.parent;
306
+ if (parent.isTextblock || !closedBefore($pos) || !closedAfter($pos)) return false;
307
+ let override = parent.type.spec.allowGapCursor;
308
+ if (override != null) return override;
309
+ let deflt = parent.contentMatchAt($pos.index()).defaultType;
310
+ return deflt && deflt.isTextblock;
311
+ }
312
+ /**
313
+ @internal
314
+ */
315
+ static findGapCursorFrom($pos, dir) {
316
+ let mustMove = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
317
+ search: for (;;) {
318
+ if (!mustMove && GapCursor.valid($pos)) return $pos;
319
+ let pos = $pos.pos,
320
+ next = null;
321
+ // Scan up from this position
322
+ for (let d = $pos.depth;; d--) {
323
+ let parent = $pos.node(d);
324
+ if (dir > 0 ? $pos.indexAfter(d) < parent.childCount : $pos.index(d) > 0) {
325
+ next = parent.child(dir > 0 ? $pos.indexAfter(d) : $pos.index(d) - 1);
326
+ break;
327
+ } else if (d == 0) {
328
+ return null;
329
+ }
330
+ pos += dir;
331
+ let $cur = $pos.doc.resolve(pos);
332
+ if (GapCursor.valid($cur)) return $cur;
333
+ }
334
+ // And then down into the next node
335
+ for (;;) {
336
+ let inside = dir > 0 ? next.firstChild : next.lastChild;
337
+ if (!inside) {
338
+ if (next.isAtom && !next.isText && !NodeSelection.isSelectable(next)) {
339
+ $pos = $pos.doc.resolve(pos + next.nodeSize * dir);
340
+ mustMove = false;
341
+ continue search;
342
+ }
343
+ break;
344
+ }
345
+ next = inside;
346
+ pos += dir;
347
+ let $cur = $pos.doc.resolve(pos);
348
+ if (GapCursor.valid($cur)) return $cur;
349
+ }
350
+ return null;
351
+ }
352
+ }
353
+ }
354
+ GapCursor.prototype.visible = false;
355
+ GapCursor.findFrom = GapCursor.findGapCursorFrom;
356
+ Selection.jsonID("gapcursor", GapCursor);
357
+ class GapBookmark {
358
+ constructor(pos) {
359
+ this.pos = pos;
360
+ }
361
+ map(mapping) {
362
+ return new GapBookmark(mapping.map(this.pos));
363
+ }
364
+ resolve(doc) {
365
+ let $pos = doc.resolve(this.pos);
366
+ return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
367
+ }
368
+ }
369
+ function closedBefore($pos) {
370
+ for (let d = $pos.depth; d >= 0; d--) {
371
+ let index = $pos.index(d),
372
+ parent = $pos.node(d);
373
+ // At the start of this parent, look at next one
374
+ if (index == 0) {
375
+ if (parent.type.spec.isolating) return true;
376
+ continue;
377
+ }
378
+ // See if the node before (or its first ancestor) is closed
379
+ for (let before = parent.child(index - 1);; before = before.lastChild) {
380
+ if (before.childCount == 0 && !before.inlineContent || before.isAtom || before.type.spec.isolating) return true;
381
+ if (before.inlineContent) return false;
382
+ }
383
+ }
384
+ // Hit start of document
385
+ return true;
386
+ }
387
+ function closedAfter($pos) {
388
+ for (let d = $pos.depth; d >= 0; d--) {
389
+ let index = $pos.indexAfter(d),
390
+ parent = $pos.node(d);
391
+ if (index == parent.childCount) {
392
+ if (parent.type.spec.isolating) return true;
393
+ continue;
394
+ }
395
+ for (let after = parent.child(index);; after = after.firstChild) {
396
+ if (after.childCount == 0 && !after.inlineContent || after.isAtom || after.type.spec.isolating) return true;
397
+ if (after.inlineContent) return false;
398
+ }
399
+ }
400
+ return true;
401
+ }
402
+
403
+ /**
404
+ Create a gap cursor plugin. When enabled, this will capture clicks
405
+ near and arrow-key-motion past places that don't have a normally
406
+ selectable position nearby, and create a gap cursor selection for
407
+ them. The cursor is drawn as an element with class
408
+ `ProseMirror-gapcursor`. You can either include
409
+ `style/gapcursor.css` from the package's directory or add your own
410
+ styles to make it visible.
411
+ */
412
+ function gapCursor() {
413
+ return new Plugin({
414
+ props: {
415
+ decorations: drawGapCursor,
416
+ createSelectionBetween(_view, $anchor, $head) {
417
+ return $anchor.pos == $head.pos && GapCursor.valid($head) ? new GapCursor($head) : null;
418
+ },
419
+ handleClick,
420
+ handleKeyDown,
421
+ handleDOMEvents: {
422
+ beforeinput: beforeinput
423
+ }
424
+ }
425
+ });
426
+ }
427
+ const handleKeyDown = keydownHandler({
428
+ "ArrowLeft": arrow("horiz", -1),
429
+ "ArrowRight": arrow("horiz", 1),
430
+ "ArrowUp": arrow("vert", -1),
431
+ "ArrowDown": arrow("vert", 1)
432
+ });
433
+ function arrow(axis, dir) {
434
+ const dirStr = axis == "vert" ? dir > 0 ? "down" : "up" : dir > 0 ? "right" : "left";
435
+ return function (state, dispatch, view) {
436
+ let sel = state.selection;
437
+ let $start = dir > 0 ? sel.$to : sel.$from,
438
+ mustMove = sel.empty;
439
+ if (sel instanceof TextSelection) {
440
+ if (!view.endOfTextblock(dirStr) || $start.depth == 0) return false;
441
+ mustMove = false;
442
+ $start = state.doc.resolve(dir > 0 ? $start.after() : $start.before());
443
+ }
444
+ let $found = GapCursor.findGapCursorFrom($start, dir, mustMove);
445
+ if (!$found) return false;
446
+ if (dispatch) dispatch(state.tr.setSelection(new GapCursor($found)));
447
+ return true;
448
+ };
449
+ }
450
+ function handleClick(view, pos, event) {
451
+ if (!view || !view.editable) return false;
452
+ let $pos = view.state.doc.resolve(pos);
453
+ if (!GapCursor.valid($pos)) return false;
454
+ let clickPos = view.posAtCoords({
455
+ left: event.clientX,
456
+ top: event.clientY
457
+ });
458
+ if (clickPos && clickPos.inside > -1 && NodeSelection.isSelectable(view.state.doc.nodeAt(clickPos.inside))) return false;
459
+ view.dispatch(view.state.tr.setSelection(new GapCursor($pos)));
460
+ return true;
461
+ }
462
+ // This is a hack that, when a composition starts while a gap cursor
463
+ // is active, quickly creates an inline context for the composition to
464
+ // happen in, to avoid it being aborted by the DOM selection being
465
+ // moved into a valid position.
466
+ function beforeinput(view, event) {
467
+ if (event.inputType != "insertCompositionText" || !(view.state.selection instanceof GapCursor)) return false;
468
+ let {
469
+ $from
470
+ } = view.state.selection;
471
+ let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);
472
+ if (!insert) return false;
473
+ let frag = Fragment.empty;
474
+ for (let i = insert.length - 1; i >= 0; i--) frag = Fragment.from(insert[i].createAndFill(null, frag));
475
+ let tr = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));
476
+ tr.setSelection(TextSelection.near(tr.doc.resolve($from.pos + 1)));
477
+ view.dispatch(tr);
478
+ return false;
479
+ }
480
+ function drawGapCursor(state) {
481
+ if (!(state.selection instanceof GapCursor)) return null;
482
+ let node = document.createElement("div");
483
+ node.className = "ProseMirror-gapcursor";
484
+ return DecorationSet.create(state.doc, [Decoration.widget(state.selection.head, node, {
485
+ key: "gapcursor"
486
+ })]);
487
+ }
488
+
489
+ const Gapcursor = Extension.create({
490
+ name: 'gapCursor',
491
+ addProseMirrorPlugins() {
492
+ return [gapCursor()];
493
+ },
494
+ extendNodeSchema(extension) {
495
+ var _a;
496
+ const context = {
497
+ name: extension.name,
498
+ options: extension.options,
499
+ storage: extension.storage
500
+ };
501
+ return {
502
+ allowGapCursor: (_a = callOrReturn(getExtensionField(extension, 'allowGapCursor', context))) !== null && _a !== void 0 ? _a : null
503
+ };
504
+ }
505
+ });
506
+
507
+ const Heading = Node.create({
508
+ name: 'heading',
509
+ addOptions() {
510
+ return {
511
+ levels: [1, 2, 3, 4, 5, 6],
512
+ HTMLAttributes: {}
513
+ };
514
+ },
515
+ content: 'inline*',
516
+ group: 'block',
517
+ defining: true,
518
+ addAttributes() {
519
+ return {
520
+ level: {
521
+ default: 1,
522
+ rendered: false
523
+ }
524
+ };
525
+ },
526
+ parseHTML() {
527
+ return this.options.levels.map(level => ({
528
+ tag: `h${level}`,
529
+ attrs: {
530
+ level
531
+ }
532
+ }));
533
+ },
534
+ renderHTML(_ref) {
535
+ let {
536
+ node,
537
+ HTMLAttributes
538
+ } = _ref;
539
+ const hasLevel = this.options.levels.includes(node.attrs.level);
540
+ const level = hasLevel ? node.attrs.level : this.options.levels[0];
541
+ return [`h${level}`, mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
542
+ },
543
+ addCommands() {
544
+ return {
545
+ setHeading: attributes => _ref2 => {
546
+ let {
547
+ commands
548
+ } = _ref2;
549
+ if (!this.options.levels.includes(attributes.level)) {
550
+ return false;
551
+ }
552
+ return commands.setNode(this.name, attributes);
553
+ },
554
+ toggleHeading: attributes => _ref3 => {
555
+ let {
556
+ commands
557
+ } = _ref3;
558
+ if (!this.options.levels.includes(attributes.level)) {
559
+ return false;
560
+ }
561
+ return commands.toggleNode(this.name, 'paragraph', attributes);
562
+ }
563
+ };
564
+ },
565
+ addKeyboardShortcuts() {
566
+ return this.options.levels.reduce((items, level) => ({
567
+ ...items,
568
+ ...{
569
+ [`Mod-Alt-${level}`]: () => this.editor.commands.toggleHeading({
570
+ level
571
+ })
572
+ }
573
+ }), {});
574
+ },
575
+ addInputRules() {
576
+ return this.options.levels.map(level => {
577
+ return textblockTypeInputRule({
578
+ find: new RegExp(`^(#{1,${level}})\\s$`),
579
+ type: this.type,
580
+ getAttributes: {
581
+ level
582
+ }
583
+ });
584
+ });
585
+ }
586
+ });
587
+
588
+ var GOOD_LEAF_SIZE = 200;
589
+
590
+ // :: class<T> A rope sequence is a persistent sequence data structure
591
+ // that supports appending, prepending, and slicing without doing a
592
+ // full copy. It is represented as a mostly-balanced tree.
593
+ var RopeSequence = function RopeSequence() {};
594
+ RopeSequence.prototype.append = function append(other) {
595
+ if (!other.length) {
596
+ return this;
597
+ }
598
+ other = RopeSequence.from(other);
599
+ return !this.length && other || other.length < GOOD_LEAF_SIZE && this.leafAppend(other) || this.length < GOOD_LEAF_SIZE && other.leafPrepend(this) || this.appendInner(other);
600
+ };
601
+
602
+ // :: (union<[T], RopeSequence<T>>) → RopeSequence<T>
603
+ // Prepend an array or other rope to this one, returning a new rope.
604
+ RopeSequence.prototype.prepend = function prepend(other) {
605
+ if (!other.length) {
606
+ return this;
607
+ }
608
+ return RopeSequence.from(other).append(this);
609
+ };
610
+ RopeSequence.prototype.appendInner = function appendInner(other) {
611
+ return new Append(this, other);
612
+ };
613
+
614
+ // :: (?number, ?number) → RopeSequence<T>
615
+ // Create a rope repesenting a sub-sequence of this rope.
616
+ RopeSequence.prototype.slice = function slice(from, to) {
617
+ if (from === void 0) from = 0;
618
+ if (to === void 0) to = this.length;
619
+ if (from >= to) {
620
+ return RopeSequence.empty;
621
+ }
622
+ return this.sliceInner(Math.max(0, from), Math.min(this.length, to));
623
+ };
624
+
625
+ // :: (number) → T
626
+ // Retrieve the element at the given position from this rope.
627
+ RopeSequence.prototype.get = function get(i) {
628
+ if (i < 0 || i >= this.length) {
629
+ return undefined;
630
+ }
631
+ return this.getInner(i);
632
+ };
633
+
634
+ // :: ((element: T, index: number) → ?bool, ?number, ?number)
635
+ // Call the given function for each element between the given
636
+ // indices. This tends to be more efficient than looping over the
637
+ // indices and calling `get`, because it doesn't have to descend the
638
+ // tree for every element.
639
+ RopeSequence.prototype.forEach = function forEach(f, from, to) {
640
+ if (from === void 0) from = 0;
641
+ if (to === void 0) to = this.length;
642
+ if (from <= to) {
643
+ this.forEachInner(f, from, to, 0);
644
+ } else {
645
+ this.forEachInvertedInner(f, from, to, 0);
646
+ }
647
+ };
648
+
649
+ // :: ((element: T, index: number) → U, ?number, ?number) → [U]
650
+ // Map the given functions over the elements of the rope, producing
651
+ // a flat array.
652
+ RopeSequence.prototype.map = function map(f, from, to) {
653
+ if (from === void 0) from = 0;
654
+ if (to === void 0) to = this.length;
655
+ var result = [];
656
+ this.forEach(function (elt, i) {
657
+ return result.push(f(elt, i));
658
+ }, from, to);
659
+ return result;
660
+ };
661
+
662
+ // :: (?union<[T], RopeSequence<T>>) → RopeSequence<T>
663
+ // Create a rope representing the given array, or return the rope
664
+ // itself if a rope was given.
665
+ RopeSequence.from = function from(values) {
666
+ if (values instanceof RopeSequence) {
667
+ return values;
668
+ }
669
+ return values && values.length ? new Leaf(values) : RopeSequence.empty;
670
+ };
671
+ var Leaf = /*@__PURE__*/function (RopeSequence) {
672
+ function Leaf(values) {
673
+ RopeSequence.call(this);
674
+ this.values = values;
675
+ }
676
+ if (RopeSequence) Leaf.__proto__ = RopeSequence;
677
+ Leaf.prototype = Object.create(RopeSequence && RopeSequence.prototype);
678
+ Leaf.prototype.constructor = Leaf;
679
+ var prototypeAccessors = {
680
+ length: {
681
+ configurable: true
682
+ },
683
+ depth: {
684
+ configurable: true
685
+ }
686
+ };
687
+ Leaf.prototype.flatten = function flatten() {
688
+ return this.values;
689
+ };
690
+ Leaf.prototype.sliceInner = function sliceInner(from, to) {
691
+ if (from == 0 && to == this.length) {
692
+ return this;
693
+ }
694
+ return new Leaf(this.values.slice(from, to));
695
+ };
696
+ Leaf.prototype.getInner = function getInner(i) {
697
+ return this.values[i];
698
+ };
699
+ Leaf.prototype.forEachInner = function forEachInner(f, from, to, start) {
700
+ for (var i = from; i < to; i++) {
701
+ if (f(this.values[i], start + i) === false) {
702
+ return false;
703
+ }
704
+ }
705
+ };
706
+ Leaf.prototype.forEachInvertedInner = function forEachInvertedInner(f, from, to, start) {
707
+ for (var i = from - 1; i >= to; i--) {
708
+ if (f(this.values[i], start + i) === false) {
709
+ return false;
710
+ }
711
+ }
712
+ };
713
+ Leaf.prototype.leafAppend = function leafAppend(other) {
714
+ if (this.length + other.length <= GOOD_LEAF_SIZE) {
715
+ return new Leaf(this.values.concat(other.flatten()));
716
+ }
717
+ };
718
+ Leaf.prototype.leafPrepend = function leafPrepend(other) {
719
+ if (this.length + other.length <= GOOD_LEAF_SIZE) {
720
+ return new Leaf(other.flatten().concat(this.values));
721
+ }
722
+ };
723
+ prototypeAccessors.length.get = function () {
724
+ return this.values.length;
725
+ };
726
+ prototypeAccessors.depth.get = function () {
727
+ return 0;
728
+ };
729
+ Object.defineProperties(Leaf.prototype, prototypeAccessors);
730
+ return Leaf;
731
+ }(RopeSequence);
732
+
733
+ // :: RopeSequence
734
+ // The empty rope sequence.
735
+ RopeSequence.empty = new Leaf([]);
736
+ var Append = /*@__PURE__*/function (RopeSequence) {
737
+ function Append(left, right) {
738
+ RopeSequence.call(this);
739
+ this.left = left;
740
+ this.right = right;
741
+ this.length = left.length + right.length;
742
+ this.depth = Math.max(left.depth, right.depth) + 1;
743
+ }
744
+ if (RopeSequence) Append.__proto__ = RopeSequence;
745
+ Append.prototype = Object.create(RopeSequence && RopeSequence.prototype);
746
+ Append.prototype.constructor = Append;
747
+ Append.prototype.flatten = function flatten() {
748
+ return this.left.flatten().concat(this.right.flatten());
749
+ };
750
+ Append.prototype.getInner = function getInner(i) {
751
+ return i < this.left.length ? this.left.get(i) : this.right.get(i - this.left.length);
752
+ };
753
+ Append.prototype.forEachInner = function forEachInner(f, from, to, start) {
754
+ var leftLen = this.left.length;
755
+ if (from < leftLen && this.left.forEachInner(f, from, Math.min(to, leftLen), start) === false) {
756
+ return false;
757
+ }
758
+ if (to > leftLen && this.right.forEachInner(f, Math.max(from - leftLen, 0), Math.min(this.length, to) - leftLen, start + leftLen) === false) {
759
+ return false;
760
+ }
761
+ };
762
+ Append.prototype.forEachInvertedInner = function forEachInvertedInner(f, from, to, start) {
763
+ var leftLen = this.left.length;
764
+ if (from > leftLen && this.right.forEachInvertedInner(f, from - leftLen, Math.max(to, leftLen) - leftLen, start + leftLen) === false) {
765
+ return false;
766
+ }
767
+ if (to < leftLen && this.left.forEachInvertedInner(f, Math.min(from, leftLen), to, start) === false) {
768
+ return false;
769
+ }
770
+ };
771
+ Append.prototype.sliceInner = function sliceInner(from, to) {
772
+ if (from == 0 && to == this.length) {
773
+ return this;
774
+ }
775
+ var leftLen = this.left.length;
776
+ if (to <= leftLen) {
777
+ return this.left.slice(from, to);
778
+ }
779
+ if (from >= leftLen) {
780
+ return this.right.slice(from - leftLen, to - leftLen);
781
+ }
782
+ return this.left.slice(from, leftLen).append(this.right.slice(0, to - leftLen));
783
+ };
784
+ Append.prototype.leafAppend = function leafAppend(other) {
785
+ var inner = this.right.leafAppend(other);
786
+ if (inner) {
787
+ return new Append(this.left, inner);
788
+ }
789
+ };
790
+ Append.prototype.leafPrepend = function leafPrepend(other) {
791
+ var inner = this.left.leafPrepend(other);
792
+ if (inner) {
793
+ return new Append(inner, this.right);
794
+ }
795
+ };
796
+ Append.prototype.appendInner = function appendInner(other) {
797
+ if (this.left.depth >= Math.max(this.right.depth, other.depth) + 1) {
798
+ return new Append(this.left, new Append(this.right, other));
799
+ }
800
+ return new Append(this, other);
801
+ };
802
+ return Append;
803
+ }(RopeSequence);
804
+ var ropeSequence = RopeSequence;
805
+
806
+ // ProseMirror's history isn't simply a way to roll back to a previous
807
+ // state, because ProseMirror supports applying changes without adding
808
+ // them to the history (for example during collaboration).
809
+ //
810
+ // To this end, each 'Branch' (one for the undo history and one for
811
+ // the redo history) keeps an array of 'Items', which can optionally
812
+ // hold a step (an actual undoable change), and always hold a position
813
+ // map (which is needed to move changes below them to apply to the
814
+ // current document).
815
+ //
816
+ // An item that has both a step and a selection bookmark is the start
817
+ // of an 'event' — a group of changes that will be undone or redone at
818
+ // once. (It stores only the bookmark, since that way we don't have to
819
+ // provide a document until the selection is actually applied, which
820
+ // is useful when compressing.)
821
+ // Used to schedule history compression
822
+ const max_empty_items = 500;
823
+ class Branch {
824
+ constructor(items, eventCount) {
825
+ this.items = items;
826
+ this.eventCount = eventCount;
827
+ }
828
+ // Pop the latest event off the branch's history and apply it
829
+ // to a document transform.
830
+ popEvent(state, preserveItems) {
831
+ if (this.eventCount == 0) return null;
832
+ let end = this.items.length;
833
+ for (;; end--) {
834
+ let next = this.items.get(end - 1);
835
+ if (next.selection) {
836
+ --end;
837
+ break;
838
+ }
839
+ }
840
+ let remap, mapFrom;
841
+ if (preserveItems) {
842
+ remap = this.remapping(end, this.items.length);
843
+ mapFrom = remap.maps.length;
844
+ }
845
+ let transform = state.tr;
846
+ let selection, remaining;
847
+ let addAfter = [],
848
+ addBefore = [];
849
+ this.items.forEach((item, i) => {
850
+ if (!item.step) {
851
+ if (!remap) {
852
+ remap = this.remapping(end, i + 1);
853
+ mapFrom = remap.maps.length;
854
+ }
855
+ mapFrom--;
856
+ addBefore.push(item);
857
+ return;
858
+ }
859
+ if (remap) {
860
+ addBefore.push(new Item(item.map));
861
+ let step = item.step.map(remap.slice(mapFrom)),
862
+ map;
863
+ if (step && transform.maybeStep(step).doc) {
864
+ map = transform.mapping.maps[transform.mapping.maps.length - 1];
865
+ addAfter.push(new Item(map, undefined, undefined, addAfter.length + addBefore.length));
866
+ }
867
+ mapFrom--;
868
+ if (map) remap.appendMap(map, mapFrom);
869
+ } else {
870
+ transform.maybeStep(item.step);
871
+ }
872
+ if (item.selection) {
873
+ selection = remap ? item.selection.map(remap.slice(mapFrom)) : item.selection;
874
+ remaining = new Branch(this.items.slice(0, end).append(addBefore.reverse().concat(addAfter)), this.eventCount - 1);
875
+ return false;
876
+ }
877
+ }, this.items.length, 0);
878
+ return {
879
+ remaining: remaining,
880
+ transform,
881
+ selection: selection
882
+ };
883
+ }
884
+ // Create a new branch with the given transform added.
885
+ addTransform(transform, selection, histOptions, preserveItems) {
886
+ let newItems = [],
887
+ eventCount = this.eventCount;
888
+ let oldItems = this.items,
889
+ lastItem = !preserveItems && oldItems.length ? oldItems.get(oldItems.length - 1) : null;
890
+ for (let i = 0; i < transform.steps.length; i++) {
891
+ let step = transform.steps[i].invert(transform.docs[i]);
892
+ let item = new Item(transform.mapping.maps[i], step, selection),
893
+ merged;
894
+ if (merged = lastItem && lastItem.merge(item)) {
895
+ item = merged;
896
+ if (i) newItems.pop();else oldItems = oldItems.slice(0, oldItems.length - 1);
897
+ }
898
+ newItems.push(item);
899
+ if (selection) {
900
+ eventCount++;
901
+ selection = undefined;
902
+ }
903
+ if (!preserveItems) lastItem = item;
904
+ }
905
+ let overflow = eventCount - histOptions.depth;
906
+ if (overflow > DEPTH_OVERFLOW) {
907
+ oldItems = cutOffEvents(oldItems, overflow);
908
+ eventCount -= overflow;
909
+ }
910
+ return new Branch(oldItems.append(newItems), eventCount);
911
+ }
912
+ remapping(from, to) {
913
+ let maps = new Mapping();
914
+ this.items.forEach((item, i) => {
915
+ let mirrorPos = item.mirrorOffset != null && i - item.mirrorOffset >= from ? maps.maps.length - item.mirrorOffset : undefined;
916
+ maps.appendMap(item.map, mirrorPos);
917
+ }, from, to);
918
+ return maps;
919
+ }
920
+ addMaps(array) {
921
+ if (this.eventCount == 0) return this;
922
+ return new Branch(this.items.append(array.map(map => new Item(map))), this.eventCount);
923
+ }
924
+ // When the collab module receives remote changes, the history has
925
+ // to know about those, so that it can adjust the steps that were
926
+ // rebased on top of the remote changes, and include the position
927
+ // maps for the remote changes in its array of items.
928
+ rebased(rebasedTransform, rebasedCount) {
929
+ if (!this.eventCount) return this;
930
+ let rebasedItems = [],
931
+ start = Math.max(0, this.items.length - rebasedCount);
932
+ let mapping = rebasedTransform.mapping;
933
+ let newUntil = rebasedTransform.steps.length;
934
+ let eventCount = this.eventCount;
935
+ this.items.forEach(item => {
936
+ if (item.selection) eventCount--;
937
+ }, start);
938
+ let iRebased = rebasedCount;
939
+ this.items.forEach(item => {
940
+ let pos = mapping.getMirror(--iRebased);
941
+ if (pos == null) return;
942
+ newUntil = Math.min(newUntil, pos);
943
+ let map = mapping.maps[pos];
944
+ if (item.step) {
945
+ let step = rebasedTransform.steps[pos].invert(rebasedTransform.docs[pos]);
946
+ let selection = item.selection && item.selection.map(mapping.slice(iRebased + 1, pos));
947
+ if (selection) eventCount++;
948
+ rebasedItems.push(new Item(map, step, selection));
949
+ } else {
950
+ rebasedItems.push(new Item(map));
951
+ }
952
+ }, start);
953
+ let newMaps = [];
954
+ for (let i = rebasedCount; i < newUntil; i++) newMaps.push(new Item(mapping.maps[i]));
955
+ let items = this.items.slice(0, start).append(newMaps).append(rebasedItems);
956
+ let branch = new Branch(items, eventCount);
957
+ if (branch.emptyItemCount() > max_empty_items) branch = branch.compress(this.items.length - rebasedItems.length);
958
+ return branch;
959
+ }
960
+ emptyItemCount() {
961
+ let count = 0;
962
+ this.items.forEach(item => {
963
+ if (!item.step) count++;
964
+ });
965
+ return count;
966
+ }
967
+ // Compressing a branch means rewriting it to push the air (map-only
968
+ // items) out. During collaboration, these naturally accumulate
969
+ // because each remote change adds one. The `upto` argument is used
970
+ // to ensure that only the items below a given level are compressed,
971
+ // because `rebased` relies on a clean, untouched set of items in
972
+ // order to associate old items with rebased steps.
973
+ compress() {
974
+ let upto = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.items.length;
975
+ let remap = this.remapping(0, upto),
976
+ mapFrom = remap.maps.length;
977
+ let items = [],
978
+ events = 0;
979
+ this.items.forEach((item, i) => {
980
+ if (i >= upto) {
981
+ items.push(item);
982
+ if (item.selection) events++;
983
+ } else if (item.step) {
984
+ let step = item.step.map(remap.slice(mapFrom)),
985
+ map = step && step.getMap();
986
+ mapFrom--;
987
+ if (map) remap.appendMap(map, mapFrom);
988
+ if (step) {
989
+ let selection = item.selection && item.selection.map(remap.slice(mapFrom));
990
+ if (selection) events++;
991
+ let newItem = new Item(map.invert(), step, selection),
992
+ merged,
993
+ last = items.length - 1;
994
+ if (merged = items.length && items[last].merge(newItem)) items[last] = merged;else items.push(newItem);
995
+ }
996
+ } else if (item.map) {
997
+ mapFrom--;
998
+ }
999
+ }, this.items.length, 0);
1000
+ return new Branch(ropeSequence.from(items.reverse()), events);
1001
+ }
1002
+ }
1003
+ Branch.empty = new Branch(ropeSequence.empty, 0);
1004
+ function cutOffEvents(items, n) {
1005
+ let cutPoint;
1006
+ items.forEach((item, i) => {
1007
+ if (item.selection && n-- == 0) {
1008
+ cutPoint = i;
1009
+ return false;
1010
+ }
1011
+ });
1012
+ return items.slice(cutPoint);
1013
+ }
1014
+ class Item {
1015
+ constructor(
1016
+ // The (forward) step map for this item.
1017
+ map,
1018
+ // The inverted step
1019
+ step,
1020
+ // If this is non-null, this item is the start of a group, and
1021
+ // this selection is the starting selection for the group (the one
1022
+ // that was active before the first step was applied)
1023
+ selection,
1024
+ // If this item is the inverse of a previous mapping on the stack,
1025
+ // this points at the inverse's offset
1026
+ mirrorOffset) {
1027
+ this.map = map;
1028
+ this.step = step;
1029
+ this.selection = selection;
1030
+ this.mirrorOffset = mirrorOffset;
1031
+ }
1032
+ merge(other) {
1033
+ if (this.step && other.step && !other.selection) {
1034
+ let step = other.step.merge(this.step);
1035
+ if (step) return new Item(step.getMap().invert(), step, this.selection);
1036
+ }
1037
+ }
1038
+ }
1039
+ // The value of the state field that tracks undo/redo history for that
1040
+ // state. Will be stored in the plugin state when the history plugin
1041
+ // is active.
1042
+ class HistoryState {
1043
+ constructor(done, undone, prevRanges, prevTime) {
1044
+ this.done = done;
1045
+ this.undone = undone;
1046
+ this.prevRanges = prevRanges;
1047
+ this.prevTime = prevTime;
1048
+ }
1049
+ }
1050
+ const DEPTH_OVERFLOW = 20;
1051
+ // Record a transformation in undo history.
1052
+ function applyTransaction(history, state, tr, options) {
1053
+ let historyTr = tr.getMeta(historyKey),
1054
+ rebased;
1055
+ if (historyTr) return historyTr.historyState;
1056
+ if (tr.getMeta(closeHistoryKey)) history = new HistoryState(history.done, history.undone, null, 0);
1057
+ let appended = tr.getMeta("appendedTransaction");
1058
+ if (tr.steps.length == 0) {
1059
+ return history;
1060
+ } else if (appended && appended.getMeta(historyKey)) {
1061
+ if (appended.getMeta(historyKey).redo) return new HistoryState(history.done.addTransform(tr, undefined, options, mustPreserveItems(state)), history.undone, rangesFor(tr.mapping.maps[tr.steps.length - 1]), history.prevTime);else return new HistoryState(history.done, history.undone.addTransform(tr, undefined, options, mustPreserveItems(state)), null, history.prevTime);
1062
+ } else if (tr.getMeta("addToHistory") !== false && !(appended && appended.getMeta("addToHistory") === false)) {
1063
+ // Group transforms that occur in quick succession into one event.
1064
+ let newGroup = history.prevTime == 0 || !appended && (history.prevTime < (tr.time || 0) - options.newGroupDelay || !isAdjacentTo(tr, history.prevRanges));
1065
+ let prevRanges = appended ? mapRanges(history.prevRanges, tr.mapping) : rangesFor(tr.mapping.maps[tr.steps.length - 1]);
1066
+ return new HistoryState(history.done.addTransform(tr, newGroup ? state.selection.getBookmark() : undefined, options, mustPreserveItems(state)), Branch.empty, prevRanges, tr.time);
1067
+ } else if (rebased = tr.getMeta("rebased")) {
1068
+ // Used by the collab module to tell the history that some of its
1069
+ // content has been rebased.
1070
+ return new HistoryState(history.done.rebased(tr, rebased), history.undone.rebased(tr, rebased), mapRanges(history.prevRanges, tr.mapping), history.prevTime);
1071
+ } else {
1072
+ return new HistoryState(history.done.addMaps(tr.mapping.maps), history.undone.addMaps(tr.mapping.maps), mapRanges(history.prevRanges, tr.mapping), history.prevTime);
1073
+ }
1074
+ }
1075
+ function isAdjacentTo(transform, prevRanges) {
1076
+ if (!prevRanges) return false;
1077
+ if (!transform.docChanged) return true;
1078
+ let adjacent = false;
1079
+ transform.mapping.maps[0].forEach((start, end) => {
1080
+ for (let i = 0; i < prevRanges.length; i += 2) if (start <= prevRanges[i + 1] && end >= prevRanges[i]) adjacent = true;
1081
+ });
1082
+ return adjacent;
1083
+ }
1084
+ function rangesFor(map) {
1085
+ let result = [];
1086
+ map.forEach((_from, _to, from, to) => result.push(from, to));
1087
+ return result;
1088
+ }
1089
+ function mapRanges(ranges, mapping) {
1090
+ if (!ranges) return null;
1091
+ let result = [];
1092
+ for (let i = 0; i < ranges.length; i += 2) {
1093
+ let from = mapping.map(ranges[i], 1),
1094
+ to = mapping.map(ranges[i + 1], -1);
1095
+ if (from <= to) result.push(from, to);
1096
+ }
1097
+ return result;
1098
+ }
1099
+ // Apply the latest event from one branch to the document and shift the event
1100
+ // onto the other branch.
1101
+ function histTransaction(history, state, dispatch, redo) {
1102
+ let preserveItems = mustPreserveItems(state);
1103
+ let histOptions = historyKey.get(state).spec.config;
1104
+ let pop = (redo ? history.undone : history.done).popEvent(state, preserveItems);
1105
+ if (!pop) return;
1106
+ let selection = pop.selection.resolve(pop.transform.doc);
1107
+ let added = (redo ? history.done : history.undone).addTransform(pop.transform, state.selection.getBookmark(), histOptions, preserveItems);
1108
+ let newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0);
1109
+ dispatch(pop.transform.setSelection(selection).setMeta(historyKey, {
1110
+ redo,
1111
+ historyState: newHist
1112
+ }).scrollIntoView());
1113
+ }
1114
+ let cachedPreserveItems = false,
1115
+ cachedPreserveItemsPlugins = null;
1116
+ // Check whether any plugin in the given state has a
1117
+ // `historyPreserveItems` property in its spec, in which case we must
1118
+ // preserve steps exactly as they came in, so that they can be
1119
+ // rebased.
1120
+ function mustPreserveItems(state) {
1121
+ let plugins = state.plugins;
1122
+ if (cachedPreserveItemsPlugins != plugins) {
1123
+ cachedPreserveItems = false;
1124
+ cachedPreserveItemsPlugins = plugins;
1125
+ for (let i = 0; i < plugins.length; i++) if (plugins[i].spec.historyPreserveItems) {
1126
+ cachedPreserveItems = true;
1127
+ break;
1128
+ }
1129
+ }
1130
+ return cachedPreserveItems;
1131
+ }
1132
+ const historyKey = new PluginKey("history");
1133
+ const closeHistoryKey = new PluginKey("closeHistory");
1134
+ /**
1135
+ Returns a plugin that enables the undo history for an editor. The
1136
+ plugin will track undo and redo stacks, which can be used with the
1137
+ [`undo`](https://prosemirror.net/docs/ref/#history.undo) and [`redo`](https://prosemirror.net/docs/ref/#history.redo) commands.
1138
+
1139
+ You can set an `"addToHistory"` [metadata
1140
+ property](https://prosemirror.net/docs/ref/#state.Transaction.setMeta) of `false` on a transaction
1141
+ to prevent it from being rolled back by undo.
1142
+ */
1143
+ function history() {
1144
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1145
+ config = {
1146
+ depth: config.depth || 100,
1147
+ newGroupDelay: config.newGroupDelay || 500
1148
+ };
1149
+ return new Plugin({
1150
+ key: historyKey,
1151
+ state: {
1152
+ init() {
1153
+ return new HistoryState(Branch.empty, Branch.empty, null, 0);
1154
+ },
1155
+ apply(tr, hist, state) {
1156
+ return applyTransaction(hist, state, tr, config);
1157
+ }
1158
+ },
1159
+ config,
1160
+ props: {
1161
+ handleDOMEvents: {
1162
+ beforeinput(view, e) {
1163
+ let inputType = e.inputType;
1164
+ let command = inputType == "historyUndo" ? undo : inputType == "historyRedo" ? redo : null;
1165
+ if (!command) return false;
1166
+ e.preventDefault();
1167
+ return command(view.state, view.dispatch);
1168
+ }
1169
+ }
1170
+ }
1171
+ });
1172
+ }
1173
+ /**
1174
+ A command function that undoes the last change, if any.
1175
+ */
1176
+ const undo = (state, dispatch) => {
1177
+ let hist = historyKey.getState(state);
1178
+ if (!hist || hist.done.eventCount == 0) return false;
1179
+ if (dispatch) histTransaction(hist, state, dispatch, false);
1180
+ return true;
1181
+ };
1182
+ /**
1183
+ A command function that redoes the last undone change, if any.
1184
+ */
1185
+ const redo = (state, dispatch) => {
1186
+ let hist = historyKey.getState(state);
1187
+ if (!hist || hist.undone.eventCount == 0) return false;
1188
+ if (dispatch) histTransaction(hist, state, dispatch, true);
1189
+ return true;
1190
+ };
1191
+
1192
+ const History = Extension.create({
1193
+ name: 'history',
1194
+ addOptions() {
1195
+ return {
1196
+ depth: 100,
1197
+ newGroupDelay: 500
1198
+ };
1199
+ },
1200
+ addCommands() {
1201
+ return {
1202
+ undo: () => _ref => {
1203
+ let {
1204
+ state,
1205
+ dispatch
1206
+ } = _ref;
1207
+ return undo(state, dispatch);
1208
+ },
1209
+ redo: () => _ref2 => {
1210
+ let {
1211
+ state,
1212
+ dispatch
1213
+ } = _ref2;
1214
+ return redo(state, dispatch);
1215
+ }
1216
+ };
1217
+ },
1218
+ addProseMirrorPlugins() {
1219
+ return [history(this.options)];
1220
+ },
1221
+ addKeyboardShortcuts() {
1222
+ return {
1223
+ 'Mod-z': () => this.editor.commands.undo(),
1224
+ 'Mod-y': () => this.editor.commands.redo(),
1225
+ 'Shift-Mod-z': () => this.editor.commands.redo(),
1226
+ // Russian keyboard layouts
1227
+ 'Mod-я': () => this.editor.commands.undo(),
1228
+ 'Shift-Mod-я': () => this.editor.commands.redo()
1229
+ };
1230
+ }
1231
+ });
1232
+
1233
+ const HorizontalRule = Node.create({
1234
+ name: 'horizontalRule',
1235
+ addOptions() {
1236
+ return {
1237
+ HTMLAttributes: {}
1238
+ };
1239
+ },
1240
+ group: 'block',
1241
+ parseHTML() {
1242
+ return [{
1243
+ tag: 'hr'
1244
+ }];
1245
+ },
1246
+ renderHTML(_ref) {
1247
+ let {
1248
+ HTMLAttributes
1249
+ } = _ref;
1250
+ return ['hr', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
1251
+ },
1252
+ addCommands() {
1253
+ return {
1254
+ setHorizontalRule: () => _ref2 => {
1255
+ let {
1256
+ chain
1257
+ } = _ref2;
1258
+ return chain().insertContent({
1259
+ type: this.name
1260
+ })
1261
+ // set cursor after horizontal rule
1262
+ .command(_ref3 => {
1263
+ let {
1264
+ tr,
1265
+ dispatch
1266
+ } = _ref3;
1267
+ var _a;
1268
+ if (dispatch) {
1269
+ const {
1270
+ $to
1271
+ } = tr.selection;
1272
+ const posAfter = $to.end();
1273
+ if ($to.nodeAfter) {
1274
+ tr.setSelection(TextSelection.create(tr.doc, $to.pos));
1275
+ } else {
1276
+ // add node after horizontal rule if it’s the end of the document
1277
+ const node = (_a = $to.parent.type.contentMatch.defaultType) === null || _a === void 0 ? void 0 : _a.create();
1278
+ if (node) {
1279
+ tr.insert(posAfter, node);
1280
+ tr.setSelection(TextSelection.create(tr.doc, posAfter));
1281
+ }
1282
+ }
1283
+ tr.scrollIntoView();
1284
+ }
1285
+ return true;
1286
+ }).run();
1287
+ }
1288
+ };
1289
+ },
1290
+ addInputRules() {
1291
+ return [nodeInputRule({
1292
+ find: /^(?:---|—-|___\s|\*\*\*\s)$/,
1293
+ type: this.type
1294
+ })];
1295
+ }
1296
+ });
1297
+
1298
+ const Text = Node.create({
1299
+ name: 'text',
1300
+ group: 'inline'
1301
+ });
1302
+
1303
+ const StarterKit = Extension.create({
1304
+ name: 'starterKit',
1305
+ addExtensions() {
1306
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
1307
+ const extensions = [];
1308
+ if (this.options.blockquote !== false) {
1309
+ extensions.push(Blockquote.configure((_a = this.options) === null || _a === void 0 ? void 0 : _a.blockquote));
1310
+ }
1311
+ if (this.options.bold !== false) {
1312
+ extensions.push(Bold.configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.bold));
1313
+ }
1314
+ if (this.options.bulletList !== false) {
1315
+ extensions.push(BulletList.configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList));
1316
+ }
1317
+ if (this.options.code !== false) {
1318
+ extensions.push(Code.configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code));
1319
+ }
1320
+ if (this.options.codeBlock !== false) {
1321
+ extensions.push(CodeBlock.configure((_e = this.options) === null || _e === void 0 ? void 0 : _e.codeBlock));
1322
+ }
1323
+ if (this.options.document !== false) {
1324
+ extensions.push(Document.configure((_f = this.options) === null || _f === void 0 ? void 0 : _f.document));
1325
+ }
1326
+ if (this.options.dropcursor !== false) {
1327
+ extensions.push(Dropcursor.configure((_g = this.options) === null || _g === void 0 ? void 0 : _g.dropcursor));
1328
+ }
1329
+ if (this.options.gapcursor !== false) {
1330
+ extensions.push(Gapcursor.configure((_h = this.options) === null || _h === void 0 ? void 0 : _h.gapcursor));
1331
+ }
1332
+ if (this.options.hardBreak !== false) {
1333
+ extensions.push(HardBreak.configure((_j = this.options) === null || _j === void 0 ? void 0 : _j.hardBreak));
1334
+ }
1335
+ if (this.options.heading !== false) {
1336
+ extensions.push(Heading.configure((_k = this.options) === null || _k === void 0 ? void 0 : _k.heading));
1337
+ }
1338
+ if (this.options.history !== false) {
1339
+ extensions.push(History.configure((_l = this.options) === null || _l === void 0 ? void 0 : _l.history));
1340
+ }
1341
+ if (this.options.horizontalRule !== false) {
1342
+ extensions.push(HorizontalRule.configure((_m = this.options) === null || _m === void 0 ? void 0 : _m.horizontalRule));
1343
+ }
1344
+ if (this.options.italic !== false) {
1345
+ extensions.push(Italic.configure((_o = this.options) === null || _o === void 0 ? void 0 : _o.italic));
1346
+ }
1347
+ if (this.options.listItem !== false) {
1348
+ extensions.push(ListItem.configure((_p = this.options) === null || _p === void 0 ? void 0 : _p.listItem));
1349
+ }
1350
+ if (this.options.orderedList !== false) {
1351
+ extensions.push(OrderedList.configure((_q = this.options) === null || _q === void 0 ? void 0 : _q.orderedList));
1352
+ }
1353
+ if (this.options.paragraph !== false) {
1354
+ extensions.push(Paragraph.configure((_r = this.options) === null || _r === void 0 ? void 0 : _r.paragraph));
1355
+ }
1356
+ if (this.options.strike !== false) {
1357
+ extensions.push(Strike.configure((_s = this.options) === null || _s === void 0 ? void 0 : _s.strike));
1358
+ }
1359
+ if (this.options.text !== false) {
1360
+ extensions.push(Text.configure((_t = this.options) === null || _t === void 0 ? void 0 : _t.text));
1361
+ }
1362
+ return extensions;
1363
+ }
1364
+ });
1365
+
1366
+ const Placeholder = Extension.create({
1367
+ name: 'placeholder',
1368
+ addOptions() {
1369
+ return {
1370
+ emptyEditorClass: 'is-editor-empty',
1371
+ emptyNodeClass: 'is-empty',
1372
+ placeholder: 'Write something …',
1373
+ showOnlyWhenEditable: true,
1374
+ showOnlyCurrent: true,
1375
+ includeChildren: false
1376
+ };
1377
+ },
1378
+ addProseMirrorPlugins() {
1379
+ return [new Plugin({
1380
+ key: new PluginKey('placeholder'),
1381
+ props: {
1382
+ decorations: _ref => {
1383
+ let {
1384
+ doc,
1385
+ selection
1386
+ } = _ref;
1387
+ const active = this.editor.isEditable || !this.options.showOnlyWhenEditable;
1388
+ const {
1389
+ anchor
1390
+ } = selection;
1391
+ const decorations = [];
1392
+ if (!active) {
1393
+ return null;
1394
+ }
1395
+ // only calculate isEmpty once due to its performance impacts (see issue #3360)
1396
+ const emptyDocInstance = doc.type.createAndFill();
1397
+ const isEditorEmpty = (emptyDocInstance === null || emptyDocInstance === void 0 ? void 0 : emptyDocInstance.sameMarkup(doc)) && emptyDocInstance.content.findDiffStart(doc.content) === null;
1398
+ doc.descendants((node, pos) => {
1399
+ const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;
1400
+ const isEmpty = !node.isLeaf && !node.childCount;
1401
+ if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {
1402
+ const classes = [this.options.emptyNodeClass];
1403
+ if (isEditorEmpty) {
1404
+ classes.push(this.options.emptyEditorClass);
1405
+ }
1406
+ const decoration = Decoration.node(pos, pos + node.nodeSize, {
1407
+ class: classes.join(' '),
1408
+ 'data-placeholder': typeof this.options.placeholder === 'function' ? this.options.placeholder({
1409
+ editor: this.editor,
1410
+ node,
1411
+ pos,
1412
+ hasAnchor
1413
+ }) : this.options.placeholder
1414
+ });
1415
+ decorations.push(decoration);
1416
+ }
1417
+ return this.options.includeChildren;
1418
+ });
1419
+ return DecorationSet.create(doc, decorations);
1420
+ }
1421
+ }
1422
+ })];
1423
+ }
1424
+ });
1425
+
1426
+ var script = defineComponent({
1427
+ name: 'OrRichTextEditor',
1428
+ components: {
1429
+ OrIconButton: script$1,
1430
+ OrLabel: script$2,
1431
+ OrMenuItem: script$3,
1432
+ OrMenu: script$4,
1433
+ OrModal: script$5,
1434
+ OrInput: script$6,
1435
+ OrButton: script$7
1436
+ },
1437
+ inheritAttrs: false,
1438
+ model: {
1439
+ prop: 'modelValue',
1440
+ event: 'update:modelValue'
1441
+ },
1442
+ props: {
1443
+ modelValue: {
1444
+ type: String,
1445
+ default: undefined
1446
+ },
1447
+ toolbar: {
1448
+ type: Array,
1449
+ default: () => []
1450
+ },
1451
+ description: {
1452
+ type: String,
1453
+ default: ''
1454
+ },
1455
+ placeholder: {
1456
+ type: String,
1457
+ default: ''
1458
+ },
1459
+ autofocus: {
1460
+ type: Boolean,
1461
+ default: false
1462
+ },
1463
+ format: {
1464
+ type: String,
1465
+ default: 'markup'
1466
+ },
1467
+ fullHeight: {
1468
+ type: Boolean,
1469
+ default: false
1470
+ }
1471
+ },
1472
+ emits: ['update:modelValue', 'input', 'file-upload'],
1473
+ expose: ['root'],
1474
+ setup(props, context) {
1475
+ // Refs
1476
+ const root = ref();
1477
+ let editor = null;
1478
+ const editorRef = ref();
1479
+ const containerRef = ref();
1480
+ const toolbarRef = ref();
1481
+ const moreButtonRef = ref();
1482
+ const moreRef = ref();
1483
+ const toolbarButtonRef = ref();
1484
+ const menuRef = ref();
1485
+ const isActive = ref({});
1486
+ const isFocused = ref(props.autofocus);
1487
+ const headingLevels = [1, 2, 3, 4];
1488
+ const activeHeadingLevel = ref(0);
1489
+ const markdownOutput = ref('');
1490
+ const isOpenLinkModal = ref(false);
1491
+ const disableMarkdown = ref(false);
1492
+ const text = ref('');
1493
+ const link = ref('');
1494
+ const countOfNotVisibleTools = ref(0);
1495
+ let trap = useFocusTrap(editorRef, {
1496
+ immediate: true,
1497
+ fallbackFocus: '.container',
1498
+ allowOutsideClick: true
1499
+ });
1500
+ const iconsEnum = ref({
1501
+ bold: 'format_bold',
1502
+ italic: 'format_italic',
1503
+ underline: 'format_underlined',
1504
+ strike: 'format_strikethrough',
1505
+ bulletList: 'format_list_bulleted',
1506
+ orderedList: 'format_list_numbered',
1507
+ link: 'link',
1508
+ highlight: 'highlight',
1509
+ redo: 'redo',
1510
+ undo: 'undo',
1511
+ codeBlock: 'code_blocks',
1512
+ blockquote: 'format_quote',
1513
+ file: 'attach_file',
1514
+ source: 'source_notes'
1515
+ });
1516
+ const iconTooltipsEnum = ref({
1517
+ bold: 'Bold',
1518
+ italic: 'Italic',
1519
+ underline: 'Underline',
1520
+ strike: 'Strike',
1521
+ bulletList: 'Bulleted List',
1522
+ orderedList: 'Numbered List',
1523
+ link: 'Link',
1524
+ highlight: 'Highlight',
1525
+ redo: 'Redo',
1526
+ undo: 'Undo',
1527
+ codeBlock: 'Code Block',
1528
+ blockquote: 'Quote',
1529
+ file: 'File',
1530
+ source: 'Source'
1531
+ });
1532
+ useResizeObserver(root, entries => {
1533
+ var _a, _b;
1534
+ const entry = entries[0];
1535
+ const {
1536
+ width
1537
+ } = entry.contentRect;
1538
+ if (containerRef.value && toolbarRef.value && toolbarLength.value) {
1539
+ let lengthOfItem = 0;
1540
+ lengthOfItem = ((_b = (_a = toolbarRef.value.firstElementChild) === null || _a === void 0 ? void 0 : _a.firstElementChild) === null || _b === void 0 ? void 0 : _b.offsetWidth) + 16;
1541
+ const lengthOfToolbar = lengthOfItem * toolbarLength.value;
1542
+ if (lengthOfToolbar >= width) {
1543
+ const count = width / lengthOfItem - 2;
1544
+ countOfNotVisibleTools.value = Math.round(toolbarLength.value - count);
1545
+ }
1546
+ }
1547
+ });
1548
+ onMounted(() => {
1549
+ editor = new Editor({
1550
+ onUpdate: _ref => {
1551
+ let {
1552
+ editor
1553
+ } = _ref;
1554
+ isFocused.value = true;
1555
+ setActiveFormats();
1556
+ const html = editor.getHTML();
1557
+ const text = editor.getText();
1558
+ if (props.format === 'markdown') {
1559
+ markdownOutput.value = disableMarkdown.value ? text : serialize(editor.schema, editor.getJSON());
1560
+ proxyModelValue.value = markdownOutput.value;
1561
+ } else {
1562
+ proxyModelValue.value = text === '' ? text : html;
1563
+ }
1564
+ },
1565
+ onCreate: _ref2 => {
1566
+ let {
1567
+ editor
1568
+ } = _ref2;
1569
+ if (props.format === 'markdown') {
1570
+ const deserialized = deserialize(editor.schema, proxyModelValue.value);
1571
+ editor.commands.setContent(deserialized);
1572
+ } else {
1573
+ editor.commands.setContent(proxyModelValue.value);
1574
+ }
1575
+ },
1576
+ element: editorRef.value,
1577
+ autofocus: props.autofocus,
1578
+ extensions: [codemirrorNode, StarterKit.configure({
1579
+ heading: false,
1580
+ codeBlock: false
1581
+ }), Heading.configure({
1582
+ levels: headingLevels
1583
+ }).extend({
1584
+ levels: headingLevels,
1585
+ renderHTML(_ref3) {
1586
+ let {
1587
+ node,
1588
+ HTMLAttributes
1589
+ } = _ref3;
1590
+ return ['h' + node.attrs.level, mergeAttributes(HTMLAttributes, {
1591
+ class: `typography-headline-${node.attrs.level}`
1592
+ }), 0];
1593
+ }
1594
+ }), Underline, Link.configure({
1595
+ openOnClick: true,
1596
+ linkOnPaste: true,
1597
+ autolink: false,
1598
+ protocols: ['ftp', 'mailto', 'http', 'https'],
1599
+ validate: href => /^https?:\/\//.test(href),
1600
+ HTMLAttributes: {
1601
+ class: 'text-primary cursor-pointer'
1602
+ }
1603
+ }), Highlight, Placeholder.configure({
1604
+ placeholder: props.placeholder,
1605
+ emptyEditorClass: 'is-editor-empty text-outline'
1606
+ })],
1607
+ editorProps: {
1608
+ attributes: {
1609
+ class: 'focus:outline-none'
1610
+ }
1611
+ }
1612
+ });
1613
+ setActiveFormats();
1614
+ trap.activate();
1615
+ });
1616
+ onBeforeUnmount(() => {
1617
+ editor === null || editor === void 0 ? void 0 : editor.destroy();
1618
+ });
1619
+ onClickOutside(root, () => {
1620
+ isFocused.value = false;
1621
+ trap.deactivate();
1622
+ });
1623
+ // Computed
1624
+ const proxyModelValue = computed({
1625
+ get: () => {
1626
+ return props.modelValue;
1627
+ },
1628
+ set: value => {
1629
+ context.emit('input', value);
1630
+ context.emit('update:modelValue', value);
1631
+ }
1632
+ });
1633
+ const getIndexOfHeading = computed(() => {
1634
+ return props.toolbar.flat().indexOf('heading');
1635
+ });
1636
+ const headingIcon = computed(() => {
1637
+ if (activeHeadingLevel.value && isActive.value.heading) {
1638
+ return `format_h${activeHeadingLevel.value}`;
1639
+ }
1640
+ return 'format_paragraph';
1641
+ });
1642
+ const toolbarLength = computed(() => {
1643
+ return props.toolbar.flat().length;
1644
+ });
1645
+ const notVisibleTools = computed(() => {
1646
+ const count = countOfNotVisibleTools.value;
1647
+ const toolbar = props.toolbar.flat();
1648
+ let notVisible = toolbar.slice(toolbar.length - count, toolbar.length);
1649
+ props.toolbar.forEach(tools => {
1650
+ if (tools.some(item => notVisible.includes(item))) {
1651
+ notVisible = [...notVisible, ...tools];
1652
+ }
1653
+ });
1654
+ return notVisible;
1655
+ });
1656
+ //Methods
1657
+ const handleEditorClick = () => {
1658
+ var _a;
1659
+ setActiveFormats();
1660
+ isFocused.value = true;
1661
+ editor === null || editor === void 0 ? void 0 : editor.commands.focus();
1662
+ activeHeadingLevel.value = ((_a = editor === null || editor === void 0 ? void 0 : editor.getAttributes('heading')) === null || _a === void 0 ? void 0 : _a.level) || 0;
1663
+ };
1664
+ const isVisible = value => {
1665
+ if (Array.isArray(value)) {
1666
+ const isHaveNotVisibleTools = value.some(item => notVisibleTools.value.includes(item));
1667
+ return isHaveNotVisibleTools;
1668
+ }
1669
+ return !notVisibleTools.value.includes(value);
1670
+ };
1671
+ const handleToolbarClick = (item, level) => {
1672
+ var _a, _b;
1673
+ switch (item) {
1674
+ case 'source':
1675
+ disableMarkdown.value = !disableMarkdown.value;
1676
+ editor === null || editor === void 0 ? void 0 : editor.setOptions({
1677
+ enableInputRules: !disableMarkdown.value,
1678
+ enablePasteRules: !disableMarkdown.value
1679
+ });
1680
+ editor === null || editor === void 0 ? void 0 : editor.view.updateState(editor === null || editor === void 0 ? void 0 : editor.state.reconfigure({
1681
+ plugins: editor.extensionManager.plugins
1682
+ }));
1683
+ if (disableMarkdown.value) {
1684
+ editor === null || editor === void 0 ? void 0 : editor.commands.setContent(serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON()));
1685
+ } else {
1686
+ editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getHTML()));
1687
+ }
1688
+ break;
1689
+ case 'bulletList':
1690
+ case 'orderedList':
1691
+ item === 'bulletList' ? editor === null || editor === void 0 ? void 0 : editor.commands.toggleBulletList() : editor === null || editor === void 0 ? void 0 : editor.commands.toggleOrderedList();
1692
+ break;
1693
+ case 'link':
1694
+ if (editor) {
1695
+ const cursorPosition = (editor === null || editor === void 0 ? void 0 : editor.state.selection.$anchor.pos) || 0;
1696
+ const {
1697
+ from,
1698
+ to,
1699
+ empty
1700
+ } = editor.state.selection;
1701
+ const isLink = (_a = editor.view.state.doc.nodeAt(cursorPosition)) === null || _a === void 0 ? void 0 : _a.marks.filter(mark => mark.type.name === 'link');
1702
+ const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((_b = editor.view.state.doc.nodeAt(cursorPosition)) === null || _b === void 0 ? void 0 : _b.text) || '' : '';
1703
+ text.value = empty ? existedText : editor.state.doc.textBetween(from, to, ' ');
1704
+ link.value = editor.getAttributes('link').href || '';
1705
+ }
1706
+ isOpenLinkModal.value = !isOpenLinkModal.value;
1707
+ break;
1708
+ case 'blockquote':
1709
+ editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleBlockquote().run();
1710
+ break;
1711
+ case 'codeBlock':
1712
+ if (!isActive.value['codeBlock']) {
1713
+ editor === null || editor === void 0 ? void 0 : editor.commands.setNode(item, {
1714
+ language: 'javascript'
1715
+ });
1716
+ } else {
1717
+ editor === null || editor === void 0 ? void 0 : editor.commands.setNode('paragraph');
1718
+ }
1719
+ break;
1720
+ case 'heading':
1721
+ if (!level) {
1722
+ editor === null || editor === void 0 ? void 0 : editor.commands.toggleHeading({
1723
+ level: 0
1724
+ });
1725
+ activeHeadingLevel.value = 0;
1726
+ } else {
1727
+ activeHeadingLevel.value = level;
1728
+ editor === null || editor === void 0 ? void 0 : editor.commands.toggleHeading({
1729
+ level: level
1730
+ });
1731
+ }
1732
+ editor === null || editor === void 0 ? void 0 : editor.commands.focus();
1733
+ break;
1734
+ case 'undo':
1735
+ case 'redo':
1736
+ item === 'undo' ? editor === null || editor === void 0 ? void 0 : editor.commands.undo() : editor === null || editor === void 0 ? void 0 : editor.commands.redo();
1737
+ break;
1738
+ case 'file':
1739
+ context.emit('file-upload');
1740
+ break;
1741
+ default:
1742
+ editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleMark(item).run();
1743
+ break;
1744
+ }
1745
+ };
1746
+ const attachLink = async () => {
1747
+ var _a, _b;
1748
+ // empty
1749
+ if (link.value === '') {
1750
+ editor === null || editor === void 0 ? void 0 : editor.chain().focus().extendMarkRange('link').unsetLink().run();
1751
+ }
1752
+ const isEmptySelection = editor === null || editor === void 0 ? void 0 : editor.state.selection.empty;
1753
+ const cursorPosition = (editor === null || editor === void 0 ? void 0 : editor.state.selection.$anchor.pos) || 0;
1754
+ const isLink = (_a = editor === null || editor === void 0 ? void 0 : editor.view.state.doc.nodeAt(cursorPosition)) === null || _a === void 0 ? void 0 : _a.marks.filter(mark => mark.type.name === 'link');
1755
+ const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? (_b = editor === null || editor === void 0 ? void 0 : editor.view.state.doc.nodeAt(cursorPosition)) === null || _b === void 0 ? void 0 : _b.text : '';
1756
+ if (link.value && isEmptySelection && !existedText) {
1757
+ editor === null || editor === void 0 ? void 0 : editor.chain().focus().setMark('link', {
1758
+ href: link.value,
1759
+ target: '__blank'
1760
+ }).command(_ref4 => {
1761
+ let {
1762
+ tr
1763
+ } = _ref4;
1764
+ const preparedValue = text.value[text.value.length - 1] === ' ' ? text.value : `${text.value} `;
1765
+ tr.insertText(preparedValue);
1766
+ return true;
1767
+ }).run();
1768
+ }
1769
+ if (link.value && existedText === text.value && isEmptySelection) {
1770
+ editor === null || editor === void 0 ? void 0 : editor.chain().extendMarkRange('link').updateAttributes('link', {
1771
+ href: link.value
1772
+ }).run();
1773
+ }
1774
+ if (link.value && !isEmptySelection) {
1775
+ editor === null || editor === void 0 ? void 0 : editor.chain().focus().setMark('link', {
1776
+ href: link.value,
1777
+ target: '__blank'
1778
+ }).run();
1779
+ }
1780
+ text.value = '';
1781
+ link.value = '';
1782
+ isOpenLinkModal.value = false;
1783
+ };
1784
+ const discardLink = () => {
1785
+ isOpenLinkModal.value = false;
1786
+ };
1787
+ const setActiveFormats = () => {
1788
+ const toolbarList = props.toolbar.flat();
1789
+ toolbarList.forEach(item => {
1790
+ if (item === 'source') {
1791
+ isActive.value[item] = disableMarkdown.value;
1792
+ } else {
1793
+ isActive.value[item] = (editor === null || editor === void 0 ? void 0 : editor.isActive(item)) || false;
1794
+ }
1795
+ });
1796
+ };
1797
+ // Styles
1798
+ const rootStyles = computed(() => {
1799
+ return ['or-rich-text-editor', ...(props.fullHeight ? ['h-full'] : [])];
1800
+ });
1801
+ const containerStyles = computed(() => {
1802
+ return [...EditorContainer, ...(props.fullHeight ? ['h-full'] : [])];
1803
+ });
1804
+ const toolbarContainerStyles = computed(() => {
1805
+ return [...ToolbarContainer];
1806
+ });
1807
+ const toolbarStyles = computed(() => {
1808
+ return [...Toolbar,
1809
+ // 'overflow-x-hidden',
1810
+ ...(isFocused.value ? ToolbarButtonFocused : ToolbarButton)];
1811
+ });
1812
+ const editorInputStyles = computed(() => {
1813
+ return ['tiptap-editor-v3', ...(props.fullHeight ? ['h-full overflow-y-auto'] : []), ...EditorInput];
1814
+ });
1815
+ //Effects
1816
+ watch(proxyModelValue, value => {
1817
+ if (value !== (editor === null || editor === void 0 ? void 0 : editor.getHTML()) && props.format !== 'markdown') {
1818
+ editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
1819
+ }
1820
+ if (props.format === 'markdown' && value !== markdownOutput.value) {
1821
+ const deserialized = deserialize(editor === null || editor === void 0 ? void 0 : editor.schema, value);
1822
+ editor === null || editor === void 0 ? void 0 : editor.commands.setContent(deserialized);
1823
+ }
1824
+ });
1825
+ return {
1826
+ editor,
1827
+ editorRef,
1828
+ toolbarRef,
1829
+ containerRef,
1830
+ toolbarButtonRef,
1831
+ moreButtonRef,
1832
+ moreRef,
1833
+ menuRef,
1834
+ iconsEnum,
1835
+ handleToolbarClick,
1836
+ handleEditorClick,
1837
+ isActive,
1838
+ iconTooltipsEnum,
1839
+ containerStyles,
1840
+ toolbarContainerStyles,
1841
+ toolbarStyles,
1842
+ rootStyles,
1843
+ root,
1844
+ editorInputStyles,
1845
+ getIndexOfHeading,
1846
+ headingLevels,
1847
+ headingIcon,
1848
+ attachLink,
1849
+ discardLink,
1850
+ isOpenLinkModal,
1851
+ text,
1852
+ link,
1853
+ isFocused,
1854
+ isVisible,
1855
+ countOfNotVisibleTools,
1856
+ notVisibleTools
1857
+ };
1858
+ }
1859
+ });
1860
+
1861
+ export { script as s };