@onereach/ui-components 4.3.8 → 4.3.9-beta.2653.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.
- package/dist/bundled/v2/{OrDateTimePickerMonthSelect-40adb0f2.js → OrDateTimePickerMonthSelect-5eda9e34.js} +4 -3
- package/dist/bundled/v2/components/OrBottomSheetV3/OrBottomSheet.js +8 -4
- package/dist/bundled/v2/components/OrButton/OrButton.js +1 -1
- package/dist/bundled/v2/components/OrButtonV2/OrButton.js +1 -1
- package/dist/bundled/v2/components/OrCardCollection/OrCardCollection.js +4 -3
- package/dist/bundled/v2/components/OrCarousel/OrCarousel.js +7 -1
- package/dist/bundled/v2/components/OrCheckbox/OrCheckbox.js +4 -3
- package/dist/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.js +4 -3
- package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.js +4 -3
- package/dist/bundled/v2/components/OrCheckboxV3/OrCheckbox.js +4 -3
- package/dist/bundled/v2/components/OrCode/OrCode.js +266 -200
- package/dist/bundled/v2/components/OrCode/index.js +2 -2
- package/dist/bundled/v2/components/OrCode/lang.js +2 -2
- package/dist/bundled/v2/components/OrCode/theme.js +1 -1
- package/dist/bundled/v2/components/OrCollapse/OrCollapse.js +6 -4
- package/dist/bundled/v2/components/OrColorPicker/utils/defultPalette.js +2 -1
- package/dist/bundled/v2/components/OrConfirm/OrConfirm.js +5 -4
- package/dist/bundled/v2/components/OrConfirm/index.js +1 -1
- package/dist/bundled/v2/components/OrConfirmV3/OrConfirm.js +5 -4
- package/dist/bundled/v2/components/OrConfirmV3/index.js +1 -1
- package/dist/bundled/v2/components/OrDatePickerV3/OrDatePicker.js +1 -1
- package/dist/bundled/v2/components/OrDatePickerV3/index.js +1 -1
- package/dist/bundled/v2/components/OrDateTimePickerV3/OrDateTimePicker.js +1 -1
- package/dist/bundled/v2/components/OrDateTimePickerV3/index.js +1 -1
- package/dist/bundled/v2/components/OrIconButtonV2/OrIconButton.js +5 -4
- package/dist/bundled/v2/components/OrInlineTextEdit/OrInlineTextEdit.js +4 -3
- package/dist/bundled/v2/components/OrList/OrList.js +5 -4
- package/dist/bundled/v2/components/OrMenuV3/OrMenu.js +11 -5
- package/dist/bundled/v2/components/OrModal/OrModal.js +101 -20
- package/dist/bundled/v2/components/OrNumberInput/OrNumberInput.js +4 -3
- package/dist/bundled/v2/components/OrOverflowMenu/OrOverflowMenu.js +4 -3
- package/dist/bundled/v2/components/OrPassword/OrPassword.js +4 -3
- package/dist/bundled/v2/components/OrPopoverV3/OrPopover.js +8 -4
- package/dist/bundled/v2/components/OrRadio/OrRadio.js +4 -3
- package/dist/bundled/v2/components/OrRadioGroupV3/OrRadioGroup.js +4 -3
- package/dist/bundled/v2/components/OrSearch/OrSearch.js +4 -3
- package/dist/bundled/v2/components/OrSelectV3/OrSelect.js +8 -4
- package/dist/bundled/v2/components/OrSidebarV3/OrSidebar.js +4 -3
- package/dist/bundled/v2/components/OrSwitch/OrSwitch.js +4 -3
- package/dist/bundled/v2/components/OrTabHeaderItem/OrTabHeaderItem.js +4 -3
- package/dist/bundled/v2/components/OrTabs/OrTabs.js +5 -4
- package/dist/bundled/v2/components/OrTabsV3/OrTabs.js +8 -4
- package/dist/bundled/v2/components/OrTextV3/OrText.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrTextarea/OrTextarea.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrTextareaV3/OrTextarea.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrTextbox/OrTextbox.js +5 -4
- package/dist/bundled/v2/components/OrTextbox/OrTextbox.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrTimePickerV3/OrTimePicker.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrToast/OrToast.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrToast/composable/useToast.js +10 -5
- package/dist/bundled/v2/components/OrToastContainerV3/OrToastContainer.js +6 -3
- package/dist/bundled/v2/components/OrToastV3/OrToast.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrToastV3/composable/useToast.js +10 -5
- package/dist/bundled/v2/components/OrTooltip/OrTooltip.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrTooltipV3/OrTooltip.vue.d.ts +2 -2
- package/dist/bundled/v2/components/index.js +6 -6
- package/dist/bundled/v2/hooks/useElevation.js +2 -1
- package/dist/bundled/v2/hooks/useOverflow.js +5 -4
- package/dist/bundled/v2/hooks/useToggle.js +2 -1
- package/dist/bundled/{v3/index-6976c52a.js → v2/index-cf2c3c27.js} +1288 -735
- package/dist/bundled/v2/index.js +5 -5
- package/dist/bundled/{v3/lang-02d2bb2d.js → v2/lang-0fb8f78b.js} +275 -196
- package/dist/bundled/v2/utils/functions/color.js +2 -1
- package/dist/bundled/v2/utils/functions/flattenDeep.js +2 -1
- package/dist/bundled/v3/{OrBottomSheet.vue_vue_type_script_lang-461f99cf.js → OrBottomSheet.vue_vue_type_script_lang-a81b2abb.js} +9 -5
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-b42d07c5.js → OrCardCollection.vue_vue_type_script_lang-86a02f38.js} +3 -3
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-7a2e1332.js → OrCardCollection.vue_vue_type_script_lang-d3f43900.js} +6 -5
- package/dist/bundled/v3/{OrCarousel.vue_vue_type_script_lang-6976844a.js → OrCarousel.vue_vue_type_script_lang-188ca513.js} +7 -1
- package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-1cf06290.js → OrCheckbox.vue_vue_type_script_lang-75c6053a.js} +4 -3
- package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-11b16d93.js → OrCheckbox.vue_vue_type_script_lang-ba11d80f.js} +4 -3
- package/dist/bundled/v3/{OrCheckboxTree.vue_vue_type_script_lang-4042ef27.js → OrCheckboxTree.vue_vue_type_script_lang-528dd4d5.js} +5 -4
- package/dist/bundled/v3/{OrChips.vue_vue_type_script_lang-d4bb44eb.js → OrChips.vue_vue_type_script_lang-211e03a1.js} +4 -2
- package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-5397df6a.js → OrCode.vue_vue_type_script_lang-74060519.js} +268 -202
- package/dist/bundled/v3/{OrCollapse.vue_vue_type_script_lang-5137ca99.js → OrCollapse.vue_vue_type_script_lang-45b18baf.js} +6 -4
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-c3d584a5.js → OrConfirm.vue_vue_type_script_lang-23e4ce08.js} +7 -6
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-89febea7.js → OrConfirm.vue_vue_type_script_lang-e5a8f92a.js} +8 -7
- package/dist/bundled/v3/{OrDatePicker.vue_vue_type_script_lang-10648c78.js → OrDatePicker.vue_vue_type_script_lang-50a9aeaf.js} +3 -3
- package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-8ff54abd.js → OrDateTimePicker.vue_vue_type_script_lang-6fd7c75e.js} +5 -3
- package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-c14895ae.js → OrDateTimePicker.vue_vue_type_script_lang-af944f0d.js} +3 -3
- package/dist/bundled/v3/{OrDateTimePickerMonthSelect-74896719.js → OrDateTimePickerMonthSelect-b475eb4f.js} +6 -5
- package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-a4558aec.js → OrIconButton.vue_vue_type_script_lang-e786c9e5.js} +1 -1
- package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-96cb5b59.js → OrIconButton.vue_vue_type_script_lang-fb99a3ea.js} +4 -3
- package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-3317d59e.js → OrInlineInput.vue_vue_type_script_lang-65a0cff4.js} +1 -1
- package/dist/bundled/v3/{OrInlineTextEdit.vue_vue_type_script_lang-45987769.js → OrInlineTextEdit.vue_vue_type_script_lang-869c7772.js} +6 -5
- package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-bec81f6e.js → OrInlineTextarea.vue_vue_type_script_lang-bbb820b7.js} +1 -1
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-9596c9e5.js → OrInput.vue_vue_type_script_lang-223ac3b9.js} +1 -1
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-ad995b35.js → OrInput.vue_vue_type_script_lang-4067879f.js} +1 -1
- package/dist/bundled/v3/{OrList.vue_vue_type_script_lang-2c7537cc.js → OrList.vue_vue_type_script_lang-47bafed1.js} +7 -6
- package/dist/bundled/v3/{OrListOfInputs.vue_vue_type_script_lang-009f62a5.js → OrListOfInputs.vue_vue_type_script_lang-006e0106.js} +3 -3
- package/dist/bundled/v3/{OrMenu.vue_vue_type_script_lang-4151a6c5.js → OrMenu.vue_vue_type_script_lang-a18d3c8d.js} +12 -6
- package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-c53617ae.js → OrModal.vue_vue_type_script_lang-ae842e5b.js} +102 -21
- package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-8e6bfbe0.js → OrModal.vue_vue_type_script_lang-c71dafa8.js} +2 -2
- package/dist/bundled/v3/{OrNotification.vue_vue_type_script_lang-3cb896a6.js → OrNotification.vue_vue_type_script_lang-8bb9dfd1.js} +1 -1
- package/dist/bundled/v3/{OrNotification.vue_vue_type_script_lang-efb05bb2.js → OrNotification.vue_vue_type_script_lang-cf2e272c.js} +1 -1
- package/dist/bundled/v3/{OrNumberInput.vue_vue_type_script_lang-1d469d1f.js → OrNumberInput.vue_vue_type_script_lang-55c5ea8f.js} +5 -4
- package/dist/bundled/v3/{OrOverflowMenu.vue_vue_type_script_lang-ba50133f.js → OrOverflowMenu.vue_vue_type_script_lang-fe2d0395.js} +6 -5
- package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-b1501bad.js → OrPagination.vue_vue_type_script_lang-e935332b.js} +1 -1
- package/dist/bundled/v3/{OrPassword.vue_vue_type_script_lang-37f52611.js → OrPassword.vue_vue_type_script_lang-1f5d2a91.js} +6 -5
- package/dist/bundled/v3/{OrPopover.vue_vue_type_script_lang-2d9a006c.js → OrPopover.vue_vue_type_script_lang-2d4eae64.js} +9 -5
- package/dist/bundled/v3/{OrRadio.vue_vue_type_script_lang-cc11200c.js → OrRadio.vue_vue_type_script_lang-e1617a0e.js} +4 -3
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-79acec48.js → OrSearch.vue_vue_type_script_lang-1a4ebba2.js} +1 -1
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-bcb935c3.js → OrSearch.vue_vue_type_script_lang-7ac93e50.js} +6 -5
- package/dist/bundled/v3/{OrSegmentedControl.vue_vue_type_script_lang-d1b4694c.js → OrSegmentedControl.vue_vue_type_script_lang-ed0d9fe7.js} +3 -1
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-2bd087f3.js → OrSelect.vue_vue_type_script_lang-264914d3.js} +12 -8
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-c82d8f58.js → OrSelect.vue_vue_type_script_lang-29a48259.js} +8 -4
- package/dist/bundled/v3/{OrSidebar.vue_vue_type_script_lang-f6179985.js → OrSidebar.vue_vue_type_script_lang-d7f700de.js} +5 -4
- package/dist/bundled/v3/{OrStepper.vue_vue_type_script_lang-975a4df6.js → OrStepper.vue_vue_type_script_lang-d230260e.js} +1 -1
- package/dist/bundled/v3/{OrSwitch.vue_vue_type_script_lang-1c079a74.js → OrSwitch.vue_vue_type_script_lang-c986f062.js} +4 -3
- package/dist/bundled/v3/{OrTabHeaderItem.vue_vue_type_script_lang-0a67721f.js → OrTabHeaderItem.vue_vue_type_script_lang-29f331ec.js} +4 -3
- package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-06a89286.js → OrTabs.vue_vue_type_script_lang-5836b8bd.js} +6 -5
- package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-92e9d9d8.js → OrTabs.vue_vue_type_script_lang-6d47e560.js} +9 -5
- package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-f2855602.js → OrTag.vue_vue_type_script_lang-8643b784.js} +1 -1
- package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-1236e04a.js → OrTextarea.vue_vue_type_script_lang-048cb245.js} +1 -1
- package/dist/bundled/v3/{OrTextbox.vue_vue_type_script_lang-812f302d.js → OrTextbox.vue_vue_type_script_lang-dad835c3.js} +7 -6
- package/dist/bundled/v3/{OrTimePicker.vue_vue_type_script_lang-805e884c.js → OrTimePicker.vue_vue_type_script_lang-a85e5b96.js} +2 -2
- package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-572c7dad.js → OrToastContainer.vue_vue_type_script_lang-9a91e4ab.js} +6 -3
- package/dist/bundled/v3/{OrTooltip.vue_vue_type_script_lang-67f6fa3c.js → OrTooltip.vue_vue_type_script_lang-56496d67.js} +1 -1
- package/dist/bundled/v3/components/OrAvatar/OrAvatar.js +8 -4
- package/dist/bundled/v3/components/OrAvatar/OrAvatar.vue.d.ts +11 -26
- package/dist/bundled/v3/components/OrAvatar/index.js +1 -1
- package/dist/bundled/v3/components/OrAvatarV3/OrAvatar.js +2 -2
- package/dist/bundled/v3/components/OrAvatarV3/OrAvatar.vue.d.ts +8 -24
- package/dist/bundled/v3/components/OrAvatarV3/index.js +1 -1
- package/dist/bundled/v3/components/OrBottomSheetV3/OrBottomSheet.js +3 -3
- package/dist/bundled/v3/components/OrBottomSheetV3/OrBottomSheet.vue.d.ts +20 -33
- package/dist/bundled/v3/components/OrBottomSheetV3/index.js +2 -2
- package/dist/bundled/v3/components/OrButton/OrButton.js +1 -1
- package/dist/bundled/v3/components/OrButton/OrButton.vue.d.ts +16 -51
- package/dist/bundled/v3/components/OrButtonV2/OrButton.js +3 -3
- package/dist/bundled/v3/components/OrButtonV2/OrButton.vue.d.ts +20 -57
- package/dist/bundled/v3/components/OrButtonV2/index.js +2 -2
- package/dist/bundled/v3/components/OrButtonV3/OrButton.vue.d.ts +15 -35
- package/dist/bundled/v3/components/OrCard/OrCard.vue.d.ts +7 -15
- package/dist/bundled/v3/components/OrCardCollection/OrCardCollection.js +6 -6
- package/dist/bundled/v3/components/OrCardCollection/OrCardCollection.vue.d.ts +21 -47
- package/dist/bundled/v3/components/OrCardCollection/index.js +5 -5
- package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.js +10 -10
- package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.vue.d.ts +22 -70
- package/dist/bundled/v3/components/OrCardCollectionV3/index.js +9 -9
- package/dist/bundled/v3/components/OrCardV3/OrCard.vue.d.ts +4 -7
- package/dist/bundled/v3/components/OrCarousel/OrCarousel.js +2 -2
- package/dist/bundled/v3/components/OrCarousel/OrCarousel.vue.d.ts +126 -676
- package/dist/bundled/v3/components/OrCarousel/index.js +1 -1
- package/dist/bundled/v3/components/OrCarouselItem/OrCarouselItem.vue.d.ts +1 -1
- package/dist/bundled/v3/components/OrCheckbox/OrCheckbox.js +8 -4
- package/dist/bundled/v3/components/OrCheckbox/OrCheckbox.vue.d.ts +15 -35
- package/dist/bundled/v3/components/OrCheckbox/index.js +1 -1
- package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.js +6 -5
- package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +6 -24
- package/dist/bundled/v3/components/OrCheckboxGroupV3/index.js +2 -2
- package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.js +3 -3
- package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +17 -43
- package/dist/bundled/v3/components/OrCheckboxTreeV3/index.js +2 -2
- package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.js +5 -3
- package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.vue.d.ts +23 -53
- package/dist/bundled/v3/components/OrCheckboxV3/index.js +1 -1
- package/dist/bundled/v3/components/OrChip/OrChip.js +5 -3
- package/dist/bundled/v3/components/OrChip/OrChip.vue.d.ts +9 -25
- package/dist/bundled/v3/components/OrChip/index.js +1 -1
- package/dist/bundled/v3/components/OrChips/OrChips.js +3 -3
- package/dist/bundled/v3/components/OrChips/OrChips.vue.d.ts +24 -51
- package/dist/bundled/v3/components/OrChips/index.js +2 -2
- package/dist/bundled/v3/components/OrCode/OrCode.js +6 -6
- package/dist/bundled/v3/components/OrCode/OrCode.vue.d.ts +24 -69
- package/dist/bundled/v3/components/OrCode/index.js +5 -5
- package/dist/bundled/v3/components/OrCode/lang.js +2 -2
- package/dist/bundled/v3/components/OrCode/theme.js +1 -1
- package/dist/bundled/v3/components/OrCollapse/OrCollapse.js +2 -2
- package/dist/bundled/v3/components/OrCollapse/OrCollapse.vue.d.ts +17 -39
- package/dist/bundled/v3/components/OrCollapse/index.js +1 -1
- package/dist/bundled/v3/components/OrColorPicker/OrColorPicker.js +5 -3
- package/dist/bundled/v3/components/OrColorPicker/OrColorPicker.vue.d.ts +13 -31
- package/dist/bundled/v3/components/OrColorPicker/index.js +1 -1
- package/dist/bundled/v3/components/OrColorPicker/utils/defultPalette.js +2 -1
- package/dist/bundled/v3/components/OrCombinedInputV3/OrCombinedInput.vue.d.ts +8 -30
- package/dist/bundled/v3/components/OrConfirm/OrConfirm.js +8 -8
- package/dist/bundled/v3/components/OrConfirm/OrConfirm.vue.d.ts +23 -84
- package/dist/bundled/v3/components/OrConfirm/index.js +7 -7
- package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.js +9 -9
- package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.vue.d.ts +29 -91
- package/dist/bundled/v3/components/OrConfirmV3/index.js +8 -8
- package/dist/bundled/v3/components/OrDatePickerV3/OrDatePicker.js +9 -9
- package/dist/bundled/v3/components/OrDatePickerV3/OrDatePicker.vue.d.ts +25 -81
- package/dist/bundled/v3/components/OrDatePickerV3/index.js +8 -8
- package/dist/bundled/v3/components/OrDateTimePicker/OrDateTimePicker.js +7 -5
- package/dist/bundled/v3/components/OrDateTimePicker/OrDateTimePicker.vue.d.ts +68 -177
- package/dist/bundled/v3/components/OrDateTimePicker/index.js +3 -3
- package/dist/bundled/v3/components/OrDateTimePickerV3/OrDateTimePicker.js +9 -9
- package/dist/bundled/v3/components/OrDateTimePickerV3/OrDateTimePicker.vue.d.ts +31 -105
- package/dist/bundled/v3/components/OrDateTimePickerV3/index.js +8 -8
- package/dist/bundled/v3/components/OrEmptyStateV3/OrEmptyState.vue.d.ts +11 -28
- package/dist/bundled/v3/components/OrError/OrError.vue.d.ts +4 -8
- package/dist/bundled/v3/components/OrErrorTagV3/OrErrorTag.vue.d.ts +4 -7
- package/dist/bundled/v3/components/OrErrorV3/OrError.vue.d.ts +9 -18
- package/dist/bundled/v3/components/OrExpansionPanelV3/OrExpansionPanel.vue.d.ts +14 -35
- package/dist/bundled/v3/components/OrFabV3/OrFab.vue.d.ts +8 -20
- package/dist/bundled/v3/components/OrFloating/OrFloating.vue.d.ts +15 -46
- package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.vue.d.ts +10 -30
- package/dist/bundled/v3/components/OrHint/OrHint.vue.d.ts +4 -8
- package/dist/bundled/v3/components/OrHintV3/OrHint.vue.d.ts +9 -18
- package/dist/bundled/v3/components/OrIcon/OrIcon.js +6 -2
- package/dist/bundled/v3/components/OrIcon/OrIcon.vue.d.ts +16 -44
- package/dist/bundled/v3/components/OrIconButtonV2/OrIconButton.js +3 -3
- package/dist/bundled/v3/components/OrIconButtonV2/OrIconButton.vue.d.ts +13 -43
- package/dist/bundled/v3/components/OrIconButtonV2/index.js +1 -1
- package/dist/bundled/v3/components/OrIconButtonV3/OrIconButton.js +6 -6
- package/dist/bundled/v3/components/OrIconButtonV3/OrIconButton.vue.d.ts +16 -52
- package/dist/bundled/v3/components/OrIconButtonV3/index.js +5 -5
- package/dist/bundled/v3/components/OrIconV3/OrIcon.vue.d.ts +7 -18
- package/dist/bundled/v3/components/OrInlineInputBoxV3/OrInlineInputBox.vue.d.ts +7 -16
- package/dist/bundled/v3/components/OrInlineInputV3/OrInlineInput.js +13 -9
- package/dist/bundled/v3/components/OrInlineInputV3/OrInlineInput.vue.d.ts +39 -83
- package/dist/bundled/v3/components/OrInlineInputV3/index.js +6 -6
- package/dist/bundled/v3/components/OrInlineTextEdit/OrInlineTextEdit.js +28 -12
- package/dist/bundled/v3/components/OrInlineTextEdit/OrInlineTextEdit.vue.d.ts +43 -95
- package/dist/bundled/v3/components/OrInlineTextEdit/index.js +3 -3
- package/dist/bundled/v3/components/OrInlineTextareaV3/OrInlineTextarea.js +13 -9
- package/dist/bundled/v3/components/OrInlineTextareaV3/OrInlineTextarea.vue.d.ts +39 -79
- package/dist/bundled/v3/components/OrInlineTextareaV3/index.js +6 -6
- package/dist/bundled/v3/components/OrInput/OrInput.js +12 -6
- package/dist/bundled/v3/components/OrInput/OrInput.vue.d.ts +36 -87
- package/dist/bundled/v3/components/OrInput/index.js +2 -2
- package/dist/bundled/v3/components/OrInputBoxV3/OrInputBox.vue.d.ts +7 -22
- package/dist/bundled/v3/components/OrInputV3/OrInput.js +7 -7
- package/dist/bundled/v3/components/OrInputV3/OrInput.vue.d.ts +34 -85
- package/dist/bundled/v3/components/OrInputV3/index.js +6 -6
- package/dist/bundled/v3/components/OrLabel/OrLabel.vue.d.ts +9 -20
- package/dist/bundled/v3/components/OrLabelV3/OrLabel.vue.d.ts +9 -24
- package/dist/bundled/v3/components/OrLinkV3/OrLink.vue.d.ts +7 -24
- package/dist/bundled/v3/components/OrList/OrList.js +4 -4
- package/dist/bundled/v3/components/OrList/OrList.vue.d.ts +21 -47
- package/dist/bundled/v3/components/OrList/index.js +3 -3
- package/dist/bundled/v3/components/OrListOfInputs/OrListOfInputs.js +63 -54
- package/dist/bundled/v3/components/OrListOfInputs/OrListOfInputs.vue.d.ts +11 -27
- package/dist/bundled/v3/components/OrListOfInputs/index.js +6 -6
- package/dist/bundled/v3/components/OrLoader/OrLoader.vue.d.ts +10 -26
- package/dist/bundled/v3/components/OrLoaderV3/OrLoader.vue.d.ts +13 -34
- package/dist/bundled/v3/components/OrMenuItemV3/OrMenuItem.vue.d.ts +13 -34
- package/dist/bundled/v3/components/OrMenuV3/OrMenu.js +8 -6
- package/dist/bundled/v3/components/OrMenuV3/OrMenu.vue.d.ts +16 -43
- package/dist/bundled/v3/components/OrMenuV3/index.js +4 -4
- package/dist/bundled/v3/components/OrModal/OrModal.js +3 -3
- package/dist/bundled/v3/components/OrModal/OrModal.vue.d.ts +14 -38
- package/dist/bundled/v3/components/OrModal/index.js +2 -2
- package/dist/bundled/v3/components/OrModalV3/OrModal.js +7 -7
- package/dist/bundled/v3/components/OrModalV3/OrModal.vue.d.ts +13 -27
- package/dist/bundled/v3/components/OrModalV3/index.js +6 -6
- package/dist/bundled/v3/components/OrNotification/OrNotification.js +3 -3
- package/dist/bundled/v3/components/OrNotification/OrNotification.vue.d.ts +9 -27
- package/dist/bundled/v3/components/OrNotification/index.js +2 -2
- package/dist/bundled/v3/components/OrNotificationV3/OrNotification.js +7 -7
- package/dist/bundled/v3/components/OrNotificationV3/OrNotification.vue.d.ts +9 -20
- package/dist/bundled/v3/components/OrNotificationV3/index.js +6 -6
- package/dist/bundled/v3/components/OrNumberInput/OrNumberInput.js +4 -4
- package/dist/bundled/v3/components/OrNumberInput/OrNumberInput.vue.d.ts +24 -70
- package/dist/bundled/v3/components/OrNumberInput/index.js +3 -3
- package/dist/bundled/v3/components/OrOverflowMenu/OrOverflowMenu.js +4 -4
- package/dist/bundled/v3/components/OrOverflowMenu/OrOverflowMenu.vue.d.ts +13 -31
- package/dist/bundled/v3/components/OrOverflowMenu/index.js +3 -3
- package/dist/bundled/v3/components/OrOverlay/OrOverlay.vue.d.ts +6 -16
- package/dist/bundled/v3/components/OrOverlayV3/OrOverlay.js +2 -2
- package/dist/bundled/v3/components/OrOverlayV3/OrOverlay.vue.d.ts +7 -14
- package/dist/bundled/v3/components/OrOverlayV3/index.js +1 -1
- package/dist/bundled/v3/components/OrPaginationV3/OrPagination.js +6 -6
- package/dist/bundled/v3/components/OrPaginationV3/OrPagination.vue.d.ts +27 -75
- package/dist/bundled/v3/components/OrPaginationV3/index.js +5 -5
- package/dist/bundled/v3/components/OrPassword/OrPassword.js +5 -5
- package/dist/bundled/v3/components/OrPassword/OrPassword.vue.d.ts +22 -63
- package/dist/bundled/v3/components/OrPassword/index.js +4 -4
- package/dist/bundled/v3/components/OrPopoverV3/OrPopover.js +4 -4
- package/dist/bundled/v3/components/OrPopoverV3/OrPopover.vue.d.ts +27 -74
- package/dist/bundled/v3/components/OrPopoverV3/index.js +3 -3
- package/dist/bundled/v3/components/OrProgress/OrProgress.vue.d.ts +20 -56
- package/dist/bundled/v3/components/OrProgressV3/OrProgress.vue.d.ts +25 -62
- package/dist/bundled/v3/components/OrRadio/OrRadio.js +5 -3
- package/dist/bundled/v3/components/OrRadio/OrRadio.vue.d.ts +13 -35
- package/dist/bundled/v3/components/OrRadio/index.js +1 -1
- package/dist/bundled/v3/components/OrRadioGroup/OrRadioGroup.vue.d.ts +9 -26
- package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.js +4 -3
- package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +6 -32
- package/dist/bundled/v3/components/OrRadioV3/OrRadio.vue.d.ts +21 -49
- package/dist/bundled/v3/components/OrSearch/OrSearch.js +5 -5
- package/dist/bundled/v3/components/OrSearch/OrSearch.vue.d.ts +23 -65
- package/dist/bundled/v3/components/OrSearch/index.js +4 -4
- package/dist/bundled/v3/components/OrSearchV3/OrSearch.js +8 -8
- package/dist/bundled/v3/components/OrSearchV3/OrSearch.vue.d.ts +17 -41
- package/dist/bundled/v3/components/OrSearchV3/index.js +7 -7
- package/dist/bundled/v3/components/OrSegmentedControlV3/OrSegmentedControl.js +2 -2
- package/dist/bundled/v3/components/OrSegmentedControlV3/OrSegmentedControl.vue.d.ts +9 -25
- package/dist/bundled/v3/components/OrSegmentedControlV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSelect/OrSelect.js +4 -4
- package/dist/bundled/v3/components/OrSelect/OrSelect.vue.d.ts +28 -77
- package/dist/bundled/v3/components/OrSelect/index.js +3 -3
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +10 -10
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.vue.d.ts +37 -115
- package/dist/bundled/v3/components/OrSelectV3/index.js +9 -9
- package/dist/bundled/v3/components/OrSidebar/OrSidebar.vue.d.ts +14 -33
- package/dist/bundled/v3/components/OrSidebarV3/OrSidebar.js +7 -7
- package/dist/bundled/v3/components/OrSidebarV3/OrSidebar.vue.d.ts +28 -63
- package/dist/bundled/v3/components/OrSidebarV3/index.js +6 -6
- package/dist/bundled/v3/components/OrSkeletonCircle/OrSkeletonCircle.vue.d.ts +9 -20
- package/dist/bundled/v3/components/OrSkeletonCircleV3/OrSkeletonCircle.vue.d.ts +13 -28
- package/dist/bundled/v3/components/OrSkeletonRect/OrSkeletonRect.vue.d.ts +9 -22
- package/dist/bundled/v3/components/OrSkeletonRectV3/OrSkeletonRect.vue.d.ts +11 -26
- package/dist/bundled/v3/components/OrSkeletonText/OrSkeletonText.vue.d.ts +10 -26
- package/dist/bundled/v3/components/OrSkeletonTextV3/OrSkeletonText.vue.d.ts +16 -40
- package/dist/bundled/v3/components/OrSlider/OrSlider.js +17 -5
- package/dist/bundled/v3/components/OrSlider/OrSlider.vue.d.ts +35 -91
- package/dist/bundled/v3/components/OrSlider/index.js +1 -1
- package/dist/bundled/v3/components/OrSortHeaderV3/OrSortHeader.vue.d.ts +13 -25
- package/dist/bundled/v3/components/OrStepper/OrStepper.js +3 -3
- package/dist/bundled/v3/components/OrStepper/OrStepper.vue.d.ts +16 -43
- package/dist/bundled/v3/components/OrStepper/index.js +2 -2
- package/dist/bundled/v3/components/OrSwitch/OrSwitch.js +5 -3
- package/dist/bundled/v3/components/OrSwitch/OrSwitch.vue.d.ts +12 -33
- package/dist/bundled/v3/components/OrSwitch/index.js +1 -1
- package/dist/bundled/v3/components/OrSwitchV3/OrSwitch.vue.d.ts +22 -53
- package/dist/bundled/v3/components/OrTab/OrTab.vue.d.ts +9 -22
- package/dist/bundled/v3/components/OrTabHeaderItem/OrTabHeaderItem.js +5 -3
- package/dist/bundled/v3/components/OrTabHeaderItem/OrTabHeaderItem.vue.d.ts +13 -29
- package/dist/bundled/v3/components/OrTabHeaderItem/index.js +1 -1
- package/dist/bundled/v3/components/OrTabV3/OrTab.vue.d.ts +10 -17
- package/dist/bundled/v3/components/OrTabs/OrTabs.js +3 -3
- package/dist/bundled/v3/components/OrTabs/OrTabs.vue.d.ts +4 -17
- package/dist/bundled/v3/components/OrTabs/index.js +2 -2
- package/dist/bundled/v3/components/OrTabsV3/OrTabs.js +6 -6
- package/dist/bundled/v3/components/OrTabsV3/OrTabs.vue.d.ts +24 -69
- package/dist/bundled/v3/components/OrTabsV3/index.js +5 -5
- package/dist/bundled/v3/components/OrTag/OrTag.js +5 -3
- package/dist/bundled/v3/components/OrTag/OrTag.vue.d.ts +10 -27
- package/dist/bundled/v3/components/OrTag/index.js +1 -1
- package/dist/bundled/v3/components/OrTagV3/OrTag.js +7 -7
- package/dist/bundled/v3/components/OrTagV3/OrTag.vue.d.ts +12 -23
- package/dist/bundled/v3/components/OrTagV3/index.js +6 -6
- package/dist/bundled/v3/components/OrTeleport/OrTeleport.vue3.vue.d.ts +4 -10
- package/dist/bundled/v3/components/OrTeleportV3/OrTeleport.vue3.vue.d.ts +4 -10
- package/dist/bundled/v3/components/OrTextV3/OrText.vue.d.ts +11 -24
- package/dist/bundled/v3/components/OrTextarea/OrTextarea.js +12 -6
- package/dist/bundled/v3/components/OrTextarea/OrTextarea.vue.d.ts +37 -85
- package/dist/bundled/v3/components/OrTextarea/index.js +2 -2
- package/dist/bundled/v3/components/OrTextareaV3/OrTextarea.vue.d.ts +32 -73
- package/dist/bundled/v3/components/OrTextbox/OrTextbox.js +22 -10
- package/dist/bundled/v3/components/OrTextbox/OrTextbox.vue.d.ts +55 -137
- package/dist/bundled/v3/components/OrTextbox/index.js +3 -3
- package/dist/bundled/v3/components/OrTimePickerV3/OrTimePicker.js +7 -7
- package/dist/bundled/v3/components/OrTimePickerV3/OrTimePicker.vue.d.ts +25 -79
- package/dist/bundled/v3/components/OrTimePickerV3/index.js +6 -6
- package/dist/bundled/v3/components/OrToast/OrToast.js +4 -2
- package/dist/bundled/v3/components/OrToast/OrToast.vue.d.ts +11 -31
- package/dist/bundled/v3/components/OrToast/composable/useToast.js +10 -5
- package/dist/bundled/v3/components/OrToast/index.js +2 -2
- package/dist/bundled/v3/components/OrToastContainer/OrToastContainer.js +3 -3
- package/dist/bundled/v3/components/OrToastContainer/OrToastContainer.vue.d.ts +25 -55
- package/dist/bundled/v3/components/OrToastContainer/index.js +2 -2
- package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.js +7 -7
- package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.vue.d.ts +24 -54
- package/dist/bundled/v3/components/OrToastContainerV3/index.js +6 -6
- package/dist/bundled/v3/components/OrToastV3/OrToast.js +8 -6
- package/dist/bundled/v3/components/OrToastV3/OrToast.vue.d.ts +16 -38
- package/dist/bundled/v3/components/OrToastV3/composable/useToast.js +10 -5
- package/dist/bundled/v3/components/OrToastV3/index.js +6 -6
- package/dist/bundled/v3/components/OrTooltip/OrTooltip.js +6 -2
- package/dist/bundled/v3/components/OrTooltip/OrTooltip.vue.d.ts +14 -33
- package/dist/bundled/v3/components/OrTooltipContent/OrTooltipContent.vue.d.ts +4 -10
- package/dist/bundled/v3/components/OrTooltipV3/OrTooltip.js +5 -5
- package/dist/bundled/v3/components/OrTooltipV3/OrTooltip.vue.d.ts +13 -37
- package/dist/bundled/v3/components/OrTooltipV3/index.js +4 -4
- package/dist/bundled/v3/components/index.js +66 -66
- package/dist/bundled/v3/directives/dropdown-close.d.ts +3 -1
- package/dist/bundled/v3/directives/dropdown-open.d.ts +3 -1
- package/dist/bundled/v3/hooks/useElevation.js +2 -1
- package/dist/bundled/v3/hooks/useOverflow.js +5 -4
- package/dist/bundled/v3/hooks/useResponsive/useResponsive.d.ts +2 -2
- package/dist/bundled/v3/hooks/useToggle.js +2 -1
- package/dist/bundled/{v2/index-6976c52a.js → v3/index-cf2c3c27.js} +1288 -735
- package/dist/bundled/v3/index.js +65 -65
- package/dist/bundled/{v2/lang-02d2bb2d.js → v3/lang-0fb8f78b.js} +275 -196
- package/dist/bundled/v3/utils/functions/color.js +2 -1
- package/dist/bundled/v3/utils/functions/flattenDeep.js +2 -1
- package/dist/esm/v2/{OrAvatar-12b0e276.js → OrAvatar-3df48865.js} +1 -1
- package/dist/esm/v2/{OrBottomSheet-7b8449e9.js → OrBottomSheet-ffa029ca.js} +9 -5
- package/dist/esm/v2/OrButton-b4a39652.js +195 -0
- package/dist/esm/v2/{OrButton-4e532ddb.js → OrButton-dbf0efe7.js} +1 -1
- package/dist/esm/v2/OrButton.vue_rollup-plugin-vue_styles.0-83b5a752.js +106 -0
- package/dist/esm/v2/{OrCardCollection-d92966db.js → OrCardCollection-722c83ce.js} +4 -4
- package/dist/esm/v2/{OrCardCollection-9bf513b7.js → OrCardCollection-fe8a1a88.js} +8 -7
- package/dist/esm/v2/{OrCarousel-e0c2e387.js → OrCarousel-5c2b2d10.js} +7 -1
- package/dist/esm/v2/{OrCheckbox-7b98fc08.js → OrCheckbox-03e5eaff.js} +4 -3
- package/dist/esm/v2/{OrCheckbox-60e4456b.js → OrCheckbox-59332f84.js} +4 -3
- package/dist/esm/v2/{OrCheckboxTree-85f8ec89.js → OrCheckboxTree-df80d4ab.js} +6 -5
- package/dist/esm/v2/{OrCode-e54e09f7.js → OrCode-0288dd2d.js} +8 -7
- package/dist/esm/v2/{OrCollapse-50e3914c.js → OrCollapse-57c64292.js} +6 -4
- package/dist/esm/v2/{OrColorPicker-fa92b4fa.js → OrColorPicker-ca470d10.js} +2 -1
- package/dist/esm/v2/{OrConfirm-61904137.js → OrConfirm-687e6730.js} +6 -5
- package/dist/esm/v2/{OrConfirm-5d5dd9bc.js → OrConfirm-b62d9ce4.js} +8 -7
- package/dist/esm/v2/{OrDatePicker-0870820f.js → OrDatePicker-f88f8950.js} +3 -3
- package/dist/esm/v2/{OrDateTimePicker-f2243479.js → OrDateTimePicker-32dae87a.js} +3 -3
- package/dist/esm/v2/{OrDateTimePicker-6e2853ec.js → OrDateTimePicker-77ef1975.js} +4 -4
- package/dist/esm/v2/{OrDateTimePickerMonthSelect-159efa66.js → OrDateTimePickerMonthSelect-bb583c5f.js} +7 -6
- package/dist/esm/v2/{OrIconButton-23972f7d.js → OrIconButton-83608cbc.js} +1 -1
- package/dist/esm/v2/{OrIconButton-0ecb9d8e.js → OrIconButton-d8fc2902.js} +2 -2
- package/dist/esm/v2/OrIconButton.vue_rollup-plugin-vue_styles.0-20b054cc.js +206 -0
- package/dist/esm/v2/{OrInlineInput-1e7f2ba2.js → OrInlineInput-46d0cc13.js} +1 -1
- package/dist/esm/v2/{OrInlineTextEdit-9541b625.js → OrInlineTextEdit-a129aaf1.js} +8 -7
- package/dist/esm/v2/{OrInlineTextarea-ab911736.js → OrInlineTextarea-c23c5fb2.js} +1 -1
- package/dist/esm/v2/{OrInput-27f35cd3.js → OrInput-61086e47.js} +1 -1
- package/dist/esm/v2/{OrInput-c005a759.js → OrInput-bc2371b6.js} +1 -1
- package/dist/esm/v2/{OrList-61c7b8ea.js → OrList-7de293f5.js} +8 -7
- package/dist/esm/v2/{OrListOfInputs-e1b09290.js → OrListOfInputs-fa926159.js} +5 -5
- package/dist/esm/v2/{OrMenu-b2a79308.js → OrMenu-63ed2235.js} +12 -6
- package/dist/esm/v2/{OrModal-b9cfb8ec.js → OrModal-3f09ae47.js} +7 -6
- package/dist/esm/v2/{OrModal-51519c0d.js → OrModal-a4c0fa77.js} +2 -2
- package/dist/esm/v2/{OrNotification-19cd0212.js → OrNotification-af62b848.js} +1 -1
- package/dist/esm/v2/{OrNotification-fdb88eec.js → OrNotification-bfa97981.js} +3 -3
- package/dist/esm/v2/{OrNumberInput-eb0e7087.js → OrNumberInput-5b1135df.js} +5 -4
- package/dist/esm/v2/{OrOverflowMenu-83540c76.js → OrOverflowMenu-13fac7a3.js} +8 -7
- package/dist/esm/v2/{OrOverlay-38acdcfa.js → OrOverlay-4c8c11e2.js} +1 -1
- package/dist/esm/v2/{OrPagination-9b58b74c.js → OrPagination-75e7cade.js} +2 -2
- package/dist/esm/v2/{OrPassword-022e10fd.js → OrPassword-82877067.js} +9 -8
- package/dist/esm/v2/{OrPopover-20cac769.js → OrPopover-50995dcf.js} +10 -6
- package/dist/esm/v2/{OrRadio-514e8de8.js → OrRadio-f53c0944.js} +4 -3
- package/dist/esm/v2/{OrSearch-620d5d76.js → OrSearch-330e9af0.js} +8 -7
- package/dist/esm/v2/{OrSearch-b30b29c1.js → OrSearch-7ccc1f33.js} +1 -1
- package/dist/esm/v2/{OrSelect-d887118b.js → OrSelect-22eea9cc.js} +1 -1
- package/dist/esm/v2/{OrSelect-4a54ac1c.js → OrSelect-9c8f96b2.js} +13 -9
- package/dist/esm/v2/{OrSidebar-b36f0d10.js → OrSidebar-b8387abe.js} +5 -4
- package/dist/esm/v2/{OrSidebarCollapseButton-3b46a709.js → OrSidebarCollapseButton-4bf3bad8.js} +1 -1
- package/dist/esm/v2/{OrStepper-b00f7531.js → OrStepper-2ae3fc21.js} +2 -2
- package/dist/esm/v2/{OrSwitch-cd24ee40.js → OrSwitch-e7fe2b86.js} +4 -3
- package/dist/esm/v2/{OrTabHeaderItem-6a08756e.js → OrTabHeaderItem-46947417.js} +4 -3
- package/dist/esm/v2/{OrTabs-12138346.js → OrTabs-1b314eeb.js} +6 -5
- package/dist/esm/v2/{OrTabs-54b66eb4.js → OrTabs-87069663.js} +10 -6
- package/dist/esm/v2/{OrTag-9c6caef5.js → OrTag-843ec724.js} +1 -1
- package/dist/esm/v2/{OrTag-6349049b.js → OrTag-8ded4261.js} +1 -1
- package/dist/esm/v2/{OrTextarea-724a4d6f.js → OrTextarea-226ab7a2.js} +1 -1
- package/dist/esm/v2/{OrTextbox-0373bd6a.js → OrTextbox-90badc95.js} +10 -9
- package/dist/esm/v2/{OrTimePicker-de9611da.js → OrTimePicker-33973321.js} +2 -2
- package/dist/esm/v2/{OrToastContainer-1625b803.js → OrToastContainer-2f530752.js} +4 -4
- package/dist/esm/v2/{OrTooltip-d08323f1.js → OrTooltip-93a3eefb.js} +1 -1
- package/dist/esm/{v3/color-1f348774.js → v2/color-40b7fe6b.js} +2 -1
- package/dist/esm/v2/components/index.js +66 -66
- package/dist/esm/v2/components/or-avatar-v3/index.js +2 -2
- package/dist/esm/v2/components/or-bottom-sheet-v3/index.js +3 -3
- package/dist/esm/v2/components/or-button/index.js +1 -1
- package/dist/esm/v2/components/or-button-v2/index.js +4 -4
- package/dist/esm/v2/components/or-card-collection/index.js +7 -7
- package/dist/esm/v2/components/or-card-collection-v3/index.js +10 -10
- package/dist/esm/v2/components/or-carousel/index.js +1 -1
- package/dist/esm/v2/components/or-checkbox/index.js +1 -1
- package/dist/esm/v2/components/or-checkbox-group-v3/index.js +7 -6
- package/dist/esm/v2/components/or-checkbox-tree-v3/index.js +3 -3
- package/dist/esm/v2/components/or-checkbox-v3/index.js +1 -1
- package/dist/esm/v2/components/or-code/index.js +5 -5
- package/dist/esm/v2/components/or-collapse/index.js +1 -1
- package/dist/esm/v2/components/or-color-picker/index.js +1 -1
- package/dist/esm/v2/components/or-confirm/index.js +8 -8
- package/dist/esm/v2/components/or-confirm-v3/index.js +8 -8
- package/dist/esm/v2/components/or-date-picker-v3/index.js +9 -9
- package/dist/esm/v2/components/or-date-time-picker/index.js +5 -5
- package/dist/esm/v2/components/or-date-time-picker-v3/index.js +9 -9
- package/dist/esm/v2/components/or-icon-button-v2/index.js +2 -2
- package/dist/esm/v2/components/or-icon-button-v3/index.js +6 -6
- package/dist/esm/v2/components/or-inline-input-v3/index.js +7 -7
- package/dist/esm/v2/components/or-inline-text-edit/index.js +5 -5
- package/dist/esm/v2/components/or-inline-textarea-v3/index.js +7 -7
- package/dist/esm/v2/components/or-input/index.js +2 -2
- package/dist/esm/v2/components/or-input-v3/index.js +7 -7
- package/dist/esm/v2/components/or-list/index.js +5 -5
- package/dist/esm/v2/components/or-list-of-inputs/index.js +8 -8
- package/dist/esm/v2/components/or-menu-v3/index.js +5 -5
- package/dist/esm/v2/components/or-modal/index.js +4 -4
- package/dist/esm/v2/components/or-modal-v3/index.js +7 -7
- package/dist/esm/v2/components/or-notification/index.js +4 -4
- package/dist/esm/v2/components/or-notification-v3/index.js +7 -7
- package/dist/esm/v2/components/or-number-input/index.js +3 -3
- package/dist/esm/v2/components/or-overflow-menu/index.js +5 -5
- package/dist/esm/v2/components/or-overlay-v3/index.js +2 -2
- package/dist/esm/v2/components/or-pagination-v3/index.js +6 -6
- package/dist/esm/v2/components/or-password/index.js +7 -7
- package/dist/esm/v2/components/or-popover-v3/index.js +4 -4
- package/dist/esm/v2/components/or-radio/index.js +1 -1
- package/dist/esm/v2/components/or-radio-group-v3/index.js +4 -3
- package/dist/esm/v2/components/or-search/index.js +6 -6
- package/dist/esm/v2/components/or-search-v3/index.js +8 -8
- package/dist/esm/v2/components/or-select/index.js +2 -2
- package/dist/esm/v2/components/or-select-v3/index.js +11 -11
- package/dist/esm/v2/components/or-sidebar-v3/index.js +8 -8
- package/dist/esm/v2/components/or-sidebar-v3/partials/index.js +7 -7
- package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +7 -7
- package/dist/esm/v2/components/or-stepper/index.js +4 -4
- package/dist/esm/v2/components/or-switch/index.js +1 -1
- package/dist/esm/v2/components/or-tab-header-item/index.js +1 -1
- package/dist/esm/v2/components/or-tabs/index.js +2 -2
- package/dist/esm/v2/components/or-tabs-v3/index.js +6 -6
- package/dist/esm/v2/components/or-tag/index.js +2 -2
- package/dist/esm/v2/components/or-tag-v3/index.js +7 -7
- package/dist/esm/v2/components/or-text-v3/OrText.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-textarea/OrTextarea.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-textarea/index.js +2 -2
- package/dist/esm/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-textbox/OrTextbox.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-textbox/index.js +6 -6
- package/dist/esm/v2/components/or-time-picker-v3/OrTimePicker.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-time-picker-v3/index.js +7 -7
- package/dist/esm/v2/components/or-toast/OrToast.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-toast/composable/index.js +1 -1
- package/dist/esm/v2/components/or-toast/index.js +5 -5
- package/dist/esm/v2/components/or-toast/or-toast-container/OrToastContainer.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-toast/or-toast-container/index.js +5 -5
- package/dist/esm/v2/components/or-toast-v3/OrToast.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-toast-v3/composable/index.js +1 -1
- package/dist/esm/v2/components/or-toast-v3/index.js +8 -8
- package/dist/esm/v2/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-toast-v3/or-toast-container-v3/index.js +8 -8
- package/dist/esm/v2/components/or-tooltip/OrTooltip.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-tooltip/or-tooltip-content/OrTooltipContent.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-tooltip-v3/OrTooltip.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-tooltip-v3/index.js +5 -5
- package/dist/esm/{v3/flattenDeep-e7a8b995.js → v2/flattenDeep-fe0af413.js} +2 -1
- package/dist/esm/v2/hooks/index.js +3 -3
- package/dist/esm/v2/index.js +67 -67
- package/dist/esm/v2/{types-483890e4.js → types-13f5380a.js} +9 -6
- package/dist/esm/{v3/useElevation-df91fa50.js → v2/useElevation-b5a49746.js} +2 -1
- package/dist/esm/{v3/useOverflow-af6161c8.js → v2/useOverflow-c856b7b7.js} +5 -4
- package/dist/esm/{v3/useToast-0665462d.js → v2/useToast-a1332cc2.js} +10 -5
- package/dist/esm/v2/{useToast-4fbe0e5a.js → useToast-b5ea5cb2.js} +10 -5
- package/dist/esm/v2/{useToggle-29e4d7c7.js → useToggle-c04fc920.js} +2 -1
- package/dist/esm/v3/{OrAvatar-1ebca2e8.js → OrAvatar-3ccb5f60.js} +1 -1
- package/dist/esm/v3/{OrAvatar-14a5c5f0.js → OrAvatar-8a73221d.js} +7 -3
- package/dist/esm/v3/{OrBottomSheet-e491689f.js → OrBottomSheet-5969a217.js} +9 -5
- package/dist/esm/v3/OrButton-49605f5c.js +162 -0
- package/dist/esm/v3/OrButton-d6834ea0.js +142 -0
- package/dist/esm/v3/{OrCardCollection-a0cc4895.js → OrCardCollection-b319b723.js} +4 -4
- package/dist/esm/v3/{OrCardCollection-ffbb9eda.js → OrCardCollection-d79dac85.js} +8 -7
- package/dist/esm/v3/{OrCarousel-03597740.js → OrCarousel-4fb775f8.js} +8 -2
- package/dist/esm/v3/{OrCheckbox-247ce27b.js → OrCheckbox-56d7b6eb.js} +7 -4
- package/dist/esm/v3/{OrCheckbox-7efd5f26.js → OrCheckbox-ab457011.js} +11 -6
- package/dist/esm/v3/{OrCheckboxTree-ed8b5f53.js → OrCheckboxTree-4a85b9b3.js} +6 -5
- package/dist/esm/v3/{OrChip-97a85e10.js → OrChip-1b479371.js} +4 -2
- package/dist/esm/v3/{OrChips-64b86761.js → OrChips-544a35b3.js} +4 -2
- package/dist/esm/v3/{OrCode-6f2e4d99.js → OrCode-48281fc0.js} +7 -6
- package/dist/esm/v3/{OrCollapse-37a52e8f.js → OrCollapse-2b31de04.js} +6 -4
- package/dist/esm/v3/{OrColorPicker-9a149e6b.js → OrColorPicker-ffaaf14f.js} +5 -2
- package/dist/esm/v3/{OrConfirm-c497fe8e.js → OrConfirm-017b80b5.js} +6 -5
- package/dist/esm/v3/{OrConfirm-ab04201f.js → OrConfirm-1a94bdea.js} +8 -7
- package/dist/esm/v3/{OrDatePicker-b4e92bf3.js → OrDatePicker-09a6c970.js} +3 -3
- package/dist/esm/v3/{OrDateTimePicker-014f7819.js → OrDateTimePicker-2af19719.js} +9 -5
- package/dist/esm/v3/{OrDateTimePicker-cd4741af.js → OrDateTimePicker-40e08446.js} +3 -3
- package/dist/esm/v3/{OrDateTimePickerMonthSelect-9fb0b634.js → OrDateTimePickerMonthSelect-45e637e4.js} +7 -6
- package/dist/esm/v3/{OrIcon-925c5413.js → OrIcon-b566a871.js} +7 -3
- package/dist/esm/v3/OrIconButton-049a3bd2.js +223 -0
- package/dist/esm/v3/{OrIconButton-6c3fafc2.js → OrIconButton-55d51a7a.js} +2 -2
- package/dist/esm/v3/{OrInlineInput-6209e8c8.js → OrInlineInput-9ed7d570.js} +7 -3
- package/dist/esm/v3/{OrInlineTextEdit-6f97629f.js → OrInlineTextEdit-4f4ecba4.js} +31 -14
- package/dist/esm/v3/{OrInlineTextarea-1c36f763.js → OrInlineTextarea-f30d0580.js} +7 -3
- package/dist/esm/v3/{OrInput-0dbd5a01.js → OrInput-53a32706.js} +10 -4
- package/dist/esm/v3/{OrInput-4215a3d8.js → OrInput-de491b63.js} +1 -1
- package/dist/esm/v3/{OrList-b8799cf4.js → OrList-0543a645.js} +8 -7
- package/dist/esm/v3/{OrListOfInputs-16ba8358.js → OrListOfInputs-2fc8087c.js} +61 -52
- package/dist/esm/v3/{OrMenu-45a1dc3e.js → OrMenu-bce8349d.js} +15 -7
- package/dist/esm/v3/{OrModal-6ff24390.js → OrModal-0908f20a.js} +2 -2
- package/dist/esm/v3/{OrModal-e6513e8c.js → OrModal-c420594e.js} +6 -5
- package/dist/esm/v3/{OrNotification-4c56f7ea.js → OrNotification-9a696585.js} +3 -3
- package/dist/esm/v3/{OrNotification-0a674902.js → OrNotification-cdce5546.js} +1 -1
- package/dist/esm/v3/{OrNumberInput-dca5e850.js → OrNumberInput-a80859d1.js} +5 -4
- package/dist/esm/v3/{OrOverflowMenu-fe77e22c.js → OrOverflowMenu-4b2d2950.js} +6 -5
- package/dist/esm/v3/{OrOverlay-d63d39c3.js → OrOverlay-bf72f582.js} +1 -1
- package/dist/esm/v3/{OrPagination-5846675e.js → OrPagination-7d223695.js} +2 -2
- package/dist/esm/v3/{OrPassword-9c8a458d.js → OrPassword-35c5775f.js} +8 -7
- package/dist/esm/v3/{OrPopover-0635cb63.js → OrPopover-84d5b844.js} +10 -6
- package/dist/esm/v3/{OrRadio-c3ab11f2.js → OrRadio-dfd0f0c9.js} +7 -4
- package/dist/esm/v3/{OrSearch-2770023a.js → OrSearch-e15c7fd2.js} +1 -1
- package/dist/esm/v3/{OrSearch-c4caf04e.js → OrSearch-f4ad73db.js} +7 -6
- package/dist/esm/v3/{OrSegmentedControl-4587c7a9.js → OrSegmentedControl-359fbf3a.js} +3 -1
- package/dist/esm/v3/{OrSelect-d8a78242.js → OrSelect-6ff34196.js} +10 -6
- package/dist/esm/v3/{OrSelect-2d486470.js → OrSelect-b1d7651a.js} +13 -9
- package/dist/esm/v3/{OrSidebar-b9747293.js → OrSidebar-bfd19c4c.js} +5 -4
- package/dist/esm/v3/{OrSidebarCollapseButton-3d9c827c.js → OrSidebarCollapseButton-63914891.js} +1 -1
- package/dist/esm/v3/{OrSlider-80e0f2e6.js → OrSlider-c3778aa7.js} +16 -4
- package/dist/esm/v3/{OrStepper-3a586401.js → OrStepper-fedc1cca.js} +2 -2
- package/dist/esm/v3/{OrSwitch-c333ee32.js → OrSwitch-3fca7e24.js} +7 -4
- package/dist/esm/v3/{OrTabHeaderItem-d668cc59.js → OrTabHeaderItem-3bb0b711.js} +7 -4
- package/dist/esm/v3/{OrTabs-d3812c11.js → OrTabs-35a376a3.js} +6 -5
- package/dist/esm/v3/{OrTabs-f61d6f85.js → OrTabs-3d9c1a8b.js} +10 -6
- package/dist/esm/v3/{OrTag-e7adb078.js → OrTag-2d9eacf8.js} +5 -3
- package/dist/esm/v3/{OrTag-da570522.js → OrTag-6116c6e3.js} +1 -1
- package/dist/esm/v3/{OrTextarea-de1ecb0f.js → OrTextarea-f6722edc.js} +10 -4
- package/dist/esm/v3/{OrTextbox-f7388a30.js → OrTextbox-6e585202.js} +27 -14
- package/dist/esm/v3/{OrTimePicker-6a280973.js → OrTimePicker-ed83bc3f.js} +2 -2
- package/dist/esm/v3/{OrToastContainer-94ba2803.js → OrToastContainer-24839efd.js} +6 -4
- package/dist/esm/v3/{OrTooltip-a38adced.js → OrTooltip-4bb0054a.js} +1 -1
- package/dist/esm/v3/{OrTooltip-618ce7c9.js → OrTooltip-89ce98e8.js} +6 -2
- package/dist/esm/{v2/color-1f348774.js → v3/color-40b7fe6b.js} +2 -1
- package/dist/esm/v3/components/index.js +71 -71
- package/dist/esm/v3/components/or-avatar/OrAvatar.vue.d.ts +11 -26
- package/dist/esm/v3/components/or-avatar/index.js +3 -3
- package/dist/esm/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +8 -24
- package/dist/esm/v3/components/or-avatar-v3/index.js +2 -2
- package/dist/esm/v3/components/or-bottom-sheet-v3/OrBottomSheet.vue.d.ts +20 -33
- package/dist/esm/v3/components/or-bottom-sheet-v3/index.js +3 -3
- package/dist/esm/v3/components/or-button/OrButton.vue.d.ts +16 -51
- package/dist/esm/v3/components/or-button/index.js +1 -1
- package/dist/esm/v3/components/or-button-v2/OrButton.vue.d.ts +20 -57
- package/dist/esm/v3/components/or-button-v2/index.js +4 -4
- package/dist/esm/v3/components/or-button-v3/OrButton.vue.d.ts +15 -35
- package/dist/esm/v3/components/or-card/OrCard.vue.d.ts +7 -15
- package/dist/esm/v3/components/or-card-collection/OrCardCollection.vue.d.ts +21 -47
- package/dist/esm/v3/components/or-card-collection/index.js +8 -8
- package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +22 -70
- package/dist/esm/v3/components/or-card-collection-v3/index.js +10 -10
- package/dist/esm/v3/components/or-card-collection-v3/partials/OrCardCollectionView.vue3.vue.d.ts +6 -14
- package/dist/esm/v3/components/or-card-v3/OrCard.vue.d.ts +4 -7
- package/dist/esm/v3/components/or-carousel/OrCarousel.vue.d.ts +126 -676
- package/dist/esm/v3/components/or-carousel/index.js +3 -3
- package/dist/esm/v3/components/or-carousel/or-carousel-item/OrCarouselItem.vue.d.ts +1 -1
- package/dist/esm/v3/components/or-checkbox/OrCheckbox.vue.d.ts +15 -35
- package/dist/esm/v3/components/or-checkbox/index.js +3 -3
- package/dist/esm/v3/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +6 -24
- package/dist/esm/v3/components/or-checkbox-group-v3/index.js +7 -6
- package/dist/esm/v3/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +17 -43
- package/dist/esm/v3/components/or-checkbox-tree-v3/index.js +3 -3
- package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +23 -53
- package/dist/esm/v3/components/or-checkbox-v3/index.js +1 -1
- package/dist/esm/v3/components/or-chips/OrChips.vue.d.ts +24 -51
- package/dist/esm/v3/components/or-chips/index.js +4 -4
- package/dist/esm/v3/components/or-chips/or-chip/OrChip.vue.d.ts +9 -25
- package/dist/esm/v3/components/or-chips/or-chip/index.js +3 -3
- package/dist/esm/v3/components/or-chips/partials/OrChipsInput.vue.d.ts +17 -37
- package/dist/esm/v3/components/or-code/OrCode.vue.d.ts +24 -69
- package/dist/esm/v3/components/or-code/index.js +6 -6
- package/dist/esm/v3/components/or-collapse/OrCollapse.vue.d.ts +17 -39
- package/dist/esm/v3/components/or-collapse/index.js +1 -1
- package/dist/esm/v3/components/or-color-picker/OrColorPicker.vue.d.ts +13 -31
- package/dist/esm/v3/components/or-color-picker/index.js +1 -1
- package/dist/esm/v3/components/or-combined-input-v3/OrCombinedInput.vue.d.ts +8 -30
- package/dist/esm/v3/components/or-confirm/OrConfirm.vue.d.ts +23 -84
- package/dist/esm/v3/components/or-confirm/index.js +8 -8
- package/dist/esm/v3/components/or-confirm-v3/OrConfirm.vue.d.ts +29 -91
- package/dist/esm/v3/components/or-confirm-v3/index.js +8 -8
- package/dist/esm/v3/components/or-date-picker-v3/OrDatePicker.vue.d.ts +25 -81
- package/dist/esm/v3/components/or-date-picker-v3/index.js +9 -9
- package/dist/esm/v3/components/or-date-time-picker/OrDateTimePicker.vue.d.ts +68 -177
- package/dist/esm/v3/components/or-date-time-picker/index.js +6 -6
- package/dist/esm/v3/components/or-date-time-picker/partials/OrDateTimePickerCalendarItem.vue.d.ts +12 -33
- package/dist/esm/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +31 -105
- package/dist/esm/v3/components/or-date-time-picker-v3/index.js +9 -9
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-control/OrDateTimePickerDateControl.vue.d.ts +11 -28
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts +17 -39
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/OrDateTimePickerMobileControl.vue.d.ts +7 -15
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +23 -85
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/OrDateTimePickerPopoverFooter.vue.d.ts +7 -11
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/OrDateTimePickerPopoverHeader.vue.d.ts +4 -7
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-control/OrDateTimePickerTimeControl.vue.d.ts +11 -28
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +15 -37
- package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +11 -28
- package/dist/esm/v3/components/or-error/OrError.vue.d.ts +4 -8
- package/dist/esm/v3/components/or-error-tag-v3/OrErrorTag.vue.d.ts +4 -7
- package/dist/esm/v3/components/or-error-v3/OrError.vue.d.ts +9 -18
- package/dist/esm/v3/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +14 -35
- package/dist/esm/v3/components/or-fab-v3/OrFab.vue.d.ts +8 -20
- package/dist/esm/v3/components/or-floating/OrFloating.vue.d.ts +15 -46
- package/dist/esm/v3/components/or-form-group-v3/OrFormGroup.vue.d.ts +10 -30
- package/dist/esm/v3/components/or-hint/OrHint.vue.d.ts +4 -8
- package/dist/esm/v3/components/or-hint-v3/OrHint.vue.d.ts +9 -18
- package/dist/esm/v3/components/or-icon/OrIcon.vue.d.ts +16 -44
- package/dist/esm/v3/components/or-icon/index.js +2 -2
- package/dist/esm/v3/components/or-icon-button-v2/OrIconButton.vue.d.ts +13 -43
- package/dist/esm/v3/components/or-icon-button-v2/index.js +3 -3
- package/dist/esm/v3/components/or-icon-button-v2/partials/OrTooltipWrapper.vue.d.ts +8 -10
- package/dist/esm/v3/components/or-icon-button-v3/OrIconButton.vue.d.ts +16 -52
- package/dist/esm/v3/components/or-icon-button-v3/index.js +6 -6
- package/dist/esm/v3/components/or-icon-v3/OrIcon.vue.d.ts +7 -18
- package/dist/esm/v3/components/or-inline-input-box-v3/OrInlineInputBox.vue.d.ts +7 -16
- package/dist/esm/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +39 -83
- package/dist/esm/v3/components/or-inline-input-v3/index.js +7 -7
- package/dist/esm/v3/components/or-inline-text-edit/OrInlineTextEdit.vue.d.ts +43 -95
- package/dist/esm/v3/components/or-inline-text-edit/index.js +6 -6
- package/dist/esm/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +39 -79
- package/dist/esm/v3/components/or-inline-textarea-v3/index.js +7 -7
- package/dist/esm/v3/components/or-input/OrInput.vue.d.ts +36 -87
- package/dist/esm/v3/components/or-input/index.js +2 -2
- package/dist/esm/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +7 -22
- package/dist/esm/v3/components/or-input-v3/OrInput.vue.d.ts +34 -85
- package/dist/esm/v3/components/or-input-v3/index.js +7 -7
- package/dist/esm/v3/components/or-label/OrLabel.vue.d.ts +9 -20
- package/dist/esm/v3/components/or-label-v3/OrLabel.vue.d.ts +9 -24
- package/dist/esm/v3/components/or-link-v3/OrLink.vue.d.ts +7 -24
- package/dist/esm/v3/components/or-list/OrList.vue.d.ts +21 -47
- package/dist/esm/v3/components/or-list/index.js +5 -5
- package/dist/esm/v3/components/or-list-of-inputs/OrListOfInputs.vue.d.ts +11 -27
- package/dist/esm/v3/components/or-list-of-inputs/index.js +8 -8
- package/dist/esm/v3/components/or-loader/OrLoader.vue.d.ts +10 -26
- package/dist/esm/v3/components/or-loader-v3/OrLoader.vue.d.ts +13 -34
- package/dist/esm/v3/components/or-menu-item-v3/OrMenuItem.vue.d.ts +13 -34
- package/dist/esm/v3/components/or-menu-v3/OrMenu.vue.d.ts +16 -43
- package/dist/esm/v3/components/or-menu-v3/index.js +5 -5
- package/dist/esm/v3/components/or-modal/OrModal.vue.d.ts +14 -38
- package/dist/esm/v3/components/or-modal/index.js +5 -5
- package/dist/esm/v3/components/or-modal-v3/OrModal.vue.d.ts +13 -27
- package/dist/esm/v3/components/or-modal-v3/index.js +7 -7
- package/dist/esm/v3/components/or-notification/OrNotification.vue.d.ts +9 -27
- package/dist/esm/v3/components/or-notification/index.js +5 -5
- package/dist/esm/v3/components/or-notification-v3/OrNotification.vue.d.ts +9 -20
- package/dist/esm/v3/components/or-notification-v3/index.js +7 -7
- package/dist/esm/v3/components/or-number-input/OrNumberInput.vue.d.ts +24 -70
- package/dist/esm/v3/components/or-number-input/index.js +3 -3
- package/dist/esm/v3/components/or-overflow-menu/OrOverflowMenu.vue.d.ts +13 -31
- package/dist/esm/v3/components/or-overflow-menu/index.js +5 -5
- package/dist/esm/v3/components/or-overflow-menu/partials/OrOverflowMenuItem.vue.d.ts +7 -23
- package/dist/esm/v3/components/or-overlay/OrOverlay.vue.d.ts +6 -16
- package/dist/esm/v3/components/or-overlay-v3/OrOverlay.vue.d.ts +7 -14
- package/dist/esm/v3/components/or-overlay-v3/index.js +2 -2
- package/dist/esm/v3/components/or-pagination-v3/OrPagination.vue.d.ts +27 -75
- package/dist/esm/v3/components/or-pagination-v3/index.js +6 -6
- package/dist/esm/v3/components/or-password/OrPassword.vue.d.ts +22 -63
- package/dist/esm/v3/components/or-password/index.js +8 -8
- package/dist/esm/v3/components/or-popover-v3/OrPopover.vue.d.ts +27 -74
- package/dist/esm/v3/components/or-popover-v3/index.js +4 -4
- package/dist/esm/v3/components/or-progress/OrProgress.vue.d.ts +20 -56
- package/dist/esm/v3/components/or-progress-v3/OrProgress.vue.d.ts +25 -62
- package/dist/esm/v3/components/or-radio/OrRadio.vue.d.ts +13 -35
- package/dist/esm/v3/components/or-radio/index.js +1 -1
- package/dist/esm/v3/components/or-radio-group/OrRadioGroup.vue.d.ts +9 -26
- package/dist/esm/v3/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +6 -32
- package/dist/esm/v3/components/or-radio-group-v3/index.js +4 -3
- package/dist/esm/v3/components/or-radio-v3/OrRadio.vue.d.ts +21 -49
- package/dist/esm/v3/components/or-search/OrSearch.vue.d.ts +23 -65
- package/dist/esm/v3/components/or-search/index.js +7 -7
- package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +17 -41
- package/dist/esm/v3/components/or-search-v3/index.js +8 -8
- package/dist/esm/v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +9 -25
- package/dist/esm/v3/components/or-segmented-control-v3/index.js +1 -1
- package/dist/esm/v3/components/or-segmented-control-v3/partials/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +8 -20
- package/dist/esm/v3/components/or-select/OrSelect.vue.d.ts +28 -77
- package/dist/esm/v3/components/or-select/index.js +6 -6
- package/dist/esm/v3/components/or-select/partials/OrSelectContent.vue.d.ts +18 -49
- package/dist/esm/v3/components/or-select/partials/OrSelectContentEmpty.vue.d.ts +4 -16
- package/dist/esm/v3/components/or-select/partials/OrSelectContentOptions.vue.d.ts +13 -67
- package/dist/esm/v3/components/or-select/partials/OrSelectInput.vue.d.ts +16 -41
- package/dist/esm/v3/components/or-select/partials/OrSelectInputValue.vue.d.ts +16 -35
- package/dist/esm/v3/components/or-select/partials/OrSelectMain.vue.d.ts +24 -71
- package/dist/esm/v3/components/or-select/partials/OrSelectOption.vue.d.ts +7 -19
- package/dist/esm/v3/components/or-select/partials/OrSelectSearchOptions.vue.d.ts +11 -24
- package/dist/esm/v3/components/or-select-v3/OrSelect.vue.d.ts +37 -115
- package/dist/esm/v3/components/or-select-v3/index.js +11 -11
- package/dist/esm/v3/components/or-sidebar/OrSidebar.vue.d.ts +14 -33
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +28 -63
- package/dist/esm/v3/components/or-sidebar-v3/index.js +8 -8
- package/dist/esm/v3/components/or-sidebar-v3/partials/index.js +7 -7
- package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue.d.ts +10 -23
- package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +7 -7
- package/dist/esm/v3/components/or-skeleton/or-skeleton-circle/OrSkeletonCircle.vue.d.ts +9 -20
- package/dist/esm/v3/components/or-skeleton/or-skeleton-rect/OrSkeletonRect.vue.d.ts +9 -22
- package/dist/esm/v3/components/or-skeleton/or-skeleton-text/OrSkeletonText.vue.d.ts +10 -26
- package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-circle-v3/OrSkeletonCircle.vue.d.ts +13 -28
- package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-rect-v3/OrSkeletonRect.vue.d.ts +11 -26
- package/dist/esm/v3/components/or-skeleton-v3/or-skeleton-text-v3/OrSkeletonText.vue.d.ts +16 -40
- package/dist/esm/v3/components/or-slider/OrSlider.vue.d.ts +35 -91
- package/dist/esm/v3/components/or-slider/index.js +3 -3
- package/dist/esm/v3/components/or-sort-header-v3/OrSortHeader.vue.d.ts +13 -25
- package/dist/esm/v3/components/or-stepper/OrStepper.vue.d.ts +16 -43
- package/dist/esm/v3/components/or-stepper/index.js +5 -5
- package/dist/esm/v3/components/or-stepper/partials/OrStepperButtonOptions.vue.d.ts +4 -20
- package/dist/esm/v3/components/or-stepper/partials/OrStepperOptionHorizontal.vue.d.ts +4 -26
- package/dist/esm/v3/components/or-stepper/partials/OrStepperOptionVertical.vue.d.ts +4 -26
- package/dist/esm/v3/components/or-stepper/partials/OrStepperTitle.vue.d.ts +6 -22
- package/dist/esm/v3/components/or-stepper/partials/StatusIcon.vue.d.ts +6 -12
- package/dist/esm/v3/components/or-switch/OrSwitch.vue.d.ts +12 -33
- package/dist/esm/v3/components/or-switch/index.js +1 -1
- package/dist/esm/v3/components/or-switch-v3/OrSwitch.vue.d.ts +22 -53
- package/dist/esm/v3/components/or-tab/OrTab.vue.d.ts +9 -22
- package/dist/esm/v3/components/or-tab-header-item/OrTabHeaderItem.vue.d.ts +13 -29
- package/dist/esm/v3/components/or-tab-header-item/index.js +1 -1
- package/dist/esm/v3/components/or-tab-v3/OrTab.vue.d.ts +10 -17
- package/dist/esm/v3/components/or-tabs/OrTabs.vue.d.ts +4 -17
- package/dist/esm/v3/components/or-tabs/index.js +2 -2
- package/dist/esm/v3/components/or-tabs-v3/OrTabs.vue.d.ts +24 -69
- package/dist/esm/v3/components/or-tabs-v3/index.js +6 -6
- package/dist/esm/v3/components/or-tag/OrTag.vue.d.ts +10 -27
- package/dist/esm/v3/components/or-tag/index.js +4 -4
- package/dist/esm/v3/components/or-tag-v3/OrTag.vue.d.ts +12 -23
- package/dist/esm/v3/components/or-tag-v3/index.js +7 -7
- package/dist/esm/v3/components/or-teleport/OrTeleport.vue3.vue.d.ts +4 -10
- package/dist/esm/v3/components/or-teleport-v3/OrTeleport.vue3.vue.d.ts +4 -10
- package/dist/esm/v3/components/or-text-v3/OrText.vue.d.ts +11 -24
- package/dist/esm/v3/components/or-textarea/OrTextarea.vue.d.ts +37 -85
- package/dist/esm/v3/components/or-textarea/index.js +2 -2
- package/dist/esm/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +32 -73
- package/dist/esm/v3/components/or-textbox/OrTextbox.vue.d.ts +55 -137
- package/dist/esm/v3/components/or-textbox/index.js +7 -7
- package/dist/esm/v3/components/or-time-picker-v3/OrTimePicker.vue.d.ts +25 -79
- package/dist/esm/v3/components/or-time-picker-v3/index.js +7 -7
- package/dist/esm/v3/components/or-toast/OrToast.vue.d.ts +11 -31
- package/dist/esm/v3/components/or-toast/composable/index.js +1 -1
- package/dist/esm/v3/components/or-toast/index.js +6 -6
- package/dist/esm/v3/components/or-toast/or-toast-container/OrToastContainer.vue.d.ts +25 -55
- package/dist/esm/v3/components/or-toast/or-toast-container/index.js +6 -6
- package/dist/esm/v3/components/or-toast-v3/OrToast.vue.d.ts +16 -38
- package/dist/esm/v3/components/or-toast-v3/composable/index.js +1 -1
- package/dist/esm/v3/components/or-toast-v3/index.js +8 -8
- package/dist/esm/v3/components/or-toast-v3/or-toast-container-v3/OrToastContainer.vue.d.ts +24 -54
- package/dist/esm/v3/components/or-toast-v3/or-toast-container-v3/index.js +8 -8
- package/dist/esm/v3/components/or-tooltip/OrTooltip.vue.d.ts +14 -33
- package/dist/esm/v3/components/or-tooltip/index.js +1 -1
- package/dist/esm/v3/components/or-tooltip/or-tooltip-content/OrTooltipContent.vue.d.ts +4 -10
- package/dist/esm/v3/components/or-tooltip-v3/OrTooltip.vue.d.ts +13 -37
- package/dist/esm/v3/components/or-tooltip-v3/index.js +5 -5
- package/dist/esm/v3/directives/dropdown-close.d.ts +3 -1
- package/dist/esm/v3/directives/dropdown-open.d.ts +3 -1
- package/dist/esm/{v2/flattenDeep-e7a8b995.js → v3/flattenDeep-fe0af413.js} +2 -1
- package/dist/esm/v3/hooks/index.js +3 -3
- package/dist/esm/v3/hooks/useResponsive/useResponsive.d.ts +2 -2
- package/dist/esm/v3/index.js +72 -72
- package/dist/esm/v3/{types-af3e3f9c.js → types-3a885bea.js} +12 -7
- package/dist/esm/{v2/useElevation-df91fa50.js → v3/useElevation-b5a49746.js} +2 -1
- package/dist/esm/{v2/useOverflow-af6161c8.js → v3/useOverflow-c856b7b7.js} +5 -4
- package/dist/esm/{v2/useToast-0665462d.js → v3/useToast-a1332cc2.js} +10 -5
- package/dist/esm/v3/{useToast-4fbe0e5a.js → useToast-b5ea5cb2.js} +10 -5
- package/dist/esm/v3/{useToggle-29e4d7c7.js → useToggle-c04fc920.js} +2 -1
- package/package.json +6 -7
- package/dist/esm/v2/OrButton-549e8852.js +0 -195
- package/dist/esm/v2/OrButton.vue_rollup-plugin-vue_styles.0-48c5883e.js +0 -106
- package/dist/esm/v2/OrIconButton.vue_rollup-plugin-vue_styles.0-277ce06c.js +0 -205
- package/dist/esm/v3/OrButton-f8b10d79.js +0 -142
- package/dist/esm/v3/OrButton-fca9019a.js +0 -162
- package/dist/esm/v3/OrIconButton-5387fd59.js +0 -222
- /package/dist/bundled/v2/{index-63e094a0.js → index-968c331a.js} +0 -0
- /package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-6511e348.js → OrAvatar.vue_vue_type_script_lang-2d5de9d4.js} +0 -0
- /package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-623c32a1.js → OrAvatar.vue_vue_type_script_lang-8d7ce473.js} +0 -0
- /package/dist/bundled/v3/{OrButton.vue_vue_type_script_lang-da7f7ed0.js → OrButton.vue_vue_type_script_lang-4f44f547.js} +0 -0
- /package/dist/bundled/v3/{OrChip.vue_vue_type_script_lang-5a390853.js → OrChip.vue_vue_type_script_lang-185d8d45.js} +0 -0
- /package/dist/bundled/v3/{OrColorPicker.vue_vue_type_script_lang-3a799e23.js → OrColorPicker.vue_vue_type_script_lang-d8588b52.js} +0 -0
- /package/dist/bundled/v3/{OrOverlay.vue_vue_type_script_lang-47004a50.js → OrOverlay.vue_vue_type_script_lang-86c7b93a.js} +0 -0
- /package/dist/bundled/v3/{OrSlider.vue_vue_type_script_lang-45ecddbe.js → OrSlider.vue_vue_type_script_lang-7234ab75.js} +0 -0
- /package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-621e9307.js → OrTag.vue_vue_type_script_lang-4e98d8a0.js} +0 -0
- /package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-70cc38be.js → OrToastContainer.vue_vue_type_script_lang-b8184db5.js} +0 -0
- /package/dist/bundled/v3/{index-63e094a0.js → index-968c331a.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
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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(
|
|
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
|
|
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,12 @@ class ContentView {
|
|
|
4522
4586
|
get isEditable() {
|
|
4523
4587
|
return true;
|
|
4524
4588
|
}
|
|
4589
|
+
get isWidget() {
|
|
4590
|
+
return false;
|
|
4591
|
+
}
|
|
4592
|
+
get isHidden() {
|
|
4593
|
+
return false;
|
|
4594
|
+
}
|
|
4525
4595
|
merge(from, to, source, hasStart, openStart, openEnd) {
|
|
4526
4596
|
return false;
|
|
4527
4597
|
}
|
|
@@ -4555,7 +4625,8 @@ class ChildCursor {
|
|
|
4555
4625
|
this.i = i;
|
|
4556
4626
|
this.off = 0;
|
|
4557
4627
|
}
|
|
4558
|
-
findPos(pos
|
|
4628
|
+
findPos(pos) {
|
|
4629
|
+
let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
4559
4630
|
for (;;) {
|
|
4560
4631
|
if (pos > this.pos || pos == this.pos && (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) {
|
|
4561
4632
|
this.off = pos - this.pos;
|
|
@@ -4695,7 +4766,7 @@ class TextView extends ContentView {
|
|
|
4695
4766
|
createDOM(textDOM) {
|
|
4696
4767
|
this.setDOM(textDOM || document.createTextNode(this.text));
|
|
4697
4768
|
}
|
|
4698
|
-
sync(track) {
|
|
4769
|
+
sync(view, track) {
|
|
4699
4770
|
if (!this.dom) this.createDOM();
|
|
4700
4771
|
if (this.dom.nodeValue != this.text) {
|
|
4701
4772
|
if (track && track.node == this.dom) track.written = true;
|
|
@@ -4736,7 +4807,9 @@ class TextView extends ContentView {
|
|
|
4736
4807
|
}
|
|
4737
4808
|
}
|
|
4738
4809
|
class MarkView extends ContentView {
|
|
4739
|
-
constructor(mark
|
|
4810
|
+
constructor(mark) {
|
|
4811
|
+
let children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
4812
|
+
let length = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
4740
4813
|
super();
|
|
4741
4814
|
this.mark = mark;
|
|
4742
4815
|
this.children = children;
|
|
@@ -4756,9 +4829,9 @@ class MarkView extends ContentView {
|
|
|
4756
4829
|
}
|
|
4757
4830
|
}
|
|
4758
4831
|
|
|
4759
|
-
sync(track) {
|
|
4832
|
+
sync(view, track) {
|
|
4760
4833
|
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);
|
|
4834
|
+
super.sync(view, track);
|
|
4762
4835
|
}
|
|
4763
4836
|
merge(from, to, source, _hasStart, openStart, openEnd) {
|
|
4764
4837
|
if (source && (!(source instanceof MarkView && source.mark.eq(this.mark)) || from && openStart <= 0 || to < this.length && openEnd <= 0)) return false;
|
|
@@ -4837,11 +4910,11 @@ class WidgetView extends ContentView {
|
|
|
4837
4910
|
this.length -= from;
|
|
4838
4911
|
return result;
|
|
4839
4912
|
}
|
|
4840
|
-
sync() {
|
|
4841
|
-
if (!this.dom || !this.widget.updateDOM(this.dom)) {
|
|
4913
|
+
sync(view) {
|
|
4914
|
+
if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
|
|
4842
4915
|
if (this.dom && this.prevWidget) this.prevWidget.destroy(this.dom);
|
|
4843
4916
|
this.prevWidget = null;
|
|
4844
|
-
this.setDOM(this.widget.toDOM(
|
|
4917
|
+
this.setDOM(this.widget.toDOM(view));
|
|
4845
4918
|
this.dom.contentEditable = "false";
|
|
4846
4919
|
}
|
|
4847
4920
|
}
|
|
@@ -4856,7 +4929,7 @@ class WidgetView extends ContentView {
|
|
|
4856
4929
|
become(other) {
|
|
4857
4930
|
if (other.length == this.length && other instanceof WidgetView && other.side == this.side) {
|
|
4858
4931
|
if (this.widget.constructor == other.widget.constructor) {
|
|
4859
|
-
if (!this.widget.
|
|
4932
|
+
if (!this.widget.compare(other.widget)) this.markDirty(true);
|
|
4860
4933
|
if (this.dom && !this.prevWidget) this.prevWidget = this.widget;
|
|
4861
4934
|
this.widget = other.widget;
|
|
4862
4935
|
return true;
|
|
@@ -4874,13 +4947,15 @@ class WidgetView extends ContentView {
|
|
|
4874
4947
|
if (this.length == 0) return Text.empty;
|
|
4875
4948
|
let top = this;
|
|
4876
4949
|
while (top.parent) top = top.parent;
|
|
4877
|
-
let
|
|
4950
|
+
let {
|
|
4951
|
+
view
|
|
4952
|
+
} = top,
|
|
4878
4953
|
text = view && view.state.doc,
|
|
4879
4954
|
start = this.posAtStart;
|
|
4880
4955
|
return text ? text.slice(start, start + this.length) : Text.empty;
|
|
4881
4956
|
}
|
|
4882
4957
|
domAtPos(pos) {
|
|
4883
|
-
return pos == 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);
|
|
4958
|
+
return (this.length ? pos == 0 : this.side > 0) ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);
|
|
4884
4959
|
}
|
|
4885
4960
|
domBoundsAround() {
|
|
4886
4961
|
return null;
|
|
@@ -4898,6 +4973,12 @@ class WidgetView extends ContentView {
|
|
|
4898
4973
|
get isEditable() {
|
|
4899
4974
|
return false;
|
|
4900
4975
|
}
|
|
4976
|
+
get isWidget() {
|
|
4977
|
+
return true;
|
|
4978
|
+
}
|
|
4979
|
+
get isHidden() {
|
|
4980
|
+
return this.widget.isHidden;
|
|
4981
|
+
}
|
|
4901
4982
|
destroy() {
|
|
4902
4983
|
super.destroy();
|
|
4903
4984
|
if (this.dom) this.widget.destroy(this.dom);
|
|
@@ -4971,9 +5052,9 @@ function scanCompositionTree(pos, side, view, text, enterView, fromText) {
|
|
|
4971
5052
|
}
|
|
4972
5053
|
function posFromDOMInCompositionTree(node, offset, view, text) {
|
|
4973
5054
|
if (view instanceof MarkView) {
|
|
5055
|
+
let pos = 0;
|
|
4974
5056
|
for (let child of view.children) {
|
|
4975
|
-
let
|
|
4976
|
-
hasComp = contains(child.dom, text);
|
|
5057
|
+
let hasComp = contains(child.dom, text);
|
|
4977
5058
|
if (contains(child.dom, node)) return pos + (hasComp ? posFromDOMInCompositionTree(node, offset, child, text) : child.localPosFromDOM(node, offset));
|
|
4978
5059
|
pos += hasComp ? text.nodeValue.length : child.length;
|
|
4979
5060
|
}
|
|
@@ -5014,7 +5095,7 @@ class WidgetBufferView extends ContentView {
|
|
|
5014
5095
|
return this.side;
|
|
5015
5096
|
}
|
|
5016
5097
|
domAtPos(pos) {
|
|
5017
|
-
return DOMPos.before(this.dom);
|
|
5098
|
+
return this.side > 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom);
|
|
5018
5099
|
}
|
|
5019
5100
|
localPosFromDOM() {
|
|
5020
5101
|
return 0;
|
|
@@ -5037,6 +5118,9 @@ class WidgetBufferView extends ContentView {
|
|
|
5037
5118
|
get overrideDOMText() {
|
|
5038
5119
|
return Text.empty;
|
|
5039
5120
|
}
|
|
5121
|
+
get isHidden() {
|
|
5122
|
+
return true;
|
|
5123
|
+
}
|
|
5040
5124
|
}
|
|
5041
5125
|
TextView.prototype.children = WidgetView.prototype.children = WidgetBufferView.prototype.children = noChildren;
|
|
5042
5126
|
function inlineSiblingRect(view, side) {
|
|
@@ -5111,7 +5195,7 @@ function coordsInChildren(view, pos, side) {
|
|
|
5111
5195
|
if (end >= pos) {
|
|
5112
5196
|
if (child.children.length) {
|
|
5113
5197
|
scan(child, pos - off);
|
|
5114
|
-
} else if (!after && (end > pos || off == end && child.getSide() > 0)) {
|
|
5198
|
+
} else if ((!after || after instanceof WidgetBufferView && side > 0) && (end > pos || off == end && child.getSide() > 0)) {
|
|
5115
5199
|
after = child;
|
|
5116
5200
|
afterPos = pos - off;
|
|
5117
5201
|
} else if (off < pos || off == end && child.getSide() < 0) {
|
|
@@ -5184,7 +5268,7 @@ class WidgetType {
|
|
|
5184
5268
|
couldn't (in which case the widget will be redrawn). The default
|
|
5185
5269
|
implementation just returns false.
|
|
5186
5270
|
*/
|
|
5187
|
-
updateDOM(dom) {
|
|
5271
|
+
updateDOM(dom, view) {
|
|
5188
5272
|
return false;
|
|
5189
5273
|
}
|
|
5190
5274
|
/**
|
|
@@ -5217,6 +5301,12 @@ class WidgetType {
|
|
|
5217
5301
|
return null;
|
|
5218
5302
|
}
|
|
5219
5303
|
/**
|
|
5304
|
+
@internal
|
|
5305
|
+
*/
|
|
5306
|
+
get isHidden() {
|
|
5307
|
+
return false;
|
|
5308
|
+
}
|
|
5309
|
+
/**
|
|
5220
5310
|
This is called when the an instance of the widget is removed
|
|
5221
5311
|
from the editor view.
|
|
5222
5312
|
*/
|
|
@@ -5337,7 +5427,8 @@ class Decoration extends RangeValue {
|
|
|
5337
5427
|
decorated range or ranges. If the ranges aren't already sorted,
|
|
5338
5428
|
pass `true` for `sort` to make the library sort them for you.
|
|
5339
5429
|
*/
|
|
5340
|
-
static set(of
|
|
5430
|
+
static set(of) {
|
|
5431
|
+
let sort = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
5341
5432
|
return RangeSet.of(of, sort);
|
|
5342
5433
|
}
|
|
5343
5434
|
/**
|
|
@@ -5365,7 +5456,8 @@ class MarkDecoration extends Decoration {
|
|
|
5365
5456
|
eq(other) {
|
|
5366
5457
|
return this == other || other instanceof MarkDecoration && this.tagName == other.tagName && this.class == other.class && attrsEq(this.attrs, other.attrs);
|
|
5367
5458
|
}
|
|
5368
|
-
range(from
|
|
5459
|
+
range(from) {
|
|
5460
|
+
let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
|
|
5369
5461
|
if (from >= to) throw new RangeError("Mark decorations may not be empty");
|
|
5370
5462
|
return super.range(from, to);
|
|
5371
5463
|
}
|
|
@@ -5378,7 +5470,8 @@ class LineDecoration extends Decoration {
|
|
|
5378
5470
|
eq(other) {
|
|
5379
5471
|
return other instanceof LineDecoration && this.spec.class == other.spec.class && attrsEq(this.spec.attributes, other.spec.attributes);
|
|
5380
5472
|
}
|
|
5381
|
-
range(from
|
|
5473
|
+
range(from) {
|
|
5474
|
+
let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
|
|
5382
5475
|
if (to != from) throw new RangeError("Line decoration ranges must be zero-length");
|
|
5383
5476
|
return super.range(from, to);
|
|
5384
5477
|
}
|
|
@@ -5402,14 +5495,16 @@ class PointDecoration extends Decoration {
|
|
|
5402
5495
|
eq(other) {
|
|
5403
5496
|
return other instanceof PointDecoration && widgetsEq(this.widget, other.widget) && this.block == other.block && this.startSide == other.startSide && this.endSide == other.endSide;
|
|
5404
5497
|
}
|
|
5405
|
-
range(from
|
|
5498
|
+
range(from) {
|
|
5499
|
+
let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : from;
|
|
5406
5500
|
if (this.isReplace && (from > to || from == to && this.startSide > 0 && this.endSide <= 0)) throw new RangeError("Invalid range for replacement decoration");
|
|
5407
5501
|
if (!this.isReplace && to != from) throw new RangeError("Widget decorations can only have zero-length ranges");
|
|
5408
5502
|
return super.range(from, to);
|
|
5409
5503
|
}
|
|
5410
5504
|
}
|
|
5411
5505
|
PointDecoration.prototype.point = true;
|
|
5412
|
-
function getInclusive(spec
|
|
5506
|
+
function getInclusive(spec) {
|
|
5507
|
+
let block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
5413
5508
|
let {
|
|
5414
5509
|
inclusiveStart: start,
|
|
5415
5510
|
inclusiveEnd: end
|
|
@@ -5424,7 +5519,8 @@ function getInclusive(spec, block = false) {
|
|
|
5424
5519
|
function widgetsEq(a, b) {
|
|
5425
5520
|
return a == b || !!(a && b && a.compare(b));
|
|
5426
5521
|
}
|
|
5427
|
-
function addRange(from, to, ranges
|
|
5522
|
+
function addRange(from, to, ranges) {
|
|
5523
|
+
let margin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
5428
5524
|
let last = ranges.length - 1;
|
|
5429
5525
|
if (last >= 0 && ranges[last] + margin >= from) ranges[last] = Math.max(ranges[last], to);else ranges.push(from, to);
|
|
5430
5526
|
}
|
|
@@ -5507,7 +5603,7 @@ class LineView extends ContentView {
|
|
|
5507
5603
|
}
|
|
5508
5604
|
}
|
|
5509
5605
|
|
|
5510
|
-
sync(track) {
|
|
5606
|
+
sync(view, track) {
|
|
5511
5607
|
var _a;
|
|
5512
5608
|
if (!this.dom) {
|
|
5513
5609
|
this.setDOM(document.createElement("div"));
|
|
@@ -5523,7 +5619,7 @@ class LineView extends ContentView {
|
|
|
5523
5619
|
this.dom.classList.add("cm-line");
|
|
5524
5620
|
this.prevAttrs = undefined;
|
|
5525
5621
|
}
|
|
5526
|
-
super.sync(track);
|
|
5622
|
+
super.sync(view, track);
|
|
5527
5623
|
let last = this.dom.lastChild;
|
|
5528
5624
|
while (last && ContentView.get(last) instanceof MarkView) last = last.lastChild;
|
|
5529
5625
|
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 +5630,41 @@ class LineView extends ContentView {
|
|
|
5534
5630
|
}
|
|
5535
5631
|
measureTextSize() {
|
|
5536
5632
|
if (this.children.length == 0 || this.length > 20) return null;
|
|
5537
|
-
let totalWidth = 0
|
|
5633
|
+
let totalWidth = 0,
|
|
5634
|
+
textHeight;
|
|
5538
5635
|
for (let child of this.children) {
|
|
5539
5636
|
if (!(child instanceof TextView) || /[^ -~]/.test(child.text)) return null;
|
|
5540
5637
|
let rects = clientRectsFor(child.dom);
|
|
5541
5638
|
if (rects.length != 1) return null;
|
|
5542
5639
|
totalWidth += rects[0].width;
|
|
5640
|
+
textHeight = rects[0].height;
|
|
5543
5641
|
}
|
|
5544
5642
|
return !totalWidth ? null : {
|
|
5545
5643
|
lineHeight: this.dom.getBoundingClientRect().height,
|
|
5546
|
-
charWidth: totalWidth / this.length
|
|
5644
|
+
charWidth: totalWidth / this.length,
|
|
5645
|
+
textHeight
|
|
5547
5646
|
};
|
|
5548
5647
|
}
|
|
5549
5648
|
coordsAt(pos, side) {
|
|
5550
|
-
|
|
5649
|
+
let rect = coordsInChildren(this, pos, side);
|
|
5650
|
+
// Correct rectangle height for empty lines when the returned
|
|
5651
|
+
// height is larger than the text height.
|
|
5652
|
+
if (!this.children.length && rect && this.parent) {
|
|
5653
|
+
let {
|
|
5654
|
+
heightOracle
|
|
5655
|
+
} = this.parent.view.viewState,
|
|
5656
|
+
height = rect.bottom - rect.top;
|
|
5657
|
+
if (Math.abs(height - heightOracle.lineHeight) < 2 && heightOracle.textHeight < height) {
|
|
5658
|
+
let dist = (height - heightOracle.textHeight) / 2;
|
|
5659
|
+
return {
|
|
5660
|
+
top: rect.top + dist,
|
|
5661
|
+
bottom: rect.bottom - dist,
|
|
5662
|
+
left: rect.left,
|
|
5663
|
+
right: rect.left
|
|
5664
|
+
};
|
|
5665
|
+
}
|
|
5666
|
+
}
|
|
5667
|
+
return rect;
|
|
5551
5668
|
}
|
|
5552
5669
|
become(_other) {
|
|
5553
5670
|
return false;
|
|
@@ -5595,11 +5712,11 @@ class BlockWidgetView extends ContentView {
|
|
|
5595
5712
|
get children() {
|
|
5596
5713
|
return noChildren;
|
|
5597
5714
|
}
|
|
5598
|
-
sync() {
|
|
5599
|
-
if (!this.dom || !this.widget.updateDOM(this.dom)) {
|
|
5715
|
+
sync(view) {
|
|
5716
|
+
if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
|
|
5600
5717
|
if (this.dom && this.prevWidget) this.prevWidget.destroy(this.dom);
|
|
5601
5718
|
this.prevWidget = null;
|
|
5602
|
-
this.setDOM(this.widget.toDOM(
|
|
5719
|
+
this.setDOM(this.widget.toDOM(view));
|
|
5603
5720
|
this.dom.contentEditable = "false";
|
|
5604
5721
|
}
|
|
5605
5722
|
}
|
|
@@ -5611,7 +5728,7 @@ class BlockWidgetView extends ContentView {
|
|
|
5611
5728
|
}
|
|
5612
5729
|
become(other) {
|
|
5613
5730
|
if (other instanceof BlockWidgetView && other.type == this.type && other.widget.constructor == this.widget.constructor) {
|
|
5614
|
-
if (!other.widget.
|
|
5731
|
+
if (!other.widget.compare(this.widget)) this.markDirty(true);
|
|
5615
5732
|
if (this.dom && !this.prevWidget) this.prevWidget = this.widget;
|
|
5616
5733
|
this.widget = other.widget;
|
|
5617
5734
|
this.length = other.length;
|
|
@@ -5626,6 +5743,12 @@ class BlockWidgetView extends ContentView {
|
|
|
5626
5743
|
ignoreEvent(event) {
|
|
5627
5744
|
return this.widget.ignoreEvent(event);
|
|
5628
5745
|
}
|
|
5746
|
+
get isEditable() {
|
|
5747
|
+
return false;
|
|
5748
|
+
}
|
|
5749
|
+
get isWidget() {
|
|
5750
|
+
return true;
|
|
5751
|
+
}
|
|
5629
5752
|
destroy() {
|
|
5630
5753
|
super.destroy();
|
|
5631
5754
|
if (this.dom) this.widget.destroy(this.dom);
|
|
@@ -5663,7 +5786,8 @@ class ContentBuilder {
|
|
|
5663
5786
|
}
|
|
5664
5787
|
return this.curLine;
|
|
5665
5788
|
}
|
|
5666
|
-
flushBuffer(
|
|
5789
|
+
flushBuffer() {
|
|
5790
|
+
let active = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.bufferMarks;
|
|
5667
5791
|
if (this.pendingBuffer) {
|
|
5668
5792
|
this.curLine.append(wrapMarks(new WidgetBufferView(-1), active), active.length);
|
|
5669
5793
|
this.pendingBuffer = 0 /* Buf.No */;
|
|
@@ -5734,7 +5858,7 @@ class ContentBuilder {
|
|
|
5734
5858
|
let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length && (from < to || deco.startSide > 0);
|
|
5735
5859
|
let cursorAfter = !view.isEditable && (from < to || openStart > active.length || deco.startSide <= 0);
|
|
5736
5860
|
let line = this.getLine();
|
|
5737
|
-
if (this.pendingBuffer == 2 /* Buf.IfCursor */ && !cursorBefore) this.pendingBuffer = 0 /* Buf.No */;
|
|
5861
|
+
if (this.pendingBuffer == 2 /* Buf.IfCursor */ && !cursorBefore && !view.isEditable) this.pendingBuffer = 0 /* Buf.No */;
|
|
5738
5862
|
this.flushBuffer(active);
|
|
5739
5863
|
if (cursorBefore) {
|
|
5740
5864
|
line.append(wrapMarks(new WidgetBufferView(1), active), openStart);
|
|
@@ -5788,6 +5912,9 @@ class NullWidget extends WidgetType {
|
|
|
5788
5912
|
updateDOM(elt) {
|
|
5789
5913
|
return elt.nodeName.toLowerCase() == this.tag;
|
|
5790
5914
|
}
|
|
5915
|
+
get isHidden() {
|
|
5916
|
+
return true;
|
|
5917
|
+
}
|
|
5791
5918
|
}
|
|
5792
5919
|
const clickAddsSelectionRange = /*@__PURE__*/Facet.define();
|
|
5793
5920
|
const dragMovesSelection$1 = /*@__PURE__*/Facet.define();
|
|
@@ -5795,6 +5922,7 @@ const mouseSelectionStyle = /*@__PURE__*/Facet.define();
|
|
|
5795
5922
|
const exceptionSink = /*@__PURE__*/Facet.define();
|
|
5796
5923
|
const updateListener = /*@__PURE__*/Facet.define();
|
|
5797
5924
|
const inputHandler = /*@__PURE__*/Facet.define();
|
|
5925
|
+
const focusChangeEffect = /*@__PURE__*/Facet.define();
|
|
5798
5926
|
const perLineTextDirection = /*@__PURE__*/Facet.define({
|
|
5799
5927
|
combine: values => values.some(x => x)
|
|
5800
5928
|
});
|
|
@@ -5802,7 +5930,11 @@ const nativeSelectionHidden = /*@__PURE__*/Facet.define({
|
|
|
5802
5930
|
combine: values => values.some(x => x)
|
|
5803
5931
|
});
|
|
5804
5932
|
class ScrollTarget {
|
|
5805
|
-
constructor(range
|
|
5933
|
+
constructor(range) {
|
|
5934
|
+
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "nearest";
|
|
5935
|
+
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "nearest";
|
|
5936
|
+
let yMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;
|
|
5937
|
+
let xMargin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 5;
|
|
5806
5938
|
this.range = range;
|
|
5807
5939
|
this.y = y;
|
|
5808
5940
|
this.x = x;
|
|
@@ -6025,11 +6157,6 @@ class ViewUpdate {
|
|
|
6025
6157
|
let changedRanges = [];
|
|
6026
6158
|
this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange(fromA, toA, fromB, toB)));
|
|
6027
6159
|
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
6160
|
}
|
|
6034
6161
|
/**
|
|
6035
6162
|
@internal
|
|
@@ -6482,9 +6609,6 @@ class DocView extends ContentView {
|
|
|
6482
6609
|
this.updateDeco();
|
|
6483
6610
|
this.updateInner([new ChangedRange(0, 0, 0, view.state.doc.length)], 0);
|
|
6484
6611
|
}
|
|
6485
|
-
get editorView() {
|
|
6486
|
-
return this.view;
|
|
6487
|
-
}
|
|
6488
6612
|
get length() {
|
|
6489
6613
|
return this.view.state.doc.length;
|
|
6490
6614
|
}
|
|
@@ -6495,10 +6619,13 @@ class DocView extends ContentView {
|
|
|
6495
6619
|
update(update) {
|
|
6496
6620
|
let changedRanges = update.changedRanges;
|
|
6497
6621
|
if (this.minWidth > 0 && changedRanges.length) {
|
|
6498
|
-
if (!changedRanges.every(
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6622
|
+
if (!changedRanges.every(_ref => {
|
|
6623
|
+
let {
|
|
6624
|
+
fromA,
|
|
6625
|
+
toA
|
|
6626
|
+
} = _ref;
|
|
6627
|
+
return toA < this.minWidthFrom || fromA > this.minWidthTo;
|
|
6628
|
+
})) {
|
|
6502
6629
|
this.minWidth = this.minWidthFrom = this.minWidthTo = 0;
|
|
6503
6630
|
} else {
|
|
6504
6631
|
this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);
|
|
@@ -6547,7 +6674,7 @@ class DocView extends ContentView {
|
|
|
6547
6674
|
node: observer.selectionRange.focusNode,
|
|
6548
6675
|
written: false
|
|
6549
6676
|
} : undefined;
|
|
6550
|
-
this.sync(track);
|
|
6677
|
+
this.sync(this.view, track);
|
|
6551
6678
|
this.dirty = 0 /* Dirty.Not */;
|
|
6552
6679
|
if (track && (track.written || observer.selectionRange.focusNode != track.node)) this.forceSelection = true;
|
|
6553
6680
|
this.dom.style.height = "";
|
|
@@ -6585,7 +6712,9 @@ class DocView extends ContentView {
|
|
|
6585
6712
|
}
|
|
6586
6713
|
}
|
|
6587
6714
|
// Sync the DOM selection to this.state.selection
|
|
6588
|
-
updateSelection(
|
|
6715
|
+
updateSelection() {
|
|
6716
|
+
let mustRead = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6717
|
+
let fromPointer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
6589
6718
|
if (mustRead || !this.view.observer.selectionRange.focusNode) this.view.observer.readSelectionRange();
|
|
6590
6719
|
if (!(fromPointer || this.mayControlSelection())) return;
|
|
6591
6720
|
let force = this.forceSelection;
|
|
@@ -6596,7 +6725,7 @@ class DocView extends ContentView {
|
|
|
6596
6725
|
let head = main.empty ? anchor : this.domAtPos(main.head);
|
|
6597
6726
|
// Always reset on Firefox when next to an uneditable node to
|
|
6598
6727
|
// avoid invisible cursor bugs (#111)
|
|
6599
|
-
if (browser.gecko && main.empty && betweenUneditable(anchor)) {
|
|
6728
|
+
if (browser.gecko && main.empty && !this.compositionDeco.size && betweenUneditable(anchor)) {
|
|
6600
6729
|
let dummy = document.createTextNode("");
|
|
6601
6730
|
this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null));
|
|
6602
6731
|
anchor = head = new DOMPos(dummy, 0);
|
|
@@ -6772,7 +6901,8 @@ class DocView extends ContentView {
|
|
|
6772
6901
|
// If no workable line exists, force a layout of a measurable element
|
|
6773
6902
|
let dummy = document.createElement("div"),
|
|
6774
6903
|
lineHeight,
|
|
6775
|
-
charWidth
|
|
6904
|
+
charWidth,
|
|
6905
|
+
textHeight;
|
|
6776
6906
|
dummy.className = "cm-line";
|
|
6777
6907
|
dummy.style.width = "99999px";
|
|
6778
6908
|
dummy.textContent = "abc def ghi jkl mno pqr stu";
|
|
@@ -6781,14 +6911,17 @@ class DocView extends ContentView {
|
|
|
6781
6911
|
let rect = clientRectsFor(dummy.firstChild)[0];
|
|
6782
6912
|
lineHeight = dummy.getBoundingClientRect().height;
|
|
6783
6913
|
charWidth = rect ? rect.width / 27 : 7;
|
|
6914
|
+
textHeight = rect ? rect.height : lineHeight;
|
|
6784
6915
|
dummy.remove();
|
|
6785
6916
|
});
|
|
6786
6917
|
return {
|
|
6787
6918
|
lineHeight,
|
|
6788
|
-
charWidth
|
|
6919
|
+
charWidth,
|
|
6920
|
+
textHeight
|
|
6789
6921
|
};
|
|
6790
6922
|
}
|
|
6791
|
-
childCursor(
|
|
6923
|
+
childCursor() {
|
|
6924
|
+
let pos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.length;
|
|
6792
6925
|
// Move back to start of last element when possible, so that
|
|
6793
6926
|
// `ChildCursor.findPos` doesn't have to deal with the edge case
|
|
6794
6927
|
// of being after the last element.
|
|
@@ -6969,19 +7102,26 @@ class CompositionWidget extends WidgetType {
|
|
|
6969
7102
|
return CompositionView;
|
|
6970
7103
|
}
|
|
6971
7104
|
}
|
|
6972
|
-
function nearbyTextNode(
|
|
6973
|
-
for (;;) {
|
|
7105
|
+
function nearbyTextNode(startNode, startOffset, side) {
|
|
7106
|
+
if (side <= 0) for (let node = startNode, offset = startOffset;;) {
|
|
6974
7107
|
if (node.nodeType == 3) return node;
|
|
6975
|
-
if (node.nodeType == 1 && offset > 0
|
|
7108
|
+
if (node.nodeType == 1 && offset > 0) {
|
|
6976
7109
|
node = node.childNodes[offset - 1];
|
|
6977
7110
|
offset = maxOffset(node);
|
|
6978
|
-
} else
|
|
7111
|
+
} else {
|
|
7112
|
+
break;
|
|
7113
|
+
}
|
|
7114
|
+
}
|
|
7115
|
+
if (side >= 0) for (let node = startNode, offset = startOffset;;) {
|
|
7116
|
+
if (node.nodeType == 3) return node;
|
|
7117
|
+
if (node.nodeType == 1 && offset < node.childNodes.length && side >= 0) {
|
|
6979
7118
|
node = node.childNodes[offset];
|
|
6980
7119
|
offset = 0;
|
|
6981
7120
|
} else {
|
|
6982
|
-
|
|
7121
|
+
break;
|
|
6983
7122
|
}
|
|
6984
7123
|
}
|
|
7124
|
+
return null;
|
|
6985
7125
|
}
|
|
6986
7126
|
function nextToUneditable(node, offset) {
|
|
6987
7127
|
if (node.nodeType != 1) return 0;
|
|
@@ -7011,7 +7151,8 @@ function inUneditable(node, inside) {
|
|
|
7011
7151
|
}
|
|
7012
7152
|
return false;
|
|
7013
7153
|
}
|
|
7014
|
-
function groupAt(state, pos
|
|
7154
|
+
function groupAt(state, pos) {
|
|
7155
|
+
let bias = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
7015
7156
|
let categorize = state.charCategorizer(pos);
|
|
7016
7157
|
let line = state.doc.lineAt(pos),
|
|
7017
7158
|
linePos = pos - line.from;
|
|
@@ -7154,18 +7295,20 @@ function domPosInText(node, x, y) {
|
|
|
7154
7295
|
offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0
|
|
7155
7296
|
};
|
|
7156
7297
|
}
|
|
7157
|
-
function posAtCoords(view, {
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
}, precise, bias = -1) {
|
|
7161
|
-
var _a;
|
|
7298
|
+
function posAtCoords(view, coords, precise) {
|
|
7299
|
+
let bias = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
|
|
7300
|
+
var _a, _b;
|
|
7162
7301
|
let content = view.contentDOM.getBoundingClientRect(),
|
|
7163
7302
|
docTop = content.top + view.viewState.paddingTop;
|
|
7164
7303
|
let block,
|
|
7165
7304
|
{
|
|
7166
7305
|
docHeight
|
|
7167
7306
|
} = view.viewState;
|
|
7168
|
-
let
|
|
7307
|
+
let {
|
|
7308
|
+
x,
|
|
7309
|
+
y
|
|
7310
|
+
} = coords,
|
|
7311
|
+
yOffset = y - docTop;
|
|
7169
7312
|
if (yOffset < 0) return 0;
|
|
7170
7313
|
if (yOffset > docHeight) return view.state.doc.length;
|
|
7171
7314
|
// Scan for a text block near the queried y position
|
|
@@ -7230,7 +7373,14 @@ function posAtCoords(view, {
|
|
|
7230
7373
|
offset
|
|
7231
7374
|
} = domPosAtCoords(line.dom, x, y));
|
|
7232
7375
|
}
|
|
7233
|
-
|
|
7376
|
+
let nearest = view.docView.nearest(node);
|
|
7377
|
+
if (!nearest) return null;
|
|
7378
|
+
if (nearest.isWidget && ((_b = nearest.dom) === null || _b === void 0 ? void 0 : _b.nodeType) == 1) {
|
|
7379
|
+
let rect = nearest.dom.getBoundingClientRect();
|
|
7380
|
+
return coords.y < rect.top || coords.y <= rect.bottom && coords.x <= (rect.left + rect.right) / 2 ? nearest.posAtStart : nearest.posAtEnd;
|
|
7381
|
+
} else {
|
|
7382
|
+
return nearest.localPosFromDOM(node, offset) + nearest.posAtStart;
|
|
7383
|
+
}
|
|
7234
7384
|
}
|
|
7235
7385
|
function posAtCoordsImprecise(view, contentRect, block, x, y) {
|
|
7236
7386
|
let into = Math.round((x - contentRect.left) * view.defaultCharacterWidth);
|
|
@@ -7386,7 +7536,15 @@ class InputState {
|
|
|
7386
7536
|
// first, false means first has already been marked for this
|
|
7387
7537
|
// composition)
|
|
7388
7538
|
this.compositionFirstChange = null;
|
|
7539
|
+
// End time of the previous composition
|
|
7389
7540
|
this.compositionEndedAt = 0;
|
|
7541
|
+
// Used in a kludge to detect when an Enter keypress should be
|
|
7542
|
+
// considered part of the composition on Safari, which fires events
|
|
7543
|
+
// in the wrong order
|
|
7544
|
+
this.compositionPendingKey = false;
|
|
7545
|
+
// Used to categorize changes as part of a composition, even when
|
|
7546
|
+
// the mutation events fire shortly after the compositionend event
|
|
7547
|
+
this.compositionPendingChange = false;
|
|
7390
7548
|
this.mouseSelection = null;
|
|
7391
7549
|
let handleEvent = (handler, event) => {
|
|
7392
7550
|
if (this.ignoreDuringComposition(event)) return;
|
|
@@ -7402,7 +7560,16 @@ class InputState {
|
|
|
7402
7560
|
this.registeredEvents.push(type);
|
|
7403
7561
|
}
|
|
7404
7562
|
view.scrollDOM.addEventListener("mousedown", event => {
|
|
7405
|
-
if (event.target == view.scrollDOM
|
|
7563
|
+
if (event.target == view.scrollDOM && event.clientY > view.contentDOM.getBoundingClientRect().bottom) {
|
|
7564
|
+
handleEvent(handlers.mousedown, event);
|
|
7565
|
+
if (!event.defaultPrevented && event.button == 2) {
|
|
7566
|
+
// Make sure the content covers the entire scroller height, in order
|
|
7567
|
+
// to catch a native context menu click below it
|
|
7568
|
+
let start = view.contentDOM.style.minHeight;
|
|
7569
|
+
view.contentDOM.style.minHeight = "100%";
|
|
7570
|
+
setTimeout(() => view.contentDOM.style.minHeight = start, 200);
|
|
7571
|
+
}
|
|
7572
|
+
}
|
|
7406
7573
|
});
|
|
7407
7574
|
if (browser.chrome && browser.chrome_version == 102) {
|
|
7408
7575
|
// FIXME remove at some point
|
|
@@ -7515,8 +7682,8 @@ class InputState {
|
|
|
7515
7682
|
// compositionend and keydown events are sometimes emitted in the
|
|
7516
7683
|
// wrong order. The key event should still be ignored, even when
|
|
7517
7684
|
// it happens after the compositionend event.
|
|
7518
|
-
if (browser.safari && !browser.ios && Date.now() - this.compositionEndedAt < 100) {
|
|
7519
|
-
this.
|
|
7685
|
+
if (browser.safari && !browser.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100) {
|
|
7686
|
+
this.compositionPendingKey = false;
|
|
7520
7687
|
return true;
|
|
7521
7688
|
}
|
|
7522
7689
|
return false;
|
|
@@ -7552,8 +7719,9 @@ const PendingKeys = [{
|
|
|
7552
7719
|
const EmacsyPendingKeys = "dthko";
|
|
7553
7720
|
// Key codes for modifier keys
|
|
7554
7721
|
const modifierCodes = [16, 17, 18, 20, 91, 92, 224, 225];
|
|
7722
|
+
const dragScrollMargin = 6;
|
|
7555
7723
|
function dragScrollSpeed(dist) {
|
|
7556
|
-
return dist * 0.7 + 8;
|
|
7724
|
+
return Math.max(0, dist) * 0.7 + 8;
|
|
7557
7725
|
}
|
|
7558
7726
|
class MouseSelection {
|
|
7559
7727
|
constructor(view, startEvent, style, mustSelect) {
|
|
@@ -7574,11 +7742,13 @@ class MouseSelection {
|
|
|
7574
7742
|
this.multiple = view.state.facet(EditorState.allowMultipleSelections) && addsSelectionRange(view, startEvent);
|
|
7575
7743
|
this.dragMove = dragMovesSelection(view, startEvent);
|
|
7576
7744
|
this.dragging = isInPrimarySelection(view, startEvent) && getClickType(startEvent) == 1 ? null : false;
|
|
7745
|
+
}
|
|
7746
|
+
start(event) {
|
|
7577
7747
|
// When clicking outside of the selection, immediately apply the
|
|
7578
7748
|
// effect of starting the selection
|
|
7579
7749
|
if (this.dragging === false) {
|
|
7580
|
-
|
|
7581
|
-
this.select(
|
|
7750
|
+
event.preventDefault();
|
|
7751
|
+
this.select(event);
|
|
7582
7752
|
}
|
|
7583
7753
|
}
|
|
7584
7754
|
move(event) {
|
|
@@ -7594,8 +7764,8 @@ class MouseSelection {
|
|
|
7594
7764
|
right: this.view.win.innerWidth,
|
|
7595
7765
|
bottom: this.view.win.innerHeight
|
|
7596
7766
|
};
|
|
7597
|
-
if (event.clientX <= rect.left) sx = -dragScrollSpeed(rect.left - event.clientX);else if (event.clientX >= rect.right) sx = dragScrollSpeed(event.clientX - rect.right);
|
|
7598
|
-
if (event.clientY <= rect.top) sy = -dragScrollSpeed(rect.top - event.clientY);else if (event.clientY >= rect.bottom) sy = dragScrollSpeed(event.clientY - rect.bottom);
|
|
7767
|
+
if (event.clientX <= rect.left + dragScrollMargin) sx = -dragScrollSpeed(rect.left - event.clientX);else if (event.clientX >= rect.right - dragScrollMargin) sx = dragScrollSpeed(event.clientX - rect.right);
|
|
7768
|
+
if (event.clientY <= rect.top + dragScrollMargin) sy = -dragScrollSpeed(rect.top - event.clientY);else if (event.clientY >= rect.bottom - dragScrollMargin) sy = dragScrollSpeed(event.clientY - rect.bottom);
|
|
7599
7769
|
this.setScrollSpeed(sx, sy);
|
|
7600
7770
|
}
|
|
7601
7771
|
up(event) {
|
|
@@ -7763,8 +7933,9 @@ handlers.mousedown = (view, event) => {
|
|
|
7763
7933
|
if (!style && event.button == 0) style = basicMouseSelection(view, event);
|
|
7764
7934
|
if (style) {
|
|
7765
7935
|
let mustFocus = view.root.activeElement != view.contentDOM;
|
|
7766
|
-
if (mustFocus) view.observer.ignore(() => focusPreventScroll(view.contentDOM));
|
|
7767
7936
|
view.inputState.startMouseSelection(new MouseSelection(view, event, style, mustFocus));
|
|
7937
|
+
if (mustFocus) view.observer.ignore(() => focusPreventScroll(view.contentDOM));
|
|
7938
|
+
if (view.inputState.mouseSelection) view.inputState.mouseSelection.start(event);
|
|
7768
7939
|
}
|
|
7769
7940
|
};
|
|
7770
7941
|
function rangeForClick(view, pos, bias, type) {
|
|
@@ -7839,7 +8010,8 @@ function basicMouseSelection(view, event) {
|
|
|
7839
8010
|
}
|
|
7840
8011
|
},
|
|
7841
8012
|
get(event, extend, multiple) {
|
|
7842
|
-
let cur = queryPos(view, event)
|
|
8013
|
+
let cur = queryPos(view, event),
|
|
8014
|
+
removed;
|
|
7843
8015
|
let range = rangeForClick(view, cur.pos, cur.bias, type);
|
|
7844
8016
|
if (start.pos != cur.pos && !extend) {
|
|
7845
8017
|
let startRange = rangeForClick(view, start.pos, start.bias, type);
|
|
@@ -7847,14 +8019,19 @@ function basicMouseSelection(view, event) {
|
|
|
7847
8019
|
to = Math.max(startRange.to, range.to);
|
|
7848
8020
|
range = from < range.from ? EditorSelection.range(from, to) : EditorSelection.range(to, from);
|
|
7849
8021
|
}
|
|
7850
|
-
if (extend) return startSel.replaceRange(startSel.main.extend(range.from, range.to));else if (multiple && startSel.ranges.length > 1 &&
|
|
8022
|
+
if (extend) return startSel.replaceRange(startSel.main.extend(range.from, range.to));else if (multiple && type == 1 && startSel.ranges.length > 1 && (removed = removeRangeAround(startSel, cur.pos))) return removed;else if (multiple) return startSel.addRange(range);else return EditorSelection.create([range]);
|
|
7851
8023
|
}
|
|
7852
8024
|
};
|
|
7853
8025
|
}
|
|
7854
|
-
function
|
|
7855
|
-
for (let i = 0
|
|
7856
|
-
|
|
8026
|
+
function removeRangeAround(sel, pos) {
|
|
8027
|
+
for (let i = 0; i < sel.ranges.length; i++) {
|
|
8028
|
+
let {
|
|
8029
|
+
from,
|
|
8030
|
+
to
|
|
8031
|
+
} = sel.ranges[i];
|
|
8032
|
+
if (from <= pos && to >= pos) return EditorSelection.create(sel.ranges.slice(0, i).concat(sel.ranges.slice(i + 1)), sel.mainIndex == i ? 0 : sel.mainIndex - (sel.mainIndex > i ? 1 : 0));
|
|
7857
8033
|
}
|
|
8034
|
+
return null;
|
|
7858
8035
|
}
|
|
7859
8036
|
handlers.dragstart = (view, event) => {
|
|
7860
8037
|
let {
|
|
@@ -7930,7 +8107,7 @@ handlers.paste = (view, event) => {
|
|
|
7930
8107
|
view.observer.flush();
|
|
7931
8108
|
let data = brokenClipboardAPI ? null : event.clipboardData;
|
|
7932
8109
|
if (data) {
|
|
7933
|
-
doPaste(view, data.getData("text/plain"));
|
|
8110
|
+
doPaste(view, data.getData("text/plain") || data.getData("text/uri-text"));
|
|
7934
8111
|
event.preventDefault();
|
|
7935
8112
|
} else {
|
|
7936
8113
|
capturePaste(view);
|
|
@@ -8007,9 +8184,25 @@ handlers.copy = handlers.cut = (view, event) => {
|
|
|
8007
8184
|
userEvent: "delete.cut"
|
|
8008
8185
|
});
|
|
8009
8186
|
};
|
|
8187
|
+
const isFocusChange = /*@__PURE__*/Annotation.define();
|
|
8188
|
+
function focusChangeTransaction(state, focus) {
|
|
8189
|
+
let effects = [];
|
|
8190
|
+
for (let getEffect of state.facet(focusChangeEffect)) {
|
|
8191
|
+
let effect = getEffect(state, focus);
|
|
8192
|
+
if (effect) effects.push(effect);
|
|
8193
|
+
}
|
|
8194
|
+
return effects ? state.update({
|
|
8195
|
+
effects,
|
|
8196
|
+
annotations: isFocusChange.of(true)
|
|
8197
|
+
}) : null;
|
|
8198
|
+
}
|
|
8010
8199
|
function updateForFocusChange(view) {
|
|
8011
8200
|
setTimeout(() => {
|
|
8012
|
-
|
|
8201
|
+
let focus = view.hasFocus;
|
|
8202
|
+
if (focus != view.inputState.notifiedFocused) {
|
|
8203
|
+
let tr = focusChangeTransaction(view.state, focus);
|
|
8204
|
+
if (tr) view.dispatch(tr);else view.update([]);
|
|
8205
|
+
}
|
|
8013
8206
|
}, 10);
|
|
8014
8207
|
}
|
|
8015
8208
|
handlers.focus = view => {
|
|
@@ -8035,6 +8228,8 @@ handlers.compositionstart = handlers.compositionupdate = view => {
|
|
|
8035
8228
|
handlers.compositionend = view => {
|
|
8036
8229
|
view.inputState.composing = -1;
|
|
8037
8230
|
view.inputState.compositionEndedAt = Date.now();
|
|
8231
|
+
view.inputState.compositionPendingKey = true;
|
|
8232
|
+
view.inputState.compositionPendingChange = view.observer.pendingRecords().length > 0;
|
|
8038
8233
|
view.inputState.compositionFirstChange = null;
|
|
8039
8234
|
if (browser.chrome && browser.android) view.observer.flushSoon();
|
|
8040
8235
|
setTimeout(() => {
|
|
@@ -8078,15 +8273,16 @@ class HeightOracle {
|
|
|
8078
8273
|
this.lineWrapping = lineWrapping;
|
|
8079
8274
|
this.doc = Text.empty;
|
|
8080
8275
|
this.heightSamples = {};
|
|
8081
|
-
this.lineHeight = 14;
|
|
8276
|
+
this.lineHeight = 14; // The height of an entire line (line-height)
|
|
8082
8277
|
this.charWidth = 7;
|
|
8278
|
+
this.textHeight = 14; // The height of the actual font (font-size)
|
|
8083
8279
|
this.lineLength = 30;
|
|
8084
8280
|
// Used to track, during updateHeight, if any actual heights changed
|
|
8085
8281
|
this.heightChanged = false;
|
|
8086
8282
|
}
|
|
8087
8283
|
heightForGap(from, to) {
|
|
8088
8284
|
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);
|
|
8285
|
+
if (this.lineWrapping) lines += Math.max(0, Math.ceil((to - from - lines * this.lineLength * 0.5) / this.lineLength));
|
|
8090
8286
|
return this.lineHeight * lines;
|
|
8091
8287
|
}
|
|
8092
8288
|
heightForLine(length) {
|
|
@@ -8115,12 +8311,13 @@ class HeightOracle {
|
|
|
8115
8311
|
}
|
|
8116
8312
|
return newHeight;
|
|
8117
8313
|
}
|
|
8118
|
-
refresh(whiteSpace, lineHeight, charWidth, lineLength, knownHeights) {
|
|
8314
|
+
refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {
|
|
8119
8315
|
let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;
|
|
8120
8316
|
let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping;
|
|
8121
8317
|
this.lineWrapping = lineWrapping;
|
|
8122
8318
|
this.lineHeight = lineHeight;
|
|
8123
8319
|
this.charWidth = charWidth;
|
|
8320
|
+
this.textHeight = textHeight;
|
|
8124
8321
|
this.lineLength = lineLength;
|
|
8125
8322
|
if (changed) {
|
|
8126
8323
|
this.heightSamples = {};
|
|
@@ -8212,9 +8409,8 @@ const Epsilon = 1e-3;
|
|
|
8212
8409
|
class HeightMap {
|
|
8213
8410
|
constructor(length,
|
|
8214
8411
|
// The number of characters covered
|
|
8215
|
-
height
|
|
8216
|
-
|
|
8217
|
-
flags = 2 /* Flag.Outdated */) {
|
|
8412
|
+
height) {
|
|
8413
|
+
let flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
|
8218
8414
|
this.length = length;
|
|
8219
8415
|
this.height = height;
|
|
8220
8416
|
this.flags = flags;
|
|
@@ -8245,7 +8441,8 @@ class HeightMap {
|
|
|
8245
8441
|
result.push(this);
|
|
8246
8442
|
}
|
|
8247
8443
|
applyChanges(decorations, oldDoc, oracle, changes) {
|
|
8248
|
-
let me = this
|
|
8444
|
+
let me = this,
|
|
8445
|
+
doc = oracle.doc;
|
|
8249
8446
|
for (let i = changes.length - 1; i >= 0; i--) {
|
|
8250
8447
|
let {
|
|
8251
8448
|
fromA,
|
|
@@ -8253,19 +8450,19 @@ class HeightMap {
|
|
|
8253
8450
|
fromB,
|
|
8254
8451
|
toB
|
|
8255
8452
|
} = 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,
|
|
8453
|
+
let start = me.lineAt(fromA, QueryType.ByPosNoHeight, oracle.setDoc(oldDoc), 0, 0);
|
|
8454
|
+
let end = start.to >= toA ? start : me.lineAt(toA, QueryType.ByPosNoHeight, oracle, 0, 0);
|
|
8258
8455
|
toB += end.to - toA;
|
|
8259
8456
|
toA = end.to;
|
|
8260
8457
|
while (i > 0 && start.from <= changes[i - 1].toA) {
|
|
8261
8458
|
fromA = changes[i - 1].fromA;
|
|
8262
8459
|
fromB = changes[i - 1].fromB;
|
|
8263
8460
|
i--;
|
|
8264
|
-
if (fromA < start.from) start = me.lineAt(fromA, QueryType.ByPosNoHeight,
|
|
8461
|
+
if (fromA < start.from) start = me.lineAt(fromA, QueryType.ByPosNoHeight, oracle, 0, 0);
|
|
8265
8462
|
}
|
|
8266
8463
|
fromB += start.from - fromA;
|
|
8267
8464
|
fromA = start.from;
|
|
8268
|
-
let nodes = NodeBuilder.build(oracle, decorations, fromB, toB);
|
|
8465
|
+
let nodes = NodeBuilder.build(oracle.setDoc(doc), decorations, fromB, toB);
|
|
8269
8466
|
me = me.replace(fromA, toA, nodes);
|
|
8270
8467
|
}
|
|
8271
8468
|
return me.updateHeight(oracle, 0);
|
|
@@ -8323,16 +8520,18 @@ class HeightMapBlock extends HeightMap {
|
|
|
8323
8520
|
super(length, height);
|
|
8324
8521
|
this.type = type;
|
|
8325
8522
|
}
|
|
8326
|
-
blockAt(_height,
|
|
8523
|
+
blockAt(_height, _oracle, top, offset) {
|
|
8327
8524
|
return new BlockInfo(offset, this.length, top, this.height, this.type);
|
|
8328
8525
|
}
|
|
8329
|
-
lineAt(_value, _type,
|
|
8330
|
-
return this.blockAt(0,
|
|
8526
|
+
lineAt(_value, _type, oracle, top, offset) {
|
|
8527
|
+
return this.blockAt(0, oracle, top, offset);
|
|
8331
8528
|
}
|
|
8332
|
-
forEachLine(from, to,
|
|
8333
|
-
if (from <= offset + this.length && to >= offset) f(this.blockAt(0,
|
|
8529
|
+
forEachLine(from, to, oracle, top, offset, f) {
|
|
8530
|
+
if (from <= offset + this.length && to >= offset) f(this.blockAt(0, oracle, top, offset));
|
|
8334
8531
|
}
|
|
8335
|
-
updateHeight(oracle
|
|
8532
|
+
updateHeight(oracle) {
|
|
8533
|
+
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
8534
|
+
let measured = arguments.length > 3 ? arguments[3] : undefined;
|
|
8336
8535
|
if (measured && measured.from <= offset && measured.more) this.setHeight(oracle, measured.heights[measured.index++]);
|
|
8337
8536
|
this.outdated = false;
|
|
8338
8537
|
return this;
|
|
@@ -8358,7 +8557,10 @@ class HeightMapText extends HeightMapBlock {
|
|
|
8358
8557
|
return HeightMap.of(nodes);
|
|
8359
8558
|
}
|
|
8360
8559
|
}
|
|
8361
|
-
updateHeight(oracle
|
|
8560
|
+
updateHeight(oracle) {
|
|
8561
|
+
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
8562
|
+
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
8563
|
+
let measured = arguments.length > 3 ? arguments[3] : undefined;
|
|
8362
8564
|
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
8565
|
this.outdated = false;
|
|
8364
8566
|
return this;
|
|
@@ -8371,58 +8573,85 @@ class HeightMapGap extends HeightMap {
|
|
|
8371
8573
|
constructor(length) {
|
|
8372
8574
|
super(length, 0);
|
|
8373
8575
|
}
|
|
8374
|
-
|
|
8375
|
-
let firstLine = doc.lineAt(offset).number,
|
|
8376
|
-
lastLine = doc.lineAt(offset + this.length).number;
|
|
8576
|
+
heightMetrics(oracle, offset) {
|
|
8577
|
+
let firstLine = oracle.doc.lineAt(offset).number,
|
|
8578
|
+
lastLine = oracle.doc.lineAt(offset + this.length).number;
|
|
8579
|
+
let lines = lastLine - firstLine + 1;
|
|
8580
|
+
let perLine,
|
|
8581
|
+
perChar = 0;
|
|
8582
|
+
if (oracle.lineWrapping) {
|
|
8583
|
+
let totalPerLine = Math.min(this.height, oracle.lineHeight * lines);
|
|
8584
|
+
perLine = totalPerLine / lines;
|
|
8585
|
+
perChar = (this.height - totalPerLine) / (this.length - lines - 1);
|
|
8586
|
+
} else {
|
|
8587
|
+
perLine = this.height / lines;
|
|
8588
|
+
}
|
|
8377
8589
|
return {
|
|
8378
8590
|
firstLine,
|
|
8379
8591
|
lastLine,
|
|
8380
|
-
|
|
8592
|
+
perLine,
|
|
8593
|
+
perChar
|
|
8381
8594
|
};
|
|
8382
8595
|
}
|
|
8383
|
-
blockAt(height,
|
|
8596
|
+
blockAt(height, oracle, top, offset) {
|
|
8384
8597
|
let {
|
|
8385
8598
|
firstLine,
|
|
8386
8599
|
lastLine,
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8600
|
+
perLine,
|
|
8601
|
+
perChar
|
|
8602
|
+
} = this.heightMetrics(oracle, offset);
|
|
8603
|
+
if (oracle.lineWrapping) {
|
|
8604
|
+
let guess = offset + Math.round(Math.max(0, Math.min(1, (height - top) / this.height)) * this.length);
|
|
8605
|
+
let line = oracle.doc.lineAt(guess),
|
|
8606
|
+
lineHeight = perLine + line.length * perChar;
|
|
8607
|
+
let lineTop = Math.max(top, height - lineHeight / 2);
|
|
8608
|
+
return new BlockInfo(line.from, line.length, lineTop, lineHeight, BlockType.Text);
|
|
8609
|
+
} else {
|
|
8610
|
+
let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top) / perLine)));
|
|
8611
|
+
let {
|
|
8612
|
+
from,
|
|
8613
|
+
length
|
|
8614
|
+
} = oracle.doc.line(firstLine + line);
|
|
8615
|
+
return new BlockInfo(from, length, top + perLine * line, perLine, BlockType.Text);
|
|
8616
|
+
}
|
|
8395
8617
|
}
|
|
8396
|
-
lineAt(value, type,
|
|
8397
|
-
if (type == QueryType.ByHeight) return this.blockAt(value,
|
|
8618
|
+
lineAt(value, type, oracle, top, offset) {
|
|
8619
|
+
if (type == QueryType.ByHeight) return this.blockAt(value, oracle, top, offset);
|
|
8398
8620
|
if (type == QueryType.ByPosNoHeight) {
|
|
8399
8621
|
let {
|
|
8400
8622
|
from,
|
|
8401
8623
|
to
|
|
8402
|
-
} = doc.lineAt(value);
|
|
8624
|
+
} = oracle.doc.lineAt(value);
|
|
8403
8625
|
return new BlockInfo(from, to - from, 0, 0, BlockType.Text);
|
|
8404
8626
|
}
|
|
8405
8627
|
let {
|
|
8406
8628
|
firstLine,
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
length
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
return new BlockInfo(from, length, top
|
|
8415
|
-
}
|
|
8416
|
-
forEachLine(from, to,
|
|
8629
|
+
perLine,
|
|
8630
|
+
perChar
|
|
8631
|
+
} = this.heightMetrics(oracle, offset);
|
|
8632
|
+
let line = oracle.doc.lineAt(value),
|
|
8633
|
+
lineHeight = perLine + line.length * perChar;
|
|
8634
|
+
let linesAbove = line.number - firstLine;
|
|
8635
|
+
let lineTop = top + perLine * linesAbove + perChar * (line.from - offset - linesAbove);
|
|
8636
|
+
return new BlockInfo(line.from, line.length, Math.max(top, Math.min(lineTop, top + this.height - lineHeight)), lineHeight, BlockType.Text);
|
|
8637
|
+
}
|
|
8638
|
+
forEachLine(from, to, oracle, top, offset, f) {
|
|
8639
|
+
from = Math.max(from, offset);
|
|
8640
|
+
to = Math.min(to, offset + this.length);
|
|
8417
8641
|
let {
|
|
8418
8642
|
firstLine,
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8643
|
+
perLine,
|
|
8644
|
+
perChar
|
|
8645
|
+
} = this.heightMetrics(oracle, offset);
|
|
8646
|
+
for (let pos = from, lineTop = top; pos <= to;) {
|
|
8647
|
+
let line = oracle.doc.lineAt(pos);
|
|
8648
|
+
if (pos == from) {
|
|
8649
|
+
let linesAbove = line.number - firstLine;
|
|
8650
|
+
lineTop += perLine * linesAbove + perChar * (from - offset - linesAbove);
|
|
8651
|
+
}
|
|
8652
|
+
let lineHeight = perLine + perChar * line.length;
|
|
8653
|
+
f(new BlockInfo(line.from, line.length, lineTop, lineHeight, BlockType.Text));
|
|
8654
|
+
lineTop += lineHeight;
|
|
8426
8655
|
pos = line.to + 1;
|
|
8427
8656
|
}
|
|
8428
8657
|
}
|
|
@@ -8444,7 +8673,10 @@ class HeightMapGap extends HeightMap {
|
|
|
8444
8673
|
decomposeRight(from, result) {
|
|
8445
8674
|
result.push(null, new HeightMapGap(this.length - from - 1));
|
|
8446
8675
|
}
|
|
8447
|
-
updateHeight(oracle
|
|
8676
|
+
updateHeight(oracle) {
|
|
8677
|
+
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
8678
|
+
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
8679
|
+
let measured = arguments.length > 3 ? arguments[3] : undefined;
|
|
8448
8680
|
let end = offset + this.length;
|
|
8449
8681
|
if (measured && measured.from <= offset + this.length && measured.more) {
|
|
8450
8682
|
// Fill in part of this gap with measured lines. We know there
|
|
@@ -8454,7 +8686,6 @@ class HeightMapGap extends HeightMap {
|
|
|
8454
8686
|
let nodes = [],
|
|
8455
8687
|
pos = Math.max(offset, measured.from),
|
|
8456
8688
|
singleHeight = -1;
|
|
8457
|
-
let wasChanged = oracle.heightChanged;
|
|
8458
8689
|
if (measured.from > offset) nodes.push(new HeightMapGap(measured.from - offset - 1).updateHeight(oracle, offset));
|
|
8459
8690
|
while (pos <= end && measured.more) {
|
|
8460
8691
|
let len = oracle.doc.lineAt(pos).length;
|
|
@@ -8468,7 +8699,7 @@ class HeightMapGap extends HeightMap {
|
|
|
8468
8699
|
}
|
|
8469
8700
|
if (pos <= end) nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));
|
|
8470
8701
|
let result = HeightMap.of(nodes);
|
|
8471
|
-
|
|
8702
|
+
if (singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon) oracle.heightChanged = true;
|
|
8472
8703
|
return result;
|
|
8473
8704
|
} else if (force || this.outdated) {
|
|
8474
8705
|
this.setHeight(oracle, oracle.heightForGap(offset, offset + this.length));
|
|
@@ -8490,30 +8721,30 @@ class HeightMapBranch extends HeightMap {
|
|
|
8490
8721
|
get break() {
|
|
8491
8722
|
return this.flags & 1 /* Flag.Break */;
|
|
8492
8723
|
}
|
|
8493
|
-
blockAt(height,
|
|
8724
|
+
blockAt(height, oracle, top, offset) {
|
|
8494
8725
|
let mid = top + this.left.height;
|
|
8495
|
-
return height < mid ? this.left.blockAt(height,
|
|
8726
|
+
return height < mid ? this.left.blockAt(height, oracle, top, offset) : this.right.blockAt(height, oracle, mid, offset + this.left.length + this.break);
|
|
8496
8727
|
}
|
|
8497
|
-
lineAt(value, type,
|
|
8728
|
+
lineAt(value, type, oracle, top, offset) {
|
|
8498
8729
|
let rightTop = top + this.left.height,
|
|
8499
8730
|
rightOffset = offset + this.left.length + this.break;
|
|
8500
8731
|
let left = type == QueryType.ByHeight ? value < rightTop : value < rightOffset;
|
|
8501
|
-
let base = left ? this.left.lineAt(value, type,
|
|
8732
|
+
let base = left ? this.left.lineAt(value, type, oracle, top, offset) : this.right.lineAt(value, type, oracle, rightTop, rightOffset);
|
|
8502
8733
|
if (this.break || (left ? base.to < rightOffset : base.from > rightOffset)) return base;
|
|
8503
8734
|
let subQuery = type == QueryType.ByPosNoHeight ? QueryType.ByPosNoHeight : QueryType.ByPos;
|
|
8504
|
-
if (left) return base.join(this.right.lineAt(rightOffset, subQuery,
|
|
8735
|
+
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
8736
|
}
|
|
8506
|
-
forEachLine(from, to,
|
|
8737
|
+
forEachLine(from, to, oracle, top, offset, f) {
|
|
8507
8738
|
let rightTop = top + this.left.height,
|
|
8508
8739
|
rightOffset = offset + this.left.length + this.break;
|
|
8509
8740
|
if (this.break) {
|
|
8510
|
-
if (from < rightOffset) this.left.forEachLine(from, to,
|
|
8511
|
-
if (to >= rightOffset) this.right.forEachLine(from, to,
|
|
8741
|
+
if (from < rightOffset) this.left.forEachLine(from, to, oracle, top, offset, f);
|
|
8742
|
+
if (to >= rightOffset) this.right.forEachLine(from, to, oracle, rightTop, rightOffset, f);
|
|
8512
8743
|
} else {
|
|
8513
|
-
let mid = this.lineAt(rightOffset, QueryType.ByPos,
|
|
8514
|
-
if (from < mid.from) this.left.forEachLine(from, mid.from - 1,
|
|
8744
|
+
let mid = this.lineAt(rightOffset, QueryType.ByPos, oracle, top, offset);
|
|
8745
|
+
if (from < mid.from) this.left.forEachLine(from, mid.from - 1, oracle, top, offset, f);
|
|
8515
8746
|
if (mid.to >= from && mid.from <= to) f(mid);
|
|
8516
|
-
if (to > mid.to) this.right.forEachLine(mid.to + 1, to,
|
|
8747
|
+
if (to > mid.to) this.right.forEachLine(mid.to + 1, to, oracle, rightTop, rightOffset, f);
|
|
8517
8748
|
}
|
|
8518
8749
|
}
|
|
8519
8750
|
replace(from, to, nodes) {
|
|
@@ -8560,7 +8791,10 @@ class HeightMapBranch extends HeightMap {
|
|
|
8560
8791
|
this.length = left.length + this.break + right.length;
|
|
8561
8792
|
return this;
|
|
8562
8793
|
}
|
|
8563
|
-
updateHeight(oracle
|
|
8794
|
+
updateHeight(oracle) {
|
|
8795
|
+
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
8796
|
+
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
8797
|
+
let measured = arguments.length > 3 ? arguments[3] : undefined;
|
|
8564
8798
|
let {
|
|
8565
8799
|
left,
|
|
8566
8800
|
right
|
|
@@ -8847,10 +9081,13 @@ class ViewState {
|
|
|
8847
9081
|
} = this.state.selection;
|
|
8848
9082
|
for (let i = 0; i <= 1; i++) {
|
|
8849
9083
|
let pos = i ? main.head : main.anchor;
|
|
8850
|
-
if (!viewports.some(
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
9084
|
+
if (!viewports.some(_ref2 => {
|
|
9085
|
+
let {
|
|
9086
|
+
from,
|
|
9087
|
+
to
|
|
9088
|
+
} = _ref2;
|
|
9089
|
+
return pos >= from && pos <= to;
|
|
9090
|
+
})) {
|
|
8854
9091
|
let {
|
|
8855
9092
|
from,
|
|
8856
9093
|
to
|
|
@@ -8859,15 +9096,16 @@ class ViewState {
|
|
|
8859
9096
|
}
|
|
8860
9097
|
}
|
|
8861
9098
|
this.viewports = viewports.sort((a, b) => a.from - b.from);
|
|
8862
|
-
this.scaler = this.heightMap.height <= 7000000 /* VP.MaxDOMHeight */ ? IdScaler : new BigScaler(this.heightOracle
|
|
9099
|
+
this.scaler = this.heightMap.height <= 7000000 /* VP.MaxDOMHeight */ ? IdScaler : new BigScaler(this.heightOracle, this.heightMap, this.viewports);
|
|
8863
9100
|
}
|
|
8864
9101
|
updateViewportLines() {
|
|
8865
9102
|
this.viewportLines = [];
|
|
8866
|
-
this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.state.doc, 0, 0, block => {
|
|
9103
|
+
this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, block => {
|
|
8867
9104
|
this.viewportLines.push(this.scaler.scale == 1 ? block : scaleBlock(block, this.scaler));
|
|
8868
9105
|
});
|
|
8869
9106
|
}
|
|
8870
|
-
update(update
|
|
9107
|
+
update(update) {
|
|
9108
|
+
let scrollTarget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
8871
9109
|
this.state = update.state;
|
|
8872
9110
|
let prevDeco = this.stateDeco;
|
|
8873
9111
|
this.stateDeco = this.state.facet(decorations).filter(d => typeof d != "function");
|
|
@@ -8894,8 +9132,9 @@ class ViewState {
|
|
|
8894
9132
|
let whiteSpace = style.whiteSpace;
|
|
8895
9133
|
this.defaultTextDirection = style.direction == "rtl" ? Direction.RTL : Direction.LTR;
|
|
8896
9134
|
let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace);
|
|
8897
|
-
let
|
|
8898
|
-
this.contentDOMHeight
|
|
9135
|
+
let domRect = dom.getBoundingClientRect();
|
|
9136
|
+
let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
|
|
9137
|
+
this.contentDOMHeight = domRect.height;
|
|
8899
9138
|
this.mustMeasureContent = false;
|
|
8900
9139
|
let result = 0,
|
|
8901
9140
|
bias = 0;
|
|
@@ -8924,9 +9163,9 @@ class ViewState {
|
|
|
8924
9163
|
if (inView) measureContent = true;
|
|
8925
9164
|
}
|
|
8926
9165
|
if (!this.inView && !this.scrollTarget) return 0;
|
|
8927
|
-
let contentWidth =
|
|
9166
|
+
let contentWidth = domRect.width;
|
|
8928
9167
|
if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
|
|
8929
|
-
this.contentDOMWidth =
|
|
9168
|
+
this.contentDOMWidth = domRect.width;
|
|
8930
9169
|
this.editorHeight = view.scrollDOM.clientHeight;
|
|
8931
9170
|
result |= 8 /* UpdateFlag.Geometry */;
|
|
8932
9171
|
}
|
|
@@ -8937,9 +9176,10 @@ class ViewState {
|
|
|
8937
9176
|
if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) {
|
|
8938
9177
|
let {
|
|
8939
9178
|
lineHeight,
|
|
8940
|
-
charWidth
|
|
9179
|
+
charWidth,
|
|
9180
|
+
textHeight
|
|
8941
9181
|
} = view.docView.measureTextSize();
|
|
8942
|
-
refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, contentWidth / charWidth, lineHeights);
|
|
9182
|
+
refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);
|
|
8943
9183
|
if (refresh) {
|
|
8944
9184
|
view.docView.minWidth = 0;
|
|
8945
9185
|
result |= 8 /* UpdateFlag.Geometry */;
|
|
@@ -8983,12 +9223,12 @@ class ViewState {
|
|
|
8983
9223
|
// since the last update). It'll hold a number between 0 and 1
|
|
8984
9224
|
let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1000 /* VP.Margin */ / 2));
|
|
8985
9225
|
let map = this.heightMap,
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
let viewport = new Viewport(map.lineAt(visibleTop - marginTop * 1000 /* VP.Margin */, QueryType.ByHeight,
|
|
9226
|
+
oracle = this.heightOracle;
|
|
9227
|
+
let {
|
|
9228
|
+
visibleTop,
|
|
9229
|
+
visibleBottom
|
|
9230
|
+
} = this;
|
|
9231
|
+
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
9232
|
// If scrollTarget is given, make sure the viewport includes that position
|
|
8993
9233
|
if (scrollTarget) {
|
|
8994
9234
|
let {
|
|
@@ -8996,10 +9236,10 @@ class ViewState {
|
|
|
8996
9236
|
} = scrollTarget.range;
|
|
8997
9237
|
if (head < viewport.from || head > viewport.to) {
|
|
8998
9238
|
let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);
|
|
8999
|
-
let block = map.lineAt(head, QueryType.ByPos,
|
|
9239
|
+
let block = map.lineAt(head, QueryType.ByPos, oracle, 0, 0),
|
|
9000
9240
|
topPos;
|
|
9001
9241
|
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,
|
|
9242
|
+
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
9243
|
}
|
|
9004
9244
|
}
|
|
9005
9245
|
return viewport;
|
|
@@ -9007,21 +9247,23 @@ class ViewState {
|
|
|
9007
9247
|
mapViewport(viewport, changes) {
|
|
9008
9248
|
let from = changes.mapPos(viewport.from, -1),
|
|
9009
9249
|
to = changes.mapPos(viewport.to, 1);
|
|
9010
|
-
return new Viewport(this.heightMap.lineAt(from, QueryType.ByPos, this.
|
|
9250
|
+
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
9251
|
}
|
|
9012
9252
|
// Checks if a given viewport covers the visible part of the
|
|
9013
9253
|
// document and not too much beyond that.
|
|
9014
|
-
viewportIsAppropriate({
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9254
|
+
viewportIsAppropriate(_ref3) {
|
|
9255
|
+
let {
|
|
9256
|
+
from,
|
|
9257
|
+
to
|
|
9258
|
+
} = _ref3;
|
|
9259
|
+
let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
9018
9260
|
if (!this.inView) return true;
|
|
9019
9261
|
let {
|
|
9020
9262
|
top
|
|
9021
|
-
} = this.heightMap.lineAt(from, QueryType.ByPos, this.
|
|
9263
|
+
} = this.heightMap.lineAt(from, QueryType.ByPos, this.heightOracle, 0, 0);
|
|
9022
9264
|
let {
|
|
9023
9265
|
bottom
|
|
9024
|
-
} = this.heightMap.lineAt(to, QueryType.ByPos, this.
|
|
9266
|
+
} = this.heightMap.lineAt(to, QueryType.ByPos, this.heightOracle, 0, 0);
|
|
9025
9267
|
let {
|
|
9026
9268
|
visibleTop,
|
|
9027
9269
|
visibleBottom
|
|
@@ -9146,13 +9388,13 @@ class ViewState {
|
|
|
9146
9388
|
return changed ? 4 /* UpdateFlag.Viewport */ : 0;
|
|
9147
9389
|
}
|
|
9148
9390
|
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.
|
|
9391
|
+
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
9392
|
}
|
|
9151
9393
|
lineBlockAtHeight(height) {
|
|
9152
|
-
return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType.ByHeight, this.
|
|
9394
|
+
return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType.ByHeight, this.heightOracle, 0, 0), this.scaler);
|
|
9153
9395
|
}
|
|
9154
9396
|
elementAtHeight(height) {
|
|
9155
|
-
return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.
|
|
9397
|
+
return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.heightOracle, 0, 0), this.scaler);
|
|
9156
9398
|
}
|
|
9157
9399
|
get docHeight() {
|
|
9158
9400
|
return this.scaler.toDOM(this.heightMap.height);
|
|
@@ -9196,10 +9438,11 @@ function lineStructure(from, to, stateDeco) {
|
|
|
9196
9438
|
ranges
|
|
9197
9439
|
};
|
|
9198
9440
|
}
|
|
9199
|
-
function findPosition({
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9441
|
+
function findPosition(_ref4, ratio) {
|
|
9442
|
+
let {
|
|
9443
|
+
total,
|
|
9444
|
+
ranges
|
|
9445
|
+
} = _ref4;
|
|
9203
9446
|
if (ratio <= 0) return ranges[0].from;
|
|
9204
9447
|
if (ratio >= 1) return ranges[ranges.length - 1].to;
|
|
9205
9448
|
let dist = Math.floor(total * ratio);
|
|
@@ -9246,16 +9489,17 @@ const IdScaler = {
|
|
|
9246
9489
|
// regions outside the viewports so that the total height is
|
|
9247
9490
|
// VP.MaxDOMHeight.
|
|
9248
9491
|
class BigScaler {
|
|
9249
|
-
constructor(
|
|
9492
|
+
constructor(oracle, heightMap, viewports) {
|
|
9250
9493
|
let vpHeight = 0,
|
|
9251
9494
|
base = 0,
|
|
9252
9495
|
domBase = 0;
|
|
9253
|
-
this.viewports = viewports.map(
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
let
|
|
9496
|
+
this.viewports = viewports.map(_ref5 => {
|
|
9497
|
+
let {
|
|
9498
|
+
from,
|
|
9499
|
+
to
|
|
9500
|
+
} = _ref5;
|
|
9501
|
+
let top = heightMap.lineAt(from, QueryType.ByPos, oracle, 0, 0).top;
|
|
9502
|
+
let bottom = heightMap.lineAt(to, QueryType.ByPos, oracle, 0, 0).bottom;
|
|
9259
9503
|
vpHeight += bottom - top;
|
|
9260
9504
|
return {
|
|
9261
9505
|
from,
|
|
@@ -9382,6 +9626,9 @@ const baseTheme$1$1 = /*@__PURE__*/buildTheme("." + baseThemeID, {
|
|
|
9382
9626
|
padding: "0 2px 0 6px"
|
|
9383
9627
|
},
|
|
9384
9628
|
".cm-layer": {
|
|
9629
|
+
position: "absolute",
|
|
9630
|
+
left: 0,
|
|
9631
|
+
top: 0,
|
|
9385
9632
|
contain: "size style",
|
|
9386
9633
|
"& > *": {
|
|
9387
9634
|
position: "absolute"
|
|
@@ -9433,6 +9680,9 @@ const baseTheme$1$1 = /*@__PURE__*/buildTheme("." + baseThemeID, {
|
|
|
9433
9680
|
"&dark .cm-cursor": {
|
|
9434
9681
|
borderLeftColor: "#444"
|
|
9435
9682
|
},
|
|
9683
|
+
".cm-dropCursor": {
|
|
9684
|
+
position: "absolute"
|
|
9685
|
+
},
|
|
9436
9686
|
"&.cm-focused .cm-cursor": {
|
|
9437
9687
|
display: "block"
|
|
9438
9688
|
},
|
|
@@ -9651,7 +9901,7 @@ function applyDOMChange(view, domChange) {
|
|
|
9651
9901
|
to: sel.to,
|
|
9652
9902
|
insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))
|
|
9653
9903
|
};
|
|
9654
|
-
} else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString())) {
|
|
9904
|
+
} 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
9905
|
// Detect insert-period-on-double-space Mac and Android behavior,
|
|
9656
9906
|
// and transform it into a regular space insert.
|
|
9657
9907
|
if (newSel && change.insert.length == 2) newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
|
|
@@ -9691,7 +9941,7 @@ function applyDOMChange(view, domChange) {
|
|
|
9691
9941
|
tr = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, undefined, view.state.lineBreak) + after));
|
|
9692
9942
|
} else {
|
|
9693
9943
|
let changes = startState.changes(change);
|
|
9694
|
-
let mainSel = newSel &&
|
|
9944
|
+
let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : undefined;
|
|
9695
9945
|
// Try to apply a composition change to all cursors
|
|
9696
9946
|
if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 && change.to <= sel.to && change.to >= sel.to - 10) {
|
|
9697
9947
|
let replaced = view.state.sliceDoc(change.from, change.to);
|
|
@@ -9732,7 +9982,8 @@ function applyDOMChange(view, domChange) {
|
|
|
9732
9982
|
}
|
|
9733
9983
|
}
|
|
9734
9984
|
let userEvent = "input.type";
|
|
9735
|
-
if (view.composing) {
|
|
9985
|
+
if (view.composing || view.inputState.compositionPendingChange && view.inputState.compositionEndedAt > Date.now() - 50) {
|
|
9986
|
+
view.inputState.compositionPendingChange = false;
|
|
9736
9987
|
userEvent += ".compose";
|
|
9737
9988
|
if (view.inputState.compositionFirstChange) {
|
|
9738
9989
|
userEvent += ".start";
|
|
@@ -10084,9 +10335,12 @@ class DOMObserver {
|
|
|
10084
10335
|
}
|
|
10085
10336
|
this.flush();
|
|
10086
10337
|
}
|
|
10338
|
+
pendingRecords() {
|
|
10339
|
+
for (let mut of this.observer.takeRecords()) this.queue.push(mut);
|
|
10340
|
+
return this.queue;
|
|
10341
|
+
}
|
|
10087
10342
|
processRecords() {
|
|
10088
|
-
let records = this.
|
|
10089
|
-
for (let mut of this.observer.takeRecords()) records.push(mut);
|
|
10343
|
+
let records = this.pendingRecords();
|
|
10090
10344
|
if (records.length) this.queue = [];
|
|
10091
10345
|
let from = -1,
|
|
10092
10346
|
to = -1,
|
|
@@ -10125,7 +10379,8 @@ class DOMObserver {
|
|
|
10125
10379
|
return new DOMChange(this.view, from, to, typeOver);
|
|
10126
10380
|
}
|
|
10127
10381
|
// Apply pending changes, if any
|
|
10128
|
-
flush(
|
|
10382
|
+
flush() {
|
|
10383
|
+
let readSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
10129
10384
|
// Completely hold off flushing when pending keys are set—the code
|
|
10130
10385
|
// managing those will make sure processRecords is called and the
|
|
10131
10386
|
// view is resynchronized after
|
|
@@ -10264,7 +10519,8 @@ class EditorView {
|
|
|
10264
10519
|
option, or put `view.dom` into your document after creating a
|
|
10265
10520
|
view, so that the user can see the editor.
|
|
10266
10521
|
*/
|
|
10267
|
-
constructor(
|
|
10522
|
+
constructor() {
|
|
10523
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10268
10524
|
this.plugins = [];
|
|
10269
10525
|
this.pluginMap = new Map();
|
|
10270
10526
|
this.editorAttrs = {};
|
|
@@ -10373,8 +10629,8 @@ class EditorView {
|
|
|
10373
10629
|
get win() {
|
|
10374
10630
|
return this.dom.ownerDocument.defaultView || window;
|
|
10375
10631
|
}
|
|
10376
|
-
dispatch(
|
|
10377
|
-
this._dispatch(
|
|
10632
|
+
dispatch() {
|
|
10633
|
+
this._dispatch(arguments.length == 1 && (arguments.length <= 0 ? undefined : arguments[0]) instanceof Transaction ? arguments.length <= 0 ? undefined : arguments[0] : this.state.update(...arguments));
|
|
10378
10634
|
}
|
|
10379
10635
|
/**
|
|
10380
10636
|
Update the view for the given array of transactions. This will
|
|
@@ -10398,6 +10654,20 @@ class EditorView {
|
|
|
10398
10654
|
this.viewState.state = state;
|
|
10399
10655
|
return;
|
|
10400
10656
|
}
|
|
10657
|
+
let focus = this.hasFocus,
|
|
10658
|
+
focusFlag = 0,
|
|
10659
|
+
dispatchFocus = null;
|
|
10660
|
+
if (transactions.some(tr => tr.annotation(isFocusChange))) {
|
|
10661
|
+
this.inputState.notifiedFocused = focus;
|
|
10662
|
+
// If a focus-change transaction is being dispatched, set this update flag.
|
|
10663
|
+
focusFlag = 1 /* UpdateFlag.Focus */;
|
|
10664
|
+
} else if (focus != this.inputState.notifiedFocused) {
|
|
10665
|
+
this.inputState.notifiedFocused = focus;
|
|
10666
|
+
// Schedule a separate focus transaction if necessary, otherwise
|
|
10667
|
+
// add a flag to this update
|
|
10668
|
+
dispatchFocus = focusChangeTransaction(state, focus);
|
|
10669
|
+
if (!dispatchFocus) focusFlag = 1 /* UpdateFlag.Focus */;
|
|
10670
|
+
}
|
|
10401
10671
|
// If there was a pending DOM change, eagerly read it and try to
|
|
10402
10672
|
// apply it after the given transactions.
|
|
10403
10673
|
let pendingKey = this.observer.delayedAndroidKey,
|
|
@@ -10414,6 +10684,7 @@ class EditorView {
|
|
|
10414
10684
|
// When the phrases change, redraw the editor
|
|
10415
10685
|
if (state.facet(EditorState.phrases) != this.state.facet(EditorState.phrases)) return this.setState(state);
|
|
10416
10686
|
update = ViewUpdate.create(this, state, transactions);
|
|
10687
|
+
update.flags |= focusFlag;
|
|
10417
10688
|
let scrollTarget = this.viewState.scrollTarget;
|
|
10418
10689
|
try {
|
|
10419
10690
|
this.updateState = 2 /* UpdateState.Updating */;
|
|
@@ -10445,9 +10716,12 @@ class EditorView {
|
|
|
10445
10716
|
if (update.startState.facet(theme) != update.state.facet(theme)) this.viewState.mustMeasureContent = true;
|
|
10446
10717
|
if (redrawn || attrsChanged || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) this.requestMeasure();
|
|
10447
10718
|
if (!update.empty) for (let listener of this.state.facet(updateListener)) listener(update);
|
|
10448
|
-
if (domChange) {
|
|
10449
|
-
if (
|
|
10450
|
-
|
|
10719
|
+
if (dispatchFocus || domChange) Promise.resolve().then(() => {
|
|
10720
|
+
if (dispatchFocus && this.state == dispatchFocus.startState) this.dispatch(dispatchFocus);
|
|
10721
|
+
if (domChange) {
|
|
10722
|
+
if (!applyDOMChange(this, domChange) && pendingKey.force) dispatchKey(this.contentDOM, pendingKey.key, pendingKey.keyCode);
|
|
10723
|
+
}
|
|
10724
|
+
});
|
|
10451
10725
|
}
|
|
10452
10726
|
/**
|
|
10453
10727
|
Reset the view to the given state. (This will cause the entire
|
|
@@ -10509,9 +10783,10 @@ class EditorView {
|
|
|
10509
10783
|
/**
|
|
10510
10784
|
@internal
|
|
10511
10785
|
*/
|
|
10512
|
-
measure(
|
|
10786
|
+
measure() {
|
|
10787
|
+
let flush = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
10513
10788
|
if (this.destroyed) return;
|
|
10514
|
-
if (this.measureScheduled > -1) cancelAnimationFrame(this.measureScheduled);
|
|
10789
|
+
if (this.measureScheduled > -1) this.win.cancelAnimationFrame(this.measureScheduled);
|
|
10515
10790
|
this.measureScheduled = 0; // Prevent requestMeasure calls from scheduling another animation frame
|
|
10516
10791
|
if (flush) this.observer.forceFlush();
|
|
10517
10792
|
let updated = null;
|
|
@@ -10762,7 +11037,8 @@ class EditorView {
|
|
|
10762
11037
|
returned. Otherwise this function will return the start or end
|
|
10763
11038
|
of the line.
|
|
10764
11039
|
*/
|
|
10765
|
-
moveToLineBoundary(start, forward
|
|
11040
|
+
moveToLineBoundary(start, forward) {
|
|
11041
|
+
let includeWrap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
10766
11042
|
return moveToLineBoundary(this, start, forward, includeWrap);
|
|
10767
11043
|
}
|
|
10768
11044
|
/**
|
|
@@ -10799,10 +11075,12 @@ class EditorView {
|
|
|
10799
11075
|
for associating positions with DOM events. Will raise an error
|
|
10800
11076
|
when `node` isn't part of the editor content.
|
|
10801
11077
|
*/
|
|
10802
|
-
posAtDOM(node
|
|
11078
|
+
posAtDOM(node) {
|
|
11079
|
+
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
10803
11080
|
return this.docView.posFromDOM(node, offset);
|
|
10804
11081
|
}
|
|
10805
|
-
posAtCoords(coords
|
|
11082
|
+
posAtCoords(coords) {
|
|
11083
|
+
let precise = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
10806
11084
|
this.readMeasured();
|
|
10807
11085
|
return posAtCoords(this, coords, precise);
|
|
10808
11086
|
}
|
|
@@ -10813,7 +11091,8 @@ class EditorView {
|
|
|
10813
11091
|
available on the given side, the method will transparently use
|
|
10814
11092
|
another strategy to get reasonable coordinates).
|
|
10815
11093
|
*/
|
|
10816
|
-
coordsAtPos(pos
|
|
11094
|
+
coordsAtPos(pos) {
|
|
11095
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
10817
11096
|
this.readMeasured();
|
|
10818
11097
|
let rect = this.docView.coordsAt(pos, side);
|
|
10819
11098
|
if (!rect || rect.left == rect.right) return rect;
|
|
@@ -10928,7 +11207,7 @@ class EditorView {
|
|
|
10928
11207
|
this.inputState.destroy();
|
|
10929
11208
|
this.dom.remove();
|
|
10930
11209
|
this.observer.destroy();
|
|
10931
|
-
if (this.measureScheduled > -1) cancelAnimationFrame(this.measureScheduled);
|
|
11210
|
+
if (this.measureScheduled > -1) this.win.cancelAnimationFrame(this.measureScheduled);
|
|
10932
11211
|
this.destroyed = true;
|
|
10933
11212
|
}
|
|
10934
11213
|
/**
|
|
@@ -10936,7 +11215,8 @@ class EditorView {
|
|
|
10936
11215
|
[added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to
|
|
10937
11216
|
cause it to scroll the given position or range into view.
|
|
10938
11217
|
*/
|
|
10939
|
-
static scrollIntoView(pos
|
|
11218
|
+
static scrollIntoView(pos) {
|
|
11219
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10940
11220
|
return scrollIntoView.of(new ScrollTarget(typeof pos == "number" ? EditorSelection.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin));
|
|
10941
11221
|
}
|
|
10942
11222
|
/**
|
|
@@ -11018,6 +11298,11 @@ called and the default behavior is prevented.
|
|
|
11018
11298
|
*/
|
|
11019
11299
|
EditorView.inputHandler = inputHandler;
|
|
11020
11300
|
/**
|
|
11301
|
+
This facet can be used to provide functions that create effects
|
|
11302
|
+
to be dispatched when the editor's focus state changes.
|
|
11303
|
+
*/
|
|
11304
|
+
EditorView.focusChangeEffect = focusChangeEffect;
|
|
11305
|
+
/**
|
|
11021
11306
|
By default, the editor assumes all its content has the same
|
|
11022
11307
|
[text direction](https://codemirror.net/6/docs/ref/#view.Direction). Configure this with a `true`
|
|
11023
11308
|
value to make it read the text direction of every (rendered)
|
|
@@ -11226,7 +11511,8 @@ function runScopeHandlers(view, event, scope) {
|
|
|
11226
11511
|
}
|
|
11227
11512
|
let storedPrefix = null;
|
|
11228
11513
|
const PrefixTimeout = 4000;
|
|
11229
|
-
function buildKeymap(bindings
|
|
11514
|
+
function buildKeymap(bindings) {
|
|
11515
|
+
let platform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : currentPlatform;
|
|
11230
11516
|
let bound = Object.create(null);
|
|
11231
11517
|
let isPrefix = Object.create(null);
|
|
11232
11518
|
let checkPrefix = (name, is) => {
|
|
@@ -11406,9 +11692,10 @@ function rectanglesForRange(view, className, range) {
|
|
|
11406
11692
|
let content = view.contentDOM,
|
|
11407
11693
|
contentRect = content.getBoundingClientRect(),
|
|
11408
11694
|
base = getBase(view);
|
|
11409
|
-
let
|
|
11410
|
-
|
|
11411
|
-
let
|
|
11695
|
+
let lineElt = content.querySelector(".cm-line"),
|
|
11696
|
+
lineStyle = lineElt && window.getComputedStyle(lineElt);
|
|
11697
|
+
let leftSide = contentRect.left + (lineStyle ? parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)) : 0);
|
|
11698
|
+
let rightSide = contentRect.right - (lineStyle ? parseInt(lineStyle.paddingRight) : 0);
|
|
11412
11699
|
let startBlock = blockAt(view, from),
|
|
11413
11700
|
endBlock = blockAt(view, to);
|
|
11414
11701
|
let visualStart = startBlock.type == BlockType.Text ? startBlock : null;
|
|
@@ -11430,11 +11717,12 @@ function rectanglesForRange(view, className, range) {
|
|
|
11430
11717
|
return new RectangleMarker(className, left - base.left, top - base.top - 0.01 /* C.Epsilon */, right - left, bottom - top + 0.01 /* C.Epsilon */);
|
|
11431
11718
|
}
|
|
11432
11719
|
|
|
11433
|
-
function pieces({
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11720
|
+
function pieces(_ref6) {
|
|
11721
|
+
let {
|
|
11722
|
+
top,
|
|
11723
|
+
bottom,
|
|
11724
|
+
horizontal
|
|
11725
|
+
} = _ref6;
|
|
11438
11726
|
let pieces = [];
|
|
11439
11727
|
for (let i = 0; i < horizontal.length; i += 2) pieces.push(piece(horizontal[i], top, horizontal[i + 1], bottom));
|
|
11440
11728
|
return pieces;
|
|
@@ -11583,7 +11871,8 @@ layout cycle for many updates (the selection is drawn based on DOM
|
|
|
11583
11871
|
layout information that's only available after laying out the
|
|
11584
11872
|
content).
|
|
11585
11873
|
*/
|
|
11586
|
-
function drawSelection(
|
|
11874
|
+
function drawSelection() {
|
|
11875
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11587
11876
|
return [selectionConfig.of(config), cursorLayer, selectionLayer, hideNativeSelection, nativeSelectionHidden.of(true)];
|
|
11588
11877
|
}
|
|
11589
11878
|
function configChanged(update) {
|
|
@@ -11917,11 +12206,8 @@ const specialCharConfig = /*@__PURE__*/Facet.define({
|
|
|
11917
12206
|
Returns an extension that installs highlighting of special
|
|
11918
12207
|
characters.
|
|
11919
12208
|
*/
|
|
11920
|
-
function highlightSpecialChars(
|
|
11921
|
-
|
|
11922
|
-
Configuration options.
|
|
11923
|
-
*/
|
|
11924
|
-
config = {}) {
|
|
12209
|
+
function highlightSpecialChars() {
|
|
12210
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11925
12211
|
return [specialCharConfig.of(config), specialCharPlugin()];
|
|
11926
12212
|
}
|
|
11927
12213
|
let _plugin = null;
|
|
@@ -12157,7 +12443,8 @@ down. Can serve as a visual hint that rectangular selection is
|
|
|
12157
12443
|
going to happen when paired with
|
|
12158
12444
|
[`rectangularSelection`](https://codemirror.net/6/docs/ref/#view.rectangularSelection).
|
|
12159
12445
|
*/
|
|
12160
|
-
function crosshairCursor(
|
|
12446
|
+
function crosshairCursor() {
|
|
12447
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
12161
12448
|
let [code, getter] = keys[options.key || "Alt"];
|
|
12162
12449
|
let plugin = ViewPlugin.fromClass(class {
|
|
12163
12450
|
constructor(view) {
|
|
@@ -12252,6 +12539,7 @@ const tooltipConfig = /*@__PURE__*/Facet.define({
|
|
|
12252
12539
|
};
|
|
12253
12540
|
}
|
|
12254
12541
|
});
|
|
12542
|
+
const knownHeight = /*@__PURE__*/new WeakMap();
|
|
12255
12543
|
const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
|
|
12256
12544
|
constructor(view) {
|
|
12257
12545
|
this.view = view;
|
|
@@ -12355,13 +12643,17 @@ const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
|
|
|
12355
12643
|
let tv = this.manager.tooltipViews[i];
|
|
12356
12644
|
return tv.getCoords ? tv.getCoords(t.pos) : this.view.coordsAtPos(t.pos);
|
|
12357
12645
|
}),
|
|
12358
|
-
size: this.manager.tooltipViews.map(
|
|
12359
|
-
|
|
12360
|
-
|
|
12646
|
+
size: this.manager.tooltipViews.map(_ref7 => {
|
|
12647
|
+
let {
|
|
12648
|
+
dom
|
|
12649
|
+
} = _ref7;
|
|
12650
|
+
return dom.getBoundingClientRect();
|
|
12651
|
+
}),
|
|
12361
12652
|
space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view)
|
|
12362
12653
|
};
|
|
12363
12654
|
}
|
|
12364
12655
|
writeMeasure(measured) {
|
|
12656
|
+
var _a;
|
|
12365
12657
|
let {
|
|
12366
12658
|
editor,
|
|
12367
12659
|
space
|
|
@@ -12383,7 +12675,7 @@ const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
|
|
|
12383
12675
|
let arrow = tooltip.arrow ? tView.dom.querySelector(".cm-tooltip-arrow") : null;
|
|
12384
12676
|
let arrowHeight = arrow ? 7 /* Arrow.Size */ : 0;
|
|
12385
12677
|
let width = size.right - size.left,
|
|
12386
|
-
height = size.bottom - size.top;
|
|
12678
|
+
height = (_a = knownHeight.get(tView)) !== null && _a !== void 0 ? _a : size.bottom - size.top;
|
|
12387
12679
|
let offset = tView.offset || noOffset,
|
|
12388
12680
|
ltr = this.view.textDirection == Direction.LTR;
|
|
12389
12681
|
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 +12687,7 @@ const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
|
|
|
12395
12687
|
dom.style.top = Outside;
|
|
12396
12688
|
continue;
|
|
12397
12689
|
}
|
|
12690
|
+
knownHeight.set(tView, height);
|
|
12398
12691
|
dom.style.height = (height = spaceVert) + "px";
|
|
12399
12692
|
} else if (dom.style.height) {
|
|
12400
12693
|
dom.style.height = "";
|
|
@@ -12689,7 +12982,8 @@ Note that all hover tooltips are hosted within a single tooltip
|
|
|
12689
12982
|
container element. This allows multiple tooltips over the same
|
|
12690
12983
|
range to be "merged" together without overlapping.
|
|
12691
12984
|
*/
|
|
12692
|
-
function hoverTooltip(source
|
|
12985
|
+
function hoverTooltip(source) {
|
|
12986
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12693
12987
|
let setHover = StateEffect.define();
|
|
12694
12988
|
let hoverState = StateField.define({
|
|
12695
12989
|
create() {
|
|
@@ -13269,7 +13563,8 @@ const lineNumberGutter = /*@__PURE__*/activeGutters.compute([lineNumberConfig],
|
|
|
13269
13563
|
/**
|
|
13270
13564
|
Create a line number gutter extension.
|
|
13271
13565
|
*/
|
|
13272
|
-
function lineNumbers(
|
|
13566
|
+
function lineNumbers() {
|
|
13567
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13273
13568
|
return [lineNumberConfig.of(config), gutters(), lineNumberGutter];
|
|
13274
13569
|
}
|
|
13275
13570
|
function maxLineNumber(lines) {
|
|
@@ -13320,7 +13615,8 @@ class Range {
|
|
|
13320
13615
|
/// class represent prop names.
|
|
13321
13616
|
class NodeProp {
|
|
13322
13617
|
/// Create a new node prop type.
|
|
13323
|
-
constructor(
|
|
13618
|
+
constructor() {
|
|
13619
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13324
13620
|
this.id = nextPropID++;
|
|
13325
13621
|
this.perNode = !!config.perNode;
|
|
13326
13622
|
this.deserialize = config.deserialize || (() => {
|
|
@@ -13417,9 +13713,8 @@ class NodeType {
|
|
|
13417
13713
|
props,
|
|
13418
13714
|
/// The id of this node in its set. Corresponds to the term ids
|
|
13419
13715
|
/// used in the parser.
|
|
13420
|
-
id
|
|
13421
|
-
|
|
13422
|
-
flags = 0) {
|
|
13716
|
+
id) {
|
|
13717
|
+
let flags = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
13423
13718
|
this.name = name;
|
|
13424
13719
|
this.props = props;
|
|
13425
13720
|
this.id = id;
|
|
@@ -13509,8 +13804,11 @@ class NodeSet {
|
|
|
13509
13804
|
/// Create a copy of this set with some node properties added. The
|
|
13510
13805
|
/// arguments to this method can be created with
|
|
13511
13806
|
/// [`NodeProp.add`](#common.NodeProp.add).
|
|
13512
|
-
extend(
|
|
13807
|
+
extend() {
|
|
13513
13808
|
let newTypes = [];
|
|
13809
|
+
for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13810
|
+
props[_key] = arguments[_key];
|
|
13811
|
+
}
|
|
13514
13812
|
for (let type of this.types) {
|
|
13515
13813
|
let newProps = null;
|
|
13516
13814
|
for (let source of props) {
|
|
@@ -13605,13 +13903,15 @@ class Tree {
|
|
|
13605
13903
|
/// Get a [tree cursor](#common.TreeCursor) positioned at the top of
|
|
13606
13904
|
/// the tree. Mode can be used to [control](#common.IterMode) which
|
|
13607
13905
|
/// nodes the cursor visits.
|
|
13608
|
-
cursor(
|
|
13906
|
+
cursor() {
|
|
13907
|
+
let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
13609
13908
|
return new TreeCursor(this.topNode, mode);
|
|
13610
13909
|
}
|
|
13611
13910
|
/// Get a [tree cursor](#common.TreeCursor) pointing into this tree
|
|
13612
13911
|
/// at the given position and side (see
|
|
13613
13912
|
/// [`moveTo`](#common.TreeCursor.moveTo).
|
|
13614
|
-
cursorAt(pos
|
|
13913
|
+
cursorAt(pos) {
|
|
13914
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
13615
13915
|
let scope = CachedNode.get(this) || this.topNode;
|
|
13616
13916
|
let cursor = new TreeCursor(scope);
|
|
13617
13917
|
cursor.moveTo(pos, side);
|
|
@@ -13632,7 +13932,8 @@ class Tree {
|
|
|
13632
13932
|
/// Note that this will not enter
|
|
13633
13933
|
/// [overlays](#common.MountedTree.overlay), and you often want
|
|
13634
13934
|
/// [`resolveInner`](#common.Tree.resolveInner) instead.
|
|
13635
|
-
resolve(pos
|
|
13935
|
+
resolve(pos) {
|
|
13936
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
13636
13937
|
let node = resolveNode(CachedNode.get(this) || this.topNode, pos, side, false);
|
|
13637
13938
|
CachedNode.set(this, node);
|
|
13638
13939
|
return node;
|
|
@@ -13642,7 +13943,8 @@ class Tree {
|
|
|
13642
13943
|
/// pointing into the innermost overlaid tree at the given position
|
|
13643
13944
|
/// (with parent links going through all parent structure, including
|
|
13644
13945
|
/// the host trees).
|
|
13645
|
-
resolveInner(pos
|
|
13946
|
+
resolveInner(pos) {
|
|
13947
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
13646
13948
|
let node = resolveNode(CachedInnerNode.get(this) || this.topNode, pos, side, true);
|
|
13647
13949
|
CachedInnerNode.set(this, node);
|
|
13648
13950
|
return node;
|
|
@@ -13689,7 +13991,8 @@ class Tree {
|
|
|
13689
13991
|
/// Balance the direct children of this tree, producing a copy of
|
|
13690
13992
|
/// which may have children grouped into subtrees with type
|
|
13691
13993
|
/// [`NodeType.none`](#common.NodeType^none).
|
|
13692
|
-
balance(
|
|
13994
|
+
balance() {
|
|
13995
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13693
13996
|
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
13997
|
}
|
|
13695
13998
|
/// Build a tree from a postfix-ordered buffer of node information,
|
|
@@ -13869,7 +14172,8 @@ class TreeNode {
|
|
|
13869
14172
|
get to() {
|
|
13870
14173
|
return this.from + this._tree.length;
|
|
13871
14174
|
}
|
|
13872
|
-
nextChild(i, dir, pos, side
|
|
14175
|
+
nextChild(i, dir, pos, side) {
|
|
14176
|
+
let mode = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
13873
14177
|
for (let parent = this;;) {
|
|
13874
14178
|
for (let {
|
|
13875
14179
|
children,
|
|
@@ -13907,7 +14211,8 @@ class TreeNode {
|
|
|
13907
14211
|
childBefore(pos) {
|
|
13908
14212
|
return this.nextChild(this._tree.children.length - 1, -1, pos, -2 /* Side.Before */);
|
|
13909
14213
|
}
|
|
13910
|
-
enter(pos, side
|
|
14214
|
+
enter(pos, side) {
|
|
14215
|
+
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
13911
14216
|
let mounted;
|
|
13912
14217
|
if (!(mode & IterMode.IgnoreOverlays) && (mounted = this._tree.prop(NodeProp.mounted)) && mounted.overlay) {
|
|
13913
14218
|
let rPos = pos - this.from;
|
|
@@ -13934,7 +14239,8 @@ class TreeNode {
|
|
|
13934
14239
|
get prevSibling() {
|
|
13935
14240
|
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4 /* Side.DontCare */) : null;
|
|
13936
14241
|
}
|
|
13937
|
-
cursor(
|
|
14242
|
+
cursor() {
|
|
14243
|
+
let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
13938
14244
|
return new TreeCursor(this, mode);
|
|
13939
14245
|
}
|
|
13940
14246
|
get tree() {
|
|
@@ -13943,20 +14249,26 @@ class TreeNode {
|
|
|
13943
14249
|
toTree() {
|
|
13944
14250
|
return this._tree;
|
|
13945
14251
|
}
|
|
13946
|
-
resolve(pos
|
|
14252
|
+
resolve(pos) {
|
|
14253
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
13947
14254
|
return resolveNode(this, pos, side, false);
|
|
13948
14255
|
}
|
|
13949
|
-
resolveInner(pos
|
|
14256
|
+
resolveInner(pos) {
|
|
14257
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
13950
14258
|
return resolveNode(this, pos, side, true);
|
|
13951
14259
|
}
|
|
13952
14260
|
enterUnfinishedNodesBefore(pos) {
|
|
13953
14261
|
return enterUnfinishedNodesBefore(this, pos);
|
|
13954
14262
|
}
|
|
13955
|
-
getChild(type
|
|
14263
|
+
getChild(type) {
|
|
14264
|
+
let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
14265
|
+
let after = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
13956
14266
|
let r = getChildren(this, type, before, after);
|
|
13957
14267
|
return r.length ? r[0] : null;
|
|
13958
14268
|
}
|
|
13959
|
-
getChildren(type
|
|
14269
|
+
getChildren(type) {
|
|
14270
|
+
let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
14271
|
+
let after = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
13960
14272
|
return getChildren(this, type, before, after);
|
|
13961
14273
|
}
|
|
13962
14274
|
/// @internal
|
|
@@ -13981,7 +14293,8 @@ function getChildren(node, type, before, after) {
|
|
|
13981
14293
|
if (!cur.nextSibling()) return after == null ? result : [];
|
|
13982
14294
|
}
|
|
13983
14295
|
}
|
|
13984
|
-
function matchNodeContext(node, context
|
|
14296
|
+
function matchNodeContext(node, context) {
|
|
14297
|
+
let i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : context.length - 1;
|
|
13985
14298
|
for (let p = node.parent; i >= 0; p = p.parent) {
|
|
13986
14299
|
if (!p) return false;
|
|
13987
14300
|
if (!p.type.isAnonymous) {
|
|
@@ -14034,7 +14347,8 @@ class BufferNode {
|
|
|
14034
14347
|
childBefore(pos) {
|
|
14035
14348
|
return this.child(-1, pos, -2 /* Side.Before */);
|
|
14036
14349
|
}
|
|
14037
|
-
enter(pos, side
|
|
14350
|
+
enter(pos, side) {
|
|
14351
|
+
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
14038
14352
|
if (mode & IterMode.ExcludeBuffers) return null;
|
|
14039
14353
|
let {
|
|
14040
14354
|
buffer
|
|
@@ -14066,7 +14380,8 @@ class BufferNode {
|
|
|
14066
14380
|
return new BufferNode(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4 /* Side.DontCare */));
|
|
14067
14381
|
}
|
|
14068
14382
|
|
|
14069
|
-
cursor(
|
|
14383
|
+
cursor() {
|
|
14384
|
+
let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
14070
14385
|
return new TreeCursor(this, mode);
|
|
14071
14386
|
}
|
|
14072
14387
|
get tree() {
|
|
@@ -14087,10 +14402,12 @@ class BufferNode {
|
|
|
14087
14402
|
}
|
|
14088
14403
|
return new Tree(this.type, children, positions, this.to - this.from);
|
|
14089
14404
|
}
|
|
14090
|
-
resolve(pos
|
|
14405
|
+
resolve(pos) {
|
|
14406
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
14091
14407
|
return resolveNode(this, pos, side, false);
|
|
14092
14408
|
}
|
|
14093
|
-
resolveInner(pos
|
|
14409
|
+
resolveInner(pos) {
|
|
14410
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
14094
14411
|
return resolveNode(this, pos, side, true);
|
|
14095
14412
|
}
|
|
14096
14413
|
enterUnfinishedNodesBefore(pos) {
|
|
@@ -14100,11 +14417,15 @@ class BufferNode {
|
|
|
14100
14417
|
toString() {
|
|
14101
14418
|
return this.context.buffer.childString(this.index);
|
|
14102
14419
|
}
|
|
14103
|
-
getChild(type
|
|
14420
|
+
getChild(type) {
|
|
14421
|
+
let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
14422
|
+
let after = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
14104
14423
|
let r = getChildren(this, type, before, after);
|
|
14105
14424
|
return r.length ? r[0] : null;
|
|
14106
14425
|
}
|
|
14107
|
-
getChildren(type
|
|
14426
|
+
getChildren(type) {
|
|
14427
|
+
let before = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
14428
|
+
let after = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
14108
14429
|
return getChildren(this, type, before, after);
|
|
14109
14430
|
}
|
|
14110
14431
|
get node() {
|
|
@@ -14122,9 +14443,8 @@ class TreeCursor {
|
|
|
14122
14443
|
return this.type.name;
|
|
14123
14444
|
}
|
|
14124
14445
|
/// @internal
|
|
14125
|
-
constructor(node
|
|
14126
|
-
|
|
14127
|
-
mode = 0) {
|
|
14446
|
+
constructor(node) {
|
|
14447
|
+
let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
14128
14448
|
this.mode = mode;
|
|
14129
14449
|
/// @internal
|
|
14130
14450
|
this.buffer = null;
|
|
@@ -14207,7 +14527,8 @@ class TreeCursor {
|
|
|
14207
14527
|
/// will also enter [overlaid](#common.MountedTree.overlay)
|
|
14208
14528
|
/// [mounted](#common.NodeProp^mounted) trees unless `overlays` is
|
|
14209
14529
|
/// set to false.
|
|
14210
|
-
enter(pos, side
|
|
14530
|
+
enter(pos, side) {
|
|
14531
|
+
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.mode;
|
|
14211
14532
|
if (!this.buffer) return this.yield(this._tree.enter(pos, side, mode));
|
|
14212
14533
|
return mode & IterMode.ExcludeBuffers ? false : this.enterChild(1, pos, side);
|
|
14213
14534
|
}
|
|
@@ -14288,20 +14609,23 @@ class TreeCursor {
|
|
|
14288
14609
|
/// traversal, going from a node to its first child or, if the
|
|
14289
14610
|
/// current node is empty or `enter` is false, its next sibling or
|
|
14290
14611
|
/// the next sibling of the first parent node that has one.
|
|
14291
|
-
next(
|
|
14612
|
+
next() {
|
|
14613
|
+
let enter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
14292
14614
|
return this.move(1, enter);
|
|
14293
14615
|
}
|
|
14294
14616
|
/// Move to the next node in a last-to-first pre-order traveral. A
|
|
14295
14617
|
/// node is followed by its last child or, if it has none, its
|
|
14296
14618
|
/// previous sibling or the previous sibling of the first parent
|
|
14297
14619
|
/// node that has one.
|
|
14298
|
-
prev(
|
|
14620
|
+
prev() {
|
|
14621
|
+
let enter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
14299
14622
|
return this.move(-1, enter);
|
|
14300
14623
|
}
|
|
14301
14624
|
/// Move the cursor to the innermost node that covers `pos`. If
|
|
14302
14625
|
/// `side` is -1, it will enter nodes that end at `pos`. If it is 1,
|
|
14303
14626
|
/// it will enter nodes that start at `pos`.
|
|
14304
|
-
moveTo(pos
|
|
14627
|
+
moveTo(pos) {
|
|
14628
|
+
let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
14305
14629
|
// Move up to a node that actually holds the position, if possible
|
|
14306
14630
|
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
14631
|
// Then scan down into child nodes as far as possible
|
|
@@ -14493,7 +14817,9 @@ function buildTree(data) {
|
|
|
14493
14817
|
children.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead - to));
|
|
14494
14818
|
positions.push(from - base);
|
|
14495
14819
|
}
|
|
14496
|
-
function makeTree(type, children, positions, length
|
|
14820
|
+
function makeTree(type, children, positions, length) {
|
|
14821
|
+
let lookAhead = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
14822
|
+
let props = arguments.length > 5 ? arguments[5] : undefined;
|
|
14497
14823
|
if (contextHash) {
|
|
14498
14824
|
let pair = [NodeProp.contextHash, contextHash];
|
|
14499
14825
|
props = props ? [pair].concat(props) : [pair];
|
|
@@ -14715,7 +15041,9 @@ class TreeFragment {
|
|
|
14715
15041
|
/// this fragment can be used against. Add this when going from
|
|
14716
15042
|
/// document to tree positions, subtract it to go from tree to
|
|
14717
15043
|
/// document positions.
|
|
14718
|
-
offset
|
|
15044
|
+
offset) {
|
|
15045
|
+
let openStart = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
15046
|
+
let openEnd = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
14719
15047
|
this.from = from;
|
|
14720
15048
|
this.to = to;
|
|
14721
15049
|
this.tree = tree;
|
|
@@ -14740,7 +15068,9 @@ class TreeFragment {
|
|
|
14740
15068
|
/// true, the parse is treated as incomplete, and the resulting
|
|
14741
15069
|
/// fragment has [`openEnd`](#common.TreeFragment.openEnd) set to
|
|
14742
15070
|
/// true.
|
|
14743
|
-
static addTree(tree
|
|
15071
|
+
static addTree(tree) {
|
|
15072
|
+
let fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
15073
|
+
let partial = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
14744
15074
|
let result = [new TreeFragment(0, tree.length, tree, 0, false, partial)];
|
|
14745
15075
|
for (let f of fragments) if (f.to > tree.length) result.push(f);
|
|
14746
15076
|
return result;
|
|
@@ -14748,7 +15078,8 @@ class TreeFragment {
|
|
|
14748
15078
|
/// Apply a set of edits to an array of fragments, removing or
|
|
14749
15079
|
/// splitting fragments as necessary to remove edited ranges, and
|
|
14750
15080
|
/// adjusting offsets for fragments that moved.
|
|
14751
|
-
static applyChanges(fragments, changes
|
|
15081
|
+
static applyChanges(fragments, changes) {
|
|
15082
|
+
let minGap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 128;
|
|
14752
15083
|
if (!changes.length) return fragments;
|
|
14753
15084
|
let result = [];
|
|
14754
15085
|
let fI = 1,
|
|
@@ -15188,45 +15519,59 @@ function enterFragments(mounts, ranges) {
|
|
|
15188
15519
|
}
|
|
15189
15520
|
|
|
15190
15521
|
let nextTagID = 0;
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
|
|
15202
|
-
|
|
15203
|
-
|
|
15204
|
-
|
|
15205
|
-
|
|
15206
|
-
|
|
15207
|
-
|
|
15522
|
+
/**
|
|
15523
|
+
Highlighting tags are markers that denote a highlighting category.
|
|
15524
|
+
They are [associated](#highlight.styleTags) with parts of a syntax
|
|
15525
|
+
tree by a language mode, and then mapped to an actual CSS style by
|
|
15526
|
+
a [highlighter](#highlight.Highlighter).
|
|
15527
|
+
|
|
15528
|
+
Because syntax tree node types and highlight styles have to be
|
|
15529
|
+
able to talk the same language, CodeMirror uses a mostly _closed_
|
|
15530
|
+
[vocabulary](#highlight.tags) of syntax tags (as opposed to
|
|
15531
|
+
traditional open string-based systems, which make it hard for
|
|
15532
|
+
highlighting themes to cover all the tokens produced by the
|
|
15533
|
+
various languages).
|
|
15534
|
+
|
|
15535
|
+
It _is_ possible to [define](#highlight.Tag^define) your own
|
|
15536
|
+
highlighting tags for system-internal use (where you control both
|
|
15537
|
+
the language package and the highlighter), but such tags will not
|
|
15538
|
+
be picked up by regular highlighters (though you can derive them
|
|
15539
|
+
from standard tags to allow highlighters to fall back to those).
|
|
15540
|
+
*/
|
|
15208
15541
|
class Tag {
|
|
15209
|
-
|
|
15542
|
+
/**
|
|
15543
|
+
@internal
|
|
15544
|
+
*/
|
|
15210
15545
|
constructor(
|
|
15211
|
-
|
|
15212
|
-
|
|
15546
|
+
/**
|
|
15547
|
+
The set of this tag and all its parent tags, starting with
|
|
15548
|
+
this one itself and sorted in order of decreasing specificity.
|
|
15549
|
+
*/
|
|
15213
15550
|
set,
|
|
15214
|
-
|
|
15215
|
-
|
|
15551
|
+
/**
|
|
15552
|
+
The base unmodified tag that this one is based on, if it's
|
|
15553
|
+
modified @internal
|
|
15554
|
+
*/
|
|
15216
15555
|
base,
|
|
15217
|
-
|
|
15556
|
+
/**
|
|
15557
|
+
The modifiers applied to this.base @internal
|
|
15558
|
+
*/
|
|
15218
15559
|
modified) {
|
|
15219
15560
|
this.set = set;
|
|
15220
15561
|
this.base = base;
|
|
15221
15562
|
this.modified = modified;
|
|
15222
|
-
|
|
15563
|
+
/**
|
|
15564
|
+
@internal
|
|
15565
|
+
*/
|
|
15223
15566
|
this.id = nextTagID++;
|
|
15224
15567
|
}
|
|
15225
|
-
|
|
15226
|
-
|
|
15227
|
-
|
|
15228
|
-
|
|
15229
|
-
|
|
15568
|
+
/**
|
|
15569
|
+
Define a new tag. If `parent` is given, the tag is treated as a
|
|
15570
|
+
sub-tag of that parent, and
|
|
15571
|
+
[highlighters](#highlight.tagHighlighter) that don't mention
|
|
15572
|
+
this tag will try to fall back to the parent tag (or grandparent
|
|
15573
|
+
tag, etc).
|
|
15574
|
+
*/
|
|
15230
15575
|
static define(parent) {
|
|
15231
15576
|
if (parent === null || parent === void 0 ? void 0 : parent.base) throw new Error("Can not derive from a modified tag");
|
|
15232
15577
|
let tag = new Tag([], null, []);
|
|
@@ -15234,16 +15579,18 @@ class Tag {
|
|
|
15234
15579
|
if (parent) for (let t of parent.set) tag.set.push(t);
|
|
15235
15580
|
return tag;
|
|
15236
15581
|
}
|
|
15237
|
-
|
|
15238
|
-
|
|
15239
|
-
|
|
15240
|
-
|
|
15241
|
-
|
|
15242
|
-
|
|
15243
|
-
|
|
15244
|
-
|
|
15245
|
-
|
|
15246
|
-
|
|
15582
|
+
/**
|
|
15583
|
+
Define a tag _modifier_, which is a function that, given a tag,
|
|
15584
|
+
will return a tag that is a subtag of the original. Applying the
|
|
15585
|
+
same modifier to a twice tag will return the same value (`m1(t1)
|
|
15586
|
+
== m1(t1)`) and applying multiple modifiers will, regardless or
|
|
15587
|
+
order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
|
|
15588
|
+
|
|
15589
|
+
When multiple modifiers are applied to a given base tag, each
|
|
15590
|
+
smaller set of modifiers is registered as a parent, so that for
|
|
15591
|
+
example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
|
|
15592
|
+
`m1(m3(t1)`, and so on.
|
|
15593
|
+
*/
|
|
15247
15594
|
static defineModifier() {
|
|
15248
15595
|
let mod = new Modifier();
|
|
15249
15596
|
return tag => {
|
|
@@ -15282,55 +15629,57 @@ function powerSet(array) {
|
|
|
15282
15629
|
}
|
|
15283
15630
|
return sets.sort((a, b) => b.length - a.length);
|
|
15284
15631
|
}
|
|
15285
|
-
|
|
15286
|
-
|
|
15287
|
-
|
|
15288
|
-
|
|
15289
|
-
|
|
15290
|
-
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
|
|
15308
|
-
|
|
15309
|
-
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
|
|
15313
|
-
|
|
15314
|
-
|
|
15315
|
-
|
|
15316
|
-
|
|
15317
|
-
|
|
15318
|
-
|
|
15319
|
-
|
|
15320
|
-
|
|
15321
|
-
|
|
15322
|
-
|
|
15323
|
-
|
|
15324
|
-
|
|
15325
|
-
|
|
15326
|
-
|
|
15327
|
-
|
|
15328
|
-
|
|
15329
|
-
|
|
15330
|
-
|
|
15331
|
-
|
|
15332
|
-
|
|
15333
|
-
|
|
15632
|
+
/**
|
|
15633
|
+
This function is used to add a set of tags to a language syntax
|
|
15634
|
+
via [`NodeSet.extend`](#common.NodeSet.extend) or
|
|
15635
|
+
[`LRParser.configure`](#lr.LRParser.configure).
|
|
15636
|
+
|
|
15637
|
+
The argument object maps node selectors to [highlighting
|
|
15638
|
+
tags](#highlight.Tag) or arrays of tags.
|
|
15639
|
+
|
|
15640
|
+
Node selectors may hold one or more (space-separated) node paths.
|
|
15641
|
+
Such a path can be a [node name](#common.NodeType.name), or
|
|
15642
|
+
multiple node names (or `*` wildcards) separated by slash
|
|
15643
|
+
characters, as in `"Block/Declaration/VariableName"`. Such a path
|
|
15644
|
+
matches the final node but only if its direct parent nodes are the
|
|
15645
|
+
other nodes mentioned. A `*` in such a path matches any parent,
|
|
15646
|
+
but only a single level—wildcards that match multiple parents
|
|
15647
|
+
aren't supported, both for efficiency reasons and because Lezer
|
|
15648
|
+
trees make it rather hard to reason about what they would match.)
|
|
15649
|
+
|
|
15650
|
+
A path can be ended with `/...` to indicate that the tag assigned
|
|
15651
|
+
to the node should also apply to all child nodes, even if they
|
|
15652
|
+
match their own style (by default, only the innermost style is
|
|
15653
|
+
used).
|
|
15654
|
+
|
|
15655
|
+
When a path ends in `!`, as in `Attribute!`, no further matching
|
|
15656
|
+
happens for the node's child nodes, and the entire node gets the
|
|
15657
|
+
given style.
|
|
15658
|
+
|
|
15659
|
+
In this notation, node names that contain `/`, `!`, `*`, or `...`
|
|
15660
|
+
must be quoted as JSON strings.
|
|
15661
|
+
|
|
15662
|
+
For example:
|
|
15663
|
+
|
|
15664
|
+
```javascript
|
|
15665
|
+
parser.withProps(
|
|
15666
|
+
styleTags({
|
|
15667
|
+
// Style Number and BigNumber nodes
|
|
15668
|
+
"Number BigNumber": tags.number,
|
|
15669
|
+
// Style Escape nodes whose parent is String
|
|
15670
|
+
"String/Escape": tags.escape,
|
|
15671
|
+
// Style anything inside Attributes nodes
|
|
15672
|
+
"Attributes!": tags.meta,
|
|
15673
|
+
// Add a style to all content inside Italic nodes
|
|
15674
|
+
"Italic/...": tags.emphasis,
|
|
15675
|
+
// Style InvalidString nodes as both `string` and `invalid`
|
|
15676
|
+
"InvalidString": [tags.string, tags.invalid],
|
|
15677
|
+
// Style the node named "/" as punctuation
|
|
15678
|
+
'"/"': tags.punctuation
|
|
15679
|
+
})
|
|
15680
|
+
)
|
|
15681
|
+
```
|
|
15682
|
+
*/
|
|
15334
15683
|
function styleTags(spec) {
|
|
15335
15684
|
let byName = Object.create(null);
|
|
15336
15685
|
for (let prop in spec) {
|
|
@@ -15338,11 +15687,11 @@ function styleTags(spec) {
|
|
|
15338
15687
|
if (!Array.isArray(tags)) tags = [tags];
|
|
15339
15688
|
for (let part of prop.split(" ")) if (part) {
|
|
15340
15689
|
let pieces = [],
|
|
15341
|
-
mode = 2 /*
|
|
15690
|
+
mode = 2 /* Normal */,
|
|
15342
15691
|
rest = part;
|
|
15343
15692
|
for (let pos = 0;;) {
|
|
15344
15693
|
if (rest == "..." && pos > 0 && pos + 3 == part.length) {
|
|
15345
|
-
mode = 1 /*
|
|
15694
|
+
mode = 1 /* Inherit */;
|
|
15346
15695
|
break;
|
|
15347
15696
|
}
|
|
15348
15697
|
let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);
|
|
@@ -15352,7 +15701,7 @@ function styleTags(spec) {
|
|
|
15352
15701
|
if (pos == part.length) break;
|
|
15353
15702
|
let next = part[pos++];
|
|
15354
15703
|
if (pos == part.length && next == "!") {
|
|
15355
|
-
mode = 0 /*
|
|
15704
|
+
mode = 0 /* Opaque */;
|
|
15356
15705
|
break;
|
|
15357
15706
|
}
|
|
15358
15707
|
if (next != "/") throw new RangeError("Invalid path: " + part);
|
|
@@ -15376,10 +15725,10 @@ class Rule {
|
|
|
15376
15725
|
this.next = next;
|
|
15377
15726
|
}
|
|
15378
15727
|
get opaque() {
|
|
15379
|
-
return this.mode == 0 /*
|
|
15728
|
+
return this.mode == 0 /* Opaque */;
|
|
15380
15729
|
}
|
|
15381
15730
|
get inherit() {
|
|
15382
|
-
return this.mode == 1 /*
|
|
15731
|
+
return this.mode == 1 /* Inherit */;
|
|
15383
15732
|
}
|
|
15384
15733
|
sort(other) {
|
|
15385
15734
|
if (!other || other.depth < this.depth) {
|
|
@@ -15393,10 +15742,12 @@ class Rule {
|
|
|
15393
15742
|
return this.context ? this.context.length : 0;
|
|
15394
15743
|
}
|
|
15395
15744
|
}
|
|
15396
|
-
Rule.empty = new Rule([], 2 /*
|
|
15397
|
-
|
|
15398
|
-
|
|
15399
|
-
|
|
15745
|
+
Rule.empty = new Rule([], 2 /* Normal */, null);
|
|
15746
|
+
/**
|
|
15747
|
+
Define a [highlighter](#highlight.Highlighter) from an array of
|
|
15748
|
+
tag/class pairs. Classes associated with more specific tags will
|
|
15749
|
+
take precedence.
|
|
15750
|
+
*/
|
|
15400
15751
|
function tagHighlighter(tags, options) {
|
|
15401
15752
|
let map = Object.create(null);
|
|
15402
15753
|
for (let style of tags) {
|
|
@@ -15431,17 +15782,19 @@ function highlightTags(highlighters, tags) {
|
|
|
15431
15782
|
}
|
|
15432
15783
|
return result;
|
|
15433
15784
|
}
|
|
15434
|
-
|
|
15435
|
-
|
|
15785
|
+
/**
|
|
15786
|
+
Highlight the given [tree](#common.Tree) with the given
|
|
15787
|
+
[highlighter](#highlight.Highlighter).
|
|
15788
|
+
*/
|
|
15436
15789
|
function highlightTree(tree, highlighter,
|
|
15437
|
-
|
|
15438
|
-
|
|
15439
|
-
|
|
15440
|
-
|
|
15441
|
-
|
|
15442
|
-
|
|
15443
|
-
|
|
15444
|
-
to = tree.length
|
|
15790
|
+
/**
|
|
15791
|
+
Assign styling to a region of the text. Will be called, in order
|
|
15792
|
+
of position, for any ranges where more than zero classes apply.
|
|
15793
|
+
`classes` is a space separated string of CSS classes.
|
|
15794
|
+
*/
|
|
15795
|
+
putStyle) {
|
|
15796
|
+
let from = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
15797
|
+
let to = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : tree.length;
|
|
15445
15798
|
let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
|
|
15446
15799
|
builder.highlightRange(tree.cursor(), from, to, "", builder.highlighters);
|
|
15447
15800
|
builder.flush(to);
|
|
@@ -15477,7 +15830,7 @@ class HighlightBuilder {
|
|
|
15477
15830
|
if (tagCls) {
|
|
15478
15831
|
if (cls) cls += " ";
|
|
15479
15832
|
cls += tagCls;
|
|
15480
|
-
if (rule.mode == 1 /*
|
|
15833
|
+
if (rule.mode == 1 /* Inherit */) inheritedClass += (inheritedClass ? " " : "") + tagCls;
|
|
15481
15834
|
}
|
|
15482
15835
|
this.startSpan(cursor.from, cls);
|
|
15483
15836
|
if (rule.opaque) return;
|
|
@@ -15517,9 +15870,11 @@ class HighlightBuilder {
|
|
|
15517
15870
|
}
|
|
15518
15871
|
}
|
|
15519
15872
|
}
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15873
|
+
/**
|
|
15874
|
+
Match a syntax node's [highlight rules](#highlight.styleTags). If
|
|
15875
|
+
there's a match, return its set of tags, and whether it is
|
|
15876
|
+
opaque (uses a `!`) or applies to all child nodes (`/...`).
|
|
15877
|
+
*/
|
|
15523
15878
|
function getStyleTags(node) {
|
|
15524
15879
|
let rule = node.type.prop(ruleNodeProp);
|
|
15525
15880
|
while (rule && rule.context && !node.matchContext(rule.context)) rule = rule.next;
|
|
@@ -15540,268 +15895,440 @@ const comment = t(),
|
|
|
15540
15895
|
punctuation = t(),
|
|
15541
15896
|
bracket = t(punctuation),
|
|
15542
15897
|
meta = t();
|
|
15543
|
-
|
|
15544
|
-
|
|
15545
|
-
|
|
15546
|
-
|
|
15547
|
-
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15898
|
+
/**
|
|
15899
|
+
The default set of highlighting [tags](#highlight.Tag).
|
|
15900
|
+
|
|
15901
|
+
This collection is heavily biased towards programming languages,
|
|
15902
|
+
and necessarily incomplete. A full ontology of syntactic
|
|
15903
|
+
constructs would fill a stack of books, and be impractical to
|
|
15904
|
+
write themes for. So try to make do with this set. If all else
|
|
15905
|
+
fails, [open an
|
|
15906
|
+
issue](https://github.com/codemirror/codemirror.next) to propose a
|
|
15907
|
+
new tag, or [define](#highlight.Tag^define) a local custom tag for
|
|
15908
|
+
your use case.
|
|
15909
|
+
|
|
15910
|
+
Note that it is not obligatory to always attach the most specific
|
|
15911
|
+
tag possible to an element—if your grammar can't easily
|
|
15912
|
+
distinguish a certain type of element (such as a local variable),
|
|
15913
|
+
it is okay to style it as its more general variant (a variable).
|
|
15914
|
+
|
|
15915
|
+
For tags that extend some parent tag, the documentation links to
|
|
15916
|
+
the parent.
|
|
15917
|
+
*/
|
|
15561
15918
|
const tags = {
|
|
15562
|
-
|
|
15919
|
+
/**
|
|
15920
|
+
A comment.
|
|
15921
|
+
*/
|
|
15563
15922
|
comment,
|
|
15564
|
-
|
|
15923
|
+
/**
|
|
15924
|
+
A line [comment](#highlight.tags.comment).
|
|
15925
|
+
*/
|
|
15565
15926
|
lineComment: t(comment),
|
|
15566
|
-
|
|
15927
|
+
/**
|
|
15928
|
+
A block [comment](#highlight.tags.comment).
|
|
15929
|
+
*/
|
|
15567
15930
|
blockComment: t(comment),
|
|
15568
|
-
|
|
15931
|
+
/**
|
|
15932
|
+
A documentation [comment](#highlight.tags.comment).
|
|
15933
|
+
*/
|
|
15569
15934
|
docComment: t(comment),
|
|
15570
|
-
|
|
15935
|
+
/**
|
|
15936
|
+
Any kind of identifier.
|
|
15937
|
+
*/
|
|
15571
15938
|
name,
|
|
15572
|
-
|
|
15939
|
+
/**
|
|
15940
|
+
The [name](#highlight.tags.name) of a variable.
|
|
15941
|
+
*/
|
|
15573
15942
|
variableName: t(name),
|
|
15574
|
-
|
|
15943
|
+
/**
|
|
15944
|
+
A type [name](#highlight.tags.name).
|
|
15945
|
+
*/
|
|
15575
15946
|
typeName: typeName,
|
|
15576
|
-
|
|
15947
|
+
/**
|
|
15948
|
+
A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
|
|
15949
|
+
*/
|
|
15577
15950
|
tagName: t(typeName),
|
|
15578
|
-
|
|
15951
|
+
/**
|
|
15952
|
+
A property or field [name](#highlight.tags.name).
|
|
15953
|
+
*/
|
|
15579
15954
|
propertyName: propertyName,
|
|
15580
|
-
|
|
15955
|
+
/**
|
|
15956
|
+
An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
|
|
15957
|
+
*/
|
|
15581
15958
|
attributeName: t(propertyName),
|
|
15582
|
-
|
|
15959
|
+
/**
|
|
15960
|
+
The [name](#highlight.tags.name) of a class.
|
|
15961
|
+
*/
|
|
15583
15962
|
className: t(name),
|
|
15584
|
-
|
|
15963
|
+
/**
|
|
15964
|
+
A label [name](#highlight.tags.name).
|
|
15965
|
+
*/
|
|
15585
15966
|
labelName: t(name),
|
|
15586
|
-
|
|
15967
|
+
/**
|
|
15968
|
+
A namespace [name](#highlight.tags.name).
|
|
15969
|
+
*/
|
|
15587
15970
|
namespace: t(name),
|
|
15588
|
-
|
|
15971
|
+
/**
|
|
15972
|
+
The [name](#highlight.tags.name) of a macro.
|
|
15973
|
+
*/
|
|
15589
15974
|
macroName: t(name),
|
|
15590
|
-
|
|
15975
|
+
/**
|
|
15976
|
+
A literal value.
|
|
15977
|
+
*/
|
|
15591
15978
|
literal,
|
|
15592
|
-
|
|
15979
|
+
/**
|
|
15980
|
+
A string [literal](#highlight.tags.literal).
|
|
15981
|
+
*/
|
|
15593
15982
|
string,
|
|
15594
|
-
|
|
15983
|
+
/**
|
|
15984
|
+
A documentation [string](#highlight.tags.string).
|
|
15985
|
+
*/
|
|
15595
15986
|
docString: t(string),
|
|
15596
|
-
|
|
15987
|
+
/**
|
|
15988
|
+
A character literal (subtag of [string](#highlight.tags.string)).
|
|
15989
|
+
*/
|
|
15597
15990
|
character: t(string),
|
|
15598
|
-
|
|
15991
|
+
/**
|
|
15992
|
+
An attribute value (subtag of [string](#highlight.tags.string)).
|
|
15993
|
+
*/
|
|
15599
15994
|
attributeValue: t(string),
|
|
15600
|
-
|
|
15995
|
+
/**
|
|
15996
|
+
A number [literal](#highlight.tags.literal).
|
|
15997
|
+
*/
|
|
15601
15998
|
number,
|
|
15602
|
-
|
|
15999
|
+
/**
|
|
16000
|
+
An integer [number](#highlight.tags.number) literal.
|
|
16001
|
+
*/
|
|
15603
16002
|
integer: t(number),
|
|
15604
|
-
|
|
16003
|
+
/**
|
|
16004
|
+
A floating-point [number](#highlight.tags.number) literal.
|
|
16005
|
+
*/
|
|
15605
16006
|
float: t(number),
|
|
15606
|
-
|
|
16007
|
+
/**
|
|
16008
|
+
A boolean [literal](#highlight.tags.literal).
|
|
16009
|
+
*/
|
|
15607
16010
|
bool: t(literal),
|
|
15608
|
-
|
|
16011
|
+
/**
|
|
16012
|
+
Regular expression [literal](#highlight.tags.literal).
|
|
16013
|
+
*/
|
|
15609
16014
|
regexp: t(literal),
|
|
15610
|
-
|
|
15611
|
-
|
|
16015
|
+
/**
|
|
16016
|
+
An escape [literal](#highlight.tags.literal), for example a
|
|
16017
|
+
backslash escape in a string.
|
|
16018
|
+
*/
|
|
15612
16019
|
escape: t(literal),
|
|
15613
|
-
|
|
16020
|
+
/**
|
|
16021
|
+
A color [literal](#highlight.tags.literal).
|
|
16022
|
+
*/
|
|
15614
16023
|
color: t(literal),
|
|
15615
|
-
|
|
16024
|
+
/**
|
|
16025
|
+
A URL [literal](#highlight.tags.literal).
|
|
16026
|
+
*/
|
|
15616
16027
|
url: t(literal),
|
|
15617
|
-
|
|
16028
|
+
/**
|
|
16029
|
+
A language keyword.
|
|
16030
|
+
*/
|
|
15618
16031
|
keyword,
|
|
15619
|
-
|
|
15620
|
-
|
|
16032
|
+
/**
|
|
16033
|
+
The [keyword](#highlight.tags.keyword) for the self or this
|
|
16034
|
+
object.
|
|
16035
|
+
*/
|
|
15621
16036
|
self: t(keyword),
|
|
15622
|
-
|
|
16037
|
+
/**
|
|
16038
|
+
The [keyword](#highlight.tags.keyword) for null.
|
|
16039
|
+
*/
|
|
15623
16040
|
null: t(keyword),
|
|
15624
|
-
|
|
16041
|
+
/**
|
|
16042
|
+
A [keyword](#highlight.tags.keyword) denoting some atomic value.
|
|
16043
|
+
*/
|
|
15625
16044
|
atom: t(keyword),
|
|
15626
|
-
|
|
16045
|
+
/**
|
|
16046
|
+
A [keyword](#highlight.tags.keyword) that represents a unit.
|
|
16047
|
+
*/
|
|
15627
16048
|
unit: t(keyword),
|
|
15628
|
-
|
|
16049
|
+
/**
|
|
16050
|
+
A modifier [keyword](#highlight.tags.keyword).
|
|
16051
|
+
*/
|
|
15629
16052
|
modifier: t(keyword),
|
|
15630
|
-
|
|
16053
|
+
/**
|
|
16054
|
+
A [keyword](#highlight.tags.keyword) that acts as an operator.
|
|
16055
|
+
*/
|
|
15631
16056
|
operatorKeyword: t(keyword),
|
|
15632
|
-
|
|
16057
|
+
/**
|
|
16058
|
+
A control-flow related [keyword](#highlight.tags.keyword).
|
|
16059
|
+
*/
|
|
15633
16060
|
controlKeyword: t(keyword),
|
|
15634
|
-
|
|
16061
|
+
/**
|
|
16062
|
+
A [keyword](#highlight.tags.keyword) that defines something.
|
|
16063
|
+
*/
|
|
15635
16064
|
definitionKeyword: t(keyword),
|
|
15636
|
-
|
|
15637
|
-
|
|
16065
|
+
/**
|
|
16066
|
+
A [keyword](#highlight.tags.keyword) related to defining or
|
|
16067
|
+
interfacing with modules.
|
|
16068
|
+
*/
|
|
15638
16069
|
moduleKeyword: t(keyword),
|
|
15639
|
-
|
|
16070
|
+
/**
|
|
16071
|
+
An operator.
|
|
16072
|
+
*/
|
|
15640
16073
|
operator,
|
|
15641
|
-
|
|
16074
|
+
/**
|
|
16075
|
+
An [operator](#highlight.tags.operator) that dereferences something.
|
|
16076
|
+
*/
|
|
15642
16077
|
derefOperator: t(operator),
|
|
15643
|
-
|
|
16078
|
+
/**
|
|
16079
|
+
Arithmetic-related [operator](#highlight.tags.operator).
|
|
16080
|
+
*/
|
|
15644
16081
|
arithmeticOperator: t(operator),
|
|
15645
|
-
|
|
16082
|
+
/**
|
|
16083
|
+
Logical [operator](#highlight.tags.operator).
|
|
16084
|
+
*/
|
|
15646
16085
|
logicOperator: t(operator),
|
|
15647
|
-
|
|
16086
|
+
/**
|
|
16087
|
+
Bit [operator](#highlight.tags.operator).
|
|
16088
|
+
*/
|
|
15648
16089
|
bitwiseOperator: t(operator),
|
|
15649
|
-
|
|
16090
|
+
/**
|
|
16091
|
+
Comparison [operator](#highlight.tags.operator).
|
|
16092
|
+
*/
|
|
15650
16093
|
compareOperator: t(operator),
|
|
15651
|
-
|
|
16094
|
+
/**
|
|
16095
|
+
[Operator](#highlight.tags.operator) that updates its operand.
|
|
16096
|
+
*/
|
|
15652
16097
|
updateOperator: t(operator),
|
|
15653
|
-
|
|
16098
|
+
/**
|
|
16099
|
+
[Operator](#highlight.tags.operator) that defines something.
|
|
16100
|
+
*/
|
|
15654
16101
|
definitionOperator: t(operator),
|
|
15655
|
-
|
|
16102
|
+
/**
|
|
16103
|
+
Type-related [operator](#highlight.tags.operator).
|
|
16104
|
+
*/
|
|
15656
16105
|
typeOperator: t(operator),
|
|
15657
|
-
|
|
16106
|
+
/**
|
|
16107
|
+
Control-flow [operator](#highlight.tags.operator).
|
|
16108
|
+
*/
|
|
15658
16109
|
controlOperator: t(operator),
|
|
15659
|
-
|
|
16110
|
+
/**
|
|
16111
|
+
Program or markup punctuation.
|
|
16112
|
+
*/
|
|
15660
16113
|
punctuation,
|
|
15661
|
-
|
|
15662
|
-
|
|
16114
|
+
/**
|
|
16115
|
+
[Punctuation](#highlight.tags.punctuation) that separates
|
|
16116
|
+
things.
|
|
16117
|
+
*/
|
|
15663
16118
|
separator: t(punctuation),
|
|
15664
|
-
|
|
16119
|
+
/**
|
|
16120
|
+
Bracket-style [punctuation](#highlight.tags.punctuation).
|
|
16121
|
+
*/
|
|
15665
16122
|
bracket,
|
|
15666
|
-
|
|
15667
|
-
|
|
16123
|
+
/**
|
|
16124
|
+
Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
|
|
16125
|
+
tokens).
|
|
16126
|
+
*/
|
|
15668
16127
|
angleBracket: t(bracket),
|
|
15669
|
-
|
|
15670
|
-
|
|
16128
|
+
/**
|
|
16129
|
+
Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
|
|
16130
|
+
tokens).
|
|
16131
|
+
*/
|
|
15671
16132
|
squareBracket: t(bracket),
|
|
15672
|
-
|
|
15673
|
-
|
|
16133
|
+
/**
|
|
16134
|
+
Parentheses (usually `(` and `)` tokens). Subtag of
|
|
16135
|
+
[bracket](#highlight.tags.bracket).
|
|
16136
|
+
*/
|
|
15674
16137
|
paren: t(bracket),
|
|
15675
|
-
|
|
15676
|
-
|
|
16138
|
+
/**
|
|
16139
|
+
Braces (usually `{` and `}` tokens). Subtag of
|
|
16140
|
+
[bracket](#highlight.tags.bracket).
|
|
16141
|
+
*/
|
|
15677
16142
|
brace: t(bracket),
|
|
15678
|
-
|
|
16143
|
+
/**
|
|
16144
|
+
Content, for example plain text in XML or markup documents.
|
|
16145
|
+
*/
|
|
15679
16146
|
content,
|
|
15680
|
-
|
|
16147
|
+
/**
|
|
16148
|
+
[Content](#highlight.tags.content) that represents a heading.
|
|
16149
|
+
*/
|
|
15681
16150
|
heading,
|
|
15682
|
-
|
|
16151
|
+
/**
|
|
16152
|
+
A level 1 [heading](#highlight.tags.heading).
|
|
16153
|
+
*/
|
|
15683
16154
|
heading1: t(heading),
|
|
15684
|
-
|
|
16155
|
+
/**
|
|
16156
|
+
A level 2 [heading](#highlight.tags.heading).
|
|
16157
|
+
*/
|
|
15685
16158
|
heading2: t(heading),
|
|
15686
|
-
|
|
16159
|
+
/**
|
|
16160
|
+
A level 3 [heading](#highlight.tags.heading).
|
|
16161
|
+
*/
|
|
15687
16162
|
heading3: t(heading),
|
|
15688
|
-
|
|
16163
|
+
/**
|
|
16164
|
+
A level 4 [heading](#highlight.tags.heading).
|
|
16165
|
+
*/
|
|
15689
16166
|
heading4: t(heading),
|
|
15690
|
-
|
|
16167
|
+
/**
|
|
16168
|
+
A level 5 [heading](#highlight.tags.heading).
|
|
16169
|
+
*/
|
|
15691
16170
|
heading5: t(heading),
|
|
15692
|
-
|
|
16171
|
+
/**
|
|
16172
|
+
A level 6 [heading](#highlight.tags.heading).
|
|
16173
|
+
*/
|
|
15693
16174
|
heading6: t(heading),
|
|
15694
|
-
|
|
16175
|
+
/**
|
|
16176
|
+
A prose separator (such as a horizontal rule).
|
|
16177
|
+
*/
|
|
15695
16178
|
contentSeparator: t(content),
|
|
15696
|
-
|
|
16179
|
+
/**
|
|
16180
|
+
[Content](#highlight.tags.content) that represents a list.
|
|
16181
|
+
*/
|
|
15697
16182
|
list: t(content),
|
|
15698
|
-
|
|
16183
|
+
/**
|
|
16184
|
+
[Content](#highlight.tags.content) that represents a quote.
|
|
16185
|
+
*/
|
|
15699
16186
|
quote: t(content),
|
|
15700
|
-
|
|
16187
|
+
/**
|
|
16188
|
+
[Content](#highlight.tags.content) that is emphasized.
|
|
16189
|
+
*/
|
|
15701
16190
|
emphasis: t(content),
|
|
15702
|
-
|
|
16191
|
+
/**
|
|
16192
|
+
[Content](#highlight.tags.content) that is styled strong.
|
|
16193
|
+
*/
|
|
15703
16194
|
strong: t(content),
|
|
15704
|
-
|
|
16195
|
+
/**
|
|
16196
|
+
[Content](#highlight.tags.content) that is part of a link.
|
|
16197
|
+
*/
|
|
15705
16198
|
link: t(content),
|
|
15706
|
-
|
|
15707
|
-
|
|
16199
|
+
/**
|
|
16200
|
+
[Content](#highlight.tags.content) that is styled as code or
|
|
16201
|
+
monospace.
|
|
16202
|
+
*/
|
|
15708
16203
|
monospace: t(content),
|
|
15709
|
-
|
|
15710
|
-
|
|
16204
|
+
/**
|
|
16205
|
+
[Content](#highlight.tags.content) that has a strike-through
|
|
16206
|
+
style.
|
|
16207
|
+
*/
|
|
15711
16208
|
strikethrough: t(content),
|
|
15712
|
-
|
|
16209
|
+
/**
|
|
16210
|
+
Inserted text in a change-tracking format.
|
|
16211
|
+
*/
|
|
15713
16212
|
inserted: t(),
|
|
15714
|
-
|
|
16213
|
+
/**
|
|
16214
|
+
Deleted text.
|
|
16215
|
+
*/
|
|
15715
16216
|
deleted: t(),
|
|
15716
|
-
|
|
16217
|
+
/**
|
|
16218
|
+
Changed text.
|
|
16219
|
+
*/
|
|
15717
16220
|
changed: t(),
|
|
15718
|
-
|
|
16221
|
+
/**
|
|
16222
|
+
An invalid or unsyntactic element.
|
|
16223
|
+
*/
|
|
15719
16224
|
invalid: t(),
|
|
15720
|
-
|
|
16225
|
+
/**
|
|
16226
|
+
Metadata or meta-instruction.
|
|
16227
|
+
*/
|
|
15721
16228
|
meta,
|
|
15722
|
-
|
|
15723
|
-
|
|
16229
|
+
/**
|
|
16230
|
+
[Metadata](#highlight.tags.meta) that applies to the entire
|
|
16231
|
+
document.
|
|
16232
|
+
*/
|
|
15724
16233
|
documentMeta: t(meta),
|
|
15725
|
-
|
|
15726
|
-
|
|
16234
|
+
/**
|
|
16235
|
+
[Metadata](#highlight.tags.meta) that annotates or adds
|
|
16236
|
+
attributes to a given syntactic element.
|
|
16237
|
+
*/
|
|
15727
16238
|
annotation: t(meta),
|
|
15728
|
-
|
|
15729
|
-
|
|
16239
|
+
/**
|
|
16240
|
+
Processing instruction or preprocessor directive. Subtag of
|
|
16241
|
+
[meta](#highlight.tags.meta).
|
|
16242
|
+
*/
|
|
15730
16243
|
processingInstruction: t(meta),
|
|
15731
|
-
|
|
15732
|
-
|
|
15733
|
-
|
|
16244
|
+
/**
|
|
16245
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates that a
|
|
16246
|
+
given element is being defined. Expected to be used with the
|
|
16247
|
+
various [name](#highlight.tags.name) tags.
|
|
16248
|
+
*/
|
|
15734
16249
|
definition: Tag.defineModifier(),
|
|
15735
|
-
|
|
15736
|
-
|
|
15737
|
-
|
|
16250
|
+
/**
|
|
16251
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates that
|
|
16252
|
+
something is constant. Mostly expected to be used with
|
|
16253
|
+
[variable names](#highlight.tags.variableName).
|
|
16254
|
+
*/
|
|
15738
16255
|
constant: Tag.defineModifier(),
|
|
15739
|
-
|
|
15740
|
-
|
|
15741
|
-
|
|
15742
|
-
|
|
16256
|
+
/**
|
|
16257
|
+
[Modifier](#highlight.Tag^defineModifier) used to indicate that
|
|
16258
|
+
a [variable](#highlight.tags.variableName) or [property
|
|
16259
|
+
name](#highlight.tags.propertyName) is being called or defined
|
|
16260
|
+
as a function.
|
|
16261
|
+
*/
|
|
15743
16262
|
function: Tag.defineModifier(),
|
|
15744
|
-
|
|
15745
|
-
|
|
15746
|
-
|
|
16263
|
+
/**
|
|
16264
|
+
[Modifier](#highlight.Tag^defineModifier) that can be applied to
|
|
16265
|
+
[names](#highlight.tags.name) to indicate that they belong to
|
|
16266
|
+
the language's standard environment.
|
|
16267
|
+
*/
|
|
15747
16268
|
standard: Tag.defineModifier(),
|
|
15748
|
-
|
|
15749
|
-
|
|
16269
|
+
/**
|
|
16270
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates a given
|
|
16271
|
+
[names](#highlight.tags.name) is local to some scope.
|
|
16272
|
+
*/
|
|
15750
16273
|
local: Tag.defineModifier(),
|
|
15751
|
-
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
|
|
15755
|
-
|
|
15756
|
-
|
|
16274
|
+
/**
|
|
16275
|
+
A generic variant [modifier](#highlight.Tag^defineModifier) that
|
|
16276
|
+
can be used to tag language-specific alternative variants of
|
|
16277
|
+
some common tag. It is recommended for themes to define special
|
|
16278
|
+
forms of at least the [string](#highlight.tags.string) and
|
|
16279
|
+
[variable name](#highlight.tags.variableName) tags, since those
|
|
16280
|
+
come up a lot.
|
|
16281
|
+
*/
|
|
15757
16282
|
special: Tag.defineModifier()
|
|
15758
16283
|
};
|
|
15759
|
-
|
|
15760
|
-
|
|
15761
|
-
|
|
15762
|
-
|
|
15763
|
-
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
|
|
15768
|
-
|
|
15769
|
-
|
|
15770
|
-
|
|
15771
|
-
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
|
|
15775
|
-
|
|
15776
|
-
|
|
15777
|
-
|
|
15778
|
-
|
|
15779
|
-
|
|
15780
|
-
|
|
15781
|
-
|
|
15782
|
-
|
|
15783
|
-
|
|
15784
|
-
|
|
15785
|
-
|
|
15786
|
-
|
|
15787
|
-
|
|
15788
|
-
|
|
15789
|
-
|
|
15790
|
-
|
|
15791
|
-
|
|
15792
|
-
|
|
15793
|
-
|
|
15794
|
-
|
|
15795
|
-
|
|
15796
|
-
|
|
15797
|
-
|
|
15798
|
-
|
|
15799
|
-
|
|
15800
|
-
|
|
15801
|
-
|
|
15802
|
-
|
|
15803
|
-
|
|
15804
|
-
|
|
16284
|
+
/**
|
|
16285
|
+
This is a highlighter that adds stable, predictable classes to
|
|
16286
|
+
tokens, for styling with external CSS.
|
|
16287
|
+
|
|
16288
|
+
The following tags are mapped to their name prefixed with `"tok-"`
|
|
16289
|
+
(for example `"tok-comment"`):
|
|
16290
|
+
|
|
16291
|
+
* [`link`](#highlight.tags.link)
|
|
16292
|
+
* [`heading`](#highlight.tags.heading)
|
|
16293
|
+
* [`emphasis`](#highlight.tags.emphasis)
|
|
16294
|
+
* [`strong`](#highlight.tags.strong)
|
|
16295
|
+
* [`keyword`](#highlight.tags.keyword)
|
|
16296
|
+
* [`atom`](#highlight.tags.atom)
|
|
16297
|
+
* [`bool`](#highlight.tags.bool)
|
|
16298
|
+
* [`url`](#highlight.tags.url)
|
|
16299
|
+
* [`labelName`](#highlight.tags.labelName)
|
|
16300
|
+
* [`inserted`](#highlight.tags.inserted)
|
|
16301
|
+
* [`deleted`](#highlight.tags.deleted)
|
|
16302
|
+
* [`literal`](#highlight.tags.literal)
|
|
16303
|
+
* [`string`](#highlight.tags.string)
|
|
16304
|
+
* [`number`](#highlight.tags.number)
|
|
16305
|
+
* [`variableName`](#highlight.tags.variableName)
|
|
16306
|
+
* [`typeName`](#highlight.tags.typeName)
|
|
16307
|
+
* [`namespace`](#highlight.tags.namespace)
|
|
16308
|
+
* [`className`](#highlight.tags.className)
|
|
16309
|
+
* [`macroName`](#highlight.tags.macroName)
|
|
16310
|
+
* [`propertyName`](#highlight.tags.propertyName)
|
|
16311
|
+
* [`operator`](#highlight.tags.operator)
|
|
16312
|
+
* [`comment`](#highlight.tags.comment)
|
|
16313
|
+
* [`meta`](#highlight.tags.meta)
|
|
16314
|
+
* [`punctuation`](#highlight.tags.punctuation)
|
|
16315
|
+
* [`invalid`](#highlight.tags.invalid)
|
|
16316
|
+
|
|
16317
|
+
In addition, these mappings are provided:
|
|
16318
|
+
|
|
16319
|
+
* [`regexp`](#highlight.tags.regexp),
|
|
16320
|
+
[`escape`](#highlight.tags.escape), and
|
|
16321
|
+
[`special`](#highlight.tags.special)[`(string)`](#highlight.tags.string)
|
|
16322
|
+
are mapped to `"tok-string2"`
|
|
16323
|
+
* [`special`](#highlight.tags.special)[`(variableName)`](#highlight.tags.variableName)
|
|
16324
|
+
to `"tok-variableName2"`
|
|
16325
|
+
* [`local`](#highlight.tags.local)[`(variableName)`](#highlight.tags.variableName)
|
|
16326
|
+
to `"tok-variableName tok-local"`
|
|
16327
|
+
* [`definition`](#highlight.tags.definition)[`(variableName)`](#highlight.tags.variableName)
|
|
16328
|
+
to `"tok-variableName tok-definition"`
|
|
16329
|
+
* [`definition`](#highlight.tags.definition)[`(propertyName)`](#highlight.tags.propertyName)
|
|
16330
|
+
to `"tok-propertyName tok-definition"`
|
|
16331
|
+
*/
|
|
15805
16332
|
tagHighlighter([{
|
|
15806
16333
|
tag: tags.link,
|
|
15807
16334
|
class: "tok-link"
|
|
@@ -15914,6 +16441,11 @@ function defineLanguageFacet(baseData) {
|
|
|
15914
16441
|
});
|
|
15915
16442
|
}
|
|
15916
16443
|
/**
|
|
16444
|
+
Syntax node prop used to register sublangauges. Should be added to
|
|
16445
|
+
the top level node type for the language.
|
|
16446
|
+
*/
|
|
16447
|
+
const sublanguageProp = /*@__PURE__*/new NodeProp();
|
|
16448
|
+
/**
|
|
15917
16449
|
A language object manages parsing and per-language
|
|
15918
16450
|
[metadata](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt). Parse data is
|
|
15919
16451
|
managed as a [Lezer](https://lezer.codemirror.net) tree. The class
|
|
@@ -15935,11 +16467,9 @@ class Language {
|
|
|
15935
16467
|
The [language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) facet
|
|
15936
16468
|
used for this language.
|
|
15937
16469
|
*/
|
|
15938
|
-
data, parser
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
*/
|
|
15942
|
-
name = "") {
|
|
16470
|
+
data, parser) {
|
|
16471
|
+
let extraExtensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
16472
|
+
let name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
|
|
15943
16473
|
this.data = data;
|
|
15944
16474
|
this.name = name;
|
|
15945
16475
|
// Kludge to define EditorState.tree as a debugging helper,
|
|
@@ -15951,13 +16481,28 @@ class Language {
|
|
|
15951
16481
|
}
|
|
15952
16482
|
});
|
|
15953
16483
|
this.parser = parser;
|
|
15954
|
-
this.extension = [language.of(this), EditorState.languageData.of((state, pos, side) =>
|
|
16484
|
+
this.extension = [language.of(this), EditorState.languageData.of((state, pos, side) => {
|
|
16485
|
+
let top = topNodeAt(state, pos, side),
|
|
16486
|
+
data = top.type.prop(languageDataProp);
|
|
16487
|
+
if (!data) return [];
|
|
16488
|
+
let base = state.facet(data),
|
|
16489
|
+
sub = top.type.prop(sublanguageProp);
|
|
16490
|
+
if (sub) {
|
|
16491
|
+
let innerNode = top.resolve(pos - top.from, side);
|
|
16492
|
+
for (let sublang of sub) if (sublang.test(innerNode, state)) {
|
|
16493
|
+
let data = state.facet(sublang.facet);
|
|
16494
|
+
return sublang.type == "replace" ? data : data.concat(base);
|
|
16495
|
+
}
|
|
16496
|
+
}
|
|
16497
|
+
return base;
|
|
16498
|
+
})].concat(extraExtensions);
|
|
15955
16499
|
}
|
|
15956
16500
|
/**
|
|
15957
16501
|
Query whether this language is active at the given position.
|
|
15958
16502
|
*/
|
|
15959
|
-
isActiveAt(state, pos
|
|
15960
|
-
|
|
16503
|
+
isActiveAt(state, pos) {
|
|
16504
|
+
let side = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
16505
|
+
return topNodeAt(state, pos, side).type.prop(languageDataProp) == this.data;
|
|
15961
16506
|
}
|
|
15962
16507
|
/**
|
|
15963
16508
|
Find the document regions that were parsed using this language.
|
|
@@ -16017,14 +16562,13 @@ class Language {
|
|
|
16017
16562
|
@internal
|
|
16018
16563
|
*/
|
|
16019
16564
|
Language.setState = /*@__PURE__*/StateEffect.define();
|
|
16020
|
-
function
|
|
16021
|
-
let topLang = state.facet(language)
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
for (let node = syntaxTree(state).topNode; node; node = node.enter(pos, side, IterMode.ExcludeBuffers)) facet = node.type.prop(languageDataProp) || facet;
|
|
16565
|
+
function topNodeAt(state, pos, side) {
|
|
16566
|
+
let topLang = state.facet(language),
|
|
16567
|
+
tree = syntaxTree(state).topNode;
|
|
16568
|
+
if (!topLang || topLang.allowsNesting) {
|
|
16569
|
+
for (let node = tree; node; node = node.enter(pos, side, IterMode.ExcludeBuffers)) if (node.type.isTop) tree = node;
|
|
16026
16570
|
}
|
|
16027
|
-
return
|
|
16571
|
+
return tree;
|
|
16028
16572
|
}
|
|
16029
16573
|
/**
|
|
16030
16574
|
A subclass of [`Language`](https://codemirror.net/6/docs/ref/#language.Language) for use with Lezer
|
|
@@ -16068,13 +16612,15 @@ function syntaxTree(state) {
|
|
|
16068
16612
|
}
|
|
16069
16613
|
// Lezer-style Input object for a Text document.
|
|
16070
16614
|
class DocInput {
|
|
16071
|
-
constructor(doc
|
|
16615
|
+
constructor(doc) {
|
|
16072
16616
|
this.doc = doc;
|
|
16073
|
-
this.length = length;
|
|
16074
16617
|
this.cursorPos = 0;
|
|
16075
16618
|
this.string = "";
|
|
16076
16619
|
this.cursor = doc.iter();
|
|
16077
16620
|
}
|
|
16621
|
+
get length() {
|
|
16622
|
+
return this.doc.length;
|
|
16623
|
+
}
|
|
16078
16624
|
syncTo(pos) {
|
|
16079
16625
|
this.string = this.cursor.next(pos - this.cursorPos).value;
|
|
16080
16626
|
this.cursorPos = pos + this.string.length;
|
|
@@ -16101,38 +16647,40 @@ class ParseContext {
|
|
|
16101
16647
|
/**
|
|
16102
16648
|
The current editor state.
|
|
16103
16649
|
*/
|
|
16104
|
-
state
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
16109
|
-
|
|
16110
|
-
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16121
|
-
|
|
16122
|
-
|
|
16123
|
-
|
|
16124
|
-
|
|
16125
|
-
|
|
16126
|
-
|
|
16127
|
-
|
|
16128
|
-
|
|
16129
|
-
|
|
16130
|
-
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16650
|
+
state) {
|
|
16651
|
+
let fragments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
16652
|
+
let
|
|
16653
|
+
/**
|
|
16654
|
+
@internal
|
|
16655
|
+
*/
|
|
16656
|
+
tree = arguments.length > 3 ? arguments[3] : undefined;
|
|
16657
|
+
let
|
|
16658
|
+
/**
|
|
16659
|
+
@internal
|
|
16660
|
+
*/
|
|
16661
|
+
treeLen = arguments.length > 4 ? arguments[4] : undefined;
|
|
16662
|
+
let
|
|
16663
|
+
/**
|
|
16664
|
+
The current editor viewport (or some overapproximation
|
|
16665
|
+
thereof). Intended to be used for opportunistically avoiding
|
|
16666
|
+
work (in which case
|
|
16667
|
+
[`skipUntilInView`](https://codemirror.net/6/docs/ref/#language.ParseContext.skipUntilInView)
|
|
16668
|
+
should be called to make sure the parser is restarted when the
|
|
16669
|
+
skipped region becomes visible).
|
|
16670
|
+
*/
|
|
16671
|
+
viewport = arguments.length > 5 ? arguments[5] : undefined;
|
|
16672
|
+
let
|
|
16673
|
+
/**
|
|
16674
|
+
@internal
|
|
16675
|
+
*/
|
|
16676
|
+
skipped = arguments.length > 6 ? arguments[6] : undefined;
|
|
16677
|
+
let
|
|
16678
|
+
/**
|
|
16679
|
+
This is where skipping parsers can register a promise that,
|
|
16680
|
+
when resolved, will schedule a new parse. It is cleared when
|
|
16681
|
+
the parse worker picks up the promise. @internal
|
|
16682
|
+
*/
|
|
16683
|
+
scheduleOn = arguments.length > 7 ? arguments[7] : undefined;
|
|
16136
16684
|
this.parser = parser;
|
|
16137
16685
|
this.state = state;
|
|
16138
16686
|
this.fragments = fragments;
|
|
@@ -16517,14 +17065,8 @@ class LanguageSupport {
|
|
|
16517
17065
|
/**
|
|
16518
17066
|
The language object.
|
|
16519
17067
|
*/
|
|
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 = []) {
|
|
17068
|
+
language) {
|
|
17069
|
+
let support = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
16528
17070
|
this.language = language;
|
|
16529
17071
|
this.support = support;
|
|
16530
17072
|
this.extension = [language, support];
|
|
@@ -16554,11 +17096,8 @@ class LanguageDescription {
|
|
|
16554
17096
|
Optional filename pattern that should be associated with this
|
|
16555
17097
|
language.
|
|
16556
17098
|
*/
|
|
16557
|
-
filename, loadFunc
|
|
16558
|
-
|
|
16559
|
-
If the language has been loaded, this will hold its value.
|
|
16560
|
-
*/
|
|
16561
|
-
support = undefined) {
|
|
17099
|
+
filename, loadFunc) {
|
|
17100
|
+
let support = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : undefined;
|
|
16562
17101
|
this.name = name;
|
|
16563
17102
|
this.alias = alias;
|
|
16564
17103
|
this.extensions = extensions;
|
|
@@ -16612,7 +17151,8 @@ class LanguageDescription {
|
|
|
16612
17151
|
or alias occurs in the string (for names shorter than three
|
|
16613
17152
|
characters, only when surrounded by non-word characters).
|
|
16614
17153
|
*/
|
|
16615
|
-
static matchLanguageName(descs, name
|
|
17154
|
+
static matchLanguageName(descs, name) {
|
|
17155
|
+
let fuzzy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
16616
17156
|
name = name.toLowerCase();
|
|
16617
17157
|
for (let d of descs) if (d.alias.some(a => a == name)) return d;
|
|
16618
17158
|
if (fuzzy) for (let d of descs) for (let a of d.alias) {
|
|
@@ -16634,15 +17174,16 @@ service.
|
|
|
16634
17174
|
*/
|
|
16635
17175
|
const indentService = /*@__PURE__*/Facet.define();
|
|
16636
17176
|
/**
|
|
16637
|
-
Facet for overriding the unit by which indentation happens.
|
|
16638
|
-
|
|
16639
|
-
|
|
17177
|
+
Facet for overriding the unit by which indentation happens. Should
|
|
17178
|
+
be a string consisting either entirely of the same whitespace
|
|
17179
|
+
character. When not set, this defaults to 2 spaces.
|
|
16640
17180
|
*/
|
|
16641
17181
|
const indentUnit = /*@__PURE__*/Facet.define({
|
|
16642
17182
|
combine: values => {
|
|
16643
17183
|
if (!values.length) return " ";
|
|
16644
|
-
|
|
16645
|
-
|
|
17184
|
+
let unit = values[0];
|
|
17185
|
+
if (!unit || /\S/.test(unit) || Array.from(unit).some(e => e != unit[0])) throw new Error("Invalid indent unit: " + JSON.stringify(values[0]));
|
|
17186
|
+
return unit;
|
|
16646
17187
|
}
|
|
16647
17188
|
});
|
|
16648
17189
|
/**
|
|
@@ -16663,12 +17204,16 @@ tabs.
|
|
|
16663
17204
|
*/
|
|
16664
17205
|
function indentString(state, cols) {
|
|
16665
17206
|
let result = "",
|
|
16666
|
-
ts = state.tabSize
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
cols
|
|
17207
|
+
ts = state.tabSize,
|
|
17208
|
+
ch = state.facet(indentUnit)[0];
|
|
17209
|
+
if (ch == "\t") {
|
|
17210
|
+
while (cols >= ts) {
|
|
17211
|
+
result += "\t";
|
|
17212
|
+
cols -= ts;
|
|
17213
|
+
}
|
|
17214
|
+
ch = " ";
|
|
16670
17215
|
}
|
|
16671
|
-
for (let i = 0; i < cols; i++) result +=
|
|
17216
|
+
for (let i = 0; i < cols; i++) result += ch;
|
|
16672
17217
|
return result;
|
|
16673
17218
|
}
|
|
16674
17219
|
/**
|
|
@@ -16703,11 +17248,8 @@ class IndentContext {
|
|
|
16703
17248
|
/**
|
|
16704
17249
|
The editor state.
|
|
16705
17250
|
*/
|
|
16706
|
-
state
|
|
16707
|
-
|
|
16708
|
-
@internal
|
|
16709
|
-
*/
|
|
16710
|
-
options = {}) {
|
|
17251
|
+
state) {
|
|
17252
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
16711
17253
|
this.state = state;
|
|
16712
17254
|
this.options = options;
|
|
16713
17255
|
this.unit = getIndentUnit(state);
|
|
@@ -16720,7 +17262,8 @@ class IndentContext {
|
|
|
16720
17262
|
argument determines whether the part of the line line before or
|
|
16721
17263
|
after the break is used.
|
|
16722
17264
|
*/
|
|
16723
|
-
lineAt(pos
|
|
17265
|
+
lineAt(pos) {
|
|
17266
|
+
let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
16724
17267
|
let line = this.state.doc.lineAt(pos);
|
|
16725
17268
|
let {
|
|
16726
17269
|
simulateBreak,
|
|
@@ -16744,7 +17287,8 @@ class IndentContext {
|
|
|
16744
17287
|
Get the text directly after `pos`, either the entire line
|
|
16745
17288
|
or the next 100 characters, whichever is shorter.
|
|
16746
17289
|
*/
|
|
16747
|
-
textAfterPos(pos
|
|
17290
|
+
textAfterPos(pos) {
|
|
17291
|
+
let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
16748
17292
|
if (this.options.simulateDoubleBreak && pos == this.options.simulateBreak) return "";
|
|
16749
17293
|
let {
|
|
16750
17294
|
text,
|
|
@@ -16755,7 +17299,8 @@ class IndentContext {
|
|
|
16755
17299
|
/**
|
|
16756
17300
|
Find the column for the given position.
|
|
16757
17301
|
*/
|
|
16758
|
-
column(pos
|
|
17302
|
+
column(pos) {
|
|
17303
|
+
let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
16759
17304
|
let {
|
|
16760
17305
|
text,
|
|
16761
17306
|
from
|
|
@@ -16769,13 +17314,15 @@ class IndentContext {
|
|
|
16769
17314
|
Find the column position (taking tabs into account) of the given
|
|
16770
17315
|
position in the given string.
|
|
16771
17316
|
*/
|
|
16772
|
-
countColumn(line
|
|
17317
|
+
countColumn(line) {
|
|
17318
|
+
let pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : line.length;
|
|
16773
17319
|
return countColumn(line, this.state.tabSize, pos);
|
|
16774
17320
|
}
|
|
16775
17321
|
/**
|
|
16776
17322
|
Find the indentation column of the line at the given point.
|
|
16777
17323
|
*/
|
|
16778
|
-
lineIndent(pos
|
|
17324
|
+
lineIndent(pos) {
|
|
17325
|
+
let bias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
16779
17326
|
let {
|
|
16780
17327
|
text,
|
|
16781
17328
|
from
|
|
@@ -16926,11 +17473,12 @@ opening node, like this:
|
|
|
16926
17473
|
foo(bar,
|
|
16927
17474
|
baz)
|
|
16928
17475
|
*/
|
|
16929
|
-
function delimitedIndent({
|
|
16930
|
-
|
|
16931
|
-
|
|
16932
|
-
|
|
16933
|
-
|
|
17476
|
+
function delimitedIndent(_ref) {
|
|
17477
|
+
let {
|
|
17478
|
+
closing,
|
|
17479
|
+
align = true,
|
|
17480
|
+
units = 1
|
|
17481
|
+
} = _ref;
|
|
16934
17482
|
return context => delimitedStrategy(context, align, units, closing);
|
|
16935
17483
|
}
|
|
16936
17484
|
function delimitedStrategy(context, align, units, closing, closedAt) {
|
|
@@ -16954,10 +17502,11 @@ match a pattern (for example `/^else\b/` in `if`/`else`
|
|
|
16954
17502
|
constructs), and you can change the amount of units used with the
|
|
16955
17503
|
`units` option.
|
|
16956
17504
|
*/
|
|
16957
|
-
function continuedIndent({
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
|
|
17505
|
+
function continuedIndent() {
|
|
17506
|
+
let {
|
|
17507
|
+
except,
|
|
17508
|
+
units = 1
|
|
17509
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16961
17510
|
return context => {
|
|
16962
17511
|
let matchExcept = except && except.test(context.textAfter);
|
|
16963
17512
|
return context.baseIndent + (matchExcept ? 0 : units * context.unit);
|
|
@@ -17224,7 +17773,8 @@ const unfoldCode = view => {
|
|
|
17224
17773
|
});
|
|
17225
17774
|
return effects.length > 0;
|
|
17226
17775
|
};
|
|
17227
|
-
function announceFold(view, range
|
|
17776
|
+
function announceFold(view, range) {
|
|
17777
|
+
let fold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
17228
17778
|
let lineFrom = view.state.doc.lineAt(range.from).number,
|
|
17229
17779
|
lineTo = view.state.doc.lineAt(range.to).number;
|
|
17230
17780
|
return EditorView.announce.of(`${view.state.phrase(fold ? "Folded lines" : "Unfolded lines")} ${lineFrom} ${view.state.phrase("to")} ${lineTo}.`);
|
|
@@ -17367,7 +17917,8 @@ Create an extension that registers a fold gutter, which shows a
|
|
|
17367
17917
|
fold status indicator before foldable lines (which can be clicked
|
|
17368
17918
|
to fold or unfold the line).
|
|
17369
17919
|
*/
|
|
17370
|
-
function foldGutter(
|
|
17920
|
+
function foldGutter() {
|
|
17921
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17371
17922
|
let fullConfig = Object.assign(Object.assign({}, foldGutterDefaults), config);
|
|
17372
17923
|
let canFold = new FoldMarker(fullConfig, true),
|
|
17373
17924
|
canUnfold = new FoldMarker(fullConfig, false);
|
|
@@ -17672,7 +18223,8 @@ cursor is next to a bracket, that bracket and the one it matches
|
|
|
17672
18223
|
are highlighted. Or, when no matching bracket is found, another
|
|
17673
18224
|
highlighting style is used to indicate this.
|
|
17674
18225
|
*/
|
|
17675
|
-
function bracketMatching(
|
|
18226
|
+
function bracketMatching() {
|
|
18227
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17676
18228
|
return [bracketMatchingConfig.of(config), bracketMatchingUnique];
|
|
17677
18229
|
}
|
|
17678
18230
|
/**
|
|
@@ -17703,7 +18255,8 @@ direction `dir`. Only the `brackets` and `maxScanDistance`
|
|
|
17703
18255
|
properties are used from `config`, if given. Returns null if no
|
|
17704
18256
|
bracket was found at `pos`, or a match result otherwise.
|
|
17705
18257
|
*/
|
|
17706
|
-
function matchBrackets(state, pos, dir
|
|
18258
|
+
function matchBrackets(state, pos, dir) {
|
|
18259
|
+
let config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
17707
18260
|
let maxScanDistance = config.maxScanDistance || DefaultScanDist,
|
|
17708
18261
|
brackets = config.brackets || DefaultBrackets;
|
|
17709
18262
|
let tree = syntaxTree(state),
|