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