@onereach/ui-components 4.3.8 → 4.3.9-beta.2650.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 (834) hide show
  1. package/dist/bundled/v2/{OrDateTimePickerMonthSelect-40adb0f2.js → OrDateTimePickerMonthSelect-5eda9e34.js} +4 -3
  2. package/dist/bundled/v2/components/OrBottomSheetV3/OrBottomSheet.js +8 -4
  3. package/dist/bundled/v2/components/OrButton/OrButton.js +1 -1
  4. package/dist/bundled/v2/components/OrButtonV2/OrButton.js +1 -1
  5. package/dist/bundled/v2/components/OrCardCollection/OrCardCollection.js +4 -3
  6. package/dist/bundled/v2/components/OrCarousel/OrCarousel.js +8 -2
  7. package/dist/bundled/v2/components/OrCheckbox/OrCheckbox.js +4 -3
  8. package/dist/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.js +4 -3
  9. package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.js +4 -3
  10. package/dist/bundled/v2/components/OrCheckboxV3/OrCheckbox.js +4 -3
  11. package/dist/bundled/v2/components/OrCode/OrCode.js +266 -200
  12. package/dist/bundled/v2/components/OrCode/index.js +2 -2
  13. package/dist/bundled/v2/components/OrCode/lang.js +2 -2
  14. package/dist/bundled/v2/components/OrCode/theme.js +1 -1
  15. package/dist/bundled/v2/components/OrCollapse/OrCollapse.js +6 -4
  16. package/dist/bundled/v2/components/OrColorPicker/utils/defultPalette.js +2 -1
  17. package/dist/bundled/v2/components/OrConfirm/OrConfirm.js +4 -3
  18. package/dist/bundled/v2/components/OrConfirmV3/OrConfirm.js +4 -3
  19. package/dist/bundled/v2/components/OrDatePickerV3/OrDatePicker.js +1 -1
  20. package/dist/bundled/v2/components/OrDatePickerV3/index.js +1 -1
  21. package/dist/bundled/v2/components/OrDateTimePicker/OrDateTimePicker.js +1 -1
  22. package/dist/bundled/v2/components/OrDateTimePickerV3/OrDateTimePicker.js +1 -1
  23. package/dist/bundled/v2/components/OrDateTimePickerV3/index.js +1 -1
  24. package/dist/bundled/v2/components/OrIconButtonV2/OrIconButton.js +5 -4
  25. package/dist/bundled/v2/components/OrInlineTextEdit/OrInlineTextEdit.js +4 -3
  26. package/dist/bundled/v2/components/OrList/OrList.js +5 -4
  27. package/dist/bundled/v2/components/OrMenuV3/OrMenu.js +11 -5
  28. package/dist/bundled/v2/components/OrModal/OrModal.js +101 -20
  29. package/dist/bundled/v2/components/OrNumberInput/OrNumberInput.js +4 -3
  30. package/dist/bundled/v2/components/OrOverflowMenu/OrOverflowMenu.js +4 -3
  31. package/dist/bundled/v2/components/OrPassword/OrPassword.js +4 -3
  32. package/dist/bundled/v2/components/OrPopoverV3/OrPopover.js +8 -4
  33. package/dist/bundled/v2/components/OrRadio/OrRadio.js +4 -3
  34. package/dist/bundled/v2/components/OrRadioGroupV3/OrRadioGroup.js +4 -3
  35. package/dist/bundled/v2/components/OrSearch/OrSearch.js +4 -3
  36. package/dist/bundled/v2/components/OrSelectV3/OrSelect.js +8 -4
  37. package/dist/bundled/v2/components/OrSidebarV3/OrSidebar.js +4 -3
  38. package/dist/bundled/v2/components/OrSwitch/OrSwitch.js +4 -3
  39. package/dist/bundled/v2/components/OrTabHeaderItem/OrTabHeaderItem.js +4 -3
  40. package/dist/bundled/v2/components/OrTabs/OrTabs.js +5 -4
  41. package/dist/bundled/v2/components/OrTabsV3/OrTabs.js +8 -4
  42. package/dist/bundled/v2/components/OrTextV3/OrText.vue.d.ts +2 -2
  43. package/dist/bundled/v2/components/OrTextarea/OrTextarea.vue.d.ts +2 -2
  44. package/dist/bundled/v2/components/OrTextareaV3/OrTextarea.vue.d.ts +2 -2
  45. package/dist/bundled/v2/components/OrTextbox/OrTextbox.js +5 -4
  46. package/dist/bundled/v2/components/OrTextbox/OrTextbox.vue.d.ts +2 -2
  47. package/dist/bundled/v2/components/OrTimePickerV3/OrTimePicker.vue.d.ts +2 -2
  48. package/dist/bundled/v2/components/OrToast/OrToast.vue.d.ts +2 -2
  49. package/dist/bundled/v2/components/OrToast/composable/useToast.js +10 -5
  50. package/dist/bundled/v2/components/OrToastContainerV3/OrToastContainer.js +6 -3
  51. package/dist/bundled/v2/components/OrToastV3/OrToast.vue.d.ts +2 -2
  52. package/dist/bundled/v2/components/OrToastV3/composable/useToast.js +10 -5
  53. package/dist/bundled/v2/components/OrTooltip/OrTooltip.vue.d.ts +2 -2
  54. package/dist/bundled/v2/components/OrTooltipV3/OrTooltip.vue.d.ts +2 -2
  55. package/dist/bundled/v2/components/index.js +5 -5
  56. package/dist/bundled/v2/hooks/useElevation.js +2 -1
  57. package/dist/bundled/v2/hooks/useOverflow.js +5 -4
  58. package/dist/bundled/v2/hooks/useToggle.js +2 -1
  59. package/dist/bundled/{v3/index-6976c52a.js → v2/index-e0b25cea.js} +1229 -715
  60. package/dist/bundled/v2/index.js +5 -5
  61. package/dist/bundled/v2/{lang-02d2bb2d.js → lang-7718d094.js} +275 -196
  62. package/dist/bundled/v2/utils/functions/color.js +2 -1
  63. package/dist/bundled/v2/utils/functions/flattenDeep.js +2 -1
  64. package/dist/bundled/v3/{OrBottomSheet.vue_vue_type_script_lang-461f99cf.js → OrBottomSheet.vue_vue_type_script_lang-a81b2abb.js} +9 -5
  65. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-b42d07c5.js → OrCardCollection.vue_vue_type_script_lang-86a02f38.js} +3 -3
  66. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-7a2e1332.js → OrCardCollection.vue_vue_type_script_lang-d3f43900.js} +6 -5
  67. package/dist/bundled/v3/{OrCarousel.vue_vue_type_script_lang-6976844a.js → OrCarousel.vue_vue_type_script_lang-188ca513.js} +7 -1
  68. package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-1cf06290.js → OrCheckbox.vue_vue_type_script_lang-75c6053a.js} +4 -3
  69. package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-11b16d93.js → OrCheckbox.vue_vue_type_script_lang-ba11d80f.js} +4 -3
  70. package/dist/bundled/v3/{OrCheckboxTree.vue_vue_type_script_lang-4042ef27.js → OrCheckboxTree.vue_vue_type_script_lang-528dd4d5.js} +5 -4
  71. package/dist/bundled/v3/{OrChips.vue_vue_type_script_lang-d4bb44eb.js → OrChips.vue_vue_type_script_lang-211e03a1.js} +4 -2
  72. package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-5397df6a.js → OrCode.vue_vue_type_script_lang-d081cc44.js} +268 -202
  73. package/dist/bundled/v3/{OrCollapse.vue_vue_type_script_lang-5137ca99.js → OrCollapse.vue_vue_type_script_lang-45b18baf.js} +6 -4
  74. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-c3d584a5.js → OrConfirm.vue_vue_type_script_lang-2c3578e7.js} +6 -5
  75. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-89febea7.js → OrConfirm.vue_vue_type_script_lang-925534a5.js} +7 -6
  76. package/dist/bundled/v3/{OrDatePicker.vue_vue_type_script_lang-10648c78.js → OrDatePicker.vue_vue_type_script_lang-50a9aeaf.js} +3 -3
  77. package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-8ff54abd.js → OrDateTimePicker.vue_vue_type_script_lang-6fd7c75e.js} +5 -3
  78. package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-c14895ae.js → OrDateTimePicker.vue_vue_type_script_lang-af944f0d.js} +3 -3
  79. package/dist/bundled/v3/{OrDateTimePickerMonthSelect-74896719.js → OrDateTimePickerMonthSelect-b475eb4f.js} +6 -5
  80. package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-a4558aec.js → OrIconButton.vue_vue_type_script_lang-e786c9e5.js} +1 -1
  81. package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-96cb5b59.js → OrIconButton.vue_vue_type_script_lang-fb99a3ea.js} +4 -3
  82. package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-3317d59e.js → OrInlineInput.vue_vue_type_script_lang-65a0cff4.js} +1 -1
  83. package/dist/bundled/v3/{OrInlineTextEdit.vue_vue_type_script_lang-45987769.js → OrInlineTextEdit.vue_vue_type_script_lang-869c7772.js} +6 -5
  84. package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-bec81f6e.js → OrInlineTextarea.vue_vue_type_script_lang-bbb820b7.js} +1 -1
  85. package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-9596c9e5.js → OrInput.vue_vue_type_script_lang-223ac3b9.js} +1 -1
  86. package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-ad995b35.js → OrInput.vue_vue_type_script_lang-4067879f.js} +1 -1
  87. package/dist/bundled/v3/{OrList.vue_vue_type_script_lang-2c7537cc.js → OrList.vue_vue_type_script_lang-8366e01b.js} +7 -6
  88. package/dist/bundled/v3/{OrListOfInputs.vue_vue_type_script_lang-009f62a5.js → OrListOfInputs.vue_vue_type_script_lang-085ca836.js} +3 -3
  89. package/dist/bundled/v3/{OrMenu.vue_vue_type_script_lang-4151a6c5.js → OrMenu.vue_vue_type_script_lang-a18d3c8d.js} +12 -6
  90. package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-c53617ae.js → OrModal.vue_vue_type_script_lang-ae842e5b.js} +102 -21
  91. package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-8e6bfbe0.js → OrModal.vue_vue_type_script_lang-c71dafa8.js} +2 -2
  92. package/dist/bundled/v3/{OrNotification.vue_vue_type_script_lang-3cb896a6.js → OrNotification.vue_vue_type_script_lang-8bb9dfd1.js} +1 -1
  93. package/dist/bundled/v3/{OrNotification.vue_vue_type_script_lang-efb05bb2.js → OrNotification.vue_vue_type_script_lang-cf2e272c.js} +1 -1
  94. package/dist/bundled/v3/{OrNumberInput.vue_vue_type_script_lang-1d469d1f.js → OrNumberInput.vue_vue_type_script_lang-55c5ea8f.js} +5 -4
  95. package/dist/bundled/v3/{OrOverflowMenu.vue_vue_type_script_lang-ba50133f.js → OrOverflowMenu.vue_vue_type_script_lang-638f90d1.js} +6 -5
  96. package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-b1501bad.js → OrPagination.vue_vue_type_script_lang-e935332b.js} +1 -1
  97. package/dist/bundled/v3/{OrPassword.vue_vue_type_script_lang-37f52611.js → OrPassword.vue_vue_type_script_lang-1f5d2a91.js} +6 -5
  98. package/dist/bundled/v3/{OrPopover.vue_vue_type_script_lang-2d9a006c.js → OrPopover.vue_vue_type_script_lang-2d4eae64.js} +9 -5
  99. package/dist/bundled/v3/{OrRadio.vue_vue_type_script_lang-cc11200c.js → OrRadio.vue_vue_type_script_lang-e1617a0e.js} +4 -3
  100. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-79acec48.js → OrSearch.vue_vue_type_script_lang-1a4ebba2.js} +1 -1
  101. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-bcb935c3.js → OrSearch.vue_vue_type_script_lang-7ac93e50.js} +6 -5
  102. package/dist/bundled/v3/{OrSegmentedControl.vue_vue_type_script_lang-d1b4694c.js → OrSegmentedControl.vue_vue_type_script_lang-ed0d9fe7.js} +3 -1
  103. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-2bd087f3.js → OrSelect.vue_vue_type_script_lang-264914d3.js} +12 -8
  104. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-c82d8f58.js → OrSelect.vue_vue_type_script_lang-29a48259.js} +8 -4
  105. package/dist/bundled/v3/{OrSidebar.vue_vue_type_script_lang-f6179985.js → OrSidebar.vue_vue_type_script_lang-d7f700de.js} +5 -4
  106. package/dist/bundled/v3/{OrStepper.vue_vue_type_script_lang-975a4df6.js → OrStepper.vue_vue_type_script_lang-846beafb.js} +1 -1
  107. package/dist/bundled/v3/{OrSwitch.vue_vue_type_script_lang-1c079a74.js → OrSwitch.vue_vue_type_script_lang-c986f062.js} +4 -3
  108. package/dist/bundled/v3/{OrTabHeaderItem.vue_vue_type_script_lang-0a67721f.js → OrTabHeaderItem.vue_vue_type_script_lang-29f331ec.js} +4 -3
  109. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-06a89286.js → OrTabs.vue_vue_type_script_lang-5836b8bd.js} +6 -5
  110. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-92e9d9d8.js → OrTabs.vue_vue_type_script_lang-6d47e560.js} +9 -5
  111. package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-f2855602.js → OrTag.vue_vue_type_script_lang-8643b784.js} +1 -1
  112. package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-1236e04a.js → OrTextarea.vue_vue_type_script_lang-048cb245.js} +1 -1
  113. package/dist/bundled/v3/{OrTextbox.vue_vue_type_script_lang-812f302d.js → OrTextbox.vue_vue_type_script_lang-dad835c3.js} +7 -6
  114. package/dist/bundled/v3/{OrTimePicker.vue_vue_type_script_lang-805e884c.js → OrTimePicker.vue_vue_type_script_lang-a85e5b96.js} +2 -2
  115. package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-572c7dad.js → OrToastContainer.vue_vue_type_script_lang-9a91e4ab.js} +6 -3
  116. package/dist/bundled/v3/{OrTooltip.vue_vue_type_script_lang-67f6fa3c.js → OrTooltip.vue_vue_type_script_lang-56496d67.js} +1 -1
  117. package/dist/bundled/v3/components/OrAvatar/OrAvatar.js +8 -4
  118. package/dist/bundled/v3/components/OrAvatar/OrAvatar.vue.d.ts +11 -26
  119. package/dist/bundled/v3/components/OrAvatar/index.js +1 -1
  120. package/dist/bundled/v3/components/OrAvatarV3/OrAvatar.js +2 -2
  121. package/dist/bundled/v3/components/OrAvatarV3/OrAvatar.vue.d.ts +8 -24
  122. package/dist/bundled/v3/components/OrAvatarV3/index.js +1 -1
  123. package/dist/bundled/v3/components/OrBottomSheetV3/OrBottomSheet.js +3 -3
  124. package/dist/bundled/v3/components/OrBottomSheetV3/OrBottomSheet.vue.d.ts +20 -33
  125. package/dist/bundled/v3/components/OrBottomSheetV3/index.js +2 -2
  126. package/dist/bundled/v3/components/OrButton/OrButton.js +1 -1
  127. package/dist/bundled/v3/components/OrButton/OrButton.vue.d.ts +16 -51
  128. package/dist/bundled/v3/components/OrButtonV2/OrButton.js +3 -3
  129. package/dist/bundled/v3/components/OrButtonV2/OrButton.vue.d.ts +20 -57
  130. package/dist/bundled/v3/components/OrButtonV2/index.js +2 -2
  131. package/dist/bundled/v3/components/OrButtonV3/OrButton.vue.d.ts +15 -35
  132. package/dist/bundled/v3/components/OrCard/OrCard.vue.d.ts +7 -15
  133. package/dist/bundled/v3/components/OrCardCollection/OrCardCollection.js +6 -6
  134. package/dist/bundled/v3/components/OrCardCollection/OrCardCollection.vue.d.ts +21 -47
  135. package/dist/bundled/v3/components/OrCardCollection/index.js +5 -5
  136. package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.js +10 -10
  137. package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.vue.d.ts +22 -70
  138. package/dist/bundled/v3/components/OrCardCollectionV3/index.js +9 -9
  139. package/dist/bundled/v3/components/OrCardV3/OrCard.vue.d.ts +4 -7
  140. package/dist/bundled/v3/components/OrCarousel/OrCarousel.js +3 -3
  141. package/dist/bundled/v3/components/OrCarousel/OrCarousel.vue.d.ts +126 -676
  142. package/dist/bundled/v3/components/OrCarousel/index.js +1 -1
  143. package/dist/bundled/v3/components/OrCarouselItem/OrCarouselItem.vue.d.ts +1 -1
  144. package/dist/bundled/v3/components/OrCheckbox/OrCheckbox.js +8 -4
  145. package/dist/bundled/v3/components/OrCheckbox/OrCheckbox.vue.d.ts +15 -35
  146. package/dist/bundled/v3/components/OrCheckbox/index.js +1 -1
  147. package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.js +6 -5
  148. package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +6 -24
  149. package/dist/bundled/v3/components/OrCheckboxGroupV3/index.js +2 -2
  150. package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.js +3 -3
  151. package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +17 -43
  152. package/dist/bundled/v3/components/OrCheckboxTreeV3/index.js +2 -2
  153. package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.js +5 -3
  154. package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.vue.d.ts +23 -53
  155. package/dist/bundled/v3/components/OrCheckboxV3/index.js +1 -1
  156. package/dist/bundled/v3/components/OrChip/OrChip.js +5 -3
  157. package/dist/bundled/v3/components/OrChip/OrChip.vue.d.ts +9 -25
  158. package/dist/bundled/v3/components/OrChip/index.js +1 -1
  159. package/dist/bundled/v3/components/OrChips/OrChips.js +3 -3
  160. package/dist/bundled/v3/components/OrChips/OrChips.vue.d.ts +24 -51
  161. package/dist/bundled/v3/components/OrChips/index.js +2 -2
  162. package/dist/bundled/v3/components/OrCode/OrCode.js +6 -6
  163. package/dist/bundled/v3/components/OrCode/OrCode.vue.d.ts +24 -69
  164. package/dist/bundled/v3/components/OrCode/index.js +5 -5
  165. package/dist/bundled/v3/components/OrCode/lang.js +2 -2
  166. package/dist/bundled/v3/components/OrCode/theme.js +1 -1
  167. package/dist/bundled/v3/components/OrCollapse/OrCollapse.js +2 -2
  168. package/dist/bundled/v3/components/OrCollapse/OrCollapse.vue.d.ts +17 -39
  169. package/dist/bundled/v3/components/OrCollapse/index.js +1 -1
  170. package/dist/bundled/v3/components/OrColorPicker/OrColorPicker.js +5 -3
  171. package/dist/bundled/v3/components/OrColorPicker/OrColorPicker.vue.d.ts +13 -31
  172. package/dist/bundled/v3/components/OrColorPicker/index.js +1 -1
  173. package/dist/bundled/v3/components/OrColorPicker/utils/defultPalette.js +2 -1
  174. package/dist/bundled/v3/components/OrCombinedInputV3/OrCombinedInput.vue.d.ts +8 -30
  175. package/dist/bundled/v3/components/OrConfirm/OrConfirm.js +7 -7
  176. package/dist/bundled/v3/components/OrConfirm/OrConfirm.vue.d.ts +23 -84
  177. package/dist/bundled/v3/components/OrConfirm/index.js +6 -6
  178. package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.js +8 -8
  179. package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.vue.d.ts +29 -91
  180. package/dist/bundled/v3/components/OrConfirmV3/index.js +7 -7
  181. package/dist/bundled/v3/components/OrDatePickerV3/OrDatePicker.js +9 -9
  182. package/dist/bundled/v3/components/OrDatePickerV3/OrDatePicker.vue.d.ts +25 -81
  183. package/dist/bundled/v3/components/OrDatePickerV3/index.js +8 -8
  184. package/dist/bundled/v3/components/OrDateTimePicker/OrDateTimePicker.js +8 -6
  185. package/dist/bundled/v3/components/OrDateTimePicker/OrDateTimePicker.vue.d.ts +68 -177
  186. package/dist/bundled/v3/components/OrDateTimePicker/index.js +3 -3
  187. package/dist/bundled/v3/components/OrDateTimePickerV3/OrDateTimePicker.js +9 -9
  188. package/dist/bundled/v3/components/OrDateTimePickerV3/OrDateTimePicker.vue.d.ts +31 -105
  189. package/dist/bundled/v3/components/OrDateTimePickerV3/index.js +8 -8
  190. package/dist/bundled/v3/components/OrEmptyStateV3/OrEmptyState.vue.d.ts +11 -28
  191. package/dist/bundled/v3/components/OrError/OrError.vue.d.ts +4 -8
  192. package/dist/bundled/v3/components/OrErrorTagV3/OrErrorTag.vue.d.ts +4 -7
  193. package/dist/bundled/v3/components/OrErrorV3/OrError.vue.d.ts +9 -18
  194. package/dist/bundled/v3/components/OrExpansionPanelV3/OrExpansionPanel.vue.d.ts +14 -35
  195. package/dist/bundled/v3/components/OrFabV3/OrFab.vue.d.ts +8 -20
  196. package/dist/bundled/v3/components/OrFloating/OrFloating.vue.d.ts +15 -46
  197. package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.vue.d.ts +10 -30
  198. package/dist/bundled/v3/components/OrHint/OrHint.vue.d.ts +4 -8
  199. package/dist/bundled/v3/components/OrHintV3/OrHint.vue.d.ts +9 -18
  200. package/dist/bundled/v3/components/OrIcon/OrIcon.js +6 -2
  201. package/dist/bundled/v3/components/OrIcon/OrIcon.vue.d.ts +16 -44
  202. package/dist/bundled/v3/components/OrIconButtonV2/OrIconButton.js +3 -3
  203. package/dist/bundled/v3/components/OrIconButtonV2/OrIconButton.vue.d.ts +13 -43
  204. package/dist/bundled/v3/components/OrIconButtonV2/index.js +1 -1
  205. package/dist/bundled/v3/components/OrIconButtonV3/OrIconButton.js +6 -6
  206. package/dist/bundled/v3/components/OrIconButtonV3/OrIconButton.vue.d.ts +16 -52
  207. package/dist/bundled/v3/components/OrIconButtonV3/index.js +5 -5
  208. package/dist/bundled/v3/components/OrIconV3/OrIcon.vue.d.ts +7 -18
  209. package/dist/bundled/v3/components/OrInlineInputBoxV3/OrInlineInputBox.vue.d.ts +7 -16
  210. package/dist/bundled/v3/components/OrInlineInputV3/OrInlineInput.js +13 -9
  211. package/dist/bundled/v3/components/OrInlineInputV3/OrInlineInput.vue.d.ts +39 -83
  212. package/dist/bundled/v3/components/OrInlineInputV3/index.js +6 -6
  213. package/dist/bundled/v3/components/OrInlineTextEdit/OrInlineTextEdit.js +28 -12
  214. package/dist/bundled/v3/components/OrInlineTextEdit/OrInlineTextEdit.vue.d.ts +43 -95
  215. package/dist/bundled/v3/components/OrInlineTextEdit/index.js +3 -3
  216. package/dist/bundled/v3/components/OrInlineTextareaV3/OrInlineTextarea.js +13 -9
  217. package/dist/bundled/v3/components/OrInlineTextareaV3/OrInlineTextarea.vue.d.ts +39 -79
  218. package/dist/bundled/v3/components/OrInlineTextareaV3/index.js +6 -6
  219. package/dist/bundled/v3/components/OrInput/OrInput.js +12 -6
  220. package/dist/bundled/v3/components/OrInput/OrInput.vue.d.ts +36 -87
  221. package/dist/bundled/v3/components/OrInput/index.js +2 -2
  222. package/dist/bundled/v3/components/OrInputBoxV3/OrInputBox.vue.d.ts +7 -22
  223. package/dist/bundled/v3/components/OrInputV3/OrInput.js +7 -7
  224. package/dist/bundled/v3/components/OrInputV3/OrInput.vue.d.ts +34 -85
  225. package/dist/bundled/v3/components/OrInputV3/index.js +6 -6
  226. package/dist/bundled/v3/components/OrLabel/OrLabel.vue.d.ts +9 -20
  227. package/dist/bundled/v3/components/OrLabelV3/OrLabel.vue.d.ts +9 -24
  228. package/dist/bundled/v3/components/OrLinkV3/OrLink.vue.d.ts +7 -24
  229. package/dist/bundled/v3/components/OrList/OrList.js +4 -4
  230. package/dist/bundled/v3/components/OrList/OrList.vue.d.ts +21 -47
  231. package/dist/bundled/v3/components/OrList/index.js +3 -3
  232. package/dist/bundled/v3/components/OrListOfInputs/OrListOfInputs.js +63 -54
  233. package/dist/bundled/v3/components/OrListOfInputs/OrListOfInputs.vue.d.ts +11 -27
  234. package/dist/bundled/v3/components/OrListOfInputs/index.js +6 -6
  235. package/dist/bundled/v3/components/OrLoader/OrLoader.vue.d.ts +10 -26
  236. package/dist/bundled/v3/components/OrLoaderV3/OrLoader.vue.d.ts +13 -34
  237. package/dist/bundled/v3/components/OrMenuItemV3/OrMenuItem.vue.d.ts +13 -34
  238. package/dist/bundled/v3/components/OrMenuV3/OrMenu.js +8 -6
  239. package/dist/bundled/v3/components/OrMenuV3/OrMenu.vue.d.ts +16 -43
  240. package/dist/bundled/v3/components/OrMenuV3/index.js +4 -4
  241. package/dist/bundled/v3/components/OrModal/OrModal.js +3 -3
  242. package/dist/bundled/v3/components/OrModal/OrModal.vue.d.ts +14 -38
  243. package/dist/bundled/v3/components/OrModal/index.js +2 -2
  244. package/dist/bundled/v3/components/OrModalV3/OrModal.js +7 -7
  245. package/dist/bundled/v3/components/OrModalV3/OrModal.vue.d.ts +13 -27
  246. package/dist/bundled/v3/components/OrModalV3/index.js +6 -6
  247. package/dist/bundled/v3/components/OrNotification/OrNotification.js +3 -3
  248. package/dist/bundled/v3/components/OrNotification/OrNotification.vue.d.ts +9 -27
  249. package/dist/bundled/v3/components/OrNotification/index.js +2 -2
  250. package/dist/bundled/v3/components/OrNotificationV3/OrNotification.js +7 -7
  251. package/dist/bundled/v3/components/OrNotificationV3/OrNotification.vue.d.ts +9 -20
  252. package/dist/bundled/v3/components/OrNotificationV3/index.js +6 -6
  253. package/dist/bundled/v3/components/OrNumberInput/OrNumberInput.js +4 -4
  254. package/dist/bundled/v3/components/OrNumberInput/OrNumberInput.vue.d.ts +24 -70
  255. package/dist/bundled/v3/components/OrNumberInput/index.js +3 -3
  256. package/dist/bundled/v3/components/OrOverflowMenu/OrOverflowMenu.js +4 -4
  257. package/dist/bundled/v3/components/OrOverflowMenu/OrOverflowMenu.vue.d.ts +13 -31
  258. package/dist/bundled/v3/components/OrOverflowMenu/index.js +3 -3
  259. package/dist/bundled/v3/components/OrOverlay/OrOverlay.vue.d.ts +6 -16
  260. package/dist/bundled/v3/components/OrOverlayV3/OrOverlay.js +2 -2
  261. package/dist/bundled/v3/components/OrOverlayV3/OrOverlay.vue.d.ts +7 -14
  262. package/dist/bundled/v3/components/OrOverlayV3/index.js +1 -1
  263. package/dist/bundled/v3/components/OrPaginationV3/OrPagination.js +6 -6
  264. package/dist/bundled/v3/components/OrPaginationV3/OrPagination.vue.d.ts +27 -75
  265. package/dist/bundled/v3/components/OrPaginationV3/index.js +5 -5
  266. package/dist/bundled/v3/components/OrPassword/OrPassword.js +5 -5
  267. package/dist/bundled/v3/components/OrPassword/OrPassword.vue.d.ts +22 -63
  268. package/dist/bundled/v3/components/OrPassword/index.js +4 -4
  269. package/dist/bundled/v3/components/OrPopoverV3/OrPopover.js +4 -4
  270. package/dist/bundled/v3/components/OrPopoverV3/OrPopover.vue.d.ts +27 -74
  271. package/dist/bundled/v3/components/OrPopoverV3/index.js +3 -3
  272. package/dist/bundled/v3/components/OrProgress/OrProgress.vue.d.ts +20 -56
  273. package/dist/bundled/v3/components/OrProgressV3/OrProgress.vue.d.ts +25 -62
  274. package/dist/bundled/v3/components/OrRadio/OrRadio.js +5 -3
  275. package/dist/bundled/v3/components/OrRadio/OrRadio.vue.d.ts +13 -35
  276. package/dist/bundled/v3/components/OrRadio/index.js +1 -1
  277. package/dist/bundled/v3/components/OrRadioGroup/OrRadioGroup.vue.d.ts +9 -26
  278. package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.js +4 -3
  279. package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +6 -32
  280. package/dist/bundled/v3/components/OrRadioV3/OrRadio.vue.d.ts +21 -49
  281. package/dist/bundled/v3/components/OrSearch/OrSearch.js +5 -5
  282. package/dist/bundled/v3/components/OrSearch/OrSearch.vue.d.ts +23 -65
  283. package/dist/bundled/v3/components/OrSearch/index.js +4 -4
  284. package/dist/bundled/v3/components/OrSearchV3/OrSearch.js +8 -8
  285. package/dist/bundled/v3/components/OrSearchV3/OrSearch.vue.d.ts +17 -41
  286. package/dist/bundled/v3/components/OrSearchV3/index.js +7 -7
  287. package/dist/bundled/v3/components/OrSegmentedControlV3/OrSegmentedControl.js +2 -2
  288. package/dist/bundled/v3/components/OrSegmentedControlV3/OrSegmentedControl.vue.d.ts +9 -25
  289. package/dist/bundled/v3/components/OrSegmentedControlV3/index.js +1 -1
  290. package/dist/bundled/v3/components/OrSelect/OrSelect.js +4 -4
  291. package/dist/bundled/v3/components/OrSelect/OrSelect.vue.d.ts +28 -77
  292. package/dist/bundled/v3/components/OrSelect/index.js +3 -3
  293. package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +10 -10
  294. package/dist/bundled/v3/components/OrSelectV3/OrSelect.vue.d.ts +37 -115
  295. package/dist/bundled/v3/components/OrSelectV3/index.js +9 -9
  296. package/dist/bundled/v3/components/OrSidebar/OrSidebar.vue.d.ts +14 -33
  297. package/dist/bundled/v3/components/OrSidebarV3/OrSidebar.js +7 -7
  298. package/dist/bundled/v3/components/OrSidebarV3/OrSidebar.vue.d.ts +28 -63
  299. package/dist/bundled/v3/components/OrSidebarV3/index.js +6 -6
  300. package/dist/bundled/v3/components/OrSkeletonCircle/OrSkeletonCircle.vue.d.ts +9 -20
  301. package/dist/bundled/v3/components/OrSkeletonCircleV3/OrSkeletonCircle.vue.d.ts +13 -28
  302. package/dist/bundled/v3/components/OrSkeletonRect/OrSkeletonRect.vue.d.ts +9 -22
  303. package/dist/bundled/v3/components/OrSkeletonRectV3/OrSkeletonRect.vue.d.ts +11 -26
  304. package/dist/bundled/v3/components/OrSkeletonText/OrSkeletonText.vue.d.ts +10 -26
  305. package/dist/bundled/v3/components/OrSkeletonTextV3/OrSkeletonText.vue.d.ts +16 -40
  306. package/dist/bundled/v3/components/OrSlider/OrSlider.js +17 -5
  307. package/dist/bundled/v3/components/OrSlider/OrSlider.vue.d.ts +35 -91
  308. package/dist/bundled/v3/components/OrSlider/index.js +1 -1
  309. package/dist/bundled/v3/components/OrSortHeaderV3/OrSortHeader.vue.d.ts +13 -25
  310. package/dist/bundled/v3/components/OrStepper/OrStepper.js +3 -3
  311. package/dist/bundled/v3/components/OrStepper/OrStepper.vue.d.ts +16 -43
  312. package/dist/bundled/v3/components/OrStepper/index.js +2 -2
  313. package/dist/bundled/v3/components/OrSwitch/OrSwitch.js +5 -3
  314. package/dist/bundled/v3/components/OrSwitch/OrSwitch.vue.d.ts +12 -33
  315. package/dist/bundled/v3/components/OrSwitch/index.js +1 -1
  316. package/dist/bundled/v3/components/OrSwitchV3/OrSwitch.vue.d.ts +22 -53
  317. package/dist/bundled/v3/components/OrTab/OrTab.vue.d.ts +9 -22
  318. package/dist/bundled/v3/components/OrTabHeaderItem/OrTabHeaderItem.js +5 -3
  319. package/dist/bundled/v3/components/OrTabHeaderItem/OrTabHeaderItem.vue.d.ts +13 -29
  320. package/dist/bundled/v3/components/OrTabHeaderItem/index.js +1 -1
  321. package/dist/bundled/v3/components/OrTabV3/OrTab.vue.d.ts +10 -17
  322. package/dist/bundled/v3/components/OrTabs/OrTabs.js +3 -3
  323. package/dist/bundled/v3/components/OrTabs/OrTabs.vue.d.ts +4 -17
  324. package/dist/bundled/v3/components/OrTabs/index.js +2 -2
  325. package/dist/bundled/v3/components/OrTabsV3/OrTabs.js +6 -6
  326. package/dist/bundled/v3/components/OrTabsV3/OrTabs.vue.d.ts +24 -69
  327. package/dist/bundled/v3/components/OrTabsV3/index.js +5 -5
  328. package/dist/bundled/v3/components/OrTag/OrTag.js +5 -3
  329. package/dist/bundled/v3/components/OrTag/OrTag.vue.d.ts +10 -27
  330. package/dist/bundled/v3/components/OrTag/index.js +1 -1
  331. package/dist/bundled/v3/components/OrTagV3/OrTag.js +7 -7
  332. package/dist/bundled/v3/components/OrTagV3/OrTag.vue.d.ts +12 -23
  333. package/dist/bundled/v3/components/OrTagV3/index.js +6 -6
  334. package/dist/bundled/v3/components/OrTeleport/OrTeleport.vue3.vue.d.ts +4 -10
  335. package/dist/bundled/v3/components/OrTeleportV3/OrTeleport.vue3.vue.d.ts +4 -10
  336. package/dist/bundled/v3/components/OrTextV3/OrText.vue.d.ts +11 -24
  337. package/dist/bundled/v3/components/OrTextarea/OrTextarea.js +12 -6
  338. package/dist/bundled/v3/components/OrTextarea/OrTextarea.vue.d.ts +37 -85
  339. package/dist/bundled/v3/components/OrTextarea/index.js +2 -2
  340. package/dist/bundled/v3/components/OrTextareaV3/OrTextarea.vue.d.ts +32 -73
  341. package/dist/bundled/v3/components/OrTextbox/OrTextbox.js +22 -10
  342. package/dist/bundled/v3/components/OrTextbox/OrTextbox.vue.d.ts +55 -137
  343. package/dist/bundled/v3/components/OrTextbox/index.js +3 -3
  344. package/dist/bundled/v3/components/OrTimePickerV3/OrTimePicker.js +7 -7
  345. package/dist/bundled/v3/components/OrTimePickerV3/OrTimePicker.vue.d.ts +25 -79
  346. package/dist/bundled/v3/components/OrTimePickerV3/index.js +6 -6
  347. package/dist/bundled/v3/components/OrToast/OrToast.js +4 -2
  348. package/dist/bundled/v3/components/OrToast/OrToast.vue.d.ts +11 -31
  349. package/dist/bundled/v3/components/OrToast/composable/useToast.js +10 -5
  350. package/dist/bundled/v3/components/OrToast/index.js +2 -2
  351. package/dist/bundled/v3/components/OrToastContainer/OrToastContainer.js +3 -3
  352. package/dist/bundled/v3/components/OrToastContainer/OrToastContainer.vue.d.ts +25 -55
  353. package/dist/bundled/v3/components/OrToastContainer/index.js +2 -2
  354. package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.js +7 -7
  355. package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.vue.d.ts +24 -54
  356. package/dist/bundled/v3/components/OrToastContainerV3/index.js +6 -6
  357. package/dist/bundled/v3/components/OrToastV3/OrToast.js +8 -6
  358. package/dist/bundled/v3/components/OrToastV3/OrToast.vue.d.ts +16 -38
  359. package/dist/bundled/v3/components/OrToastV3/composable/useToast.js +10 -5
  360. package/dist/bundled/v3/components/OrToastV3/index.js +6 -6
  361. package/dist/bundled/v3/components/OrTooltip/OrTooltip.js +6 -2
  362. package/dist/bundled/v3/components/OrTooltip/OrTooltip.vue.d.ts +14 -33
  363. package/dist/bundled/v3/components/OrTooltipContent/OrTooltipContent.vue.d.ts +4 -10
  364. package/dist/bundled/v3/components/OrTooltipV3/OrTooltip.js +5 -5
  365. package/dist/bundled/v3/components/OrTooltipV3/OrTooltip.vue.d.ts +13 -37
  366. package/dist/bundled/v3/components/OrTooltipV3/index.js +4 -4
  367. package/dist/bundled/v3/components/index.js +65 -65
  368. package/dist/bundled/v3/directives/dropdown-close.d.ts +3 -1
  369. package/dist/bundled/v3/directives/dropdown-open.d.ts +3 -1
  370. package/dist/bundled/v3/hooks/useElevation.js +2 -1
  371. package/dist/bundled/v3/hooks/useOverflow.js +5 -4
  372. package/dist/bundled/v3/hooks/useResponsive/useResponsive.d.ts +2 -2
  373. package/dist/bundled/v3/hooks/useToggle.js +2 -1
  374. package/dist/bundled/{v2/index-6976c52a.js → v3/index-e0b25cea.js} +1229 -715
  375. package/dist/bundled/v3/index.js +65 -65
  376. package/dist/bundled/v3/{lang-02d2bb2d.js → lang-7718d094.js} +275 -196
  377. package/dist/bundled/v3/utils/functions/color.js +2 -1
  378. package/dist/bundled/v3/utils/functions/flattenDeep.js +2 -1
  379. package/dist/esm/v2/{OrAvatar-12b0e276.js → OrAvatar-3df48865.js} +1 -1
  380. package/dist/esm/v2/{OrBottomSheet-7b8449e9.js → OrBottomSheet-ffa029ca.js} +9 -5
  381. package/dist/esm/v2/OrButton-b4a39652.js +195 -0
  382. package/dist/esm/v2/{OrButton-4e532ddb.js → OrButton-dbf0efe7.js} +1 -1
  383. package/dist/esm/v2/OrButton.vue_rollup-plugin-vue_styles.0-83b5a752.js +106 -0
  384. package/dist/esm/v2/{OrCardCollection-d92966db.js → OrCardCollection-722c83ce.js} +4 -4
  385. package/dist/esm/v2/{OrCardCollection-9bf513b7.js → OrCardCollection-fe8a1a88.js} +8 -7
  386. package/dist/esm/v2/{OrCarousel-e0c2e387.js → OrCarousel-5c2b2d10.js} +7 -1
  387. package/dist/esm/v2/{OrCheckbox-7b98fc08.js → OrCheckbox-03e5eaff.js} +4 -3
  388. package/dist/esm/v2/{OrCheckbox-60e4456b.js → OrCheckbox-59332f84.js} +4 -3
  389. package/dist/esm/v2/{OrCheckboxTree-85f8ec89.js → OrCheckboxTree-df80d4ab.js} +6 -5
  390. package/dist/esm/v2/{OrCode-e54e09f7.js → OrCode-0288dd2d.js} +8 -7
  391. package/dist/esm/v2/{OrCollapse-50e3914c.js → OrCollapse-57c64292.js} +6 -4
  392. package/dist/esm/v2/{OrColorPicker-fa92b4fa.js → OrColorPicker-ca470d10.js} +2 -1
  393. package/dist/esm/v2/{OrConfirm-61904137.js → OrConfirm-687e6730.js} +6 -5
  394. package/dist/esm/v2/{OrConfirm-5d5dd9bc.js → OrConfirm-b62d9ce4.js} +8 -7
  395. package/dist/esm/v2/{OrDatePicker-0870820f.js → OrDatePicker-f88f8950.js} +3 -3
  396. package/dist/esm/v2/{OrDateTimePicker-f2243479.js → OrDateTimePicker-32dae87a.js} +3 -3
  397. package/dist/esm/v2/{OrDateTimePicker-6e2853ec.js → OrDateTimePicker-77ef1975.js} +4 -4
  398. package/dist/esm/v2/{OrDateTimePickerMonthSelect-159efa66.js → OrDateTimePickerMonthSelect-bb583c5f.js} +7 -6
  399. package/dist/esm/v2/{OrIconButton-23972f7d.js → OrIconButton-83608cbc.js} +1 -1
  400. package/dist/esm/v2/{OrIconButton-0ecb9d8e.js → OrIconButton-d8fc2902.js} +2 -2
  401. package/dist/esm/v2/OrIconButton.vue_rollup-plugin-vue_styles.0-20b054cc.js +206 -0
  402. package/dist/esm/v2/{OrInlineInput-1e7f2ba2.js → OrInlineInput-46d0cc13.js} +1 -1
  403. package/dist/esm/v2/{OrInlineTextEdit-9541b625.js → OrInlineTextEdit-a129aaf1.js} +8 -7
  404. package/dist/esm/v2/{OrInlineTextarea-ab911736.js → OrInlineTextarea-c23c5fb2.js} +1 -1
  405. package/dist/esm/v2/{OrInput-27f35cd3.js → OrInput-61086e47.js} +1 -1
  406. package/dist/esm/v2/{OrInput-c005a759.js → OrInput-bc2371b6.js} +1 -1
  407. package/dist/esm/v2/{OrList-61c7b8ea.js → OrList-7de293f5.js} +8 -7
  408. package/dist/esm/v2/{OrListOfInputs-e1b09290.js → OrListOfInputs-fa926159.js} +5 -5
  409. package/dist/esm/v2/{OrMenu-b2a79308.js → OrMenu-63ed2235.js} +12 -6
  410. package/dist/esm/v2/{OrModal-b9cfb8ec.js → OrModal-3f09ae47.js} +7 -6
  411. package/dist/esm/v2/{OrModal-51519c0d.js → OrModal-a4c0fa77.js} +2 -2
  412. package/dist/esm/v2/{OrNotification-19cd0212.js → OrNotification-af62b848.js} +1 -1
  413. package/dist/esm/v2/{OrNotification-fdb88eec.js → OrNotification-bfa97981.js} +3 -3
  414. package/dist/esm/v2/{OrNumberInput-eb0e7087.js → OrNumberInput-5b1135df.js} +5 -4
  415. package/dist/esm/v2/{OrOverflowMenu-83540c76.js → OrOverflowMenu-13fac7a3.js} +8 -7
  416. package/dist/esm/v2/{OrOverlay-38acdcfa.js → OrOverlay-4c8c11e2.js} +1 -1
  417. package/dist/esm/v2/{OrPagination-9b58b74c.js → OrPagination-75e7cade.js} +2 -2
  418. package/dist/esm/v2/{OrPassword-022e10fd.js → OrPassword-82877067.js} +9 -8
  419. package/dist/esm/v2/{OrPopover-20cac769.js → OrPopover-50995dcf.js} +10 -6
  420. package/dist/esm/v2/{OrRadio-514e8de8.js → OrRadio-f53c0944.js} +4 -3
  421. package/dist/esm/v2/{OrSearch-620d5d76.js → OrSearch-330e9af0.js} +8 -7
  422. package/dist/esm/v2/{OrSearch-b30b29c1.js → OrSearch-7ccc1f33.js} +1 -1
  423. package/dist/esm/v2/{OrSelect-d887118b.js → OrSelect-22eea9cc.js} +1 -1
  424. package/dist/esm/v2/{OrSelect-4a54ac1c.js → OrSelect-9c8f96b2.js} +13 -9
  425. package/dist/esm/v2/{OrSidebar-b36f0d10.js → OrSidebar-b8387abe.js} +5 -4
  426. package/dist/esm/v2/{OrSidebarCollapseButton-3b46a709.js → OrSidebarCollapseButton-4bf3bad8.js} +1 -1
  427. package/dist/esm/v2/{OrStepper-b00f7531.js → OrStepper-2ae3fc21.js} +2 -2
  428. package/dist/esm/v2/{OrSwitch-cd24ee40.js → OrSwitch-e7fe2b86.js} +4 -3
  429. package/dist/esm/v2/{OrTabHeaderItem-6a08756e.js → OrTabHeaderItem-46947417.js} +4 -3
  430. package/dist/esm/v2/{OrTabs-12138346.js → OrTabs-1b314eeb.js} +6 -5
  431. package/dist/esm/v2/{OrTabs-54b66eb4.js → OrTabs-87069663.js} +10 -6
  432. package/dist/esm/v2/{OrTag-9c6caef5.js → OrTag-843ec724.js} +1 -1
  433. package/dist/esm/v2/{OrTag-6349049b.js → OrTag-8ded4261.js} +1 -1
  434. package/dist/esm/v2/{OrTextarea-724a4d6f.js → OrTextarea-226ab7a2.js} +1 -1
  435. package/dist/esm/v2/{OrTextbox-0373bd6a.js → OrTextbox-90badc95.js} +10 -9
  436. package/dist/esm/v2/{OrTimePicker-de9611da.js → OrTimePicker-33973321.js} +2 -2
  437. package/dist/esm/v2/{OrToastContainer-1625b803.js → OrToastContainer-2f530752.js} +4 -4
  438. package/dist/esm/v2/{OrTooltip-d08323f1.js → OrTooltip-93a3eefb.js} +1 -1
  439. package/dist/esm/{v3/color-1f348774.js → v2/color-40b7fe6b.js} +2 -1
  440. package/dist/esm/v2/components/index.js +66 -66
  441. package/dist/esm/v2/components/or-avatar-v3/index.js +2 -2
  442. package/dist/esm/v2/components/or-bottom-sheet-v3/index.js +3 -3
  443. package/dist/esm/v2/components/or-button/index.js +1 -1
  444. package/dist/esm/v2/components/or-button-v2/index.js +4 -4
  445. package/dist/esm/v2/components/or-card-collection/index.js +7 -7
  446. package/dist/esm/v2/components/or-card-collection-v3/index.js +10 -10
  447. package/dist/esm/v2/components/or-carousel/index.js +1 -1
  448. package/dist/esm/v2/components/or-checkbox/index.js +1 -1
  449. package/dist/esm/v2/components/or-checkbox-group-v3/index.js +7 -6
  450. package/dist/esm/v2/components/or-checkbox-tree-v3/index.js +3 -3
  451. package/dist/esm/v2/components/or-checkbox-v3/index.js +1 -1
  452. package/dist/esm/v2/components/or-code/index.js +5 -5
  453. package/dist/esm/v2/components/or-collapse/index.js +1 -1
  454. package/dist/esm/v2/components/or-color-picker/index.js +1 -1
  455. package/dist/esm/v2/components/or-confirm/index.js +8 -8
  456. package/dist/esm/v2/components/or-confirm-v3/index.js +8 -8
  457. package/dist/esm/v2/components/or-date-picker-v3/index.js +9 -9
  458. package/dist/esm/v2/components/or-date-time-picker/index.js +5 -5
  459. package/dist/esm/v2/components/or-date-time-picker-v3/index.js +9 -9
  460. package/dist/esm/v2/components/or-icon-button-v2/index.js +2 -2
  461. package/dist/esm/v2/components/or-icon-button-v3/index.js +6 -6
  462. package/dist/esm/v2/components/or-inline-input-v3/index.js +7 -7
  463. package/dist/esm/v2/components/or-inline-text-edit/index.js +5 -5
  464. package/dist/esm/v2/components/or-inline-textarea-v3/index.js +7 -7
  465. package/dist/esm/v2/components/or-input/index.js +2 -2
  466. package/dist/esm/v2/components/or-input-v3/index.js +7 -7
  467. package/dist/esm/v2/components/or-list/index.js +5 -5
  468. package/dist/esm/v2/components/or-list-of-inputs/index.js +8 -8
  469. package/dist/esm/v2/components/or-menu-v3/index.js +5 -5
  470. package/dist/esm/v2/components/or-modal/index.js +4 -4
  471. package/dist/esm/v2/components/or-modal-v3/index.js +7 -7
  472. package/dist/esm/v2/components/or-notification/index.js +4 -4
  473. package/dist/esm/v2/components/or-notification-v3/index.js +7 -7
  474. package/dist/esm/v2/components/or-number-input/index.js +3 -3
  475. package/dist/esm/v2/components/or-overflow-menu/index.js +5 -5
  476. package/dist/esm/v2/components/or-overlay-v3/index.js +2 -2
  477. package/dist/esm/v2/components/or-pagination-v3/index.js +6 -6
  478. package/dist/esm/v2/components/or-password/index.js +7 -7
  479. package/dist/esm/v2/components/or-popover-v3/index.js +4 -4
  480. package/dist/esm/v2/components/or-radio/index.js +1 -1
  481. package/dist/esm/v2/components/or-radio-group-v3/index.js +4 -3
  482. package/dist/esm/v2/components/or-search/index.js +6 -6
  483. package/dist/esm/v2/components/or-search-v3/index.js +8 -8
  484. package/dist/esm/v2/components/or-select/index.js +2 -2
  485. package/dist/esm/v2/components/or-select-v3/index.js +11 -11
  486. package/dist/esm/v2/components/or-sidebar-v3/index.js +8 -8
  487. package/dist/esm/v2/components/or-sidebar-v3/partials/index.js +7 -7
  488. package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +7 -7
  489. package/dist/esm/v2/components/or-stepper/index.js +4 -4
  490. package/dist/esm/v2/components/or-switch/index.js +1 -1
  491. package/dist/esm/v2/components/or-tab-header-item/index.js +1 -1
  492. package/dist/esm/v2/components/or-tabs/index.js +2 -2
  493. package/dist/esm/v2/components/or-tabs-v3/index.js +6 -6
  494. package/dist/esm/v2/components/or-tag/index.js +2 -2
  495. package/dist/esm/v2/components/or-tag-v3/index.js +7 -7
  496. package/dist/esm/v2/components/or-text-v3/OrText.vue.d.ts +2 -2
  497. package/dist/esm/v2/components/or-textarea/OrTextarea.vue.d.ts +2 -2
  498. package/dist/esm/v2/components/or-textarea/index.js +2 -2
  499. package/dist/esm/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +2 -2
  500. package/dist/esm/v2/components/or-textbox/OrTextbox.vue.d.ts +2 -2
  501. package/dist/esm/v2/components/or-textbox/index.js +6 -6
  502. package/dist/esm/v2/components/or-time-picker-v3/OrTimePicker.vue.d.ts +2 -2
  503. package/dist/esm/v2/components/or-time-picker-v3/index.js +7 -7
  504. package/dist/esm/v2/components/or-toast/OrToast.vue.d.ts +2 -2
  505. package/dist/esm/v2/components/or-toast/composable/index.js +1 -1
  506. package/dist/esm/v2/components/or-toast/index.js +5 -5
  507. package/dist/esm/v2/components/or-toast/or-toast-container/OrToastContainer.vue.d.ts +2 -2
  508. package/dist/esm/v2/components/or-toast/or-toast-container/index.js +5 -5
  509. package/dist/esm/v2/components/or-toast-v3/OrToast.vue.d.ts +2 -2
  510. package/dist/esm/v2/components/or-toast-v3/composable/index.js +1 -1
  511. package/dist/esm/v2/components/or-toast-v3/index.js +8 -8
  512. package/dist/esm/v2/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue.d.ts +2 -2
  513. package/dist/esm/v2/components/or-toast-v3/or-toast-container-v3/index.js +8 -8
  514. package/dist/esm/v2/components/or-tooltip/OrTooltip.vue.d.ts +2 -2
  515. package/dist/esm/v2/components/or-tooltip/or-tooltip-content/OrTooltipContent.vue.d.ts +2 -2
  516. package/dist/esm/v2/components/or-tooltip-v3/OrTooltip.vue.d.ts +2 -2
  517. package/dist/esm/v2/components/or-tooltip-v3/index.js +5 -5
  518. package/dist/esm/v2/{flattenDeep-e7a8b995.js → flattenDeep-fe0af413.js} +2 -1
  519. package/dist/esm/v2/hooks/index.js +3 -3
  520. package/dist/esm/v2/index.js +67 -67
  521. package/dist/esm/v2/{types-483890e4.js → types-13f5380a.js} +9 -6
  522. package/dist/esm/{v3/useElevation-df91fa50.js → v2/useElevation-b5a49746.js} +2 -1
  523. package/dist/esm/v2/{useOverflow-af6161c8.js → useOverflow-c856b7b7.js} +5 -4
  524. package/dist/esm/{v3/useToast-0665462d.js → v2/useToast-a1332cc2.js} +10 -5
  525. package/dist/esm/v2/{useToast-4fbe0e5a.js → useToast-b5ea5cb2.js} +10 -5
  526. package/dist/esm/{v3/useToggle-29e4d7c7.js → v2/useToggle-c04fc920.js} +2 -1
  527. package/dist/esm/v3/{OrAvatar-1ebca2e8.js → OrAvatar-3ccb5f60.js} +1 -1
  528. package/dist/esm/v3/{OrAvatar-14a5c5f0.js → OrAvatar-8a73221d.js} +7 -3
  529. package/dist/esm/v3/{OrBottomSheet-e491689f.js → OrBottomSheet-5969a217.js} +9 -5
  530. package/dist/esm/v3/OrButton-49605f5c.js +162 -0
  531. package/dist/esm/v3/OrButton-d6834ea0.js +142 -0
  532. package/dist/esm/v3/{OrCardCollection-a0cc4895.js → OrCardCollection-b319b723.js} +4 -4
  533. package/dist/esm/v3/{OrCardCollection-ffbb9eda.js → OrCardCollection-d79dac85.js} +8 -7
  534. package/dist/esm/v3/{OrCarousel-03597740.js → OrCarousel-4fb775f8.js} +8 -2
  535. package/dist/esm/v3/{OrCheckbox-247ce27b.js → OrCheckbox-56d7b6eb.js} +7 -4
  536. package/dist/esm/v3/{OrCheckbox-7efd5f26.js → OrCheckbox-ab457011.js} +11 -6
  537. package/dist/esm/v3/{OrCheckboxTree-ed8b5f53.js → OrCheckboxTree-4a85b9b3.js} +6 -5
  538. package/dist/esm/v3/{OrChip-97a85e10.js → OrChip-1b479371.js} +4 -2
  539. package/dist/esm/v3/{OrChips-64b86761.js → OrChips-544a35b3.js} +4 -2
  540. package/dist/esm/v3/{OrCode-6f2e4d99.js → OrCode-48281fc0.js} +7 -6
  541. package/dist/esm/v3/{OrCollapse-37a52e8f.js → OrCollapse-2b31de04.js} +6 -4
  542. package/dist/esm/v3/{OrColorPicker-9a149e6b.js → OrColorPicker-ffaaf14f.js} +5 -2
  543. package/dist/esm/v3/{OrConfirm-c497fe8e.js → OrConfirm-017b80b5.js} +6 -5
  544. package/dist/esm/v3/{OrConfirm-ab04201f.js → OrConfirm-1a94bdea.js} +8 -7
  545. package/dist/esm/v3/{OrDatePicker-b4e92bf3.js → OrDatePicker-09a6c970.js} +3 -3
  546. package/dist/esm/v3/{OrDateTimePicker-014f7819.js → OrDateTimePicker-2af19719.js} +9 -5
  547. package/dist/esm/v3/{OrDateTimePicker-cd4741af.js → OrDateTimePicker-40e08446.js} +3 -3
  548. package/dist/esm/v3/{OrDateTimePickerMonthSelect-9fb0b634.js → OrDateTimePickerMonthSelect-45e637e4.js} +7 -6
  549. package/dist/esm/v3/{OrIcon-925c5413.js → OrIcon-b566a871.js} +7 -3
  550. package/dist/esm/v3/OrIconButton-049a3bd2.js +223 -0
  551. package/dist/esm/v3/{OrIconButton-6c3fafc2.js → OrIconButton-55d51a7a.js} +2 -2
  552. package/dist/esm/v3/{OrInlineInput-6209e8c8.js → OrInlineInput-9ed7d570.js} +7 -3
  553. package/dist/esm/v3/{OrInlineTextEdit-6f97629f.js → OrInlineTextEdit-4f4ecba4.js} +31 -14
  554. package/dist/esm/v3/{OrInlineTextarea-1c36f763.js → OrInlineTextarea-f30d0580.js} +7 -3
  555. package/dist/esm/v3/{OrInput-0dbd5a01.js → OrInput-53a32706.js} +10 -4
  556. package/dist/esm/v3/{OrInput-4215a3d8.js → OrInput-de491b63.js} +1 -1
  557. package/dist/esm/v3/{OrList-b8799cf4.js → OrList-0543a645.js} +8 -7
  558. package/dist/esm/v3/{OrListOfInputs-16ba8358.js → OrListOfInputs-2fc8087c.js} +61 -52
  559. package/dist/esm/v3/{OrMenu-45a1dc3e.js → OrMenu-bce8349d.js} +15 -7
  560. package/dist/esm/v3/{OrModal-6ff24390.js → OrModal-0908f20a.js} +2 -2
  561. package/dist/esm/v3/{OrModal-e6513e8c.js → OrModal-c420594e.js} +6 -5
  562. package/dist/esm/v3/{OrNotification-4c56f7ea.js → OrNotification-9a696585.js} +3 -3
  563. package/dist/esm/v3/{OrNotification-0a674902.js → OrNotification-cdce5546.js} +1 -1
  564. package/dist/esm/v3/{OrNumberInput-dca5e850.js → OrNumberInput-a80859d1.js} +5 -4
  565. package/dist/esm/v3/{OrOverflowMenu-fe77e22c.js → OrOverflowMenu-4b2d2950.js} +6 -5
  566. package/dist/esm/v3/{OrOverlay-d63d39c3.js → OrOverlay-bf72f582.js} +1 -1
  567. package/dist/esm/v3/{OrPagination-5846675e.js → OrPagination-7d223695.js} +2 -2
  568. package/dist/esm/v3/{OrPassword-9c8a458d.js → OrPassword-35c5775f.js} +8 -7
  569. package/dist/esm/v3/{OrPopover-0635cb63.js → OrPopover-84d5b844.js} +10 -6
  570. package/dist/esm/v3/{OrRadio-c3ab11f2.js → OrRadio-dfd0f0c9.js} +7 -4
  571. package/dist/esm/v3/{OrSearch-2770023a.js → OrSearch-e15c7fd2.js} +1 -1
  572. package/dist/esm/v3/{OrSearch-c4caf04e.js → OrSearch-f4ad73db.js} +7 -6
  573. package/dist/esm/v3/{OrSegmentedControl-4587c7a9.js → OrSegmentedControl-359fbf3a.js} +3 -1
  574. package/dist/esm/v3/{OrSelect-d8a78242.js → OrSelect-6ff34196.js} +10 -6
  575. package/dist/esm/v3/{OrSelect-2d486470.js → OrSelect-b1d7651a.js} +13 -9
  576. package/dist/esm/v3/{OrSidebar-b9747293.js → OrSidebar-bfd19c4c.js} +5 -4
  577. package/dist/esm/v3/{OrSidebarCollapseButton-3d9c827c.js → OrSidebarCollapseButton-63914891.js} +1 -1
  578. package/dist/esm/v3/{OrSlider-80e0f2e6.js → OrSlider-c3778aa7.js} +16 -4
  579. package/dist/esm/v3/{OrStepper-3a586401.js → OrStepper-fedc1cca.js} +2 -2
  580. package/dist/esm/v3/{OrSwitch-c333ee32.js → OrSwitch-3fca7e24.js} +7 -4
  581. package/dist/esm/v3/{OrTabHeaderItem-d668cc59.js → OrTabHeaderItem-3bb0b711.js} +7 -4
  582. package/dist/esm/v3/{OrTabs-d3812c11.js → OrTabs-35a376a3.js} +6 -5
  583. package/dist/esm/v3/{OrTabs-f61d6f85.js → OrTabs-3d9c1a8b.js} +10 -6
  584. package/dist/esm/v3/{OrTag-e7adb078.js → OrTag-2d9eacf8.js} +5 -3
  585. package/dist/esm/v3/{OrTag-da570522.js → OrTag-6116c6e3.js} +1 -1
  586. package/dist/esm/v3/{OrTextarea-de1ecb0f.js → OrTextarea-f6722edc.js} +10 -4
  587. package/dist/esm/v3/{OrTextbox-f7388a30.js → OrTextbox-6e585202.js} +27 -14
  588. package/dist/esm/v3/{OrTimePicker-6a280973.js → OrTimePicker-ed83bc3f.js} +2 -2
  589. package/dist/esm/v3/{OrToastContainer-94ba2803.js → OrToastContainer-24839efd.js} +6 -4
  590. package/dist/esm/v3/{OrTooltip-a38adced.js → OrTooltip-4bb0054a.js} +1 -1
  591. package/dist/esm/v3/{OrTooltip-618ce7c9.js → OrTooltip-89ce98e8.js} +6 -2
  592. package/dist/esm/{v2/color-1f348774.js → v3/color-40b7fe6b.js} +2 -1
  593. package/dist/esm/v3/components/index.js +71 -71
  594. package/dist/esm/v3/components/or-avatar/OrAvatar.vue.d.ts +11 -26
  595. package/dist/esm/v3/components/or-avatar/index.js +3 -3
  596. package/dist/esm/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +8 -24
  597. package/dist/esm/v3/components/or-avatar-v3/index.js +2 -2
  598. package/dist/esm/v3/components/or-bottom-sheet-v3/OrBottomSheet.vue.d.ts +20 -33
  599. package/dist/esm/v3/components/or-bottom-sheet-v3/index.js +3 -3
  600. package/dist/esm/v3/components/or-button/OrButton.vue.d.ts +16 -51
  601. package/dist/esm/v3/components/or-button/index.js +1 -1
  602. package/dist/esm/v3/components/or-button-v2/OrButton.vue.d.ts +20 -57
  603. package/dist/esm/v3/components/or-button-v2/index.js +4 -4
  604. package/dist/esm/v3/components/or-button-v3/OrButton.vue.d.ts +15 -35
  605. package/dist/esm/v3/components/or-card/OrCard.vue.d.ts +7 -15
  606. package/dist/esm/v3/components/or-card-collection/OrCardCollection.vue.d.ts +21 -47
  607. package/dist/esm/v3/components/or-card-collection/index.js +8 -8
  608. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +22 -70
  609. package/dist/esm/v3/components/or-card-collection-v3/index.js +10 -10
  610. package/dist/esm/v3/components/or-card-collection-v3/partials/OrCardCollectionView.vue3.vue.d.ts +6 -14
  611. package/dist/esm/v3/components/or-card-v3/OrCard.vue.d.ts +4 -7
  612. package/dist/esm/v3/components/or-carousel/OrCarousel.vue.d.ts +126 -676
  613. package/dist/esm/v3/components/or-carousel/index.js +3 -3
  614. package/dist/esm/v3/components/or-carousel/or-carousel-item/OrCarouselItem.vue.d.ts +1 -1
  615. package/dist/esm/v3/components/or-checkbox/OrCheckbox.vue.d.ts +15 -35
  616. package/dist/esm/v3/components/or-checkbox/index.js +3 -3
  617. package/dist/esm/v3/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +6 -24
  618. package/dist/esm/v3/components/or-checkbox-group-v3/index.js +7 -6
  619. package/dist/esm/v3/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +17 -43
  620. package/dist/esm/v3/components/or-checkbox-tree-v3/index.js +3 -3
  621. package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +23 -53
  622. package/dist/esm/v3/components/or-checkbox-v3/index.js +1 -1
  623. package/dist/esm/v3/components/or-chips/OrChips.vue.d.ts +24 -51
  624. package/dist/esm/v3/components/or-chips/index.js +4 -4
  625. package/dist/esm/v3/components/or-chips/or-chip/OrChip.vue.d.ts +9 -25
  626. package/dist/esm/v3/components/or-chips/or-chip/index.js +3 -3
  627. package/dist/esm/v3/components/or-chips/partials/OrChipsInput.vue.d.ts +17 -37
  628. package/dist/esm/v3/components/or-code/OrCode.vue.d.ts +24 -69
  629. package/dist/esm/v3/components/or-code/index.js +6 -6
  630. package/dist/esm/v3/components/or-collapse/OrCollapse.vue.d.ts +17 -39
  631. package/dist/esm/v3/components/or-collapse/index.js +1 -1
  632. package/dist/esm/v3/components/or-color-picker/OrColorPicker.vue.d.ts +13 -31
  633. package/dist/esm/v3/components/or-color-picker/index.js +1 -1
  634. package/dist/esm/v3/components/or-combined-input-v3/OrCombinedInput.vue.d.ts +8 -30
  635. package/dist/esm/v3/components/or-confirm/OrConfirm.vue.d.ts +23 -84
  636. package/dist/esm/v3/components/or-confirm/index.js +8 -8
  637. package/dist/esm/v3/components/or-confirm-v3/OrConfirm.vue.d.ts +29 -91
  638. package/dist/esm/v3/components/or-confirm-v3/index.js +8 -8
  639. package/dist/esm/v3/components/or-date-picker-v3/OrDatePicker.vue.d.ts +25 -81
  640. package/dist/esm/v3/components/or-date-picker-v3/index.js +9 -9
  641. package/dist/esm/v3/components/or-date-time-picker/OrDateTimePicker.vue.d.ts +68 -177
  642. package/dist/esm/v3/components/or-date-time-picker/index.js +6 -6
  643. package/dist/esm/v3/components/or-date-time-picker/partials/OrDateTimePickerCalendarItem.vue.d.ts +12 -33
  644. package/dist/esm/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +31 -105
  645. package/dist/esm/v3/components/or-date-time-picker-v3/index.js +9 -9
  646. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-control/OrDateTimePickerDateControl.vue.d.ts +11 -28
  647. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts +17 -39
  648. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/OrDateTimePickerMobileControl.vue.d.ts +7 -15
  649. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +23 -85
  650. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/OrDateTimePickerPopoverFooter.vue.d.ts +7 -11
  651. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/OrDateTimePickerPopoverHeader.vue.d.ts +4 -7
  652. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-control/OrDateTimePickerTimeControl.vue.d.ts +11 -28
  653. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +15 -37
  654. package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +11 -28
  655. package/dist/esm/v3/components/or-error/OrError.vue.d.ts +4 -8
  656. package/dist/esm/v3/components/or-error-tag-v3/OrErrorTag.vue.d.ts +4 -7
  657. package/dist/esm/v3/components/or-error-v3/OrError.vue.d.ts +9 -18
  658. package/dist/esm/v3/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +14 -35
  659. package/dist/esm/v3/components/or-fab-v3/OrFab.vue.d.ts +8 -20
  660. package/dist/esm/v3/components/or-floating/OrFloating.vue.d.ts +15 -46
  661. package/dist/esm/v3/components/or-form-group-v3/OrFormGroup.vue.d.ts +10 -30
  662. package/dist/esm/v3/components/or-hint/OrHint.vue.d.ts +4 -8
  663. package/dist/esm/v3/components/or-hint-v3/OrHint.vue.d.ts +9 -18
  664. package/dist/esm/v3/components/or-icon/OrIcon.vue.d.ts +16 -44
  665. package/dist/esm/v3/components/or-icon/index.js +2 -2
  666. package/dist/esm/v3/components/or-icon-button-v2/OrIconButton.vue.d.ts +13 -43
  667. package/dist/esm/v3/components/or-icon-button-v2/index.js +3 -3
  668. package/dist/esm/v3/components/or-icon-button-v2/partials/OrTooltipWrapper.vue.d.ts +8 -10
  669. package/dist/esm/v3/components/or-icon-button-v3/OrIconButton.vue.d.ts +16 -52
  670. package/dist/esm/v3/components/or-icon-button-v3/index.js +6 -6
  671. package/dist/esm/v3/components/or-icon-v3/OrIcon.vue.d.ts +7 -18
  672. package/dist/esm/v3/components/or-inline-input-box-v3/OrInlineInputBox.vue.d.ts +7 -16
  673. package/dist/esm/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +39 -83
  674. package/dist/esm/v3/components/or-inline-input-v3/index.js +7 -7
  675. package/dist/esm/v3/components/or-inline-text-edit/OrInlineTextEdit.vue.d.ts +43 -95
  676. package/dist/esm/v3/components/or-inline-text-edit/index.js +6 -6
  677. package/dist/esm/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +39 -79
  678. package/dist/esm/v3/components/or-inline-textarea-v3/index.js +7 -7
  679. package/dist/esm/v3/components/or-input/OrInput.vue.d.ts +36 -87
  680. package/dist/esm/v3/components/or-input/index.js +2 -2
  681. package/dist/esm/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +7 -22
  682. package/dist/esm/v3/components/or-input-v3/OrInput.vue.d.ts +34 -85
  683. package/dist/esm/v3/components/or-input-v3/index.js +7 -7
  684. package/dist/esm/v3/components/or-label/OrLabel.vue.d.ts +9 -20
  685. package/dist/esm/v3/components/or-label-v3/OrLabel.vue.d.ts +9 -24
  686. package/dist/esm/v3/components/or-link-v3/OrLink.vue.d.ts +7 -24
  687. package/dist/esm/v3/components/or-list/OrList.vue.d.ts +21 -47
  688. package/dist/esm/v3/components/or-list/index.js +5 -5
  689. package/dist/esm/v3/components/or-list-of-inputs/OrListOfInputs.vue.d.ts +11 -27
  690. package/dist/esm/v3/components/or-list-of-inputs/index.js +8 -8
  691. package/dist/esm/v3/components/or-loader/OrLoader.vue.d.ts +10 -26
  692. package/dist/esm/v3/components/or-loader-v3/OrLoader.vue.d.ts +13 -34
  693. package/dist/esm/v3/components/or-menu-item-v3/OrMenuItem.vue.d.ts +13 -34
  694. package/dist/esm/v3/components/or-menu-v3/OrMenu.vue.d.ts +16 -43
  695. package/dist/esm/v3/components/or-menu-v3/index.js +5 -5
  696. package/dist/esm/v3/components/or-modal/OrModal.vue.d.ts +14 -38
  697. package/dist/esm/v3/components/or-modal/index.js +5 -5
  698. package/dist/esm/v3/components/or-modal-v3/OrModal.vue.d.ts +13 -27
  699. package/dist/esm/v3/components/or-modal-v3/index.js +7 -7
  700. package/dist/esm/v3/components/or-notification/OrNotification.vue.d.ts +9 -27
  701. package/dist/esm/v3/components/or-notification/index.js +5 -5
  702. package/dist/esm/v3/components/or-notification-v3/OrNotification.vue.d.ts +9 -20
  703. package/dist/esm/v3/components/or-notification-v3/index.js +7 -7
  704. package/dist/esm/v3/components/or-number-input/OrNumberInput.vue.d.ts +24 -70
  705. package/dist/esm/v3/components/or-number-input/index.js +3 -3
  706. package/dist/esm/v3/components/or-overflow-menu/OrOverflowMenu.vue.d.ts +13 -31
  707. package/dist/esm/v3/components/or-overflow-menu/index.js +5 -5
  708. package/dist/esm/v3/components/or-overflow-menu/partials/OrOverflowMenuItem.vue.d.ts +7 -23
  709. package/dist/esm/v3/components/or-overlay/OrOverlay.vue.d.ts +6 -16
  710. package/dist/esm/v3/components/or-overlay-v3/OrOverlay.vue.d.ts +7 -14
  711. package/dist/esm/v3/components/or-overlay-v3/index.js +2 -2
  712. package/dist/esm/v3/components/or-pagination-v3/OrPagination.vue.d.ts +27 -75
  713. package/dist/esm/v3/components/or-pagination-v3/index.js +6 -6
  714. package/dist/esm/v3/components/or-password/OrPassword.vue.d.ts +22 -63
  715. package/dist/esm/v3/components/or-password/index.js +8 -8
  716. package/dist/esm/v3/components/or-popover-v3/OrPopover.vue.d.ts +27 -74
  717. package/dist/esm/v3/components/or-popover-v3/index.js +4 -4
  718. package/dist/esm/v3/components/or-progress/OrProgress.vue.d.ts +20 -56
  719. package/dist/esm/v3/components/or-progress-v3/OrProgress.vue.d.ts +25 -62
  720. package/dist/esm/v3/components/or-radio/OrRadio.vue.d.ts +13 -35
  721. package/dist/esm/v3/components/or-radio/index.js +1 -1
  722. package/dist/esm/v3/components/or-radio-group/OrRadioGroup.vue.d.ts +9 -26
  723. package/dist/esm/v3/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +6 -32
  724. package/dist/esm/v3/components/or-radio-group-v3/index.js +4 -3
  725. package/dist/esm/v3/components/or-radio-v3/OrRadio.vue.d.ts +21 -49
  726. package/dist/esm/v3/components/or-search/OrSearch.vue.d.ts +23 -65
  727. package/dist/esm/v3/components/or-search/index.js +7 -7
  728. package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +17 -41
  729. package/dist/esm/v3/components/or-search-v3/index.js +8 -8
  730. package/dist/esm/v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +9 -25
  731. package/dist/esm/v3/components/or-segmented-control-v3/index.js +1 -1
  732. package/dist/esm/v3/components/or-segmented-control-v3/partials/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +8 -20
  733. package/dist/esm/v3/components/or-select/OrSelect.vue.d.ts +28 -77
  734. package/dist/esm/v3/components/or-select/index.js +6 -6
  735. package/dist/esm/v3/components/or-select/partials/OrSelectContent.vue.d.ts +18 -49
  736. package/dist/esm/v3/components/or-select/partials/OrSelectContentEmpty.vue.d.ts +4 -16
  737. package/dist/esm/v3/components/or-select/partials/OrSelectContentOptions.vue.d.ts +13 -67
  738. package/dist/esm/v3/components/or-select/partials/OrSelectInput.vue.d.ts +16 -41
  739. package/dist/esm/v3/components/or-select/partials/OrSelectInputValue.vue.d.ts +16 -35
  740. package/dist/esm/v3/components/or-select/partials/OrSelectMain.vue.d.ts +24 -71
  741. package/dist/esm/v3/components/or-select/partials/OrSelectOption.vue.d.ts +7 -19
  742. package/dist/esm/v3/components/or-select/partials/OrSelectSearchOptions.vue.d.ts +11 -24
  743. package/dist/esm/v3/components/or-select-v3/OrSelect.vue.d.ts +37 -115
  744. package/dist/esm/v3/components/or-select-v3/index.js +11 -11
  745. package/dist/esm/v3/components/or-sidebar/OrSidebar.vue.d.ts +14 -33
  746. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +28 -63
  747. package/dist/esm/v3/components/or-sidebar-v3/index.js +8 -8
  748. package/dist/esm/v3/components/or-sidebar-v3/partials/index.js +7 -7
  749. package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue.d.ts +10 -23
  750. package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +7 -7
  751. package/dist/esm/v3/components/or-skeleton/or-skeleton-circle/OrSkeletonCircle.vue.d.ts +9 -20
  752. package/dist/esm/v3/components/or-skeleton/or-skeleton-rect/OrSkeletonRect.vue.d.ts +9 -22
  753. package/dist/esm/v3/components/or-skeleton/or-skeleton-text/OrSkeletonText.vue.d.ts +10 -26
  754. package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-circle-v3/OrSkeletonCircle.vue.d.ts +13 -28
  755. package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-rect-v3/OrSkeletonRect.vue.d.ts +11 -26
  756. package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-text-v3/OrSkeletonText.vue.d.ts +16 -40
  757. package/dist/esm/v3/components/or-slider/OrSlider.vue.d.ts +35 -91
  758. package/dist/esm/v3/components/or-slider/index.js +3 -3
  759. package/dist/esm/v3/components/or-sort-header-v3/OrSortHeader.vue.d.ts +13 -25
  760. package/dist/esm/v3/components/or-stepper/OrStepper.vue.d.ts +16 -43
  761. package/dist/esm/v3/components/or-stepper/index.js +5 -5
  762. package/dist/esm/v3/components/or-stepper/partials/OrStepperButtonOptions.vue.d.ts +4 -20
  763. package/dist/esm/v3/components/or-stepper/partials/OrStepperOptionHorizontal.vue.d.ts +4 -26
  764. package/dist/esm/v3/components/or-stepper/partials/OrStepperOptionVertical.vue.d.ts +4 -26
  765. package/dist/esm/v3/components/or-stepper/partials/OrStepperTitle.vue.d.ts +6 -22
  766. package/dist/esm/v3/components/or-stepper/partials/StatusIcon.vue.d.ts +6 -12
  767. package/dist/esm/v3/components/or-switch/OrSwitch.vue.d.ts +12 -33
  768. package/dist/esm/v3/components/or-switch/index.js +1 -1
  769. package/dist/esm/v3/components/or-switch-v3/OrSwitch.vue.d.ts +22 -53
  770. package/dist/esm/v3/components/or-tab/OrTab.vue.d.ts +9 -22
  771. package/dist/esm/v3/components/or-tab-header-item/OrTabHeaderItem.vue.d.ts +13 -29
  772. package/dist/esm/v3/components/or-tab-header-item/index.js +1 -1
  773. package/dist/esm/v3/components/or-tab-v3/OrTab.vue.d.ts +10 -17
  774. package/dist/esm/v3/components/or-tabs/OrTabs.vue.d.ts +4 -17
  775. package/dist/esm/v3/components/or-tabs/index.js +2 -2
  776. package/dist/esm/v3/components/or-tabs-v3/OrTabs.vue.d.ts +24 -69
  777. package/dist/esm/v3/components/or-tabs-v3/index.js +6 -6
  778. package/dist/esm/v3/components/or-tag/OrTag.vue.d.ts +10 -27
  779. package/dist/esm/v3/components/or-tag/index.js +4 -4
  780. package/dist/esm/v3/components/or-tag-v3/OrTag.vue.d.ts +12 -23
  781. package/dist/esm/v3/components/or-tag-v3/index.js +7 -7
  782. package/dist/esm/v3/components/or-teleport/OrTeleport.vue3.vue.d.ts +4 -10
  783. package/dist/esm/v3/components/or-teleport-v3/OrTeleport.vue3.vue.d.ts +4 -10
  784. package/dist/esm/v3/components/or-text-v3/OrText.vue.d.ts +11 -24
  785. package/dist/esm/v3/components/or-textarea/OrTextarea.vue.d.ts +37 -85
  786. package/dist/esm/v3/components/or-textarea/index.js +2 -2
  787. package/dist/esm/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +32 -73
  788. package/dist/esm/v3/components/or-textbox/OrTextbox.vue.d.ts +55 -137
  789. package/dist/esm/v3/components/or-textbox/index.js +7 -7
  790. package/dist/esm/v3/components/or-time-picker-v3/OrTimePicker.vue.d.ts +25 -79
  791. package/dist/esm/v3/components/or-time-picker-v3/index.js +7 -7
  792. package/dist/esm/v3/components/or-toast/OrToast.vue.d.ts +11 -31
  793. package/dist/esm/v3/components/or-toast/composable/index.js +1 -1
  794. package/dist/esm/v3/components/or-toast/index.js +6 -6
  795. package/dist/esm/v3/components/or-toast/or-toast-container/OrToastContainer.vue.d.ts +25 -55
  796. package/dist/esm/v3/components/or-toast/or-toast-container/index.js +6 -6
  797. package/dist/esm/v3/components/or-toast-v3/OrToast.vue.d.ts +16 -38
  798. package/dist/esm/v3/components/or-toast-v3/composable/index.js +1 -1
  799. package/dist/esm/v3/components/or-toast-v3/index.js +8 -8
  800. package/dist/esm/v3/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue.d.ts +24 -54
  801. package/dist/esm/v3/components/or-toast-v3/or-toast-container-v3/index.js +8 -8
  802. package/dist/esm/v3/components/or-tooltip/OrTooltip.vue.d.ts +14 -33
  803. package/dist/esm/v3/components/or-tooltip/index.js +1 -1
  804. package/dist/esm/v3/components/or-tooltip/or-tooltip-content/OrTooltipContent.vue.d.ts +4 -10
  805. package/dist/esm/v3/components/or-tooltip-v3/OrTooltip.vue.d.ts +13 -37
  806. package/dist/esm/v3/components/or-tooltip-v3/index.js +5 -5
  807. package/dist/esm/v3/directives/dropdown-close.d.ts +3 -1
  808. package/dist/esm/v3/directives/dropdown-open.d.ts +3 -1
  809. package/dist/esm/v3/{flattenDeep-e7a8b995.js → flattenDeep-fe0af413.js} +2 -1
  810. package/dist/esm/v3/hooks/index.js +3 -3
  811. package/dist/esm/v3/hooks/useResponsive/useResponsive.d.ts +2 -2
  812. package/dist/esm/v3/index.js +72 -72
  813. package/dist/esm/v3/{types-af3e3f9c.js → types-3a885bea.js} +12 -7
  814. package/dist/esm/{v2/useElevation-df91fa50.js → v3/useElevation-b5a49746.js} +2 -1
  815. package/dist/esm/v3/{useOverflow-af6161c8.js → useOverflow-c856b7b7.js} +5 -4
  816. package/dist/esm/{v2/useToast-0665462d.js → v3/useToast-a1332cc2.js} +10 -5
  817. package/dist/esm/v3/{useToast-4fbe0e5a.js → useToast-b5ea5cb2.js} +10 -5
  818. package/dist/esm/{v2/useToggle-29e4d7c7.js → v3/useToggle-c04fc920.js} +2 -1
  819. package/package.json +8 -8
  820. package/dist/esm/v2/OrButton-549e8852.js +0 -195
  821. package/dist/esm/v2/OrButton.vue_rollup-plugin-vue_styles.0-48c5883e.js +0 -106
  822. package/dist/esm/v2/OrIconButton.vue_rollup-plugin-vue_styles.0-277ce06c.js +0 -205
  823. package/dist/esm/v3/OrButton-f8b10d79.js +0 -142
  824. package/dist/esm/v3/OrButton-fca9019a.js +0 -162
  825. package/dist/esm/v3/OrIconButton-5387fd59.js +0 -222
  826. /package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-6511e348.js → OrAvatar.vue_vue_type_script_lang-2d5de9d4.js} +0 -0
  827. /package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-623c32a1.js → OrAvatar.vue_vue_type_script_lang-8d7ce473.js} +0 -0
  828. /package/dist/bundled/v3/{OrButton.vue_vue_type_script_lang-da7f7ed0.js → OrButton.vue_vue_type_script_lang-4f44f547.js} +0 -0
  829. /package/dist/bundled/v3/{OrChip.vue_vue_type_script_lang-5a390853.js → OrChip.vue_vue_type_script_lang-185d8d45.js} +0 -0
  830. /package/dist/bundled/v3/{OrColorPicker.vue_vue_type_script_lang-3a799e23.js → OrColorPicker.vue_vue_type_script_lang-d8588b52.js} +0 -0
  831. /package/dist/bundled/v3/{OrOverlay.vue_vue_type_script_lang-47004a50.js → OrOverlay.vue_vue_type_script_lang-86c7b93a.js} +0 -0
  832. /package/dist/bundled/v3/{OrSlider.vue_vue_type_script_lang-45ecddbe.js → OrSlider.vue_vue_type_script_lang-7234ab75.js} +0 -0
  833. /package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-621e9307.js → OrTag.vue_vue_type_script_lang-4e98d8a0.js} +0 -0
  834. /package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-70cc38be.js → OrToastContainer.vue_vue_type_script_lang-b8184db5.js} +0 -0
