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