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