@@ -39,7 +39,8 @@ class Text {
39
39
  /**
40
40
  Retrieve the text between the given points.
41
41
  */
42
- slice(from, to = this.length) {
42
+ slice(from) {
43
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.length;
43
44
  let parts = [];
44
45
  this.decompose(from, to, parts, 0);
45
46
  return TextNode.from(parts, to - from);
@@ -68,14 +69,16 @@ class Text {
68
69
  from end to start. This will return lines and the breaks between
69
70
  them as separate strings.
70
71
  */
71
- iter(dir = 1) {
72
+ iter() {
73
+ let dir = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
72
74
  return new RawTextCursor(this, dir);
73
75
  }
74
76
  /**
75
77
  Iterate over a range of the text. When `from` > `to`, the
76
78
  iterator will run in reverse.
77
79
  */
78
- iterRange(from, to = this.length) {
80
+ iterRange(from) {
81
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.length;
79
82
  return new PartialTextCursor(this, from, to);
80
83
  }
81
84
  /**
@@ -124,7 +127,8 @@ class Text {
124
127
  // between these strings. Leaves are limited in size and have to be
125
128
  // contained in TextNode instances for bigger documents.
126
129
  class TextLeaf extends Text {
127
- constructor(text, length = textLength(text)) {
130
+ constructor(text) {
131
+ let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : textLength(text);
128
132
  super();
129
133
  this.text = text;
130
134
  this.length = length;
@@ -166,7 +170,9 @@ class TextLeaf extends Text {
166
170
  if (lines.length <= 32 /* Tree.Branch */) return new TextLeaf(lines, newLen);
167
171
  return TextNode.from(TextLeaf.split(lines, []), newLen);
168
172
  }
169
- sliceString(from, to = this.length, lineSep = "\n") {
173
+ sliceString(from) {
174
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.length;
175
+ let lineSep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "\n";
170
176
  let result = "";
171
177
  for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) {
172
178
  let line = this.text[i],
@@ -253,7 +259,9 @@ class TextNode extends Text {
253
259
  }
254
260
  return super.replace(from, to, text);
255
261
  }
256
- sliceString(from, to = this.length, lineSep = "\n") {
262
+ sliceString(from) {
263
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.length;
264
+ let lineSep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "\n";
257
265
  let result = "";
258
266
  for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) {
259
267
  let child = this.children[i],
@@ -279,7 +287,8 @@ class TextNode extends Text {
279
287
  length += chA.length + 1;
280
288
  }
281
289
  }
282
- static from(children, length = children.reduce((l, ch) => l + ch.length + 1, -1)) {
290
+ static from(children) {
291
+ let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : children.reduce((l, ch) => l + ch.length + 1, -1);
283
292
  let lines = 0;
284
293
  for (let ch of children) lines += ch.lines;
285
294
  if (lines < 32 /* Tree.Branch */) {
@@ -329,7 +338,9 @@ function textLength(text) {
329
338
  for (let line of text) length += line.length + 1;
330
339
  return length;
331
340
  }
332
- function appendText(text, target, from = 0, to = 1e9) {
341
+ function appendText(text, target) {
342
+ let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
343
+ let to = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1e9;
333
344
  for (let pos = 0, i = 0, first = true; i < text.length && pos <= to; i++) {
334
345
  let line = text[i],
335
346
  end = pos + line.length;
@@ -349,7 +360,8 @@ function sliceText(text, from, to) {
349
360
  return appendText(text, [""], from, to);
350
361
  }
351
362
  class RawTextCursor {
352
- constructor(text, dir = 1) {
363
+ constructor(text) {
364
+ let dir = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
353
365
  this.dir = dir;
354
366
  this.done = false;
355
367
  this.lineBreak = false;
@@ -404,7 +416,8 @@ class RawTextCursor {
404
416
  }
405
417
  }
406
418
  }
407
- next(skip = 0) {
419
+ next() {
420
+ let skip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
408
421
  if (skip < 0) {
409
422
  this.nextInner(-skip, -this.dir);
410
423
  skip = this.value.length;
@@ -439,7 +452,8 @@ class PartialTextCursor {
439
452
  this.done = !this.value;
440
453
  return this;
441
454
  }
442
- next(skip = 0) {
455
+ next() {
456
+ let skip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
443
457
  if (skip < 0) skip = Math.max(skip, this.from - this.pos);else if (skip > 0) skip = Math.min(skip, this.to - this.pos);
444
458
  return this.nextInner(skip, this.cursor.dir);
445
459
  }
@@ -454,7 +468,8 @@ class LineCursor {
454
468
  this.value = "";
455
469
  this.done = false;
456
470
  }
457
- next(skip = 0) {
471
+ next() {
472
+ let skip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
458
473
  let {
459
474
  done,
460
475
  lineBreak,
@@ -552,7 +567,9 @@ Moves across surrogate pairs, extending characters (when
552
567
  `includeExtending` is true), characters joined with zero-width
553
568
  joiners, and flag emoji.
554
569
  */
555
- function findClusterBreak(str, pos, forward = true, includeExtending = true) {
570
+ function findClusterBreak(str, pos) {
571
+ let forward = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
572
+ let includeExtending = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
556
573
  return (forward ? nextClusterBreak : prevClusterBreak)(str, pos, includeExtending);
557
574
  }
558
575
  function nextClusterBreak(str, pos, includeExtending) {
@@ -722,7 +739,8 @@ class ChangeDesc {
722
739
  separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are
723
740
  reported separately.
724
741
  */
725
- iterChangedRanges(f, individual = false) {
742
+ iterChangedRanges(f) {
743
+ let individual = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
726
744
  iterChanges(this, f, individual);
727
745
  }
728
746
  /**
@@ -751,10 +769,13 @@ class ChangeDesc {
751
769
  applied after it. When `before` is true, map as if the changes
752
770
  in `other` happened before the ones in `this`.
753
771
  */
754
- mapDesc(other, before = false) {
772
+ mapDesc(other) {
773
+ let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
755
774
  return other.empty ? this : mapSet(this, other, before);
756
775
  }
757
- mapPos(pos, assoc = -1, mode = MapMode.Simple) {
776
+ mapPos(pos) {
777
+ let assoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
778
+ let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : MapMode.Simple;
758
779
  let posA = 0,
759
780
  posB = 0;
760
781
  for (let i = 0; i < this.sections.length;) {
@@ -779,7 +800,8 @@ class ChangeDesc {
779
800
  changes entirely covers the range, the string `"cover"` is
780
801
  returned.
781
802
  */
782
- touchesRange(from, to = from) {
803
+ touchesRange(from) {
804
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
783
805
  for (let i = 0, pos = 0; i < this.sections.length && pos <= to;) {
784
806
  let len = this.sections[i++],
785
807
  ins = this.sections[i++],
@@ -845,7 +867,8 @@ class ChangeSet extends ChangeDesc {
845
867
  iterChanges(this, (fromA, toA, fromB, _toB, text) => doc = doc.replace(fromB, fromB + (toA - fromA), text), false);
846
868
  return doc;
847
869
  }
848
- mapDesc(other, before = false) {
870
+ mapDesc(other) {
871
+ let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
849
872
  return mapSet(this, other, before, true);
850
873
  }
851
874
  /**
@@ -893,7 +916,8 @@ class ChangeSet extends ChangeDesc {
893
916
  transformation](https://en.wikipedia.org/wiki/Operational_transformation),
894
917
  and can be used for collaborative editing.
895
918
  */
896
- map(other, before = false) {
919
+ map(other) {
920
+ let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
897
921
  return other.empty ? this : mapSet(this, other, before, true);
898
922
  }
899
923
  /**
@@ -905,7 +929,8 @@ class ChangeSet extends ChangeDesc {
905
929
  When `individual` is true, adjacent changes are reported
906
930
  separately.
907
931
  */
908
- iterChanges(f, individual = false) {
932
+ iterChanges(f) {
933
+ let individual = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
909
934
  iterChanges(this, f, individual);
910
935
  }
911
936
  /**
@@ -971,7 +996,8 @@ class ChangeSet extends ChangeDesc {
971
996
  inserted = [],
972
997
  pos = 0;
973
998
  let total = null;
974
- function flush(force = false) {
999
+ function flush() {
1000
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
975
1001
  if (!force && !sections.length) return;
976
1002
  if (pos < length) addSection(sections, length - pos, -1);
977
1003
  let set = new ChangeSet(sections, inserted);
@@ -1045,7 +1071,8 @@ class ChangeSet extends ChangeDesc {
1045
1071
  return new ChangeSet(sections, inserted);
1046
1072
  }
1047
1073
  }
1048
- function addSection(sections, len, ins, forceJoin = false) {
1074
+ function addSection(sections, len, ins) {
1075
+ let forceJoin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1049
1076
  if (len == 0 && ins <= 0) return;
1050
1077
  let last = sections.length - 2;
1051
1078
  if (last >= 0 && ins <= 0 && ins == sections[last + 1]) sections[last] += len;else if (len == 0 && sections[last] == 0) sections[last + 1] += ins;else if (forceJoin) {
@@ -1089,7 +1116,8 @@ function iterChanges(desc, f, individual) {
1089
1116
  }
1090
1117
  }
1091
1118
  }
1092
- function mapSet(setA, setB, before, mkSet = false) {
1119
+ function mapSet(setA, setB, before) {
1120
+ let mkSet = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1093
1121
  // Produce a copy of setA that applies to the document after setB
1094
1122
  // has been applied (assuming both start at the same document).
1095
1123
  let sections = [],
@@ -1153,7 +1181,8 @@ function mapSet(setA, setB, before, mkSet = false) {
1153
1181
  }
1154
1182
  }
1155
1183
  }
1156
- function composeSets(setA, setB, mkSet = false) {
1184
+ function composeSets(setA, setB) {
1185
+ let mkSet = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1157
1186
  let sections = [];
1158
1187
  let insert = mkSet ? [] : null;
1159
1188
  let a = new SectionIter(setA),
@@ -1316,7 +1345,8 @@ class SelectionRange {
1316
1345
  Map this range through a change, producing a valid range in the
1317
1346
  updated document.
1318
1347
  */
1319
- map(change, assoc = -1) {
1348
+ map(change) {
1349
+ let assoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
1320
1350
  let from, to;
1321
1351
  if (this.empty) {
1322
1352
  from = to = change.mapPos(this.from, assoc);
@@ -1329,7 +1359,8 @@ class SelectionRange {
1329
1359
  /**
1330
1360
  Extend this range to cover at least `from` to `to`.
1331
1361
  */
1332
- extend(from, to = from) {
1362
+ extend(from) {
1363
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
1333
1364
  if (from <= this.anchor && to >= this.anchor) return EditorSelection.range(from, to);
1334
1365
  let head = Math.abs(from - this.anchor) > Math.abs(to - this.anchor) ? from : to;
1335
1366
  return EditorSelection.range(this.anchor, head);
@@ -1386,7 +1417,8 @@ class EditorSelection {
1386
1417
  Map a selection through a change. Used to adjust the selection
1387
1418
  position for changes.
1388
1419
  */
1389
- map(change, assoc = -1) {
1420
+ map(change) {
1421
+ let assoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
1390
1422
  if (change.empty) return this;
1391
1423
  return EditorSelection.create(this.ranges.map(r => r.map(change, assoc)), this.mainIndex);
1392
1424
  }
@@ -1416,14 +1448,16 @@ class EditorSelection {
1416
1448
  /**
1417
1449
  Extend this selection with an extra range.
1418
1450
  */
1419
- addRange(range, main = true) {
1451
+ addRange(range) {
1452
+ let main = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1420
1453
  return EditorSelection.create([range].concat(this.ranges), main ? 0 : this.mainIndex + 1);
1421
1454
  }
1422
1455
  /**
1423
1456
  Replace a given range with another range, and then normalize the
1424
1457
  selection to merge and sort ranges if necessary.
1425
1458
  */
1426
- replaceRange(range, which = this.mainIndex) {
1459
+ replaceRange(range) {
1460
+ let which = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.mainIndex;
1427
1461
  let ranges = this.ranges.slice();
1428
1462
  ranges[which] = range;
1429
1463
  return EditorSelection.create(ranges, this.mainIndex);
@@ -1448,14 +1482,16 @@ class EditorSelection {
1448
1482
  /**
1449
1483
  Create a selection holding a single range.
1450
1484
  */
1451
- static single(anchor, head = anchor) {
1485
+ static single(anchor) {
1486
+ let head = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : anchor;
1452
1487
  return new EditorSelection([EditorSelection.range(anchor, head)], 0);
1453
1488
  }
1454
1489
  /**
1455
1490
  Sort and merge the given set of ranges, creating a valid
1456
1491
  selection.
1457
1492
  */
1458
- static create(ranges, mainIndex = 0) {
1493
+ static create(ranges) {
1494
+ let mainIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1459
1495
  if (ranges.length == 0) throw new RangeError("A selection needs at least one range");
1460
1496
  for (let pos = 0, i = 0; i < ranges.length; i++) {
1461
1497
  let range = ranges[i];
@@ -1468,7 +1504,10 @@ class EditorSelection {
1468
1504
  Create a cursor selection range at the given position. You can
1469
1505
  safely ignore the optional arguments in most situations.
1470
1506
  */
1471
- static cursor(pos, assoc = 0, bidiLevel, goalColumn) {
1507
+ static cursor(pos) {
1508
+ let assoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1509
+ let bidiLevel = arguments.length > 2 ? arguments[2] : undefined;
1510
+ let goalColumn = arguments.length > 3 ? arguments[3] : undefined;
1472
1511
  return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 4 /* RangeFlag.AssocBefore */ : 8 /* RangeFlag.AssocAfter */) | (bidiLevel == null ? 3 : Math.min(2, bidiLevel)) | (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 33554431 /* RangeFlag.NoGoalColumn */) << 5 /* RangeFlag.GoalColumnOffset */);
1473
1512
  }
1474
1513
  /**
@@ -1481,7 +1520,8 @@ class EditorSelection {
1481
1520
  /**
1482
1521
  @internal
1483
1522
  */
1484
- static normalized(ranges, mainIndex = 0) {
1523
+ static normalized(ranges) {
1524
+ let mainIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1485
1525
  let main = ranges[mainIndex];
1486
1526
  ranges.sort((a, b) => a.from - b.from);
1487
1527
  mainIndex = ranges.indexOf(main);
@@ -1540,7 +1580,8 @@ class Facet {
1540
1580
  /**
1541
1581
  Define a new facet.
1542
1582
  */
1543
- static define(config = {}) {
1583
+ static define() {
1584
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1544
1585
  return new Facet(config.combine || (a => a), config.compareInput || ((a, b) => a === b), config.compare || (!config.combine ? sameArray$1 : (a, b) => a === b), !!config.static, config.enables);
1545
1586
  }
1546
1587
  /**
@@ -2111,7 +2152,8 @@ class StateEffect {
2111
2152
  Define a new effect type. The type parameter indicates the type
2112
2153
  of values that his effect holds.
2113
2154
  */
2114
- static define(spec = {}) {
2155
+ static define() {
2156
+ let spec = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2115
2157
  return new StateEffectType(spec.map || (v => v));
2116
2158
  }
2117
2159
  /**
@@ -2493,7 +2535,8 @@ class EditorState {
2493
2535
  for (let i = 0; i < this.config.dynamicSlots.length; i++) ensureAddr(this, i << 1);
2494
2536
  this.computeSlot = null;
2495
2537
  }
2496
- field(field, require = true) {
2538
+ field(field) {
2539
+ let require = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2497
2540
  let addr = this.config.address[field.id];
2498
2541
  if (addr == null) {
2499
2542
  if (require) throw new RangeError("Field is not present in this state");
@@ -2517,7 +2560,10 @@ class EditorState {
2517
2560
  specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later
2518
2561
  specs take precedence over earlier ones.
2519
2562
  */
2520
- update(...specs) {
2563
+ update() {
2564
+ for (var _len = arguments.length, specs = new Array(_len), _key = 0; _key < _len; _key++) {
2565
+ specs[_key] = arguments[_key];
2566
+ }
2521
2567
  return resolveTransaction(this, specs, true);
2522
2568
  }
2523
2569
  /**
@@ -2608,7 +2654,8 @@ class EditorState {
2608
2654
  description, taking the state's document length and line
2609
2655
  separator into account.
2610
2656
  */
2611
- changes(spec = []) {
2657
+ changes() {
2658
+ let spec = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2612
2659
  if (spec instanceof ChangeSet) return spec;
2613
2660
  return ChangeSet.of(spec, this.doc.length, this.facet(EditorState.lineSeparator));
2614
2661
  }
@@ -2623,7 +2670,9 @@ class EditorState {
2623
2670
  /**
2624
2671
  Return the given range of the document as a string.
2625
2672
  */
2626
- sliceDoc(from = 0, to = this.doc.length) {
2673
+ sliceDoc() {
2674
+ let from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
2675
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.doc.length;
2627
2676
  return this.doc.sliceString(from, to, this.lineBreak);
2628
2677
  }
2629
2678
  /**
@@ -2658,7 +2707,9 @@ class EditorState {
2658
2707
  to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as
2659
2708
  third argument.
2660
2709
  */
2661
- static fromJSON(json, config = {}, fields) {
2710
+ static fromJSON(json) {
2711
+ let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2712
+ let fields = arguments.length > 2 ? arguments[2] : undefined;
2662
2713
  if (!json || typeof json.doc != "string") throw new RangeError("Invalid JSON representation for EditorState");
2663
2714
  let fieldInit = [];
2664
2715
  if (fields) for (let prop in fields) {
@@ -2679,7 +2730,8 @@ class EditorState {
2679
2730
  initializing an editor—updated states are created by applying
2680
2731
  transactions.
2681
2732
  */
2682
- static create(config = {}) {
2733
+ static create() {
2734
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2683
2735
  let configuration = Configuration.resolve(config.extensions || [], new Map());
2684
2736
  let doc = config.doc instanceof Text ? config.doc : Text.of((config.doc || "").split(configuration.staticFacet(EditorState.lineSeparator) || DefaultSplit));
2685
2737
  let selection = !config.selection ? EditorSelection.single(0) : config.selection instanceof EditorSelection ? config.selection : EditorSelection.single(config.selection.anchor, config.selection.head);
@@ -2718,7 +2770,10 @@ class EditorState {
2718
2770
  A single `$` is equivalent to `$1`, and `$$` will produce a
2719
2771
  literal dollar sign.
2720
2772
  */
2721
- phrase(phrase, ...insert) {
2773
+ phrase(phrase) {
2774
+ for (var _len2 = arguments.length, insert = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2775
+ insert[_key2 - 1] = arguments[_key2];
2776
+ }
2722
2777
  for (let map of this.facet(EditorState.phrases)) if (Object.prototype.hasOwnProperty.call(map, phrase)) {
2723
2778
  phrase = map[phrase];
2724
2779
  break;
@@ -2746,7 +2801,8 @@ class EditorState {
2746
2801
  - [`"closeBrackets"`](https://codemirror.net/6/docs/ref/#autocomplete.CloseBracketConfig) controls
2747
2802
  bracket closing behavior.
2748
2803
  */
2749
- languageDataAt(name, pos, side = -1) {
2804
+ languageDataAt(name, pos) {
2805
+ let side = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
2750
2806
  let values = [];
2751
2807
  for (let provider of this.facet(languageData)) {
2752
2808
  for (let result of provider(this, pos, side)) {
@@ -2916,9 +2972,8 @@ The function will, by default, error
2916
2972
  when a field gets two values that aren't `===`-equal, but you can
2917
2973
  provide combine functions per field to do something else.
2918
2974
  */
2919
- function combineConfig(configs, defaults,
2920
- // Should hold only the optional properties of Config, but I haven't managed to express that
2921
- combine = {}) {
2975
+ function combineConfig(configs, defaults) {
2976
+ let combine = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2922
2977
  let result = {};
2923
2978
  for (let config of configs) for (let key of Object.keys(config)) {
2924
2979
  let value = config[key],
@@ -2948,7 +3003,8 @@ class RangeValue {
2948
3003
  /**
2949
3004
  Create a [range](https://codemirror.net/6/docs/ref/#state.Range) with this value.
2950
3005
  */
2951
- range(from, to = from) {
3006
+ range(from) {
3007
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
2952
3008
  return Range$1.create(from, to, this);
2953
3009
  }
2954
3010
  }
@@ -3003,7 +3059,8 @@ class Chunk {
3003
3059
  }
3004
3060
  // Find the index of the given position and side. Use the ranges'
3005
3061
  // `from` pos when `end == false`, `to` when `end == true`.
3006
- findIndex(pos, side, end, startAt = 0) {
3062
+ findIndex(pos, side, end) {
3063
+ let startAt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
3007
3064
  let arr = end ? this.to : this.from;
3008
3065
  for (let lo = startAt, hi = arr.length;;) {
3009
3066
  if (lo == hi) return lo;
@@ -3205,7 +3262,8 @@ class RangeSet {
3205
3262
  Iterate over the ranges in this set, in order, including all
3206
3263
  ranges that end at or after `from`.
3207
3264
  */
3208
- iter(from = 0) {
3265
+ iter() {
3266
+ let from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
3209
3267
  return HeapCursor.from([this]).goto(from);
3210
3268
  }
3211
3269
  /**
@@ -3218,7 +3276,8 @@ class RangeSet {
3218
3276
  Iterate over the ranges in a collection of sets, in order,
3219
3277
  starting from `from`.
3220
3278
  */
3221
- static iter(sets, from = 0) {
3279
+ static iter(sets) {
3280
+ let from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3222
3281
  return HeapCursor.from(sets).goto(from);
3223
3282
  }
3224
3283
  /**
@@ -3231,12 +3290,8 @@ class RangeSet {
3231
3290
  ranges, and is needed to synchronize the iteration. `from` and
3232
3291
  `to` are coordinates in the _new_ space, after these changes.
3233
3292
  */
3234
- textDiff, comparator,
3235
- /**
3236
- Can be used to ignore all non-point ranges, and points below
3237
- the given size. When -1, all ranges are compared.
3238
- */
3239
- minPointSize = -1) {
3293
+ textDiff, comparator) {
3294
+ let minPointSize = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;
3240
3295
  let a = oldSets.filter(set => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);
3241
3296
  let b = newSets.filter(set => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);
3242
3297
  let sharedChunks = findSharedChunks(a, b, textDiff);
@@ -3249,7 +3304,9 @@ class RangeSet {
3249
3304
  Compare the contents of two groups of range sets, returning true
3250
3305
  if they are equivalent in the given range.
3251
3306
  */
3252
- static eq(oldSets, newSets, from = 0, to) {
3307
+ static eq(oldSets, newSets) {
3308
+ let from = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
3309
+ let to = arguments.length > 3 ? arguments[3] : undefined;
3253
3310
  if (to == null) to = 1000000000 /* C.Far */ - 1;
3254
3311
  let a = oldSets.filter(set => !set.isEmpty && newSets.indexOf(set) < 0);
3255
3312
  let b = newSets.filter(set => !set.isEmpty && oldSets.indexOf(set) < 0);
@@ -3272,12 +3329,8 @@ class RangeSet {
3272
3329
  [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end
3273
3330
  of the iteration.
3274
3331
  */
3275
- static spans(sets, from, to, iterator,
3276
- /**
3277
- When given and greater than -1, only points of at least this
3278
- size are taken into account.
3279
- */
3280
- minPointSize = -1) {
3332
+ static spans(sets, from, to, iterator) {
3333
+ let minPointSize = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;
3281
3334
  let cursor = new SpanCursor(sets, null, minPointSize).goto(from),
3282
3335
  pos = from;
3283
3336
  let openRanges = cursor.openStart;
@@ -3304,7 +3357,8 @@ class RangeSet {
3304
3357
  `value.startSide`). You can pass `true` as second argument to
3305
3358
  cause the method to sort them.
3306
3359
  */
3307
- static of(ranges, sort = false) {
3360
+ static of(ranges) {
3361
+ let sort = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3308
3362
  let build = new RangeSetBuilder();
3309
3363
  for (let range of ranges instanceof Range$1 ? [ranges] : sort ? lazySort(ranges) : ranges) build.add(range.from, range.to, range.value);
3310
3364
  return build.finish();
@@ -3427,7 +3481,8 @@ function findSharedChunks(a, b, textDiff) {
3427
3481
  return shared;
3428
3482
  }
3429
3483
  class LayerCursor {
3430
- constructor(layer, skip, minPoint, rank = 0) {
3484
+ constructor(layer, skip, minPoint) {
3485
+ let rank = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
3431
3486
  this.layer = layer;
3432
3487
  this.skip = skip;
3433
3488
  this.minPoint = minPoint;
@@ -3439,7 +3494,8 @@ class LayerCursor {
3439
3494
  get endSide() {
3440
3495
  return this.value ? this.value.endSide : 0;
3441
3496
  }
3442
- goto(pos, side = -1000000000 /* C.Far */) {
3497
+ goto(pos) {
3498
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1000000000;
3443
3499
  this.chunkIndex = this.rangeIndex = 0;
3444
3500
  this.gotoInner(pos, side, false);
3445
3501
  return this;
@@ -3502,7 +3558,9 @@ class HeapCursor {
3502
3558
  constructor(heap) {
3503
3559
  this.heap = heap;
3504
3560
  }
3505
- static from(sets, skip = null, minPoint = -1) {
3561
+ static from(sets) {
3562
+ let skip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
3563
+ let minPoint = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
3506
3564
  let heap = [];
3507
3565
  for (let i = 0; i < sets.length; i++) {
3508
3566
  for (let cur = sets[i]; !cur.isEmpty; cur = cur.nextLayer) {
@@ -3514,7 +3572,8 @@ class HeapCursor {
3514
3572
  get startSide() {
3515
3573
  return this.value ? this.value.startSide : 0;
3516
3574
  }
3517
- goto(pos, side = -1000000000 /* C.Far */) {
3575
+ goto(pos) {
3576
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1000000000;
3518
3577
  for (let cur of this.heap) cur.goto(pos, side);
3519
3578
  for (let i = this.heap.length >> 1; i >= 0; i--) heapBubble(this.heap, i);
3520
3579
  this.next();
@@ -3574,7 +3633,8 @@ class SpanCursor {
3574
3633
  this.openStart = -1;
3575
3634
  this.cursor = HeapCursor.from(sets, skip, minPoint);
3576
3635
  }
3577
- goto(pos, side = -1000000000 /* C.Far */) {
3636
+ goto(pos) {
3637
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1000000000;
3578
3638
  this.cursor.goto(pos, side);
3579
3639
  this.active.length = this.activeTo.length = this.activeRank.length = 0;
3580
3640
  this.minActive = -1;
@@ -3722,7 +3782,8 @@ function findMinIndex(value, array) {
3722
3782
  Count the column position at the given offset into the string,
3723
3783
  taking extending characters and tab size into account.
3724
3784
  */
3725
- function countColumn(string, tabSize, to = string.length) {
3785
+ function countColumn(string, tabSize) {
3786
+ let to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : string.length;
3726
3787
  let n = 0;
3727
3788
  for (let i = 0; i < to;) {
3728
3789
  if (string.charCodeAt(i) == 9) {
@@ -3839,11 +3900,11 @@ class StyleSet {
3839
3900
  constructor(root) {
3840
3901
  if (!root.head && root.adoptedStyleSheets && typeof CSSStyleSheet != "undefined") {
3841
3902
  if (adoptedSet) {
3842
- root.adoptedStyleSheets = [adoptedSet.sheet].concat(root.adoptedStyleSheets);
3903
+ root.adoptedStyleSheets = [adoptedSet.sheet, ...root.adoptedStyleSheets];
3843
3904
  return root[SET] = adoptedSet;
3844
3905
  }
3845
3906
  this.sheet = new CSSStyleSheet();
3846
- root.adoptedStyleSheets = [this.sheet].concat(root.adoptedStyleSheets);
3907
+ root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets];
3847
3908
  adoptedSet = this;
3848
3909
  } else {
3849
3910
  this.styleTag = (root.ownerDocument || root).createElement("style");
@@ -4269,7 +4330,8 @@ function focusPreventScroll(dom) {
4269
4330
  }
4270
4331
  }
4271
4332
  let scratchRange;
4272
- function textRange(node, from, to = from) {
4333
+ function textRange(node, from) {
4334
+ let to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : from;
4273
4335
  let range = scratchRange || (scratchRange = document.createRange());
4274
4336
  range.setEnd(node, to);
4275
4337
  range.setStart(node, from);
@@ -4322,7 +4384,8 @@ function atElementStart(doc, selection) {
4322
4384
  }
4323
4385
  }
4324
4386
  class DOMPos {
4325
- constructor(node, offset, precise = true) {
4387
+ constructor(node, offset) {
4388
+ let precise = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
4326
4389
  this.node = node;
4327
4390
  this.offset = offset;
4328
4391
  this.precise = precise;
@@ -4342,10 +4405,6 @@ class ContentView {
4342
4405
  this.dirty = 2 /* Dirty.Node */;
4343
4406
  }
4344
4407
 
4345
- get editorView() {
4346
- if (!this.parent) throw new Error("Accessing view in orphan content view");
4347
- return this.parent.editorView;
4348
- }
4349
4408
  get overrideDOMText() {
4350
4409
  return null;
4351
4410
  }
@@ -4372,7 +4431,7 @@ class ContentView {
4372
4431
  coordsAt(_pos, _side) {
4373
4432
  return null;
4374
4433
  }
4375
- sync(track) {
4434
+ sync(view, track) {
4376
4435
  if (this.dirty & 2 /* Dirty.Node */) {
4377
4436
  let parent = this.dom;
4378
4437
  let prev = null,
@@ -4383,7 +4442,7 @@ class ContentView {
4383
4442
  let contentView = ContentView.get(next);
4384
4443
  if (!contentView || !contentView.parent && contentView.canReuseDOM(child)) child.reuseDOM(next);
4385
4444
  }
4386
- child.sync(track);
4445
+ child.sync(view, track);
4387
4446
  child.dirty = 0 /* Dirty.Not */;
4388
4447
  }
4389
4448
 
@@ -4401,7 +4460,7 @@ class ContentView {
4401
4460
  while (next) next = rm$1(next);
4402
4461
  } else if (this.dirty & 1 /* Dirty.Child */) {
4403
4462
  for (let child of this.children) if (child.dirty) {
4404
- child.sync(track);
4463
+ child.sync(view, track);
4405
4464
  child.dirty = 0 /* Dirty.Not */;
4406
4465
  }
4407
4466
  }
@@ -4433,7 +4492,8 @@ class ContentView {
4433
4492
  pos += child.length + child.breakAfter;
4434
4493
  }
4435
4494
  }
4436
- domBoundsAround(from, to, offset = 0) {
4495
+ domBoundsAround(from, to) {
4496
+ let offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
4437
4497
  let fromI = -1,
4438
4498
  fromStart = -1,
4439
4499
  toI = -1,
@@ -4461,7 +4521,8 @@ class ContentView {
4461
4521
  endDOM: toI < this.children.length && toI >= 0 ? this.children[toI].dom : null
4462
4522
  };
4463
4523
  }
4464
- markDirty(andParent = false) {
4524
+ markDirty() {
4525
+ let andParent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
4465
4526
  this.dirty |= 2 /* Dirty.Node */;
4466
4527
  this.markParentsDirty(andParent);
4467
4528
  }
@@ -4491,7 +4552,8 @@ class ContentView {
4491
4552
  v = parent;
4492
4553
  }
4493
4554
  }
4494
- replaceChildren(from, to, children = noChildren) {
4555
+ replaceChildren(from, to) {
4556
+ let children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noChildren;
4495
4557
  this.markDirty();
4496
4558
  for (let i = from; i < to; i++) {
4497
4559
  let child = this.children[i];
@@ -4506,10 +4568,12 @@ class ContentView {
4506
4568
  ignoreEvent(_event) {
4507
4569
  return false;
4508
4570
  }
4509
- childCursor(pos = this.length) {
4571
+ childCursor() {
4572
+ let pos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.length;
4510
4573
  return new ChildCursor(this.children, pos, this.children.length);
4511
4574
  }
4512
- childPos(pos, bias = 1) {
4575
+ childPos(pos) {
4576
+ let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4513
4577
  return this.childCursor().findPos(pos, bias);
4514
4578
  }
4515
4579
  toString() {
@@ -4522,6 +4586,9 @@ class ContentView {
4522
4586
  get isEditable() {
4523
4587
  return true;
4524
4588
  }
4589
+ get isWidget() {
4590
+ return false;
4591
+ }
4525
4592
  merge(from, to, source, hasStart, openStart, openEnd) {
4526
4593
  return false;
4527
4594
  }
@@ -4555,7 +4622,8 @@ class ChildCursor {
4555
4622
  this.i = i;
4556
4623
  this.off = 0;
4557
4624
  }
4558
- findPos(pos, bias = 1) {
4625
+ findPos(pos) {
4626
+ let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4559
4627
  for (;;) {
4560
4628
  if (pos > this.pos || pos == this.pos && (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) {
4561
4629
  this.off = pos - this.pos;
@@ -4695,7 +4763,7 @@ class TextView extends ContentView {
4695
4763
  createDOM(textDOM) {
4696
4764
  this.setDOM(textDOM || document.createTextNode(this.text));
4697
4765
  }
4698
- sync(track) {
4766
+ sync(view, track) {
4699
4767
  if (!this.dom) this.createDOM();
4700
4768
  if (this.dom.nodeValue != this.text) {
4701
4769
  if (track && track.node == this.dom) track.written = true;
@@ -4736,7 +4804,9 @@ class TextView extends ContentView {
4736
4804
  }
4737
4805
  }
4738
4806
  class MarkView extends ContentView {
4739
- constructor(mark, children = [], length = 0) {
4807
+ constructor(mark) {
4808
+ let children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
4809
+ let length = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
4740
4810
  super();
4741
4811
  this.mark = mark;
4742
4812
  this.children = children;
@@ -4756,9 +4826,9 @@ class MarkView extends ContentView {
4756
4826
  }
4757
4827
  }
4758
4828
 
4759
- sync(track) {
4829
+ sync(view, track) {
4760
4830
  if (!this.dom) this.setDOM(this.setAttrs(document.createElement(this.mark.tagName)));else if (this.dirty & 4 /* Dirty.Attrs */) this.setAttrs(this.dom);
4761
- super.sync(track);
4831
+ super.sync(view, track);
4762
4832
  }
4763
4833
  merge(from, to, source, _hasStart, openStart, openEnd) {
4764
4834
  if (source && (!(source instanceof MarkView && source.mark.eq(this.mark)) || from && openStart <= 0 || to < this.length && openEnd <= 0)) return false;
@@ -4837,11 +4907,11 @@ class WidgetView extends ContentView {
4837
4907
  this.length -= from;
4838
4908
  return result;
4839
4909
  }
4840
- sync() {
4841
- if (!this.dom || !this.widget.updateDOM(this.dom)) {
4910
+ sync(view) {
4911
+ if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
4842
4912
  if (this.dom && this.prevWidget) this.prevWidget.destroy(this.dom);
4843
4913
  this.prevWidget = null;
4844
- this.setDOM(this.widget.toDOM(this.editorView));
4914
+ this.setDOM(this.widget.toDOM(view));
4845
4915
  this.dom.contentEditable = "false";
4846
4916
  }
4847
4917
  }
@@ -4874,7 +4944,9 @@ class WidgetView extends ContentView {
4874
4944
  if (this.length == 0) return Text.empty;
4875
4945
  let top = this;
4876
4946
  while (top.parent) top = top.parent;
4877
- let view = top.editorView,
4947
+ let {
4948
+ view
4949
+ } = top,
4878
4950
  text = view && view.state.doc,
4879
4951
  start = this.posAtStart;
4880
4952
  return text ? text.slice(start, start + this.length) : Text.empty;
@@ -4898,6 +4970,9 @@ class WidgetView extends ContentView {
4898
4970
  get isEditable() {
4899
4971
  return false;
4900
4972
  }
4973
+ get isWidget() {
4974
+ return true;
4975
+ }
4901
4976
  destroy() {
4902
4977
  super.destroy();
4903
4978
  if (this.dom) this.widget.destroy(this.dom);
@@ -4971,9 +5046,9 @@ function scanCompositionTree(pos, side, view, text, enterView, fromText) {
4971
5046
  }
4972
5047
  function posFromDOMInCompositionTree(node, offset, view, text) {
4973
5048
  if (view instanceof MarkView) {
5049
+ let pos = 0;
4974
5050
  for (let child of view.children) {
4975
- let pos = 0,
4976
- hasComp = contains(child.dom, text);
5051
+ let hasComp = contains(child.dom, text);
4977
5052
  if (contains(child.dom, node)) return pos + (hasComp ? posFromDOMInCompositionTree(node, offset, child, text) : child.localPosFromDOM(node, offset));
4978
5053
  pos += hasComp ? text.nodeValue.length : child.length;
4979
5054
  }
@@ -5014,7 +5089,7 @@ class WidgetBufferView extends ContentView {
5014
5089
  return this.side;
5015
5090
  }
5016
5091
  domAtPos(pos) {
5017
- return DOMPos.before(this.dom);
5092
+ return this.side > 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom);
5018
5093
  }
5019
5094
  localPosFromDOM() {
5020
5095
  return 0;
@@ -5184,7 +5259,7 @@ class WidgetType {
5184
5259
  couldn't (in which case the widget will be redrawn). The default
5185
5260
  implementation just returns false.
5186
5261
  */
5187
- updateDOM(dom) {
5262
+ updateDOM(dom, view) {
5188
5263
  return false;
5189
5264
  }
5190
5265
  /**
@@ -5337,7 +5412,8 @@ class Decoration extends RangeValue {
5337
5412
  decorated range or ranges. If the ranges aren't already sorted,
5338
5413
  pass `true` for `sort` to make the library sort them for you.
5339
5414
  */
5340
- static set(of, sort = false) {
5415
+ static set(of) {
5416
+ let sort = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5341
5417
  return RangeSet.of(of, sort);
5342
5418
  }
5343
5419
  /**
@@ -5365,7 +5441,8 @@ class MarkDecoration extends Decoration {
5365
5441
  eq(other) {
5366
5442
  return this == other || other instanceof MarkDecoration && this.tagName == other.tagName && this.class == other.class && attrsEq(this.attrs, other.attrs);
5367
5443
  }
5368
- range(from, to = from) {
5444
+ range(from) {
5445
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
5369
5446
  if (from >= to) throw new RangeError("Mark decorations may not be empty");
5370
5447
  return super.range(from, to);
5371
5448
  }
@@ -5378,7 +5455,8 @@ class LineDecoration extends Decoration {
5378
5455
  eq(other) {
5379
5456
  return other instanceof LineDecoration && this.spec.class == other.spec.class && attrsEq(this.spec.attributes, other.spec.attributes);
5380
5457
  }
5381
- range(from, to = from) {
5458
+ range(from) {
5459
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
5382
5460
  if (to != from) throw new RangeError("Line decoration ranges must be zero-length");
5383
5461
  return super.range(from, to);
5384
5462
  }
@@ -5402,14 +5480,16 @@ class PointDecoration extends Decoration {
5402
5480
  eq(other) {
5403
5481
  return other instanceof PointDecoration && widgetsEq(this.widget, other.widget) && this.block == other.block && this.startSide == other.startSide && this.endSide == other.endSide;
5404
5482
  }
5405
- range(from, to = from) {
5483
+ range(from) {
5484
+ let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
5406
5485
  if (this.isReplace && (from > to || from == to && this.startSide > 0 && this.endSide <= 0)) throw new RangeError("Invalid range for replacement decoration");
5407
5486
  if (!this.isReplace && to != from) throw new RangeError("Widget decorations can only have zero-length ranges");
5408
5487
  return super.range(from, to);
5409
5488
  }
5410
5489
  }
5411
5490
  PointDecoration.prototype.point = true;
5412
- function getInclusive(spec, block = false) {
5491
+ function getInclusive(spec) {
5492
+ let block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5413
5493
  let {
5414
5494
  inclusiveStart: start,
5415
5495
  inclusiveEnd: end
@@ -5424,7 +5504,8 @@ function getInclusive(spec, block = false) {
5424
5504
  function widgetsEq(a, b) {
5425
5505
  return a == b || !!(a && b && a.compare(b));
5426
5506
  }
5427
- function addRange(from, to, ranges, margin = 0) {
5507
+ function addRange(from, to, ranges) {
5508
+ let margin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
5428
5509
  let last = ranges.length - 1;
5429
5510
  if (last >= 0 && ranges[last] + margin >= from) ranges[last] = Math.max(ranges[last], to);else ranges.push(from, to);
5430
5511
  }
@@ -5507,7 +5588,7 @@ class LineView extends ContentView {
5507
5588
  }
5508
5589
  }
5509
5590
 
5510
- sync(track) {
5591
+ sync(view, track) {
5511
5592
  var _a;
5512
5593
  if (!this.dom) {
5513
5594
  this.setDOM(document.createElement("div"));
@@ -5523,7 +5604,7 @@ class LineView extends ContentView {
5523
5604
  this.dom.classList.add("cm-line");
5524
5605
  this.prevAttrs = undefined;
5525
5606
  }
5526
- super.sync(track);
5607
+ super.sync(view, track);
5527
5608
  let last = this.dom.lastChild;
5528
5609
  while (last && ContentView.get(last) instanceof MarkView) last = last.lastChild;
5529
5610
  if (!last || !this.length || last.nodeName != "BR" && ((_a = ContentView.get(last)) === null || _a === void 0 ? void 0 : _a.isEditable) == false && (!browser.ios || !this.children.some(ch => ch instanceof TextView))) {
@@ -5534,20 +5615,41 @@ class LineView extends ContentView {
5534
5615
  }
5535
5616
  measureTextSize() {
5536
5617
  if (this.children.length == 0 || this.length > 20) return null;
5537
- let totalWidth = 0;
5618
+ let totalWidth = 0,
5619
+ textHeight;
5538
5620
  for (let child of this.children) {
5539
5621
  if (!(child instanceof TextView) || /[^ -~]/.test(child.text)) return null;
5540
5622
  let rects = clientRectsFor(child.dom);
5541
5623
  if (rects.length != 1) return null;
5542
5624
  totalWidth += rects[0].width;
5625
+ textHeight = rects[0].height;
5543
5626
  }
5544
5627
  return !totalWidth ? null : {
5545
5628
  lineHeight: this.dom.getBoundingClientRect().height,
5546
- charWidth: totalWidth / this.length
5629
+ charWidth: totalWidth / this.length,
5630
+ textHeight
5547
5631
  };
5548
5632
  }
5549
5633
  coordsAt(pos, side) {
5550
- return coordsInChildren(this, pos, side);
5634
+ let rect = coordsInChildren(this, pos, side);
5635
+ // Correct rectangle height for empty lines when the returned
5636
+ // height is larger than the text height.
5637
+ if (!this.children.length && rect && this.parent) {
5638
+ let {
5639
+ heightOracle
5640
+ } = this.parent.view.viewState,
5641
+ height = rect.bottom - rect.top;
5642
+ if (Math.abs(height - heightOracle.lineHeight) < 2 && heightOracle.textHeight < height) {
5643
+ let dist = (height - heightOracle.textHeight) / 2;
5644
+ return {
5645
+ top: rect.top + dist,
5646
+ bottom: rect.bottom - dist,
5647
+ left: rect.left,
5648
+ right: rect.left
5649
+ };
5650
+ }
5651
+ }
5652
+ return rect;
5551
5653
  }
5552
5654
  become(_other) {
5553
5655
  return false;
@@ -5595,11 +5697,11 @@ class BlockWidgetView extends ContentView {
5595
5697
  get children() {
5596
5698
  return noChildren;
5597
5699
  }
5598
- sync() {
5599
- if (!this.dom || !this.widget.updateDOM(this.dom)) {
5700
+ sync(view) {
5701
+ if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
5600
5702
  if (this.dom && this.prevWidget) this.prevWidget.destroy(this.dom);
5601
5703
  this.prevWidget = null;
5602
- this.setDOM(this.widget.toDOM(this.editorView));
5704
+ this.setDOM(this.widget.toDOM(view));
5603
5705
  this.dom.contentEditable = "false";
5604
5706
  }
5605
5707
  }
@@ -5626,6 +5728,12 @@ class BlockWidgetView extends ContentView {
5626
5728
  ignoreEvent(event) {
5627
5729
  return this.widget.ignoreEvent(event);
5628
5730
  }
5731
+ get isEditable() {
5732
+ return false;
5733
+ }
5734
+ get isWidget() {
5735
+ return true;
5736
+ }
5629
5737
  destroy() {
5630
5738
  super.destroy();
5631
5739
  if (this.dom) this.widget.destroy(this.dom);
@@ -5663,7 +5771,8 @@ class ContentBuilder {
5663
5771
  }
5664
5772
  return this.curLine;
5665
5773
  }
5666
- flushBuffer(active = this.bufferMarks) {
5774
+ flushBuffer() {
5775
+ let active = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.bufferMarks;
5667
5776
  if (this.pendingBuffer) {
5668
5777
  this.curLine.append(wrapMarks(new WidgetBufferView(-1), active), active.length);
5669
5778
  this.pendingBuffer = 0 /* Buf.No */;
@@ -5795,6 +5904,7 @@ const mouseSelectionStyle = /*@__PURE__*/Facet.define();
5795
5904
  const exceptionSink = /*@__PURE__*/Facet.define();
5796
5905
  const updateListener = /*@__PURE__*/Facet.define();
5797
5906
  const inputHandler = /*@__PURE__*/Facet.define();
5907
+ const focusChangeEffect = /*@__PURE__*/Facet.define();
5798
5908
  const perLineTextDirection = /*@__PURE__*/Facet.define({
5799
5909
  combine: values => values.some(x => x)
5800
5910
  });
@@ -5802,7 +5912,11 @@ const nativeSelectionHidden = /*@__PURE__*/Facet.define({
5802
5912
  combine: values => values.some(x => x)
5803
5913
  });
5804
5914
  class ScrollTarget {
5805
- constructor(range, y = "nearest", x = "nearest", yMargin = 5, xMargin = 5) {
5915
+ constructor(range) {
5916
+ let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "nearest";
5917
+ let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "nearest";
5918
+ let yMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;
5919
+ let xMargin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 5;
5806
5920
  this.range = range;
5807
5921
  this.y = y;
5808
5922
  this.x = x;
@@ -6025,11 +6139,6 @@ class ViewUpdate {
6025
6139
  let changedRanges = [];
6026
6140
  this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange(fromA, toA, fromB, toB)));
6027
6141
  this.changedRanges = changedRanges;
6028
- let focus = view.hasFocus;
6029
- if (focus != view.inputState.notifiedFocused) {
6030
- view.inputState.notifiedFocused = focus;
6031
- this.flags |= 1 /* UpdateFlag.Focus */;
6032
- }
6033
6142
  }
6034
6143
  /**
6035
6144
  @internal
@@ -6482,9 +6591,6 @@ class DocView extends ContentView {
6482
6591
  this.updateDeco();
6483
6592
  this.updateInner([new ChangedRange(0, 0, 0, view.state.doc.length)], 0);
6484
6593
  }
6485
- get editorView() {
6486
- return this.view;
6487
- }
6488
6594
  get length() {
6489
6595
  return this.view.state.doc.length;
6490
6596
  }
@@ -6495,10 +6601,13 @@ class DocView extends ContentView {
6495
6601
  update(update) {
6496
6602
  let changedRanges = update.changedRanges;
6497
6603
  if (this.minWidth > 0 && changedRanges.length) {
6498
- if (!changedRanges.every(({
6499
- fromA,
6500
- toA
6501
- }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) {
6604
+ if (!changedRanges.every(_ref => {
6605
+ let {
6606
+ fromA,
6607
+ toA
6608
+ } = _ref;
6609
+ return toA < this.minWidthFrom || fromA > this.minWidthTo;
6610
+ })) {
6502
6611
  this.minWidth = this.minWidthFrom = this.minWidthTo = 0;
6503
6612
  } else {
6504
6613
  this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);
@@ -6547,7 +6656,7 @@ class DocView extends ContentView {
6547
6656
  node: observer.selectionRange.focusNode,
6548
6657
  written: false
6549
6658
  } : undefined;
6550
- this.sync(track);
6659
+ this.sync(this.view, track);
6551
6660
  this.dirty = 0 /* Dirty.Not */;
6552
6661
  if (track && (track.written || observer.selectionRange.focusNode != track.node)) this.forceSelection = true;
6553
6662
  this.dom.style.height = "";
@@ -6585,7 +6694,9 @@ class DocView extends ContentView {
6585
6694
  }
6586
6695
  }
6587
6696
  // Sync the DOM selection to this.state.selection
6588
- updateSelection(mustRead = false, fromPointer = false) {
6697
+ updateSelection() {
6698
+ let mustRead = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6699
+ let fromPointer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6589
6700
  if (mustRead || !this.view.observer.selectionRange.focusNode) this.view.observer.readSelectionRange();
6590
6701
  if (!(fromPointer || this.mayControlSelection())) return;
6591
6702
  let force = this.forceSelection;
@@ -6772,7 +6883,8 @@ class DocView extends ContentView {
6772
6883
  // If no workable line exists, force a layout of a measurable element
6773
6884
  let dummy = document.createElement("div"),
6774
6885
  lineHeight,
6775
- charWidth;
6886
+ charWidth,
6887
+ textHeight;
6776
6888
  dummy.className = "cm-line";
6777
6889
  dummy.style.width = "99999px";
6778
6890
  dummy.textContent = "abc def ghi jkl mno pqr stu";
@@ -6781,14 +6893,17 @@ class DocView extends ContentView {
6781
6893
  let rect = clientRectsFor(dummy.firstChild)[0];
6782
6894
  lineHeight = dummy.getBoundingClientRect().height;
6783
6895
  charWidth = rect ? rect.width / 27 : 7;
6896
+ textHeight = rect ? rect.height : lineHeight;
6784
6897
  dummy.remove();
6785
6898
  });
6786
6899
  return {
6787
6900
  lineHeight,
6788
- charWidth
6901
+ charWidth,
6902
+ textHeight
6789
6903
  };
6790
6904
  }
6791
- childCursor(pos = this.length) {
6905
+ childCursor() {
6906
+ let pos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.length;
6792
6907
  // Move back to start of last element when possible, so that
6793
6908
  // `ChildCursor.findPos` doesn't have to deal with the edge case
6794
6909
  // of being after the last element.
@@ -6969,19 +7084,26 @@ class CompositionWidget extends WidgetType {
6969
7084
  return CompositionView;
6970
7085
  }
6971
7086
  }
6972
- function nearbyTextNode(node, offset, side) {
6973
- for (;;) {
7087
+ function nearbyTextNode(startNode, startOffset, side) {
7088
+ if (side <= 0) for (let node = startNode, offset = startOffset;;) {
6974
7089
  if (node.nodeType == 3) return node;
6975
- if (node.nodeType == 1 && offset > 0 && side <= 0) {
7090
+ if (node.nodeType == 1 && offset > 0) {
6976
7091
  node = node.childNodes[offset - 1];
6977
7092
  offset = maxOffset(node);
6978
- } else if (node.nodeType == 1 && offset < node.childNodes.length && side >= 0) {
7093
+ } else {
7094
+ break;
7095
+ }
7096
+ }
7097
+ if (side >= 0) for (let node = startNode, offset = startOffset;;) {
7098
+ if (node.nodeType == 3) return node;
7099
+ if (node.nodeType == 1 && offset < node.childNodes.length && side >= 0) {
6979
7100
  node = node.childNodes[offset];
6980
7101
  offset = 0;
6981
7102
  } else {
6982
- return null;
7103
+ break;
6983
7104
  }
6984
7105
  }
7106
+ return null;
6985
7107
  }
6986
7108
  function nextToUneditable(node, offset) {
6987
7109
  if (node.nodeType != 1) return 0;
@@ -7011,7 +7133,8 @@ function inUneditable(node, inside) {
7011
7133
  }
7012
7134
  return false;
7013
7135
  }
7014
- function groupAt(state, pos, bias = 1) {
7136
+ function groupAt(state, pos) {
7137
+ let bias = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
7015
7138
  let categorize = state.charCategorizer(pos);
7016
7139
  let line = state.doc.lineAt(pos),
7017
7140
  linePos = pos - line.from;
@@ -7154,18 +7277,20 @@ function domPosInText(node, x, y) {
7154
7277
  offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0
7155
7278
  };
7156
7279
  }
7157
- function posAtCoords(view, {
7158
- x,
7159
- y
7160
- }, precise, bias = -1) {
7161
- var _a;
7280
+ function posAtCoords(view, coords, precise) {
7281
+ let bias = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
7282
+ var _a, _b;
7162
7283
  let content = view.contentDOM.getBoundingClientRect(),
7163
7284
  docTop = content.top + view.viewState.paddingTop;
7164
7285
  let block,
7165
7286
  {
7166
7287
  docHeight
7167
7288
  } = view.viewState;
7168
- let yOffset = y - docTop;
7289
+ let {
7290
+ x,
7291
+ y
7292
+ } = coords,
7293
+ yOffset = y - docTop;
7169
7294
  if (yOffset < 0) return 0;
7170
7295
  if (yOffset > docHeight) return view.state.doc.length;
7171
7296
  // Scan for a text block near the queried y position
@@ -7230,7 +7355,14 @@ function posAtCoords(view, {
7230
7355
  offset
7231
7356
  } = domPosAtCoords(line.dom, x, y));
7232
7357
  }
7233
- return view.docView.posFromDOM(node, offset);
7358
+ let nearest = view.docView.nearest(node);
7359
+ if (!nearest) return null;
7360
+ if (nearest.isWidget && ((_b = nearest.dom) === null || _b === void 0 ? void 0 : _b.nodeType) == 1) {
7361
+ let rect = nearest.dom.getBoundingClientRect();
7362
+ return coords.y < rect.top || coords.y <= rect.bottom && coords.x <= (rect.left + rect.right) / 2 ? nearest.posAtStart : nearest.posAtEnd;
7363
+ } else {
7364
+ return nearest.localPosFromDOM(node, offset) + nearest.posAtStart;
7365
+ }
7234
7366
  }
7235
7367
  function posAtCoordsImprecise(view, contentRect, block, x, y) {
7236
7368
  let into = Math.round((x - contentRect.left) * view.defaultCharacterWidth);
@@ -7402,7 +7534,16 @@ class InputState {
7402
7534
  this.registeredEvents.push(type);
7403
7535
  }
7404
7536
  view.scrollDOM.addEventListener("mousedown", event => {
7405
- if (event.target == view.scrollDOM) handleEvent(handlers.mousedown, event);
7537
+ if (event.target == view.scrollDOM && event.clientY > view.contentDOM.getBoundingClientRect().bottom) {
7538
+ handleEvent(handlers.mousedown, event);
7539
+ if (!event.defaultPrevented && event.button == 2) {
7540
+ // Make sure the content covers the entire scroller height, in order
7541
+ // to catch a native context menu click below it
7542
+ let start = view.contentDOM.style.minHeight;
7543
+ view.contentDOM.style.minHeight = "100%";
7544
+ setTimeout(() => view.contentDOM.style.minHeight = start, 200);
7545
+ }
7546
+ }
7406
7547
  });
7407
7548
  if (browser.chrome && browser.chrome_version == 102) {
7408
7549
  // FIXME remove at some point
@@ -7574,11 +7715,13 @@ class MouseSelection {
7574
7715
  this.multiple = view.state.facet(EditorState.allowMultipleSelections) && addsSelectionRange(view, startEvent);
7575
7716
  this.dragMove = dragMovesSelection(view, startEvent);
7576
7717
  this.dragging = isInPrimarySelection(view, startEvent) && getClickType(startEvent) == 1 ? null : false;
7718
+ }
7719
+ start(event) {
7577
7720
  // When clicking outside of the selection, immediately apply the
7578
7721
  // effect of starting the selection
7579
7722
  if (this.dragging === false) {
7580
- startEvent.preventDefault();
7581
- this.select(startEvent);
7723
+ event.preventDefault();
7724
+ this.select(event);
7582
7725
  }
7583
7726
  }
7584
7727
  move(event) {
@@ -7763,8 +7906,9 @@ handlers.mousedown = (view, event) => {
7763
7906
  if (!style && event.button == 0) style = basicMouseSelection(view, event);
7764
7907
  if (style) {
7765
7908
  let mustFocus = view.root.activeElement != view.contentDOM;
7766
- if (mustFocus) view.observer.ignore(() => focusPreventScroll(view.contentDOM));
7767
7909
  view.inputState.startMouseSelection(new MouseSelection(view, event, style, mustFocus));
7910
+ if (mustFocus) view.observer.ignore(() => focusPreventScroll(view.contentDOM));
7911
+ if (view.inputState.mouseSelection) view.inputState.mouseSelection.start(event);
7768
7912
  }
7769
7913
  };
7770
7914
  function rangeForClick(view, pos, bias, type) {
@@ -7930,7 +8074,7 @@ handlers.paste = (view, event) => {
7930
8074
  view.observer.flush();
7931
8075
  let data = brokenClipboardAPI ? null : event.clipboardData;
7932
8076
  if (data) {
7933
- doPaste(view, data.getData("text/plain"));
8077
+ doPaste(view, data.getData("text/plain") || data.getData("text/uri-text"));
7934
8078
  event.preventDefault();
7935
8079
  } else {
7936
8080
  capturePaste(view);
@@ -8007,9 +8151,25 @@ handlers.copy = handlers.cut = (view, event) => {
8007
8151
  userEvent: "delete.cut"
8008
8152
  });
8009
8153
  };
8154
+ const isFocusChange = /*@__PURE__*/Annotation.define();
8155
+ function focusChangeTransaction(state, focus) {
8156
+ let effects = [];
8157
+ for (let getEffect of state.facet(focusChangeEffect)) {
8158
+ let effect = getEffect(state, focus);
8159
+ if (effect) effects.push(effect);
8160
+ }
8161
+ return effects ? state.update({
8162
+ effects,
8163
+ annotations: isFocusChange.of(true)
8164
+ }) : null;
8165
+ }
8010
8166
  function updateForFocusChange(view) {
8011
8167
  setTimeout(() => {
8012
- if (view.hasFocus != view.inputState.notifiedFocused) view.update([]);
8168
+ let focus = view.hasFocus;
8169
+ if (focus != view.inputState.notifiedFocused) {
8170
+ let tr = focusChangeTransaction(view.state, focus);
8171
+ if (tr) view.dispatch(tr);else view.update([]);
8172
+ }
8013
8173
  }, 10);
8014
8174
  }
8015
8175
  handlers.focus = view => {
@@ -8078,15 +8238,16 @@ class HeightOracle {
8078
8238
  this.lineWrapping = lineWrapping;
8079
8239
  this.doc = Text.empty;
8080
8240
  this.heightSamples = {};
8081
- this.lineHeight = 14;
8241
+ this.lineHeight = 14; // The height of an entire line (line-height)
8082
8242
  this.charWidth = 7;
8243
+ this.textHeight = 14; // The height of the actual font (font-size)
8083
8244
  this.lineLength = 30;
8084
8245
  // Used to track, during updateHeight, if any actual heights changed
8085
8246
  this.heightChanged = false;
8086
8247
  }
8087
8248
  heightForGap(from, to) {
8088
8249
  let lines = this.doc.lineAt(to).number - this.doc.lineAt(from).number + 1;
8089
- if (this.lineWrapping) lines += Math.ceil((to - from - lines * this.lineLength * 0.5) / this.lineLength);
8250
+ if (this.lineWrapping) lines += Math.max(0, Math.ceil((to - from - lines * this.lineLength * 0.5) / this.lineLength));
8090
8251
  return this.lineHeight * lines;
8091
8252
  }
8092
8253
  heightForLine(length) {
@@ -8115,12 +8276,13 @@ class HeightOracle {
8115
8276
  }
8116
8277
  return newHeight;
8117
8278
  }
8118
- refresh(whiteSpace, lineHeight, charWidth, lineLength, knownHeights) {
8279
+ refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {
8119
8280
  let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;
8120
8281
  let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping;
8121
8282
  this.lineWrapping = lineWrapping;
8122
8283
  this.lineHeight = lineHeight;
8123
8284
  this.charWidth = charWidth;
8285
+ this.textHeight = textHeight;
8124
8286
  this.lineLength = lineLength;
8125
8287
  if (changed) {
8126
8288
  this.heightSamples = {};
@@ -8212,9 +8374,8 @@ const Epsilon = 1e-3;
8212
8374
  class HeightMap {
8213
8375
  constructor(length,
8214
8376
  // The number of characters covered
8215
- height,
8216
- // Height of this part of the document
8217
- flags = 2 /* Flag.Outdated */) {
8377
+ height) {
8378
+ let flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
8218
8379
  this.length = length;
8219
8380
  this.height = height;
8220
8381
  this.flags = flags;
@@ -8245,7 +8406,8 @@ class HeightMap {
8245
8406
  result.push(this);
8246
8407
  }
8247
8408
  applyChanges(decorations, oldDoc, oracle, changes) {
8248
- let me = this;
8409
+ let me = this,
8410
+ doc = oracle.doc;
8249
8411
  for (let i = changes.length - 1; i >= 0; i--) {
8250
8412
  let {
8251
8413
  fromA,
@@ -8253,19 +8415,19 @@ class HeightMap {
8253
8415
  fromB,
8254
8416
  toB
8255
8417
  } = changes[i];
8256
- let start = me.lineAt(fromA, QueryType.ByPosNoHeight, oldDoc, 0, 0);
8257
- let end = start.to >= toA ? start : me.lineAt(toA, QueryType.ByPosNoHeight, oldDoc, 0, 0);
8418
+ let start = me.lineAt(fromA, QueryType.ByPosNoHeight, oracle.setDoc(oldDoc), 0, 0);
8419
+ let end = start.to >= toA ? start : me.lineAt(toA, QueryType.ByPosNoHeight, oracle, 0, 0);
8258
8420
  toB += end.to - toA;
8259
8421
  toA = end.to;
8260
8422
  while (i > 0 && start.from <= changes[i - 1].toA) {
8261
8423
  fromA = changes[i - 1].fromA;
8262
8424
  fromB = changes[i - 1].fromB;
8263
8425
  i--;
8264
- if (fromA < start.from) start = me.lineAt(fromA, QueryType.ByPosNoHeight, oldDoc, 0, 0);
8426
+ if (fromA < start.from) start = me.lineAt(fromA, QueryType.ByPosNoHeight, oracle, 0, 0);
8265
8427
  }
8266
8428
  fromB += start.from - fromA;
8267
8429
  fromA = start.from;
8268
- let nodes = NodeBuilder.build(oracle, decorations, fromB, toB);
8430
+ let nodes = NodeBuilder.build(oracle.setDoc(doc), decorations, fromB, toB);
8269
8431
  me = me.replace(fromA, toA, nodes);
8270
8432
  }
8271
8433
  return me.updateHeight(oracle, 0);
@@ -8323,16 +8485,18 @@ class HeightMapBlock extends HeightMap {
8323
8485
  super(length, height);
8324
8486
  this.type = type;
8325
8487
  }
8326
- blockAt(_height, _doc, top, offset) {
8488
+ blockAt(_height, _oracle, top, offset) {
8327
8489
  return new BlockInfo(offset, this.length, top, this.height, this.type);
8328
8490
  }
8329
- lineAt(_value, _type, doc, top, offset) {
8330
- return this.blockAt(0, doc, top, offset);
8491
+ lineAt(_value, _type, oracle, top, offset) {
8492
+ return this.blockAt(0, oracle, top, offset);
8331
8493
  }
8332
- forEachLine(from, to, doc, top, offset, f) {
8333
- if (from <= offset + this.length && to >= offset) f(this.blockAt(0, doc, top, offset));
8494
+ forEachLine(from, to, oracle, top, offset, f) {
8495
+ if (from <= offset + this.length && to >= offset) f(this.blockAt(0, oracle, top, offset));
8334
8496
  }
8335
- updateHeight(oracle, offset = 0, _force = false, measured) {
8497
+ updateHeight(oracle) {
8498
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
8499
+ let measured = arguments.length > 3 ? arguments[3] : undefined;
8336
8500
  if (measured && measured.from <= offset && measured.more) this.setHeight(oracle, measured.heights[measured.index++]);
8337
8501
  this.outdated = false;
8338
8502
  return this;
@@ -8358,7 +8522,10 @@ class HeightMapText extends HeightMapBlock {
8358
8522
  return HeightMap.of(nodes);
8359
8523
  }
8360
8524
  }
8361
- updateHeight(oracle, offset = 0, force = false, measured) {
8525
+ updateHeight(oracle) {
8526
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
8527
+ let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8528
+ let measured = arguments.length > 3 ? arguments[3] : undefined;
8362
8529
  if (measured && measured.from <= offset && measured.more) this.setHeight(oracle, measured.heights[measured.index++]);else if (force || this.outdated) this.setHeight(oracle, Math.max(this.widgetHeight, oracle.heightForLine(this.length - this.collapsed)));
8363
8530
  this.outdated = false;
8364
8531
  return this;
@@ -8371,58 +8538,85 @@ class HeightMapGap extends HeightMap {
8371
8538
  constructor(length) {
8372
8539
  super(length, 0);
8373
8540
  }
8374
- lines(doc, offset) {
8375
- let firstLine = doc.lineAt(offset).number,
8376
- lastLine = doc.lineAt(offset + this.length).number;
8541
+ heightMetrics(oracle, offset) {
8542
+ let firstLine = oracle.doc.lineAt(offset).number,
8543
+ lastLine = oracle.doc.lineAt(offset + this.length).number;
8544
+ let lines = lastLine - firstLine + 1;
8545
+ let perLine,
8546
+ perChar = 0;
8547
+ if (oracle.lineWrapping) {
8548
+ let totalPerLine = Math.min(this.height, oracle.lineHeight * lines);
8549
+ perLine = totalPerLine / lines;
8550
+ perChar = (this.height - totalPerLine) / (this.length - lines - 1);
8551
+ } else {
8552
+ perLine = this.height / lines;
8553
+ }
8377
8554
  return {
8378
8555
  firstLine,
8379
8556
  lastLine,
8380
- lineHeight: this.height / (lastLine - firstLine + 1)
8557
+ perLine,
8558
+ perChar
8381
8559
  };
8382
8560
  }
8383
- blockAt(height, doc, top, offset) {
8561
+ blockAt(height, oracle, top, offset) {
8384
8562
  let {
8385
8563
  firstLine,
8386
8564
  lastLine,
8387
- lineHeight
8388
- } = this.lines(doc, offset);
8389
- let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top) / lineHeight)));
8390
- let {
8391
- from,
8392
- length
8393
- } = doc.line(firstLine + line);
8394
- return new BlockInfo(from, length, top + lineHeight * line, lineHeight, BlockType.Text);
8565
+ perLine,
8566
+ perChar
8567
+ } = this.heightMetrics(oracle, offset);
8568
+ if (oracle.lineWrapping) {
8569
+ let guess = offset + Math.round(Math.max(0, Math.min(1, (height - top) / this.height)) * this.length);
8570
+ let line = oracle.doc.lineAt(guess),
8571
+ lineHeight = perLine + line.length * perChar;
8572
+ let lineTop = Math.max(top, height - lineHeight / 2);
8573
+ return new BlockInfo(line.from, line.length, lineTop, lineHeight, BlockType.Text);
8574
+ } else {
8575
+ let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top) / perLine)));
8576
+ let {
8577
+ from,
8578
+ length
8579
+ } = oracle.doc.line(firstLine + line);
8580
+ return new BlockInfo(from, length, top + perLine * line, perLine, BlockType.Text);
8581
+ }
8395
8582
  }
8396
- lineAt(value, type, doc, top, offset) {
8397
- if (type == QueryType.ByHeight) return this.blockAt(value, doc, top, offset);
8583
+ lineAt(value, type, oracle, top, offset) {
8584
+ if (type == QueryType.ByHeight) return this.blockAt(value, oracle, top, offset);
8398
8585
  if (type == QueryType.ByPosNoHeight) {
8399
8586
  let {
8400
8587
  from,
8401
8588
  to
8402
- } = doc.lineAt(value);
8589
+ } = oracle.doc.lineAt(value);
8403
8590
  return new BlockInfo(from, to - from, 0, 0, BlockType.Text);
8404
8591
  }
8405
8592
  let {
8406
8593
  firstLine,
8407
- lineHeight
8408
- } = this.lines(doc, offset);
8409
- let {
8410
- from,
8411
- length,
8412
- number
8413
- } = doc.lineAt(value);
8414
- return new BlockInfo(from, length, top + lineHeight * (number - firstLine), lineHeight, BlockType.Text);
8415
- }
8416
- forEachLine(from, to, doc, top, offset, f) {
8594
+ perLine,
8595
+ perChar
8596
+ } = this.heightMetrics(oracle, offset);
8597
+ let line = oracle.doc.lineAt(value),
8598
+ lineHeight = perLine + line.length * perChar;
8599
+ let linesAbove = line.number - firstLine;
8600
+ let lineTop = top + perLine * linesAbove + perChar * (line.from - offset - linesAbove);
8601
+ return new BlockInfo(line.from, line.length, Math.max(top, Math.min(lineTop, top + this.height - lineHeight)), lineHeight, BlockType.Text);
8602
+ }
8603
+ forEachLine(from, to, oracle, top, offset, f) {
8604
+ from = Math.max(from, offset);
8605
+ to = Math.min(to, offset + this.length);
8417
8606
  let {
8418
8607
  firstLine,
8419
- lineHeight
8420
- } = this.lines(doc, offset);
8421
- for (let pos = Math.max(from, offset), end = Math.min(offset + this.length, to); pos <= end;) {
8422
- let line = doc.lineAt(pos);
8423
- if (pos == from) top += lineHeight * (line.number - firstLine);
8424
- f(new BlockInfo(line.from, line.length, top, lineHeight, BlockType.Text));
8425
- top += lineHeight;
8608
+ perLine,
8609
+ perChar
8610
+ } = this.heightMetrics(oracle, offset);
8611
+ for (let pos = from, lineTop = top; pos <= to;) {
8612
+ let line = oracle.doc.lineAt(pos);
8613
+ if (pos == from) {
8614
+ let linesAbove = line.number - firstLine;
8615
+ lineTop += perLine * linesAbove + perChar * (from - offset - linesAbove);
8616
+ }
8617
+ let lineHeight = perLine + perChar * line.length;
8618
+ f(new BlockInfo(line.from, line.length, lineTop, lineHeight, BlockType.Text));
8619
+ lineTop += lineHeight;
8426
8620
  pos = line.to + 1;
8427
8621
  }
8428
8622
  }
@@ -8444,7 +8638,10 @@ class HeightMapGap extends HeightMap {
8444
8638
  decomposeRight(from, result) {
8445
8639
  result.push(null, new HeightMapGap(this.length - from - 1));
8446
8640
  }
8447
- updateHeight(oracle, offset = 0, force = false, measured) {
8641
+ updateHeight(oracle) {
8642
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
8643
+ let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8644
+ let measured = arguments.length > 3 ? arguments[3] : undefined;
8448
8645
  let end = offset + this.length;
8449
8646
  if (measured && measured.from <= offset + this.length && measured.more) {
8450
8647
  // Fill in part of this gap with measured lines. We know there
@@ -8454,7 +8651,6 @@ class HeightMapGap extends HeightMap {
8454
8651
  let nodes = [],
8455
8652
  pos = Math.max(offset, measured.from),
8456
8653
  singleHeight = -1;
8457
- let wasChanged = oracle.heightChanged;
8458
8654
  if (measured.from > offset) nodes.push(new HeightMapGap(measured.from - offset - 1).updateHeight(oracle, offset));
8459
8655
  while (pos <= end && measured.more) {
8460
8656
  let len = oracle.doc.lineAt(pos).length;
@@ -8468,7 +8664,7 @@ class HeightMapGap extends HeightMap {
8468
8664
  }
8469
8665
  if (pos <= end) nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));
8470
8666
  let result = HeightMap.of(nodes);
8471
- oracle.heightChanged = wasChanged || singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon || Math.abs(singleHeight - this.lines(oracle.doc, offset).lineHeight) >= Epsilon;
8667
+ if (singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon) oracle.heightChanged = true;
8472
8668
  return result;
8473
8669
  } else if (force || this.outdated) {
8474
8670
  this.setHeight(oracle, oracle.heightForGap(offset, offset + this.length));
@@ -8490,30 +8686,30 @@ class HeightMapBranch extends HeightMap {
8490
8686
  get break() {
8491
8687
  return this.flags & 1 /* Flag.Break */;
8492
8688
  }
8493
- blockAt(height, doc, top, offset) {
8689
+ blockAt(height, oracle, top, offset) {
8494
8690
  let mid = top + this.left.height;
8495
- return height < mid ? this.left.blockAt(height, doc, top, offset) : this.right.blockAt(height, doc, mid, offset + this.left.length + this.break);
8691
+ return height < mid ? this.left.blockAt(height, oracle, top, offset) : this.right.blockAt(height, oracle, mid, offset + this.left.length + this.break);
8496
8692
  }
8497
- lineAt(value, type, doc, top, offset) {
8693
+ lineAt(value, type, oracle, top, offset) {
8498
8694
  let rightTop = top + this.left.height,
8499
8695
  rightOffset = offset + this.left.length + this.break;
8500
8696
  let left = type == QueryType.ByHeight ? value < rightTop : value < rightOffset;
8501
- let base = left ? this.left.lineAt(value, type, doc, top, offset) : this.right.lineAt(value, type, doc, rightTop, rightOffset);
8697
+ let base = left ? this.left.lineAt(value, type, oracle, top, offset) : this.right.lineAt(value, type, oracle, rightTop, rightOffset);
8502
8698
  if (this.break || (left ? base.to < rightOffset : base.from > rightOffset)) return base;
8503
8699
  let subQuery = type == QueryType.ByPosNoHeight ? QueryType.ByPosNoHeight : QueryType.ByPos;
8504
- if (left) return base.join(this.right.lineAt(rightOffset, subQuery, doc, rightTop, rightOffset));else return this.left.lineAt(rightOffset, subQuery, doc, top, offset).join(base);
8700
+ if (left) return base.join(this.right.lineAt(rightOffset, subQuery, oracle, rightTop, rightOffset));else return this.left.lineAt(rightOffset, subQuery, oracle, top, offset).join(base);
8505
8701
  }
8506
- forEachLine(from, to, doc, top, offset, f) {
8702
+ forEachLine(from, to, oracle, top, offset, f) {
8507
8703
  let rightTop = top + this.left.height,
8508
8704
  rightOffset = offset + this.left.length + this.break;
8509
8705
  if (this.break) {
8510
- if (from < rightOffset) this.left.forEachLine(from, to, doc, top, offset, f);
8511
- if (to >= rightOffset) this.right.forEachLine(from, to, doc, rightTop, rightOffset, f);
8706
+ if (from < rightOffset) this.left.forEachLine(from, to, oracle, top, offset, f);
8707
+ if (to >= rightOffset) this.right.forEachLine(from, to, oracle, rightTop, rightOffset, f);
8512
8708
  } else {
8513
- let mid = this.lineAt(rightOffset, QueryType.ByPos, doc, top, offset);
8514
- if (from < mid.from) this.left.forEachLine(from, mid.from - 1, doc, top, offset, f);
8709
+ let mid = this.lineAt(rightOffset, QueryType.ByPos, oracle, top, offset);
8710
+ if (from < mid.from) this.left.forEachLine(from, mid.from - 1, oracle, top, offset, f);
8515
8711
  if (mid.to >= from && mid.from <= to) f(mid);
8516
- if (to > mid.to) this.right.forEachLine(mid.to + 1, to, doc, rightTop, rightOffset, f);
8712
+ if (to > mid.to) this.right.forEachLine(mid.to + 1, to, oracle, rightTop, rightOffset, f);
8517
8713
  }
8518
8714
  }
8519
8715
  replace(from, to, nodes) {
@@ -8560,7 +8756,10 @@ class HeightMapBranch extends HeightMap {
8560
8756
  this.length = left.length + this.break + right.length;
8561
8757
  return this;
8562
8758
  }
8563
- updateHeight(oracle, offset = 0, force = false, measured) {
8759
+ updateHeight(oracle) {
8760
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
8761
+ let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8762
+ let measured = arguments.length > 3 ? arguments[3] : undefined;
8564
8763
  let {
8565
8764
  left,
8566
8765
  right
@@ -8847,10 +9046,13 @@ class ViewState {
8847
9046
  } = this.state.selection;
8848
9047
  for (let i = 0; i <= 1; i++) {
8849
9048
  let pos = i ? main.head : main.anchor;
8850
- if (!viewports.some(({
8851
- from,
8852
- to
8853
- }) => pos >= from && pos <= to)) {
9049
+ if (!viewports.some(_ref2 => {
9050
+ let {
9051
+ from,
9052
+ to
9053
+ } = _ref2;
9054
+ return pos >= from && pos <= to;
9055
+ })) {
8854
9056
  let {
8855
9057
  from,
8856
9058
  to
@@ -8859,15 +9061,16 @@ class ViewState {
8859
9061
  }
8860
9062
  }
8861
9063
  this.viewports = viewports.sort((a, b) => a.from - b.from);
8862
- this.scaler = this.heightMap.height <= 7000000 /* VP.MaxDOMHeight */ ? IdScaler : new BigScaler(this.heightOracle.doc, this.heightMap, this.viewports);
9064
+ this.scaler = this.heightMap.height <= 7000000 /* VP.MaxDOMHeight */ ? IdScaler : new BigScaler(this.heightOracle, this.heightMap, this.viewports);
8863
9065
  }
8864
9066
  updateViewportLines() {
8865
9067
  this.viewportLines = [];
8866
- this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.state.doc, 0, 0, block => {
9068
+ this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, block => {
8867
9069
  this.viewportLines.push(this.scaler.scale == 1 ? block : scaleBlock(block, this.scaler));
8868
9070
  });
8869
9071
  }
8870
- update(update, scrollTarget = null) {
9072
+ update(update) {
9073
+ let scrollTarget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
8871
9074
  this.state = update.state;
8872
9075
  let prevDeco = this.stateDeco;
8873
9076
  this.stateDeco = this.state.facet(decorations).filter(d => typeof d != "function");
@@ -8894,8 +9097,9 @@ class ViewState {
8894
9097
  let whiteSpace = style.whiteSpace;
8895
9098
  this.defaultTextDirection = style.direction == "rtl" ? Direction.RTL : Direction.LTR;
8896
9099
  let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace);
8897
- let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != dom.clientHeight;
8898
- this.contentDOMHeight = dom.clientHeight;
9100
+ let domRect = dom.getBoundingClientRect();
9101
+ let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
9102
+ this.contentDOMHeight = domRect.height;
8899
9103
  this.mustMeasureContent = false;
8900
9104
  let result = 0,
8901
9105
  bias = 0;
@@ -8924,9 +9128,9 @@ class ViewState {
8924
9128
  if (inView) measureContent = true;
8925
9129
  }
8926
9130
  if (!this.inView && !this.scrollTarget) return 0;
8927
- let contentWidth = dom.clientWidth;
9131
+ let contentWidth = domRect.width;
8928
9132
  if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
8929
- this.contentDOMWidth = contentWidth;
9133
+ this.contentDOMWidth = domRect.width;
8930
9134
  this.editorHeight = view.scrollDOM.clientHeight;
8931
9135
  result |= 8 /* UpdateFlag.Geometry */;
8932
9136
  }
@@ -8937,9 +9141,10 @@ class ViewState {
8937
9141
  if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) {
8938
9142
  let {
8939
9143
  lineHeight,
8940
- charWidth
9144
+ charWidth,
9145
+ textHeight
8941
9146
  } = view.docView.measureTextSize();
8942
- refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, contentWidth / charWidth, lineHeights);
9147
+ refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);
8943
9148
  if (refresh) {
8944
9149
  view.docView.minWidth = 0;
8945
9150
  result |= 8 /* UpdateFlag.Geometry */;
@@ -8983,12 +9188,12 @@ class ViewState {
8983
9188
  // since the last update). It'll hold a number between 0 and 1
8984
9189
  let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1000 /* VP.Margin */ / 2));
8985
9190
  let map = this.heightMap,
8986
- doc = this.state.doc,
8987
- {
8988
- visibleTop,
8989
- visibleBottom
8990
- } = this;
8991
- let viewport = new Viewport(map.lineAt(visibleTop - marginTop * 1000 /* VP.Margin */, QueryType.ByHeight, doc, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1000 /* VP.Margin */, QueryType.ByHeight, doc, 0, 0).to);
9191
+ oracle = this.heightOracle;
9192
+ let {
9193
+ visibleTop,
9194
+ visibleBottom
9195
+ } = this;
9196
+ let viewport = new Viewport(map.lineAt(visibleTop - marginTop * 1000 /* VP.Margin */, QueryType.ByHeight, oracle, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1000 /* VP.Margin */, QueryType.ByHeight, oracle, 0, 0).to);
8992
9197
  // If scrollTarget is given, make sure the viewport includes that position
8993
9198
  if (scrollTarget) {
8994
9199
  let {
@@ -8996,10 +9201,10 @@ class ViewState {
8996
9201
  } = scrollTarget.range;
8997
9202
  if (head < viewport.from || head > viewport.to) {
8998
9203
  let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);
8999
- let block = map.lineAt(head, QueryType.ByPos, doc, 0, 0),
9204
+ let block = map.lineAt(head, QueryType.ByPos, oracle, 0, 0),
9000
9205
  topPos;
9001
9206
  if (scrollTarget.y == "center") topPos = (block.top + block.bottom) / 2 - viewHeight / 2;else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from) topPos = block.top;else topPos = block.bottom - viewHeight;
9002
- viewport = new Viewport(map.lineAt(topPos - 1000 /* VP.Margin */ / 2, QueryType.ByHeight, doc, 0, 0).from, map.lineAt(topPos + viewHeight + 1000 /* VP.Margin */ / 2, QueryType.ByHeight, doc, 0, 0).to);
9207
+ viewport = new Viewport(map.lineAt(topPos - 1000 /* VP.Margin */ / 2, QueryType.ByHeight, oracle, 0, 0).from, map.lineAt(topPos + viewHeight + 1000 /* VP.Margin */ / 2, QueryType.ByHeight, oracle, 0, 0).to);
9003
9208
  }
9004
9209
  }
9005
9210
  return viewport;
@@ -9007,21 +9212,23 @@ class ViewState {
9007
9212
  mapViewport(viewport, changes) {
9008
9213
  let from = changes.mapPos(viewport.from, -1),
9009
9214
  to = changes.mapPos(viewport.to, 1);
9010
- return new Viewport(this.heightMap.lineAt(from, QueryType.ByPos, this.state.doc, 0, 0).from, this.heightMap.lineAt(to, QueryType.ByPos, this.state.doc, 0, 0).to);
9215
+ return new Viewport(this.heightMap.lineAt(from, QueryType.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(to, QueryType.ByPos, this.heightOracle, 0, 0).to);
9011
9216
  }
9012
9217
  // Checks if a given viewport covers the visible part of the
9013
9218
  // document and not too much beyond that.
9014
- viewportIsAppropriate({
9015
- from,
9016
- to
9017
- }, bias = 0) {
9219
+ viewportIsAppropriate(_ref3) {
9220
+ let {
9221
+ from,
9222
+ to
9223
+ } = _ref3;
9224
+ let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
9018
9225
  if (!this.inView) return true;
9019
9226
  let {
9020
9227
  top
9021
- } = this.heightMap.lineAt(from, QueryType.ByPos, this.state.doc, 0, 0);
9228
+ } = this.heightMap.lineAt(from, QueryType.ByPos, this.heightOracle, 0, 0);
9022
9229
  let {
9023
9230
  bottom
9024
- } = this.heightMap.lineAt(to, QueryType.ByPos, this.state.doc, 0, 0);
9231
+ } = this.heightMap.lineAt(to, QueryType.ByPos, this.heightOracle, 0, 0);
9025
9232
  let {
9026
9233
  visibleTop,
9027
9234
  visibleBottom
@@ -9146,13 +9353,13 @@ class ViewState {
9146
9353
  return changed ? 4 /* UpdateFlag.Viewport */ : 0;
9147
9354
  }
9148
9355
  lineBlockAt(pos) {
9149
- return pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find(b => b.from <= pos && b.to >= pos) || scaleBlock(this.heightMap.lineAt(pos, QueryType.ByPos, this.state.doc, 0, 0), this.scaler);
9356
+ return pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find(b => b.from <= pos && b.to >= pos) || scaleBlock(this.heightMap.lineAt(pos, QueryType.ByPos, this.heightOracle, 0, 0), this.scaler);
9150
9357
  }
9151
9358
  lineBlockAtHeight(height) {
9152
- return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType.ByHeight, this.state.doc, 0, 0), this.scaler);
9359
+ return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType.ByHeight, this.heightOracle, 0, 0), this.scaler);
9153
9360
  }
9154
9361
  elementAtHeight(height) {
9155
- return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.state.doc, 0, 0), this.scaler);
9362
+ return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.heightOracle, 0, 0), this.scaler);
9156
9363
  }
9157
9364
  get docHeight() {
9158
9365
  return this.scaler.toDOM(this.heightMap.height);
@@ -9196,10 +9403,11 @@ function lineStructure(from, to, stateDeco) {
9196
9403
  ranges
9197
9404
  };
9198
9405
  }
9199
- function findPosition({
9200
- total,
9201
- ranges
9202
- }, ratio) {
9406
+ function findPosition(_ref4, ratio) {
9407
+ let {
9408
+ total,
9409
+ ranges
9410
+ } = _ref4;
9203
9411
  if (ratio <= 0) return ranges[0].from;
9204
9412
  if (ratio >= 1) return ranges[ranges.length - 1].to;
9205
9413
  let dist = Math.floor(total * ratio);
@@ -9246,16 +9454,17 @@ const IdScaler = {
9246
9454
  // regions outside the viewports so that the total height is
9247
9455
  // VP.MaxDOMHeight.
9248
9456
  class BigScaler {
9249
- constructor(doc, heightMap, viewports) {
9457
+ constructor(oracle, heightMap, viewports) {
9250
9458
  let vpHeight = 0,
9251
9459
  base = 0,
9252
9460
  domBase = 0;
9253
- this.viewports = viewports.map(({
9254
- from,
9255
- to
9256
- }) => {
9257
- let top = heightMap.lineAt(from, QueryType.ByPos, doc, 0, 0).top;
9258
- let bottom = heightMap.lineAt(to, QueryType.ByPos, doc, 0, 0).bottom;
9461
+ this.viewports = viewports.map(_ref5 => {
9462
+ let {
9463
+ from,
9464
+ to
9465
+ } = _ref5;
9466
+ let top = heightMap.lineAt(from, QueryType.ByPos, oracle, 0, 0).top;
9467
+ let bottom = heightMap.lineAt(to, QueryType.ByPos, oracle, 0, 0).bottom;
9259
9468
  vpHeight += bottom - top;
9260
9469
  return {
9261
9470
  from,
@@ -9382,6 +9591,9 @@ const baseTheme$1$1 = /*@__PURE__*/buildTheme("." + baseThemeID, {
9382
9591
  padding: "0 2px 0 6px"
9383
9592
  },
9384
9593
  ".cm-layer": {
9594
+ position: "absolute",
9595
+ left: 0,
9596
+ top: 0,
9385
9597
  contain: "size style",
9386
9598
  "& > *": {
9387
9599
  position: "absolute"
@@ -9433,6 +9645,9 @@ const baseTheme$1$1 = /*@__PURE__*/buildTheme("." + baseThemeID, {
9433
9645
  "&dark .cm-cursor": {
9434
9646
  borderLeftColor: "#444"
9435
9647
  },
9648
+ ".cm-dropCursor": {
9649
+ position: "absolute"
9650
+ },
9436
9651
  "&.cm-focused .cm-cursor": {
9437
9652
  display: "block"
9438
9653
  },
@@ -9651,7 +9866,7 @@ function applyDOMChange(view, domChange) {
9651
9866
  to: sel.to,
9652
9867
  insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))
9653
9868
  };
9654
- } else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString())) {
9869
+ } else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute("autocorrect") == "off") {
9655
9870
  // Detect insert-period-on-double-space Mac and Android behavior,
9656
9871
  // and transform it into a regular space insert.
9657
9872
  if (newSel && change.insert.length == 2) newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
@@ -10125,7 +10340,8 @@ class DOMObserver {
10125
10340
  return new DOMChange(this.view, from, to, typeOver);
10126
10341
  }
10127
10342
  // Apply pending changes, if any
10128
- flush(readSelection = true) {
10343
+ flush() {
10344
+ let readSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
10129
10345
  // Completely hold off flushing when pending keys are set—the code
10130
10346
  // managing those will make sure processRecords is called and the
10131
10347
  // view is resynchronized after
@@ -10264,7 +10480,8 @@ class EditorView {
10264
10480
  option, or put `view.dom` into your document after creating a
10265
10481
  view, so that the user can see the editor.
10266
10482
  */
10267
- constructor(config = {}) {
10483
+ constructor() {
10484
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10268
10485
  this.plugins = [];
10269
10486
  this.pluginMap = new Map();
10270
10487
  this.editorAttrs = {};
@@ -10373,8 +10590,8 @@ class EditorView {
10373
10590
  get win() {
10374
10591
  return this.dom.ownerDocument.defaultView || window;
10375
10592
  }
10376
- dispatch(...input) {
10377
- this._dispatch(input.length == 1 && input[0] instanceof Transaction ? input[0] : this.state.update(...input));
10593
+ dispatch() {
10594
+ this._dispatch(arguments.length == 1 && (arguments.length <= 0 ? undefined : arguments[0]) instanceof Transaction ? arguments.length <= 0 ? undefined : arguments[0] : this.state.update(...arguments));
10378
10595
  }
10379
10596
  /**
10380
10597
  Update the view for the given array of transactions. This will
@@ -10398,6 +10615,20 @@ class EditorView {
10398
10615
  this.viewState.state = state;
10399
10616
  return;
10400
10617
  }
10618
+ let focus = this.hasFocus,
10619
+ focusFlag = 0,
10620
+ dispatchFocus = null;
10621
+ if (transactions.some(tr => tr.annotation(isFocusChange))) {
10622
+ this.inputState.notifiedFocused = focus;
10623
+ // If a focus-change transaction is being dispatched, set this update flag.
10624
+ focusFlag = 1 /* UpdateFlag.Focus */;
10625
+ } else if (focus != this.inputState.notifiedFocused) {
10626
+ this.inputState.notifiedFocused = focus;
10627
+ // Schedule a separate focus transaction if necessary, otherwise
10628
+ // add a flag to this update
10629
+ dispatchFocus = focusChangeTransaction(state, focus);
10630
+ if (!dispatchFocus) focusFlag = 1 /* UpdateFlag.Focus */;
10631
+ }
10401
10632
  // If there was a pending DOM change, eagerly read it and try to
10402
10633
  // apply it after the given transactions.
10403
10634
  let pendingKey = this.observer.delayedAndroidKey,
@@ -10414,6 +10645,7 @@ class EditorView {
10414
10645
  // When the phrases change, redraw the editor
10415
10646
  if (state.facet(EditorState.phrases) != this.state.facet(EditorState.phrases)) return this.setState(state);
10416
10647
  update = ViewUpdate.create(this, state, transactions);
10648
+ update.flags |= focusFlag;
10417
10649
  let scrollTarget = this.viewState.scrollTarget;
10418
10650
  try {
10419
10651
  this.updateState = 2 /* UpdateState.Updating */;
@@ -10445,9 +10677,12 @@ class EditorView {
10445
10677
  if (update.startState.facet(theme) != update.state.facet(theme)) this.viewState.mustMeasureContent = true;
10446
10678
  if (redrawn || attrsChanged || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) this.requestMeasure();
10447
10679
  if (!update.empty) for (let listener of this.state.facet(updateListener)) listener(update);
10448
- if (domChange) {
10449
- if (!applyDOMChange(this, domChange) && pendingKey.force) dispatchKey(this.contentDOM, pendingKey.key, pendingKey.keyCode);
10450
- }
10680
+ if (dispatchFocus || domChange) Promise.resolve().then(() => {
10681
+ if (dispatchFocus && this.state == dispatchFocus.startState) this.dispatch(dispatchFocus);
10682
+ if (domChange) {
10683
+ if (!applyDOMChange(this, domChange) && pendingKey.force) dispatchKey(this.contentDOM, pendingKey.key, pendingKey.keyCode);
10684
+ }
10685
+ });
10451
10686
  }
10452
10687
  /**
10453
10688
  Reset the view to the given state. (This will cause the entire
@@ -10509,9 +10744,10 @@ class EditorView {
10509
10744
  /**
10510
10745
  @internal
10511
10746
  */
10512
- measure(flush = true) {
10747
+ measure() {
10748
+ let flush = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
10513
10749
  if (this.destroyed) return;
10514
- if (this.measureScheduled > -1) cancelAnimationFrame(this.measureScheduled);
10750
+ if (this.measureScheduled > -1) this.win.cancelAnimationFrame(this.measureScheduled);
10515
10751
  this.measureScheduled = 0; // Prevent requestMeasure calls from scheduling another animation frame
10516
10752
  if (flush) this.observer.forceFlush();
10517
10753
  let updated = null;
@@ -10762,7 +10998,8 @@ class EditorView {
10762
10998
  returned. Otherwise this function will return the start or end
10763
10999
  of the line.
10764
11000
  */
10765
- moveToLineBoundary(start, forward, includeWrap = true) {
11001
+ moveToLineBoundary(start, forward) {
11002
+ let includeWrap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
10766
11003
  return moveToLineBoundary(this, start, forward, includeWrap);
10767
11004
  }
10768
11005
  /**
@@ -10799,10 +11036,12 @@ class EditorView {
10799
11036
  for associating positions with DOM events. Will raise an error
10800
11037
  when `node` isn't part of the editor content.
10801
11038
  */
10802
- posAtDOM(node, offset = 0) {
11039
+ posAtDOM(node) {
11040
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
10803
11041
  return this.docView.posFromDOM(node, offset);
10804
11042
  }
10805
- posAtCoords(coords, precise = true) {
11043
+ posAtCoords(coords) {
11044
+ let precise = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
10806
11045
  this.readMeasured();
10807
11046
  return posAtCoords(this, coords, precise);
10808
11047
  }
@@ -10813,7 +11052,8 @@ class EditorView {
10813
11052
  available on the given side, the method will transparently use
10814
11053
  another strategy to get reasonable coordinates).
10815
11054
  */
10816
- coordsAtPos(pos, side = 1) {
11055
+ coordsAtPos(pos) {
11056
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
10817
11057
  this.readMeasured();
10818
11058
  let rect = this.docView.coordsAt(pos, side);
10819
11059
  if (!rect || rect.left == rect.right) return rect;
@@ -10928,7 +11168,7 @@ class EditorView {
10928
11168
  this.inputState.destroy();
10929
11169
  this.dom.remove();
10930
11170
  this.observer.destroy();
10931
- if (this.measureScheduled > -1) cancelAnimationFrame(this.measureScheduled);
11171
+ if (this.measureScheduled > -1) this.win.cancelAnimationFrame(this.measureScheduled);
10932
11172
  this.destroyed = true;
10933
11173
  }
10934
11174
  /**
@@ -10936,7 +11176,8 @@ class EditorView {
10936
11176
  [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to
10937
11177
  cause it to scroll the given position or range into view.
10938
11178
  */
10939
- static scrollIntoView(pos, options = {}) {
11179
+ static scrollIntoView(pos) {
11180
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10940
11181
  return scrollIntoView.of(new ScrollTarget(typeof pos == "number" ? EditorSelection.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin));
10941
11182
  }
10942
11183
  /**
@@ -11018,6 +11259,11 @@ called and the default behavior is prevented.
11018
11259
  */
11019
11260
  EditorView.inputHandler = inputHandler;
11020
11261
  /**
11262
+ This facet can be used to provide functions that create effects
11263
+ to be dispatched when the editor's focus state changes.
11264
+ */
11265
+ EditorView.focusChangeEffect = focusChangeEffect;
11266
+ /**
11021
11267
  By default, the editor assumes all its content has the same
11022
11268
  [text direction](https://codemirror.net/6/docs/ref/#view.Direction). Configure this with a `true`
11023
11269
  value to make it read the text direction of every (rendered)
@@ -11226,7 +11472,8 @@ function runScopeHandlers(view, event, scope) {
11226
11472
  }
11227
11473
  let storedPrefix = null;
11228
11474
  const PrefixTimeout = 4000;
11229
- function buildKeymap(bindings, platform = currentPlatform) {
11475
+ function buildKeymap(bindings) {
11476
+ let platform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : currentPlatform;
11230
11477
  let bound = Object.create(null);
11231
11478
  let isPrefix = Object.create(null);
11232
11479
  let checkPrefix = (name, is) => {
@@ -11406,9 +11653,10 @@ function rectanglesForRange(view, className, range) {
11406
11653
  let content = view.contentDOM,
11407
11654
  contentRect = content.getBoundingClientRect(),
11408
11655
  base = getBase(view);
11409
- let lineStyle = window.getComputedStyle(content.firstChild);
11410
- let leftSide = contentRect.left + parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent));
11411
- let rightSide = contentRect.right - parseInt(lineStyle.paddingRight);
11656
+ let lineElt = content.querySelector(".cm-line"),
11657
+ lineStyle = lineElt && window.getComputedStyle(lineElt);
11658
+ let leftSide = contentRect.left + (lineStyle ? parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)) : 0);
11659
+ let rightSide = contentRect.right - (lineStyle ? parseInt(lineStyle.paddingRight) : 0);
11412
11660
  let startBlock = blockAt(view, from),
11413
11661
  endBlock = blockAt(view, to);
11414
11662
  let visualStart = startBlock.type == BlockType.Text ? startBlock : null;
@@ -11430,11 +11678,12 @@ function rectanglesForRange(view, className, range) {
11430
11678
  return new RectangleMarker(className, left - base.left, top - base.top - 0.01 /* C.Epsilon */, right - left, bottom - top + 0.01 /* C.Epsilon */);
11431
11679
  }
11432
11680
 
11433
- function pieces({
11434
- top,
11435
- bottom,
11436
- horizontal
11437
- }) {
11681
+ function pieces(_ref6) {
11682
+ let {
11683
+ top,
11684
+ bottom,
11685
+ horizontal
11686
+ } = _ref6;
11438
11687
  let pieces = [];
11439
11688
  for (let i = 0; i < horizontal.length; i += 2) pieces.push(piece(horizontal[i], top, horizontal[i + 1], bottom));
11440
11689
  return pieces;
@@ -11583,7 +11832,8 @@ layout cycle for many updates (the selection is drawn based on DOM
11583
11832
  layout information that's only available after laying out the
11584
11833
  content).
11585
11834
  */
11586
- function drawSelection(config = {}) {
11835
+ function drawSelection() {
11836
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11587
11837
  return [selectionConfig.of(config), cursorLayer, selectionLayer, hideNativeSelection, nativeSelectionHidden.of(true)];
11588
11838
  }
11589
11839
  function configChanged(update) {
@@ -11917,11 +12167,8 @@ const specialCharConfig = /*@__PURE__*/Facet.define({
11917
12167
  Returns an extension that installs highlighting of special
11918
12168
  characters.
11919
12169
  */
11920
- function highlightSpecialChars(
11921
- /**
11922
- Configuration options.
11923
- */
11924
- config = {}) {
12170
+ function highlightSpecialChars() {
12171
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11925
12172
  return [specialCharConfig.of(config), specialCharPlugin()];
11926
12173
  }
11927
12174
  let _plugin = null;
@@ -12157,7 +12404,8 @@ down. Can serve as a visual hint that rectangular selection is
12157
12404
  going to happen when paired with
12158
12405
  [`rectangularSelection`](https://codemirror.net/6/docs/ref/#view.rectangularSelection).
12159
12406
  */
12160
- function crosshairCursor(options = {}) {
12407
+ function crosshairCursor() {
12408
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12161
12409
  let [code, getter] = keys[options.key || "Alt"];
12162
12410
  let plugin = ViewPlugin.fromClass(class {
12163
12411
  constructor(view) {
@@ -12252,6 +12500,7 @@ const tooltipConfig = /*@__PURE__*/Facet.define({
12252
12500
  };
12253
12501
  }
12254
12502
  });
12503
+ const knownHeight = /*@__PURE__*/new WeakMap();
12255
12504
  const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
12256
12505
  constructor(view) {
12257
12506
  this.view = view;
@@ -12355,13 +12604,17 @@ const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
12355
12604
  let tv = this.manager.tooltipViews[i];
12356
12605
  return tv.getCoords ? tv.getCoords(t.pos) : this.view.coordsAtPos(t.pos);
12357
12606
  }),
12358
- size: this.manager.tooltipViews.map(({
12359
- dom
12360
- }) => dom.getBoundingClientRect()),
12607
+ size: this.manager.tooltipViews.map(_ref7 => {
12608
+ let {
12609
+ dom
12610
+ } = _ref7;
12611
+ return dom.getBoundingClientRect();
12612
+ }),
12361
12613
  space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view)
12362
12614
  };
12363
12615
  }
12364
12616
  writeMeasure(measured) {
12617
+ var _a;
12365
12618
  let {
12366
12619
  editor,
12367
12620
  space
@@ -12383,7 +12636,7 @@ const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
12383
12636
  let arrow = tooltip.arrow ? tView.dom.querySelector(".cm-tooltip-arrow") : null;
12384
12637
  let arrowHeight = arrow ? 7 /* Arrow.Size */ : 0;
12385
12638
  let width = size.right - size.left,
12386
- height = size.bottom - size.top;
12639
+ height = (_a = knownHeight.get(tView)) !== null && _a !== void 0 ? _a : size.bottom - size.top;
12387
12640
  let offset = tView.offset || noOffset,
12388
12641
  ltr = this.view.textDirection == Direction.LTR;
12389
12642
  let left = size.width > space.right - space.left ? ltr ? space.left : space.right - size.width : ltr ? Math.min(pos.left - (arrow ? 14 /* Arrow.Offset */ : 0) + offset.x, space.right - width) : Math.max(space.left, pos.left - width + (arrow ? 14 /* Arrow.Offset */ : 0) - offset.x);
@@ -12395,6 +12648,7 @@ const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
12395
12648
  dom.style.top = Outside;
12396
12649
  continue;
12397
12650
  }
12651
+ knownHeight.set(tView, height);
12398
12652
  dom.style.height = (height = spaceVert) + "px";
12399
12653
  } else if (dom.style.height) {
12400
12654
  dom.style.height = "";
@@ -12689,7 +12943,8 @@ Note that all hover tooltips are hosted within a single tooltip
12689
12943
  container element. This allows multiple tooltips over the same
12690
12944
  range to be "merged" together without overlapping.
12691
12945
  */
12692
- function hoverTooltip(source, options = {}) {
12946
+ function hoverTooltip(source) {
12947
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12693
12948
  let setHover = StateEffect.define();
12694
12949
  let hoverState = StateField.define({
12695
12950
  create() {
@@ -13269,7 +13524,8 @@ const lineNumberGutter = /*@__PURE__*/activeGutters.compute([lineNumberConfig],
13269
13524
  /**
13270
13525
  Create a line number gutter extension.
13271
13526
  */
13272
- function lineNumbers(config = {}) {
13527
+ function lineNumbers() {
13528
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13273
13529
  return [lineNumberConfig.of(config), gutters(), lineNumberGutter];
13274
13530
  }
13275
13531
  function maxLineNumber(lines) {
@@ -13320,7 +13576,8 @@ class Range {
13320
13576
  /// class represent prop names.
13321
13577
  class NodeProp {
13322
13578
  /// Create a new node prop type.
13323
- constructor(config = {}) {
13579
+ constructor() {
13580
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13324
13581
  this.id = nextPropID++;
13325
13582
  this.perNode = !!config.perNode;
13326
13583
  this.deserialize = config.deserialize || (() => {
@@ -13417,9 +13674,8 @@ class NodeType {
13417
13674
  props,
13418
13675
  /// The id of this node in its set. Corresponds to the term ids
13419
13676
  /// used in the parser.
13420
- id,
13421
- /// @internal
13422
- flags = 0) {
13677
+ id) {
13678
+ let flags = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
13423
13679
  this.name = name;
13424
13680
  this.props = props;
13425
13681
  this.id = id;
@@ -13509,8 +13765,11 @@ class NodeSet {
13509
13765
  /// Create a copy of this set with some node properties added. The
13510
13766
  /// arguments to this method can be created with
13511
13767
  /// [`NodeProp.add`](#common.NodeProp.add).
13512
- extend(...props) {
13768
+ extend() {
13513
13769
  let newTypes = [];
13770
+ for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) {
13771
+ props[_key] = arguments[_key];
13772
+ }
13514
13773
  for (let type of this.types) {
13515
13774
  let newProps = null;
13516
13775
  for (let source of props) {
@@ -13605,13 +13864,15 @@ class Tree {
13605
13864
  /// Get a [tree cursor](#common.TreeCursor) positioned at the top of
13606
13865
  /// the tree. Mode can be used to [control](#common.IterMode) which
13607
13866
  /// nodes the cursor visits.
13608
- cursor(mode = 0) {
13867
+ cursor() {
13868
+ let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
13609
13869
  return new TreeCursor(this.topNode, mode);
13610
13870
  }
13611
13871
  /// Get a [tree cursor](#common.TreeCursor) pointing into this tree
13612
13872
  /// at the given position and side (see
13613
13873
  /// [`moveTo`](#common.TreeCursor.moveTo).
13614
- cursorAt(pos, side = 0, mode = 0) {
13874
+ cursorAt(pos) {
13875
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
13615
13876
  let scope = CachedNode.get(this) || this.topNode;
13616
13877
  let cursor = new TreeCursor(scope);
13617
13878
  cursor.moveTo(pos, side);
@@ -13632,7 +13893,8 @@ class Tree {
13632
13893
  /// Note that this will not enter
13633
13894
  /// [overlays](#common.MountedTree.overlay), and you often want
13634
13895
  /// [`resolveInner`](#common.Tree.resolveInner) instead.
13635
- resolve(pos, side = 0) {
13896
+ resolve(pos) {
13897
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
13636
13898
  let node = resolveNode(CachedNode.get(this) || this.topNode, pos, side, false);
13637
13899
  CachedNode.set(this, node);
13638
13900
  return node;
@@ -13642,7 +13904,8 @@ class Tree {
13642
13904
  /// pointing into the innermost overlaid tree at the given position
13643
13905
  /// (with parent links going through all parent structure, including
13644
13906
  /// the host trees).
13645
- resolveInner(pos, side = 0) {
13907
+ resolveInner(pos) {
13908
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
13646
13909
  let node = resolveNode(CachedInnerNode.get(this) || this.topNode, pos, side, true);
13647
13910
  CachedInnerNode.set(this, node);
13648
13911
  return node;
@@ -13689,7 +13952,8 @@ class Tree {
13689
13952
  /// Balance the direct children of this tree, producing a copy of
13690
13953
  /// which may have children grouped into subtrees with type
13691
13954
  /// [`NodeType.none`](#common.NodeType^none).
13692
- balance(config = {}) {
13955
+ balance() {
13956
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13693
13957
  return this.children.length <= 8 /* Balance.BranchFactor */ ? this : balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree(this.type, children, positions, length, this.propValues), config.makeTree || ((children, positions, length) => new Tree(NodeType.none, children, positions, length)));
13694
13958
  }
13695
13959
  /// Build a tree from a postfix-ordered buffer of node information,
@@ -13869,7 +14133,8 @@ class TreeNode {
13869
14133
  get to() {
13870
14134
  return this.from + this._tree.length;
13871
14135
  }
13872
- nextChild(i, dir, pos, side, mode = 0) {
14136
+ nextChild(i, dir, pos, side) {
14137
+ let mode = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
13873
14138
  for (let parent = this;;) {
13874
14139
  for (let {
13875
14140
  children,
@@ -13907,7 +14172,8 @@ class TreeNode {
13907
14172
  childBefore(pos) {
13908
14173
  return this.nextChild(this._tree.children.length - 1, -1, pos, -2 /* Side.Before */);
13909
14174
  }
13910
- enter(pos, side, mode = 0) {
14175
+ enter(pos, side) {
14176
+ let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
13911
14177
  let mounted;
13912
14178
  if (!(mode & IterMode.IgnoreOverlays) && (mounted = this._tree.prop(NodeProp.mounted)) && mounted.overlay) {
13913
14179
  let rPos = pos - this.from;
@@ -13934,7 +14200,8 @@ class TreeNode {
13934
14200
  get prevSibling() {
13935
14201
  return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4 /* Side.DontCare */) : null;
13936
14202
  }
13937
- cursor(mode = 0) {
14203
+ cursor() {
14204
+ let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
13938
14205
  return new TreeCursor(this, mode);
13939
14206
  }
13940
14207
  get tree() {
@@ -13943,20 +14210,26 @@ class TreeNode {
13943
14210
  toTree() {
13944
14211
  return this._tree;
13945
14212
  }
13946
- resolve(pos, side = 0) {
14213
+ resolve(pos) {
14214
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
13947
14215
  return resolveNode(this, pos, side, false);
13948
14216
  }
13949
- resolveInner(pos, side = 0) {
14217
+ resolveInner(pos) {
14218
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
13950
14219
  return resolveNode(this, pos, side, true);
13951
14220
  }
13952
14221
  enterUnfinishedNodesBefore(pos) {
13953
14222
  return enterUnfinishedNodesBefore(this, pos);
13954
14223
  }
13955
- getChild(type, before = null, after = null) {
14224
+ getChild(type) {
14225
+ let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
14226
+ let after = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
13956
14227
  let r = getChildren(this, type, before, after);
13957
14228
  return r.length ? r[0] : null;
13958
14229
  }
13959
- getChildren(type, before = null, after = null) {
14230
+ getChildren(type) {
14231
+ let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
14232
+ let after = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
13960
14233
  return getChildren(this, type, before, after);
13961
14234
  }
13962
14235
  /// @internal
@@ -13981,7 +14254,8 @@ function getChildren(node, type, before, after) {
13981
14254
  if (!cur.nextSibling()) return after == null ? result : [];
13982
14255
  }
13983
14256
  }
13984
- function matchNodeContext(node, context, i = context.length - 1) {
14257
+ function matchNodeContext(node, context) {
14258
+ let i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : context.length - 1;
13985
14259
  for (let p = node.parent; i >= 0; p = p.parent) {
13986
14260
  if (!p) return false;
13987
14261
  if (!p.type.isAnonymous) {
@@ -14034,7 +14308,8 @@ class BufferNode {
14034
14308
  childBefore(pos) {
14035
14309
  return this.child(-1, pos, -2 /* Side.Before */);
14036
14310
  }
14037
- enter(pos, side, mode = 0) {
14311
+ enter(pos, side) {
14312
+ let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
14038
14313
  if (mode & IterMode.ExcludeBuffers) return null;
14039
14314
  let {
14040
14315
  buffer
@@ -14066,7 +14341,8 @@ class BufferNode {
14066
14341
  return new BufferNode(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4 /* Side.DontCare */));
14067
14342
  }
14068
14343
 
14069
- cursor(mode = 0) {
14344
+ cursor() {
14345
+ let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
14070
14346
  return new TreeCursor(this, mode);
14071
14347
  }
14072
14348
  get tree() {
@@ -14087,10 +14363,12 @@ class BufferNode {
14087
14363
  }
14088
14364
  return new Tree(this.type, children, positions, this.to - this.from);
14089
14365
  }
14090
- resolve(pos, side = 0) {
14366
+ resolve(pos) {
14367
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
14091
14368
  return resolveNode(this, pos, side, false);
14092
14369
  }
14093
- resolveInner(pos, side = 0) {
14370
+ resolveInner(pos) {
14371
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
14094
14372
  return resolveNode(this, pos, side, true);
14095
14373
  }
14096
14374
  enterUnfinishedNodesBefore(pos) {
@@ -14100,11 +14378,15 @@ class BufferNode {
14100
14378
  toString() {
14101
14379
  return this.context.buffer.childString(this.index);
14102
14380
  }
14103
- getChild(type, before = null, after = null) {
14381
+ getChild(type) {
14382
+ let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
14383
+ let after = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
14104
14384
  let r = getChildren(this, type, before, after);
14105
14385
  return r.length ? r[0] : null;
14106
14386
  }
14107
- getChildren(type, before = null, after = null) {
14387
+ getChildren(type) {
14388
+ let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
14389
+ let after = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
14108
14390
  return getChildren(this, type, before, after);
14109
14391
  }
14110
14392
  get node() {
@@ -14122,9 +14404,8 @@ class TreeCursor {
14122
14404
  return this.type.name;
14123
14405
  }
14124
14406
  /// @internal
14125
- constructor(node,
14126
- /// @internal
14127
- mode = 0) {
14407
+ constructor(node) {
14408
+ let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
14128
14409
  this.mode = mode;
14129
14410
  /// @internal
14130
14411
  this.buffer = null;
@@ -14207,7 +14488,8 @@ class TreeCursor {
14207
14488
  /// will also enter [overlaid](#common.MountedTree.overlay)
14208
14489
  /// [mounted](#common.NodeProp^mounted) trees unless `overlays` is
14209
14490
  /// set to false.
14210
- enter(pos, side, mode = this.mode) {
14491
+ enter(pos, side) {
14492
+ let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.mode;
14211
14493
  if (!this.buffer) return this.yield(this._tree.enter(pos, side, mode));
14212
14494
  return mode & IterMode.ExcludeBuffers ? false : this.enterChild(1, pos, side);
14213
14495
  }
@@ -14288,20 +14570,23 @@ class TreeCursor {
14288
14570
  /// traversal, going from a node to its first child or, if the
14289
14571
  /// current node is empty or `enter` is false, its next sibling or
14290
14572
  /// the next sibling of the first parent node that has one.
14291
- next(enter = true) {
14573
+ next() {
14574
+ let enter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
14292
14575
  return this.move(1, enter);
14293
14576
  }
14294
14577
  /// Move to the next node in a last-to-first pre-order traveral. A
14295
14578
  /// node is followed by its last child or, if it has none, its
14296
14579
  /// previous sibling or the previous sibling of the first parent
14297
14580
  /// node that has one.
14298
- prev(enter = true) {
14581
+ prev() {
14582
+ let enter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
14299
14583
  return this.move(-1, enter);
14300
14584
  }
14301
14585
  /// Move the cursor to the innermost node that covers `pos`. If
14302
14586
  /// `side` is -1, it will enter nodes that end at `pos`. If it is 1,
14303
14587
  /// it will enter nodes that start at `pos`.
14304
- moveTo(pos, side = 0) {
14588
+ moveTo(pos) {
14589
+ let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
14305
14590
  // Move up to a node that actually holds the position, if possible
14306
14591
  while (this.from == this.to || (side < 1 ? this.from >= pos : this.from > pos) || (side > -1 ? this.to <= pos : this.to < pos)) if (!this.parent()) break;
14307
14592
  // Then scan down into child nodes as far as possible
@@ -14493,7 +14778,9 @@ function buildTree(data) {
14493
14778
  children.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead - to));
14494
14779
  positions.push(from - base);
14495
14780
  }
14496
- function makeTree(type, children, positions, length, lookAhead = 0, props) {
14781
+ function makeTree(type, children, positions, length) {
14782
+ let lookAhead = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
14783
+ let props = arguments.length > 5 ? arguments[5] : undefined;
14497
14784
  if (contextHash) {
14498
14785
  let pair = [NodeProp.contextHash, contextHash];
14499
14786
  props = props ? [pair].concat(props) : [pair];
@@ -14715,7 +15002,9 @@ class TreeFragment {
14715
15002
  /// this fragment can be used against. Add this when going from
14716
15003
  /// document to tree positions, subtract it to go from tree to
14717
15004
  /// document positions.
14718
- offset, openStart = false, openEnd = false) {
15005
+ offset) {
15006
+ let openStart = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
15007
+ let openEnd = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
14719
15008
  this.from = from;
14720
15009
  this.to = to;
14721
15010
  this.tree = tree;
@@ -14740,7 +15029,9 @@ class TreeFragment {
14740
15029
  /// true, the parse is treated as incomplete, and the resulting
14741
15030
  /// fragment has [`openEnd`](#common.TreeFragment.openEnd) set to
14742
15031
  /// true.
14743
- static addTree(tree, fragments = [], partial = false) {
15032
+ static addTree(tree) {
15033
+ let fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
15034
+ let partial = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
14744
15035
  let result = [new TreeFragment(0, tree.length, tree, 0, false, partial)];
14745
15036
  for (let f of fragments) if (f.to > tree.length) result.push(f);
14746
15037
  return result;
@@ -14748,7 +15039,8 @@ class TreeFragment {
14748
15039
  /// Apply a set of edits to an array of fragments, removing or
14749
15040
  /// splitting fragments as necessary to remove edited ranges, and
14750
15041
  /// adjusting offsets for fragments that moved.
14751
- static applyChanges(fragments, changes, minGap = 128) {
15042
+ static applyChanges(fragments, changes) {
15043
+ let minGap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 128;
14752
15044
  if (!changes.length) return fragments;
14753
15045
  let result = [];
14754
15046
  let fI = 1,
@@ -15188,45 +15480,59 @@ function enterFragments(mounts, ranges) {
15188
15480
  }
15189
15481
 
15190
15482
  let nextTagID = 0;
15191
- /// Highlighting tags are markers that denote a highlighting category.
15192
- /// They are [associated](#highlight.styleTags) with parts of a syntax
15193
- /// tree by a language mode, and then mapped to an actual CSS style by
15194
- /// a [highlighter](#highlight.Highlighter).
15195
- ///
15196
- /// Because syntax tree node types and highlight styles have to be
15197
- /// able to talk the same language, CodeMirror uses a mostly _closed_
15198
- /// [vocabulary](#highlight.tags) of syntax tags (as opposed to
15199
- /// traditional open string-based systems, which make it hard for
15200
- /// highlighting themes to cover all the tokens produced by the
15201
- /// various languages).
15202
- ///
15203
- /// It _is_ possible to [define](#highlight.Tag^define) your own
15204
- /// highlighting tags for system-internal use (where you control both
15205
- /// the language package and the highlighter), but such tags will not
15206
- /// be picked up by regular highlighters (though you can derive them
15207
- /// from standard tags to allow highlighters to fall back to those).
15483
+ /**
15484
+ Highlighting tags are markers that denote a highlighting category.
15485
+ They are [associated](#highlight.styleTags) with parts of a syntax
15486
+ tree by a language mode, and then mapped to an actual CSS style by
15487
+ a [highlighter](#highlight.Highlighter).
15488
+
15489
+ Because syntax tree node types and highlight styles have to be
15490
+ able to talk the same language, CodeMirror uses a mostly _closed_
15491
+ [vocabulary](#highlight.tags) of syntax tags (as opposed to
15492
+ traditional open string-based systems, which make it hard for
15493
+ highlighting themes to cover all the tokens produced by the
15494
+ various languages).
15495
+
15496
+ It _is_ possible to [define](#highlight.Tag^define) your own
15497
+ highlighting tags for system-internal use (where you control both
15498
+ the language package and the highlighter), but such tags will not
15499
+ be picked up by regular highlighters (though you can derive them
15500
+ from standard tags to allow highlighters to fall back to those).
15501
+ */
15208
15502
  class Tag {
15209
- /// @internal
15503
+ /**
15504
+ @internal
15505
+ */
15210
15506
  constructor(
15211
- /// The set of this tag and all its parent tags, starting with
15212
- /// this one itself and sorted in order of decreasing specificity.
15507
+ /**
15508
+ The set of this tag and all its parent tags, starting with
15509
+ this one itself and sorted in order of decreasing specificity.
15510
+ */
15213
15511
  set,
15214
- /// The base unmodified tag that this one is based on, if it's
15215
- /// modified @internal
15512
+ /**
15513
+ The base unmodified tag that this one is based on, if it's
15514
+ modified @internal
15515
+ */
15216
15516
  base,
15217
- /// The modifiers applied to this.base @internal
15517
+ /**
15518
+ The modifiers applied to this.base @internal
15519
+ */
15218
15520
  modified) {
15219
15521
  this.set = set;
15220
15522
  this.base = base;
15221
15523
  this.modified = modified;
15222
- /// @internal
15524
+ /**
15525
+ @internal
15526
+ */
15223
15527
  this.id = nextTagID++;
15224
15528
  }
15225
- /// Define a new tag. If `parent` is given, the tag is treated as a
15226
- /// sub-tag of that parent, and
15227
- /// [highlighters](#highlight.tagHighlighter) that don't mention
15228
- /// this tag will try to fall back to the parent tag (or grandparent
15229
- /// tag, etc).
15529
+ /**
15530
+ Define a new tag. If `parent` is given, the tag is treated as a
15531
+ sub-tag of that parent, and
15532
+ [highlighters](#highlight.tagHighlighter) that don't mention
15533
+ this tag will try to fall back to the parent tag (or grandparent
15534
+ tag, etc).
15535
+ */
15230
15536
  static define(parent) {
15231
15537
  if (parent === null || parent === void 0 ? void 0 : parent.base) throw new Error("Can not derive from a modified tag");
15232
15538
  let tag = new Tag([], null, []);
@@ -15234,16 +15540,18 @@ class Tag {
15234
15540
  if (parent) for (let t of parent.set) tag.set.push(t);
15235
15541
  return tag;
15236
15542
  }
15237
- /// Define a tag _modifier_, which is a function that, given a tag,
15238
- /// will return a tag that is a subtag of the original. Applying the
15239
- /// same modifier to a twice tag will return the same value (`m1(t1)
15240
- /// == m1(t1)`) and applying multiple modifiers will, regardless or
15241
- /// order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
15242
- ///
15243
- /// When multiple modifiers are applied to a given base tag, each
15244
- /// smaller set of modifiers is registered as a parent, so that for
15245
- /// example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
15246
- /// `m1(m3(t1)`, and so on.
15543
+ /**
15544
+ Define a tag _modifier_, which is a function that, given a tag,
15545
+ will return a tag that is a subtag of the original. Applying the
15546
+ same modifier to a twice tag will return the same value (`m1(t1)
15547
+ == m1(t1)`) and applying multiple modifiers will, regardless or
15548
+ order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
15549
+
15550
+ When multiple modifiers are applied to a given base tag, each
15551
+ smaller set of modifiers is registered as a parent, so that for
15552
+ example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
15553
+ `m1(m3(t1)`, and so on.
15554
+ */
15247
15555
  static defineModifier() {
15248
15556
  let mod = new Modifier();
15249
15557
  return tag => {
@@ -15282,55 +15590,57 @@ function powerSet(array) {
15282
15590
  }
15283
15591
  return sets.sort((a, b) => b.length - a.length);
15284
15592
  }
15285
- /// This function is used to add a set of tags to a language syntax
15286
- /// via [`NodeSet.extend`](#common.NodeSet.extend) or
15287
- /// [`LRParser.configure`](#lr.LRParser.configure).
15288
- ///
15289
- /// The argument object maps node selectors to [highlighting
15290
- /// tags](#highlight.Tag) or arrays of tags.
15291
- ///
15292
- /// Node selectors may hold one or more (space-separated) node paths.
15293
- /// Such a path can be a [node name](#common.NodeType.name), or
15294
- /// multiple node names (or `*` wildcards) separated by slash
15295
- /// characters, as in `"Block/Declaration/VariableName"`. Such a path
15296
- /// matches the final node but only if its direct parent nodes are the
15297
- /// other nodes mentioned. A `*` in such a path matches any parent,
15298
- /// but only a single level—wildcards that match multiple parents
15299
- /// aren't supported, both for efficiency reasons and because Lezer
15300
- /// trees make it rather hard to reason about what they would match.)
15301
- ///
15302
- /// A path can be ended with `/...` to indicate that the tag assigned
15303
- /// to the node should also apply to all child nodes, even if they
15304
- /// match their own style (by default, only the innermost style is
15305
- /// used).
15306
- ///
15307
- /// When a path ends in `!`, as in `Attribute!`, no further matching
15308
- /// happens for the node's child nodes, and the entire node gets the
15309
- /// given style.
15310
- ///
15311
- /// In this notation, node names that contain `/`, `!`, `*`, or `...`
15312
- /// must be quoted as JSON strings.
15313
- ///
15314
- /// For example:
15315
- ///
15316
- /// ```javascript
15317
- /// parser.withProps(
15318
- /// styleTags({
15319
- /// // Style Number and BigNumber nodes
15320
- /// "Number BigNumber": tags.number,
15321
- /// // Style Escape nodes whose parent is String
15322
- /// "String/Escape": tags.escape,
15323
- /// // Style anything inside Attributes nodes
15324
- /// "Attributes!": tags.meta,
15325
- /// // Add a style to all content inside Italic nodes
15326
- /// "Italic/...": tags.emphasis,
15327
- /// // Style InvalidString nodes as both `string` and `invalid`
15328
- /// "InvalidString": [tags.string, tags.invalid],
15329
- /// // Style the node named "/" as punctuation
15330
- /// '"/"': tags.punctuation
15331
- /// })
15332
- /// )
15333
- /// ```
15593
+ /**
15594
+ This function is used to add a set of tags to a language syntax
15595
+ via [`NodeSet.extend`](#common.NodeSet.extend) or
15596
+ [`LRParser.configure`](#lr.LRParser.configure).
15597
+
15598
+ The argument object maps node selectors to [highlighting
15599
+ tags](#highlight.Tag) or arrays of tags.
15600
+
15601
+ Node selectors may hold one or more (space-separated) node paths.
15602
+ Such a path can be a [node name](#common.NodeType.name), or
15603
+ multiple node names (or `*` wildcards) separated by slash
15604
+ characters, as in `"Block/Declaration/VariableName"`. Such a path
15605
+ matches the final node but only if its direct parent nodes are the
15606
+ other nodes mentioned. A `*` in such a path matches any parent,
15607
+ but only a single level—wildcards that match multiple parents
15608
+ aren't supported, both for efficiency reasons and because Lezer
15609
+ trees make it rather hard to reason about what they would match.)
15610
+
15611
+ A path can be ended with `/...` to indicate that the tag assigned
15612
+ to the node should also apply to all child nodes, even if they
15613
+ match their own style (by default, only the innermost style is
15614
+ used).
15615
+
15616
+ When a path ends in `!`, as in `Attribute!`, no further matching
15617
+ happens for the node's child nodes, and the entire node gets the
15618
+ given style.
15619
+
15620
+ In this notation, node names that contain `/`, `!`, `*`, or `...`
15621
+ must be quoted as JSON strings.
15622
+
15623
+ For example:
15624
+
15625
+ ```javascript
15626
+ parser.withProps(
15627
+ styleTags({
15628
+ // Style Number and BigNumber nodes
15629
+ "Number BigNumber": tags.number,
15630
+ // Style Escape nodes whose parent is String
15631
+ "String/Escape": tags.escape,
15632
+ // Style anything inside Attributes nodes
15633
+ "Attributes!": tags.meta,
15634
+ // Add a style to all content inside Italic nodes
15635
+ "Italic/...": tags.emphasis,
15636
+ // Style InvalidString nodes as both `string` and `invalid`
15637
+ "InvalidString": [tags.string, tags.invalid],
15638
+ // Style the node named "/" as punctuation
15639
+ '"/"': tags.punctuation
15640
+ })
15641
+ )
15642
+ ```
15643
+ */
15334
15644
  function styleTags(spec) {
15335
15645
  let byName = Object.create(null);
15336
15646
  for (let prop in spec) {
@@ -15338,11 +15648,11 @@ function styleTags(spec) {
15338
15648
  if (!Array.isArray(tags)) tags = [tags];
15339
15649
  for (let part of prop.split(" ")) if (part) {
15340
15650
  let pieces = [],
15341
- mode = 2 /* Mode.Normal */,
15651
+ mode = 2 /* Normal */,
15342
15652
  rest = part;
15343
15653
  for (let pos = 0;;) {
15344
15654
  if (rest == "..." && pos > 0 && pos + 3 == part.length) {
15345
- mode = 1 /* Mode.Inherit */;
15655
+ mode = 1 /* Inherit */;
15346
15656
  break;
15347
15657
  }
15348
15658
  let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);
@@ -15352,7 +15662,7 @@ function styleTags(spec) {
15352
15662
  if (pos == part.length) break;
15353
15663
  let next = part[pos++];
15354
15664
  if (pos == part.length && next == "!") {
15355
- mode = 0 /* Mode.Opaque */;
15665
+ mode = 0 /* Opaque */;
15356
15666
  break;
15357
15667
  }
15358
15668
  if (next != "/") throw new RangeError("Invalid path: " + part);
@@ -15376,10 +15686,10 @@ class Rule {
15376
15686
  this.next = next;
15377
15687
  }
15378
15688
  get opaque() {
15379
- return this.mode == 0 /* Mode.Opaque */;
15689
+ return this.mode == 0 /* Opaque */;
15380
15690
  }
15381
15691
  get inherit() {
15382
- return this.mode == 1 /* Mode.Inherit */;
15692
+ return this.mode == 1 /* Inherit */;
15383
15693
  }
15384
15694
  sort(other) {
15385
15695
  if (!other || other.depth < this.depth) {
@@ -15393,10 +15703,12 @@ class Rule {
15393
15703
  return this.context ? this.context.length : 0;
15394
15704
  }
15395
15705
  }
15396
- Rule.empty = new Rule([], 2 /* Mode.Normal */, null);
15397
- /// Define a [highlighter](#highlight.Highlighter) from an array of
15398
- /// tag/class pairs. Classes associated with more specific tags will
15399
- /// take precedence.
15706
+ Rule.empty = new Rule([], 2 /* Normal */, null);
15707
+ /**
15708
+ Define a [highlighter](#highlight.Highlighter) from an array of
15709
+ tag/class pairs. Classes associated with more specific tags will
15710
+ take precedence.
15711
+ */
15400
15712
  function tagHighlighter(tags, options) {
15401
15713
  let map = Object.create(null);
15402
15714
  for (let style of tags) {
@@ -15431,17 +15743,19 @@ function highlightTags(highlighters, tags) {
15431
15743
  }
15432
15744
  return result;
15433
15745
  }
15434
- /// Highlight the given [tree](#common.Tree) with the given
15435
- /// [highlighter](#highlight.Highlighter).
15746
+ /**
15747
+ Highlight the given [tree](#common.Tree) with the given
15748
+ [highlighter](#highlight.Highlighter).
15749
+ */
15436
15750
  function highlightTree(tree, highlighter,
15437
- /// Assign styling to a region of the text. Will be called, in order
15438
- /// of position, for any ranges where more than zero classes apply.
15439
- /// `classes` is a space separated string of CSS classes.
15440
- putStyle,
15441
- /// The start of the range to highlight.
15442
- from = 0,
15443
- /// The end of the range.
15444
- to = tree.length) {
15751
+ /**
15752
+ Assign styling to a region of the text. Will be called, in order
15753
+ of position, for any ranges where more than zero classes apply.
15754
+ `classes` is a space separated string of CSS classes.
15755
+ */
15756
+ putStyle) {
15757
+ let from = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
15758
+ let to = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : tree.length;
15445
15759
  let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
15446
15760
  builder.highlightRange(tree.cursor(), from, to, "", builder.highlighters);
15447
15761
  builder.flush(to);
@@ -15477,7 +15791,7 @@ class HighlightBuilder {
15477
15791
  if (tagCls) {
15478
15792
  if (cls) cls += " ";
15479
15793
  cls += tagCls;
15480
- if (rule.mode == 1 /* Mode.Inherit */) inheritedClass += (inheritedClass ? " " : "") + tagCls;
15794
+ if (rule.mode == 1 /* Inherit */) inheritedClass += (inheritedClass ? " " : "") + tagCls;
15481
15795
  }
15482
15796
  this.startSpan(cursor.from, cls);
15483
15797
  if (rule.opaque) return;
@@ -15517,9 +15831,11 @@ class HighlightBuilder {
15517
15831
  }
15518
15832
  }
15519
15833
  }
15520
- /// Match a syntax node's [highlight rules](#highlight.styleTags). If
15521
- /// there's a match, return its set of tags, and whether it is
15522
- /// opaque (uses a `!`) or applies to all child nodes (`/...`).
15834
+ /**
15835
+ Match a syntax node's [highlight rules](#highlight.styleTags). If
15836
+ there's a match, return its set of tags, and whether it is
15837
+ opaque (uses a `!`) or applies to all child nodes (`/...`).
15838
+ */
15523
15839
  function getStyleTags(node) {
15524
15840
  let rule = node.type.prop(ruleNodeProp);
15525
15841
  while (rule && rule.context && !node.matchContext(rule.context)) rule = rule.next;
@@ -15540,268 +15856,440 @@ const comment = t(),
15540
15856
  punctuation = t(),
15541
15857
  bracket = t(punctuation),
15542
15858
  meta = t();
15543
- /// The default set of highlighting [tags](#highlight.Tag).
15544
- ///
15545
- /// This collection is heavily biased towards programming languages,
15546
- /// and necessarily incomplete. A full ontology of syntactic
15547
- /// constructs would fill a stack of books, and be impractical to
15548
- /// write themes for. So try to make do with this set. If all else
15549
- /// fails, [open an
15550
- /// issue](https://github.com/codemirror/codemirror.next) to propose a
15551
- /// new tag, or [define](#highlight.Tag^define) a local custom tag for
15552
- /// your use case.
15553
- ///
15554
- /// Note that it is not obligatory to always attach the most specific
15555
- /// tag possible to an element—if your grammar can't easily
15556
- /// distinguish a certain type of element (such as a local variable),
15557
- /// it is okay to style it as its more general variant (a variable).
15558
- ///
15559
- /// For tags that extend some parent tag, the documentation links to
15560
- /// the parent.
15859
+ /**
15860
+ The default set of highlighting [tags](#highlight.Tag).
15861
+
15862
+ This collection is heavily biased towards programming languages,
15863
+ and necessarily incomplete. A full ontology of syntactic
15864
+ constructs would fill a stack of books, and be impractical to
15865
+ write themes for. So try to make do with this set. If all else
15866
+ fails, [open an
15867
+ issue](https://github.com/codemirror/codemirror.next) to propose a
15868
+ new tag, or [define](#highlight.Tag^define) a local custom tag for
15869
+ your use case.
15870
+
15871
+ Note that it is not obligatory to always attach the most specific
15872
+ tag possible to an element—if your grammar can't easily
15873
+ distinguish a certain type of element (such as a local variable),
15874
+ it is okay to style it as its more general variant (a variable).
15875
+
15876
+ For tags that extend some parent tag, the documentation links to
15877
+ the parent.
15878
+ */
15561
15879
  const tags = {
15562
- /// A comment.
15880
+ /**
15881
+ A comment.
15882
+ */
15563
15883
  comment,
15564
- /// A line [comment](#highlight.tags.comment).
15884
+ /**
15885
+ A line [comment](#highlight.tags.comment).
15886
+ */
15565
15887
  lineComment: t(comment),
15566
- /// A block [comment](#highlight.tags.comment).
15888
+ /**
15889
+ A block [comment](#highlight.tags.comment).
15890
+ */
15567
15891
  blockComment: t(comment),
15568
- /// A documentation [comment](#highlight.tags.comment).
15892
+ /**
15893
+ A documentation [comment](#highlight.tags.comment).
15894
+ */
15569
15895
  docComment: t(comment),
15570
- /// Any kind of identifier.
15896
+ /**
15897
+ Any kind of identifier.
15898
+ */
15571
15899
  name,
15572
- /// The [name](#highlight.tags.name) of a variable.
15900
+ /**
15901
+ The [name](#highlight.tags.name) of a variable.
15902
+ */
15573
15903
  variableName: t(name),
15574
- /// A type [name](#highlight.tags.name).
15904
+ /**
15905
+ A type [name](#highlight.tags.name).
15906
+ */
15575
15907
  typeName: typeName,
15576
- /// A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
15908
+ /**
15909
+ A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
15910
+ */
15577
15911
  tagName: t(typeName),
15578
- /// A property or field [name](#highlight.tags.name).
15912
+ /**
15913
+ A property or field [name](#highlight.tags.name).
15914
+ */
15579
15915
  propertyName: propertyName,
15580
- /// An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
15916
+ /**
15917
+ An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
15918
+ */
15581
15919
  attributeName: t(propertyName),
15582
- /// The [name](#highlight.tags.name) of a class.
15920
+ /**
15921
+ The [name](#highlight.tags.name) of a class.
15922
+ */
15583
15923
  className: t(name),
15584
- /// A label [name](#highlight.tags.name).
15924
+ /**
15925
+ A label [name](#highlight.tags.name).
15926
+ */
15585
15927
  labelName: t(name),
15586
- /// A namespace [name](#highlight.tags.name).
15928
+ /**
15929
+ A namespace [name](#highlight.tags.name).
15930
+ */
15587
15931
  namespace: t(name),
15588
- /// The [name](#highlight.tags.name) of a macro.
15932
+ /**
15933
+ The [name](#highlight.tags.name) of a macro.
15934
+ */
15589
15935
  macroName: t(name),
15590
- /// A literal value.
15936
+ /**
15937
+ A literal value.
15938
+ */
15591
15939
  literal,
15592
- /// A string [literal](#highlight.tags.literal).
15940
+ /**
15941
+ A string [literal](#highlight.tags.literal).
15942
+ */
15593
15943
  string,
15594
- /// A documentation [string](#highlight.tags.string).
15944
+ /**
15945
+ A documentation [string](#highlight.tags.string).
15946
+ */
15595
15947
  docString: t(string),
15596
- /// A character literal (subtag of [string](#highlight.tags.string)).
15948
+ /**
15949
+ A character literal (subtag of [string](#highlight.tags.string)).
15950
+ */
15597
15951
  character: t(string),
15598
- /// An attribute value (subtag of [string](#highlight.tags.string)).
15952
+ /**
15953
+ An attribute value (subtag of [string](#highlight.tags.string)).
15954
+ */
15599
15955
  attributeValue: t(string),
15600
- /// A number [literal](#highlight.tags.literal).
15956
+ /**
15957
+ A number [literal](#highlight.tags.literal).
15958
+ */
15601
15959
  number,
15602
- /// An integer [number](#highlight.tags.number) literal.
15960
+ /**
15961
+ An integer [number](#highlight.tags.number) literal.
15962
+ */
15603
15963
  integer: t(number),
15604
- /// A floating-point [number](#highlight.tags.number) literal.
15964
+ /**
15965
+ A floating-point [number](#highlight.tags.number) literal.
15966
+ */
15605
15967
  float: t(number),
15606
- /// A boolean [literal](#highlight.tags.literal).
15968
+ /**
15969
+ A boolean [literal](#highlight.tags.literal).
15970
+ */
15607
15971
  bool: t(literal),
15608
- /// Regular expression [literal](#highlight.tags.literal).
15972
+ /**
15973
+ Regular expression [literal](#highlight.tags.literal).
15974
+ */
15609
15975
  regexp: t(literal),
15610
- /// An escape [literal](#highlight.tags.literal), for example a
15611
- /// backslash escape in a string.
15976
+ /**
15977
+ An escape [literal](#highlight.tags.literal), for example a
15978
+ backslash escape in a string.
15979
+ */
15612
15980
  escape: t(literal),
15613
- /// A color [literal](#highlight.tags.literal).
15981
+ /**
15982
+ A color [literal](#highlight.tags.literal).
15983
+ */
15614
15984
  color: t(literal),
15615
- /// A URL [literal](#highlight.tags.literal).
15985
+ /**
15986
+ A URL [literal](#highlight.tags.literal).
15987
+ */
15616
15988
  url: t(literal),
15617
- /// A language keyword.
15989
+ /**
15990
+ A language keyword.
15991
+ */
15618
15992
  keyword,
15619
- /// The [keyword](#highlight.tags.keyword) for the self or this
15620
- /// object.
15993
+ /**
15994
+ The [keyword](#highlight.tags.keyword) for the self or this
15995
+ object.
15996
+ */
15621
15997
  self: t(keyword),
15622
- /// The [keyword](#highlight.tags.keyword) for null.
15998
+ /**
15999
+ The [keyword](#highlight.tags.keyword) for null.
16000
+ */
15623
16001
  null: t(keyword),
15624
- /// A [keyword](#highlight.tags.keyword) denoting some atomic value.
16002
+ /**
16003
+ A [keyword](#highlight.tags.keyword) denoting some atomic value.
16004
+ */
15625
16005
  atom: t(keyword),
15626
- /// A [keyword](#highlight.tags.keyword) that represents a unit.
16006
+ /**
16007
+ A [keyword](#highlight.tags.keyword) that represents a unit.
16008
+ */
15627
16009
  unit: t(keyword),
15628
- /// A modifier [keyword](#highlight.tags.keyword).
16010
+ /**
16011
+ A modifier [keyword](#highlight.tags.keyword).
16012
+ */
15629
16013
  modifier: t(keyword),
15630
- /// A [keyword](#highlight.tags.keyword) that acts as an operator.
16014
+ /**
16015
+ A [keyword](#highlight.tags.keyword) that acts as an operator.
16016
+ */
15631
16017
  operatorKeyword: t(keyword),
15632
- /// A control-flow related [keyword](#highlight.tags.keyword).
16018
+ /**
16019
+ A control-flow related [keyword](#highlight.tags.keyword).
16020
+ */
15633
16021
  controlKeyword: t(keyword),
15634
- /// A [keyword](#highlight.tags.keyword) that defines something.
16022
+ /**
16023
+ A [keyword](#highlight.tags.keyword) that defines something.
16024
+ */
15635
16025
  definitionKeyword: t(keyword),
15636
- /// A [keyword](#highlight.tags.keyword) related to defining or
15637
- /// interfacing with modules.
16026
+ /**
16027
+ A [keyword](#highlight.tags.keyword) related to defining or
16028
+ interfacing with modules.
16029
+ */
15638
16030
  moduleKeyword: t(keyword),
15639
- /// An operator.
16031
+ /**
16032
+ An operator.
16033
+ */
15640
16034
  operator,
15641
- /// An [operator](#highlight.tags.operator) that dereferences something.
16035
+ /**
16036
+ An [operator](#highlight.tags.operator) that dereferences something.
16037
+ */
15642
16038
  derefOperator: t(operator),
15643
- /// Arithmetic-related [operator](#highlight.tags.operator).
16039
+ /**
16040
+ Arithmetic-related [operator](#highlight.tags.operator).
16041
+ */
15644
16042
  arithmeticOperator: t(operator),
15645
- /// Logical [operator](#highlight.tags.operator).
16043
+ /**
16044
+ Logical [operator](#highlight.tags.operator).
16045
+ */
15646
16046
  logicOperator: t(operator),
15647
- /// Bit [operator](#highlight.tags.operator).
16047
+ /**
16048
+ Bit [operator](#highlight.tags.operator).
16049
+ */
15648
16050
  bitwiseOperator: t(operator),
15649
- /// Comparison [operator](#highlight.tags.operator).
16051
+ /**
16052
+ Comparison [operator](#highlight.tags.operator).
16053
+ */
15650
16054
  compareOperator: t(operator),
15651
- /// [Operator](#highlight.tags.operator) that updates its operand.
16055
+ /**
16056
+ [Operator](#highlight.tags.operator) that updates its operand.
16057
+ */
15652
16058
  updateOperator: t(operator),
15653
- /// [Operator](#highlight.tags.operator) that defines something.
16059
+ /**
16060
+ [Operator](#highlight.tags.operator) that defines something.
16061
+ */
15654
16062
  definitionOperator: t(operator),
15655
- /// Type-related [operator](#highlight.tags.operator).
16063
+ /**
16064
+ Type-related [operator](#highlight.tags.operator).
16065
+ */
15656
16066
  typeOperator: t(operator),
15657
- /// Control-flow [operator](#highlight.tags.operator).
16067
+ /**
16068
+ Control-flow [operator](#highlight.tags.operator).
16069
+ */
15658
16070
  controlOperator: t(operator),
15659
- /// Program or markup punctuation.
16071
+ /**
16072
+ Program or markup punctuation.
16073
+ */
15660
16074
  punctuation,
15661
- /// [Punctuation](#highlight.tags.punctuation) that separates
15662
- /// things.
16075
+ /**
16076
+ [Punctuation](#highlight.tags.punctuation) that separates
16077
+ things.
16078
+ */
15663
16079
  separator: t(punctuation),
15664
- /// Bracket-style [punctuation](#highlight.tags.punctuation).
16080
+ /**
16081
+ Bracket-style [punctuation](#highlight.tags.punctuation).
16082
+ */
15665
16083
  bracket,
15666
- /// Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
15667
- /// tokens).
16084
+ /**
16085
+ Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
16086
+ tokens).
16087
+ */
15668
16088
  angleBracket: t(bracket),
15669
- /// Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
15670
- /// tokens).
16089
+ /**
16090
+ Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
16091
+ tokens).
16092
+ */
15671
16093
  squareBracket: t(bracket),
15672
- /// Parentheses (usually `(` and `)` tokens). Subtag of
15673
- /// [bracket](#highlight.tags.bracket).
16094
+ /**
16095
+ Parentheses (usually `(` and `)` tokens). Subtag of
16096
+ [bracket](#highlight.tags.bracket).
16097
+ */
15674
16098
  paren: t(bracket),
15675
- /// Braces (usually `{` and `}` tokens). Subtag of
15676
- /// [bracket](#highlight.tags.bracket).
16099
+ /**
16100
+ Braces (usually `{` and `}` tokens). Subtag of
16101
+ [bracket](#highlight.tags.bracket).
16102
+ */
15677
16103
  brace: t(bracket),
15678
- /// Content, for example plain text in XML or markup documents.
16104
+ /**
16105
+ Content, for example plain text in XML or markup documents.
16106
+ */
15679
16107
  content,
15680
- /// [Content](#highlight.tags.content) that represents a heading.
16108
+ /**
16109
+ [Content](#highlight.tags.content) that represents a heading.
16110
+ */
15681
16111
  heading,
15682
- /// A level 1 [heading](#highlight.tags.heading).
16112
+ /**
16113
+ A level 1 [heading](#highlight.tags.heading).
16114
+ */
15683
16115
  heading1: t(heading),
15684
- /// A level 2 [heading](#highlight.tags.heading).
16116
+ /**
16117
+ A level 2 [heading](#highlight.tags.heading).
16118
+ */
15685
16119
  heading2: t(heading),
15686
- /// A level 3 [heading](#highlight.tags.heading).
16120
+ /**
16121
+ A level 3 [heading](#highlight.tags.heading).
16122
+ */
15687
16123
  heading3: t(heading),
15688
- /// A level 4 [heading](#highlight.tags.heading).
16124
+ /**
16125
+ A level 4 [heading](#highlight.tags.heading).
16126
+ */
15689
16127
  heading4: t(heading),
15690
- /// A level 5 [heading](#highlight.tags.heading).
16128
+ /**
16129
+ A level 5 [heading](#highlight.tags.heading).
16130
+ */
15691
16131
  heading5: t(heading),
15692
- /// A level 6 [heading](#highlight.tags.heading).
16132
+ /**
16133
+ A level 6 [heading](#highlight.tags.heading).
16134
+ */
15693
16135
  heading6: t(heading),
15694
- /// A prose separator (such as a horizontal rule).
16136
+ /**
16137
+ A prose separator (such as a horizontal rule).
16138
+ */
15695
16139
  contentSeparator: t(content),
15696
- /// [Content](#highlight.tags.content) that represents a list.
16140
+ /**
16141
+ [Content](#highlight.tags.content) that represents a list.
16142
+ */
15697
16143
  list: t(content),
15698
- /// [Content](#highlight.tags.content) that represents a quote.
16144
+ /**
16145
+ [Content](#highlight.tags.content) that represents a quote.
16146
+ */
15699
16147
  quote: t(content),
15700
- /// [Content](#highlight.tags.content) that is emphasized.
16148
+ /**
16149
+ [Content](#highlight.tags.content) that is emphasized.
16150
+ */
15701
16151
  emphasis: t(content),
15702
- /// [Content](#highlight.tags.content) that is styled strong.
16152
+ /**
16153
+ [Content](#highlight.tags.content) that is styled strong.
16154
+ */
15703
16155
  strong: t(content),
15704
- /// [Content](#highlight.tags.content) that is part of a link.
16156
+ /**
16157
+ [Content](#highlight.tags.content) that is part of a link.
16158
+ */
15705
16159
  link: t(content),
15706
- /// [Content](#highlight.tags.content) that is styled as code or
15707
- /// monospace.
16160
+ /**
16161
+ [Content](#highlight.tags.content) that is styled as code or
16162
+ monospace.
16163
+ */
15708
16164
  monospace: t(content),
15709
- /// [Content](#highlight.tags.content) that has a strike-through
15710
- /// style.
16165
+ /**
16166
+ [Content](#highlight.tags.content) that has a strike-through
16167
+ style.
16168
+ */
15711
16169
  strikethrough: t(content),
15712
- /// Inserted text in a change-tracking format.
16170
+ /**
16171
+ Inserted text in a change-tracking format.
16172
+ */
15713
16173
  inserted: t(),
15714
- /// Deleted text.
16174
+ /**
16175
+ Deleted text.
16176
+ */
15715
16177
  deleted: t(),
15716
- /// Changed text.
16178
+ /**
16179
+ Changed text.
16180
+ */
15717
16181
  changed: t(),
15718
- /// An invalid or unsyntactic element.
16182
+ /**
16183
+ An invalid or unsyntactic element.
16184
+ */
15719
16185
  invalid: t(),
15720
- /// Metadata or meta-instruction.
16186
+ /**
16187
+ Metadata or meta-instruction.
16188
+ */
15721
16189
  meta,
15722
- /// [Metadata](#highlight.tags.meta) that applies to the entire
15723
- /// document.
16190
+ /**
16191
+ [Metadata](#highlight.tags.meta) that applies to the entire
16192
+ document.
16193
+ */
15724
16194
  documentMeta: t(meta),
15725
- /// [Metadata](#highlight.tags.meta) that annotates or adds
15726
- /// attributes to a given syntactic element.
16195
+ /**
16196
+ [Metadata](#highlight.tags.meta) that annotates or adds
16197
+ attributes to a given syntactic element.
16198
+ */
15727
16199
  annotation: t(meta),
15728
- /// Processing instruction or preprocessor directive. Subtag of
15729
- /// [meta](#highlight.tags.meta).
16200
+ /**
16201
+ Processing instruction or preprocessor directive. Subtag of
16202
+ [meta](#highlight.tags.meta).
16203
+ */
15730
16204
  processingInstruction: t(meta),
15731
- /// [Modifier](#highlight.Tag^defineModifier) that indicates that a
15732
- /// given element is being defined. Expected to be used with the
15733
- /// various [name](#highlight.tags.name) tags.
16205
+ /**
16206
+ [Modifier](#highlight.Tag^defineModifier) that indicates that a
16207
+ given element is being defined. Expected to be used with the
16208
+ various [name](#highlight.tags.name) tags.
16209
+ */
15734
16210
  definition: Tag.defineModifier(),
15735
- /// [Modifier](#highlight.Tag^defineModifier) that indicates that
15736
- /// something is constant. Mostly expected to be used with
15737
- /// [variable names](#highlight.tags.variableName).
16211
+ /**
16212
+ [Modifier](#highlight.Tag^defineModifier) that indicates that
16213
+ something is constant. Mostly expected to be used with
16214
+ [variable names](#highlight.tags.variableName).
16215
+ */
15738
16216
  constant: Tag.defineModifier(),
15739
- /// [Modifier](#highlight.Tag^defineModifier) used to indicate that
15740
- /// a [variable](#highlight.tags.variableName) or [property
15741
- /// name](#highlight.tags.propertyName) is being called or defined
15742
- /// as a function.
16217
+ /**
16218
+ [Modifier](#highlight.Tag^defineModifier) used to indicate that
16219
+ a [variable](#highlight.tags.variableName) or [property
16220
+ name](#highlight.tags.propertyName) is being called or defined
16221
+ as a function.
16222
+ */
15743
16223
  function: Tag.defineModifier(),
15744
- /// [Modifier](#highlight.Tag^defineModifier) that can be applied to
15745
- /// [names](#highlight.tags.name) to indicate that they belong to
15746
- /// the language's standard environment.
16224
+ /**
16225
+ [Modifier](#highlight.Tag^defineModifier) that can be applied to
16226
+ [names](#highlight.tags.name) to indicate that they belong to
16227
+ the language's standard environment.
16228
+ */
15747
16229
  standard: Tag.defineModifier(),
15748
- /// [Modifier](#highlight.Tag^defineModifier) that indicates a given
15749
- /// [names](#highlight.tags.name) is local to some scope.
16230
+ /**
16231
+ [Modifier](#highlight.Tag^defineModifier) that indicates a given
16232
+ [names](#highlight.tags.name) is local to some scope.
16233
+ */
15750
16234
  local: Tag.defineModifier(),
15751
- /// A generic variant [modifier](#highlight.Tag^defineModifier) that
15752
- /// can be used to tag language-specific alternative variants of
15753
- /// some common tag. It is recommended for themes to define special
15754
- /// forms of at least the [string](#highlight.tags.string) and
15755
- /// [variable name](#highlight.tags.variableName) tags, since those
15756
- /// come up a lot.
16235
+ /**
16236
+ A generic variant [modifier](#highlight.Tag^defineModifier) that
16237
+ can be used to tag language-specific alternative variants of
16238
+ some common tag. It is recommended for themes to define special
16239
+ forms of at least the [string](#highlight.tags.string) and
16240
+ [variable name](#highlight.tags.variableName) tags, since those
16241
+ come up a lot.
16242
+ */
15757
16243
  special: Tag.defineModifier()
15758
16244
  };
15759
- /// This is a highlighter that adds stable, predictable classes to
15760
- /// tokens, for styling with external CSS.
15761
- ///
15762
- /// The following tags are mapped to their name prefixed with `"tok-"`
15763
- /// (for example `"tok-comment"`):
15764
- ///
15765
- /// * [`link`](#highlight.tags.link)
15766
- /// * [`heading`](#highlight.tags.heading)
15767
- /// * [`emphasis`](#highlight.tags.emphasis)
15768
- /// * [`strong`](#highlight.tags.strong)
15769
- /// * [`keyword`](#highlight.tags.keyword)
15770
- /// * [`atom`](#highlight.tags.atom)
15771
- /// * [`bool`](#highlight.tags.bool)
15772
- /// * [`url`](#highlight.tags.url)
15773
- /// * [`labelName`](#highlight.tags.labelName)
15774
- /// * [`inserted`](#highlight.tags.inserted)
15775
- /// * [`deleted`](#highlight.tags.deleted)
15776
- /// * [`literal`](#highlight.tags.literal)
15777
- /// * [`string`](#highlight.tags.string)
15778
- /// * [`number`](#highlight.tags.number)
15779
- /// * [`variableName`](#highlight.tags.variableName)
15780
- /// * [`typeName`](#highlight.tags.typeName)
15781
- /// * [`namespace`](#highlight.tags.namespace)
15782
- /// * [`className`](#highlight.tags.className)
15783
- /// * [`macroName`](#highlight.tags.macroName)
15784
- /// * [`propertyName`](#highlight.tags.propertyName)
15785
- /// * [`operator`](#highlight.tags.operator)
15786
- /// * [`comment`](#highlight.tags.comment)
15787
- /// * [`meta`](#highlight.tags.meta)
15788
- /// * [`punctuation`](#highlight.tags.punctuation)
15789
- /// * [`invalid`](#highlight.tags.invalid)
15790
- ///
15791
- /// In addition, these mappings are provided:
15792
- ///
15793
- /// * [`regexp`](#highlight.tags.regexp),
15794
- /// [`escape`](#highlight.tags.escape), and
15795
- /// [`special`](#highlight.tags.special)[`(string)`](#highlight.tags.string)
15796
- /// are mapped to `"tok-string2"`
15797
- /// * [`special`](#highlight.tags.special)[`(variableName)`](#highlight.tags.variableName)
15798
- /// to `"tok-variableName2"`
15799
- /// * [`local`](#highlight.tags.local)[`(variableName)`](#highlight.tags.variableName)
15800
- /// to `"tok-variableName tok-local"`
15801
- /// * [`definition`](#highlight.tags.definition)[`(variableName)`](#highlight.tags.variableName)
15802
- /// to `"tok-variableName tok-definition"`
15803
- /// * [`definition`](#highlight.tags.definition)[`(propertyName)`](#highlight.tags.propertyName)
15804
- /// to `"tok-propertyName tok-definition"`
16245
+ /**
16246
+ This is a highlighter that adds stable, predictable classes to
16247
+ tokens, for styling with external CSS.
16248
+
16249
+ The following tags are mapped to their name prefixed with `"tok-"`
16250
+ (for example `"tok-comment"`):
16251
+
16252
+ * [`link`](#highlight.tags.link)
16253
+ * [`heading`](#highlight.tags.heading)
16254
+ * [`emphasis`](#highlight.tags.emphasis)
16255
+ * [`strong`](#highlight.tags.strong)
16256
+ * [`keyword`](#highlight.tags.keyword)
16257
+ * [`atom`](#highlight.tags.atom)
16258
+ * [`bool`](#highlight.tags.bool)
16259
+ * [`url`](#highlight.tags.url)
16260
+ * [`labelName`](#highlight.tags.labelName)
16261
+ * [`inserted`](#highlight.tags.inserted)
16262
+ * [`deleted`](#highlight.tags.deleted)
16263
+ * [`literal`](#highlight.tags.literal)
16264
+ * [`string`](#highlight.tags.string)
16265
+ * [`number`](#highlight.tags.number)
16266
+ * [`variableName`](#highlight.tags.variableName)
16267
+ * [`typeName`](#highlight.tags.typeName)
16268
+ * [`namespace`](#highlight.tags.namespace)
16269
+ * [`className`](#highlight.tags.className)
16270
+ * [`macroName`](#highlight.tags.macroName)
16271
+ * [`propertyName`](#highlight.tags.propertyName)
16272
+ * [`operator`](#highlight.tags.operator)
16273
+ * [`comment`](#highlight.tags.comment)
16274
+ * [`meta`](#highlight.tags.meta)
16275
+ * [`punctuation`](#highlight.tags.punctuation)
16276
+ * [`invalid`](#highlight.tags.invalid)
16277
+
16278
+ In addition, these mappings are provided:
16279
+
16280
+ * [`regexp`](#highlight.tags.regexp),
16281
+ [`escape`](#highlight.tags.escape), and
16282
+ [`special`](#highlight.tags.special)[`(string)`](#highlight.tags.string)
16283
+ are mapped to `"tok-string2"`
16284
+ * [`special`](#highlight.tags.special)[`(variableName)`](#highlight.tags.variableName)
16285
+ to `"tok-variableName2"`
16286
+ * [`local`](#highlight.tags.local)[`(variableName)`](#highlight.tags.variableName)
16287
+ to `"tok-variableName tok-local"`
16288
+ * [`definition`](#highlight.tags.definition)[`(variableName)`](#highlight.tags.variableName)
16289
+ to `"tok-variableName tok-definition"`
16290
+ * [`definition`](#highlight.tags.definition)[`(propertyName)`](#highlight.tags.propertyName)
16291
+ to `"tok-propertyName tok-definition"`
16292
+ */
15805
16293
  tagHighlighter([{
15806
16294
  tag: tags.link,
15807
16295
  class: "tok-link"
@@ -15914,6 +16402,11 @@ function defineLanguageFacet(baseData) {
15914
16402
  });
15915
16403
  }
15916
16404
  /**
16405
+ Syntax node prop used to register sublangauges. Should be added to
16406
+ the top level node type for the language.
16407
+ */
16408
+ const sublanguageProp = /*@__PURE__*/new NodeProp();
16409
+ /**
15917
16410
  A language object manages parsing and per-language
15918
16411
  [metadata](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt). Parse data is
15919
16412
  managed as a [Lezer](https://lezer.codemirror.net) tree. The class
@@ -15935,11 +16428,9 @@ class Language {
15935
16428
  The [language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) facet
15936
16429
  used for this language.
15937
16430
  */
15938
- data, parser, extraExtensions = [],
15939
- /**
15940
- A language name.
15941
- */
15942
- name = "") {
16431
+ data, parser) {
16432
+ let extraExtensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
16433
+ let name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
15943
16434
  this.data = data;
15944
16435
  this.name = name;
15945
16436
  // Kludge to define EditorState.tree as a debugging helper,
@@ -15951,13 +16442,28 @@ class Language {
15951
16442
  }
15952
16443
  });
15953
16444
  this.parser = parser;
15954
- this.extension = [language.of(this), EditorState.languageData.of((state, pos, side) => state.facet(languageDataFacetAt(state, pos, side)))].concat(extraExtensions);
16445
+ this.extension = [language.of(this), EditorState.languageData.of((state, pos, side) => {
16446
+ let top = topNodeAt(state, pos, side),
16447
+ data = top.type.prop(languageDataProp);
16448
+ if (!data) return [];
16449
+ let base = state.facet(data),
16450
+ sub = top.type.prop(sublanguageProp);
16451
+ if (sub) {
16452
+ let innerNode = top.resolve(pos - top.from, side);
16453
+ for (let sublang of sub) if (sublang.test(innerNode, state)) {
16454
+ let data = state.facet(sublang.facet);
16455
+ return sublang.type == "replace" ? data : data.concat(base);
16456
+ }
16457
+ }
16458
+ return base;
16459
+ })].concat(extraExtensions);
15955
16460
  }
15956
16461
  /**
15957
16462
  Query whether this language is active at the given position.
15958
16463
  */
15959
- isActiveAt(state, pos, side = -1) {
15960
- return languageDataFacetAt(state, pos, side) == this.data;
16464
+ isActiveAt(state, pos) {
16465
+ let side = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
16466
+ return topNodeAt(state, pos, side).type.prop(languageDataProp) == this.data;
15961
16467
  }
15962
16468
  /**
15963
16469
  Find the document regions that were parsed using this language.
@@ -16017,14 +16523,13 @@ class Language {
16017
16523
  @internal
16018
16524
  */
16019
16525
  Language.setState = /*@__PURE__*/StateEffect.define();
16020
- function languageDataFacetAt(state, pos, side) {
16021
- let topLang = state.facet(language);
16022
- if (!topLang) return null;
16023
- let facet = topLang.data;
16024
- if (topLang.allowsNesting) {
16025
- for (let node = syntaxTree(state).topNode; node; node = node.enter(pos, side, IterMode.ExcludeBuffers)) facet = node.type.prop(languageDataProp) || facet;
16526
+ function topNodeAt(state, pos, side) {
16527
+ let topLang = state.facet(language),
16528
+ tree = syntaxTree(state).topNode;
16529
+ if (!topLang || topLang.allowsNesting) {
16530
+ for (let node = tree; node; node = node.enter(pos, side, IterMode.ExcludeBuffers)) if (node.type.isTop) tree = node;
16026
16531
  }
16027
- return facet;
16532
+ return tree;
16028
16533
  }
16029
16534
  /**
16030
16535
  A subclass of [`Language`](https://codemirror.net/6/docs/ref/#language.Language) for use with Lezer
@@ -16068,13 +16573,15 @@ function syntaxTree(state) {
16068
16573
  }
16069
16574
  // Lezer-style Input object for a Text document.
16070
16575
  class DocInput {
16071
- constructor(doc, length = doc.length) {
16576
+ constructor(doc) {
16072
16577
  this.doc = doc;
16073
- this.length = length;
16074
16578
  this.cursorPos = 0;
16075
16579
  this.string = "";
16076
16580
  this.cursor = doc.iter();
16077
16581
  }
16582
+ get length() {
16583
+ return this.doc.length;
16584
+ }
16078
16585
  syncTo(pos) {
16079
16586
  this.string = this.cursor.next(pos - this.cursorPos).value;
16080
16587
  this.cursorPos = pos + this.string.length;
@@ -16101,38 +16608,40 @@ class ParseContext {
16101
16608
  /**
16102
16609
  The current editor state.
16103
16610
  */
16104
- state,
16105
- /**
16106
- Tree fragments that can be reused by incremental re-parses.
16107
- */
16108
- fragments = [],
16109
- /**
16110
- @internal
16111
- */
16112
- tree,
16113
- /**
16114
- @internal
16115
- */
16116
- treeLen,
16117
- /**
16118
- The current editor viewport (or some overapproximation
16119
- thereof). Intended to be used for opportunistically avoiding
16120
- work (in which case
16121
- [`skipUntilInView`](https://codemirror.net/6/docs/ref/#language.ParseContext.skipUntilInView)
16122
- should be called to make sure the parser is restarted when the
16123
- skipped region becomes visible).
16124
- */
16125
- viewport,
16126
- /**
16127
- @internal
16128
- */
16129
- skipped,
16130
- /**
16131
- This is where skipping parsers can register a promise that,
16132
- when resolved, will schedule a new parse. It is cleared when
16133
- the parse worker picks up the promise. @internal
16134
- */
16135
- scheduleOn) {
16611
+ state) {
16612
+ let fragments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
16613
+ let
16614
+ /**
16615
+ @internal
16616
+ */
16617
+ tree = arguments.length > 3 ? arguments[3] : undefined;
16618
+ let
16619
+ /**
16620
+ @internal
16621
+ */
16622
+ treeLen = arguments.length > 4 ? arguments[4] : undefined;
16623
+ let
16624
+ /**
16625
+ The current editor viewport (or some overapproximation
16626
+ thereof). Intended to be used for opportunistically avoiding
16627
+ work (in which case
16628
+ [`skipUntilInView`](https://codemirror.net/6/docs/ref/#language.ParseContext.skipUntilInView)
16629
+ should be called to make sure the parser is restarted when the
16630
+ skipped region becomes visible).
16631
+ */
16632
+ viewport = arguments.length > 5 ? arguments[5] : undefined;
16633
+ let
16634
+ /**
16635
+ @internal
16636
+ */
16637
+ skipped = arguments.length > 6 ? arguments[6] : undefined;
16638
+ let
16639
+ /**
16640
+ This is where skipping parsers can register a promise that,
16641
+ when resolved, will schedule a new parse. It is cleared when
16642
+ the parse worker picks up the promise. @internal
16643
+ */
16644
+ scheduleOn = arguments.length > 7 ? arguments[7] : undefined;
16136
16645
  this.parser = parser;
16137
16646
  this.state = state;
16138
16647
  this.fragments = fragments;
@@ -16517,14 +17026,8 @@ class LanguageSupport {
16517
17026
  /**
16518
17027
  The language object.
16519
17028
  */
16520
- language,
16521
- /**
16522
- An optional set of supporting extensions. When nesting a
16523
- language in another language, the outer language is encouraged
16524
- to include the supporting extensions for its inner languages
16525
- in its own set of support extensions.
16526
- */
16527
- support = []) {
17029
+ language) {
17030
+ let support = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
16528
17031
  this.language = language;
16529
17032
  this.support = support;
16530
17033
  this.extension = [language, support];
@@ -16554,11 +17057,8 @@ class LanguageDescription {
16554
17057
  Optional filename pattern that should be associated with this
16555
17058
  language.
16556
17059
  */
16557
- filename, loadFunc,
16558
- /**
16559
- If the language has been loaded, this will hold its value.
16560
- */
16561
- support = undefined) {
17060
+ filename, loadFunc) {
17061
+ let support = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : undefined;
16562
17062
  this.name = name;
16563
17063
  this.alias = alias;
16564
17064
  this.extensions = extensions;
@@ -16612,7 +17112,8 @@ class LanguageDescription {
16612
17112
  or alias occurs in the string (for names shorter than three
16613
17113
  characters, only when surrounded by non-word characters).
16614
17114
  */
16615
- static matchLanguageName(descs, name, fuzzy = true) {
17115
+ static matchLanguageName(descs, name) {
17116
+ let fuzzy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
16616
17117
  name = name.toLowerCase();
16617
17118
  for (let d of descs) if (d.alias.some(a => a == name)) return d;
16618
17119
  if (fuzzy) for (let d of descs) for (let a of d.alias) {
@@ -16634,15 +17135,16 @@ service.
16634
17135
  */
16635
17136
  const indentService = /*@__PURE__*/Facet.define();
16636
17137
  /**
16637
- Facet for overriding the unit by which indentation happens.
16638
- Should be a string consisting either entirely of spaces or
16639
- entirely of tabs. When not set, this defaults to 2 spaces.
17138
+ Facet for overriding the unit by which indentation happens. Should
17139
+ be a string consisting either entirely of the same whitespace
17140
+ character. When not set, this defaults to 2 spaces.
16640
17141
  */
16641
17142
  const indentUnit = /*@__PURE__*/Facet.define({
16642
17143
  combine: values => {
16643
17144
  if (!values.length) return " ";
16644
- if (!/^(?: +|\t+)$/.test(values[0])) throw new Error("Invalid indent unit: " + JSON.stringify(values[0]));
16645
- return values[0];
17145
+ let unit = values[0];
17146
+ if (!unit || /\S/.test(unit) || Array.from(unit).some(e => e != unit[0])) throw new Error("Invalid indent unit: " + JSON.stringify(values[0]));
17147
+ return unit;
16646
17148
  }
16647
17149
  });
16648
17150
  /**
@@ -16663,12 +17165,16 @@ tabs.
16663
17165
  */
16664
17166
  function indentString(state, cols) {
16665
17167
  let result = "",
16666
- ts = state.tabSize;
16667
- if (state.facet(indentUnit).charCodeAt(0) == 9) while (cols >= ts) {
16668
- result += "\t";
16669
- cols -= ts;
17168
+ ts = state.tabSize,
17169
+ ch = state.facet(indentUnit)[0];
17170
+ if (ch == "\t") {
17171
+ while (cols >= ts) {
17172
+ result += "\t";
17173
+ cols -= ts;
17174
+ }
17175
+ ch = " ";
16670
17176
  }
16671
- for (let i = 0; i < cols; i++) result += " ";
17177
+ for (let i = 0; i < cols; i++) result += ch;
16672
17178
  return result;
16673
17179
  }
16674
17180
  /**
@@ -16703,11 +17209,8 @@ class IndentContext {
16703
17209
  /**
16704
17210
  The editor state.
16705
17211
  */
16706
- state,
16707
- /**
16708
- @internal
16709
- */
16710
- options = {}) {
17212
+ state) {
17213
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
16711
17214
  this.state = state;
16712
17215
  this.options = options;
16713
17216
  this.unit = getIndentUnit(state);
@@ -16720,7 +17223,8 @@ class IndentContext {
16720
17223
  argument determines whether the part of the line line before or
16721
17224
  after the break is used.
16722
17225
  */
16723
- lineAt(pos, bias = 1) {
17226
+ lineAt(pos) {
17227
+ let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
16724
17228
  let line = this.state.doc.lineAt(pos);
16725
17229
  let {
16726
17230
  simulateBreak,
@@ -16744,7 +17248,8 @@ class IndentContext {
16744
17248
  Get the text directly after `pos`, either the entire line
16745
17249
  or the next 100 characters, whichever is shorter.
16746
17250
  */
16747
- textAfterPos(pos, bias = 1) {
17251
+ textAfterPos(pos) {
17252
+ let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
16748
17253
  if (this.options.simulateDoubleBreak && pos == this.options.simulateBreak) return "";
16749
17254
  let {
16750
17255
  text,
@@ -16755,7 +17260,8 @@ class IndentContext {
16755
17260
  /**
16756
17261
  Find the column for the given position.
16757
17262
  */
16758
- column(pos, bias = 1) {
17263
+ column(pos) {
17264
+ let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
16759
17265
  let {
16760
17266
  text,
16761
17267
  from
@@ -16769,13 +17275,15 @@ class IndentContext {
16769
17275
  Find the column position (taking tabs into account) of the given
16770
17276
  position in the given string.
16771
17277
  */
16772
- countColumn(line, pos = line.length) {
17278
+ countColumn(line) {
17279
+ let pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : line.length;
16773
17280
  return countColumn(line, this.state.tabSize, pos);
16774
17281
  }
16775
17282
  /**
16776
17283
  Find the indentation column of the line at the given point.
16777
17284
  */
16778
- lineIndent(pos, bias = 1) {
17285
+ lineIndent(pos) {
17286
+ let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
16779
17287
  let {
16780
17288
  text,
16781
17289
  from
@@ -16926,11 +17434,12 @@ opening node, like this:
16926
17434
  foo(bar,
16927
17435
  baz)
16928
17436
  */
16929
- function delimitedIndent({
16930
- closing,
16931
- align = true,
16932
- units = 1
16933
- }) {
17437
+ function delimitedIndent(_ref) {
17438
+ let {
17439
+ closing,
17440
+ align = true,
17441
+ units = 1
17442
+ } = _ref;
16934
17443
  return context => delimitedStrategy(context, align, units, closing);
16935
17444
  }
16936
17445
  function delimitedStrategy(context, align, units, closing, closedAt) {
@@ -16954,10 +17463,11 @@ match a pattern (for example `/^else\b/` in `if`/`else`
16954
17463
  constructs), and you can change the amount of units used with the
16955
17464
  `units` option.
16956
17465
  */
16957
- function continuedIndent({
16958
- except,
16959
- units = 1
16960
- } = {}) {
17466
+ function continuedIndent() {
17467
+ let {
17468
+ except,
17469
+ units = 1
17470
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16961
17471
  return context => {
16962
17472
  let matchExcept = except && except.test(context.textAfter);
16963
17473
  return context.baseIndent + (matchExcept ? 0 : units * context.unit);
@@ -17224,7 +17734,8 @@ const unfoldCode = view => {
17224
17734
  });
17225
17735
  return effects.length > 0;
17226
17736
  };
17227
- function announceFold(view, range, fold = true) {
17737
+ function announceFold(view, range) {
17738
+ let fold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
17228
17739
  let lineFrom = view.state.doc.lineAt(range.from).number,
17229
17740
  lineTo = view.state.doc.lineAt(range.to).number;
17230
17741
  return EditorView.announce.of(`${view.state.phrase(fold ? "Folded lines" : "Unfolded lines")} ${lineFrom} ${view.state.phrase("to")} ${lineTo}.`);
@@ -17367,7 +17878,8 @@ Create an extension that registers a fold gutter, which shows a
17367
17878
  fold status indicator before foldable lines (which can be clicked
17368
17879
  to fold or unfold the line).
17369
17880
  */
17370
- function foldGutter(config = {}) {
17881
+ function foldGutter() {
17882
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17371
17883
  let fullConfig = Object.assign(Object.assign({}, foldGutterDefaults), config);
17372
17884
  let canFold = new FoldMarker(fullConfig, true),
17373
17885
  canUnfold = new FoldMarker(fullConfig, false);
@@ -17672,7 +18184,8 @@ cursor is next to a bracket, that bracket and the one it matches
17672
18184
  are highlighted. Or, when no matching bracket is found, another
17673
18185
  highlighting style is used to indicate this.
17674
18186
  */
17675
- function bracketMatching(config = {}) {
18187
+ function bracketMatching() {
18188
+ let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
17676
18189
  return [bracketMatchingConfig.of(config), bracketMatchingUnique];
17677
18190
  }
17678
18191
  /**
@@ -17703,7 +18216,8 @@ direction `dir`. Only the `brackets` and `maxScanDistance`
17703
18216
  properties are used from `config`, if given. Returns null if no
17704
18217
  bracket was found at `pos`, or a match result otherwise.
17705
18218
  */
17706
- function matchBrackets(state, pos, dir, config = {}) {
18219
+ function matchBrackets(state, pos, dir) {
18220
+ let config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
17707
18221
  let maxScanDistance = config.maxScanDistance || DefaultScanDist,
17708
18222
  brackets = config.brackets || DefaultBrackets;
17709
18223
  let tree = syntaxTree(state),