tuikit-atomicx-vue3 4.4.0 → 4.5.1
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/.eslintrc.cjs +6 -2
- package/dist/DurationSelector.vue_vue_type_script_setup_true_lang-RndH6NtJ.js +54 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D9jiYNFu.js → MessageInput.vue_vue_type_script_setup_true_lang-jPzZ5INK.js} +31 -29
- package/dist/{PopoverTrigger-L8abAry7.js → PopoverPortal-DghpKKm8.js} +91 -136
- package/dist/PopoverTrigger-BajjNkGO.js +54 -0
- package/dist/{PopperContent-XdhqL8Y2.js → PopperContent-SLoFuK7k.js} +6 -6
- package/dist/{Teleport-CSEuZbpM.js → Teleport-DFrneqLM.js} +4 -4
- package/dist/TimezoneSelector.vue_vue_type_script_setup_true_lang-C-lovW-l.js +62 -0
- package/dist/baseComp/AudioIcon.js +7 -7
- package/dist/baseComp/Input/InputH5.vue.d.ts +1 -1
- package/dist/baseComp/Input/InputPC.vue.d.ts +1 -1
- package/dist/baseComp/Input/InputWX.vue.d.ts +1 -1
- package/dist/baseComp/Input/index.d.ts +15 -15
- package/dist/baseComp/Modal/Modal.js +3 -3
- package/dist/changeNameCardDialog.vue_vue_type_script_setup_true_lang-a4FmKskP.js +41 -0
- package/dist/components/AudioSetting/AudioMediaControl.js +23 -23
- package/dist/components/AudioSetting/AudioRequestDialog.js +86 -2
- package/dist/components/AudioSetting/AudioSettingTab.js +32 -33
- package/dist/components/AudioSetting/MicrophoneSelect.js +14 -15
- package/dist/components/AudioSetting/SpeakerSelect.js +16 -17
- package/dist/components/AudioSetting/index.js +29 -3
- package/dist/components/AudioSettingPanel/MicrophoneSelect.js +61 -0
- package/dist/components/AudioSettingPanel/MicrophoneSelect.vue.d.ts +29 -0
- package/dist/components/AudioSettingPanel/SpeakerSelect.js +61 -0
- package/dist/components/AudioSettingPanel/SpeakerSelect.vue.d.ts +29 -0
- package/dist/components/AudioSettingPanel/i18n/en-US/index.d.ts +12 -6
- package/dist/components/AudioSettingPanel/i18n/en-US/index.js +12 -6
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.d.ts +12 -6
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.js +12 -6
- package/dist/components/AudioSettingPanel/index.d.ts +49 -2
- package/dist/components/AudioSettingPanel/index.js +127 -94
- package/dist/components/AudioSettingPanel/index.vue.d.ts +49 -1
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +10 -9
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +16 -14
- package/dist/components/BarrageInput/TextEditor/TextEditor.vue.d.ts +1 -1
- package/dist/components/BarrageInput/index.d.ts +6 -6
- package/dist/components/BarrageList/BarrageList.js +7 -7
- package/dist/components/BarrageList/BarrageListH5.js +7 -7
- package/dist/components/BarrageList/BarrageListState.d.ts +5 -27
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.js +4 -4
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue.d.ts +1 -1
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.js +11 -11
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.vue.d.ts +1 -1
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +4 -4
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.vue.d.ts +1 -1
- package/dist/components/CameraButton/index.js +7 -7
- package/dist/components/ChatSetting/GroupChatSetting/GroupChatSetting.js +2 -1
- package/dist/components/ChatSetting/SettingItem/SettingItem.vue.d.ts +2 -2
- package/dist/components/ConversationList/ConversationActions/ConversationActions.js +49 -51
- package/dist/components/ConversationList/ConversationList.vue.d.ts +190 -190
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +82 -82
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +62 -40
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +30 -26
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +27 -23
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue.d.ts +1 -1
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +67 -65
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +16 -16
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +32 -30
- package/dist/components/ConversationList/ConversationPreview/utils.d.ts +2 -2
- package/dist/components/ConversationList/ConversationPreview/utils.js +81 -35
- package/dist/components/ConversationList/ConversationSearch/ConversationSearch.vue.d.ts +36 -36
- package/dist/components/ConversationList/i18n/en-US.d.ts +10 -1
- package/dist/components/ConversationList/i18n/en-US.js +11 -2
- package/dist/components/ConversationList/i18n/zh-CN.d.ts +10 -1
- package/dist/components/ConversationList/i18n/zh-CN.js +11 -2
- package/dist/components/ConversationList/index.d.ts +442 -442
- package/dist/components/FreeBeautyPanel/FreeBeautyPanel.js +257 -0
- package/dist/components/FreeBeautyPanel/FreeBeautyPanel.vue.d.ts +6 -0
- package/dist/components/FreeBeautyPanel/i18n/en-US/index.d.ts +15 -0
- package/dist/components/FreeBeautyPanel/i18n/en-US/index.js +19 -0
- package/dist/components/FreeBeautyPanel/i18n/index.d.ts +4 -0
- package/dist/components/FreeBeautyPanel/i18n/index.js +6 -0
- package/dist/components/FreeBeautyPanel/i18n/zh-CN/index.d.ts +15 -0
- package/dist/components/FreeBeautyPanel/i18n/zh-CN/index.js +19 -0
- package/dist/components/FreeBeautyPanel/index.d.ts +6 -0
- package/dist/components/FreeBeautyPanel/index.js +10 -0
- package/dist/components/LiveMonitorView/LiveMonitorView.js +11 -11
- package/dist/components/LiveScenePanel/index.d.ts +1 -2
- package/dist/components/LiveScenePanel/index.js +48 -46
- package/dist/components/LiveView/DefaultStreamViewUI.js +10 -10
- package/dist/components/LiveView/PlayerControl/AudioControl.js +97 -93
- package/dist/components/LiveView/PlayerControl/AudioControl.vue.d.ts +10 -6
- package/dist/components/LiveView/PlayerControl/MultiResolution.js +58 -64
- package/dist/components/LiveView/PlayerControl/MultiResolution.vue.d.ts +1 -7
- package/dist/components/LiveView/PlayerControl/PlayerControl.js +82 -83
- package/dist/components/LiveView/PlayerControl/PlayerControlState.d.ts +6 -6
- package/dist/components/LiveView/PlayerControl/PlayerControlState.js +153 -194
- package/dist/components/LiveView/index.d.ts +37 -2
- package/dist/components/LiveView/index.js +29 -29
- package/dist/components/MessageInput/AttachmentPicker/index.js +10 -9
- package/dist/components/MessageInput/AudioCallPicker/AudioCallPicker.js +63 -65
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +17 -16
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/MessageInput.vue.d.ts +4 -1
- package/dist/components/MessageInput/QuotedMessagePreview/index.js +35 -35
- package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +14 -12
- package/dist/components/MessageInput/TextEditor/EditorCore.js +59 -108
- package/dist/components/MessageInput/TextEditor/TextEditor.vue.d.ts +5 -1
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.js +229 -0
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue.d.ts +15 -0
- package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.d.ts +19 -0
- package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +74 -0
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.d.ts +1 -0
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.js +22 -0
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.d.ts +3 -0
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.js +15 -0
- package/dist/components/MessageInput/TextEditor/extensions/imageExtension.d.ts +2 -0
- package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +62 -0
- package/dist/components/MessageInput/TextEditor/extensions/index.d.ts +8 -0
- package/dist/components/MessageInput/TextEditor/extensions/index.js +12 -0
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.d.ts +5 -0
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.js +330 -0
- package/dist/components/MessageInput/TextEditor/index.js +64 -55
- package/dist/components/MessageInput/VideoCallPicker/VideoCallPicker.js +67 -69
- package/dist/components/MessageInput/i18n/en-US.d.ts +3 -0
- package/dist/components/MessageInput/i18n/en-US.js +4 -1
- package/dist/components/MessageInput/i18n/index.d.ts +10 -0
- package/dist/components/MessageInput/i18n/zh-CN.d.ts +7 -0
- package/dist/components/MessageInput/i18n/zh-CN.js +8 -1
- package/dist/components/MessageInput/index.d.ts +60 -30
- package/dist/components/MessageInput/index.js +1 -1
- package/dist/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.js +18 -18
- package/dist/components/MessageList/Message/GroupTipMessage/index.js +13 -13
- package/dist/components/MessageList/Message/ImageMessage/ImageMessage.js +119 -89
- package/dist/components/MessageList/Message/ImageMessage/ImagePreview.js +142 -0
- package/dist/components/MessageList/Message/ImageMessage/ImagePreview.vue.d.ts +20 -0
- package/dist/components/MessageList/Message/Message.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.js +74 -69
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/VideoMessage/VideoMessage.js +48 -53
- package/dist/components/MessageList/Message/VideoMessage/VideoMessage.vue.d.ts +8 -8
- package/dist/components/MessageList/Message/index.js +8 -4
- package/dist/components/MessageList/MessageList.js +98 -90
- package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
- package/dist/components/MessageList/i18n/en-US.d.ts +65 -1
- package/dist/components/MessageList/i18n/en-US.js +66 -2
- package/dist/components/MessageList/i18n/index.d.ts +128 -0
- package/dist/components/MessageList/i18n/index.js +6 -6
- package/dist/components/MessageList/i18n/zh-CN.d.ts +65 -1
- package/dist/components/MessageList/i18n/zh-CN.js +64 -0
- package/dist/components/MessageList/index.d.ts +21 -3
- package/dist/components/MicButton/index.js +13 -13
- package/dist/components/RoomParticipantList/ParticipantAction.js +78 -0
- package/dist/components/RoomParticipantList/ParticipantAction.vue.d.ts +17 -0
- package/dist/components/RoomParticipantList/ParticipantItem.js +82 -0
- package/dist/components/RoomParticipantList/ParticipantItem.vue.d.ts +27 -0
- package/dist/components/RoomParticipantList/PendingParticipantItem.js +75 -0
- package/dist/components/RoomParticipantList/PendingParticipantItem.vue.d.ts +16 -0
- package/dist/components/RoomParticipantList/RoomAction.js +89 -0
- package/dist/components/RoomParticipantList/RoomAction.vue.d.ts +2 -0
- package/dist/components/RoomParticipantList/i18n/en-US/index.d.ts +66 -0
- package/dist/components/RoomParticipantList/i18n/en-US/index.js +69 -0
- package/dist/components/RoomParticipantList/i18n/index.d.ts +2 -0
- package/dist/components/RoomParticipantList/i18n/index.js +6 -0
- package/dist/components/RoomParticipantList/i18n/zh-CN/index.d.ts +66 -0
- package/dist/components/RoomParticipantList/i18n/zh-CN/index.js +69 -0
- package/dist/components/RoomParticipantList/index.d.ts +2 -0
- package/dist/components/RoomParticipantList/index.js +171 -0
- package/dist/components/RoomParticipantList/index.vue.d.ts +2 -0
- package/dist/components/RoomParticipantList/useParticpantAction/index.d.ts +15 -0
- package/dist/components/RoomParticipantList/useParticpantAction/index.js +71 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useAdminAction.d.ts +19 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useAdminAction.js +36 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useAudioAction.d.ts +19 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useAudioAction.js +42 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useKickAction.d.ts +11 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useKickAction.js +34 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useMessageAction.d.ts +11 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useMessageAction.js +31 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useNameCardAction/changeNameCardDialog.js +4 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useNameCardAction/changeNameCardDialog.vue.d.ts +17 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useNameCardAction/index.d.ts +11 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useNameCardAction/index.js +61 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useTransferOwnerAction.d.ts +11 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useTransferOwnerAction.js +54 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useVideoAction.d.ts +19 -0
- package/dist/components/RoomParticipantList/useParticpantAction/useVideoAction.js +40 -0
- package/dist/components/RoomParticipantList/useRoomAction/index.d.ts +8 -0
- package/dist/components/RoomParticipantList/useRoomAction/index.js +20 -0
- package/dist/components/RoomParticipantList/useRoomAction/useRoomAudioAction.d.ts +5 -0
- package/dist/components/RoomParticipantList/useRoomAction/useRoomAudioAction.js +51 -0
- package/dist/components/RoomParticipantList/useRoomAction/useRoomScreenAction.d.ts +8 -0
- package/dist/components/RoomParticipantList/useRoomAction/useRoomScreenAction.js +60 -0
- package/dist/components/RoomParticipantList/useRoomAction/useRoomVideoAction.d.ts +5 -0
- package/dist/components/RoomParticipantList/useRoomAction/useRoomVideoAction.js +50 -0
- package/dist/components/RoomParticipantView/StreamPlay.js +74 -0
- package/dist/components/RoomParticipantView/StreamPlay.vue.d.ts +66 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/LazyLoadManager.d.ts +56 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/LazyLoadManager.js +94 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/StreamInfoManager.d.ts +58 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/StreamInfoManager.js +97 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/StreamPlayer.d.ts +46 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/StreamPlayer.js +100 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/VideoQualityManager.d.ts +92 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/VideoQualityManager.js +177 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/index.d.ts +119 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/index.js +298 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/types.d.ts +14 -0
- package/dist/components/RoomParticipantView/StreamPlayManager/types.js +4 -0
- package/dist/components/RoomParticipantView/index.d.ts +99 -0
- package/dist/components/RoomParticipantView/index.js +32 -0
- package/dist/components/RoomParticipantView/index.vue.d.ts +34 -0
- package/dist/components/RoomView/ArrowStroke.js +43 -0
- package/dist/components/RoomView/ArrowStroke.vue.d.ts +20 -0
- package/dist/components/RoomView/GridLayout.js +119 -0
- package/dist/components/RoomView/GridLayout.vue.d.ts +20 -0
- package/dist/components/RoomView/SpeakerLayout.js +141 -0
- package/dist/components/RoomView/SpeakerLayout.vue.d.ts +32 -0
- package/dist/components/RoomView/index.d.ts +52 -0
- package/dist/components/RoomView/index.js +49 -0
- package/dist/components/RoomView/index.vue.d.ts +46 -0
- package/dist/components/RoomView/useRoomToolbar.d.ts +5 -0
- package/dist/components/RoomView/useRoomToolbar.js +36 -0
- package/dist/components/RoomView/useRoomView.d.ts +13 -0
- package/dist/components/RoomView/useRoomView.js +40 -0
- package/dist/components/RoomView/useStreamItemDimensions.d.ts +30 -0
- package/dist/components/RoomView/useStreamItemDimensions.js +57 -0
- package/dist/components/ScheduleRoomPanel/Datepicker.js +162 -0
- package/dist/components/ScheduleRoomPanel/Datepicker.vue.d.ts +18 -0
- package/dist/components/ScheduleRoomPanel/DurationSelector.js +4 -0
- package/dist/components/ScheduleRoomPanel/DurationSelector.vue.d.ts +39 -0
- package/dist/components/ScheduleRoomPanel/RoomDetail.js +113 -0
- package/dist/components/ScheduleRoomPanel/RoomDetail.vue.d.ts +31 -0
- package/dist/components/ScheduleRoomPanel/RoomEdit.js +281 -0
- package/dist/components/ScheduleRoomPanel/RoomEdit.vue.d.ts +23 -0
- package/dist/components/ScheduleRoomPanel/RoomShare.js +110 -0
- package/dist/components/ScheduleRoomPanel/RoomShare.vue.d.ts +16 -0
- package/dist/components/ScheduleRoomPanel/ScheduleRoomPanel.js +385 -0
- package/dist/components/ScheduleRoomPanel/ScheduleRoomPanel.vue.d.ts +40 -0
- package/dist/components/ScheduleRoomPanel/ScheduledRoomList.js +345 -0
- package/dist/components/ScheduleRoomPanel/ScheduledRoomList.vue.d.ts +8 -0
- package/dist/components/ScheduleRoomPanel/Timepicker.js +65 -0
- package/dist/components/ScheduleRoomPanel/Timepicker.vue.d.ts +18 -0
- package/dist/components/ScheduleRoomPanel/TimezoneSelector.js +4 -0
- package/dist/components/ScheduleRoomPanel/TimezoneSelector.vue.d.ts +18 -0
- package/dist/components/ScheduleRoomPanel/i18n/en-US/index.d.ts +108 -0
- package/dist/components/ScheduleRoomPanel/i18n/en-US/index.js +111 -0
- package/dist/components/ScheduleRoomPanel/i18n/index.d.ts +4 -0
- package/dist/components/ScheduleRoomPanel/i18n/index.js +6 -0
- package/dist/components/ScheduleRoomPanel/i18n/zh-CN/index.d.ts +108 -0
- package/dist/components/ScheduleRoomPanel/i18n/zh-CN/index.js +111 -0
- package/dist/components/ScheduleRoomPanel/index.d.ts +34 -0
- package/dist/components/ScheduleRoomPanel/index.js +12 -0
- package/dist/components/ScheduleRoomPanel/type.d.ts +7 -0
- package/dist/components/ScheduleRoomPanel/type.js +1 -0
- package/dist/components/ScheduleRoomPanel/utils.d.ts +46 -0
- package/dist/components/ScheduleRoomPanel/utils.js +123 -0
- package/dist/components/Search/Search.vue.d.ts +12 -12
- package/dist/components/Search/SearchAdvanced/DateRangePicker/DateRangePicker.js +172 -174
- package/dist/components/Search/SearchAdvanced/MessageAdvanced/MessageAdvanced.js +58 -60
- package/dist/components/Search/SearchAdvanced/SearchAdvanced.js +28 -30
- package/dist/components/Search/SearchAdvanced/SearchTab/SearchTab.js +22 -24
- package/dist/components/Search/SearchAdvanced/Slider/Slider.js +26 -28
- package/dist/components/Search/SearchAdvanced/UserAdvanced/UserAdvanced.js +133 -135
- package/dist/components/Search/SearchBar/SearchBar.js +56 -58
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +6 -6
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.vue.d.ts +1 -1
- package/dist/components/Search/index.d.ts +18 -18
- package/dist/components/StreamMixer/LocalMixer/index.js +25 -22
- package/dist/components/StreamMixer/index.d.ts +1 -2
- package/dist/components/StreamMixer/index.js +9 -8
- package/dist/components/StreamView/Layout/CustomLayout.js +53 -53
- package/dist/components/StreamView/Layout/CustomLayout.vue.d.ts +1 -2
- package/dist/components/StreamView/Layout/FloatLayout.vue.d.ts +1 -2
- package/dist/components/StreamView/Layout/GridLayout.js +47 -51
- package/dist/components/StreamView/Layout/GridLayout.vue.d.ts +1 -2
- package/dist/components/StreamView/Layout/MeetingLayout.js +10 -10
- package/dist/components/StreamView/Layout/MeetingLayout.vue.d.ts +1 -1
- package/dist/components/StreamView/common/StreamList/index.vue.d.ts +1 -1
- package/dist/components/StreamView/common/StreamRegion/StreamRegionPC.vue.d.ts +2 -2
- package/dist/components/StreamView/index.d.ts +90 -3
- package/dist/components/StreamView/index.js +4 -4
- package/dist/components/StreamView/index.vue.d.ts +1 -1
- package/dist/components/StreamView/manager/mediaManager.js +9 -9
- package/dist/components/UIKitModal/UIKitModal.d.ts +7 -0
- package/dist/components/UIKitModal/UIKitModal.js +156 -0
- package/dist/components/UIKitModal/index.d.ts +2 -0
- package/dist/components/UIKitModal/index.js +6 -0
- package/dist/components/UIKitModal/index.vue.d.ts +45 -0
- package/dist/components/UIKitModal/type.d.ts +21 -0
- package/dist/components/UIKitModal/type.js +1 -0
- package/dist/components/UIKitModal/useRoomModal/i18n/en-US/index.d.ts +17 -0
- package/dist/components/UIKitModal/useRoomModal/i18n/en-US/index.js +21 -0
- package/dist/components/UIKitModal/useRoomModal/i18n/index.d.ts +4 -0
- package/dist/components/UIKitModal/useRoomModal/i18n/index.js +6 -0
- package/dist/components/UIKitModal/useRoomModal/i18n/zh-CN/index.d.ts +17 -0
- package/dist/components/UIKitModal/useRoomModal/i18n/zh-CN/index.js +21 -0
- package/dist/components/UIKitModal/useRoomModal/index.d.ts +6 -0
- package/dist/components/UIKitModal/useRoomModal/index.js +11 -0
- package/dist/components/UIKitModal/useRoomModal/useRoomModal.d.ts +21 -0
- package/dist/components/UIKitModal/useRoomModal/useRoomModal.js +79 -0
- package/dist/components/UserList/AllUserActions/indexH5.js +21 -21
- package/dist/components/UserList/AllUserActions/useIndexHooks.d.ts +0 -2
- package/dist/components/UserList/AllUserActions/useIndexHooks.js +24 -25
- package/dist/components/UserList/UserItem/UserInfo/index.js +19 -19
- package/dist/components/UserPicker/UserPicker.js +1 -2
- package/dist/components/UserPicker/components/SelectedPanel/SelectedPanel.js +19 -18
- package/dist/components/UserPicker/hooks/useSearchFilter.d.ts +2 -2
- package/dist/components/UserPicker/hooks/useSearchFilter.js +39 -31
- package/dist/components/UserPicker/i18n/en-US.d.ts +1 -0
- package/dist/components/UserPicker/i18n/en-US.js +2 -1
- package/dist/components/UserPicker/i18n/index.d.ts +2 -0
- package/dist/components/UserPicker/i18n/zh-CN.d.ts +1 -0
- package/dist/components/UserPicker/i18n/zh-CN.js +2 -1
- package/dist/components/UserPicker/index.d.ts +2 -2
- package/dist/components/UserPicker/type.d.ts +1 -1
- package/dist/components/VideoSetting/CameraSelect.js +6 -7
- package/dist/components/VideoSetting/VideoMediaControl.js +45 -44
- package/dist/components/VideoSetting/VideoPreview.js +24 -25
- package/dist/components/VideoSetting/VideoProfile.js +22 -23
- package/dist/components/VideoSetting/VideoSettingTab.js +24 -24
- package/dist/components/VideoSetting/index.js +32 -3
- package/dist/components/VideoSettingPanel/CameraSelect.js +28 -25
- package/dist/components/VideoSettingPanel/VideoPreview.js +13 -13
- package/dist/components/VideoSettingPanel/VideoProfile.js +27 -27
- package/dist/components/VideoSettingPanel/i18n/en-US/index.d.ts +13 -10
- package/dist/components/VideoSettingPanel/i18n/en-US/index.js +13 -10
- package/dist/components/VideoSettingPanel/i18n/zh-CN/index.d.ts +13 -10
- package/dist/components/VideoSettingPanel/i18n/zh-CN/index.js +13 -10
- package/dist/components/VideoSettingPanel/index.d.ts +9 -0
- package/dist/components/VideoSettingPanel/index.js +56 -44
- package/dist/components/VideoSettingPanel/index.vue.d.ts +9 -0
- package/dist/components/VirtualBackgroundPanel/VirtualBackgroundPanel.js +169 -0
- package/dist/components/VirtualBackgroundPanel/VirtualBackgroundPanel.vue.d.ts +33 -0
- package/dist/components/VirtualBackgroundPanel/i18n/en-US/index.d.ts +10 -0
- package/dist/components/VirtualBackgroundPanel/i18n/en-US/index.js +14 -0
- package/dist/components/VirtualBackgroundPanel/i18n/index.d.ts +4 -0
- package/dist/components/VirtualBackgroundPanel/i18n/index.js +6 -0
- package/dist/components/VirtualBackgroundPanel/i18n/zh-CN/index.d.ts +10 -0
- package/dist/components/VirtualBackgroundPanel/i18n/zh-CN/index.js +14 -0
- package/dist/components/VirtualBackgroundPanel/index.d.ts +20 -0
- package/dist/components/VirtualBackgroundPanel/index.js +10 -0
- package/dist/hooks/useRoomActions/index.d.ts +1 -1
- package/dist/hooks/useRoomActions/index.js +10 -11
- package/dist/hooks/useRoomActions/useRoomAudioAction.d.ts +1 -3
- package/dist/hooks/useRoomActions/useRoomAudioAction.js +30 -31
- package/dist/hooks/useRoomActions/useRoomScreenAction.d.ts +0 -2
- package/dist/hooks/useRoomActions/useRoomScreenAction.js +20 -20
- package/dist/hooks/useRoomActions/useRoomVideoAction.d.ts +1 -8
- package/dist/hooks/useRoomActions/useRoomVideoAction.js +26 -28
- package/dist/hooks/useRoomEngine.d.ts +2 -2
- package/dist/hooks/useUserActions/index.d.ts +7 -23
- package/dist/hooks/useUserActions/index.js +11 -11
- package/dist/hooks/useUserActions/useChangeNameCardAction/index.d.ts +1 -9
- package/dist/hooks/useUserActions/useKickUserAction.d.ts +1 -9
- package/dist/hooks/useUserActions/useSeatAction.d.ts +1 -1
- package/dist/hooks/useUserActions/useSeatAction.js +3 -3
- package/dist/hooks/useUserActions/useTransferOwnerAction.d.ts +2 -10
- package/dist/hooks/useUserActions/useTransferOwnerAction.js +22 -20
- package/dist/hooks/useUserActions/useVideoAction.d.ts +1 -9
- package/dist/index-BvFYOUyz.js +2936 -0
- package/dist/{index-BfIEeWMg.js → index-C8Jw_xE4.js} +825 -800
- package/dist/index-CiYL_XsE.js +64 -0
- package/dist/index-CzCDLp99.js +2174 -0
- package/dist/index.d.ts +4 -7
- package/dist/index.js +255 -194
- package/dist/report/MetricsKey.d.ts +27 -14
- package/dist/report/MetricsKey.js +1 -1
- package/dist/report/dataReport.js +12 -8
- package/dist/states/ASRState/ASRState.d.ts +61 -0
- package/dist/states/ASRState/ASRState.js +79 -0
- package/dist/states/ASRState/index.d.ts +1 -0
- package/dist/states/ASRState/index.js +4 -0
- package/dist/states/BarrageState/BarrageState.d.ts +70 -44
- package/dist/states/BarrageState/BarrageState.js +29 -31
- package/dist/states/BarrageState/index.js +2 -3
- package/dist/states/BattleState/BattleState.d.ts +101 -5
- package/dist/states/C2CSettingState/C2CSettingState.d.ts +107 -0
- package/dist/states/CoGuestState.d.ts +53 -1
- package/dist/states/CoGuestState.js +15 -15
- package/dist/states/CoHostState/CoHostState.d.ts +120 -0
- package/dist/states/ContactListState/ContactListState.d.ts +56 -0
- package/dist/states/ConversationListState/ConversationListState.d.ts +36 -0
- package/dist/states/DeviceState/DeviceState.d.ts +68 -10
- package/dist/states/DeviceState/DeviceState.js +233 -189
- package/dist/states/DeviceState/mediaAbality.d.ts +2 -0
- package/dist/states/DeviceState/mediaAbality.js +11 -0
- package/dist/states/FreeBeautyState/FreeBeautyState.d.ts +11 -0
- package/dist/states/FreeBeautyState/FreeBeautyState.js +103 -0
- package/dist/states/FreeBeautyState/index.d.ts +1 -0
- package/dist/states/FreeBeautyState/index.js +4 -0
- package/dist/states/GroupSettingState/GroupSettingState.d.ts +59 -0
- package/dist/states/LiveAudienceState.d.ts +42 -4
- package/dist/states/LiveListState/LiveListState.d.ts +2 -2
- package/dist/states/LiveListState/LiveListState.js +5 -5
- package/dist/states/LiveMonitorState/index.d.ts +42 -0
- package/dist/states/LiveMonitorState/player/adapters/trtc.js +6 -6
- package/dist/states/LiveSeatState/index.d.ts +58 -8
- package/dist/states/LiveSeatState/index.js +20 -18
- package/dist/states/LiveSeatState/seatManager.d.ts +293 -6
- package/dist/states/LiveSeatState/seatManager.js +283 -0
- package/dist/states/LiveSeatState/store.d.ts +0 -2
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamManager.js +13 -13
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamPlayer.js +7 -7
- package/dist/states/LiveSeatState/usePlayStream/index.d.ts +4 -7
- package/dist/states/LiveSeatState/usePlayStream/index.js +65 -54
- package/dist/states/LoginState.d.ts +45 -0
- package/dist/states/MessageActionState/MessageActionState.d.ts +36 -2
- package/dist/states/MessageActionState/MessageActionState.js +83 -103
- package/dist/states/MessageInputState/MessageInputState.js +115 -83
- package/dist/states/MessageInputState/type.d.ts +36 -10
- package/dist/states/MessageInputState/utils.d.ts +1 -5
- package/dist/states/MessageListState/MessageListState.d.ts +40 -1
- package/dist/states/RoomParticipantState/callEventManager.d.ts +10 -0
- package/dist/states/RoomParticipantState/callEventManager.js +49 -0
- package/dist/states/RoomParticipantState/common.d.ts +14 -0
- package/dist/states/RoomParticipantState/common.js +76 -0
- package/dist/states/RoomParticipantState/index.d.ts +4 -0
- package/dist/states/RoomParticipantState/index.js +93 -0
- package/dist/states/RoomParticipantState/participantEventManager.d.ts +66 -0
- package/dist/states/RoomParticipantState/participantEventManager.js +326 -0
- package/dist/states/RoomParticipantState/participantManager.d.ts +311 -0
- package/dist/states/RoomParticipantState/participantManager.js +440 -0
- package/dist/states/RoomParticipantState/scheduleEventManager.d.ts +7 -0
- package/dist/states/RoomParticipantState/scheduleEventManager.js +37 -0
- package/dist/states/RoomParticipantState/store.d.ts +38 -0
- package/dist/states/RoomParticipantState/store.js +102 -0
- package/dist/states/RoomState/callManager.d.ts +43 -0
- package/dist/states/RoomState/callManager.js +208 -0
- package/dist/states/RoomState/common.d.ts +25 -0
- package/dist/states/RoomState/common.js +101 -0
- package/dist/states/RoomState/index.d.ts +8 -0
- package/dist/states/RoomState/index.js +52 -0
- package/dist/states/RoomState/roomManager.d.ts +35 -0
- package/dist/states/RoomState/roomManager.js +129 -0
- package/dist/states/RoomState/scheduleManager.d.ts +48 -0
- package/dist/states/RoomState/scheduleManager.js +174 -0
- package/dist/states/RoomState/store.d.ts +103 -0
- package/dist/states/RoomState/store.js +12 -0
- package/dist/states/SeatStore.d.ts +59 -52
- package/dist/states/UIKitModalState/UIKitModalState.d.ts +17 -0
- package/dist/states/UIKitModalState/UIKitModalState.js +63 -0
- package/dist/states/UIKitModalState/index.d.ts +1 -0
- package/dist/states/UIKitModalState/index.js +4 -0
- package/dist/states/UserState/index.js +22 -28
- package/dist/states/UserState/store.d.ts +1 -1
- package/dist/states/UserState/store.js +55 -62
- package/dist/states/UserState/userManager.d.ts +2 -2
- package/dist/states/UserState/userManager.js +23 -25
- package/dist/states/VideoMixerState/VideoMixerState.d.ts +57 -1
- package/dist/states/VideoMixerState/VideoMixerState.js +91 -90
- package/dist/states/VideoMixerState/index.d.ts +1 -0
- package/dist/states/VideoMixerState/index.js +2 -1
- package/dist/states/VirtualBackgroundState/VirtualBackgroundState.d.ts +52 -0
- package/dist/states/VirtualBackgroundState/VirtualBackgroundState.js +99 -0
- package/dist/states/VirtualBackgroundState/index.d.ts +1 -0
- package/dist/states/VirtualBackgroundState/index.js +4 -0
- package/dist/styles/index.css +1 -1
- package/dist/{chat/index.d.ts → subEntry/chat/chat.d.ts} +2554 -2514
- package/dist/subEntry/chat/chat.js +89 -0
- package/dist/subEntry/chat/index.d.ts +11 -0
- package/dist/subEntry/chat/index.js +81 -0
- package/dist/{chat → subEntry/chat}/server.js +4 -4
- package/dist/subEntry/common/base.d.ts +5 -0
- package/dist/subEntry/common/base.js +21 -0
- package/dist/subEntry/common/index.d.ts +2 -0
- package/dist/subEntry/common/index.js +29 -0
- package/dist/subEntry/common/rtc.d.ts +4 -0
- package/dist/subEntry/common/rtc.js +10 -0
- package/dist/subEntry/live/index.d.ts +4 -0
- package/dist/subEntry/live/index.js +200 -0
- package/dist/subEntry/live/live.d.ts +21 -0
- package/dist/subEntry/live/live.js +45 -0
- package/dist/{rtc → subEntry/live}/server.d.ts +1 -1
- package/dist/{rtc → subEntry/live}/server.js +4 -4
- package/dist/subEntry/room/index.d.ts +4 -0
- package/dist/subEntry/room/index.js +180 -0
- package/dist/subEntry/room/room.d.ts +11 -0
- package/dist/subEntry/room/room.js +25 -0
- package/dist/subEntry/room/server.d.ts +19 -0
- package/dist/subEntry/room/server.js +97 -0
- package/dist/types/asr.d.ts +29 -0
- package/dist/types/asr.js +4 -0
- package/dist/types/barrage.d.ts +83 -0
- package/dist/types/barrage.js +4 -0
- package/dist/types/beauty.d.ts +9 -0
- package/dist/types/beauty.js +4 -0
- package/dist/types/device.d.ts +0 -1
- package/dist/types/index.d.ts +7 -3
- package/dist/types/index.js +125 -108
- package/dist/types/participant.d.ts +243 -0
- package/dist/types/participant.js +10 -0
- package/dist/types/room.d.ts +202 -55
- package/dist/types/room.js +5 -3
- package/dist/types/virtualBackground.d.ts +14 -0
- package/dist/types/virtualBackground.js +5 -0
- package/dist/{useId-CtirfF0W.js → useId-D5WE76CM.js} +1 -1
- package/dist/utils/call.d.ts +1 -1
- package/dist/utils/call.js +78 -79
- package/dist/utils/compare.d.ts +10 -0
- package/dist/utils/compare.js +12 -0
- package/dist/{utils-DaB7eSu5.js → utils-CttDpxqz.js} +1 -1
- package/package.json +16 -10
- package/src/baseComp/AudioIcon.vue +11 -3
- package/src/components/AudioSetting/AudioMediaControl.vue +10 -9
- package/src/components/AudioSetting/AudioRequestDialog.vue +11 -11
- package/src/components/AudioSetting/AudioSettingTab.vue +14 -14
- package/src/components/AudioSetting/MicrophoneSelect.vue +11 -11
- package/src/components/AudioSetting/SpeakerSelect.vue +10 -11
- package/src/components/AudioSetting/index.ts +1 -1
- package/src/components/AudioSetting/index.vue +4 -7
- package/src/components/AudioSettingPanel/MicrophoneSelect.vue +77 -0
- package/src/components/AudioSettingPanel/SpeakerSelect.vue +78 -0
- package/src/components/AudioSettingPanel/i18n/en-US/index.ts +12 -6
- package/src/components/AudioSettingPanel/i18n/zh-CN/index.ts +12 -6
- package/src/components/AudioSettingPanel/index.ts +3 -1
- package/src/components/AudioSettingPanel/index.vue +150 -122
- package/src/components/BarrageList/BarrageList.vue +1 -1
- package/src/components/BarrageList/BarrageListH5.vue +1 -1
- package/src/components/BarrageList/BarrageListState.ts +1 -1
- package/src/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue +1 -1
- package/src/components/BarrageList/Message/MessageLayout/MessageLayout.vue +2 -2
- package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +1 -1
- package/src/components/ChatSetting/GroupChatSetting/GroupChatSetting.vue +5 -0
- package/src/components/ConversationList/ConversationActions/ConversationActions.vue +1 -7
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +8 -0
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +32 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.vue +3 -3
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +3 -2
- package/src/components/ConversationList/ConversationPreview/utils.ts +98 -28
- package/src/components/ConversationList/i18n/en-US.ts +10 -1
- package/src/components/ConversationList/i18n/zh-CN.ts +10 -1
- package/src/components/FreeBeautyPanel/FreeBeautyPanel.vue +618 -0
- package/src/components/FreeBeautyPanel/i18n/en-US/index.ts +16 -0
- package/src/components/FreeBeautyPanel/i18n/index.ts +4 -0
- package/src/components/FreeBeautyPanel/i18n/zh-CN/index.ts +16 -0
- package/src/components/FreeBeautyPanel/index.ts +11 -0
- package/src/components/LiveScenePanel/index.ts +4 -1
- package/src/components/LiveScenePanel/index.vue +1 -0
- package/src/components/LiveView/PlayerControl/AudioControl.vue +72 -80
- package/src/components/LiveView/PlayerControl/MultiResolution.vue +29 -26
- package/src/components/LiveView/PlayerControl/PlayerControl.vue +10 -36
- package/src/components/LiveView/PlayerControl/PlayerControlState.ts +108 -286
- package/src/components/LiveView/index.ts +2 -1
- package/src/components/MessageInput/AudioCallPicker/AudioCallPicker.vue +8 -6
- package/src/components/MessageInput/MessageInput.vue +2 -0
- package/src/components/MessageInput/QuotedMessagePreview/QuotedMessagePreview.vue +19 -22
- package/src/components/MessageInput/TextEditor/Editor.scss +25 -0
- package/src/components/MessageInput/TextEditor/EditorCore.ts +78 -111
- package/src/components/MessageInput/TextEditor/TextEditor.vue +68 -51
- package/src/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue +449 -0
- package/src/components/MessageInput/TextEditor/extensions/characterCountExtension.ts +159 -0
- package/src/components/MessageInput/TextEditor/extensions/emojiExtension.ts +22 -0
- package/src/components/MessageInput/TextEditor/extensions/enterKeyExtension.ts +22 -0
- package/src/components/MessageInput/TextEditor/extensions/imageExtension.ts +79 -0
- package/src/components/MessageInput/TextEditor/extensions/index.ts +8 -0
- package/src/components/MessageInput/TextEditor/extensions/mentionExtension.ts +87 -0
- package/src/components/MessageInput/VideoCallPicker/VideoCallPicker.vue +8 -6
- package/src/components/MessageInput/i18n/en-US.ts +3 -0
- package/src/components/MessageInput/i18n/zh-CN.ts +7 -0
- package/src/components/MessageInput/types.d.ts +1 -0
- package/src/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.vue +4 -2
- package/src/components/MessageList/Message/GroupTipMessage/GroupTipMessage.vue +5 -4
- package/src/components/MessageList/Message/ImageMessage/ImageMessage.vue +49 -0
- package/src/components/MessageList/Message/ImageMessage/ImagePreview.vue +344 -0
- package/src/components/MessageList/Message/Message.vue +6 -0
- package/src/components/MessageList/Message/MessageLayout/MessageLayout.vue +16 -9
- package/src/components/MessageList/Message/VideoMessage/VideoMessage.vue +46 -43
- package/src/components/MessageList/Message/VideoMessage/index.ts +1 -1
- package/src/components/MessageList/MessageList.vue +36 -14
- package/src/components/MessageList/i18n/en-US.ts +66 -0
- package/src/components/MessageList/i18n/index.ts +4 -4
- package/src/components/MessageList/i18n/zh-CN.ts +66 -0
- package/src/components/RoomParticipantList/ParticipantAction.vue +196 -0
- package/src/components/RoomParticipantList/ParticipantItem.vue +205 -0
- package/src/components/RoomParticipantList/PendingParticipantItem.vue +142 -0
- package/src/components/RoomParticipantList/RoomAction.vue +141 -0
- package/src/components/RoomParticipantList/i18n/en-US/index.ts +74 -0
- package/src/components/RoomParticipantList/i18n/index.ts +2 -0
- package/src/components/RoomParticipantList/i18n/zh-CN/index.ts +74 -0
- package/src/components/RoomParticipantList/index.ts +10 -0
- package/src/components/RoomParticipantList/index.vue +285 -0
- package/src/components/RoomParticipantList/useParticpantAction/index.ts +94 -0
- package/src/components/RoomParticipantList/useParticpantAction/useAdminAction.ts +56 -0
- package/src/components/RoomParticipantList/useParticpantAction/useAudioAction.ts +66 -0
- package/src/components/RoomParticipantList/useParticpantAction/useKickAction.ts +46 -0
- package/src/components/RoomParticipantList/useParticpantAction/useMessageAction.ts +42 -0
- package/src/components/RoomParticipantList/useParticpantAction/useNameCardAction/changeNameCardDialog.vue +51 -0
- package/src/components/RoomParticipantList/useParticpantAction/useNameCardAction/index.ts +80 -0
- package/src/components/RoomParticipantList/useParticpantAction/useTransferOwnerAction.ts +77 -0
- package/src/components/RoomParticipantList/useParticpantAction/useVideoAction.ts +59 -0
- package/src/components/RoomParticipantList/useRoomAction/index.ts +23 -0
- package/src/components/RoomParticipantList/useRoomAction/useRoomAudioAction.ts +67 -0
- package/src/components/RoomParticipantList/useRoomAction/useRoomScreenAction.ts +69 -0
- package/src/components/RoomParticipantList/useRoomAction/useRoomVideoAction.ts +66 -0
- package/src/components/RoomParticipantView/StreamPlay.vue +127 -0
- package/src/components/RoomParticipantView/StreamPlayManager/LazyLoadManager.ts +174 -0
- package/src/components/RoomParticipantView/StreamPlayManager/README.md +768 -0
- package/src/components/RoomParticipantView/StreamPlayManager/StreamInfoManager.ts +209 -0
- package/src/components/RoomParticipantView/StreamPlayManager/StreamPlayer.ts +183 -0
- package/src/components/RoomParticipantView/StreamPlayManager/VideoQualityManager.ts +357 -0
- package/src/components/RoomParticipantView/StreamPlayManager/index.ts +501 -0
- package/src/components/RoomParticipantView/StreamPlayManager/types.ts +13 -0
- package/src/components/RoomParticipantView/index.ts +5 -0
- package/src/components/RoomParticipantView/index.vue +43 -0
- package/src/components/RoomView/ArrowStroke.vue +265 -0
- package/src/components/RoomView/GridLayout.vue +236 -0
- package/src/components/RoomView/SpeakerLayout.vue +400 -0
- package/src/components/RoomView/index.ts +5 -0
- package/src/components/RoomView/index.vue +58 -0
- package/src/components/RoomView/useRoomToolbar.ts +97 -0
- package/src/components/RoomView/useRoomView.ts +48 -0
- package/src/components/RoomView/useStreamItemDimensions.ts +162 -0
- package/src/components/ScheduleRoomPanel/Datepicker.vue +332 -0
- package/src/components/ScheduleRoomPanel/DurationSelector.vue +92 -0
- package/src/components/ScheduleRoomPanel/RoomDetail.vue +240 -0
- package/src/components/ScheduleRoomPanel/RoomEdit.vue +473 -0
- package/src/components/ScheduleRoomPanel/RoomShare.vue +216 -0
- package/src/components/ScheduleRoomPanel/ScheduleRoomPanel.vue +625 -0
- package/src/components/ScheduleRoomPanel/ScheduledRoomList.vue +622 -0
- package/src/components/ScheduleRoomPanel/Timepicker.vue +86 -0
- package/src/components/ScheduleRoomPanel/TimezoneSelector.vue +70 -0
- package/src/components/ScheduleRoomPanel/i18n/en-US/index.ts +116 -0
- package/src/components/ScheduleRoomPanel/i18n/index.ts +4 -0
- package/src/components/ScheduleRoomPanel/i18n/zh-CN/index.ts +116 -0
- package/src/components/ScheduleRoomPanel/index.ts +14 -0
- package/src/components/ScheduleRoomPanel/type.ts +7 -0
- package/src/components/ScheduleRoomPanel/utils.ts +281 -0
- package/src/components/Search/SearchAdvanced/DateRangePicker/DateRangePicker.scss +1 -4
- package/src/components/Search/SearchAdvanced/MessageAdvanced/MessageAdvanced.scss +1 -4
- package/src/components/Search/SearchAdvanced/SearchAdvanced.scss +1 -4
- package/src/components/Search/SearchAdvanced/SearchTab/SearchTab.scss +1 -4
- package/src/components/Search/SearchAdvanced/Slider/Slider.scss +1 -4
- package/src/components/Search/SearchAdvanced/UserAdvanced/UserAdvanced.scss +1 -4
- package/src/components/Search/SearchBar/SearchBar.scss +3 -6
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +30 -31
- package/src/components/StreamMixer/LocalMixer/index.vue +6 -1
- package/src/components/StreamMixer/index.ts +4 -1
- package/src/components/StreamView/Layout/CustomLayout.vue +40 -36
- package/src/components/StreamView/Layout/GridLayout.vue +31 -40
- package/src/components/StreamView/Layout/MeetingLayout.vue +34 -35
- package/src/components/StreamView/index.ts +5 -3
- package/src/components/StreamView/manager/mediaManager.ts +1 -2
- package/src/components/UIKitModal/UIKitModal.ts +71 -0
- package/src/components/UIKitModal/index.scss +134 -0
- package/src/components/UIKitModal/index.ts +2 -0
- package/src/components/UIKitModal/index.vue +160 -0
- package/src/components/UIKitModal/type.ts +24 -0
- package/src/components/UIKitModal/useRoomModal/i18n/en-US/index.ts +19 -0
- package/src/components/UIKitModal/useRoomModal/i18n/index.ts +4 -0
- package/src/components/UIKitModal/useRoomModal/i18n/zh-CN/index.ts +18 -0
- package/src/components/UIKitModal/useRoomModal/index.ts +11 -0
- package/src/components/UIKitModal/useRoomModal/useRoomModal.ts +103 -0
- package/src/components/UserList/AllUserActions/indexH5.vue +3 -3
- package/src/components/UserList/AllUserActions/useIndexHooks.ts +1 -1
- package/src/components/UserList/UserItem/UserInfo/index.vue +17 -12
- package/src/components/UserPicker/UserPicker.vue +1 -1
- package/src/components/UserPicker/components/SelectedPanel/SelectedPanel.vue +1 -0
- package/src/components/UserPicker/hooks/useSearchFilter.ts +27 -18
- package/src/components/UserPicker/i18n/en-US.ts +1 -0
- package/src/components/UserPicker/i18n/zh-CN.ts +1 -0
- package/src/components/UserPicker/type.ts +1 -1
- package/src/components/VideoSetting/CameraSelect.vue +11 -11
- package/src/components/VideoSetting/VideoMediaControl.vue +22 -21
- package/src/components/VideoSetting/VideoPreview.vue +14 -8
- package/src/components/VideoSetting/VideoProfile.vue +13 -15
- package/src/components/VideoSetting/VideoSettingTab.vue +9 -9
- package/src/components/VideoSettingPanel/CameraSelect.vue +8 -3
- package/src/components/VideoSettingPanel/VideoPreview.vue +4 -4
- package/src/components/VideoSettingPanel/VideoProfile.vue +6 -6
- package/src/components/VideoSettingPanel/i18n/en-US/index.ts +13 -10
- package/src/components/VideoSettingPanel/i18n/zh-CN/index.ts +13 -10
- package/src/components/VideoSettingPanel/index.ts +2 -2
- package/src/components/VideoSettingPanel/index.vue +73 -74
- package/src/components/VirtualBackgroundPanel/VirtualBackgroundPanel.vue +337 -0
- package/src/components/VirtualBackgroundPanel/assets/blurred-background.png +0 -0
- package/src/components/VirtualBackgroundPanel/assets/close-virtual-background.png +0 -0
- package/src/components/VirtualBackgroundPanel/i18n/en-US/index.ts +11 -0
- package/src/components/VirtualBackgroundPanel/i18n/index.ts +4 -0
- package/src/components/VirtualBackgroundPanel/i18n/zh-CN/index.ts +11 -0
- package/src/components/VirtualBackgroundPanel/index.ts +11 -0
- package/src/hooks/useRoomActions/index.ts +3 -2
- package/src/hooks/useRoomActions/useRoomAudioAction.ts +11 -12
- package/src/hooks/useRoomActions/useRoomScreenAction.ts +12 -13
- package/src/hooks/useRoomActions/useRoomVideoAction.ts +10 -13
- package/src/hooks/useRoomEngine.ts +3 -2
- package/src/hooks/useUserActions/index.ts +38 -43
- package/src/hooks/useUserActions/useSeatAction.ts +10 -10
- package/src/hooks/useUserActions/useTransferOwnerAction.ts +10 -10
- package/src/index.ts +8 -10
- package/src/report/MetricsKey.ts +28 -14
- package/src/report/dataReport.ts +13 -9
- package/src/{chat/index.ts → subEntry/chat/chat.ts} +25 -18
- package/src/subEntry/chat/index.ts +13 -0
- package/src/{chat → subEntry/chat}/server.ts +3 -3
- package/src/subEntry/common/base.ts +6 -0
- package/src/subEntry/common/index.ts +2 -0
- package/src/subEntry/common/rtc.ts +5 -0
- package/src/subEntry/live/index.ts +8 -0
- package/src/subEntry/live/live.ts +23 -0
- package/src/{rtc → subEntry/live}/server.ts +3 -3
- package/src/subEntry/room/index.ts +8 -0
- package/src/subEntry/room/room.ts +12 -0
- package/src/subEntry/room/server.ts +123 -0
- package/src/types/asr.ts +31 -0
- package/src/types/barrage.ts +86 -0
- package/src/types/beauty.ts +10 -0
- package/src/types/device.ts +3 -5
- package/src/types/index.ts +9 -3
- package/src/types/participant.ts +155 -0
- package/src/types/room.ts +122 -57
- package/src/types/user.ts +2 -0
- package/src/types/virtualBackground.ts +17 -0
- package/src/utils/call.ts +25 -26
- package/src/utils/compare.ts +34 -0
- package/tsconfig.eslint.json +15 -0
- package/tsconfig.json +7 -1
- package/dist/AudioRequestDialog.vue_vue_type_script_setup_true_lang-DESfuJPj.js +0 -89
- package/dist/chat/index.js +0 -59
- package/dist/index-DTi1fL-x.js +0 -5128
- package/dist/index-DTq2ybsB.js +0 -33
- package/dist/index.vue_vue_type_script_setup_true_lang-DZIBxSQ7.js +0 -32
- package/dist/rtc/index.d.ts +0 -501
- package/dist/rtc/index.js +0 -67
- package/dist/states/RoomState.d.ts +0 -173
- package/dist/states/RoomState.js +0 -272
- package/dist/states/SearchState.d.ts +0 -267
- package/src/rtc/index.ts +0 -100
- /package/dist/{chat → subEntry/chat}/server.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function
|
|
1
|
+
function L(r) {
|
|
2
2
|
this.content = r;
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
constructor:
|
|
4
|
+
L.prototype = {
|
|
5
|
+
constructor: L,
|
|
6
6
|
find: function(r) {
|
|
7
7
|
for (var e = 0; e < this.content.length; e += 2)
|
|
8
8
|
if (this.content[e] === r) return e;
|
|
@@ -21,7 +21,7 @@ V.prototype = {
|
|
|
21
21
|
// given, the key of the binding will be replaced with that key.
|
|
22
22
|
update: function(r, e, t) {
|
|
23
23
|
var n = t && t != r ? this.remove(t) : this, i = n.find(r), s = n.content.slice();
|
|
24
|
-
return i == -1 ? s.push(t || r, e) : (s[i + 1] = e, t && (s[i] = t)), new
|
|
24
|
+
return i == -1 ? s.push(t || r, e) : (s[i + 1] = e, t && (s[i] = t)), new L(s);
|
|
25
25
|
},
|
|
26
26
|
// :: (string) → OrderedMap
|
|
27
27
|
// Return a map with the given key removed, if it existed.
|
|
@@ -29,25 +29,25 @@ V.prototype = {
|
|
|
29
29
|
var e = this.find(r);
|
|
30
30
|
if (e == -1) return this;
|
|
31
31
|
var t = this.content.slice();
|
|
32
|
-
return t.splice(e, 2), new
|
|
32
|
+
return t.splice(e, 2), new L(t);
|
|
33
33
|
},
|
|
34
34
|
// :: (string, any) → OrderedMap
|
|
35
35
|
// Add a new key to the start of the map.
|
|
36
36
|
addToStart: function(r, e) {
|
|
37
|
-
return new
|
|
37
|
+
return new L([r, e].concat(this.remove(r).content));
|
|
38
38
|
},
|
|
39
39
|
// :: (string, any) → OrderedMap
|
|
40
40
|
// Add a new key to the end of the map.
|
|
41
41
|
addToEnd: function(r, e) {
|
|
42
42
|
var t = this.remove(r).content.slice();
|
|
43
|
-
return t.push(r, e), new
|
|
43
|
+
return t.push(r, e), new L(t);
|
|
44
44
|
},
|
|
45
45
|
// :: (string, string, any) → OrderedMap
|
|
46
46
|
// Add a key after the given key. If `place` is not found, the new
|
|
47
47
|
// key is added to the end.
|
|
48
48
|
addBefore: function(r, e, t) {
|
|
49
49
|
var n = this.remove(e), i = n.content.slice(), s = n.find(r);
|
|
50
|
-
return i.splice(s == -1 ? i.length : s, 0, e, t), new
|
|
50
|
+
return i.splice(s == -1 ? i.length : s, 0, e, t), new L(i);
|
|
51
51
|
},
|
|
52
52
|
// :: ((key: string, value: any))
|
|
53
53
|
// Call the given function for each key/value pair in the map, in
|
|
@@ -60,20 +60,20 @@ V.prototype = {
|
|
|
60
60
|
// Create a new map by prepending the keys in this map that don't
|
|
61
61
|
// appear in `map` before the keys in `map`.
|
|
62
62
|
prepend: function(r) {
|
|
63
|
-
return r =
|
|
63
|
+
return r = L.from(r), r.size ? new L(r.content.concat(this.subtract(r).content)) : this;
|
|
64
64
|
},
|
|
65
65
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
66
66
|
// Create a new map by appending the keys in this map that don't
|
|
67
67
|
// appear in `map` after the keys in `map`.
|
|
68
68
|
append: function(r) {
|
|
69
|
-
return r =
|
|
69
|
+
return r = L.from(r), r.size ? new L(this.subtract(r).content.concat(r.content)) : this;
|
|
70
70
|
},
|
|
71
71
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
72
72
|
// Create a map containing all the keys in this map that don't
|
|
73
73
|
// appear in `map`.
|
|
74
74
|
subtract: function(r) {
|
|
75
75
|
var e = this;
|
|
76
|
-
r =
|
|
76
|
+
r = L.from(r);
|
|
77
77
|
for (var t = 0; t < r.content.length; t += 2)
|
|
78
78
|
e = e.remove(r.content[t]);
|
|
79
79
|
return e;
|
|
@@ -92,11 +92,11 @@ V.prototype = {
|
|
|
92
92
|
return this.content.length >> 1;
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
|
|
96
|
-
if (r instanceof
|
|
95
|
+
L.from = function(r) {
|
|
96
|
+
if (r instanceof L) return r;
|
|
97
97
|
var e = [];
|
|
98
98
|
if (r) for (var t in r) e.push(t, r[t]);
|
|
99
|
-
return new
|
|
99
|
+
return new L(e);
|
|
100
100
|
};
|
|
101
101
|
function hi(r, e, t) {
|
|
102
102
|
for (let n = 0; ; n++) {
|
|
@@ -635,7 +635,7 @@ function mi(r, e, t, n) {
|
|
|
635
635
|
let l = mi(o.content, e - s - 1, t, o);
|
|
636
636
|
return l && r.replaceChild(i, o.copy(l));
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Ks(r, e, t) {
|
|
639
639
|
if (t.openStart > r.depth)
|
|
640
640
|
throw new It("Inserted content deeper than insertion position");
|
|
641
641
|
if (r.depth - t.openStart != e.depth - t.openEnd)
|
|
@@ -652,7 +652,7 @@ function gi(r, e, t, n) {
|
|
|
652
652
|
let o = r.parent, l = o.content;
|
|
653
653
|
return Ae(o, l.cut(0, r.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
|
|
654
654
|
} else {
|
|
655
|
-
let { start: o, end: l } =
|
|
655
|
+
let { start: o, end: l } = Hs(t, r);
|
|
656
656
|
return Ae(s, bi(r, o, l, e, n));
|
|
657
657
|
}
|
|
658
658
|
else return Ae(s, Rt(r, e, n));
|
|
@@ -691,7 +691,7 @@ function Rt(r, e, t) {
|
|
|
691
691
|
}
|
|
692
692
|
return st(e, null, t, n), new b(n);
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function Hs(r, e) {
|
|
695
695
|
let t = e.depth - r.openStart, i = e.node(t).copy(r.content);
|
|
696
696
|
for (let s = t - 1; s >= 0; s--)
|
|
697
697
|
i = e.node(s).copy(b.from(i));
|
|
@@ -942,17 +942,17 @@ class ct {
|
|
|
942
942
|
return o;
|
|
943
943
|
}
|
|
944
944
|
else
|
|
945
|
-
or.set(e, n = new
|
|
945
|
+
or.set(e, n = new Us());
|
|
946
946
|
let i = n.elts[n.i] = ct.resolve(e, t);
|
|
947
|
-
return n.i = (n.i + 1) %
|
|
947
|
+
return n.i = (n.i + 1) % Gs, i;
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
class
|
|
950
|
+
class Us {
|
|
951
951
|
constructor() {
|
|
952
952
|
this.elts = [], this.i = 0;
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
const
|
|
955
|
+
const Gs = 12, or = /* @__PURE__ */ new WeakMap();
|
|
956
956
|
class Pt {
|
|
957
957
|
/**
|
|
958
958
|
Construct a node range. `$from` and `$to` should point into the
|
|
@@ -993,7 +993,7 @@ class Pt {
|
|
|
993
993
|
return this.$to.indexAfter(this.depth);
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
const
|
|
996
|
+
const _s = /* @__PURE__ */ Object.create(null);
|
|
997
997
|
let be = class Mn {
|
|
998
998
|
/**
|
|
999
999
|
@internal
|
|
@@ -1112,7 +1112,7 @@ let be = class Mn {
|
|
|
1112
1112
|
attributes, and marks.
|
|
1113
1113
|
*/
|
|
1114
1114
|
hasMarkup(e, t, n) {
|
|
1115
|
-
return this.type == e && At(this.attrs, t || e.defaultAttrs ||
|
|
1115
|
+
return this.type == e && At(this.attrs, t || e.defaultAttrs || _s) && D.sameSet(this.marks, n || D.none);
|
|
1116
1116
|
}
|
|
1117
1117
|
/**
|
|
1118
1118
|
Create a new node with the same markup as this node, containing
|
|
@@ -1155,7 +1155,7 @@ let be = class Mn {
|
|
|
1155
1155
|
[`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
|
|
1156
1156
|
*/
|
|
1157
1157
|
replace(e, t, n) {
|
|
1158
|
-
return
|
|
1158
|
+
return Ks(this.resolve(e), this.resolve(t), n);
|
|
1159
1159
|
}
|
|
1160
1160
|
/**
|
|
1161
1161
|
Find the node directly after the given position.
|
|
@@ -1418,13 +1418,13 @@ class Pe {
|
|
|
1418
1418
|
@internal
|
|
1419
1419
|
*/
|
|
1420
1420
|
static parse(e, t) {
|
|
1421
|
-
let n = new
|
|
1421
|
+
let n = new Ys(e, t);
|
|
1422
1422
|
if (n.next == null)
|
|
1423
1423
|
return Pe.empty;
|
|
1424
1424
|
let i = xi(n);
|
|
1425
1425
|
n.next && n.err("Unexpected trailing text");
|
|
1426
|
-
let s = no(
|
|
1427
|
-
return
|
|
1426
|
+
let s = ro(no(i));
|
|
1427
|
+
return io(s, n), s;
|
|
1428
1428
|
}
|
|
1429
1429
|
/**
|
|
1430
1430
|
Match a node type, returning a match after that node if
|
|
@@ -1570,7 +1570,7 @@ class Pe {
|
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
1572
|
Pe.empty = new Pe(!0);
|
|
1573
|
-
class
|
|
1573
|
+
class Ys {
|
|
1574
1574
|
constructor(e, t) {
|
|
1575
1575
|
this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
|
|
1576
1576
|
}
|
|
@@ -1587,19 +1587,19 @@ class _s {
|
|
|
1587
1587
|
function xi(r) {
|
|
1588
1588
|
let e = [];
|
|
1589
1589
|
do
|
|
1590
|
-
e.push(
|
|
1590
|
+
e.push(Xs(r));
|
|
1591
1591
|
while (r.eat("|"));
|
|
1592
1592
|
return e.length == 1 ? e[0] : { type: "choice", exprs: e };
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1594
|
+
function Xs(r) {
|
|
1595
1595
|
let e = [];
|
|
1596
1596
|
do
|
|
1597
|
-
e.push(
|
|
1597
|
+
e.push(Zs(r));
|
|
1598
1598
|
while (r.next && r.next != ")" && r.next != "|");
|
|
1599
1599
|
return e.length == 1 ? e[0] : { type: "seq", exprs: e };
|
|
1600
1600
|
}
|
|
1601
|
-
function
|
|
1602
|
-
let e =
|
|
1601
|
+
function Zs(r) {
|
|
1602
|
+
let e = to(r);
|
|
1603
1603
|
for (; ; )
|
|
1604
1604
|
if (r.eat("+"))
|
|
1605
1605
|
e = { type: "plus", expr: e };
|
|
@@ -1608,7 +1608,7 @@ function Xs(r) {
|
|
|
1608
1608
|
else if (r.eat("?"))
|
|
1609
1609
|
e = { type: "opt", expr: e };
|
|
1610
1610
|
else if (r.eat("{"))
|
|
1611
|
-
e =
|
|
1611
|
+
e = Qs(r, e);
|
|
1612
1612
|
else
|
|
1613
1613
|
break;
|
|
1614
1614
|
return e;
|
|
@@ -1618,11 +1618,11 @@ function lr(r) {
|
|
|
1618
1618
|
let e = Number(r.next);
|
|
1619
1619
|
return r.pos++, e;
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1621
|
+
function Qs(r, e) {
|
|
1622
1622
|
let t = lr(r), n = t;
|
|
1623
1623
|
return r.eat(",") && (r.next != "}" ? n = lr(r) : n = -1), r.eat("}") || r.err("Unclosed braced range"), { type: "range", min: t, max: n, expr: e };
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function eo(r, e) {
|
|
1626
1626
|
let t = r.nodeTypes, n = t[e];
|
|
1627
1627
|
if (n)
|
|
1628
1628
|
return [n];
|
|
@@ -1633,18 +1633,18 @@ function Qs(r, e) {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
return i.length == 0 && r.err("No node type or group '" + e + "' found"), i;
|
|
1635
1635
|
}
|
|
1636
|
-
function
|
|
1636
|
+
function to(r) {
|
|
1637
1637
|
if (r.eat("(")) {
|
|
1638
1638
|
let e = xi(r);
|
|
1639
1639
|
return r.eat(")") || r.err("Missing closing paren"), e;
|
|
1640
1640
|
} else if (/\W/.test(r.next))
|
|
1641
1641
|
r.err("Unexpected token '" + r.next + "'");
|
|
1642
1642
|
else {
|
|
1643
|
-
let e =
|
|
1643
|
+
let e = eo(r, r.next).map((t) => (r.inline == null ? r.inline = t.isInline : r.inline != t.isInline && r.err("Mixing inline and block content"), { type: "name", value: t }));
|
|
1644
1644
|
return r.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1647
|
+
function no(r) {
|
|
1648
1648
|
let e = [[]];
|
|
1649
1649
|
return i(s(r, 0), t()), e;
|
|
1650
1650
|
function t() {
|
|
@@ -1715,7 +1715,7 @@ function ar(r, e) {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1718
|
+
function ro(r) {
|
|
1719
1719
|
let e = /* @__PURE__ */ Object.create(null);
|
|
1720
1720
|
return t(ar(r, 0));
|
|
1721
1721
|
function t(n) {
|
|
@@ -1740,7 +1740,7 @@ function no(r) {
|
|
|
1740
1740
|
return s;
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function io(r, e) {
|
|
1744
1744
|
for (let t = 0, n = [r]; t < n.length; t++) {
|
|
1745
1745
|
let i = n[t], s = !i.validEnd, o = [];
|
|
1746
1746
|
for (let l = 0; l < i.next.length; l++) {
|
|
@@ -1788,7 +1788,7 @@ function Oi(r, e) {
|
|
|
1788
1788
|
let t = /* @__PURE__ */ Object.create(null);
|
|
1789
1789
|
if (e)
|
|
1790
1790
|
for (let n in e)
|
|
1791
|
-
t[n] = new
|
|
1791
|
+
t[n] = new oo(r, n, e[n]);
|
|
1792
1792
|
return t;
|
|
1793
1793
|
}
|
|
1794
1794
|
let cr = class Ni {
|
|
@@ -1970,7 +1970,7 @@ let cr = class Ni {
|
|
|
1970
1970
|
return n;
|
|
1971
1971
|
}
|
|
1972
1972
|
};
|
|
1973
|
-
function
|
|
1973
|
+
function so(r, e, t) {
|
|
1974
1974
|
let n = t.split("|");
|
|
1975
1975
|
return (i) => {
|
|
1976
1976
|
let s = i === null ? "null" : typeof i;
|
|
@@ -1978,9 +1978,9 @@ function io(r, e, t) {
|
|
|
1978
1978
|
throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`);
|
|
1979
1979
|
};
|
|
1980
1980
|
}
|
|
1981
|
-
class
|
|
1981
|
+
class oo {
|
|
1982
1982
|
constructor(e, t, n) {
|
|
1983
|
-
this.hasDefault = Object.prototype.hasOwnProperty.call(n, "default"), this.default = n.default, this.validate = typeof n.validate == "string" ?
|
|
1983
|
+
this.hasDefault = Object.prototype.hasOwnProperty.call(n, "default"), this.default = n.default, this.validate = typeof n.validate == "string" ? so(e, t, n.validate) : n.validate;
|
|
1984
1984
|
}
|
|
1985
1985
|
get isRequired() {
|
|
1986
1986
|
return !this.hasDefault;
|
|
@@ -2050,7 +2050,7 @@ class Ti {
|
|
|
2050
2050
|
let t = this.spec = {};
|
|
2051
2051
|
for (let i in e)
|
|
2052
2052
|
t[i] = e[i];
|
|
2053
|
-
t.nodes =
|
|
2053
|
+
t.nodes = L.from(e.nodes), t.marks = L.from(e.marks || {}), this.nodes = cr.compile(this.spec.nodes, this), this.marks = qt.compile(this.spec.marks, this);
|
|
2054
2054
|
let n = /* @__PURE__ */ Object.create(null);
|
|
2055
2055
|
for (let i in this.nodes) {
|
|
2056
2056
|
if (i in this.marks)
|
|
@@ -2126,10 +2126,10 @@ function fr(r, e) {
|
|
|
2126
2126
|
}
|
|
2127
2127
|
return t;
|
|
2128
2128
|
}
|
|
2129
|
-
function
|
|
2129
|
+
function lo(r) {
|
|
2130
2130
|
return r.tag != null;
|
|
2131
2131
|
}
|
|
2132
|
-
function
|
|
2132
|
+
function ao(r) {
|
|
2133
2133
|
return r.style != null;
|
|
2134
2134
|
}
|
|
2135
2135
|
class ke {
|
|
@@ -2141,9 +2141,9 @@ class ke {
|
|
|
2141
2141
|
this.schema = e, this.rules = t, this.tags = [], this.styles = [];
|
|
2142
2142
|
let n = this.matchedStyles = [];
|
|
2143
2143
|
t.forEach((i) => {
|
|
2144
|
-
if (
|
|
2144
|
+
if (lo(i))
|
|
2145
2145
|
this.tags.push(i);
|
|
2146
|
-
else if (
|
|
2146
|
+
else if (ao(i)) {
|
|
2147
2147
|
let s = /[^=]*/.exec(i.style)[0];
|
|
2148
2148
|
n.indexOf(s) < 0 && n.push(s), this.styles.push(i);
|
|
2149
2149
|
}
|
|
@@ -2179,7 +2179,7 @@ class ke {
|
|
|
2179
2179
|
matchTag(e, t, n) {
|
|
2180
2180
|
for (let i = n ? this.tags.indexOf(n) + 1 : 0; i < this.tags.length; i++) {
|
|
2181
2181
|
let s = this.tags[i];
|
|
2182
|
-
if (
|
|
2182
|
+
if (ho(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
|
|
2183
2183
|
if (s.getAttrs) {
|
|
2184
2184
|
let o = s.getAttrs(e);
|
|
2185
2185
|
if (o === !1)
|
|
@@ -2280,7 +2280,7 @@ const Ei = {
|
|
|
2280
2280
|
table: !0,
|
|
2281
2281
|
tfoot: !0,
|
|
2282
2282
|
ul: !0
|
|
2283
|
-
},
|
|
2283
|
+
}, co = {
|
|
2284
2284
|
head: !0,
|
|
2285
2285
|
noscript: !0,
|
|
2286
2286
|
object: !0,
|
|
@@ -2367,9 +2367,9 @@ class hr {
|
|
|
2367
2367
|
let i = this.localPreserveWS, s = this.top;
|
|
2368
2368
|
(e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
|
|
2369
2369
|
let o = e.nodeName.toLowerCase(), l;
|
|
2370
|
-
Di.hasOwnProperty(o) && this.parser.normalizeLists &&
|
|
2370
|
+
Di.hasOwnProperty(o) && this.parser.normalizeLists && fo(e);
|
|
2371
2371
|
let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, n));
|
|
2372
|
-
e: if (a ? a.ignore :
|
|
2372
|
+
e: if (a ? a.ignore : co.hasOwnProperty(o))
|
|
2373
2373
|
this.findInside(e), this.ignoreFallback(e, t);
|
|
2374
2374
|
else if (!a || a.skip || a.closeParent) {
|
|
2375
2375
|
a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
|
|
@@ -2606,13 +2606,13 @@ class hr {
|
|
|
2606
2606
|
}
|
|
2607
2607
|
}
|
|
2608
2608
|
}
|
|
2609
|
-
function
|
|
2609
|
+
function fo(r) {
|
|
2610
2610
|
for (let e = r.firstChild, t = null; e; e = e.nextSibling) {
|
|
2611
2611
|
let n = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
|
|
2612
2612
|
n && Di.hasOwnProperty(n) && t ? (t.appendChild(e), e = t) : n == "li" ? t = e : n && (t = null);
|
|
2613
2613
|
}
|
|
2614
2614
|
}
|
|
2615
|
-
function
|
|
2615
|
+
function ho(r, e) {
|
|
2616
2616
|
return (r.matches || r.msMatchesSelector || r.webkitMatchesSelector || r.mozMatchesSelector).call(r, e);
|
|
2617
2617
|
}
|
|
2618
2618
|
function ur(r) {
|
|
@@ -2755,11 +2755,11 @@ function rn(r) {
|
|
|
2755
2755
|
return r.document || window.document;
|
|
2756
2756
|
}
|
|
2757
2757
|
const gr = /* @__PURE__ */ new WeakMap();
|
|
2758
|
-
function
|
|
2758
|
+
function uo(r) {
|
|
2759
2759
|
let e = gr.get(r);
|
|
2760
|
-
return e === void 0 && gr.set(r, e =
|
|
2760
|
+
return e === void 0 && gr.set(r, e = po(r)), e;
|
|
2761
2761
|
}
|
|
2762
|
-
function
|
|
2762
|
+
function po(r) {
|
|
2763
2763
|
let e = null;
|
|
2764
2764
|
function t(n) {
|
|
2765
2765
|
if (n && typeof n == "object")
|
|
@@ -2785,7 +2785,7 @@ function Tt(r, e, t, n) {
|
|
|
2785
2785
|
let i = e[0], s;
|
|
2786
2786
|
if (typeof i != "string")
|
|
2787
2787
|
throw new RangeError("Invalid array passed to renderSpec");
|
|
2788
|
-
if (n && (s =
|
|
2788
|
+
if (n && (s = uo(n)) && s.indexOf(e) > -1)
|
|
2789
2789
|
throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
|
|
2790
2790
|
let o = i.indexOf(" ");
|
|
2791
2791
|
o > 0 && (t = i.slice(0, o), i = i.slice(o + 1));
|
|
@@ -2816,13 +2816,13 @@ function Tt(r, e, t, n) {
|
|
|
2816
2816
|
return { dom: a, contentDOM: l };
|
|
2817
2817
|
}
|
|
2818
2818
|
const Ai = 65535, Ii = Math.pow(2, 16);
|
|
2819
|
-
function
|
|
2819
|
+
function mo(r, e) {
|
|
2820
2820
|
return r + e * Ii;
|
|
2821
2821
|
}
|
|
2822
2822
|
function yr(r) {
|
|
2823
2823
|
return r & Ai;
|
|
2824
2824
|
}
|
|
2825
|
-
function
|
|
2825
|
+
function go(r) {
|
|
2826
2826
|
return (r - (r & Ai)) / Ii;
|
|
2827
2827
|
}
|
|
2828
2828
|
const Ri = 1, Pi = 2, Et = 4, vi = 8;
|
|
@@ -2880,7 +2880,7 @@ class _ {
|
|
|
2880
2880
|
if (!this.inverted)
|
|
2881
2881
|
for (let i = 0; i < n; i++)
|
|
2882
2882
|
t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
|
|
2883
|
-
return this.ranges[n * 3] + t +
|
|
2883
|
+
return this.ranges[n * 3] + t + go(e);
|
|
2884
2884
|
}
|
|
2885
2885
|
mapResult(e, t = 1) {
|
|
2886
2886
|
return this._map(e, t, !1);
|
|
@@ -2902,7 +2902,7 @@ class _ {
|
|
|
2902
2902
|
let h = c ? e == a ? -1 : e == d ? 1 : t : t, u = a + i + (h < 0 ? 0 : f);
|
|
2903
2903
|
if (n)
|
|
2904
2904
|
return u;
|
|
2905
|
-
let p = e == (t < 0 ? a : d) ? null :
|
|
2905
|
+
let p = e == (t < 0 ? a : d) ? null : mo(l / 3, e - a), m = e == a ? Pi : e == d ? Ri : Et;
|
|
2906
2906
|
return (t < 0 ? e != a : e != d) && (m |= vi), new On(u, m, p);
|
|
2907
2907
|
}
|
|
2908
2908
|
i += f - c;
|
|
@@ -3067,7 +3067,7 @@ class Bt {
|
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
3069
|
const sn = /* @__PURE__ */ Object.create(null);
|
|
3070
|
-
class
|
|
3070
|
+
class K {
|
|
3071
3071
|
/**
|
|
3072
3072
|
Get the step map that represents the changes made by this step,
|
|
3073
3073
|
and which can be used to transform between positions in the old
|
|
@@ -3150,7 +3150,7 @@ function Wn(r, e, t) {
|
|
|
3150
3150
|
}
|
|
3151
3151
|
return b.fromArray(n);
|
|
3152
3152
|
}
|
|
3153
|
-
class me extends
|
|
3153
|
+
class me extends K {
|
|
3154
3154
|
/**
|
|
3155
3155
|
Create a mark step.
|
|
3156
3156
|
*/
|
|
@@ -3188,8 +3188,8 @@ class me extends q {
|
|
|
3188
3188
|
return new me(t.from, t.to, e.markFromJSON(t.mark));
|
|
3189
3189
|
}
|
|
3190
3190
|
}
|
|
3191
|
-
|
|
3192
|
-
class re extends
|
|
3191
|
+
K.jsonID("addMark", me);
|
|
3192
|
+
class re extends K {
|
|
3193
3193
|
/**
|
|
3194
3194
|
Create a mark-removing step.
|
|
3195
3195
|
*/
|
|
@@ -3227,8 +3227,8 @@ class re extends q {
|
|
|
3227
3227
|
return new re(t.from, t.to, e.markFromJSON(t.mark));
|
|
3228
3228
|
}
|
|
3229
3229
|
}
|
|
3230
|
-
|
|
3231
|
-
class ge extends
|
|
3230
|
+
K.jsonID("removeMark", re);
|
|
3231
|
+
class ge extends K {
|
|
3232
3232
|
/**
|
|
3233
3233
|
Create a node mark step.
|
|
3234
3234
|
*/
|
|
@@ -3271,8 +3271,8 @@ class ge extends q {
|
|
|
3271
3271
|
return new ge(t.pos, e.markFromJSON(t.mark));
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
|
-
|
|
3275
|
-
class ve extends
|
|
3274
|
+
K.jsonID("addNodeMark", ge);
|
|
3275
|
+
class ve extends K {
|
|
3276
3276
|
/**
|
|
3277
3277
|
Create a mark-removing step.
|
|
3278
3278
|
*/
|
|
@@ -3306,8 +3306,8 @@ class ve extends q {
|
|
|
3306
3306
|
return new ve(t.pos, e.markFromJSON(t.mark));
|
|
3307
3307
|
}
|
|
3308
3308
|
}
|
|
3309
|
-
|
|
3310
|
-
class B extends
|
|
3309
|
+
K.jsonID("removeNodeMark", ve);
|
|
3310
|
+
class B extends K {
|
|
3311
3311
|
/**
|
|
3312
3312
|
The given `slice` should fit the 'gap' between `from` and
|
|
3313
3313
|
`to`—the depths must line up, and the surrounding nodes must be
|
|
@@ -3358,8 +3358,8 @@ class B extends q {
|
|
|
3358
3358
|
return new B(t.from, t.to, k.fromJSON(e, t.slice), !!t.structure);
|
|
3359
3359
|
}
|
|
3360
3360
|
}
|
|
3361
|
-
|
|
3362
|
-
class
|
|
3361
|
+
K.jsonID("replace", B);
|
|
3362
|
+
class F extends K {
|
|
3363
3363
|
/**
|
|
3364
3364
|
Create a replace-around step with the given range and gap.
|
|
3365
3365
|
`insert` should be the point in the slice into which the content
|
|
@@ -3390,11 +3390,11 @@ class z extends q {
|
|
|
3390
3390
|
}
|
|
3391
3391
|
invert(e) {
|
|
3392
3392
|
let t = this.gapTo - this.gapFrom;
|
|
3393
|
-
return new
|
|
3393
|
+
return new F(this.from, this.from + this.slice.size + t, this.from + this.insert, this.from + this.insert + t, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
|
|
3394
3394
|
}
|
|
3395
3395
|
map(e) {
|
|
3396
3396
|
let t = e.mapResult(this.from, 1), n = e.mapResult(this.to, -1), i = this.from == this.gapFrom ? t.pos : e.map(this.gapFrom, -1), s = this.to == this.gapTo ? n.pos : e.map(this.gapTo, 1);
|
|
3397
|
-
return t.deletedAcross && n.deletedAcross || i < t.pos || s > n.pos ? null : new
|
|
3397
|
+
return t.deletedAcross && n.deletedAcross || i < t.pos || s > n.pos ? null : new F(t.pos, n.pos, i, s, this.slice, this.insert, this.structure);
|
|
3398
3398
|
}
|
|
3399
3399
|
toJSON() {
|
|
3400
3400
|
let e = {
|
|
@@ -3413,10 +3413,10 @@ class z extends q {
|
|
|
3413
3413
|
static fromJSON(e, t) {
|
|
3414
3414
|
if (typeof t.from != "number" || typeof t.to != "number" || typeof t.gapFrom != "number" || typeof t.gapTo != "number" || typeof t.insert != "number")
|
|
3415
3415
|
throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
|
|
3416
|
-
return new
|
|
3416
|
+
return new F(t.from, t.to, t.gapFrom, t.gapTo, k.fromJSON(e, t.slice), t.insert, !!t.structure);
|
|
3417
3417
|
}
|
|
3418
3418
|
}
|
|
3419
|
-
|
|
3419
|
+
K.jsonID("replaceAround", F);
|
|
3420
3420
|
function Nn(r, e, t) {
|
|
3421
3421
|
let n = r.resolve(e), i = t - e, s = n.depth;
|
|
3422
3422
|
for (; i > 0 && s > 0 && n.indexAfter(s) == n.node(s).childCount; )
|
|
@@ -3431,7 +3431,7 @@ function Nn(r, e, t) {
|
|
|
3431
3431
|
}
|
|
3432
3432
|
return !1;
|
|
3433
3433
|
}
|
|
3434
|
-
function
|
|
3434
|
+
function yo(r, e, t, n) {
|
|
3435
3435
|
let i = [], s = [], o, l;
|
|
3436
3436
|
r.doc.nodesBetween(e, t, (a, c, f) => {
|
|
3437
3437
|
if (!a.isInline)
|
|
@@ -3445,7 +3445,7 @@ function go(r, e, t, n) {
|
|
|
3445
3445
|
}
|
|
3446
3446
|
}), i.forEach((a) => r.step(a)), s.forEach((a) => r.step(a));
|
|
3447
3447
|
}
|
|
3448
|
-
function
|
|
3448
|
+
function bo(r, e, t, n) {
|
|
3449
3449
|
let i = [], s = 0;
|
|
3450
3450
|
r.doc.nodesBetween(e, t, (o, l) => {
|
|
3451
3451
|
if (!o.isInline)
|
|
@@ -3495,7 +3495,7 @@ function Jn(r, e, t, n = t.contentMatch, i = !0) {
|
|
|
3495
3495
|
for (let a = o.length - 1; a >= 0; a--)
|
|
3496
3496
|
r.step(o[a]);
|
|
3497
3497
|
}
|
|
3498
|
-
function
|
|
3498
|
+
function ko(r, e, t) {
|
|
3499
3499
|
return (e == 0 || r.canReplace(e, r.childCount)) && (t == r.childCount || r.canReplace(0, t));
|
|
3500
3500
|
}
|
|
3501
3501
|
function et(r) {
|
|
@@ -3504,36 +3504,36 @@ function et(r) {
|
|
|
3504
3504
|
let o = r.$from.node(n), l = r.$from.index(n) + i, a = r.$to.indexAfter(n) - s;
|
|
3505
3505
|
if (n < r.depth && o.canReplace(l, a, t))
|
|
3506
3506
|
return n;
|
|
3507
|
-
if (n == 0 || o.type.spec.isolating || !
|
|
3507
|
+
if (n == 0 || o.type.spec.isolating || !ko(o, l, a))
|
|
3508
3508
|
break;
|
|
3509
3509
|
l && (i = 1), a < o.childCount && (s = 1);
|
|
3510
3510
|
}
|
|
3511
3511
|
return null;
|
|
3512
3512
|
}
|
|
3513
|
-
function
|
|
3513
|
+
function xo(r, e, t) {
|
|
3514
3514
|
let { $from: n, $to: i, depth: s } = e, o = n.before(s + 1), l = i.after(s + 1), a = o, c = l, f = b.empty, d = 0;
|
|
3515
3515
|
for (let p = s, m = !1; p > t; p--)
|
|
3516
3516
|
m || n.index(p) > 0 ? (m = !0, f = b.from(n.node(p).copy(f)), d++) : a--;
|
|
3517
3517
|
let h = b.empty, u = 0;
|
|
3518
3518
|
for (let p = s, m = !1; p > t; p--)
|
|
3519
3519
|
m || i.after(p + 1) < i.end(p) ? (m = !0, h = b.from(i.node(p).copy(h)), u++) : c++;
|
|
3520
|
-
r.step(new
|
|
3520
|
+
r.step(new F(a, c, o, l, new k(f.append(h), d, u), f.size - d, !0));
|
|
3521
3521
|
}
|
|
3522
3522
|
function Bi(r, e, t = null, n = r) {
|
|
3523
|
-
let i =
|
|
3523
|
+
let i = So(r, e), s = i && Co(n, e);
|
|
3524
3524
|
return s ? i.map(br).concat({ type: e, attrs: t }).concat(s.map(br)) : null;
|
|
3525
3525
|
}
|
|
3526
3526
|
function br(r) {
|
|
3527
3527
|
return { type: r, attrs: null };
|
|
3528
3528
|
}
|
|
3529
|
-
function
|
|
3529
|
+
function So(r, e) {
|
|
3530
3530
|
let { parent: t, startIndex: n, endIndex: i } = r, s = t.contentMatchAt(n).findWrapping(e);
|
|
3531
3531
|
if (!s)
|
|
3532
3532
|
return null;
|
|
3533
3533
|
let o = s.length ? s[0] : e;
|
|
3534
3534
|
return t.canReplaceWith(n, i, o) ? s : null;
|
|
3535
3535
|
}
|
|
3536
|
-
function
|
|
3536
|
+
function Co(r, e) {
|
|
3537
3537
|
let { parent: t, startIndex: n, endIndex: i } = r, s = t.child(n), o = e.contentMatch.findWrapping(s.type);
|
|
3538
3538
|
if (!o)
|
|
3539
3539
|
return null;
|
|
@@ -3542,7 +3542,7 @@ function So(r, e) {
|
|
|
3542
3542
|
a = a.matchType(t.child(c).type);
|
|
3543
3543
|
return !a || !a.validEnd ? null : o;
|
|
3544
3544
|
}
|
|
3545
|
-
function
|
|
3545
|
+
function Mo(r, e, t) {
|
|
3546
3546
|
let n = b.empty;
|
|
3547
3547
|
for (let o = t.length - 1; o >= 0; o--) {
|
|
3548
3548
|
if (n.size) {
|
|
@@ -3553,15 +3553,15 @@ function Co(r, e, t) {
|
|
|
3553
3553
|
n = b.from(t[o].type.create(t[o].attrs, n));
|
|
3554
3554
|
}
|
|
3555
3555
|
let i = e.start, s = e.end;
|
|
3556
|
-
r.step(new
|
|
3556
|
+
r.step(new F(i, s, i, s, new k(n, 0, 0), t.length, !0));
|
|
3557
3557
|
}
|
|
3558
|
-
function
|
|
3558
|
+
function wo(r, e, t, n, i) {
|
|
3559
3559
|
if (!n.isTextblock)
|
|
3560
3560
|
throw new RangeError("Type given to setBlockType should be a textblock");
|
|
3561
3561
|
let s = r.steps.length;
|
|
3562
3562
|
r.doc.nodesBetween(e, t, (o, l) => {
|
|
3563
3563
|
let a = typeof i == "function" ? i(o) : i;
|
|
3564
|
-
if (o.isTextblock && !o.hasMarkup(n, a) &&
|
|
3564
|
+
if (o.isTextblock && !o.hasMarkup(n, a) && Oo(r.doc, r.mapping.slice(s).map(l), n)) {
|
|
3565
3565
|
let c = null;
|
|
3566
3566
|
if (n.schema.linebreakReplacement) {
|
|
3567
3567
|
let u = n.whitespace == "pre", p = !!n.contentMatch.matchType(n.schema.linebreakReplacement);
|
|
@@ -3569,7 +3569,7 @@ function Mo(r, e, t, n, i) {
|
|
|
3569
3569
|
}
|
|
3570
3570
|
c === !1 && Fi(r, o, l, s), Jn(r, r.mapping.slice(s).map(l, 1), n, void 0, c === null);
|
|
3571
3571
|
let f = r.mapping.slice(s), d = f.map(l, 1), h = f.map(l + o.nodeSize, 1);
|
|
3572
|
-
return r.step(new
|
|
3572
|
+
return r.step(new F(d, h, d + 1, h - 1, new k(b.from(n.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && zi(r, o, l, s), !1;
|
|
3573
3573
|
}
|
|
3574
3574
|
});
|
|
3575
3575
|
}
|
|
@@ -3593,11 +3593,11 @@ function Fi(r, e, t, n) {
|
|
|
3593
3593
|
}
|
|
3594
3594
|
});
|
|
3595
3595
|
}
|
|
3596
|
-
function
|
|
3596
|
+
function Oo(r, e, t) {
|
|
3597
3597
|
let n = r.resolve(e), i = n.index();
|
|
3598
3598
|
return n.parent.canReplaceWith(i, i + 1, t);
|
|
3599
3599
|
}
|
|
3600
|
-
function
|
|
3600
|
+
function No(r, e, t, n, i) {
|
|
3601
3601
|
let s = r.doc.nodeAt(e);
|
|
3602
3602
|
if (!s)
|
|
3603
3603
|
throw new RangeError("No node at given position");
|
|
@@ -3607,7 +3607,7 @@ function Oo(r, e, t, n, i) {
|
|
|
3607
3607
|
return r.replaceWith(e, e + s.nodeSize, o);
|
|
3608
3608
|
if (!t.validContent(s.content))
|
|
3609
3609
|
throw new RangeError("Invalid content for node type " + t.name);
|
|
3610
|
-
r.step(new
|
|
3610
|
+
r.step(new F(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new k(b.from(o), 0, 0), 1, !0));
|
|
3611
3611
|
}
|
|
3612
3612
|
function Ue(r, e, t = 1, n) {
|
|
3613
3613
|
let i = r.resolve(e), s = i.depth - t, o = n && n[n.length - 1] || i.parent;
|
|
@@ -3626,7 +3626,7 @@ function Ue(r, e, t = 1, n) {
|
|
|
3626
3626
|
let l = i.indexAfter(s), a = n && n[0];
|
|
3627
3627
|
return i.node(s).canReplaceWith(l, l, a ? a.type : i.node(s + 1).type);
|
|
3628
3628
|
}
|
|
3629
|
-
function
|
|
3629
|
+
function To(r, e, t = 1, n) {
|
|
3630
3630
|
let i = r.doc.resolve(e), s = b.empty, o = b.empty;
|
|
3631
3631
|
for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
|
|
3632
3632
|
s = b.from(i.node(l).copy(s));
|
|
@@ -3639,7 +3639,7 @@ function Ve(r, e) {
|
|
|
3639
3639
|
let t = r.resolve(e), n = t.index();
|
|
3640
3640
|
return Vi(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(n, n + 1);
|
|
3641
3641
|
}
|
|
3642
|
-
function
|
|
3642
|
+
function Eo(r, e) {
|
|
3643
3643
|
e.content.size || r.type.compatibleContent(e.type);
|
|
3644
3644
|
let t = r.contentMatchAt(r.childCount), { linebreakReplacement: n } = r.type.schema;
|
|
3645
3645
|
for (let i = 0; i < e.childCount; i++) {
|
|
@@ -3650,7 +3650,7 @@ function To(r, e) {
|
|
|
3650
3650
|
return t.validEnd;
|
|
3651
3651
|
}
|
|
3652
3652
|
function Vi(r, e) {
|
|
3653
|
-
return !!(r && e && !r.isLeaf &&
|
|
3653
|
+
return !!(r && e && !r.isLeaf && Eo(r, e));
|
|
3654
3654
|
}
|
|
3655
3655
|
function Kt(r, e, t = -1) {
|
|
3656
3656
|
let n = r.resolve(e);
|
|
@@ -3663,7 +3663,7 @@ function Kt(r, e, t = -1) {
|
|
|
3663
3663
|
e = t < 0 ? n.before(i) : n.after(i);
|
|
3664
3664
|
}
|
|
3665
3665
|
}
|
|
3666
|
-
function
|
|
3666
|
+
function Do(r, e, t) {
|
|
3667
3667
|
let n = null, { linebreakReplacement: i } = r.doc.type.schema, s = r.doc.resolve(e - t), o = s.node().type;
|
|
3668
3668
|
if (i && o.inlineContent) {
|
|
3669
3669
|
let f = o.whitespace == "pre", d = !!o.contentMatch.matchType(i);
|
|
@@ -3682,7 +3682,7 @@ function Eo(r, e, t) {
|
|
|
3682
3682
|
}
|
|
3683
3683
|
return r;
|
|
3684
3684
|
}
|
|
3685
|
-
function
|
|
3685
|
+
function Ao(r, e, t) {
|
|
3686
3686
|
let n = r.resolve(e);
|
|
3687
3687
|
if (n.parent.canReplaceWith(n.index(), n.index(), t))
|
|
3688
3688
|
return e;
|
|
@@ -3704,7 +3704,7 @@ function Do(r, e, t) {
|
|
|
3704
3704
|
}
|
|
3705
3705
|
return null;
|
|
3706
3706
|
}
|
|
3707
|
-
function
|
|
3707
|
+
function Io(r, e, t) {
|
|
3708
3708
|
let n = r.resolve(e);
|
|
3709
3709
|
if (!t.content.size)
|
|
3710
3710
|
return e;
|
|
@@ -3729,12 +3729,12 @@ function Ht(r, e, t = e, n = k.empty) {
|
|
|
3729
3729
|
if (e == t && !n.size)
|
|
3730
3730
|
return null;
|
|
3731
3731
|
let i = r.resolve(e), s = r.resolve(t);
|
|
3732
|
-
return Li(i, s, n) ? new B(e, t, n) : new
|
|
3732
|
+
return Li(i, s, n) ? new B(e, t, n) : new Ro(i, s, n).fit();
|
|
3733
3733
|
}
|
|
3734
3734
|
function Li(r, e, t) {
|
|
3735
3735
|
return !t.openStart && !t.openEnd && r.start() == e.start() && r.parent.canReplace(r.index(), e.index(), t.content);
|
|
3736
3736
|
}
|
|
3737
|
-
class
|
|
3737
|
+
class Ro {
|
|
3738
3738
|
constructor(e, t, n) {
|
|
3739
3739
|
this.$from = e, this.$to = t, this.unplaced = n, this.frontier = [], this.placed = b.empty;
|
|
3740
3740
|
for (let i = 0; i <= e.depth; i++) {
|
|
@@ -3762,7 +3762,7 @@ class Io {
|
|
|
3762
3762
|
for (; o && l && s.childCount == 1; )
|
|
3763
3763
|
s = s.firstChild.content, o--, l--;
|
|
3764
3764
|
let a = new k(s, o, l);
|
|
3765
|
-
return e > -1 ? new
|
|
3765
|
+
return e > -1 ? new F(n.pos, e, this.$to.pos, this.$to.end(), a, t) : a.size || n.pos != this.$to.pos ? new B(n.pos, i.pos, a) : null;
|
|
3766
3766
|
}
|
|
3767
3767
|
// Find a position on the start spine of `this.unplaced` that has
|
|
3768
3768
|
// content that can be moved somewhere on the frontier. Returns two
|
|
@@ -3903,18 +3903,18 @@ function ln(r, e, t, n, i) {
|
|
|
3903
3903
|
if (o == s.childCount && !t.compatibleContent(s.type))
|
|
3904
3904
|
return null;
|
|
3905
3905
|
let l = n.fillBefore(s.content, !0, o);
|
|
3906
|
-
return l && !
|
|
3906
|
+
return l && !Po(t, s.content, o) ? l : null;
|
|
3907
3907
|
}
|
|
3908
|
-
function
|
|
3908
|
+
function Po(r, e, t) {
|
|
3909
3909
|
for (let n = t; n < e.childCount; n++)
|
|
3910
3910
|
if (!r.allowsMarks(e.child(n).marks))
|
|
3911
3911
|
return !0;
|
|
3912
3912
|
return !1;
|
|
3913
3913
|
}
|
|
3914
|
-
function
|
|
3914
|
+
function vo(r) {
|
|
3915
3915
|
return r.spec.defining || r.spec.definingForContent;
|
|
3916
3916
|
}
|
|
3917
|
-
function
|
|
3917
|
+
function Bo(r, e, t, n) {
|
|
3918
3918
|
if (!n.size)
|
|
3919
3919
|
return r.deleteRange(e, t);
|
|
3920
3920
|
let i = r.doc.resolve(e), s = r.doc.resolve(t);
|
|
@@ -3938,7 +3938,7 @@ function vo(r, e, t, n) {
|
|
|
3938
3938
|
h = p.content;
|
|
3939
3939
|
}
|
|
3940
3940
|
for (let h = f - 1; h >= 0; h--) {
|
|
3941
|
-
let u = c[h], p =
|
|
3941
|
+
let u = c[h], p = vo(u.type);
|
|
3942
3942
|
if (p && !u.sameMarkup(i.node(Math.abs(l) - 1)))
|
|
3943
3943
|
f = h;
|
|
3944
3944
|
else if (p || !u.type.isTextblock)
|
|
@@ -3950,8 +3950,8 @@ function vo(r, e, t, n) {
|
|
|
3950
3950
|
for (let m = 0; m < o.length; m++) {
|
|
3951
3951
|
let g = o[(m + a) % o.length], y = !0;
|
|
3952
3952
|
g < 0 && (y = !1, g = -g);
|
|
3953
|
-
let
|
|
3954
|
-
if (
|
|
3953
|
+
let w = i.node(g - 1), C = i.index(g - 1);
|
|
3954
|
+
if (w.canReplaceWith(C, C, p.type, p.marks))
|
|
3955
3955
|
return r.replace(i.before(g), y ? s.after(g) : t, new k(Wi(n.content, 0, n.openStart, u), u, n.openEnd));
|
|
3956
3956
|
}
|
|
3957
3957
|
}
|
|
@@ -3972,14 +3972,14 @@ function Wi(r, e, t, n, i) {
|
|
|
3972
3972
|
}
|
|
3973
3973
|
return r;
|
|
3974
3974
|
}
|
|
3975
|
-
function
|
|
3975
|
+
function zo(r, e, t, n) {
|
|
3976
3976
|
if (!n.isInline && e == t && r.doc.resolve(e).parent.content.size) {
|
|
3977
|
-
let i =
|
|
3977
|
+
let i = Ao(r.doc, e, n.type);
|
|
3978
3978
|
i != null && (e = t = i);
|
|
3979
3979
|
}
|
|
3980
3980
|
r.replaceRange(e, t, new k(b.from(n), 0, 0));
|
|
3981
3981
|
}
|
|
3982
|
-
function
|
|
3982
|
+
function Fo(r, e, t) {
|
|
3983
3983
|
let n = r.doc.resolve(e), i = r.doc.resolve(t), s = Ji(n, i);
|
|
3984
3984
|
for (let o = 0; o < s.length; o++) {
|
|
3985
3985
|
let l = s[o], a = o == s.length - 1;
|
|
@@ -4003,7 +4003,7 @@ function Ji(r, e) {
|
|
|
4003
4003
|
}
|
|
4004
4004
|
return t;
|
|
4005
4005
|
}
|
|
4006
|
-
class Ge extends
|
|
4006
|
+
class Ge extends K {
|
|
4007
4007
|
/**
|
|
4008
4008
|
Construct an attribute step.
|
|
4009
4009
|
*/
|
|
@@ -4040,8 +4040,8 @@ class Ge extends q {
|
|
|
4040
4040
|
return new Ge(t.pos, t.attr, t.value);
|
|
4041
4041
|
}
|
|
4042
4042
|
}
|
|
4043
|
-
|
|
4044
|
-
class dt extends
|
|
4043
|
+
K.jsonID("attr", Ge);
|
|
4044
|
+
class dt extends K {
|
|
4045
4045
|
/**
|
|
4046
4046
|
Construct an attribute step.
|
|
4047
4047
|
*/
|
|
@@ -4074,7 +4074,7 @@ class dt extends q {
|
|
|
4074
4074
|
return new dt(t.attr, t.value);
|
|
4075
4075
|
}
|
|
4076
4076
|
}
|
|
4077
|
-
|
|
4077
|
+
K.jsonID("docAttr", dt);
|
|
4078
4078
|
let Ye = class extends Error {
|
|
4079
4079
|
};
|
|
4080
4080
|
Ye = function r(e) {
|
|
@@ -4084,7 +4084,7 @@ Ye = function r(e) {
|
|
|
4084
4084
|
Ye.prototype = Object.create(Error.prototype);
|
|
4085
4085
|
Ye.prototype.constructor = Ye;
|
|
4086
4086
|
Ye.prototype.name = "TransformError";
|
|
4087
|
-
class
|
|
4087
|
+
class Vo {
|
|
4088
4088
|
/**
|
|
4089
4089
|
Create a transform that starts with the given document.
|
|
4090
4090
|
*/
|
|
@@ -4175,7 +4175,7 @@ class Fo {
|
|
|
4175
4175
|
control over what happens.
|
|
4176
4176
|
*/
|
|
4177
4177
|
replaceRange(e, t, n) {
|
|
4178
|
-
return
|
|
4178
|
+
return Bo(this, e, t, n), this;
|
|
4179
4179
|
}
|
|
4180
4180
|
/**
|
|
4181
4181
|
Replace the given range with a node, but use `from` and `to` as
|
|
@@ -4187,14 +4187,14 @@ class Fo {
|
|
|
4187
4187
|
that parent node.
|
|
4188
4188
|
*/
|
|
4189
4189
|
replaceRangeWith(e, t, n) {
|
|
4190
|
-
return
|
|
4190
|
+
return zo(this, e, t, n), this;
|
|
4191
4191
|
}
|
|
4192
4192
|
/**
|
|
4193
4193
|
Delete the given range, expanding it to cover fully covered
|
|
4194
4194
|
parent nodes until a valid replace is found.
|
|
4195
4195
|
*/
|
|
4196
4196
|
deleteRange(e, t) {
|
|
4197
|
-
return
|
|
4197
|
+
return Fo(this, e, t), this;
|
|
4198
4198
|
}
|
|
4199
4199
|
/**
|
|
4200
4200
|
Split the content in the given range off from its parent, if there
|
|
@@ -4204,14 +4204,14 @@ class Fo {
|
|
|
4204
4204
|
sure the lift is valid.
|
|
4205
4205
|
*/
|
|
4206
4206
|
lift(e, t) {
|
|
4207
|
-
return
|
|
4207
|
+
return xo(this, e, t), this;
|
|
4208
4208
|
}
|
|
4209
4209
|
/**
|
|
4210
4210
|
Join the blocks around the given position. If depth is 2, their
|
|
4211
4211
|
last and first siblings are also joined, and so on.
|
|
4212
4212
|
*/
|
|
4213
4213
|
join(e, t = 1) {
|
|
4214
|
-
return
|
|
4214
|
+
return Do(this, e, t), this;
|
|
4215
4215
|
}
|
|
4216
4216
|
/**
|
|
4217
4217
|
Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
|
|
@@ -4219,21 +4219,21 @@ class Fo {
|
|
|
4219
4219
|
probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
|
|
4220
4220
|
*/
|
|
4221
4221
|
wrap(e, t) {
|
|
4222
|
-
return
|
|
4222
|
+
return Mo(this, e, t), this;
|
|
4223
4223
|
}
|
|
4224
4224
|
/**
|
|
4225
4225
|
Set the type of all textblocks (partly) between `from` and `to` to
|
|
4226
4226
|
the given node type with the given attributes.
|
|
4227
4227
|
*/
|
|
4228
4228
|
setBlockType(e, t = e, n, i = null) {
|
|
4229
|
-
return
|
|
4229
|
+
return wo(this, e, t, n, i), this;
|
|
4230
4230
|
}
|
|
4231
4231
|
/**
|
|
4232
4232
|
Change the type, attributes, and/or marks of the node at `pos`.
|
|
4233
4233
|
When `type` isn't given, the existing node type is preserved,
|
|
4234
4234
|
*/
|
|
4235
4235
|
setNodeMarkup(e, t, n = null, i) {
|
|
4236
|
-
return
|
|
4236
|
+
return No(this, e, t, n, i), this;
|
|
4237
4237
|
}
|
|
4238
4238
|
/**
|
|
4239
4239
|
Set a single attribute on a given node to a new value.
|
|
@@ -4282,13 +4282,13 @@ class Fo {
|
|
|
4282
4282
|
use after the split (with the outermost nodes coming first).
|
|
4283
4283
|
*/
|
|
4284
4284
|
split(e, t = 1, n) {
|
|
4285
|
-
return
|
|
4285
|
+
return To(this, e, t, n), this;
|
|
4286
4286
|
}
|
|
4287
4287
|
/**
|
|
4288
4288
|
Add the given mark to the inline content between `from` and `to`.
|
|
4289
4289
|
*/
|
|
4290
4290
|
addMark(e, t, n) {
|
|
4291
|
-
return
|
|
4291
|
+
return yo(this, e, t, n), this;
|
|
4292
4292
|
}
|
|
4293
4293
|
/**
|
|
4294
4294
|
Remove marks from inline nodes between `from` and `to`. When
|
|
@@ -4297,7 +4297,7 @@ class Fo {
|
|
|
4297
4297
|
remove all marks of any type.
|
|
4298
4298
|
*/
|
|
4299
4299
|
removeMark(e, t, n) {
|
|
4300
|
-
return
|
|
4300
|
+
return bo(this, e, t, n), this;
|
|
4301
4301
|
}
|
|
4302
4302
|
/**
|
|
4303
4303
|
Removes all marks and nodes from the content of the node at
|
|
@@ -4317,7 +4317,7 @@ class N {
|
|
|
4317
4317
|
`$head`.
|
|
4318
4318
|
*/
|
|
4319
4319
|
constructor(e, t, n) {
|
|
4320
|
-
this.$anchor = e, this.$head = t, this.ranges = n || [new
|
|
4320
|
+
this.$anchor = e, this.$head = t, this.ranges = n || [new Lo(e.min(t), e.max(t))];
|
|
4321
4321
|
}
|
|
4322
4322
|
/**
|
|
4323
4323
|
The selection's anchor, as an unresolved position.
|
|
@@ -4475,7 +4475,7 @@ class N {
|
|
|
4475
4475
|
}
|
|
4476
4476
|
}
|
|
4477
4477
|
N.prototype.visible = !0;
|
|
4478
|
-
class
|
|
4478
|
+
class Lo {
|
|
4479
4479
|
/**
|
|
4480
4480
|
Create a range.
|
|
4481
4481
|
*/
|
|
@@ -4663,11 +4663,11 @@ class Z extends N {
|
|
|
4663
4663
|
return e instanceof Z;
|
|
4664
4664
|
}
|
|
4665
4665
|
getBookmark() {
|
|
4666
|
-
return
|
|
4666
|
+
return $o;
|
|
4667
4667
|
}
|
|
4668
4668
|
}
|
|
4669
4669
|
N.jsonID("all", Z);
|
|
4670
|
-
const
|
|
4670
|
+
const $o = {
|
|
4671
4671
|
map() {
|
|
4672
4672
|
return this;
|
|
4673
4673
|
},
|
|
@@ -4697,7 +4697,7 @@ function Sr(r, e, t) {
|
|
|
4697
4697
|
if (n < e)
|
|
4698
4698
|
return;
|
|
4699
4699
|
let i = r.steps[n];
|
|
4700
|
-
if (!(i instanceof B || i instanceof
|
|
4700
|
+
if (!(i instanceof B || i instanceof F))
|
|
4701
4701
|
return;
|
|
4702
4702
|
let s = r.mapping.maps[n], o;
|
|
4703
4703
|
s.forEach((l, a, c, f) => {
|
|
@@ -4705,7 +4705,7 @@ function Sr(r, e, t) {
|
|
|
4705
4705
|
}), r.setSelection(N.near(r.doc.resolve(o), t));
|
|
4706
4706
|
}
|
|
4707
4707
|
const Cr = 1, Ct = 2, Mr = 4;
|
|
4708
|
-
class
|
|
4708
|
+
class Wo extends Vo {
|
|
4709
4709
|
/**
|
|
4710
4710
|
@internal
|
|
4711
4711
|
*/
|
|
@@ -4864,7 +4864,7 @@ class it {
|
|
|
4864
4864
|
this.name = e, this.init = wr(t.init, n), this.apply = wr(t.apply, n);
|
|
4865
4865
|
}
|
|
4866
4866
|
}
|
|
4867
|
-
const
|
|
4867
|
+
const Jo = [
|
|
4868
4868
|
new it("doc", {
|
|
4869
4869
|
init(r) {
|
|
4870
4870
|
return r.doc || r.schema.topNodeType.createAndFill();
|
|
@@ -4900,7 +4900,7 @@ const Wo = [
|
|
|
4900
4900
|
];
|
|
4901
4901
|
class cn {
|
|
4902
4902
|
constructor(e, t) {
|
|
4903
|
-
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields =
|
|
4903
|
+
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Jo.slice(), t && t.forEach((n) => {
|
|
4904
4904
|
if (this.pluginsByKey[n.key])
|
|
4905
4905
|
throw new RangeError("Adding different instances of a keyed plugin (" + n.key + ")");
|
|
4906
4906
|
this.plugins.push(n), this.pluginsByKey[n.key] = n, n.spec.state && this.fields.push(new it(n.key, n.spec.state, n));
|
|
@@ -4993,7 +4993,7 @@ class Ke {
|
|
|
4993
4993
|
Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
|
|
4994
4994
|
*/
|
|
4995
4995
|
get tr() {
|
|
4996
|
-
return new
|
|
4996
|
+
return new Wo(this);
|
|
4997
4997
|
}
|
|
4998
4998
|
/**
|
|
4999
4999
|
Create a new state.
|
|
@@ -5118,7 +5118,7 @@ class Le {
|
|
|
5118
5118
|
return e[this.key];
|
|
5119
5119
|
}
|
|
5120
5120
|
}
|
|
5121
|
-
const
|
|
5121
|
+
const $ = function(r) {
|
|
5122
5122
|
for (var e = 0; ; e++)
|
|
5123
5123
|
if (r = r.previousSibling, !r)
|
|
5124
5124
|
return e;
|
|
@@ -5130,20 +5130,20 @@ let Tn = null;
|
|
|
5130
5130
|
const ae = function(r, e, t) {
|
|
5131
5131
|
let n = Tn || (Tn = document.createRange());
|
|
5132
5132
|
return n.setEnd(r, t ?? r.nodeValue.length), n.setStart(r, e || 0), n;
|
|
5133
|
-
},
|
|
5133
|
+
}, jo = function() {
|
|
5134
5134
|
Tn = null;
|
|
5135
5135
|
}, Be = function(r, e, t, n) {
|
|
5136
5136
|
return t && (Or(r, e, t, n, -1) || Or(r, e, t, n, 1));
|
|
5137
|
-
},
|
|
5137
|
+
}, qo = /^(img|br|input|textarea|hr)$/i;
|
|
5138
5138
|
function Or(r, e, t, n, i) {
|
|
5139
5139
|
for (var s; ; ) {
|
|
5140
5140
|
if (r == t && e == n)
|
|
5141
5141
|
return !0;
|
|
5142
5142
|
if (e == (i < 0 ? 0 : X(r))) {
|
|
5143
5143
|
let o = r.parentNode;
|
|
5144
|
-
if (!o || o.nodeType != 1 || yt(r) ||
|
|
5144
|
+
if (!o || o.nodeType != 1 || yt(r) || qo.test(r.nodeName) || r.contentEditable == "false")
|
|
5145
5145
|
return !1;
|
|
5146
|
-
e =
|
|
5146
|
+
e = $(r) + (i < 0 ? 0 : 1), r = o;
|
|
5147
5147
|
} else if (r.nodeType == 1) {
|
|
5148
5148
|
let o = r.childNodes[e + (i < 0 ? -1 : 0)];
|
|
5149
5149
|
if (o.nodeType == 1 && o.contentEditable == "false")
|
|
@@ -5160,7 +5160,7 @@ function Or(r, e, t, n, i) {
|
|
|
5160
5160
|
function X(r) {
|
|
5161
5161
|
return r.nodeType == 3 ? r.nodeValue.length : r.childNodes.length;
|
|
5162
5162
|
}
|
|
5163
|
-
function
|
|
5163
|
+
function Ko(r, e) {
|
|
5164
5164
|
for (; ; ) {
|
|
5165
5165
|
if (r.nodeType == 3 && e)
|
|
5166
5166
|
return r;
|
|
@@ -5169,12 +5169,12 @@ function qo(r, e) {
|
|
|
5169
5169
|
return null;
|
|
5170
5170
|
r = r.childNodes[e - 1], e = X(r);
|
|
5171
5171
|
} else if (r.parentNode && !yt(r))
|
|
5172
|
-
e =
|
|
5172
|
+
e = $(r), r = r.parentNode;
|
|
5173
5173
|
else
|
|
5174
5174
|
return null;
|
|
5175
5175
|
}
|
|
5176
5176
|
}
|
|
5177
|
-
function
|
|
5177
|
+
function Ho(r, e) {
|
|
5178
5178
|
for (; ; ) {
|
|
5179
5179
|
if (r.nodeType == 3 && e < r.nodeValue.length)
|
|
5180
5180
|
return r;
|
|
@@ -5183,16 +5183,16 @@ function Ko(r, e) {
|
|
|
5183
5183
|
return null;
|
|
5184
5184
|
r = r.childNodes[e], e = 0;
|
|
5185
5185
|
} else if (r.parentNode && !yt(r))
|
|
5186
|
-
e =
|
|
5186
|
+
e = $(r) + 1, r = r.parentNode;
|
|
5187
5187
|
else
|
|
5188
5188
|
return null;
|
|
5189
5189
|
}
|
|
5190
5190
|
}
|
|
5191
|
-
function
|
|
5191
|
+
function Uo(r, e, t) {
|
|
5192
5192
|
for (let n = e == 0, i = e == X(r); n || i; ) {
|
|
5193
5193
|
if (r == t)
|
|
5194
5194
|
return !0;
|
|
5195
|
-
let s =
|
|
5195
|
+
let s = $(r);
|
|
5196
5196
|
if (r = r.parentNode, !r)
|
|
5197
5197
|
return !1;
|
|
5198
5198
|
n = n && s == 0, i = i && s == X(r);
|
|
@@ -5211,13 +5211,13 @@ function Oe(r, e) {
|
|
|
5211
5211
|
let t = document.createEvent("Event");
|
|
5212
5212
|
return t.initEvent("keydown", !0, !0), t.keyCode = r, t.key = t.code = e, t;
|
|
5213
5213
|
}
|
|
5214
|
-
function
|
|
5214
|
+
function Go(r) {
|
|
5215
5215
|
let e = r.activeElement;
|
|
5216
5216
|
for (; e && e.shadowRoot; )
|
|
5217
5217
|
e = e.shadowRoot.activeElement;
|
|
5218
5218
|
return e;
|
|
5219
5219
|
}
|
|
5220
|
-
function
|
|
5220
|
+
function _o(r, e, t) {
|
|
5221
5221
|
if (r.caretPositionFromPoint)
|
|
5222
5222
|
try {
|
|
5223
5223
|
let n = r.caretPositionFromPoint(e, t);
|
|
@@ -5231,7 +5231,7 @@ function Go(r, e, t) {
|
|
|
5231
5231
|
return { node: n.startContainer, offset: Math.min(X(n.startContainer), n.startOffset) };
|
|
5232
5232
|
}
|
|
5233
5233
|
}
|
|
5234
|
-
const ie = typeof navigator < "u" ? navigator : null, Nr = typeof document < "u" ? document : null, $e = ie && ie.userAgent || "", En = /Edge\/(\d+)/.exec($e), Ki = /MSIE \d/.exec($e), Dn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($e), G = !!(Ki || Dn || En), xe = Ki ? document.documentMode : Dn ? +Dn[1] : En ? +En[1] : 0, te = !G && /gecko\/(\d+)/i.test($e), An = !G && /Chrome\/(\d+)/.exec($e),
|
|
5234
|
+
const ie = typeof navigator < "u" ? navigator : null, Nr = typeof document < "u" ? document : null, $e = ie && ie.userAgent || "", En = /Edge\/(\d+)/.exec($e), Ki = /MSIE \d/.exec($e), Dn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($e), G = !!(Ki || Dn || En), xe = Ki ? document.documentMode : Dn ? +Dn[1] : En ? +En[1] : 0, te = !G && /gecko\/(\d+)/i.test($e), An = !G && /Chrome\/(\d+)/.exec($e), z = !!An, Hi = An ? +An[1] : 0, q = !G && !!ie && /Apple Computer/.test(ie.vendor), Ze = q && (/Mobile\/\w+/.test($e) || !!ie && ie.maxTouchPoints > 2), Y = Ze || (ie ? /Mac/.test(ie.platform) : !1), Ui = ie ? /Win/.test(ie.platform) : !1, ce = /Android \d/.test($e), bt = !!Nr && "webkitFontSmoothing" in Nr.documentElement.style, Yo = bt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5235
5235
|
function Xo(r) {
|
|
5236
5236
|
let e = r.defaultView && r.defaultView.visualViewport;
|
|
5237
5237
|
return e ? {
|
|
@@ -5293,9 +5293,9 @@ function Qo(r) {
|
|
|
5293
5293
|
break;
|
|
5294
5294
|
}
|
|
5295
5295
|
}
|
|
5296
|
-
return { refDOM: n, refTop: i, stack:
|
|
5296
|
+
return { refDOM: n, refTop: i, stack: Gi(r.dom) };
|
|
5297
5297
|
}
|
|
5298
|
-
function
|
|
5298
|
+
function Gi(r) {
|
|
5299
5299
|
let e = [], t = r.ownerDocument;
|
|
5300
5300
|
for (let n = r; n && (e.push({ dom: n, top: n.scrollTop, left: n.scrollLeft }), r != t); n = Xe(n))
|
|
5301
5301
|
;
|
|
@@ -5303,9 +5303,9 @@ function Ui(r) {
|
|
|
5303
5303
|
}
|
|
5304
5304
|
function el({ refDOM: r, refTop: e, stack: t }) {
|
|
5305
5305
|
let n = r ? r.getBoundingClientRect().top : 0;
|
|
5306
|
-
|
|
5306
|
+
_i(t, n == 0 ? 0 : n - e);
|
|
5307
5307
|
}
|
|
5308
|
-
function
|
|
5308
|
+
function _i(r, e) {
|
|
5309
5309
|
for (let t = 0; t < r.length; t++) {
|
|
5310
5310
|
let { dom: n, top: i, left: s } = r[t];
|
|
5311
5311
|
n.scrollTop != i + e && (n.scrollTop = i + e), n.scrollLeft != s && (n.scrollLeft = s);
|
|
@@ -5317,14 +5317,14 @@ function tl(r) {
|
|
|
5317
5317
|
return r.setActive();
|
|
5318
5318
|
if (We)
|
|
5319
5319
|
return r.focus(We);
|
|
5320
|
-
let e =
|
|
5320
|
+
let e = Gi(r);
|
|
5321
5321
|
r.focus(We == null ? {
|
|
5322
5322
|
get preventScroll() {
|
|
5323
5323
|
return We = { preventScroll: !0 }, !0;
|
|
5324
5324
|
}
|
|
5325
|
-
} : void 0), We || (We = !1,
|
|
5325
|
+
} : void 0), We || (We = !1, _i(e, 0));
|
|
5326
5326
|
}
|
|
5327
|
-
function
|
|
5327
|
+
function Yi(r, e) {
|
|
5328
5328
|
let t, n = 2e8, i, s = 0, o = e.top, l = e.top, a, c;
|
|
5329
5329
|
for (let f = r.firstChild, d = 0; f; f = f.nextSibling, d++) {
|
|
5330
5330
|
let h;
|
|
@@ -5350,17 +5350,19 @@ function _i(r, e) {
|
|
|
5350
5350
|
!t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = d + 1);
|
|
5351
5351
|
}
|
|
5352
5352
|
}
|
|
5353
|
-
return !t && a && (t = a, i = c, n = 0), t && t.nodeType == 3 ? nl(t, i) : !t || n && t.nodeType == 1 ? { node: r, offset: s } :
|
|
5353
|
+
return !t && a && (t = a, i = c, n = 0), t && t.nodeType == 3 ? nl(t, i) : !t || n && t.nodeType == 1 ? { node: r, offset: s } : Yi(t, i);
|
|
5354
5354
|
}
|
|
5355
5355
|
function nl(r, e) {
|
|
5356
|
-
let t = r.nodeValue.length, n = document.createRange();
|
|
5357
|
-
for (let
|
|
5358
|
-
n.setEnd(r,
|
|
5359
|
-
let
|
|
5360
|
-
if (
|
|
5361
|
-
|
|
5356
|
+
let t = r.nodeValue.length, n = document.createRange(), i;
|
|
5357
|
+
for (let s = 0; s < t; s++) {
|
|
5358
|
+
n.setEnd(r, s + 1), n.setStart(r, s);
|
|
5359
|
+
let o = he(n, 1);
|
|
5360
|
+
if (o.top != o.bottom && qn(e, o)) {
|
|
5361
|
+
i = { node: r, offset: s + (e.left >= (o.left + o.right) / 2 ? 1 : 0) };
|
|
5362
|
+
break;
|
|
5363
|
+
}
|
|
5362
5364
|
}
|
|
5363
|
-
return { node: r, offset: 0 };
|
|
5365
|
+
return n.detach(), i || { node: r, offset: 0 };
|
|
5364
5366
|
}
|
|
5365
5367
|
function qn(r, e) {
|
|
5366
5368
|
return r.left >= e.left - 1 && r.left <= e.right + 1 && r.top >= e.top - 1 && r.top <= e.bottom + 1;
|
|
@@ -5370,7 +5372,7 @@ function rl(r, e) {
|
|
|
5370
5372
|
return t && /^li$/i.test(t.nodeName) && e.left < r.getBoundingClientRect().left ? t : r;
|
|
5371
5373
|
}
|
|
5372
5374
|
function il(r, e, t) {
|
|
5373
|
-
let { node: n, offset: i } =
|
|
5375
|
+
let { node: n, offset: i } = Yi(e, t), s = -1;
|
|
5374
5376
|
if (n.nodeType == 1 && !n.firstChild) {
|
|
5375
5377
|
let o = n.getBoundingClientRect();
|
|
5376
5378
|
s = o.left != o.right && t.left > (o.left + o.right) / 2 ? 1 : -1;
|
|
@@ -5390,7 +5392,7 @@ function sl(r, e, t, n) {
|
|
|
5390
5392
|
}
|
|
5391
5393
|
return i > -1 ? i : r.docView.posFromDOM(e, t, -1);
|
|
5392
5394
|
}
|
|
5393
|
-
function
|
|
5395
|
+
function Xi(r, e, t) {
|
|
5394
5396
|
let n = r.childNodes.length;
|
|
5395
5397
|
if (n && t.top < t.bottom)
|
|
5396
5398
|
for (let i = Math.max(0, Math.min(n - 1, Math.floor(n * (e.top - t.top) / (t.bottom - t.top)) - 2)), s = i; ; ) {
|
|
@@ -5400,7 +5402,7 @@ function Yi(r, e, t) {
|
|
|
5400
5402
|
for (let a = 0; a < l.length; a++) {
|
|
5401
5403
|
let c = l[a];
|
|
5402
5404
|
if (qn(e, c))
|
|
5403
|
-
return
|
|
5405
|
+
return Xi(o, e, c);
|
|
5404
5406
|
}
|
|
5405
5407
|
}
|
|
5406
5408
|
if ((s = (s + 1) % n) == i)
|
|
@@ -5409,15 +5411,15 @@ function Yi(r, e, t) {
|
|
|
5409
5411
|
return r;
|
|
5410
5412
|
}
|
|
5411
5413
|
function ol(r, e) {
|
|
5412
|
-
let t = r.dom.ownerDocument, n, i = 0, s =
|
|
5414
|
+
let t = r.dom.ownerDocument, n, i = 0, s = _o(t, e.left, e.top);
|
|
5413
5415
|
s && ({ node: n, offset: i } = s);
|
|
5414
5416
|
let o = (r.root.elementFromPoint ? r.root : t).elementFromPoint(e.left, e.top), l;
|
|
5415
5417
|
if (!o || !r.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
|
|
5416
5418
|
let c = r.dom.getBoundingClientRect();
|
|
5417
|
-
if (!qn(e, c) || (o =
|
|
5419
|
+
if (!qn(e, c) || (o = Xi(r.dom, e, c), !o))
|
|
5418
5420
|
return null;
|
|
5419
5421
|
}
|
|
5420
|
-
if (
|
|
5422
|
+
if (q)
|
|
5421
5423
|
for (let c = o; n && c; c = Xe(c))
|
|
5422
5424
|
c.draggable && (n = void 0);
|
|
5423
5425
|
if (o = rl(o, e), n) {
|
|
@@ -5445,7 +5447,7 @@ function he(r, e) {
|
|
|
5445
5447
|
return Array.prototype.find.call(t, Er) || r.getBoundingClientRect();
|
|
5446
5448
|
}
|
|
5447
5449
|
const ll = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
5448
|
-
function
|
|
5450
|
+
function Zi(r, e, t) {
|
|
5449
5451
|
let { node: n, offset: i, atom: s } = r.docView.domFromPos(e, t < 0 ? -1 : 1), o = bt || te;
|
|
5450
5452
|
if (n.nodeType == 3)
|
|
5451
5453
|
if (o && (ll.test(n.nodeValue) || (t < 0 ? !i : i == n.nodeValue.length))) {
|
|
@@ -5503,7 +5505,7 @@ function dn(r, e) {
|
|
|
5503
5505
|
let t = e ? r.top : r.bottom;
|
|
5504
5506
|
return { top: t, bottom: t, left: r.left, right: r.right };
|
|
5505
5507
|
}
|
|
5506
|
-
function
|
|
5508
|
+
function Qi(r, e, t) {
|
|
5507
5509
|
let n = r.state, i = r.root.activeElement;
|
|
5508
5510
|
n != e && r.updateState(e), i != r.dom && r.focus();
|
|
5509
5511
|
try {
|
|
@@ -5514,7 +5516,7 @@ function Zi(r, e, t) {
|
|
|
5514
5516
|
}
|
|
5515
5517
|
function al(r, e, t) {
|
|
5516
5518
|
let n = e.selection, i = t == "up" ? n.$from : n.$to;
|
|
5517
|
-
return
|
|
5519
|
+
return Qi(r, e, () => {
|
|
5518
5520
|
let { node: s } = r.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
|
|
5519
5521
|
for (; ; ) {
|
|
5520
5522
|
let l = r.docView.nearestDesc(s, !0);
|
|
@@ -5526,7 +5528,7 @@ function al(r, e, t) {
|
|
|
5526
5528
|
}
|
|
5527
5529
|
s = l.dom.parentNode;
|
|
5528
5530
|
}
|
|
5529
|
-
let o =
|
|
5531
|
+
let o = Zi(r, i.pos, 1);
|
|
5530
5532
|
for (let l = s.firstChild; l; l = l.nextSibling) {
|
|
5531
5533
|
let a;
|
|
5532
5534
|
if (l.nodeType == 1)
|
|
@@ -5550,7 +5552,7 @@ function fl(r, e, t) {
|
|
|
5550
5552
|
if (!n.parent.isTextblock)
|
|
5551
5553
|
return !1;
|
|
5552
5554
|
let i = n.parentOffset, s = !i, o = i == n.parent.content.size, l = r.domSelection();
|
|
5553
|
-
return l ? !cl.test(n.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o :
|
|
5555
|
+
return l ? !cl.test(n.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : Qi(r, e, () => {
|
|
5554
5556
|
let { focusNode: a, focusOffset: c, anchorNode: f, anchorOffset: d } = r.domSelectionRange(), h = l.caretBidiLevel;
|
|
5555
5557
|
l.modify("move", t, "character");
|
|
5556
5558
|
let u = n.depth ? r.docView.domAfterPos(n.before()) : r.dom, { focusNode: p, focusOffset: m } = r.domSelectionRange(), g = p && !u.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
|
|
@@ -5661,7 +5663,7 @@ class kt {
|
|
|
5661
5663
|
}
|
|
5662
5664
|
let i;
|
|
5663
5665
|
if (e == this.dom && this.contentDOM)
|
|
5664
|
-
i = t >
|
|
5666
|
+
i = t > $(this.contentDOM);
|
|
5665
5667
|
else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))
|
|
5666
5668
|
i = e.compareDocumentPosition(this.contentDOM) & 2;
|
|
5667
5669
|
else if (this.dom.firstChild) {
|
|
@@ -5737,7 +5739,7 @@ class kt {
|
|
|
5737
5739
|
let n = 0, i = 0;
|
|
5738
5740
|
for (let s = 0; n < this.children.length; n++) {
|
|
5739
5741
|
let o = this.children[n], l = s + o.size;
|
|
5740
|
-
if (l > e || o instanceof
|
|
5742
|
+
if (l > e || o instanceof ts) {
|
|
5741
5743
|
i = e - s;
|
|
5742
5744
|
break;
|
|
5743
5745
|
}
|
|
@@ -5745,18 +5747,18 @@ class kt {
|
|
|
5745
5747
|
}
|
|
5746
5748
|
if (i)
|
|
5747
5749
|
return this.children[n].domFromPos(i - this.children[n].border, t);
|
|
5748
|
-
for (let s; n && !(s = this.children[n - 1]).size && s instanceof
|
|
5750
|
+
for (let s; n && !(s = this.children[n - 1]).size && s instanceof es && s.side >= 0; n--)
|
|
5749
5751
|
;
|
|
5750
5752
|
if (t <= 0) {
|
|
5751
5753
|
let s, o = !0;
|
|
5752
5754
|
for (; s = n ? this.children[n - 1] : null, !(!s || s.dom.parentNode == this.contentDOM); n--, o = !1)
|
|
5753
5755
|
;
|
|
5754
|
-
return s && t && o && !s.border && !s.domAtom ? s.domFromPos(s.size, t) : { node: this.contentDOM, offset: s ?
|
|
5756
|
+
return s && t && o && !s.border && !s.domAtom ? s.domFromPos(s.size, t) : { node: this.contentDOM, offset: s ? $(s.dom) + 1 : 0 };
|
|
5755
5757
|
} else {
|
|
5756
5758
|
let s, o = !0;
|
|
5757
5759
|
for (; s = n < this.children.length ? this.children[n] : null, !(!s || s.dom.parentNode == this.contentDOM); n++, o = !1)
|
|
5758
5760
|
;
|
|
5759
|
-
return s && o && !s.border && !s.domAtom ? s.domFromPos(0, t) : { node: this.contentDOM, offset: s ?
|
|
5761
|
+
return s && o && !s.border && !s.domAtom ? s.domFromPos(0, t) : { node: this.contentDOM, offset: s ? $(s.dom) : this.contentDOM.childNodes.length };
|
|
5760
5762
|
}
|
|
5761
5763
|
}
|
|
5762
5764
|
// Used to find a DOM range in a single parent for a given changed
|
|
@@ -5775,7 +5777,7 @@ class kt {
|
|
|
5775
5777
|
for (let d = l; d > 0; d--) {
|
|
5776
5778
|
let h = this.children[d - 1];
|
|
5777
5779
|
if (h.size && h.dom.parentNode == this.contentDOM && !h.emptyChildAt(1)) {
|
|
5778
|
-
i =
|
|
5780
|
+
i = $(h.dom) + 1;
|
|
5779
5781
|
break;
|
|
5780
5782
|
}
|
|
5781
5783
|
e -= h.size;
|
|
@@ -5787,7 +5789,7 @@ class kt {
|
|
|
5787
5789
|
for (let f = l + 1; f < this.children.length; f++) {
|
|
5788
5790
|
let d = this.children[f];
|
|
5789
5791
|
if (d.size && d.dom.parentNode == this.contentDOM && !d.emptyChildAt(-1)) {
|
|
5790
|
-
s =
|
|
5792
|
+
s = $(d.dom);
|
|
5791
5793
|
break;
|
|
5792
5794
|
}
|
|
5793
5795
|
t += d.size;
|
|
@@ -5825,14 +5827,14 @@ class kt {
|
|
|
5825
5827
|
p = g;
|
|
5826
5828
|
}
|
|
5827
5829
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = n.root.getSelection(), f = n.domSelectionRange(), d = !1;
|
|
5828
|
-
if ((te ||
|
|
5830
|
+
if ((te || q) && e == t) {
|
|
5829
5831
|
let { node: u, offset: p } = l;
|
|
5830
5832
|
if (u.nodeType == 3) {
|
|
5831
5833
|
if (d = !!(p && u.nodeValue[p - 1] == `
|
|
5832
5834
|
`), d && p == u.nodeValue.length)
|
|
5833
5835
|
for (let m = u, g; m; m = m.parentNode) {
|
|
5834
5836
|
if (g = m.nextSibling) {
|
|
5835
|
-
g.nodeName == "BR" && (l = a = { node: g.parentNode, offset:
|
|
5837
|
+
g.nodeName == "BR" && (l = a = { node: g.parentNode, offset: $(g) + 1 });
|
|
5836
5838
|
break;
|
|
5837
5839
|
}
|
|
5838
5840
|
let y = m.pmViewDesc;
|
|
@@ -5848,7 +5850,7 @@ class kt {
|
|
|
5848
5850
|
let u = f.focusNode.childNodes[f.focusOffset];
|
|
5849
5851
|
u && u.contentEditable == "false" && (i = !0);
|
|
5850
5852
|
}
|
|
5851
|
-
if (!(i || d &&
|
|
5853
|
+
if (!(i || d && q) && Be(l.node, l.offset, f.anchorNode, f.anchorOffset) && Be(a.node, a.offset, f.focusNode, f.focusOffset))
|
|
5852
5854
|
return;
|
|
5853
5855
|
let h = !1;
|
|
5854
5856
|
if ((c.extend || e == t) && !(d && te)) {
|
|
@@ -5910,7 +5912,7 @@ class kt {
|
|
|
5910
5912
|
return !1;
|
|
5911
5913
|
}
|
|
5912
5914
|
}
|
|
5913
|
-
class
|
|
5915
|
+
class es extends kt {
|
|
5914
5916
|
constructor(e, t, n, i) {
|
|
5915
5917
|
let s, o = t.type.toDOM;
|
|
5916
5918
|
if (typeof o == "function" && (o = o(n, () => {
|
|
@@ -6034,7 +6036,7 @@ class Se extends kt {
|
|
|
6034
6036
|
} else f || ({ dom: f, contentDOM: d } = Fe.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
6035
6037
|
!d && !t.isText && f.nodeName != "BR" && (f.hasAttribute("contenteditable") || (f.contentEditable = "false"), t.type.spec.draggable && (f.draggable = !0));
|
|
6036
6038
|
let h = f;
|
|
6037
|
-
return f =
|
|
6039
|
+
return f = is(f, n, t), c ? a = new ul(e, t, n, i, f, d || null, h, c, s, o + 1) : t.isText ? new _t(e, t, n, i, f, h, s) : new Se(e, t, n, i, f, d || null, h, s, o + 1);
|
|
6038
6040
|
}
|
|
6039
6041
|
parseRule() {
|
|
6040
6042
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6077,7 +6079,7 @@ class Se extends kt {
|
|
|
6077
6079
|
a.syncToMarks(c.marks, n, e);
|
|
6078
6080
|
let u;
|
|
6079
6081
|
a.findNodeMatch(c, f, d, h) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (u = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, f, d, u, e) || a.updateNextNode(c, f, d, e, h, i) || a.addNode(c, f, d, e, i), i += c.nodeSize;
|
|
6080
|
-
}), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Te) && (o && this.protectLocalComposition(e, o),
|
|
6082
|
+
}), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Te) && (o && this.protectLocalComposition(e, o), ns(this.contentDOM, this.children, e), Ze && kl(this.dom));
|
|
6081
6083
|
}
|
|
6082
6084
|
localCompositionInfo(e, t) {
|
|
6083
6085
|
let { from: n, to: i } = e.state.selection;
|
|
@@ -6118,7 +6120,7 @@ class Se extends kt {
|
|
|
6118
6120
|
if (zt(e, this.outerDeco))
|
|
6119
6121
|
return;
|
|
6120
6122
|
let t = this.nodeDOM.nodeType != 1, n = this.dom;
|
|
6121
|
-
this.dom =
|
|
6123
|
+
this.dom = rs(this.dom, this.nodeDOM, In(this.outerDeco, this.node, t), In(e, this.node, t)), this.dom != n && (n.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
|
|
6122
6124
|
}
|
|
6123
6125
|
// Mark this node as being the selected node.
|
|
6124
6126
|
selectNode() {
|
|
@@ -6133,7 +6135,7 @@ class Se extends kt {
|
|
|
6133
6135
|
}
|
|
6134
6136
|
}
|
|
6135
6137
|
function Pr(r, e, t, n, i) {
|
|
6136
|
-
|
|
6138
|
+
is(n, e, r);
|
|
6137
6139
|
let s = new Se(void 0, r, e, t, n, n, n, i, 0);
|
|
6138
6140
|
return s.contentDOM && s.updateChildren(i, 0), s;
|
|
6139
6141
|
}
|
|
@@ -6180,7 +6182,7 @@ class _t extends Se {
|
|
|
6180
6182
|
return this.node.text == e;
|
|
6181
6183
|
}
|
|
6182
6184
|
}
|
|
6183
|
-
class
|
|
6185
|
+
class ts extends kt {
|
|
6184
6186
|
parseRule() {
|
|
6185
6187
|
return { ignore: !0 };
|
|
6186
6188
|
}
|
|
@@ -6228,7 +6230,7 @@ class ul extends Se {
|
|
|
6228
6230
|
return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
|
|
6229
6231
|
}
|
|
6230
6232
|
}
|
|
6231
|
-
function
|
|
6233
|
+
function ns(r, e, t) {
|
|
6232
6234
|
let n = r.firstChild, i = !1;
|
|
6233
6235
|
for (let s = 0; s < e.length; s++) {
|
|
6234
6236
|
let o = e[s], l = o.dom;
|
|
@@ -6240,7 +6242,7 @@ function ts(r, e, t) {
|
|
|
6240
6242
|
i = !0, r.insertBefore(l, n);
|
|
6241
6243
|
if (o instanceof ze) {
|
|
6242
6244
|
let a = n ? n.previousSibling : r.lastChild;
|
|
6243
|
-
|
|
6245
|
+
ns(o.contentDOM, o.children, t), n = a ? a.nextSibling : r.firstChild;
|
|
6244
6246
|
}
|
|
6245
6247
|
}
|
|
6246
6248
|
for (; n; )
|
|
@@ -6268,7 +6270,7 @@ function In(r, e, t) {
|
|
|
6268
6270
|
}
|
|
6269
6271
|
return i;
|
|
6270
6272
|
}
|
|
6271
|
-
function
|
|
6273
|
+
function rs(r, e, t, n) {
|
|
6272
6274
|
if (t == Ee && n == Ee)
|
|
6273
6275
|
return e;
|
|
6274
6276
|
let i = e;
|
|
@@ -6304,8 +6306,8 @@ function pl(r, e, t) {
|
|
|
6304
6306
|
t.style && (r.style.cssText += t.style);
|
|
6305
6307
|
}
|
|
6306
6308
|
}
|
|
6307
|
-
function
|
|
6308
|
-
return
|
|
6309
|
+
function is(r, e, t) {
|
|
6310
|
+
return rs(r, r, Ee, In(e, t, r.nodeType != 1));
|
|
6309
6311
|
}
|
|
6310
6312
|
function zt(r, e) {
|
|
6311
6313
|
if (r.length != e.length)
|
|
@@ -6442,7 +6444,7 @@ class ml {
|
|
|
6442
6444
|
if (i && i.matchesWidget(e) && (e == i.widget || !i.widget.type.toDOM.parentNode))
|
|
6443
6445
|
this.index++;
|
|
6444
6446
|
else {
|
|
6445
|
-
let s = new
|
|
6447
|
+
let s = new es(this.top, e, t, n);
|
|
6446
6448
|
this.top.children.splice(this.index++, 0, s), this.changed = !0;
|
|
6447
6449
|
}
|
|
6448
6450
|
}
|
|
@@ -6453,7 +6455,7 @@ class ml {
|
|
|
6453
6455
|
for (; e instanceof ze; )
|
|
6454
6456
|
t = e, e = t.children[t.children.length - 1];
|
|
6455
6457
|
(!e || // Empty textblock
|
|
6456
|
-
!(e instanceof _t) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((
|
|
6458
|
+
!(e instanceof _t) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((q || z) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
6457
6459
|
}
|
|
6458
6460
|
addHackNode(e, t) {
|
|
6459
6461
|
if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
|
|
@@ -6461,7 +6463,7 @@ class ml {
|
|
|
6461
6463
|
else {
|
|
6462
6464
|
let n = document.createElement(e);
|
|
6463
6465
|
e == "IMG" && (n.className = "ProseMirror-separator", n.alt = ""), e == "BR" && (n.className = "ProseMirror-trailingBreak");
|
|
6464
|
-
let i = new
|
|
6466
|
+
let i = new ts(this.top, [], n, null);
|
|
6465
6467
|
t != this.top ? t.children.push(i) : t.children.splice(this.index++, 0, i), this.changed = !0;
|
|
6466
6468
|
}
|
|
6467
6469
|
}
|
|
@@ -6597,7 +6599,7 @@ function Kn(r, e = null) {
|
|
|
6597
6599
|
for (a = o; i && !i.node; )
|
|
6598
6600
|
i = i.parent;
|
|
6599
6601
|
let d = i.node;
|
|
6600
|
-
if (i && d.isAtom && S.isSelectable(d) && i.parent && !(d.isInline &&
|
|
6602
|
+
if (i && d.isAtom && S.isSelectable(d) && i.parent && !(d.isInline && Uo(t.focusNode, t.focusOffset, i.dom))) {
|
|
6601
6603
|
let h = i.posBefore;
|
|
6602
6604
|
c = new S(o == h ? l : n.resolve(h));
|
|
6603
6605
|
}
|
|
@@ -6623,13 +6625,13 @@ function Kn(r, e = null) {
|
|
|
6623
6625
|
}
|
|
6624
6626
|
return c;
|
|
6625
6627
|
}
|
|
6626
|
-
function
|
|
6627
|
-
return r.editable ? r.hasFocus() :
|
|
6628
|
+
function ss(r) {
|
|
6629
|
+
return r.editable ? r.hasFocus() : as(r) && document.activeElement && document.activeElement.contains(r.dom);
|
|
6628
6630
|
}
|
|
6629
6631
|
function de(r, e = !1) {
|
|
6630
6632
|
let t = r.state.selection;
|
|
6631
|
-
if (
|
|
6632
|
-
if (!e && r.input.mouseDown && r.input.mouseDown.allowDefault &&
|
|
6633
|
+
if (ls(r, t), !!ss(r)) {
|
|
6634
|
+
if (!e && r.input.mouseDown && r.input.mouseDown.allowDefault && z) {
|
|
6633
6635
|
let n = r.domSelectionRange(), i = r.domObserver.currentSelection;
|
|
6634
6636
|
if (n.anchorNode && i.anchorNode && Be(n.anchorNode, n.anchorOffset, i.anchorNode, i.anchorOffset)) {
|
|
6635
6637
|
r.input.mouseDown.delayedSelectionSync = !0, r.domObserver.setCurSelection();
|
|
@@ -6645,10 +6647,10 @@ function de(r, e = !1) {
|
|
|
6645
6647
|
r.domObserver.setCurSelection(), r.domObserver.connectSelection();
|
|
6646
6648
|
}
|
|
6647
6649
|
}
|
|
6648
|
-
const Br =
|
|
6650
|
+
const Br = q || z && Hi < 63;
|
|
6649
6651
|
function zr(r, e) {
|
|
6650
6652
|
let { node: t, offset: n } = r.docView.domFromPos(e, 0), i = n < t.childNodes.length ? t.childNodes[n] : null, s = n ? t.childNodes[n - 1] : null;
|
|
6651
|
-
if (
|
|
6653
|
+
if (q && i && i.contentEditable == "false")
|
|
6652
6654
|
return hn(i);
|
|
6653
6655
|
if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
|
|
6654
6656
|
if (i)
|
|
@@ -6658,7 +6660,7 @@ function zr(r, e) {
|
|
|
6658
6660
|
}
|
|
6659
6661
|
}
|
|
6660
6662
|
function hn(r) {
|
|
6661
|
-
return r.contentEditable = "true",
|
|
6663
|
+
return r.contentEditable = "true", q && r.draggable && (r.draggable = !1, r.wasDraggable = !0), r;
|
|
6662
6664
|
}
|
|
6663
6665
|
function Fr(r) {
|
|
6664
6666
|
r.contentEditable = "false", r.wasDraggable && (r.draggable = !0, r.wasDraggable = null);
|
|
@@ -6669,7 +6671,7 @@ function Sl(r) {
|
|
|
6669
6671
|
let t = r.domSelectionRange(), n = t.anchorNode, i = t.anchorOffset;
|
|
6670
6672
|
e.addEventListener("selectionchange", r.input.hideSelectionGuard = () => {
|
|
6671
6673
|
(t.anchorNode != n || t.anchorOffset != i) && (e.removeEventListener("selectionchange", r.input.hideSelectionGuard), setTimeout(() => {
|
|
6672
|
-
(!
|
|
6674
|
+
(!ss(r) || r.state.selection.visible) && r.dom.classList.remove("ProseMirror-hideselection");
|
|
6673
6675
|
}, 20));
|
|
6674
6676
|
});
|
|
6675
6677
|
}
|
|
@@ -6678,9 +6680,9 @@ function Cl(r) {
|
|
|
6678
6680
|
if (!e)
|
|
6679
6681
|
return;
|
|
6680
6682
|
let t = r.cursorWrapper.dom, n = t.nodeName == "IMG";
|
|
6681
|
-
n ? e.collapse(t.parentNode,
|
|
6683
|
+
n ? e.collapse(t.parentNode, $(t) + 1) : e.collapse(t, 0), !n && !r.state.selection.visible && G && xe <= 11 && (t.disabled = !0, t.disabled = !1);
|
|
6682
6684
|
}
|
|
6683
|
-
function
|
|
6685
|
+
function ls(r, e) {
|
|
6684
6686
|
if (e instanceof S) {
|
|
6685
6687
|
let t = r.docView.descAt(e.from);
|
|
6686
6688
|
t != r.lastSelectedViewDesc && (Vr(r), t && t.selectNode(), r.lastSelectedViewDesc = t);
|
|
@@ -6694,9 +6696,9 @@ function Hn(r, e, t, n) {
|
|
|
6694
6696
|
return r.someProp("createSelectionBetween", (i) => i(r, e, t)) || O.between(e, t, n);
|
|
6695
6697
|
}
|
|
6696
6698
|
function Lr(r) {
|
|
6697
|
-
return r.editable && !r.hasFocus() ? !1 :
|
|
6699
|
+
return r.editable && !r.hasFocus() ? !1 : as(r);
|
|
6698
6700
|
}
|
|
6699
|
-
function
|
|
6701
|
+
function as(r) {
|
|
6700
6702
|
let e = r.domSelectionRange();
|
|
6701
6703
|
if (!e.anchorNode)
|
|
6702
6704
|
return !1;
|
|
@@ -6776,12 +6778,12 @@ function wl(r) {
|
|
|
6776
6778
|
break;
|
|
6777
6779
|
}
|
|
6778
6780
|
} else {
|
|
6779
|
-
if (
|
|
6781
|
+
if (cs(t))
|
|
6780
6782
|
break;
|
|
6781
6783
|
{
|
|
6782
6784
|
let l = t.previousSibling;
|
|
6783
6785
|
for (; l && at(l, -1); )
|
|
6784
|
-
i = t.parentNode, s =
|
|
6786
|
+
i = t.parentNode, s = $(l), l = l.previousSibling;
|
|
6785
6787
|
if (l)
|
|
6786
6788
|
t = l, n = Ft(t);
|
|
6787
6789
|
else {
|
|
@@ -6808,12 +6810,12 @@ function Ol(r) {
|
|
|
6808
6810
|
else
|
|
6809
6811
|
break;
|
|
6810
6812
|
} else {
|
|
6811
|
-
if (
|
|
6813
|
+
if (cs(t))
|
|
6812
6814
|
break;
|
|
6813
6815
|
{
|
|
6814
6816
|
let l = t.nextSibling;
|
|
6815
6817
|
for (; l && at(l, 1); )
|
|
6816
|
-
s = l.parentNode, o =
|
|
6818
|
+
s = l.parentNode, o = $(l) + 1, l = l.nextSibling;
|
|
6817
6819
|
if (l)
|
|
6818
6820
|
t = l, n = 0, i = Ft(t);
|
|
6819
6821
|
else {
|
|
@@ -6825,13 +6827,13 @@ function Ol(r) {
|
|
|
6825
6827
|
}
|
|
6826
6828
|
s && vn(r, s, o);
|
|
6827
6829
|
}
|
|
6828
|
-
function
|
|
6830
|
+
function cs(r) {
|
|
6829
6831
|
let e = r.pmViewDesc;
|
|
6830
6832
|
return e && e.node && e.node.isBlock;
|
|
6831
6833
|
}
|
|
6832
6834
|
function Nl(r, e) {
|
|
6833
6835
|
for (; r && e == r.childNodes.length && !yt(r); )
|
|
6834
|
-
e =
|
|
6836
|
+
e = $(r) + 1, r = r.parentNode;
|
|
6835
6837
|
for (; r && e < r.childNodes.length; ) {
|
|
6836
6838
|
let t = r.childNodes[e];
|
|
6837
6839
|
if (t.nodeType == 3)
|
|
@@ -6843,7 +6845,7 @@ function Nl(r, e) {
|
|
|
6843
6845
|
}
|
|
6844
6846
|
function Tl(r, e) {
|
|
6845
6847
|
for (; r && !e && !yt(r); )
|
|
6846
|
-
e =
|
|
6848
|
+
e = $(r), r = r.parentNode;
|
|
6847
6849
|
for (; r && e; ) {
|
|
6848
6850
|
let t = r.childNodes[e - 1];
|
|
6849
6851
|
if (t.nodeType == 3)
|
|
@@ -6873,7 +6875,7 @@ function vn(r, e, t) {
|
|
|
6873
6875
|
}
|
|
6874
6876
|
function Wr(r, e) {
|
|
6875
6877
|
let t = r.state.doc.resolve(e);
|
|
6876
|
-
if (!(
|
|
6878
|
+
if (!(z || Ui) && t.parent.inlineContent) {
|
|
6877
6879
|
let i = r.coordsAtPos(e);
|
|
6878
6880
|
if (e > t.start()) {
|
|
6879
6881
|
let s = r.coordsAtPos(e - 1), o = (s.top + s.bottom) / 2;
|
|
@@ -6925,7 +6927,7 @@ function qr(r, e, t) {
|
|
|
6925
6927
|
r.domObserver.stop(), e.contentEditable = t, r.domObserver.start();
|
|
6926
6928
|
}
|
|
6927
6929
|
function El(r) {
|
|
6928
|
-
if (!
|
|
6930
|
+
if (!q || r.state.selection.$head.parentOffset > 0)
|
|
6929
6931
|
return !1;
|
|
6930
6932
|
let { focusNode: e, focusOffset: t } = r.domSelectionRange();
|
|
6931
6933
|
if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
|
|
@@ -6972,10 +6974,10 @@ function Un(r, e) {
|
|
|
6972
6974
|
let u = n.firstChild;
|
|
6973
6975
|
t.push(u.type.name, u.attrs != u.type.defaultAttrs ? u.attrs : null), n = u.content;
|
|
6974
6976
|
}
|
|
6975
|
-
let o = r.someProp("clipboardSerializer") || Fe.fromSchema(r.state.schema), l =
|
|
6977
|
+
let o = r.someProp("clipboardSerializer") || Fe.fromSchema(r.state.schema), l = ms(), a = l.createElement("div");
|
|
6976
6978
|
a.appendChild(o.serializeFragment(n, { document: l }));
|
|
6977
6979
|
let c = a.firstChild, f, d = 0;
|
|
6978
|
-
for (; c && c.nodeType == 1 && (f =
|
|
6980
|
+
for (; c && c.nodeType == 1 && (f = ps[c.nodeName.toLowerCase()]); ) {
|
|
6979
6981
|
for (let u = f.length - 1; u >= 0; u--) {
|
|
6980
6982
|
let p = l.createElement(f[u]);
|
|
6981
6983
|
for (; a.firstChild; )
|
|
@@ -6990,7 +6992,7 @@ function Un(r, e) {
|
|
|
6990
6992
|
`);
|
|
6991
6993
|
return { dom: a, text: h, slice: e };
|
|
6992
6994
|
}
|
|
6993
|
-
function
|
|
6995
|
+
function fs(r, e, t, n, i) {
|
|
6994
6996
|
let s = i.parent.type.spec.code, o, l;
|
|
6995
6997
|
if (!t && !e)
|
|
6996
6998
|
return null;
|
|
@@ -7059,11 +7061,11 @@ function Rl(r, e) {
|
|
|
7059
7061
|
let a = i.findWrapping(l.type), c;
|
|
7060
7062
|
if (!a)
|
|
7061
7063
|
return o = null;
|
|
7062
|
-
if (c = o.length && s.length &&
|
|
7064
|
+
if (c = o.length && s.length && hs(a, s, l, o[o.length - 1], 0))
|
|
7063
7065
|
o[o.length - 1] = c;
|
|
7064
7066
|
else {
|
|
7065
|
-
o.length && (o[o.length - 1] =
|
|
7066
|
-
let f =
|
|
7067
|
+
o.length && (o[o.length - 1] = us(o[o.length - 1], s.length));
|
|
7068
|
+
let f = ds(l, a);
|
|
7067
7069
|
o.push(f), i = i.matchType(f.type), s = a;
|
|
7068
7070
|
}
|
|
7069
7071
|
}), o)
|
|
@@ -7071,24 +7073,24 @@ function Rl(r, e) {
|
|
|
7071
7073
|
}
|
|
7072
7074
|
return r;
|
|
7073
7075
|
}
|
|
7074
|
-
function
|
|
7076
|
+
function ds(r, e, t = 0) {
|
|
7075
7077
|
for (let n = e.length - 1; n >= t; n--)
|
|
7076
7078
|
r = e[n].create(null, b.from(r));
|
|
7077
7079
|
return r;
|
|
7078
7080
|
}
|
|
7079
|
-
function
|
|
7081
|
+
function hs(r, e, t, n, i) {
|
|
7080
7082
|
if (i < r.length && i < e.length && r[i] == e[i]) {
|
|
7081
|
-
let s =
|
|
7083
|
+
let s = hs(r, e, t, n.lastChild, i + 1);
|
|
7082
7084
|
if (s)
|
|
7083
7085
|
return n.copy(n.content.replaceChild(n.childCount - 1, s));
|
|
7084
7086
|
if (n.contentMatchAt(n.childCount).matchType(i == r.length - 1 ? t.type : r[i + 1]))
|
|
7085
|
-
return n.copy(n.content.append(b.from(
|
|
7087
|
+
return n.copy(n.content.append(b.from(ds(t, r, i + 1))));
|
|
7086
7088
|
}
|
|
7087
7089
|
}
|
|
7088
|
-
function
|
|
7090
|
+
function us(r, e) {
|
|
7089
7091
|
if (e == 0)
|
|
7090
7092
|
return r;
|
|
7091
|
-
let t = r.content.replaceChild(r.childCount - 1,
|
|
7093
|
+
let t = r.content.replaceChild(r.childCount - 1, us(r.lastChild, e - 1)), n = r.contentMatchAt(r.childCount).fillBefore(b.empty, !0);
|
|
7092
7094
|
return r.copy(t.append(n));
|
|
7093
7095
|
}
|
|
7094
7096
|
function Bn(r, e, t, n, i, s) {
|
|
@@ -7098,7 +7100,7 @@ function Bn(r, e, t, n, i, s) {
|
|
|
7098
7100
|
function Kr(r, e, t) {
|
|
7099
7101
|
return e < r.openStart && (r = new k(Bn(r.content, -1, e, r.openStart, 0, r.openEnd), e, r.openEnd)), t < r.openEnd && (r = new k(Bn(r.content, 1, t, r.openEnd, 0, 0), r.openStart, t)), r;
|
|
7100
7102
|
}
|
|
7101
|
-
const
|
|
7103
|
+
const ps = {
|
|
7102
7104
|
thead: ["table"],
|
|
7103
7105
|
tbody: ["table"],
|
|
7104
7106
|
tfoot: ["table"],
|
|
@@ -7110,7 +7112,7 @@ const us = {
|
|
|
7110
7112
|
th: ["table", "tbody", "tr"]
|
|
7111
7113
|
};
|
|
7112
7114
|
let Hr = null;
|
|
7113
|
-
function
|
|
7115
|
+
function ms() {
|
|
7114
7116
|
return Hr || (Hr = document.implementation.createHTMLDocument("title"));
|
|
7115
7117
|
}
|
|
7116
7118
|
let un = null;
|
|
@@ -7121,14 +7123,14 @@ function Pl(r) {
|
|
|
7121
7123
|
function vl(r) {
|
|
7122
7124
|
let e = /^(\s*<meta [^>]*>)*/.exec(r);
|
|
7123
7125
|
e && (r = r.slice(e[0].length));
|
|
7124
|
-
let t =
|
|
7125
|
-
if ((i = n &&
|
|
7126
|
+
let t = ms().createElement("div"), n = /<([a-z][^>\s]+)/i.exec(r), i;
|
|
7127
|
+
if ((i = n && ps[n[1].toLowerCase()]) && (r = i.map((s) => "<" + s + ">").join("") + r + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = Pl(r), i)
|
|
7126
7128
|
for (let s = 0; s < i.length; s++)
|
|
7127
7129
|
t = t.querySelector(i[s]) || t;
|
|
7128
7130
|
return t;
|
|
7129
7131
|
}
|
|
7130
7132
|
function Bl(r) {
|
|
7131
|
-
let e = r.querySelectorAll(
|
|
7133
|
+
let e = r.querySelectorAll(z ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
7132
7134
|
for (let t = 0; t < e.length; t++) {
|
|
7133
7135
|
let n = e[t];
|
|
7134
7136
|
n.childNodes.length == 1 && n.textContent == " " && n.parentNode && n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "), n);
|
|
@@ -7165,7 +7167,7 @@ function Ll(r) {
|
|
|
7165
7167
|
Wl(r, n) && !Gn(r, n) && (r.editable || !(n.type in U)) && t(r, n);
|
|
7166
7168
|
}, Fl[e] ? { passive: !0 } : void 0);
|
|
7167
7169
|
}
|
|
7168
|
-
|
|
7170
|
+
q && r.dom.addEventListener("input", () => null), zn(r);
|
|
7169
7171
|
}
|
|
7170
7172
|
function ye(r, e) {
|
|
7171
7173
|
r.input.lastSelectionOrigin = e, r.input.lastSelectionTime = Date.now();
|
|
@@ -7203,7 +7205,7 @@ function Jl(r, e) {
|
|
|
7203
7205
|
}
|
|
7204
7206
|
U.keydown = (r, e) => {
|
|
7205
7207
|
let t = e;
|
|
7206
|
-
if (r.input.shiftKey = t.keyCode == 16 || t.shiftKey, !
|
|
7208
|
+
if (r.input.shiftKey = t.keyCode == 16 || t.shiftKey, !ys(r, t) && (r.input.lastKeyCode = t.keyCode, r.input.lastKeyCodeTime = Date.now(), !(ce && z && t.keyCode == 13)))
|
|
7207
7209
|
if (t.keyCode != 229 && r.domObserver.forceFlush(), Ze && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
7208
7210
|
let n = Date.now();
|
|
7209
7211
|
r.input.lastIOSEnter = n, r.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
@@ -7216,7 +7218,7 @@ U.keyup = (r, e) => {
|
|
|
7216
7218
|
};
|
|
7217
7219
|
U.keypress = (r, e) => {
|
|
7218
7220
|
let t = e;
|
|
7219
|
-
if (
|
|
7221
|
+
if (ys(r, t) || !t.charCode || t.ctrlKey && !t.altKey || Y && t.metaKey)
|
|
7220
7222
|
return;
|
|
7221
7223
|
if (r.someProp("handleKeyPress", (i) => i(r, t))) {
|
|
7222
7224
|
t.preventDefault();
|
|
@@ -7301,18 +7303,18 @@ function _l(r, e, t) {
|
|
|
7301
7303
|
function Yn(r) {
|
|
7302
7304
|
return Vt(r);
|
|
7303
7305
|
}
|
|
7304
|
-
const
|
|
7306
|
+
const gs = Y ? "metaKey" : "ctrlKey";
|
|
7305
7307
|
H.mousedown = (r, e) => {
|
|
7306
7308
|
let t = e;
|
|
7307
7309
|
r.input.shiftKey = t.shiftKey;
|
|
7308
7310
|
let n = Yn(r), i = Date.now(), s = "singleClick";
|
|
7309
|
-
i - r.input.lastClick.time < 500 && jl(t, r.input.lastClick) && !t[
|
|
7311
|
+
i - r.input.lastClick.time < 500 && jl(t, r.input.lastClick) && !t[gs] && r.input.lastClick.button == t.button && (r.input.lastClick.type == "singleClick" ? s = "doubleClick" : r.input.lastClick.type == "doubleClick" && (s = "tripleClick")), r.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
|
|
7310
7312
|
let o = r.posAtCoords(Yt(t));
|
|
7311
7313
|
o && (s == "singleClick" ? (r.input.mouseDown && r.input.mouseDown.done(), r.input.mouseDown = new Yl(r, o, t, !!n)) : (s == "doubleClick" ? Ul : Gl)(r, o.pos, o.inside, t) ? t.preventDefault() : ye(r, "pointer"));
|
|
7312
7314
|
};
|
|
7313
7315
|
class Yl {
|
|
7314
7316
|
constructor(e, t, n, i) {
|
|
7315
|
-
this.view = e, this.pos = t, this.event = n, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!n[
|
|
7317
|
+
this.view = e, this.pos = t, this.event = n, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!n[gs], this.allowDefault = n.shiftKey;
|
|
7316
7318
|
let s, o;
|
|
7317
7319
|
if (t.inside > -1)
|
|
7318
7320
|
s = e.state.doc.nodeAt(t.inside), o = t.inside;
|
|
@@ -7340,14 +7342,14 @@ class Yl {
|
|
|
7340
7342
|
return;
|
|
7341
7343
|
let t = this.pos;
|
|
7342
7344
|
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Yt(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ye(this.view, "pointer") : Hl(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
7343
|
-
|
|
7345
|
+
q && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
7344
7346
|
// cursor, but still report that the node is selected
|
|
7345
7347
|
// when asked through getSelection. You'll then get a
|
|
7346
7348
|
// situation where clicking at the point where that
|
|
7347
7349
|
// (hidden) cursor is doesn't change the selection, and
|
|
7348
7350
|
// thus doesn't get a reaction from ProseMirror. This
|
|
7349
7351
|
// works around that.
|
|
7350
|
-
|
|
7352
|
+
z && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (_e(this.view, N.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : ye(this.view, "pointer");
|
|
7351
7353
|
}
|
|
7352
7354
|
move(e) {
|
|
7353
7355
|
this.updateAllowDefault(e), ye(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -7363,15 +7365,15 @@ H.touchmove = (r) => {
|
|
|
7363
7365
|
r.input.lastTouch = Date.now(), ye(r, "pointer");
|
|
7364
7366
|
};
|
|
7365
7367
|
H.contextmenu = (r) => Yn(r);
|
|
7366
|
-
function
|
|
7367
|
-
return r.composing ? !0 :
|
|
7368
|
+
function ys(r, e) {
|
|
7369
|
+
return r.composing ? !0 : q && Math.abs(e.timeStamp - r.input.compositionEndedAt) < 500 ? (r.input.compositionEndedAt = -2e8, !0) : !1;
|
|
7368
7370
|
}
|
|
7369
7371
|
const Xl = ce ? 5e3 : -1;
|
|
7370
7372
|
U.compositionstart = U.compositionupdate = (r) => {
|
|
7371
7373
|
if (!r.composing) {
|
|
7372
7374
|
r.domObserver.flush();
|
|
7373
7375
|
let { state: e } = r, t = e.selection.$to;
|
|
7374
|
-
if (e.selection instanceof O && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((n) => n.type.spec.inclusive === !1)))
|
|
7376
|
+
if (e.selection instanceof O && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((n) => n.type.spec.inclusive === !1) || z && Ui && Zl(r)))
|
|
7375
7377
|
r.markCursor = r.state.storedMarks || t.marks(), Vt(r, !0), r.markCursor = null;
|
|
7376
7378
|
else if (Vt(r, !e.selection.empty), te && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
7377
7379
|
let n = r.domSelectionRange();
|
|
@@ -7389,23 +7391,30 @@ U.compositionstart = U.compositionupdate = (r) => {
|
|
|
7389
7391
|
}
|
|
7390
7392
|
r.input.composing = !0;
|
|
7391
7393
|
}
|
|
7392
|
-
|
|
7394
|
+
bs(r, Xl);
|
|
7393
7395
|
};
|
|
7396
|
+
function Zl(r) {
|
|
7397
|
+
let { focusNode: e, focusOffset: t } = r.domSelectionRange();
|
|
7398
|
+
if (!e || e.nodeType != 1 || t >= e.childNodes.length)
|
|
7399
|
+
return !1;
|
|
7400
|
+
let n = e.childNodes[t];
|
|
7401
|
+
return n.nodeType == 1 && n.contentEditable == "false";
|
|
7402
|
+
}
|
|
7394
7403
|
U.compositionend = (r, e) => {
|
|
7395
|
-
r.composing && (r.input.composing = !1, r.input.compositionEndedAt = e.timeStamp, r.input.compositionPendingChanges = r.domObserver.pendingRecords().length ? r.input.compositionID : 0, r.input.compositionNode = null, r.input.compositionPendingChanges && Promise.resolve().then(() => r.domObserver.flush()), r.input.compositionID++,
|
|
7404
|
+
r.composing && (r.input.composing = !1, r.input.compositionEndedAt = e.timeStamp, r.input.compositionPendingChanges = r.domObserver.pendingRecords().length ? r.input.compositionID : 0, r.input.compositionNode = null, r.input.compositionPendingChanges && Promise.resolve().then(() => r.domObserver.flush()), r.input.compositionID++, bs(r, 20));
|
|
7396
7405
|
};
|
|
7397
|
-
function
|
|
7406
|
+
function bs(r, e) {
|
|
7398
7407
|
clearTimeout(r.input.composingTimeout), e > -1 && (r.input.composingTimeout = setTimeout(() => Vt(r), e));
|
|
7399
7408
|
}
|
|
7400
|
-
function
|
|
7401
|
-
for (r.composing && (r.input.composing = !1, r.input.compositionEndedAt =
|
|
7409
|
+
function ks(r) {
|
|
7410
|
+
for (r.composing && (r.input.composing = !1, r.input.compositionEndedAt = ea()); r.input.compositionNodes.length > 0; )
|
|
7402
7411
|
r.input.compositionNodes.pop().markParentsDirty();
|
|
7403
7412
|
}
|
|
7404
|
-
function
|
|
7413
|
+
function Ql(r) {
|
|
7405
7414
|
let e = r.domSelectionRange();
|
|
7406
7415
|
if (!e.focusNode)
|
|
7407
7416
|
return null;
|
|
7408
|
-
let t =
|
|
7417
|
+
let t = Ko(e.focusNode, e.focusOffset), n = Ho(e.focusNode, e.focusOffset);
|
|
7409
7418
|
if (t && n && t != n) {
|
|
7410
7419
|
let i = n.pmViewDesc, s = r.domObserver.lastChangedTextNode;
|
|
7411
7420
|
if (t == s || n == s)
|
|
@@ -7420,20 +7429,20 @@ function Zl(r) {
|
|
|
7420
7429
|
}
|
|
7421
7430
|
return t || n;
|
|
7422
7431
|
}
|
|
7423
|
-
function
|
|
7432
|
+
function ea() {
|
|
7424
7433
|
let r = document.createEvent("Event");
|
|
7425
7434
|
return r.initEvent("event", !0, !0), r.timeStamp;
|
|
7426
7435
|
}
|
|
7427
7436
|
function Vt(r, e = !1) {
|
|
7428
7437
|
if (!(ce && r.domObserver.flushingSoon >= 0)) {
|
|
7429
|
-
if (r.domObserver.forceFlush(),
|
|
7438
|
+
if (r.domObserver.forceFlush(), ks(r), e || r.docView && r.docView.dirty) {
|
|
7430
7439
|
let t = Kn(r), n = r.state.selection;
|
|
7431
7440
|
return t && !t.eq(n) ? r.dispatch(r.state.tr.setSelection(t)) : (r.markCursor || e) && !n.$from.node(n.$from.sharedDepth(n.to)).inlineContent ? r.dispatch(r.state.tr.deleteSelection()) : r.updateState(r.state), !0;
|
|
7432
7441
|
}
|
|
7433
7442
|
return !1;
|
|
7434
7443
|
}
|
|
7435
7444
|
}
|
|
7436
|
-
function
|
|
7445
|
+
function ta(r, e) {
|
|
7437
7446
|
if (!r.dom.parentNode)
|
|
7438
7447
|
return;
|
|
7439
7448
|
let t = r.dom.parentNode.appendChild(document.createElement("div"));
|
|
@@ -7449,12 +7458,12 @@ H.copy = U.cut = (r, e) => {
|
|
|
7449
7458
|
if (n.empty)
|
|
7450
7459
|
return;
|
|
7451
7460
|
let s = ht ? null : t.clipboardData, o = n.content(), { dom: l, text: a } = Un(r, o);
|
|
7452
|
-
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) :
|
|
7461
|
+
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : ta(r, l), i && r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
7453
7462
|
};
|
|
7454
|
-
function
|
|
7463
|
+
function na(r) {
|
|
7455
7464
|
return r.openStart == 0 && r.openEnd == 0 && r.content.childCount == 1 ? r.content.firstChild : null;
|
|
7456
7465
|
}
|
|
7457
|
-
function
|
|
7466
|
+
function ra(r, e) {
|
|
7458
7467
|
if (!r.dom.parentNode)
|
|
7459
7468
|
return;
|
|
7460
7469
|
let t = r.input.shiftKey || r.state.selection.$from.parent.type.spec.code, n = r.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
|
|
@@ -7465,15 +7474,15 @@ function na(r, e) {
|
|
|
7465
7474
|
}, 50);
|
|
7466
7475
|
}
|
|
7467
7476
|
function ut(r, e, t, n, i) {
|
|
7468
|
-
let s =
|
|
7477
|
+
let s = fs(r, e, t, n, r.state.selection.$from);
|
|
7469
7478
|
if (r.someProp("handlePaste", (a) => a(r, i, s || k.empty)))
|
|
7470
7479
|
return !0;
|
|
7471
7480
|
if (!s)
|
|
7472
7481
|
return !1;
|
|
7473
|
-
let o =
|
|
7482
|
+
let o = na(s), l = o ? r.state.tr.replaceSelectionWith(o, n) : r.state.tr.replaceSelection(s);
|
|
7474
7483
|
return r.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
7475
7484
|
}
|
|
7476
|
-
function
|
|
7485
|
+
function xs(r) {
|
|
7477
7486
|
let e = r.getData("text/plain") || r.getData("Text");
|
|
7478
7487
|
if (e)
|
|
7479
7488
|
return e;
|
|
@@ -7485,17 +7494,17 @@ U.paste = (r, e) => {
|
|
|
7485
7494
|
if (r.composing && !ce)
|
|
7486
7495
|
return;
|
|
7487
7496
|
let n = ht ? null : t.clipboardData, i = r.input.shiftKey && r.input.lastKeyCode != 45;
|
|
7488
|
-
n && ut(r,
|
|
7497
|
+
n && ut(r, xs(n), n.getData("text/html"), i, t) ? t.preventDefault() : ra(r, t);
|
|
7489
7498
|
};
|
|
7490
|
-
class
|
|
7499
|
+
class Ss {
|
|
7491
7500
|
constructor(e, t, n) {
|
|
7492
7501
|
this.slice = e, this.move = t, this.node = n;
|
|
7493
7502
|
}
|
|
7494
7503
|
}
|
|
7495
|
-
const
|
|
7496
|
-
function
|
|
7504
|
+
const ia = Y ? "altKey" : "ctrlKey";
|
|
7505
|
+
function Cs(r, e) {
|
|
7497
7506
|
let t = r.someProp("dragCopies", (n) => !n(e));
|
|
7498
|
-
return t ?? !e[
|
|
7507
|
+
return t ?? !e[ia];
|
|
7499
7508
|
}
|
|
7500
7509
|
H.dragstart = (r, e) => {
|
|
7501
7510
|
let t = e, n = r.input.mouseDown;
|
|
@@ -7511,7 +7520,7 @@ H.dragstart = (r, e) => {
|
|
|
7511
7520
|
}
|
|
7512
7521
|
}
|
|
7513
7522
|
let l = (o || r.state.selection).content(), { dom: a, text: c, slice: f } = Un(r, l);
|
|
7514
|
-
(!t.dataTransfer.files.length || !
|
|
7523
|
+
(!t.dataTransfer.files.length || !z || Hi > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(ht ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", ht || t.dataTransfer.setData("text/plain", c), r.dragging = new Ss(f, Cs(r, t), o);
|
|
7515
7524
|
};
|
|
7516
7525
|
H.dragend = (r) => {
|
|
7517
7526
|
let e = r.dragging;
|
|
@@ -7521,43 +7530,49 @@ H.dragend = (r) => {
|
|
|
7521
7530
|
};
|
|
7522
7531
|
U.dragover = U.dragenter = (r, e) => e.preventDefault();
|
|
7523
7532
|
U.drop = (r, e) => {
|
|
7524
|
-
|
|
7525
|
-
|
|
7533
|
+
try {
|
|
7534
|
+
sa(r, e, r.dragging);
|
|
7535
|
+
} finally {
|
|
7536
|
+
r.dragging = null;
|
|
7537
|
+
}
|
|
7538
|
+
};
|
|
7539
|
+
function sa(r, e, t) {
|
|
7540
|
+
if (!e.dataTransfer)
|
|
7526
7541
|
return;
|
|
7527
|
-
let
|
|
7528
|
-
if (!
|
|
7542
|
+
let n = r.posAtCoords(Yt(e));
|
|
7543
|
+
if (!n)
|
|
7529
7544
|
return;
|
|
7530
|
-
let
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
}) :
|
|
7534
|
-
let
|
|
7535
|
-
if (r.someProp("handleDrop", (
|
|
7536
|
-
|
|
7545
|
+
let i = r.state.doc.resolve(n.pos), s = t && t.slice;
|
|
7546
|
+
s ? r.someProp("transformPasted", (u) => {
|
|
7547
|
+
s = u(s, r, !1);
|
|
7548
|
+
}) : s = fs(r, xs(e.dataTransfer), ht ? null : e.dataTransfer.getData("text/html"), !1, i);
|
|
7549
|
+
let o = !!(t && Cs(r, e));
|
|
7550
|
+
if (r.someProp("handleDrop", (u) => u(r, e, s || k.empty, o))) {
|
|
7551
|
+
e.preventDefault();
|
|
7537
7552
|
return;
|
|
7538
7553
|
}
|
|
7539
|
-
if (!
|
|
7554
|
+
if (!s)
|
|
7540
7555
|
return;
|
|
7541
|
-
|
|
7542
|
-
let
|
|
7543
|
-
|
|
7544
|
-
let
|
|
7545
|
-
if (
|
|
7546
|
-
let { node:
|
|
7547
|
-
|
|
7548
|
-
}
|
|
7549
|
-
let
|
|
7550
|
-
if (
|
|
7556
|
+
e.preventDefault();
|
|
7557
|
+
let l = s ? Io(r.state.doc, i.pos, s) : i.pos;
|
|
7558
|
+
l == null && (l = i.pos);
|
|
7559
|
+
let a = r.state.tr;
|
|
7560
|
+
if (o) {
|
|
7561
|
+
let { node: u } = t;
|
|
7562
|
+
u ? u.replace(a) : a.deleteSelection();
|
|
7563
|
+
}
|
|
7564
|
+
let c = a.mapping.map(l), f = s.openStart == 0 && s.openEnd == 0 && s.content.childCount == 1, d = a.doc;
|
|
7565
|
+
if (f ? a.replaceRangeWith(c, c, s.content.firstChild) : a.replaceRange(c, c, s), a.doc.eq(d))
|
|
7551
7566
|
return;
|
|
7552
|
-
let
|
|
7553
|
-
if (
|
|
7554
|
-
|
|
7567
|
+
let h = a.doc.resolve(c);
|
|
7568
|
+
if (f && S.isSelectable(s.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(s.content.firstChild))
|
|
7569
|
+
a.setSelection(new S(h));
|
|
7555
7570
|
else {
|
|
7556
|
-
let
|
|
7557
|
-
|
|
7571
|
+
let u = a.mapping.map(l);
|
|
7572
|
+
a.mapping.maps[a.mapping.maps.length - 1].forEach((p, m, g, y) => u = y), a.setSelection(Hn(r, h, a.doc.resolve(u)));
|
|
7558
7573
|
}
|
|
7559
|
-
r.focus(), r.dispatch(
|
|
7560
|
-
}
|
|
7574
|
+
r.focus(), r.dispatch(a.setMeta("uiEvent", "drop"));
|
|
7575
|
+
}
|
|
7561
7576
|
H.focus = (r) => {
|
|
7562
7577
|
r.input.lastFocus = Date.now(), r.focused || (r.domObserver.stop(), r.dom.classList.add("ProseMirror-focused"), r.domObserver.start(), r.focused = !0, setTimeout(() => {
|
|
7563
7578
|
r.docView && r.hasFocus() && !r.domObserver.currentSelection.eq(r.domSelectionRange()) && de(r);
|
|
@@ -7568,7 +7583,7 @@ H.blur = (r, e) => {
|
|
|
7568
7583
|
r.focused && (r.domObserver.stop(), r.dom.classList.remove("ProseMirror-focused"), r.domObserver.start(), t.relatedTarget && r.dom.contains(t.relatedTarget) && r.domObserver.currentSelection.clear(), r.focused = !1);
|
|
7569
7584
|
};
|
|
7570
7585
|
H.beforeinput = (r, e) => {
|
|
7571
|
-
if (
|
|
7586
|
+
if (z && ce && e.inputType == "deleteContentBackward") {
|
|
7572
7587
|
r.domObserver.flushSoon();
|
|
7573
7588
|
let { domChangeCount: n } = r.input;
|
|
7574
7589
|
setTimeout(() => {
|
|
@@ -7736,7 +7751,7 @@ class v {
|
|
|
7736
7751
|
you must make a copy if you want need to preserve that.
|
|
7737
7752
|
*/
|
|
7738
7753
|
static create(e, t) {
|
|
7739
|
-
return t.length ? $t(t, e, 0, Ie) :
|
|
7754
|
+
return t.length ? $t(t, e, 0, Ie) : j;
|
|
7740
7755
|
}
|
|
7741
7756
|
/**
|
|
7742
7757
|
Find all decorations in this set which touch the given range
|
|
@@ -7766,7 +7781,7 @@ class v {
|
|
|
7766
7781
|
document.
|
|
7767
7782
|
*/
|
|
7768
7783
|
map(e, t, n) {
|
|
7769
|
-
return this ==
|
|
7784
|
+
return this == j || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, n || Ie);
|
|
7770
7785
|
}
|
|
7771
7786
|
/**
|
|
7772
7787
|
@internal
|
|
@@ -7777,7 +7792,7 @@ class v {
|
|
|
7777
7792
|
let a = this.local[l].map(e, n, i);
|
|
7778
7793
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
7779
7794
|
}
|
|
7780
|
-
return this.children.length ?
|
|
7795
|
+
return this.children.length ? oa(this.children, o || [], e, t, n, i, s) : o ? new v(o.sort(Re), qe) : j;
|
|
7781
7796
|
}
|
|
7782
7797
|
/**
|
|
7783
7798
|
Add the given array of decorations to the ones in the set,
|
|
@@ -7786,19 +7801,19 @@ class v {
|
|
|
7786
7801
|
structure.
|
|
7787
7802
|
*/
|
|
7788
7803
|
add(e, t) {
|
|
7789
|
-
return t.length ? this ==
|
|
7804
|
+
return t.length ? this == j ? v.create(e, t) : this.addInner(e, t, 0) : this;
|
|
7790
7805
|
}
|
|
7791
7806
|
addInner(e, t, n) {
|
|
7792
7807
|
let i, s = 0;
|
|
7793
7808
|
e.forEach((l, a) => {
|
|
7794
7809
|
let c = a + n, f;
|
|
7795
|
-
if (f =
|
|
7810
|
+
if (f = ws(t, l, c)) {
|
|
7796
7811
|
for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
|
|
7797
7812
|
s += 3;
|
|
7798
7813
|
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, f, c + 1) : i.splice(s, 0, a, a + l.nodeSize, $t(f, l, c + 1, Ie)), s += 3;
|
|
7799
7814
|
}
|
|
7800
7815
|
});
|
|
7801
|
-
let o =
|
|
7816
|
+
let o = Ms(s ? Os(t) : t, -n);
|
|
7802
7817
|
for (let l = 0; l < o.length; l++)
|
|
7803
7818
|
o[l].type.valid(e, o[l]) || o.splice(l--, 1);
|
|
7804
7819
|
return new v(o.length ? this.local.concat(o).sort(Re) : this.local, i || this.children);
|
|
@@ -7808,7 +7823,7 @@ class v {
|
|
|
7808
7823
|
the ones in the given array.
|
|
7809
7824
|
*/
|
|
7810
7825
|
remove(e) {
|
|
7811
|
-
return e.length == 0 || this ==
|
|
7826
|
+
return e.length == 0 || this == j ? this : this.removeInner(e, 0);
|
|
7812
7827
|
}
|
|
7813
7828
|
removeInner(e, t) {
|
|
7814
7829
|
let n = this.children, i = this.local;
|
|
@@ -7820,7 +7835,7 @@ class v {
|
|
|
7820
7835
|
continue;
|
|
7821
7836
|
n == this.children && (n = this.children.slice());
|
|
7822
7837
|
let c = n[s + 2].removeInner(o, l + 1);
|
|
7823
|
-
c !=
|
|
7838
|
+
c != j ? n[s + 2] = c : (n.splice(s, 3), s -= 3);
|
|
7824
7839
|
}
|
|
7825
7840
|
if (i.length) {
|
|
7826
7841
|
for (let s = 0, o; s < e.length; s++)
|
|
@@ -7828,10 +7843,10 @@ class v {
|
|
|
7828
7843
|
for (let l = 0; l < i.length; l++)
|
|
7829
7844
|
i[l].eq(o, t) && (i == this.local && (i = this.local.slice()), i.splice(l--, 1));
|
|
7830
7845
|
}
|
|
7831
|
-
return n == this.children && i == this.local ? this : i.length || n.length ? new v(i, n) :
|
|
7846
|
+
return n == this.children && i == this.local ? this : i.length || n.length ? new v(i, n) : j;
|
|
7832
7847
|
}
|
|
7833
7848
|
forChild(e, t) {
|
|
7834
|
-
if (this ==
|
|
7849
|
+
if (this == j)
|
|
7835
7850
|
return this;
|
|
7836
7851
|
if (t.isLeaf)
|
|
7837
7852
|
return v.empty;
|
|
@@ -7853,7 +7868,7 @@ class v {
|
|
|
7853
7868
|
let l = new v(i.sort(Re), qe);
|
|
7854
7869
|
return n ? new pe([l, n]) : l;
|
|
7855
7870
|
}
|
|
7856
|
-
return n ||
|
|
7871
|
+
return n || j;
|
|
7857
7872
|
}
|
|
7858
7873
|
/**
|
|
7859
7874
|
@internal
|
|
@@ -7881,7 +7896,7 @@ class v {
|
|
|
7881
7896
|
@internal
|
|
7882
7897
|
*/
|
|
7883
7898
|
localsInner(e) {
|
|
7884
|
-
if (this ==
|
|
7899
|
+
if (this == j)
|
|
7885
7900
|
return qe;
|
|
7886
7901
|
if (e.inlineContent || !this.local.some(Ce.is))
|
|
7887
7902
|
return this.local;
|
|
@@ -7896,7 +7911,7 @@ class v {
|
|
|
7896
7911
|
}
|
|
7897
7912
|
v.empty = new v([], []);
|
|
7898
7913
|
v.removeOverlap = Zn;
|
|
7899
|
-
const
|
|
7914
|
+
const j = v.empty;
|
|
7900
7915
|
class pe {
|
|
7901
7916
|
constructor(e) {
|
|
7902
7917
|
this.members = e;
|
|
@@ -7911,7 +7926,7 @@ class pe {
|
|
|
7911
7926
|
let n = [];
|
|
7912
7927
|
for (let i = 0; i < this.members.length; i++) {
|
|
7913
7928
|
let s = this.members[i].forChild(e, t);
|
|
7914
|
-
s !=
|
|
7929
|
+
s != j && (s instanceof pe ? n = n.concat(s.members) : n.push(s));
|
|
7915
7930
|
}
|
|
7916
7931
|
return pe.from(n);
|
|
7917
7932
|
}
|
|
@@ -7943,7 +7958,7 @@ class pe {
|
|
|
7943
7958
|
static from(e) {
|
|
7944
7959
|
switch (e.length) {
|
|
7945
7960
|
case 0:
|
|
7946
|
-
return
|
|
7961
|
+
return j;
|
|
7947
7962
|
case 1:
|
|
7948
7963
|
return e[0];
|
|
7949
7964
|
default:
|
|
@@ -7955,18 +7970,18 @@ class pe {
|
|
|
7955
7970
|
this.members[t].forEachSet(e);
|
|
7956
7971
|
}
|
|
7957
7972
|
}
|
|
7958
|
-
function
|
|
7973
|
+
function oa(r, e, t, n, i, s, o) {
|
|
7959
7974
|
let l = r.slice();
|
|
7960
7975
|
for (let c = 0, f = s; c < t.maps.length; c++) {
|
|
7961
7976
|
let d = 0;
|
|
7962
7977
|
t.maps[c].forEach((h, u, p, m) => {
|
|
7963
7978
|
let g = m - p - (u - h);
|
|
7964
7979
|
for (let y = 0; y < l.length; y += 3) {
|
|
7965
|
-
let
|
|
7966
|
-
if (
|
|
7980
|
+
let w = l[y + 1];
|
|
7981
|
+
if (w < 0 || h > w + f - d)
|
|
7967
7982
|
continue;
|
|
7968
|
-
let
|
|
7969
|
-
u >=
|
|
7983
|
+
let C = l[y] + f - d;
|
|
7984
|
+
u >= C ? l[y + 1] = h <= C ? -2 : -1 : h >= f && g && (l[y] += g, l[y + 1] += g);
|
|
7970
7985
|
}
|
|
7971
7986
|
d += g;
|
|
7972
7987
|
}), f = t.maps[c].map(f, -1);
|
|
@@ -7986,12 +8001,12 @@ function ia(r, e, t, n, i, s, o) {
|
|
|
7986
8001
|
let h = t.map(r[c + 1] + s, -1), u = h - i, { index: p, offset: m } = n.content.findIndex(d), g = n.maybeChild(p);
|
|
7987
8002
|
if (g && m == d && m + g.nodeSize == u) {
|
|
7988
8003
|
let y = l[c + 2].mapInner(t, g, f + 1, r[c] + s + 1, o);
|
|
7989
|
-
y !=
|
|
8004
|
+
y != j ? (l[c] = d, l[c + 1] = u, l[c + 2] = y) : (l[c + 1] = -2, a = !0);
|
|
7990
8005
|
} else
|
|
7991
8006
|
a = !0;
|
|
7992
8007
|
}
|
|
7993
8008
|
if (a) {
|
|
7994
|
-
let c =
|
|
8009
|
+
let c = la(l, r, e, t, i, s, o), f = $t(c, n, 0, o);
|
|
7995
8010
|
e = f.local;
|
|
7996
8011
|
for (let d = 0; d < l.length; d += 3)
|
|
7997
8012
|
l[d + 1] < 0 && (l.splice(d, 3), d -= 3);
|
|
@@ -8004,7 +8019,7 @@ function ia(r, e, t, n, i, s, o) {
|
|
|
8004
8019
|
}
|
|
8005
8020
|
return new v(e.sort(Re), l);
|
|
8006
8021
|
}
|
|
8007
|
-
function
|
|
8022
|
+
function Ms(r, e) {
|
|
8008
8023
|
if (!e || !r.length)
|
|
8009
8024
|
return r;
|
|
8010
8025
|
let t = [];
|
|
@@ -8014,7 +8029,7 @@ function Cs(r, e) {
|
|
|
8014
8029
|
}
|
|
8015
8030
|
return t;
|
|
8016
8031
|
}
|
|
8017
|
-
function
|
|
8032
|
+
function la(r, e, t, n, i, s, o) {
|
|
8018
8033
|
function l(a, c) {
|
|
8019
8034
|
for (let f = 0; f < a.local.length; f++) {
|
|
8020
8035
|
let d = a.local[f].map(n, i, c);
|
|
@@ -8027,7 +8042,7 @@ function sa(r, e, t, n, i, s, o) {
|
|
|
8027
8042
|
r[a + 1] == -1 && l(r[a + 2], e[a] + s + 1);
|
|
8028
8043
|
return t;
|
|
8029
8044
|
}
|
|
8030
|
-
function
|
|
8045
|
+
function ws(r, e, t) {
|
|
8031
8046
|
if (e.isLeaf)
|
|
8032
8047
|
return null;
|
|
8033
8048
|
let n = t + e.nodeSize, i = null;
|
|
@@ -8035,7 +8050,7 @@ function Ms(r, e, t) {
|
|
|
8035
8050
|
(o = r[s]) && o.from > t && o.to < n && ((i || (i = [])).push(o), r[s] = null);
|
|
8036
8051
|
return i;
|
|
8037
8052
|
}
|
|
8038
|
-
function
|
|
8053
|
+
function Os(r) {
|
|
8039
8054
|
let e = [];
|
|
8040
8055
|
for (let t = 0; t < r.length; t++)
|
|
8041
8056
|
r[t] != null && e.push(r[t]);
|
|
@@ -8044,17 +8059,17 @@ function ws(r) {
|
|
|
8044
8059
|
function $t(r, e, t, n) {
|
|
8045
8060
|
let i = [], s = !1;
|
|
8046
8061
|
e.forEach((l, a) => {
|
|
8047
|
-
let c =
|
|
8062
|
+
let c = ws(r, l, a + t);
|
|
8048
8063
|
if (c) {
|
|
8049
8064
|
s = !0;
|
|
8050
8065
|
let f = $t(c, l, t + a + 1, n);
|
|
8051
|
-
f !=
|
|
8066
|
+
f != j && i.push(a, a + l.nodeSize, f);
|
|
8052
8067
|
}
|
|
8053
8068
|
});
|
|
8054
|
-
let o =
|
|
8069
|
+
let o = Ms(s ? Os(r) : r, -t).sort(Re);
|
|
8055
8070
|
for (let l = 0; l < o.length; l++)
|
|
8056
8071
|
o[l].type.valid(e, o[l]) || (n.onRemove && n.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8057
|
-
return o.length || i.length ? new v(o, i) :
|
|
8072
|
+
return o.length || i.length ? new v(o, i) : j;
|
|
8058
8073
|
}
|
|
8059
8074
|
function Re(r, e) {
|
|
8060
8075
|
return r.from - e.from || r.to - e.to;
|
|
@@ -8086,18 +8101,18 @@ function pn(r) {
|
|
|
8086
8101
|
let e = [];
|
|
8087
8102
|
return r.someProp("decorations", (t) => {
|
|
8088
8103
|
let n = t(r.state);
|
|
8089
|
-
n && n !=
|
|
8104
|
+
n && n != j && e.push(n);
|
|
8090
8105
|
}), r.cursorWrapper && e.push(v.create(r.state.doc, [r.cursorWrapper.deco])), pe.from(e);
|
|
8091
8106
|
}
|
|
8092
|
-
const
|
|
8107
|
+
const aa = {
|
|
8093
8108
|
childList: !0,
|
|
8094
8109
|
characterData: !0,
|
|
8095
8110
|
characterDataOldValue: !0,
|
|
8096
8111
|
attributes: !0,
|
|
8097
8112
|
attributeOldValue: !0,
|
|
8098
8113
|
subtree: !0
|
|
8099
|
-
},
|
|
8100
|
-
class
|
|
8114
|
+
}, ca = G && xe <= 11;
|
|
8115
|
+
class fa {
|
|
8101
8116
|
constructor() {
|
|
8102
8117
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
8103
8118
|
}
|
|
@@ -8111,13 +8126,13 @@ class aa {
|
|
|
8111
8126
|
return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
|
|
8112
8127
|
}
|
|
8113
8128
|
}
|
|
8114
|
-
class
|
|
8129
|
+
class da {
|
|
8115
8130
|
constructor(e, t) {
|
|
8116
|
-
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new
|
|
8131
|
+
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new fa(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((n) => {
|
|
8117
8132
|
for (let i = 0; i < n.length; i++)
|
|
8118
8133
|
this.queue.push(n[i]);
|
|
8119
8134
|
G && xe <= 11 && n.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
|
|
8120
|
-
}),
|
|
8135
|
+
}), ca && (this.onCharData = (n) => {
|
|
8121
8136
|
this.queue.push({ target: n.target, type: "characterData", oldValue: n.prevValue }), this.flushSoon();
|
|
8122
8137
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
8123
8138
|
}
|
|
@@ -8130,7 +8145,7 @@ class ca {
|
|
|
8130
8145
|
this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
|
|
8131
8146
|
}
|
|
8132
8147
|
start() {
|
|
8133
|
-
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom,
|
|
8148
|
+
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, aa)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
|
|
8134
8149
|
}
|
|
8135
8150
|
stop() {
|
|
8136
8151
|
if (this.observer) {
|
|
@@ -8213,12 +8228,18 @@ class ca {
|
|
|
8213
8228
|
let { focusNode: d } = this.currentSelection;
|
|
8214
8229
|
for (let h of f) {
|
|
8215
8230
|
let u = h.parentNode;
|
|
8216
|
-
u && u.nodeName == "LI" && (!d ||
|
|
8231
|
+
u && u.nodeName == "LI" && (!d || pa(e, d) != u) && h.remove();
|
|
8217
8232
|
}
|
|
8218
8233
|
}
|
|
8234
|
+
} else if ((z || q) && a.some((f) => f.nodeName == "BR") && (e.input.lastKeyCode == 8 || e.input.lastKeyCode == 46)) {
|
|
8235
|
+
for (let f of a)
|
|
8236
|
+
if (f.nodeName == "BR" && f.parentNode) {
|
|
8237
|
+
let d = f.nextSibling;
|
|
8238
|
+
d && d.nodeType == 1 && d.contentEditable == "false" && f.parentNode.removeChild(f);
|
|
8239
|
+
}
|
|
8219
8240
|
}
|
|
8220
8241
|
let c = null;
|
|
8221
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Gt(n) && (c = Kn(e)) && c.eq(N.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, de(e), this.currentSelection.set(n), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o),
|
|
8242
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Gt(n) && (c = Kn(e)) && c.eq(N.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, de(e), this.currentSelection.set(n), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), ha(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || de(e), this.currentSelection.set(n));
|
|
8222
8243
|
}
|
|
8223
8244
|
registerMutation(e, t) {
|
|
8224
8245
|
if (t.indexOf(e.target) > -1)
|
|
@@ -8240,7 +8261,7 @@ class ca {
|
|
|
8240
8261
|
let { previousSibling: d, nextSibling: h } = e.addedNodes[f];
|
|
8241
8262
|
(!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (i = d), (!h || Array.prototype.indexOf.call(e.addedNodes, h) < 0) && (s = h);
|
|
8242
8263
|
}
|
|
8243
|
-
let o = i && i.parentNode == e.target ?
|
|
8264
|
+
let o = i && i.parentNode == e.target ? $(i) + 1 : 0, l = n.localPosFromDOM(e.target, o, -1), a = s && s.parentNode == e.target ? $(s) : e.target.childNodes.length, c = n.localPosFromDOM(e.target, a, 1);
|
|
8244
8265
|
return { from: l, to: c };
|
|
8245
8266
|
} else return e.type == "attributes" ? { from: n.posAtStart - n.border, to: n.posAtEnd + n.border } : (this.lastChangedTextNode = e.target, {
|
|
8246
8267
|
from: n.posAtStart,
|
|
@@ -8254,7 +8275,7 @@ class ca {
|
|
|
8254
8275
|
}
|
|
8255
8276
|
}
|
|
8256
8277
|
let Gr = /* @__PURE__ */ new WeakMap(), _r = !1;
|
|
8257
|
-
function
|
|
8278
|
+
function ha(r) {
|
|
8258
8279
|
if (!Gr.has(r) && (Gr.set(r, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace) !== -1)) {
|
|
8259
8280
|
if (r.requiresGeckoHackNode = te, _r)
|
|
8260
8281
|
return;
|
|
@@ -8265,7 +8286,7 @@ function Yr(r, e) {
|
|
|
8265
8286
|
let t = e.startContainer, n = e.startOffset, i = e.endContainer, s = e.endOffset, o = r.domAtPos(r.state.selection.anchor);
|
|
8266
8287
|
return Be(o.node, o.offset, i, s) && ([t, n, i, s] = [i, s, t, n]), { anchorNode: t, anchorOffset: n, focusNode: i, focusOffset: s };
|
|
8267
8288
|
}
|
|
8268
|
-
function
|
|
8289
|
+
function ua(r, e) {
|
|
8269
8290
|
if (e.getComposedRanges) {
|
|
8270
8291
|
let i = e.getComposedRanges(r.root)[0];
|
|
8271
8292
|
if (i)
|
|
@@ -8277,7 +8298,7 @@ function da(r, e) {
|
|
|
8277
8298
|
}
|
|
8278
8299
|
return r.dom.addEventListener("beforeinput", n, !0), document.execCommand("indent"), r.dom.removeEventListener("beforeinput", n, !0), t ? Yr(r, t) : null;
|
|
8279
8300
|
}
|
|
8280
|
-
function
|
|
8301
|
+
function pa(r, e) {
|
|
8281
8302
|
for (let t = e.parentNode; t && t != r.dom; t = t.parentNode) {
|
|
8282
8303
|
let n = r.docView.nearestDesc(t, !0);
|
|
8283
8304
|
if (n && n.node.isBlock)
|
|
@@ -8285,16 +8306,16 @@ function ha(r, e) {
|
|
|
8285
8306
|
}
|
|
8286
8307
|
return null;
|
|
8287
8308
|
}
|
|
8288
|
-
function
|
|
8309
|
+
function ma(r, e, t) {
|
|
8289
8310
|
let { node: n, fromOffset: i, toOffset: s, from: o, to: l } = r.docView.parseRange(e, t), a = r.domSelectionRange(), c, f = a.anchorNode;
|
|
8290
|
-
if (f && r.dom.contains(f.nodeType == 1 ? f : f.parentNode) && (c = [{ node: f, offset: a.anchorOffset }], Gt(a) || c.push({ node: a.focusNode, offset: a.focusOffset })),
|
|
8311
|
+
if (f && r.dom.contains(f.nodeType == 1 ? f : f.parentNode) && (c = [{ node: f, offset: a.anchorOffset }], Gt(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), z && r.input.lastKeyCode === 8)
|
|
8291
8312
|
for (let g = s; g > i; g--) {
|
|
8292
|
-
let y = n.childNodes[g - 1],
|
|
8293
|
-
if (y.nodeName == "BR" && !
|
|
8313
|
+
let y = n.childNodes[g - 1], w = y.pmViewDesc;
|
|
8314
|
+
if (y.nodeName == "BR" && !w) {
|
|
8294
8315
|
s = g;
|
|
8295
8316
|
break;
|
|
8296
8317
|
}
|
|
8297
|
-
if (!
|
|
8318
|
+
if (!w || w.size)
|
|
8298
8319
|
break;
|
|
8299
8320
|
}
|
|
8300
8321
|
let d = r.state.doc, h = r.someProp("domParser") || ke.fromSchema(r.state.schema), u = d.resolve(o), p = null, m = h.parse(n, {
|
|
@@ -8305,7 +8326,7 @@ function ua(r, e, t) {
|
|
|
8305
8326
|
to: s,
|
|
8306
8327
|
preserveWhitespace: u.parent.type.whitespace == "pre" ? "full" : !0,
|
|
8307
8328
|
findPositions: c,
|
|
8308
|
-
ruleFromNode:
|
|
8329
|
+
ruleFromNode: ga,
|
|
8309
8330
|
context: u
|
|
8310
8331
|
});
|
|
8311
8332
|
if (c && c[0].pos != null) {
|
|
@@ -8314,39 +8335,39 @@ function ua(r, e, t) {
|
|
|
8314
8335
|
}
|
|
8315
8336
|
return { doc: m, sel: p, from: o, to: l };
|
|
8316
8337
|
}
|
|
8317
|
-
function
|
|
8338
|
+
function ga(r) {
|
|
8318
8339
|
let e = r.pmViewDesc;
|
|
8319
8340
|
if (e)
|
|
8320
8341
|
return e.parseRule();
|
|
8321
8342
|
if (r.nodeName == "BR" && r.parentNode) {
|
|
8322
|
-
if (
|
|
8343
|
+
if (q && /^(ul|ol)$/i.test(r.parentNode.nodeName)) {
|
|
8323
8344
|
let t = document.createElement("div");
|
|
8324
8345
|
return t.appendChild(document.createElement("li")), { skip: t };
|
|
8325
|
-
} else if (r.parentNode.lastChild == r ||
|
|
8346
|
+
} else if (r.parentNode.lastChild == r || q && /^(tr|table)$/i.test(r.parentNode.nodeName))
|
|
8326
8347
|
return { ignore: !0 };
|
|
8327
8348
|
} else if (r.nodeName == "IMG" && r.getAttribute("mark-placeholder"))
|
|
8328
8349
|
return { ignore: !0 };
|
|
8329
8350
|
return null;
|
|
8330
8351
|
}
|
|
8331
|
-
const
|
|
8332
|
-
function
|
|
8352
|
+
const ya = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
8353
|
+
function ba(r, e, t, n, i) {
|
|
8333
8354
|
let s = r.input.compositionPendingChanges || (r.composing ? r.input.compositionID : 0);
|
|
8334
8355
|
if (r.input.compositionPendingChanges = 0, e < 0) {
|
|
8335
|
-
let
|
|
8356
|
+
let M = r.input.lastSelectionTime > Date.now() - 50 ? r.input.lastSelectionOrigin : null, E = Kn(r, M);
|
|
8336
8357
|
if (E && !r.state.selection.eq(E)) {
|
|
8337
|
-
if (
|
|
8358
|
+
if (z && ce && r.input.lastKeyCode === 13 && Date.now() - 100 < r.input.lastKeyCodeTime && r.someProp("handleKeyDown", (qs) => qs(r, Oe(13, "Enter"))))
|
|
8338
8359
|
return;
|
|
8339
|
-
let
|
|
8340
|
-
|
|
8360
|
+
let J = r.state.tr.setSelection(E);
|
|
8361
|
+
M == "pointer" ? J.setMeta("pointer", !0) : M == "key" && J.scrollIntoView(), s && J.setMeta("composition", s), r.dispatch(J);
|
|
8341
8362
|
}
|
|
8342
8363
|
return;
|
|
8343
8364
|
}
|
|
8344
8365
|
let o = r.state.doc.resolve(e), l = o.sharedDepth(t);
|
|
8345
8366
|
e = o.before(l + 1), t = r.state.doc.resolve(t).after(l + 1);
|
|
8346
|
-
let a = r.state.selection, c =
|
|
8367
|
+
let a = r.state.selection, c = ma(r, e, t), f = r.state.doc, d = f.slice(c.from, c.to), h, u;
|
|
8347
8368
|
r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (h = r.state.selection.to, u = "end") : (h = r.state.selection.from, u = "start"), r.input.lastKeyCode = null;
|
|
8348
|
-
let p =
|
|
8349
|
-
if (p && r.input.domChangeCount++, (Ze && r.input.lastIOSEnter > Date.now() - 225 || ce) && i.some((
|
|
8369
|
+
let p = Sa(d.content, c.doc.content, c.from, h, u);
|
|
8370
|
+
if (p && r.input.domChangeCount++, (Ze && r.input.lastIOSEnter > Date.now() - 225 || ce) && i.some((M) => M.nodeType == 1 && !ya.test(M.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (M) => M(r, Oe(13, "Enter")))) {
|
|
8350
8371
|
r.input.lastIOSEnter = 0;
|
|
8351
8372
|
return;
|
|
8352
8373
|
}
|
|
@@ -8355,51 +8376,51 @@ function ga(r, e, t, n, i) {
|
|
|
8355
8376
|
p = { start: a.from, endA: a.to, endB: a.to };
|
|
8356
8377
|
else {
|
|
8357
8378
|
if (c.sel) {
|
|
8358
|
-
let
|
|
8359
|
-
if (
|
|
8360
|
-
let E = r.state.tr.setSelection(
|
|
8379
|
+
let M = Xr(r, r.state.doc, c.sel);
|
|
8380
|
+
if (M && !M.eq(r.state.selection)) {
|
|
8381
|
+
let E = r.state.tr.setSelection(M);
|
|
8361
8382
|
s && E.setMeta("composition", s), r.dispatch(E);
|
|
8362
8383
|
}
|
|
8363
8384
|
}
|
|
8364
8385
|
return;
|
|
8365
8386
|
}
|
|
8366
8387
|
r.state.selection.from < r.state.selection.to && p.start == p.endB && r.state.selection instanceof O && (p.start > r.state.selection.from && p.start <= r.state.selection.from + 2 && r.state.selection.from >= c.from ? p.start = r.state.selection.from : p.endA < r.state.selection.to && p.endA >= r.state.selection.to - 2 && r.state.selection.to <= c.to && (p.endB += r.state.selection.to - p.endA, p.endA = r.state.selection.to)), G && xe <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
8367
|
-
let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = f.resolve(p.start),
|
|
8368
|
-
if ((Ze && r.input.lastIOSEnter > Date.now() - 225 && (!
|
|
8388
|
+
let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = f.resolve(p.start), w = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA;
|
|
8389
|
+
if ((Ze && r.input.lastIOSEnter > Date.now() - 225 && (!w || i.some((M) => M.nodeName == "DIV" || M.nodeName == "P")) || !w && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && m.pos < g.pos && !/\S/.test(c.doc.textBetween(m.pos, g.pos, "", ""))) && r.someProp("handleKeyDown", (M) => M(r, Oe(13, "Enter")))) {
|
|
8369
8390
|
r.input.lastIOSEnter = 0;
|
|
8370
8391
|
return;
|
|
8371
8392
|
}
|
|
8372
|
-
if (r.state.selection.anchor > p.start &&
|
|
8373
|
-
ce &&
|
|
8393
|
+
if (r.state.selection.anchor > p.start && xa(f, p.start, p.endA, m, g) && r.someProp("handleKeyDown", (M) => M(r, Oe(8, "Backspace")))) {
|
|
8394
|
+
ce && z && r.domObserver.suppressSelectionUpdates();
|
|
8374
8395
|
return;
|
|
8375
8396
|
}
|
|
8376
|
-
|
|
8377
|
-
r.someProp("handleKeyDown", function(
|
|
8378
|
-
return
|
|
8397
|
+
z && p.endB == p.start && (r.input.lastChromeDelete = Date.now()), ce && !w && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
8398
|
+
r.someProp("handleKeyDown", function(M) {
|
|
8399
|
+
return M(r, Oe(13, "Enter"));
|
|
8379
8400
|
});
|
|
8380
8401
|
}, 20));
|
|
8381
|
-
let
|
|
8382
|
-
let E =
|
|
8402
|
+
let C = p.start, I = p.endA, A = (M) => {
|
|
8403
|
+
let E = M || r.state.tr.replace(C, I, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
8383
8404
|
if (c.sel) {
|
|
8384
|
-
let
|
|
8385
|
-
|
|
8405
|
+
let J = Xr(r, E.doc, c.sel);
|
|
8406
|
+
J && !(z && r.composing && J.empty && (p.start != p.endB || r.input.lastChromeDelete < Date.now() - 100) && (J.head == C || J.head == E.mapping.map(I) - 1) || G && J.empty && J.head == C) && E.setSelection(J);
|
|
8386
8407
|
}
|
|
8387
8408
|
return s && E.setMeta("composition", s), E.scrollIntoView();
|
|
8388
8409
|
}, P;
|
|
8389
|
-
if (
|
|
8410
|
+
if (w)
|
|
8390
8411
|
if (m.pos == g.pos) {
|
|
8391
8412
|
G && xe <= 11 && m.parentOffset == 0 && (r.domObserver.suppressSelectionUpdates(), setTimeout(() => de(r), 20));
|
|
8392
|
-
let
|
|
8393
|
-
E &&
|
|
8413
|
+
let M = A(r.state.tr.delete(C, I)), E = f.resolve(p.start).marksAcross(f.resolve(p.endA));
|
|
8414
|
+
E && M.ensureMarks(E), r.dispatch(M);
|
|
8394
8415
|
} else if (
|
|
8395
8416
|
// Adding or removing a mark
|
|
8396
|
-
p.endA == p.endB && (P =
|
|
8417
|
+
p.endA == p.endB && (P = ka(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
|
|
8397
8418
|
) {
|
|
8398
|
-
let
|
|
8399
|
-
P.type == "add" ?
|
|
8419
|
+
let M = A(r.state.tr);
|
|
8420
|
+
P.type == "add" ? M.addMark(C, I, P.mark) : M.removeMark(C, I, P.mark), r.dispatch(M);
|
|
8400
8421
|
} else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
8401
|
-
let
|
|
8402
|
-
r.someProp("handleTextInput", (
|
|
8422
|
+
let M = m.parent.textBetween(m.parentOffset, g.parentOffset), E = () => A(r.state.tr.insertText(M, C, I));
|
|
8423
|
+
r.someProp("handleTextInput", (J) => J(r, C, I, M, E)) || r.dispatch(E());
|
|
8403
8424
|
} else
|
|
8404
8425
|
r.dispatch(A());
|
|
8405
8426
|
else
|
|
@@ -8408,7 +8429,7 @@ function ga(r, e, t, n, i) {
|
|
|
8408
8429
|
function Xr(r, e, t) {
|
|
8409
8430
|
return Math.max(t.anchor, t.head) > e.content.size ? null : Hn(r, e.resolve(t.anchor), e.resolve(t.head));
|
|
8410
8431
|
}
|
|
8411
|
-
function
|
|
8432
|
+
function ka(r, e) {
|
|
8412
8433
|
let t = r.firstChild.marks, n = e.firstChild.marks, i = t, s = n, o, l, a;
|
|
8413
8434
|
for (let f = 0; f < n.length; f++)
|
|
8414
8435
|
i = n[f].removeFromSet(i);
|
|
@@ -8426,7 +8447,7 @@ function ya(r, e) {
|
|
|
8426
8447
|
if (b.from(c).eq(r))
|
|
8427
8448
|
return { mark: l, type: o };
|
|
8428
8449
|
}
|
|
8429
|
-
function
|
|
8450
|
+
function xa(r, e, t, n, i) {
|
|
8430
8451
|
if (
|
|
8431
8452
|
// The content must have shrunk
|
|
8432
8453
|
t - e <= i.pos - n.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
@@ -8454,7 +8475,7 @@ function mn(r, e, t) {
|
|
|
8454
8475
|
}
|
|
8455
8476
|
return i;
|
|
8456
8477
|
}
|
|
8457
|
-
function
|
|
8478
|
+
function Sa(r, e, t, n, i) {
|
|
8458
8479
|
let s = r.findDiffStart(e, t);
|
|
8459
8480
|
if (s == null)
|
|
8460
8481
|
return null;
|
|
@@ -8478,7 +8499,7 @@ function Zr(r) {
|
|
|
8478
8499
|
let e = r.charCodeAt(0), t = r.charCodeAt(1);
|
|
8479
8500
|
return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
|
|
8480
8501
|
}
|
|
8481
|
-
class
|
|
8502
|
+
class Ns {
|
|
8482
8503
|
/**
|
|
8483
8504
|
Create a view. `place` may be a DOM node that the editor should
|
|
8484
8505
|
be appended to, a function that will place it into the document,
|
|
@@ -8487,7 +8508,7 @@ class Os {
|
|
|
8487
8508
|
added to the document.
|
|
8488
8509
|
*/
|
|
8489
8510
|
constructor(e, t) {
|
|
8490
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Vl(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ri), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = ti(this), ei(this), this.nodeViews = ni(this), this.docView = Pr(this.state.doc, Qr(this), pn(this), this.dom, this), this.domObserver = new
|
|
8511
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Vl(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ri), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = ti(this), ei(this), this.nodeViews = ni(this), this.docView = Pr(this.state.doc, Qr(this), pn(this), this.dom, this), this.domObserver = new da(this, (n, i, s, o) => ba(this, n, i, s, o)), this.domObserver.start(), Ll(this), this.updatePluginViews();
|
|
8491
8512
|
}
|
|
8492
8513
|
/**
|
|
8493
8514
|
Holds `true` when a
|
|
@@ -8543,11 +8564,11 @@ class Os {
|
|
|
8543
8564
|
updateStateInner(e, t) {
|
|
8544
8565
|
var n;
|
|
8545
8566
|
let i = this.state, s = !1, o = !1;
|
|
8546
|
-
e.storedMarks && this.composing && (
|
|
8567
|
+
e.storedMarks && this.composing && (ks(this), o = !0), this.state = e;
|
|
8547
8568
|
let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
8548
8569
|
if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
8549
8570
|
let u = ni(this);
|
|
8550
|
-
|
|
8571
|
+
Ma(u, this.nodeViews) && (this.nodeViews = u, s = !0);
|
|
8551
8572
|
}
|
|
8552
8573
|
(l || t.handleDOMEvents != this._props.handleDOMEvents) && zn(this), this.editable = ti(this), ei(this);
|
|
8553
8574
|
let a = pn(this), c = Qr(this), f = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", d = s || !this.docView.matchesNode(e.doc, c, a);
|
|
@@ -8555,12 +8576,12 @@ class Os {
|
|
|
8555
8576
|
let h = f == "preserve" && o && this.dom.style.overflowAnchor == null && Qo(this);
|
|
8556
8577
|
if (o) {
|
|
8557
8578
|
this.domObserver.stop();
|
|
8558
|
-
let u = d && (G ||
|
|
8579
|
+
let u = d && (G || z) && !this.composing && !i.selection.empty && !e.selection.empty && Ca(i.selection, e.selection);
|
|
8559
8580
|
if (d) {
|
|
8560
|
-
let p =
|
|
8561
|
-
this.composing && (this.input.compositionNode =
|
|
8581
|
+
let p = z ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
8582
|
+
this.composing && (this.input.compositionNode = Ql(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Pr(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (u = !0);
|
|
8562
8583
|
}
|
|
8563
|
-
u || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Ml(this)) ? de(this, u) : (
|
|
8584
|
+
u || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Ml(this)) ? de(this, u) : (ls(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
8564
8585
|
}
|
|
8565
8586
|
this.updatePluginViews(i), !((n = this.dragging) === null || n === void 0) && n.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), f == "reset" ? this.dom.scrollTop = 0 : f == "to selection" ? this.scrollToSelection() : h && el(h);
|
|
8566
8587
|
}
|
|
@@ -8607,7 +8628,7 @@ class Os {
|
|
|
8607
8628
|
let s = n.from + (this.state.doc.content.size - t.doc.content.size);
|
|
8608
8629
|
(s > 0 && this.state.doc.nodeAt(s)) == n.node && (i = s);
|
|
8609
8630
|
}
|
|
8610
|
-
this.dragging = new
|
|
8631
|
+
this.dragging = new Ss(e.slice, e.move, i < 0 ? void 0 : S.create(this.state.doc, i));
|
|
8611
8632
|
}
|
|
8612
8633
|
someProp(e, t) {
|
|
8613
8634
|
let n = this._props && this._props[e], i;
|
|
@@ -8694,7 +8715,7 @@ class Os {
|
|
|
8694
8715
|
otherwise the element after.
|
|
8695
8716
|
*/
|
|
8696
8717
|
coordsAtPos(e, t = 1) {
|
|
8697
|
-
return
|
|
8718
|
+
return Zi(this, e, t);
|
|
8698
8719
|
}
|
|
8699
8720
|
/**
|
|
8700
8721
|
Find the DOM position that corresponds to the given document
|
|
@@ -8780,7 +8801,7 @@ class Os {
|
|
|
8780
8801
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
8781
8802
|
*/
|
|
8782
8803
|
destroy() {
|
|
8783
|
-
this.docView && ($l(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], pn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null,
|
|
8804
|
+
this.docView && ($l(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], pn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, jo());
|
|
8784
8805
|
}
|
|
8785
8806
|
/**
|
|
8786
8807
|
This is true when the view has been
|
|
@@ -8801,7 +8822,7 @@ class Os {
|
|
|
8801
8822
|
*/
|
|
8802
8823
|
domSelectionRange() {
|
|
8803
8824
|
let e = this.domSelection();
|
|
8804
|
-
return e ?
|
|
8825
|
+
return e ? q && this.root.nodeType === 11 && Go(this.dom.ownerDocument) == this.dom && ua(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
8805
8826
|
}
|
|
8806
8827
|
/**
|
|
8807
8828
|
@internal
|
|
@@ -8810,7 +8831,7 @@ class Os {
|
|
|
8810
8831
|
return this.root.getSelection();
|
|
8811
8832
|
}
|
|
8812
8833
|
}
|
|
8813
|
-
|
|
8834
|
+
Ns.prototype.dispatch = function(r) {
|
|
8814
8835
|
let e = this._props.dispatchTransaction;
|
|
8815
8836
|
e ? e.call(this, r) : this.updateState(this.state.apply(r));
|
|
8816
8837
|
};
|
|
@@ -8832,7 +8853,7 @@ function ei(r) {
|
|
|
8832
8853
|
function ti(r) {
|
|
8833
8854
|
return !r.someProp("editable", (e) => e(r.state) === !1);
|
|
8834
8855
|
}
|
|
8835
|
-
function
|
|
8856
|
+
function Ca(r, e) {
|
|
8836
8857
|
let t = Math.min(r.$anchor.sharedDepth(r.head), e.$anchor.sharedDepth(e.head));
|
|
8837
8858
|
return r.$anchor.start(t) != e.$anchor.start(t);
|
|
8838
8859
|
}
|
|
@@ -8844,7 +8865,7 @@ function ni(r) {
|
|
|
8844
8865
|
}
|
|
8845
8866
|
return r.someProp("nodeViews", t), r.someProp("markViews", t), e;
|
|
8846
8867
|
}
|
|
8847
|
-
function
|
|
8868
|
+
function Ma(r, e) {
|
|
8848
8869
|
let t = 0, n = 0;
|
|
8849
8870
|
for (let i in r) {
|
|
8850
8871
|
if (r[i] != e[i])
|
|
@@ -8937,18 +8958,18 @@ var Me = {
|
|
|
8937
8958
|
220: "|",
|
|
8938
8959
|
221: "}",
|
|
8939
8960
|
222: '"'
|
|
8940
|
-
},
|
|
8941
|
-
for (var
|
|
8942
|
-
for (var
|
|
8943
|
-
for (var
|
|
8944
|
-
Me[
|
|
8961
|
+
}, wa = typeof navigator < "u" && /Mac/.test(navigator.platform), Oa = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
8962
|
+
for (var W = 0; W < 10; W++) Me[48 + W] = Me[96 + W] = String(W);
|
|
8963
|
+
for (var W = 1; W <= 24; W++) Me[W + 111] = "F" + W;
|
|
8964
|
+
for (var W = 65; W <= 90; W++)
|
|
8965
|
+
Me[W] = String.fromCharCode(W + 32), Wt[W] = String.fromCharCode(W);
|
|
8945
8966
|
for (var gn in Me) Wt.hasOwnProperty(gn) || (Wt[gn] = Me[gn]);
|
|
8946
|
-
function
|
|
8947
|
-
var e =
|
|
8967
|
+
function Na(r) {
|
|
8968
|
+
var e = wa && r.metaKey && r.shiftKey && !r.ctrlKey && !r.altKey || Oa && r.shiftKey && r.key && r.key.length == 1 || r.key == "Unidentified", t = !e && r.key || (r.shiftKey ? Wt : Me)[r.keyCode] || r.key || "Unidentified";
|
|
8948
8969
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
8949
8970
|
}
|
|
8950
|
-
const
|
|
8951
|
-
function
|
|
8971
|
+
const Ta = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), Ea = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
8972
|
+
function Da(r) {
|
|
8952
8973
|
let e = r.split(/-(?!$)/), t = e[e.length - 1];
|
|
8953
8974
|
t == "Space" && (t = " ");
|
|
8954
8975
|
let n, i, s, o;
|
|
@@ -8963,28 +8984,28 @@ function Ta(r) {
|
|
|
8963
8984
|
else if (/^s(hift)?$/i.test(a))
|
|
8964
8985
|
s = !0;
|
|
8965
8986
|
else if (/^mod$/i.test(a))
|
|
8966
|
-
|
|
8987
|
+
Ta ? o = !0 : i = !0;
|
|
8967
8988
|
else
|
|
8968
8989
|
throw new Error("Unrecognized modifier name: " + a);
|
|
8969
8990
|
}
|
|
8970
8991
|
return n && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
|
|
8971
8992
|
}
|
|
8972
|
-
function
|
|
8993
|
+
function Aa(r) {
|
|
8973
8994
|
let e = /* @__PURE__ */ Object.create(null);
|
|
8974
8995
|
for (let t in r)
|
|
8975
|
-
e[
|
|
8996
|
+
e[Da(t)] = r[t];
|
|
8976
8997
|
return e;
|
|
8977
8998
|
}
|
|
8978
8999
|
function yn(r, e, t = !0) {
|
|
8979
9000
|
return e.altKey && (r = "Alt-" + r), e.ctrlKey && (r = "Ctrl-" + r), e.metaKey && (r = "Meta-" + r), t && e.shiftKey && (r = "Shift-" + r), r;
|
|
8980
9001
|
}
|
|
8981
|
-
function
|
|
8982
|
-
return new oe({ props: { handleKeyDown:
|
|
9002
|
+
function Ia(r) {
|
|
9003
|
+
return new oe({ props: { handleKeyDown: Ra(r) } });
|
|
8983
9004
|
}
|
|
8984
|
-
function
|
|
8985
|
-
let e =
|
|
9005
|
+
function Ra(r) {
|
|
9006
|
+
let e = Aa(r);
|
|
8986
9007
|
return function(t, n) {
|
|
8987
|
-
let i =
|
|
9008
|
+
let i = Na(n), s, o = e[yn(i, n)];
|
|
8988
9009
|
if (o && o(t.state, t.dispatch, t))
|
|
8989
9010
|
return !0;
|
|
8990
9011
|
if (i.length == 1 && i != " ") {
|
|
@@ -8994,7 +9015,7 @@ function Aa(r) {
|
|
|
8994
9015
|
return !0;
|
|
8995
9016
|
}
|
|
8996
9017
|
if ((n.altKey || n.metaKey || n.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
8997
|
-
!(
|
|
9018
|
+
!(Ea && n.ctrlKey && n.altKey) && (s = Me[n.keyCode]) && s != i) {
|
|
8998
9019
|
let l = e[yn(s, n)];
|
|
8999
9020
|
if (l && l(t.state, t.dispatch, t))
|
|
9000
9021
|
return !0;
|
|
@@ -9003,13 +9024,13 @@ function Aa(r) {
|
|
|
9003
9024
|
return !1;
|
|
9004
9025
|
};
|
|
9005
9026
|
}
|
|
9006
|
-
const
|
|
9007
|
-
function
|
|
9027
|
+
const Pa = (r, e) => r.selection.empty ? !1 : (e && e(r.tr.deleteSelection().scrollIntoView()), !0);
|
|
9028
|
+
function Ts(r, e) {
|
|
9008
9029
|
let { $cursor: t } = r.selection;
|
|
9009
9030
|
return !t || (e ? !e.endOfTextblock("backward", r) : t.parentOffset > 0) ? null : t;
|
|
9010
9031
|
}
|
|
9011
|
-
const
|
|
9012
|
-
let n =
|
|
9032
|
+
const va = (r, e, t) => {
|
|
9033
|
+
let n = Ts(r, t);
|
|
9013
9034
|
if (!n)
|
|
9014
9035
|
return !1;
|
|
9015
9036
|
let i = Qn(n);
|
|
@@ -9018,7 +9039,7 @@ const Ra = (r, e, t) => {
|
|
|
9018
9039
|
return l == null ? !1 : (e && e(r.tr.lift(o, l).scrollIntoView()), !0);
|
|
9019
9040
|
}
|
|
9020
9041
|
let s = i.nodeBefore;
|
|
9021
|
-
if (
|
|
9042
|
+
if (Is(r, i, e, -1))
|
|
9022
9043
|
return !0;
|
|
9023
9044
|
if (n.parent.content.size == 0 && (Qe(s, "end") || S.isSelectable(s)))
|
|
9024
9045
|
for (let o = n.depth; ; o--) {
|
|
@@ -9034,20 +9055,20 @@ const Ra = (r, e, t) => {
|
|
|
9034
9055
|
break;
|
|
9035
9056
|
}
|
|
9036
9057
|
return s.isAtom && i.depth == n.depth - 1 ? (e && e(r.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
|
|
9037
|
-
},
|
|
9038
|
-
let n =
|
|
9058
|
+
}, Ba = (r, e, t) => {
|
|
9059
|
+
let n = Ts(r, t);
|
|
9039
9060
|
if (!n)
|
|
9040
9061
|
return !1;
|
|
9041
9062
|
let i = Qn(n);
|
|
9042
|
-
return i ?
|
|
9043
|
-
},
|
|
9044
|
-
let n =
|
|
9063
|
+
return i ? Es(r, i, e) : !1;
|
|
9064
|
+
}, za = (r, e, t) => {
|
|
9065
|
+
let n = Ds(r, t);
|
|
9045
9066
|
if (!n)
|
|
9046
9067
|
return !1;
|
|
9047
9068
|
let i = er(n);
|
|
9048
|
-
return i ?
|
|
9069
|
+
return i ? Es(r, i, e) : !1;
|
|
9049
9070
|
};
|
|
9050
|
-
function
|
|
9071
|
+
function Es(r, e, t) {
|
|
9051
9072
|
let n = e.nodeBefore, i = n, s = e.pos - 1;
|
|
9052
9073
|
for (; !i.isTextblock; s--) {
|
|
9053
9074
|
if (i.type.spec.isolating)
|
|
@@ -9084,7 +9105,7 @@ function Qe(r, e, t = !1) {
|
|
|
9084
9105
|
}
|
|
9085
9106
|
return !1;
|
|
9086
9107
|
}
|
|
9087
|
-
const
|
|
9108
|
+
const Fa = (r, e, t) => {
|
|
9088
9109
|
let { $head: n, empty: i } = r.selection, s = n;
|
|
9089
9110
|
if (!i)
|
|
9090
9111
|
return !1;
|
|
@@ -9106,19 +9127,19 @@ function Qn(r) {
|
|
|
9106
9127
|
}
|
|
9107
9128
|
return null;
|
|
9108
9129
|
}
|
|
9109
|
-
function
|
|
9130
|
+
function Ds(r, e) {
|
|
9110
9131
|
let { $cursor: t } = r.selection;
|
|
9111
9132
|
return !t || (e ? !e.endOfTextblock("forward", r) : t.parentOffset < t.parent.content.size) ? null : t;
|
|
9112
9133
|
}
|
|
9113
|
-
const
|
|
9114
|
-
let n =
|
|
9134
|
+
const Va = (r, e, t) => {
|
|
9135
|
+
let n = Ds(r, t);
|
|
9115
9136
|
if (!n)
|
|
9116
9137
|
return !1;
|
|
9117
9138
|
let i = er(n);
|
|
9118
9139
|
if (!i)
|
|
9119
9140
|
return !1;
|
|
9120
9141
|
let s = i.nodeAfter;
|
|
9121
|
-
if (
|
|
9142
|
+
if (Is(r, i, e, 1))
|
|
9122
9143
|
return !0;
|
|
9123
9144
|
if (n.parent.content.size == 0 && (Qe(s, "start") || S.isSelectable(s))) {
|
|
9124
9145
|
let o = Ht(r.doc, n.before(), n.after(), k.empty);
|
|
@@ -9131,7 +9152,7 @@ const za = (r, e, t) => {
|
|
|
9131
9152
|
}
|
|
9132
9153
|
}
|
|
9133
9154
|
return s.isAtom && i.depth == n.depth - 1 ? (e && e(r.tr.delete(i.pos, i.pos + s.nodeSize).scrollIntoView()), !0) : !1;
|
|
9134
|
-
},
|
|
9155
|
+
}, La = (r, e, t) => {
|
|
9135
9156
|
let { $head: n, empty: i } = r.selection, s = n;
|
|
9136
9157
|
if (!i)
|
|
9137
9158
|
return !1;
|
|
@@ -9154,7 +9175,7 @@ function er(r) {
|
|
|
9154
9175
|
}
|
|
9155
9176
|
return null;
|
|
9156
9177
|
}
|
|
9157
|
-
const
|
|
9178
|
+
const $a = (r, e) => {
|
|
9158
9179
|
let t = r.selection, n = t instanceof S, i;
|
|
9159
9180
|
if (n) {
|
|
9160
9181
|
if (t.node.isTextblock || !Ve(r.doc, t.from))
|
|
@@ -9167,7 +9188,7 @@ const Va = (r, e) => {
|
|
|
9167
9188
|
n && s.setSelection(S.create(s.doc, i - r.doc.resolve(i).nodeBefore.nodeSize)), e(s.scrollIntoView());
|
|
9168
9189
|
}
|
|
9169
9190
|
return !0;
|
|
9170
|
-
},
|
|
9191
|
+
}, Wa = (r, e) => {
|
|
9171
9192
|
let t = r.selection, n;
|
|
9172
9193
|
if (t instanceof S) {
|
|
9173
9194
|
if (t.node.isTextblock || !Ve(r.doc, t.to))
|
|
@@ -9176,15 +9197,15 @@ const Va = (r, e) => {
|
|
|
9176
9197
|
} else if (n = Kt(r.doc, t.to, 1), n == null)
|
|
9177
9198
|
return !1;
|
|
9178
9199
|
return e && e(r.tr.join(n).scrollIntoView()), !0;
|
|
9179
|
-
},
|
|
9200
|
+
}, Ja = (r, e) => {
|
|
9180
9201
|
let { $from: t, $to: n } = r.selection, i = t.blockRange(n), s = i && et(i);
|
|
9181
9202
|
return s == null ? !1 : (e && e(r.tr.lift(i, s).scrollIntoView()), !0);
|
|
9182
|
-
},
|
|
9203
|
+
}, ja = (r, e) => {
|
|
9183
9204
|
let { $head: t, $anchor: n } = r.selection;
|
|
9184
9205
|
return !t.parent.type.spec.code || !t.sameParent(n) ? !1 : (e && e(r.tr.insertText(`
|
|
9185
9206
|
`).scrollIntoView()), !0);
|
|
9186
9207
|
};
|
|
9187
|
-
function
|
|
9208
|
+
function As(r) {
|
|
9188
9209
|
for (let e = 0; e < r.edgeCount; e++) {
|
|
9189
9210
|
let { type: t } = r.edge(e);
|
|
9190
9211
|
if (t.isTextblock && !t.hasRequiredAttrs())
|
|
@@ -9192,11 +9213,11 @@ function Ds(r) {
|
|
|
9192
9213
|
}
|
|
9193
9214
|
return null;
|
|
9194
9215
|
}
|
|
9195
|
-
const
|
|
9216
|
+
const qa = (r, e) => {
|
|
9196
9217
|
let { $head: t, $anchor: n } = r.selection;
|
|
9197
9218
|
if (!t.parent.type.spec.code || !t.sameParent(n))
|
|
9198
9219
|
return !1;
|
|
9199
|
-
let i = t.node(-1), s = t.indexAfter(-1), o =
|
|
9220
|
+
let i = t.node(-1), s = t.indexAfter(-1), o = As(i.contentMatchAt(s));
|
|
9200
9221
|
if (!o || !i.canReplaceWith(s, s, o))
|
|
9201
9222
|
return !1;
|
|
9202
9223
|
if (e) {
|
|
@@ -9204,11 +9225,11 @@ const Ja = (r, e) => {
|
|
|
9204
9225
|
a.setSelection(N.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
|
|
9205
9226
|
}
|
|
9206
9227
|
return !0;
|
|
9207
|
-
},
|
|
9228
|
+
}, Ka = (r, e) => {
|
|
9208
9229
|
let t = r.selection, { $from: n, $to: i } = t;
|
|
9209
9230
|
if (t instanceof Z || n.parent.inlineContent || i.parent.inlineContent)
|
|
9210
9231
|
return !1;
|
|
9211
|
-
let s =
|
|
9232
|
+
let s = As(i.parent.contentMatchAt(i.indexAfter()));
|
|
9212
9233
|
if (!s || !s.isTextblock)
|
|
9213
9234
|
return !1;
|
|
9214
9235
|
if (e) {
|
|
@@ -9216,7 +9237,7 @@ const Ja = (r, e) => {
|
|
|
9216
9237
|
l.setSelection(O.create(l.doc, o + 1)), e(l.scrollIntoView());
|
|
9217
9238
|
}
|
|
9218
9239
|
return !0;
|
|
9219
|
-
},
|
|
9240
|
+
}, Ha = (r, e) => {
|
|
9220
9241
|
let { $cursor: t } = r.selection;
|
|
9221
9242
|
if (!t || t.parent.content.size)
|
|
9222
9243
|
return !1;
|
|
@@ -9227,17 +9248,17 @@ const Ja = (r, e) => {
|
|
|
9227
9248
|
}
|
|
9228
9249
|
let n = t.blockRange(), i = n && et(n);
|
|
9229
9250
|
return i == null ? !1 : (e && e(r.tr.lift(n, i).scrollIntoView()), !0);
|
|
9230
|
-
},
|
|
9251
|
+
}, Ua = (r, e) => {
|
|
9231
9252
|
let { $from: t, to: n } = r.selection, i, s = t.sharedDepth(n);
|
|
9232
9253
|
return s == 0 ? !1 : (i = t.before(s), e && e(r.tr.setSelection(S.create(r.doc, i))), !0);
|
|
9233
9254
|
};
|
|
9234
|
-
function
|
|
9255
|
+
function Ga(r, e, t) {
|
|
9235
9256
|
let n = e.nodeBefore, i = e.nodeAfter, s = e.index();
|
|
9236
9257
|
return !n || !i || !n.type.compatibleContent(i.type) ? !1 : !n.content.size && e.parent.canReplace(s - 1, s) ? (t && t(r.tr.delete(e.pos - n.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || Ve(r.doc, e.pos)) ? !1 : (t && t(r.tr.join(e.pos).scrollIntoView()), !0);
|
|
9237
9258
|
}
|
|
9238
|
-
function
|
|
9259
|
+
function Is(r, e, t, n) {
|
|
9239
9260
|
let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
|
|
9240
|
-
if (!a &&
|
|
9261
|
+
if (!a && Ga(r, e, t))
|
|
9241
9262
|
return !0;
|
|
9242
9263
|
let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
|
|
9243
9264
|
if (c && (o = (l = i.contentMatchAt(i.childCount)).findWrapping(s.type)) && l.matchType(o[0] || s.type).validEnd) {
|
|
@@ -9246,7 +9267,7 @@ function As(r, e, t, n) {
|
|
|
9246
9267
|
for (let y = o.length - 1; y >= 0; y--)
|
|
9247
9268
|
p = b.from(o[y].create(null, p));
|
|
9248
9269
|
p = b.from(i.copy(p));
|
|
9249
|
-
let m = r.tr.step(new
|
|
9270
|
+
let m = r.tr.step(new F(e.pos - 1, u, e.pos, u, new k(p, 1, 0), o.length, !0)), g = m.doc.resolve(u + 2 * o.length);
|
|
9250
9271
|
g.nodeAfter && g.nodeAfter.type == i.type && Ve(m.doc, g.pos) && m.join(g.pos), t(m.scrollIntoView());
|
|
9251
9272
|
}
|
|
9252
9273
|
return !0;
|
|
@@ -9264,17 +9285,17 @@ function As(r, e, t, n) {
|
|
|
9264
9285
|
if (u.canReplace(u.childCount, u.childCount, m.content)) {
|
|
9265
9286
|
if (t) {
|
|
9266
9287
|
let y = b.empty;
|
|
9267
|
-
for (let
|
|
9268
|
-
y = b.from(p[
|
|
9269
|
-
let
|
|
9270
|
-
t(
|
|
9288
|
+
for (let C = p.length - 1; C >= 0; C--)
|
|
9289
|
+
y = b.from(p[C].copy(y));
|
|
9290
|
+
let w = r.tr.step(new F(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(y, p.length, 0), 0, !0));
|
|
9291
|
+
t(w.scrollIntoView());
|
|
9271
9292
|
}
|
|
9272
9293
|
return !0;
|
|
9273
9294
|
}
|
|
9274
9295
|
}
|
|
9275
9296
|
return !1;
|
|
9276
9297
|
}
|
|
9277
|
-
function
|
|
9298
|
+
function Rs(r) {
|
|
9278
9299
|
return function(e, t) {
|
|
9279
9300
|
let n = e.selection, i = r < 0 ? n.$from : n.$to, s = i.depth;
|
|
9280
9301
|
for (; i.node(s).isInline; ) {
|
|
@@ -9285,8 +9306,8 @@ function Is(r) {
|
|
|
9285
9306
|
return i.node(s).isTextblock ? (t && t(e.tr.setSelection(O.create(e.doc, r < 0 ? i.start(s) : i.end(s)))), !0) : !1;
|
|
9286
9307
|
};
|
|
9287
9308
|
}
|
|
9288
|
-
const
|
|
9289
|
-
function
|
|
9309
|
+
const _a = Rs(-1), Ya = Rs(1);
|
|
9310
|
+
function Xa(r, e = null) {
|
|
9290
9311
|
return function(t, n) {
|
|
9291
9312
|
let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && Bi(o, r, e);
|
|
9292
9313
|
return l ? (n && n(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
|
|
@@ -9323,16 +9344,16 @@ function ii(r, e = null) {
|
|
|
9323
9344
|
};
|
|
9324
9345
|
}
|
|
9325
9346
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
|
|
9326
|
-
function
|
|
9347
|
+
function Za(r, e = null) {
|
|
9327
9348
|
return function(t, n) {
|
|
9328
9349
|
let { $from: i, $to: s } = t.selection, o = i.blockRange(s);
|
|
9329
9350
|
if (!o)
|
|
9330
9351
|
return !1;
|
|
9331
9352
|
let l = n ? t.tr : null;
|
|
9332
|
-
return
|
|
9353
|
+
return Qa(l, o, r, e) ? (n && n(l.scrollIntoView()), !0) : !1;
|
|
9333
9354
|
};
|
|
9334
9355
|
}
|
|
9335
|
-
function
|
|
9356
|
+
function Qa(r, e, t, n = null) {
|
|
9336
9357
|
let i = !1, s = e, o = e.$from.doc;
|
|
9337
9358
|
if (e.depth >= 2 && e.$from.node(e.depth - 1).type.compatibleContent(t) && e.startIndex == 0) {
|
|
9338
9359
|
if (e.$from.index(e.depth - 1) == 0)
|
|
@@ -9341,13 +9362,13 @@ function Xa(r, e, t, n = null) {
|
|
|
9341
9362
|
s = new Pt(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new Pt(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
|
|
9342
9363
|
}
|
|
9343
9364
|
let l = Bi(s, t, n, e);
|
|
9344
|
-
return l ? (r &&
|
|
9365
|
+
return l ? (r && ec(r, e, l, i, t), !0) : !1;
|
|
9345
9366
|
}
|
|
9346
|
-
function
|
|
9367
|
+
function ec(r, e, t, n, i) {
|
|
9347
9368
|
let s = b.empty;
|
|
9348
9369
|
for (let f = t.length - 1; f >= 0; f--)
|
|
9349
9370
|
s = b.from(t[f].type.create(t[f].attrs, s));
|
|
9350
|
-
r.step(new
|
|
9371
|
+
r.step(new F(e.start - (n ? 2 : 0), e.end, e.start, e.end, new k(s, 0, 0), t.length, !0));
|
|
9351
9372
|
let o = 0;
|
|
9352
9373
|
for (let f = 0; f < t.length; f++)
|
|
9353
9374
|
t[f].type == i && (o = f + 1);
|
|
@@ -9356,15 +9377,15 @@ function Za(r, e, t, n, i) {
|
|
|
9356
9377
|
!h && Ue(r.doc, a, l) && (r.split(a, l), a += 2 * l), a += c.child(f).nodeSize;
|
|
9357
9378
|
return r;
|
|
9358
9379
|
}
|
|
9359
|
-
function
|
|
9380
|
+
function tc(r) {
|
|
9360
9381
|
return function(e, t) {
|
|
9361
9382
|
let { $from: n, $to: i } = e.selection, s = n.blockRange(i, (o) => o.childCount > 0 && o.firstChild.type == r);
|
|
9362
|
-
return s ? t ? n.node(s.depth - 1).type == r ?
|
|
9383
|
+
return s ? t ? n.node(s.depth - 1).type == r ? nc(e, t, r, s) : rc(e, t, s) : !0 : !1;
|
|
9363
9384
|
};
|
|
9364
9385
|
}
|
|
9365
|
-
function
|
|
9386
|
+
function nc(r, e, t, n) {
|
|
9366
9387
|
let i = r.tr, s = n.end, o = n.$to.end(n.depth);
|
|
9367
|
-
s < o && (i.step(new
|
|
9388
|
+
s < o && (i.step(new F(s - 1, o, s, o, new k(b.from(t.create(null, n.parent.copy())), 1, 0), 1, !0)), n = new Pt(i.doc.resolve(n.$from.pos), i.doc.resolve(o), n.depth));
|
|
9368
9389
|
const l = et(n);
|
|
9369
9390
|
if (l == null)
|
|
9370
9391
|
return !1;
|
|
@@ -9372,7 +9393,7 @@ function ec(r, e, t, n) {
|
|
|
9372
9393
|
let a = i.doc.resolve(i.mapping.map(s, -1) - 1);
|
|
9373
9394
|
return Ve(i.doc, a.pos) && a.nodeBefore.type == a.nodeAfter.type && i.join(a.pos), e(i.scrollIntoView()), !0;
|
|
9374
9395
|
}
|
|
9375
|
-
function
|
|
9396
|
+
function rc(r, e, t) {
|
|
9376
9397
|
let n = r.tr, i = t.parent;
|
|
9377
9398
|
for (let u = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
|
|
9378
9399
|
u -= i.child(p).nodeSize, n.delete(u - 1, u + 1);
|
|
@@ -9383,9 +9404,9 @@ function tc(r, e, t) {
|
|
|
9383
9404
|
if (!c.canReplace(f + (l ? 0 : 1), f + 1, o.content.append(a ? b.empty : b.from(i))))
|
|
9384
9405
|
return !1;
|
|
9385
9406
|
let d = s.pos, h = d + o.nodeSize;
|
|
9386
|
-
return n.step(new
|
|
9407
|
+
return n.step(new F(d - (l ? 1 : 0), h + (a ? 1 : 0), d + 1, h - 1, new k((l ? b.empty : b.from(i.copy(b.empty))).append(a ? b.empty : b.from(i.copy(b.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(n.scrollIntoView()), !0;
|
|
9387
9408
|
}
|
|
9388
|
-
function
|
|
9409
|
+
function ic(r) {
|
|
9389
9410
|
return function(e, t) {
|
|
9390
9411
|
let { $from: n, $to: i } = e.selection, s = n.blockRange(i, (c) => c.childCount > 0 && c.firstChild.type == r);
|
|
9391
9412
|
if (!s)
|
|
@@ -9398,7 +9419,7 @@ function nc(r) {
|
|
|
9398
9419
|
return !1;
|
|
9399
9420
|
if (t) {
|
|
9400
9421
|
let c = a.lastChild && a.lastChild.type == l.type, f = b.from(c ? r.create() : null), d = new k(b.from(r.create(null, b.from(l.type.create(null, f)))), c ? 3 : 1, 0), h = s.start, u = s.end;
|
|
9401
|
-
t(e.tr.step(new
|
|
9422
|
+
t(e.tr.step(new F(h - (c ? 3 : 1), u, h, u, d, 1, !0)).scrollIntoView());
|
|
9402
9423
|
}
|
|
9403
9424
|
return !0;
|
|
9404
9425
|
};
|
|
@@ -9488,7 +9509,7 @@ class Zt {
|
|
|
9488
9509
|
return l;
|
|
9489
9510
|
}
|
|
9490
9511
|
}
|
|
9491
|
-
class
|
|
9512
|
+
class sc {
|
|
9492
9513
|
constructor() {
|
|
9493
9514
|
this.callbacks = {};
|
|
9494
9515
|
}
|
|
@@ -9527,7 +9548,7 @@ function Qt(r) {
|
|
|
9527
9548
|
markExtensions: n
|
|
9528
9549
|
};
|
|
9529
9550
|
}
|
|
9530
|
-
function
|
|
9551
|
+
function Ps(r) {
|
|
9531
9552
|
const e = [], { nodeExtensions: t, markExtensions: n } = Qt(r), i = [...t, ...n], s = {
|
|
9532
9553
|
default: null,
|
|
9533
9554
|
rendered: !0,
|
|
@@ -9581,7 +9602,7 @@ function Rs(r) {
|
|
|
9581
9602
|
});
|
|
9582
9603
|
}), e;
|
|
9583
9604
|
}
|
|
9584
|
-
function
|
|
9605
|
+
function V(r, e) {
|
|
9585
9606
|
if (typeof r == "string") {
|
|
9586
9607
|
if (!e.nodes[r])
|
|
9587
9608
|
throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);
|
|
@@ -9589,7 +9610,7 @@ function F(r, e) {
|
|
|
9589
9610
|
}
|
|
9590
9611
|
return r;
|
|
9591
9612
|
}
|
|
9592
|
-
function
|
|
9613
|
+
function oc(...r) {
|
|
9593
9614
|
return r.filter((e) => !!e).reduce((e, t) => {
|
|
9594
9615
|
const n = { ...e };
|
|
9595
9616
|
return Object.entries(t).forEach(([i, s]) => {
|
|
@@ -9617,18 +9638,18 @@ function ic(...r) {
|
|
|
9617
9638
|
function Fn(r, e) {
|
|
9618
9639
|
return e.filter((t) => t.type === r.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(r.attrs) || {} : {
|
|
9619
9640
|
[t.name]: r.attrs[t.name]
|
|
9620
|
-
}).reduce((t, n) =>
|
|
9641
|
+
}).reduce((t, n) => oc(t, n), {});
|
|
9621
9642
|
}
|
|
9622
|
-
function
|
|
9643
|
+
function vs(r) {
|
|
9623
9644
|
return typeof r == "function";
|
|
9624
9645
|
}
|
|
9625
9646
|
function T(r, e = void 0, ...t) {
|
|
9626
|
-
return
|
|
9647
|
+
return vs(r) ? e ? r.bind(e)(...t) : r(...t) : r;
|
|
9627
9648
|
}
|
|
9628
|
-
function
|
|
9649
|
+
function lc(r = {}) {
|
|
9629
9650
|
return Object.keys(r).length === 0 && r.constructor === Object;
|
|
9630
9651
|
}
|
|
9631
|
-
function
|
|
9652
|
+
function ac(r) {
|
|
9632
9653
|
return typeof r != "string" ? r : r.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(r) : r === "true" ? !0 : r === "false" ? !1 : r;
|
|
9633
9654
|
}
|
|
9634
9655
|
function si(r, e) {
|
|
@@ -9639,7 +9660,7 @@ function si(r, e) {
|
|
|
9639
9660
|
if (n === !1)
|
|
9640
9661
|
return !1;
|
|
9641
9662
|
const i = e.reduce((s, o) => {
|
|
9642
|
-
const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) :
|
|
9663
|
+
const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : ac(t.getAttribute(o.name));
|
|
9643
9664
|
return l == null ? s : {
|
|
9644
9665
|
...s,
|
|
9645
9666
|
[o.name]: l
|
|
@@ -9652,22 +9673,22 @@ function si(r, e) {
|
|
|
9652
9673
|
function oi(r) {
|
|
9653
9674
|
return Object.fromEntries(
|
|
9654
9675
|
// @ts-ignore
|
|
9655
|
-
Object.entries(r).filter(([e, t]) => e === "attrs" &&
|
|
9676
|
+
Object.entries(r).filter(([e, t]) => e === "attrs" && lc(t) ? !1 : t != null)
|
|
9656
9677
|
);
|
|
9657
9678
|
}
|
|
9658
|
-
function
|
|
9679
|
+
function cc(r, e) {
|
|
9659
9680
|
var t;
|
|
9660
|
-
const n =
|
|
9681
|
+
const n = Ps(r), { nodeExtensions: i, markExtensions: s } = Qt(r), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
|
|
9661
9682
|
const f = n.filter((y) => y.type === c.name), d = {
|
|
9662
9683
|
name: c.name,
|
|
9663
9684
|
options: c.options,
|
|
9664
9685
|
storage: c.storage,
|
|
9665
9686
|
editor: e
|
|
9666
|
-
}, h = r.reduce((y,
|
|
9667
|
-
const
|
|
9687
|
+
}, h = r.reduce((y, w) => {
|
|
9688
|
+
const C = x(w, "extendNodeSchema", d);
|
|
9668
9689
|
return {
|
|
9669
9690
|
...y,
|
|
9670
|
-
...
|
|
9691
|
+
...C ? C(c) : {}
|
|
9671
9692
|
};
|
|
9672
9693
|
}, {}), u = oi({
|
|
9673
9694
|
...h,
|
|
@@ -9684,8 +9705,8 @@ function lc(r, e) {
|
|
|
9684
9705
|
defining: T(x(c, "defining", d)),
|
|
9685
9706
|
isolating: T(x(c, "isolating", d)),
|
|
9686
9707
|
attrs: Object.fromEntries(f.map((y) => {
|
|
9687
|
-
var
|
|
9688
|
-
return [y.name, { default: (
|
|
9708
|
+
var w;
|
|
9709
|
+
return [y.name, { default: (w = y == null ? void 0 : y.attribute) === null || w === void 0 ? void 0 : w.default }];
|
|
9689
9710
|
}))
|
|
9690
9711
|
}), p = T(x(c, "parseHTML", d));
|
|
9691
9712
|
p && (u.parseDOM = p.map((y) => si(y, f)));
|
|
@@ -9703,10 +9724,10 @@ function lc(r, e) {
|
|
|
9703
9724
|
storage: c.storage,
|
|
9704
9725
|
editor: e
|
|
9705
9726
|
}, h = r.reduce((g, y) => {
|
|
9706
|
-
const
|
|
9727
|
+
const w = x(y, "extendMarkSchema", d);
|
|
9707
9728
|
return {
|
|
9708
9729
|
...g,
|
|
9709
|
-
...
|
|
9730
|
+
...w ? w(c) : {}
|
|
9710
9731
|
};
|
|
9711
9732
|
}, {}), u = oi({
|
|
9712
9733
|
...h,
|
|
@@ -9743,7 +9764,7 @@ function tr(r, e) {
|
|
|
9743
9764
|
const t = Fe.fromSchema(e).serializeFragment(r), i = document.implementation.createHTMLDocument().createElement("div");
|
|
9744
9765
|
return i.appendChild(t), i.innerHTML;
|
|
9745
9766
|
}
|
|
9746
|
-
const
|
|
9767
|
+
const fc = (r, e = 500) => {
|
|
9747
9768
|
let t = "";
|
|
9748
9769
|
const n = r.parentOffset;
|
|
9749
9770
|
return r.parent.nodesBetween(Math.max(0, n - e), n, (i, s, o, l) => {
|
|
@@ -9760,12 +9781,12 @@ const ac = (r, e = 500) => {
|
|
|
9760
9781
|
function nr(r) {
|
|
9761
9782
|
return Object.prototype.toString.call(r) === "[object RegExp]";
|
|
9762
9783
|
}
|
|
9763
|
-
class
|
|
9784
|
+
class dc {
|
|
9764
9785
|
constructor(e) {
|
|
9765
9786
|
this.find = e.find, this.handler = e.handler;
|
|
9766
9787
|
}
|
|
9767
9788
|
}
|
|
9768
|
-
const
|
|
9789
|
+
const hc = (r, e) => {
|
|
9769
9790
|
if (nr(e))
|
|
9770
9791
|
return e.exec(r);
|
|
9771
9792
|
const t = e(r);
|
|
@@ -9786,11 +9807,11 @@ function Mt(r) {
|
|
|
9786
9807
|
)
|
|
9787
9808
|
return !1;
|
|
9788
9809
|
let f = !1;
|
|
9789
|
-
const d =
|
|
9810
|
+
const d = fc(c) + s;
|
|
9790
9811
|
return o.forEach((h) => {
|
|
9791
9812
|
if (f)
|
|
9792
9813
|
return;
|
|
9793
|
-
const u =
|
|
9814
|
+
const u = hc(d, h.find);
|
|
9794
9815
|
if (!u)
|
|
9795
9816
|
return;
|
|
9796
9817
|
const p = a.state.tr, m = Xt({
|
|
@@ -9799,7 +9820,7 @@ function Mt(r) {
|
|
|
9799
9820
|
}), g = {
|
|
9800
9821
|
from: n - (u[0].length - s.length),
|
|
9801
9822
|
to: i
|
|
9802
|
-
}, { commands: y, chain:
|
|
9823
|
+
}, { commands: y, chain: w, can: C } = new Zt({
|
|
9803
9824
|
editor: t,
|
|
9804
9825
|
state: m
|
|
9805
9826
|
});
|
|
@@ -9808,8 +9829,8 @@ function Mt(r) {
|
|
|
9808
9829
|
range: g,
|
|
9809
9830
|
match: u,
|
|
9810
9831
|
commands: y,
|
|
9811
|
-
chain:
|
|
9812
|
-
can:
|
|
9832
|
+
chain: w,
|
|
9833
|
+
can: C
|
|
9813
9834
|
}) === null || !p.steps.length || (p.setMeta(l, {
|
|
9814
9835
|
transform: p,
|
|
9815
9836
|
from: n,
|
|
@@ -9818,7 +9839,7 @@ function Mt(r) {
|
|
|
9818
9839
|
}), a.dispatch(p), f = !0);
|
|
9819
9840
|
}), f;
|
|
9820
9841
|
}
|
|
9821
|
-
function
|
|
9842
|
+
function uc(r) {
|
|
9822
9843
|
const { editor: e, rules: t } = r, n = new oe({
|
|
9823
9844
|
state: {
|
|
9824
9845
|
init() {
|
|
@@ -9890,11 +9911,11 @@ function dc(r) {
|
|
|
9890
9911
|
});
|
|
9891
9912
|
return n;
|
|
9892
9913
|
}
|
|
9893
|
-
function
|
|
9914
|
+
function pc(r) {
|
|
9894
9915
|
return Object.prototype.toString.call(r).slice(8, -1);
|
|
9895
9916
|
}
|
|
9896
9917
|
function wt(r) {
|
|
9897
|
-
return
|
|
9918
|
+
return pc(r) !== "Object" ? !1 : r.constructor === Object && Object.getPrototypeOf(r) === Object.prototype;
|
|
9898
9919
|
}
|
|
9899
9920
|
function en(r, e) {
|
|
9900
9921
|
const t = { ...r };
|
|
@@ -9948,10 +9969,10 @@ class Jt {
|
|
|
9948
9969
|
return !1;
|
|
9949
9970
|
}
|
|
9950
9971
|
}
|
|
9951
|
-
function
|
|
9972
|
+
function mc(r) {
|
|
9952
9973
|
return typeof r == "number";
|
|
9953
9974
|
}
|
|
9954
|
-
const
|
|
9975
|
+
const gc = (r, e, t) => {
|
|
9955
9976
|
if (nr(e))
|
|
9956
9977
|
return [...r.matchAll(e)];
|
|
9957
9978
|
const n = e(r, t);
|
|
@@ -9960,7 +9981,7 @@ const pc = (r, e, t) => {
|
|
|
9960
9981
|
return s.index = i.index, s.input = r, s.data = i.data, i.replaceWith && (i.text.includes(i.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), s.push(i.replaceWith)), s;
|
|
9961
9982
|
}) : [];
|
|
9962
9983
|
};
|
|
9963
|
-
function
|
|
9984
|
+
function yc(r) {
|
|
9964
9985
|
const { editor: e, state: t, from: n, to: i, rule: s, pasteEvent: o, dropEvent: l } = r, { commands: a, chain: c, can: f } = new Zt({
|
|
9965
9986
|
editor: e,
|
|
9966
9987
|
state: t
|
|
@@ -9969,35 +9990,35 @@ function mc(r) {
|
|
|
9969
9990
|
if (!u.isTextblock || u.type.spec.code)
|
|
9970
9991
|
return;
|
|
9971
9992
|
const m = Math.max(n, p), g = Math.min(i, p + u.content.size), y = u.textBetween(m - p, g - p, void 0, "");
|
|
9972
|
-
|
|
9973
|
-
if (
|
|
9993
|
+
gc(y, s.find, o).forEach((C) => {
|
|
9994
|
+
if (C.index === void 0)
|
|
9974
9995
|
return;
|
|
9975
|
-
const I = m +
|
|
9996
|
+
const I = m + C.index + 1, A = I + C[0].length, P = {
|
|
9976
9997
|
from: t.tr.mapping.map(I),
|
|
9977
9998
|
to: t.tr.mapping.map(A)
|
|
9978
|
-
},
|
|
9999
|
+
}, M = s.handler({
|
|
9979
10000
|
state: t,
|
|
9980
10001
|
range: P,
|
|
9981
|
-
match:
|
|
10002
|
+
match: C,
|
|
9982
10003
|
commands: a,
|
|
9983
10004
|
chain: c,
|
|
9984
10005
|
can: f,
|
|
9985
10006
|
pasteEvent: o,
|
|
9986
10007
|
dropEvent: l
|
|
9987
10008
|
});
|
|
9988
|
-
d.push(
|
|
10009
|
+
d.push(M);
|
|
9989
10010
|
});
|
|
9990
10011
|
}), d.every((u) => u !== null);
|
|
9991
10012
|
}
|
|
9992
10013
|
let Ot = null;
|
|
9993
|
-
const
|
|
10014
|
+
const bc = (r) => {
|
|
9994
10015
|
var e;
|
|
9995
10016
|
const t = new ClipboardEvent("paste", {
|
|
9996
10017
|
clipboardData: new DataTransfer()
|
|
9997
10018
|
});
|
|
9998
10019
|
return (e = t.clipboardData) === null || e === void 0 || e.setData("text/html", r), t;
|
|
9999
10020
|
};
|
|
10000
|
-
function
|
|
10021
|
+
function kc(r) {
|
|
10001
10022
|
const { editor: e, rules: t } = r;
|
|
10002
10023
|
let n = null, i = !1, s = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, l;
|
|
10003
10024
|
try {
|
|
@@ -10010,7 +10031,7 @@ function yc(r) {
|
|
|
10010
10031
|
state: f,
|
|
10011
10032
|
transaction: m
|
|
10012
10033
|
});
|
|
10013
|
-
if (!(!
|
|
10034
|
+
if (!(!yc({
|
|
10014
10035
|
editor: e,
|
|
10015
10036
|
state: g,
|
|
10016
10037
|
from: Math.max(d - 1, 0),
|
|
@@ -10062,40 +10083,40 @@ function yc(r) {
|
|
|
10062
10083
|
}
|
|
10063
10084
|
},
|
|
10064
10085
|
appendTransaction: (d, h, u) => {
|
|
10065
|
-
const p = d[0], m = p.getMeta("uiEvent") === "paste" && !i, g = p.getMeta("uiEvent") === "drop" && !s, y = p.getMeta("applyPasteRules"),
|
|
10066
|
-
if (!m && !g && !
|
|
10086
|
+
const p = d[0], m = p.getMeta("uiEvent") === "paste" && !i, g = p.getMeta("uiEvent") === "drop" && !s, y = p.getMeta("applyPasteRules"), w = !!y;
|
|
10087
|
+
if (!m && !g && !w)
|
|
10067
10088
|
return;
|
|
10068
|
-
if (
|
|
10089
|
+
if (w) {
|
|
10069
10090
|
let { text: A } = y;
|
|
10070
10091
|
typeof A == "string" ? A = A : A = tr(b.from(A), u.schema);
|
|
10071
|
-
const { from: P } = y,
|
|
10092
|
+
const { from: P } = y, M = P + A.length, E = bc(A);
|
|
10072
10093
|
return a({
|
|
10073
10094
|
rule: f,
|
|
10074
10095
|
state: u,
|
|
10075
10096
|
from: P,
|
|
10076
|
-
to: { b:
|
|
10097
|
+
to: { b: M },
|
|
10077
10098
|
pasteEvt: E
|
|
10078
10099
|
});
|
|
10079
10100
|
}
|
|
10080
|
-
const
|
|
10081
|
-
if (!(!
|
|
10101
|
+
const C = h.doc.content.findDiffStart(u.doc.content), I = h.doc.content.findDiffEnd(u.doc.content);
|
|
10102
|
+
if (!(!mc(C) || !I || C === I.b))
|
|
10082
10103
|
return a({
|
|
10083
10104
|
rule: f,
|
|
10084
10105
|
state: u,
|
|
10085
|
-
from:
|
|
10106
|
+
from: C,
|
|
10086
10107
|
to: I,
|
|
10087
10108
|
pasteEvt: o
|
|
10088
10109
|
});
|
|
10089
10110
|
}
|
|
10090
10111
|
}));
|
|
10091
10112
|
}
|
|
10092
|
-
function
|
|
10113
|
+
function xc(r) {
|
|
10093
10114
|
const e = r.filter((t, n) => r.indexOf(t) !== n);
|
|
10094
10115
|
return Array.from(new Set(e));
|
|
10095
10116
|
}
|
|
10096
10117
|
class He {
|
|
10097
10118
|
constructor(e, t) {
|
|
10098
|
-
this.splittableMarks = [], this.editor = t, this.extensions = He.resolve(e), this.schema =
|
|
10119
|
+
this.splittableMarks = [], this.editor = t, this.extensions = He.resolve(e), this.schema = cc(this.extensions, t), this.setupExtensions();
|
|
10099
10120
|
}
|
|
10100
10121
|
/**
|
|
10101
10122
|
* Returns a flattened and sorted extension list while
|
|
@@ -10104,7 +10125,7 @@ class He {
|
|
|
10104
10125
|
* @returns An flattened and sorted array of Tiptap extensions
|
|
10105
10126
|
*/
|
|
10106
10127
|
static resolve(e) {
|
|
10107
|
-
const t = He.sort(He.flatten(e)), n =
|
|
10128
|
+
const t = He.sort(He.flatten(e)), n = xc(t.map((i) => i.name));
|
|
10108
10129
|
return n.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), t;
|
|
10109
10130
|
}
|
|
10110
10131
|
/**
|
|
@@ -10170,7 +10191,7 @@ class He {
|
|
|
10170
10191
|
const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
|
|
10171
10192
|
f = { ...f, ...m };
|
|
10172
10193
|
}
|
|
10173
|
-
const d =
|
|
10194
|
+
const d = Ia(f);
|
|
10174
10195
|
a.push(d);
|
|
10175
10196
|
const h = x(o, "addInputRules", l);
|
|
10176
10197
|
li(o, e.options.enableInputRules) && h && n.push(...h());
|
|
@@ -10184,11 +10205,11 @@ class He {
|
|
|
10184
10205
|
return a;
|
|
10185
10206
|
}).flat();
|
|
10186
10207
|
return [
|
|
10187
|
-
|
|
10208
|
+
uc({
|
|
10188
10209
|
editor: e,
|
|
10189
10210
|
rules: n
|
|
10190
10211
|
}),
|
|
10191
|
-
...
|
|
10212
|
+
...kc({
|
|
10192
10213
|
editor: e,
|
|
10193
10214
|
rules: i
|
|
10194
10215
|
}),
|
|
@@ -10200,7 +10221,7 @@ class He {
|
|
|
10200
10221
|
* @returns An array of attributes
|
|
10201
10222
|
*/
|
|
10202
10223
|
get attributes() {
|
|
10203
|
-
return
|
|
10224
|
+
return Ps(this.extensions);
|
|
10204
10225
|
}
|
|
10205
10226
|
/**
|
|
10206
10227
|
* Get all node views from the extensions.
|
|
@@ -10214,7 +10235,7 @@ class He {
|
|
|
10214
10235
|
options: n.options,
|
|
10215
10236
|
storage: n.storage,
|
|
10216
10237
|
editor: e,
|
|
10217
|
-
type:
|
|
10238
|
+
type: V(n.name, this.schema)
|
|
10218
10239
|
}, o = x(n, "addNodeView", s);
|
|
10219
10240
|
if (!o)
|
|
10220
10241
|
return [];
|
|
@@ -10292,7 +10313,7 @@ class ne {
|
|
|
10292
10313
|
})), t;
|
|
10293
10314
|
}
|
|
10294
10315
|
}
|
|
10295
|
-
function
|
|
10316
|
+
function Bs(r, e, t) {
|
|
10296
10317
|
const { from: n, to: i } = e, { blockSeparator: s = `
|
|
10297
10318
|
|
|
10298
10319
|
`, textSerializers: o = {} } = t || {};
|
|
@@ -10312,10 +10333,10 @@ function vs(r, e, t) {
|
|
|
10312
10333
|
a.isText && (l += (h = a == null ? void 0 : a.text) === null || h === void 0 ? void 0 : h.slice(Math.max(n, c) - c, i - c));
|
|
10313
10334
|
}), l;
|
|
10314
10335
|
}
|
|
10315
|
-
function
|
|
10336
|
+
function zs(r) {
|
|
10316
10337
|
return Object.fromEntries(Object.entries(r.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
|
|
10317
10338
|
}
|
|
10318
|
-
const
|
|
10339
|
+
const Sc = ne.create({
|
|
10319
10340
|
name: "clipboardTextSerializer",
|
|
10320
10341
|
addOptions() {
|
|
10321
10342
|
return {
|
|
@@ -10328,8 +10349,8 @@ const kc = ne.create({
|
|
|
10328
10349
|
key: new Le("clipboardTextSerializer"),
|
|
10329
10350
|
props: {
|
|
10330
10351
|
clipboardTextSerializer: () => {
|
|
10331
|
-
const { editor: r } = this, { state: e, schema: t } = r, { doc: n, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((f) => f.$from.pos)), l = Math.max(...s.map((f) => f.$to.pos)), a =
|
|
10332
|
-
return
|
|
10352
|
+
const { editor: r } = this, { state: e, schema: t } = r, { doc: n, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((f) => f.$from.pos)), l = Math.max(...s.map((f) => f.$to.pos)), a = zs(t);
|
|
10353
|
+
return Bs(n, { from: o, to: l }, {
|
|
10333
10354
|
...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
|
|
10334
10355
|
textSerializers: a
|
|
10335
10356
|
});
|
|
@@ -10338,10 +10359,10 @@ const kc = ne.create({
|
|
|
10338
10359
|
})
|
|
10339
10360
|
];
|
|
10340
10361
|
}
|
|
10341
|
-
}),
|
|
10362
|
+
}), Cc = () => ({ editor: r, view: e }) => (requestAnimationFrame(() => {
|
|
10342
10363
|
var t;
|
|
10343
10364
|
r.isDestroyed || (e.dom.blur(), (t = window == null ? void 0 : window.getSelection()) === null || t === void 0 || t.removeAllRanges());
|
|
10344
|
-
}), !0),
|
|
10365
|
+
}), !0), Mc = (r = !1) => ({ commands: e }) => e.setContent("", r), wc = () => ({ state: r, tr: e, dispatch: t }) => {
|
|
10345
10366
|
const { selection: n } = e, { ranges: i } = n;
|
|
10346
10367
|
return t && i.forEach(({ $from: s, $to: o }) => {
|
|
10347
10368
|
r.doc.nodesBetween(s.pos, o.pos, (l, a) => {
|
|
@@ -10358,12 +10379,12 @@ const kc = ne.create({
|
|
|
10358
10379
|
(p || p === 0) && e.lift(u, p);
|
|
10359
10380
|
});
|
|
10360
10381
|
}), !0;
|
|
10361
|
-
},
|
|
10382
|
+
}, Oc = (r) => (e) => r(e), Nc = () => ({ state: r, dispatch: e }) => Ka(r, e), Tc = (r, e) => ({ editor: t, tr: n }) => {
|
|
10362
10383
|
const { state: i } = t, s = i.doc.slice(r.from, r.to);
|
|
10363
10384
|
n.deleteRange(r.from, r.to);
|
|
10364
10385
|
const o = n.mapping.map(e);
|
|
10365
10386
|
return n.insert(o, s.content), n.setSelection(new O(n.doc.resolve(Math.max(o - 1, 0)))), !0;
|
|
10366
|
-
},
|
|
10387
|
+
}, Ec = () => ({ tr: r, dispatch: e }) => {
|
|
10367
10388
|
const { selection: t } = r, n = t.$anchor.node();
|
|
10368
10389
|
if (n.content.size > 0)
|
|
10369
10390
|
return !1;
|
|
@@ -10377,8 +10398,8 @@ const kc = ne.create({
|
|
|
10377
10398
|
return !0;
|
|
10378
10399
|
}
|
|
10379
10400
|
return !1;
|
|
10380
|
-
},
|
|
10381
|
-
const i =
|
|
10401
|
+
}, Dc = (r) => ({ tr: e, state: t, dispatch: n }) => {
|
|
10402
|
+
const i = V(r, t.schema), s = e.selection.$anchor;
|
|
10382
10403
|
for (let o = s.depth; o > 0; o -= 1)
|
|
10383
10404
|
if (s.node(o).type === i) {
|
|
10384
10405
|
if (n) {
|
|
@@ -10388,15 +10409,15 @@ const kc = ne.create({
|
|
|
10388
10409
|
return !0;
|
|
10389
10410
|
}
|
|
10390
10411
|
return !1;
|
|
10391
|
-
},
|
|
10412
|
+
}, Ac = (r) => ({ tr: e, dispatch: t }) => {
|
|
10392
10413
|
const { from: n, to: i } = r;
|
|
10393
10414
|
return t && e.delete(n, i), !0;
|
|
10394
|
-
},
|
|
10415
|
+
}, Ic = () => ({ state: r, dispatch: e }) => Pa(r, e), Rc = () => ({ commands: r }) => r.keyboardShortcut("Enter"), Pc = () => ({ state: r, dispatch: e }) => qa(r, e);
|
|
10395
10416
|
function jt(r, e, t = { strict: !0 }) {
|
|
10396
10417
|
const n = Object.keys(e);
|
|
10397
10418
|
return n.length ? n.every((i) => t.strict ? e[i] === r[i] : nr(e[i]) ? e[i].test(r[i]) : e[i] === r[i]) : !0;
|
|
10398
10419
|
}
|
|
10399
|
-
function
|
|
10420
|
+
function Fs(r, e, t = {}) {
|
|
10400
10421
|
return r.find((n) => n.type === e && jt(
|
|
10401
10422
|
// Only check equality for the attributes that are provided
|
|
10402
10423
|
Object.fromEntries(Object.keys(t).map((i) => [i, n.attrs[i]])),
|
|
@@ -10404,14 +10425,14 @@ function zs(r, e, t = {}) {
|
|
|
10404
10425
|
));
|
|
10405
10426
|
}
|
|
10406
10427
|
function ai(r, e, t = {}) {
|
|
10407
|
-
return !!
|
|
10428
|
+
return !!Fs(r, e, t);
|
|
10408
10429
|
}
|
|
10409
|
-
function
|
|
10430
|
+
function Vs(r, e, t) {
|
|
10410
10431
|
var n;
|
|
10411
10432
|
if (!r || !e)
|
|
10412
10433
|
return;
|
|
10413
10434
|
let i = r.parent.childAfter(r.parentOffset);
|
|
10414
|
-
if ((!i.node || !i.node.marks.some((f) => f.type === e)) && (i = r.parent.childBefore(r.parentOffset)), !i.node || !i.node.marks.some((f) => f.type === e) || (t = t || ((n = i.node.marks[0]) === null || n === void 0 ? void 0 : n.attrs), !
|
|
10435
|
+
if ((!i.node || !i.node.marks.some((f) => f.type === e)) && (i = r.parent.childBefore(r.parentOffset)), !i.node || !i.node.marks.some((f) => f.type === e) || (t = t || ((n = i.node.marks[0]) === null || n === void 0 ? void 0 : n.attrs), !Fs([...i.node.marks], e, t)))
|
|
10415
10436
|
return;
|
|
10416
10437
|
let o = i.index, l = r.start() + i.offset, a = o + 1, c = l + i.node.nodeSize;
|
|
10417
10438
|
for (; o > 0 && ai([...r.parent.child(o - 1).marks], e, t); )
|
|
@@ -10431,30 +10452,30 @@ function we(r, e) {
|
|
|
10431
10452
|
}
|
|
10432
10453
|
return r;
|
|
10433
10454
|
}
|
|
10434
|
-
const
|
|
10455
|
+
const vc = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
10435
10456
|
const s = we(r, n.schema), { doc: o, selection: l } = t, { $from: a, from: c, to: f } = l;
|
|
10436
10457
|
if (i) {
|
|
10437
|
-
const d =
|
|
10458
|
+
const d = Vs(a, s, e);
|
|
10438
10459
|
if (d && d.from <= c && d.to >= f) {
|
|
10439
10460
|
const h = O.create(o, d.from, d.to);
|
|
10440
10461
|
t.setSelection(h);
|
|
10441
10462
|
}
|
|
10442
10463
|
}
|
|
10443
10464
|
return !0;
|
|
10444
|
-
},
|
|
10465
|
+
}, Bc = (r) => (e) => {
|
|
10445
10466
|
const t = typeof r == "function" ? r(e) : r;
|
|
10446
10467
|
for (let n = 0; n < t.length; n += 1)
|
|
10447
10468
|
if (t[n](e))
|
|
10448
10469
|
return !0;
|
|
10449
10470
|
return !1;
|
|
10450
10471
|
};
|
|
10451
|
-
function
|
|
10472
|
+
function Ls(r) {
|
|
10452
10473
|
return r instanceof O;
|
|
10453
10474
|
}
|
|
10454
10475
|
function fe(r = 0, e = 0, t = 0) {
|
|
10455
10476
|
return Math.min(Math.max(r, e), t);
|
|
10456
10477
|
}
|
|
10457
|
-
function
|
|
10478
|
+
function $s(r, e = null) {
|
|
10458
10479
|
if (!e)
|
|
10459
10480
|
return null;
|
|
10460
10481
|
const t = N.atStart(r), n = N.atEnd(r);
|
|
@@ -10465,7 +10486,7 @@ function Ls(r, e = null) {
|
|
|
10465
10486
|
const i = t.from, s = n.to;
|
|
10466
10487
|
return e === "all" ? O.create(r, fe(0, i, s), fe(r.content.size, i, s)) : O.create(r, fe(e, i, s), fe(e, i, s));
|
|
10467
10488
|
}
|
|
10468
|
-
function
|
|
10489
|
+
function zc() {
|
|
10469
10490
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
10470
10491
|
}
|
|
10471
10492
|
function rr() {
|
|
@@ -10478,33 +10499,33 @@ function rr() {
|
|
|
10478
10499
|
"iPod"
|
|
10479
10500
|
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
10480
10501
|
}
|
|
10481
|
-
const
|
|
10502
|
+
const Fc = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) => {
|
|
10482
10503
|
e = {
|
|
10483
10504
|
scrollIntoView: !0,
|
|
10484
10505
|
...e
|
|
10485
10506
|
};
|
|
10486
10507
|
const o = () => {
|
|
10487
|
-
(rr() ||
|
|
10508
|
+
(rr() || zc()) && n.dom.focus(), requestAnimationFrame(() => {
|
|
10488
10509
|
t.isDestroyed || (n.focus(), e != null && e.scrollIntoView && t.commands.scrollIntoView());
|
|
10489
10510
|
});
|
|
10490
10511
|
};
|
|
10491
10512
|
if (n.hasFocus() && r === null || r === !1)
|
|
10492
10513
|
return !0;
|
|
10493
|
-
if (s && r === null && !
|
|
10514
|
+
if (s && r === null && !Ls(t.state.selection))
|
|
10494
10515
|
return o(), !0;
|
|
10495
|
-
const l =
|
|
10516
|
+
const l = $s(i.doc, r) || t.state.selection, a = t.state.selection.eq(l);
|
|
10496
10517
|
return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
10497
|
-
},
|
|
10518
|
+
}, Vc = (r, e) => (t) => r.every((n, i) => e(n, { ...t, index: i })), Lc = (r, e) => ({ tr: t, commands: n }) => n.insertContentAt({ from: t.selection.from, to: t.selection.to }, r, e), Ws = (r) => {
|
|
10498
10519
|
const e = r.childNodes;
|
|
10499
10520
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
10500
10521
|
const n = e[t];
|
|
10501
|
-
n.nodeType === 3 && n.nodeValue && /^(\n\s\s|\n)$/.test(n.nodeValue) ? r.removeChild(n) : n.nodeType === 1 &&
|
|
10522
|
+
n.nodeType === 3 && n.nodeValue && /^(\n\s\s|\n)$/.test(n.nodeValue) ? r.removeChild(n) : n.nodeType === 1 && Ws(n);
|
|
10502
10523
|
}
|
|
10503
10524
|
return r;
|
|
10504
10525
|
};
|
|
10505
10526
|
function Nt(r) {
|
|
10506
10527
|
const e = `<body>${r}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
|
|
10507
|
-
return
|
|
10528
|
+
return Ws(t);
|
|
10508
10529
|
}
|
|
10509
10530
|
function mt(r, e, t) {
|
|
10510
10531
|
if (r instanceof be || r instanceof b)
|
|
@@ -10555,12 +10576,12 @@ function mt(r, e, t) {
|
|
|
10555
10576
|
}
|
|
10556
10577
|
return mt("", e, t);
|
|
10557
10578
|
}
|
|
10558
|
-
function
|
|
10579
|
+
function $c(r, e, t) {
|
|
10559
10580
|
const n = r.steps.length - 1;
|
|
10560
10581
|
if (n < e)
|
|
10561
10582
|
return;
|
|
10562
10583
|
const i = r.steps[n];
|
|
10563
|
-
if (!(i instanceof B || i instanceof
|
|
10584
|
+
if (!(i instanceof B || i instanceof F))
|
|
10564
10585
|
return;
|
|
10565
10586
|
const s = r.mapping.maps[n];
|
|
10566
10587
|
let o = 0;
|
|
@@ -10568,7 +10589,7 @@ function Vc(r, e, t) {
|
|
|
10568
10589
|
o === 0 && (o = f);
|
|
10569
10590
|
}), r.setSelection(N.near(r.doc.resolve(o), t));
|
|
10570
10591
|
}
|
|
10571
|
-
const
|
|
10592
|
+
const Wc = (r) => !("type" in r), Jc = (r, e, t) => ({ tr: n, dispatch: i, editor: s }) => {
|
|
10572
10593
|
var o;
|
|
10573
10594
|
if (i) {
|
|
10574
10595
|
t = {
|
|
@@ -10609,7 +10630,7 @@ const Lc = (r) => !("type" in r), $c = (r, e, t) => ({ tr: n, dispatch: i, edito
|
|
|
10609
10630
|
return a(g), !1;
|
|
10610
10631
|
}
|
|
10611
10632
|
let { from: f, to: d } = typeof r == "number" ? { from: r, to: r } : { from: r.from, to: r.to }, h = !0, u = !0;
|
|
10612
|
-
if ((
|
|
10633
|
+
if ((Wc(l) ? l : [l]).forEach((g) => {
|
|
10613
10634
|
g.check(), h = h ? g.isText && g.marks.length === 0 : !1, u = u ? g.isBlock : !1;
|
|
10614
10635
|
}), f === d && u) {
|
|
10615
10636
|
const { parent: g } = n.doc.resolve(f);
|
|
@@ -10628,28 +10649,28 @@ const Lc = (r) => !("type" in r), $c = (r, e, t) => ({ tr: n, dispatch: i, edito
|
|
|
10628
10649
|
n.insertText(m, f, d);
|
|
10629
10650
|
} else
|
|
10630
10651
|
m = l, n.replaceWith(f, d, m);
|
|
10631
|
-
t.updateSelection &&
|
|
10652
|
+
t.updateSelection && $c(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: f, text: m }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: f, text: m });
|
|
10632
10653
|
}
|
|
10633
10654
|
return !0;
|
|
10634
|
-
},
|
|
10655
|
+
}, jc = () => ({ state: r, dispatch: e }) => $a(r, e), qc = () => ({ state: r, dispatch: e }) => Wa(r, e), Kc = () => ({ state: r, dispatch: e }) => va(r, e), Hc = () => ({ state: r, dispatch: e }) => Va(r, e), Uc = () => ({ state: r, dispatch: e, tr: t }) => {
|
|
10635
10656
|
try {
|
|
10636
10657
|
const n = Kt(r.doc, r.selection.$from.pos, -1);
|
|
10637
10658
|
return n == null ? !1 : (t.join(n, 2), e && e(t), !0);
|
|
10638
10659
|
} catch {
|
|
10639
10660
|
return !1;
|
|
10640
10661
|
}
|
|
10641
|
-
},
|
|
10662
|
+
}, Gc = () => ({ state: r, dispatch: e, tr: t }) => {
|
|
10642
10663
|
try {
|
|
10643
10664
|
const n = Kt(r.doc, r.selection.$from.pos, 1);
|
|
10644
10665
|
return n == null ? !1 : (t.join(n, 2), e && e(t), !0);
|
|
10645
10666
|
} catch {
|
|
10646
10667
|
return !1;
|
|
10647
10668
|
}
|
|
10648
|
-
},
|
|
10649
|
-
function
|
|
10669
|
+
}, _c = () => ({ state: r, dispatch: e }) => Ba(r, e), Yc = () => ({ state: r, dispatch: e }) => za(r, e);
|
|
10670
|
+
function Js() {
|
|
10650
10671
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
10651
10672
|
}
|
|
10652
|
-
function
|
|
10673
|
+
function Xc(r) {
|
|
10653
10674
|
const e = r.split(/-(?!$)/);
|
|
10654
10675
|
let t = e[e.length - 1];
|
|
10655
10676
|
t === "Space" && (t = " ");
|
|
@@ -10665,14 +10686,14 @@ function _c(r) {
|
|
|
10665
10686
|
else if (/^s(hift)?$/i.test(a))
|
|
10666
10687
|
s = !0;
|
|
10667
10688
|
else if (/^mod$/i.test(a))
|
|
10668
|
-
rr() ||
|
|
10689
|
+
rr() || Js() ? o = !0 : i = !0;
|
|
10669
10690
|
else
|
|
10670
10691
|
throw new Error(`Unrecognized modifier name: ${a}`);
|
|
10671
10692
|
}
|
|
10672
10693
|
return n && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
|
|
10673
10694
|
}
|
|
10674
|
-
const
|
|
10675
|
-
const s =
|
|
10695
|
+
const Zc = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
|
|
10696
|
+
const s = Xc(r).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
|
|
10676
10697
|
key: o === "Space" ? " " : o,
|
|
10677
10698
|
altKey: s.includes("Alt"),
|
|
10678
10699
|
ctrlKey: s.includes("Ctrl"),
|
|
@@ -10689,7 +10710,7 @@ const Yc = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
|
|
|
10689
10710
|
}), !0;
|
|
10690
10711
|
};
|
|
10691
10712
|
function gt(r, e, t = {}) {
|
|
10692
|
-
const { from: n, to: i, empty: s } = r.selection, o = e ?
|
|
10713
|
+
const { from: n, to: i, empty: s } = r.selection, o = e ? V(e, r.schema) : null, l = [];
|
|
10693
10714
|
r.doc.nodesBetween(n, i, (d, h) => {
|
|
10694
10715
|
if (d.isText)
|
|
10695
10716
|
return;
|
|
@@ -10703,13 +10724,13 @@ function gt(r, e, t = {}) {
|
|
|
10703
10724
|
const a = i - n, c = l.filter((d) => o ? o.name === d.node.type.name : !0).filter((d) => jt(d.node.attrs, t, { strict: !1 }));
|
|
10704
10725
|
return s ? !!c.length : c.reduce((d, h) => d + h.to - h.from, 0) >= a;
|
|
10705
10726
|
}
|
|
10706
|
-
const
|
|
10707
|
-
const i =
|
|
10708
|
-
return gt(t, i, e) ?
|
|
10709
|
-
},
|
|
10710
|
-
const n =
|
|
10711
|
-
return
|
|
10712
|
-
},
|
|
10727
|
+
const Qc = (r, e = {}) => ({ state: t, dispatch: n }) => {
|
|
10728
|
+
const i = V(r, t.schema);
|
|
10729
|
+
return gt(t, i, e) ? Ja(t, n) : !1;
|
|
10730
|
+
}, ef = () => ({ state: r, dispatch: e }) => Ha(r, e), tf = (r) => ({ state: e, dispatch: t }) => {
|
|
10731
|
+
const n = V(r, e.schema);
|
|
10732
|
+
return tc(n)(e, t);
|
|
10733
|
+
}, nf = () => ({ state: r, dispatch: e }) => ja(r, e);
|
|
10713
10734
|
function tn(r, e) {
|
|
10714
10735
|
return e.nodes[r] ? "node" : e.marks[r] ? "mark" : null;
|
|
10715
10736
|
}
|
|
@@ -10717,23 +10738,23 @@ function ci(r, e) {
|
|
|
10717
10738
|
const t = typeof e == "string" ? [e] : e;
|
|
10718
10739
|
return Object.keys(r).reduce((n, i) => (t.includes(i) || (n[i] = r[i]), n), {});
|
|
10719
10740
|
}
|
|
10720
|
-
const
|
|
10741
|
+
const rf = (r, e) => ({ tr: t, state: n, dispatch: i }) => {
|
|
10721
10742
|
let s = null, o = null;
|
|
10722
10743
|
const l = tn(typeof r == "string" ? r : r.name, n.schema);
|
|
10723
|
-
return l ? (l === "node" && (s =
|
|
10744
|
+
return l ? (l === "node" && (s = V(r, n.schema)), l === "mark" && (o = we(r, n.schema)), i && t.selection.ranges.forEach((a) => {
|
|
10724
10745
|
n.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, f) => {
|
|
10725
10746
|
s && s === c.type && t.setNodeMarkup(f, void 0, ci(c.attrs, e)), o && c.marks.length && c.marks.forEach((d) => {
|
|
10726
10747
|
o === d.type && t.addMark(f, f + c.nodeSize, o.create(ci(d.attrs, e)));
|
|
10727
10748
|
});
|
|
10728
10749
|
});
|
|
10729
10750
|
}), !0) : !1;
|
|
10730
|
-
},
|
|
10751
|
+
}, sf = () => ({ tr: r, dispatch: e }) => (e && r.scrollIntoView(), !0), of = () => ({ tr: r, dispatch: e }) => {
|
|
10731
10752
|
if (e) {
|
|
10732
10753
|
const t = new Z(r.doc);
|
|
10733
10754
|
r.setSelection(t);
|
|
10734
10755
|
}
|
|
10735
10756
|
return !0;
|
|
10736
|
-
},
|
|
10757
|
+
}, lf = () => ({ state: r, dispatch: e }) => Fa(r, e), af = () => ({ state: r, dispatch: e }) => La(r, e), cf = () => ({ state: r, dispatch: e }) => Ua(r, e), ff = () => ({ state: r, dispatch: e }) => Ya(r, e), df = () => ({ state: r, dispatch: e }) => _a(r, e);
|
|
10737
10758
|
function Vn(r, e, t = {}, n = {}) {
|
|
10738
10759
|
return mt(r, e, {
|
|
10739
10760
|
slice: !1,
|
|
@@ -10741,7 +10762,7 @@ function Vn(r, e, t = {}, n = {}) {
|
|
|
10741
10762
|
errorOnInvalidContent: n.errorOnInvalidContent
|
|
10742
10763
|
});
|
|
10743
10764
|
}
|
|
10744
|
-
const
|
|
10765
|
+
const hf = (r, e = !1, t = {}, n = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
|
|
10745
10766
|
var a, c;
|
|
10746
10767
|
const { doc: f } = s;
|
|
10747
10768
|
if (t.preserveWhitespace !== "full") {
|
|
@@ -10755,7 +10776,7 @@ const ff = (r, e = !1, t = {}, n = {}) => ({ editor: i, tr: s, dispatch: o, comm
|
|
|
10755
10776
|
errorOnInvalidContent: (c = n.errorOnInvalidContent) !== null && c !== void 0 ? c : i.options.enableContentCheck
|
|
10756
10777
|
});
|
|
10757
10778
|
};
|
|
10758
|
-
function
|
|
10779
|
+
function js(r, e) {
|
|
10759
10780
|
const t = we(e, r.schema), { from: n, to: i, empty: s } = r.selection, o = [];
|
|
10760
10781
|
s ? (r.storedMarks && o.push(...r.storedMarks), o.push(...r.selection.$head.marks())) : r.doc.nodesBetween(n, i, (a) => {
|
|
10761
10782
|
o.push(...a.marks);
|
|
@@ -10763,7 +10784,7 @@ function Js(r, e) {
|
|
|
10763
10784
|
const l = o.find((a) => a.type.name === t.name);
|
|
10764
10785
|
return l ? { ...l.attrs } : {};
|
|
10765
10786
|
}
|
|
10766
|
-
function
|
|
10787
|
+
function uf(r) {
|
|
10767
10788
|
for (let e = 0; e < r.edgeCount; e += 1) {
|
|
10768
10789
|
const { type: t } = r.edge(e);
|
|
10769
10790
|
if (t.isTextblock && !t.hasRequiredAttrs())
|
|
@@ -10771,7 +10792,7 @@ function df(r) {
|
|
|
10771
10792
|
}
|
|
10772
10793
|
return null;
|
|
10773
10794
|
}
|
|
10774
|
-
function
|
|
10795
|
+
function pf(r, e) {
|
|
10775
10796
|
for (let t = r.depth; t > 0; t -= 1) {
|
|
10776
10797
|
const n = r.node(t);
|
|
10777
10798
|
if (e(n))
|
|
@@ -10784,26 +10805,26 @@ function hf(r, e) {
|
|
|
10784
10805
|
}
|
|
10785
10806
|
}
|
|
10786
10807
|
function ir(r) {
|
|
10787
|
-
return (e) =>
|
|
10808
|
+
return (e) => pf(e.$from, r);
|
|
10788
10809
|
}
|
|
10789
|
-
function
|
|
10810
|
+
function mf(r, e) {
|
|
10790
10811
|
const t = {
|
|
10791
10812
|
from: 0,
|
|
10792
10813
|
to: r.content.size
|
|
10793
10814
|
};
|
|
10794
|
-
return
|
|
10815
|
+
return Bs(r, t, e);
|
|
10795
10816
|
}
|
|
10796
|
-
function
|
|
10797
|
-
const t =
|
|
10817
|
+
function gf(r, e) {
|
|
10818
|
+
const t = V(e, r.schema), { from: n, to: i } = r.selection, s = [];
|
|
10798
10819
|
r.doc.nodesBetween(n, i, (l) => {
|
|
10799
10820
|
s.push(l);
|
|
10800
10821
|
});
|
|
10801
10822
|
const o = s.reverse().find((l) => l.type.name === t.name);
|
|
10802
10823
|
return o ? { ...o.attrs } : {};
|
|
10803
10824
|
}
|
|
10804
|
-
function
|
|
10825
|
+
function yf(r, e) {
|
|
10805
10826
|
const t = tn(typeof e == "string" ? e : e.name, r.schema);
|
|
10806
|
-
return t === "node" ?
|
|
10827
|
+
return t === "node" ? gf(r, e) : t === "mark" ? js(r, e) : {};
|
|
10807
10828
|
}
|
|
10808
10829
|
function Dt(r, e, t) {
|
|
10809
10830
|
return Object.fromEntries(Object.entries(t).filter(([n]) => {
|
|
@@ -10822,11 +10843,11 @@ function Ln(r, e, t = {}) {
|
|
|
10822
10843
|
r.doc.nodesBetween(u, p, (m, g) => {
|
|
10823
10844
|
if (!m.isText && !m.marks.length)
|
|
10824
10845
|
return;
|
|
10825
|
-
const y = Math.max(u, g),
|
|
10826
|
-
o +=
|
|
10846
|
+
const y = Math.max(u, g), w = Math.min(p, g + m.nodeSize), C = w - y;
|
|
10847
|
+
o += C, l.push(...m.marks.map((I) => ({
|
|
10827
10848
|
mark: I,
|
|
10828
10849
|
from: y,
|
|
10829
|
-
to:
|
|
10850
|
+
to: w
|
|
10830
10851
|
})));
|
|
10831
10852
|
});
|
|
10832
10853
|
}), o === 0)
|
|
@@ -10834,7 +10855,7 @@ function Ln(r, e, t = {}) {
|
|
|
10834
10855
|
const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) => jt(d.mark.attrs, t, { strict: !1 })).reduce((d, h) => d + h.to - h.from, 0), c = l.filter((d) => s ? d.mark.type !== s && d.mark.type.excludes(s) : !0).reduce((d, h) => d + h.to - h.from, 0);
|
|
10835
10856
|
return (a > 0 ? a + c : a) >= o;
|
|
10836
10857
|
}
|
|
10837
|
-
function
|
|
10858
|
+
function bf(r, e, t = {}) {
|
|
10838
10859
|
if (!e)
|
|
10839
10860
|
return gt(r, null, t) || Ln(r, null, t);
|
|
10840
10861
|
const n = tn(e, r.schema);
|
|
@@ -10873,10 +10894,10 @@ function sr(r, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
|
|
|
10873
10894
|
}
|
|
10874
10895
|
return !1;
|
|
10875
10896
|
}
|
|
10876
|
-
function
|
|
10897
|
+
function _f(r) {
|
|
10877
10898
|
return r instanceof S;
|
|
10878
10899
|
}
|
|
10879
|
-
function
|
|
10900
|
+
function Yf(r, e, t) {
|
|
10880
10901
|
const i = r.state.doc.content.size, s = fe(e, 0, i), o = fe(t, 0, i), l = r.coordsAtPos(s), a = r.coordsAtPos(o, -1), c = Math.min(l.top, a.top), f = Math.max(l.bottom, a.bottom), d = Math.min(l.left, a.left), h = Math.max(l.right, a.right), u = h - d, p = f - c, y = {
|
|
10881
10902
|
top: c,
|
|
10882
10903
|
bottom: f,
|
|
@@ -10892,11 +10913,11 @@ function Gf(r, e, t) {
|
|
|
10892
10913
|
toJSON: () => y
|
|
10893
10914
|
};
|
|
10894
10915
|
}
|
|
10895
|
-
function
|
|
10916
|
+
function kf(r, e, t) {
|
|
10896
10917
|
var n;
|
|
10897
10918
|
const { selection: i } = e;
|
|
10898
10919
|
let s = null;
|
|
10899
|
-
if (
|
|
10920
|
+
if (Ls(i) && (s = i.$cursor), s) {
|
|
10900
10921
|
const l = (n = r.storedMarks) !== null && n !== void 0 ? n : s.marks();
|
|
10901
10922
|
return !!t.isInSet(l) || !l.some((a) => a.type.excludes(t));
|
|
10902
10923
|
}
|
|
@@ -10914,11 +10935,11 @@ function yf(r, e, t) {
|
|
|
10914
10935
|
}), c;
|
|
10915
10936
|
});
|
|
10916
10937
|
}
|
|
10917
|
-
const
|
|
10938
|
+
const xf = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
10918
10939
|
const { selection: s } = t, { empty: o, ranges: l } = s, a = we(r, n.schema);
|
|
10919
10940
|
if (i)
|
|
10920
10941
|
if (o) {
|
|
10921
|
-
const c =
|
|
10942
|
+
const c = js(n, a);
|
|
10922
10943
|
t.addStoredMark(a.create({
|
|
10923
10944
|
...c,
|
|
10924
10945
|
...e
|
|
@@ -10936,26 +10957,26 @@ const bf = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
|
10936
10957
|
}) : t.addMark(p, m, a.create(e));
|
|
10937
10958
|
});
|
|
10938
10959
|
});
|
|
10939
|
-
return
|
|
10940
|
-
},
|
|
10941
|
-
const s =
|
|
10960
|
+
return kf(n, t, a);
|
|
10961
|
+
}, Sf = (r, e) => ({ tr: t }) => (t.setMeta(r, e), !0), Cf = (r, e = {}) => ({ state: t, dispatch: n, chain: i }) => {
|
|
10962
|
+
const s = V(r, t.schema);
|
|
10942
10963
|
let o;
|
|
10943
10964
|
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => ii(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => ii(s, { ...o, ...e })(l, n)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
10944
|
-
},
|
|
10965
|
+
}, Mf = (r) => ({ tr: e, dispatch: t }) => {
|
|
10945
10966
|
if (t) {
|
|
10946
10967
|
const { doc: n } = e, i = fe(r, 0, n.content.size), s = S.create(n, i);
|
|
10947
10968
|
e.setSelection(s);
|
|
10948
10969
|
}
|
|
10949
10970
|
return !0;
|
|
10950
|
-
},
|
|
10971
|
+
}, wf = (r) => ({ tr: e, dispatch: t }) => {
|
|
10951
10972
|
if (t) {
|
|
10952
10973
|
const { doc: n } = e, { from: i, to: s } = typeof r == "number" ? { from: r, to: r } : r, o = O.atStart(n).from, l = O.atEnd(n).to, a = fe(i, o, l), c = fe(s, o, l), f = O.create(n, a, c);
|
|
10953
10974
|
e.setSelection(f);
|
|
10954
10975
|
}
|
|
10955
10976
|
return !0;
|
|
10956
|
-
},
|
|
10957
|
-
const n =
|
|
10958
|
-
return
|
|
10977
|
+
}, Of = (r) => ({ state: e, dispatch: t }) => {
|
|
10978
|
+
const n = V(r, e.schema);
|
|
10979
|
+
return ic(n)(e, t);
|
|
10959
10980
|
};
|
|
10960
10981
|
function di(r, e) {
|
|
10961
10982
|
const t = r.storedMarks || r.selection.$to.parentOffset && r.selection.$from.marks();
|
|
@@ -10964,13 +10985,13 @@ function di(r, e) {
|
|
|
10964
10985
|
r.tr.ensureMarks(n);
|
|
10965
10986
|
}
|
|
10966
10987
|
}
|
|
10967
|
-
const
|
|
10988
|
+
const Nf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor: i }) => {
|
|
10968
10989
|
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, f = Dt(c, l.node().type.name, l.node().attrs);
|
|
10969
10990
|
if (s instanceof S && s.node.isBlock)
|
|
10970
10991
|
return !l.parentOffset || !Ue(o, l.pos) ? !1 : (n && (r && di(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
10971
10992
|
if (!l.parent.isBlock)
|
|
10972
10993
|
return !1;
|
|
10973
|
-
const d = a.parentOffset === a.parent.content.size, h = l.depth === 0 ? void 0 :
|
|
10994
|
+
const d = a.parentOffset === a.parent.content.size, h = l.depth === 0 ? void 0 : uf(l.node(-1).contentMatchAt(l.indexAfter(-1)));
|
|
10974
10995
|
let u = d && h ? [
|
|
10975
10996
|
{
|
|
10976
10997
|
type: h,
|
|
@@ -10990,9 +11011,9 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
10990
11011
|
r && di(t, i.extensionManager.splittableMarks), e.scrollIntoView();
|
|
10991
11012
|
}
|
|
10992
11013
|
return p;
|
|
10993
|
-
},
|
|
11014
|
+
}, Tf = (r, e = {}) => ({ tr: t, state: n, dispatch: i, editor: s }) => {
|
|
10994
11015
|
var o;
|
|
10995
|
-
const l =
|
|
11016
|
+
const l = V(r, n.schema), { $from: a, $to: c } = n.selection, f = n.selection.node;
|
|
10996
11017
|
if (f && f.isBlock || a.depth < 2 || !a.sameParent(c))
|
|
10997
11018
|
return !1;
|
|
10998
11019
|
const d = a.node(-1);
|
|
@@ -11004,22 +11025,22 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11004
11025
|
return !1;
|
|
11005
11026
|
if (i) {
|
|
11006
11027
|
let y = b.empty;
|
|
11007
|
-
const
|
|
11008
|
-
for (let E = a.depth -
|
|
11028
|
+
const w = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
|
|
11029
|
+
for (let E = a.depth - w; E >= a.depth - 3; E -= 1)
|
|
11009
11030
|
y = b.from(a.node(E).copy(y));
|
|
11010
|
-
const
|
|
11031
|
+
const C = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, I = {
|
|
11011
11032
|
...Dt(h, a.node().type.name, a.node().attrs),
|
|
11012
11033
|
...e
|
|
11013
11034
|
}, A = ((o = l.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(I)) || void 0;
|
|
11014
11035
|
y = y.append(b.from(l.createAndFill(null, A) || void 0));
|
|
11015
|
-
const P = a.before(a.depth - (
|
|
11016
|
-
t.replace(P, a.after(-
|
|
11017
|
-
let
|
|
11018
|
-
t.doc.nodesBetween(P, t.doc.content.size, (E,
|
|
11019
|
-
if (
|
|
11036
|
+
const P = a.before(a.depth - (w - 1));
|
|
11037
|
+
t.replace(P, a.after(-C), new k(y, 4 - w, 0));
|
|
11038
|
+
let M = -1;
|
|
11039
|
+
t.doc.nodesBetween(P, t.doc.content.size, (E, J) => {
|
|
11040
|
+
if (M > -1)
|
|
11020
11041
|
return !1;
|
|
11021
|
-
E.isTextblock && E.content.size === 0 && (
|
|
11022
|
-
}),
|
|
11042
|
+
E.isTextblock && E.content.size === 0 && (M = J + 1);
|
|
11043
|
+
}), M > -1 && t.setSelection(O.near(t.doc.resolve(M))), t.scrollIntoView();
|
|
11023
11044
|
}
|
|
11024
11045
|
return !0;
|
|
11025
11046
|
}
|
|
@@ -11038,10 +11059,10 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11038
11059
|
if (!Ue(t.doc, a.pos, 2))
|
|
11039
11060
|
return !1;
|
|
11040
11061
|
if (i) {
|
|
11041
|
-
const { selection: y, storedMarks:
|
|
11062
|
+
const { selection: y, storedMarks: w } = n, { splittableMarks: C } = s.extensionManager, I = w || y.$to.parentOffset && y.$from.marks();
|
|
11042
11063
|
if (t.split(a.pos, 2, g).scrollIntoView(), !I || !i)
|
|
11043
11064
|
return !0;
|
|
11044
|
-
const A = I.filter((P) =>
|
|
11065
|
+
const A = I.filter((P) => C.includes(P.type.name));
|
|
11045
11066
|
t.ensureMarks(A);
|
|
11046
11067
|
}
|
|
11047
11068
|
return !0;
|
|
@@ -11063,32 +11084,32 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11063
11084
|
return !0;
|
|
11064
11085
|
const i = r.doc.nodeAt(n);
|
|
11065
11086
|
return t.node.type === (i == null ? void 0 : i.type) && Ve(r.doc, n) && r.join(n), !0;
|
|
11066
|
-
},
|
|
11067
|
-
const { extensions: d, splittableMarks: h } = i.extensionManager, u =
|
|
11068
|
-
if (!
|
|
11087
|
+
}, Ef = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: f }) => {
|
|
11088
|
+
const { extensions: d, splittableMarks: h } = i.extensionManager, u = V(r, o.schema), p = V(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: w } = m, C = y.blockRange(w), I = g || m.$to.parentOffset && m.$from.marks();
|
|
11089
|
+
if (!C)
|
|
11069
11090
|
return !1;
|
|
11070
11091
|
const A = ir((P) => fi(P.type.name, d))(m);
|
|
11071
|
-
if (
|
|
11092
|
+
if (C.depth >= 1 && A && C.depth - A.depth <= 1) {
|
|
11072
11093
|
if (A.node.type === u)
|
|
11073
11094
|
return c.liftListItem(p);
|
|
11074
11095
|
if (fi(A.node.type.name, d) && u.validContent(A.node.content) && l)
|
|
11075
11096
|
return a().command(() => (s.setNodeMarkup(A.pos, u), !0)).command(() => kn(s, u)).command(() => xn(s, u)).run();
|
|
11076
11097
|
}
|
|
11077
11098
|
return !t || !I || !l ? a().command(() => f().wrapInList(u, n) ? !0 : c.clearNodes()).wrapInList(u, n).command(() => kn(s, u)).command(() => xn(s, u)).run() : a().command(() => {
|
|
11078
|
-
const P = f().wrapInList(u, n),
|
|
11079
|
-
return s.ensureMarks(
|
|
11099
|
+
const P = f().wrapInList(u, n), M = I.filter((E) => h.includes(E.type.name));
|
|
11100
|
+
return s.ensureMarks(M), P ? !0 : c.clearNodes();
|
|
11080
11101
|
}).wrapInList(u, n).command(() => kn(s, u)).command(() => xn(s, u)).run();
|
|
11081
|
-
},
|
|
11102
|
+
}, Df = (r, e = {}, t = {}) => ({ state: n, commands: i }) => {
|
|
11082
11103
|
const { extendEmptyMarkRange: s = !1 } = t, o = we(r, n.schema);
|
|
11083
11104
|
return Ln(n, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
|
|
11084
|
-
},
|
|
11085
|
-
const s =
|
|
11105
|
+
}, Af = (r, e, t = {}) => ({ state: n, commands: i }) => {
|
|
11106
|
+
const s = V(r, n.schema), o = V(e, n.schema), l = gt(n, s, t);
|
|
11086
11107
|
let a;
|
|
11087
11108
|
return n.selection.$anchor.sameParent(n.selection.$head) && (a = n.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
|
|
11088
|
-
},
|
|
11089
|
-
const i =
|
|
11109
|
+
}, If = (r, e = {}) => ({ state: t, commands: n }) => {
|
|
11110
|
+
const i = V(r, t.schema);
|
|
11090
11111
|
return gt(t, i, e) ? n.lift(i) : n.wrapIn(i, e);
|
|
11091
|
-
},
|
|
11112
|
+
}, Rf = () => ({ state: r, dispatch: e }) => {
|
|
11092
11113
|
const t = r.plugins;
|
|
11093
11114
|
for (let n = 0; n < t.length; n += 1) {
|
|
11094
11115
|
const i = t[n];
|
|
@@ -11108,29 +11129,29 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11108
11129
|
}
|
|
11109
11130
|
}
|
|
11110
11131
|
return !1;
|
|
11111
|
-
},
|
|
11132
|
+
}, Pf = () => ({ tr: r, dispatch: e }) => {
|
|
11112
11133
|
const { selection: t } = r, { empty: n, ranges: i } = t;
|
|
11113
11134
|
return n || e && i.forEach((s) => {
|
|
11114
11135
|
r.removeMark(s.$from.pos, s.$to.pos);
|
|
11115
11136
|
}), !0;
|
|
11116
|
-
},
|
|
11137
|
+
}, vf = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
11117
11138
|
var s;
|
|
11118
11139
|
const { extendEmptyMarkRange: o = !1 } = e, { selection: l } = t, a = we(r, n.schema), { $from: c, empty: f, ranges: d } = l;
|
|
11119
11140
|
if (!i)
|
|
11120
11141
|
return !0;
|
|
11121
11142
|
if (f && o) {
|
|
11122
11143
|
let { from: h, to: u } = l;
|
|
11123
|
-
const p = (s = c.marks().find((g) => g.type === a)) === null || s === void 0 ? void 0 : s.attrs, m =
|
|
11144
|
+
const p = (s = c.marks().find((g) => g.type === a)) === null || s === void 0 ? void 0 : s.attrs, m = Vs(c, a, p);
|
|
11124
11145
|
m && (h = m.from, u = m.to), t.removeMark(h, u, a);
|
|
11125
11146
|
} else
|
|
11126
11147
|
d.forEach((h) => {
|
|
11127
11148
|
t.removeMark(h.$from.pos, h.$to.pos, a);
|
|
11128
11149
|
});
|
|
11129
11150
|
return t.removeStoredMark(a), !0;
|
|
11130
|
-
},
|
|
11151
|
+
}, Bf = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
11131
11152
|
let s = null, o = null;
|
|
11132
11153
|
const l = tn(typeof r == "string" ? r : r.name, n.schema);
|
|
11133
|
-
return l ? (l === "node" && (s =
|
|
11154
|
+
return l ? (l === "node" && (s = V(r, n.schema)), l === "mark" && (o = we(r, n.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11134
11155
|
const c = a.$from.pos, f = a.$to.pos;
|
|
11135
11156
|
let d, h, u, p;
|
|
11136
11157
|
t.selection.empty ? n.doc.nodesBetween(c, f, (m, g) => {
|
|
@@ -11141,8 +11162,8 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11141
11162
|
...e
|
|
11142
11163
|
}), o && m.marks.length && m.marks.forEach((y) => {
|
|
11143
11164
|
if (o === y.type) {
|
|
11144
|
-
const
|
|
11145
|
-
t.addMark(
|
|
11165
|
+
const w = Math.max(g, c), C = Math.min(g + m.nodeSize, f);
|
|
11166
|
+
t.addMark(w, C, o.create({
|
|
11146
11167
|
...y.attrs,
|
|
11147
11168
|
...e
|
|
11148
11169
|
}));
|
|
@@ -11158,82 +11179,82 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11158
11179
|
}));
|
|
11159
11180
|
}));
|
|
11160
11181
|
}), !0) : !1;
|
|
11161
|
-
},
|
|
11162
|
-
const i =
|
|
11163
|
-
return
|
|
11164
|
-
},
|
|
11165
|
-
const i =
|
|
11166
|
-
return
|
|
11182
|
+
}, zf = (r, e = {}) => ({ state: t, dispatch: n }) => {
|
|
11183
|
+
const i = V(r, t.schema);
|
|
11184
|
+
return Xa(i, e)(t, n);
|
|
11185
|
+
}, Ff = (r, e = {}) => ({ state: t, dispatch: n }) => {
|
|
11186
|
+
const i = V(r, t.schema);
|
|
11187
|
+
return Za(i, e)(t, n);
|
|
11167
11188
|
};
|
|
11168
|
-
var
|
|
11189
|
+
var Vf = /* @__PURE__ */ Object.freeze({
|
|
11169
11190
|
__proto__: null,
|
|
11170
|
-
blur:
|
|
11171
|
-
clearContent:
|
|
11172
|
-
clearNodes:
|
|
11173
|
-
command:
|
|
11174
|
-
createParagraphNear:
|
|
11175
|
-
cut:
|
|
11176
|
-
deleteCurrentNode:
|
|
11177
|
-
deleteNode:
|
|
11178
|
-
deleteRange:
|
|
11179
|
-
deleteSelection:
|
|
11180
|
-
enter:
|
|
11181
|
-
exitCode:
|
|
11182
|
-
extendMarkRange:
|
|
11183
|
-
first:
|
|
11184
|
-
focus:
|
|
11185
|
-
forEach:
|
|
11186
|
-
insertContent:
|
|
11187
|
-
insertContentAt:
|
|
11188
|
-
joinBackward:
|
|
11189
|
-
joinDown:
|
|
11190
|
-
joinForward:
|
|
11191
|
-
joinItemBackward:
|
|
11192
|
-
joinItemForward:
|
|
11193
|
-
joinTextblockBackward:
|
|
11194
|
-
joinTextblockForward:
|
|
11195
|
-
joinUp:
|
|
11196
|
-
keyboardShortcut:
|
|
11197
|
-
lift:
|
|
11198
|
-
liftEmptyBlock:
|
|
11199
|
-
liftListItem:
|
|
11200
|
-
newlineInCode:
|
|
11201
|
-
resetAttributes:
|
|
11202
|
-
scrollIntoView:
|
|
11203
|
-
selectAll:
|
|
11204
|
-
selectNodeBackward:
|
|
11205
|
-
selectNodeForward:
|
|
11206
|
-
selectParentNode:
|
|
11207
|
-
selectTextblockEnd:
|
|
11208
|
-
selectTextblockStart:
|
|
11209
|
-
setContent:
|
|
11210
|
-
setMark:
|
|
11211
|
-
setMeta:
|
|
11212
|
-
setNode:
|
|
11213
|
-
setNodeSelection:
|
|
11214
|
-
setTextSelection:
|
|
11215
|
-
sinkListItem:
|
|
11216
|
-
splitBlock:
|
|
11217
|
-
splitListItem:
|
|
11218
|
-
toggleList:
|
|
11219
|
-
toggleMark:
|
|
11220
|
-
toggleNode:
|
|
11221
|
-
toggleWrap:
|
|
11222
|
-
undoInputRule:
|
|
11223
|
-
unsetAllMarks:
|
|
11224
|
-
unsetMark:
|
|
11225
|
-
updateAttributes:
|
|
11226
|
-
wrapIn:
|
|
11227
|
-
wrapInList:
|
|
11191
|
+
blur: Cc,
|
|
11192
|
+
clearContent: Mc,
|
|
11193
|
+
clearNodes: wc,
|
|
11194
|
+
command: Oc,
|
|
11195
|
+
createParagraphNear: Nc,
|
|
11196
|
+
cut: Tc,
|
|
11197
|
+
deleteCurrentNode: Ec,
|
|
11198
|
+
deleteNode: Dc,
|
|
11199
|
+
deleteRange: Ac,
|
|
11200
|
+
deleteSelection: Ic,
|
|
11201
|
+
enter: Rc,
|
|
11202
|
+
exitCode: Pc,
|
|
11203
|
+
extendMarkRange: vc,
|
|
11204
|
+
first: Bc,
|
|
11205
|
+
focus: Fc,
|
|
11206
|
+
forEach: Vc,
|
|
11207
|
+
insertContent: Lc,
|
|
11208
|
+
insertContentAt: Jc,
|
|
11209
|
+
joinBackward: Kc,
|
|
11210
|
+
joinDown: qc,
|
|
11211
|
+
joinForward: Hc,
|
|
11212
|
+
joinItemBackward: Uc,
|
|
11213
|
+
joinItemForward: Gc,
|
|
11214
|
+
joinTextblockBackward: _c,
|
|
11215
|
+
joinTextblockForward: Yc,
|
|
11216
|
+
joinUp: jc,
|
|
11217
|
+
keyboardShortcut: Zc,
|
|
11218
|
+
lift: Qc,
|
|
11219
|
+
liftEmptyBlock: ef,
|
|
11220
|
+
liftListItem: tf,
|
|
11221
|
+
newlineInCode: nf,
|
|
11222
|
+
resetAttributes: rf,
|
|
11223
|
+
scrollIntoView: sf,
|
|
11224
|
+
selectAll: of,
|
|
11225
|
+
selectNodeBackward: lf,
|
|
11226
|
+
selectNodeForward: af,
|
|
11227
|
+
selectParentNode: cf,
|
|
11228
|
+
selectTextblockEnd: ff,
|
|
11229
|
+
selectTextblockStart: df,
|
|
11230
|
+
setContent: hf,
|
|
11231
|
+
setMark: xf,
|
|
11232
|
+
setMeta: Sf,
|
|
11233
|
+
setNode: Cf,
|
|
11234
|
+
setNodeSelection: Mf,
|
|
11235
|
+
setTextSelection: wf,
|
|
11236
|
+
sinkListItem: Of,
|
|
11237
|
+
splitBlock: Nf,
|
|
11238
|
+
splitListItem: Tf,
|
|
11239
|
+
toggleList: Ef,
|
|
11240
|
+
toggleMark: Df,
|
|
11241
|
+
toggleNode: Af,
|
|
11242
|
+
toggleWrap: If,
|
|
11243
|
+
undoInputRule: Rf,
|
|
11244
|
+
unsetAllMarks: Pf,
|
|
11245
|
+
unsetMark: vf,
|
|
11246
|
+
updateAttributes: Bf,
|
|
11247
|
+
wrapIn: zf,
|
|
11248
|
+
wrapInList: Ff
|
|
11228
11249
|
});
|
|
11229
|
-
const
|
|
11250
|
+
const Lf = ne.create({
|
|
11230
11251
|
name: "commands",
|
|
11231
11252
|
addCommands() {
|
|
11232
11253
|
return {
|
|
11233
|
-
...
|
|
11254
|
+
...Vf
|
|
11234
11255
|
};
|
|
11235
11256
|
}
|
|
11236
|
-
}),
|
|
11257
|
+
}), $f = ne.create({
|
|
11237
11258
|
name: "drop",
|
|
11238
11259
|
addProseMirrorPlugins() {
|
|
11239
11260
|
return [
|
|
@@ -11252,7 +11273,7 @@ const Ff = ne.create({
|
|
|
11252
11273
|
})
|
|
11253
11274
|
];
|
|
11254
11275
|
}
|
|
11255
|
-
}),
|
|
11276
|
+
}), Wf = ne.create({
|
|
11256
11277
|
name: "editable",
|
|
11257
11278
|
addProseMirrorPlugins() {
|
|
11258
11279
|
return [
|
|
@@ -11264,13 +11285,13 @@ const Ff = ne.create({
|
|
|
11264
11285
|
})
|
|
11265
11286
|
];
|
|
11266
11287
|
}
|
|
11267
|
-
}),
|
|
11288
|
+
}), Jf = new Le("focusEvents"), jf = ne.create({
|
|
11268
11289
|
name: "focusEvents",
|
|
11269
11290
|
addProseMirrorPlugins() {
|
|
11270
11291
|
const { editor: r } = this;
|
|
11271
11292
|
return [
|
|
11272
11293
|
new oe({
|
|
11273
|
-
key:
|
|
11294
|
+
key: Jf,
|
|
11274
11295
|
props: {
|
|
11275
11296
|
handleDOMEvents: {
|
|
11276
11297
|
focus: (e, t) => {
|
|
@@ -11288,7 +11309,7 @@ const Ff = ne.create({
|
|
|
11288
11309
|
})
|
|
11289
11310
|
];
|
|
11290
11311
|
}
|
|
11291
|
-
}),
|
|
11312
|
+
}), qf = ne.create({
|
|
11292
11313
|
name: "keymap",
|
|
11293
11314
|
addKeyboardShortcuts() {
|
|
11294
11315
|
const r = () => this.editor.commands.first(({ commands: o }) => [
|
|
@@ -11333,7 +11354,7 @@ const Ff = ne.create({
|
|
|
11333
11354
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
11334
11355
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
11335
11356
|
};
|
|
11336
|
-
return rr() ||
|
|
11357
|
+
return rr() || Js() ? s : i;
|
|
11337
11358
|
},
|
|
11338
11359
|
addProseMirrorPlugins() {
|
|
11339
11360
|
return [
|
|
@@ -11366,7 +11387,7 @@ const Ff = ne.create({
|
|
|
11366
11387
|
})
|
|
11367
11388
|
];
|
|
11368
11389
|
}
|
|
11369
|
-
}),
|
|
11390
|
+
}), Kf = ne.create({
|
|
11370
11391
|
name: "paste",
|
|
11371
11392
|
addProseMirrorPlugins() {
|
|
11372
11393
|
return [
|
|
@@ -11384,7 +11405,7 @@ const Ff = ne.create({
|
|
|
11384
11405
|
})
|
|
11385
11406
|
];
|
|
11386
11407
|
}
|
|
11387
|
-
}),
|
|
11408
|
+
}), Hf = ne.create({
|
|
11388
11409
|
name: "tabindex",
|
|
11389
11410
|
addProseMirrorPlugins() {
|
|
11390
11411
|
return [
|
|
@@ -11512,7 +11533,7 @@ class Ne {
|
|
|
11512
11533
|
}), this.editor.view.dispatch(t);
|
|
11513
11534
|
}
|
|
11514
11535
|
}
|
|
11515
|
-
const
|
|
11536
|
+
const Uf = `.ProseMirror {
|
|
11516
11537
|
position: relative;
|
|
11517
11538
|
}
|
|
11518
11539
|
|
|
@@ -11587,14 +11608,14 @@ img.ProseMirror-separator {
|
|
|
11587
11608
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
11588
11609
|
opacity: 0
|
|
11589
11610
|
}`;
|
|
11590
|
-
function
|
|
11611
|
+
function Gf(r, e, t) {
|
|
11591
11612
|
const n = document.querySelector("style[data-tiptap-style]");
|
|
11592
11613
|
if (n !== null)
|
|
11593
11614
|
return n;
|
|
11594
11615
|
const i = document.createElement("style");
|
|
11595
11616
|
return e && i.setAttribute("nonce", e), i.setAttribute("data-tiptap-style", ""), i.innerHTML = r, document.getElementsByTagName("head")[0].appendChild(i), i;
|
|
11596
11617
|
}
|
|
11597
|
-
let
|
|
11618
|
+
let Xf = class extends sc {
|
|
11598
11619
|
constructor(e = {}) {
|
|
11599
11620
|
super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
|
|
11600
11621
|
element: document.createElement("div"),
|
|
@@ -11657,7 +11678,7 @@ let _f = class extends rc {
|
|
|
11657
11678
|
* Inject CSS styles.
|
|
11658
11679
|
*/
|
|
11659
11680
|
injectCSS() {
|
|
11660
|
-
this.options.injectCSS && document && (this.css =
|
|
11681
|
+
this.options.injectCSS && document && (this.css = Gf(Uf, this.options.injectNonce));
|
|
11661
11682
|
}
|
|
11662
11683
|
/**
|
|
11663
11684
|
* Update editor options.
|
|
@@ -11696,7 +11717,7 @@ let _f = class extends rc {
|
|
|
11696
11717
|
* @returns The new editor state
|
|
11697
11718
|
*/
|
|
11698
11719
|
registerPlugin(e, t) {
|
|
11699
|
-
const n =
|
|
11720
|
+
const n = vs(t) ? t(e, [...this.state.plugins]) : [...this.state.plugins, e], i = this.state.reconfigure({ plugins: n });
|
|
11700
11721
|
return this.view.updateState(i), i;
|
|
11701
11722
|
}
|
|
11702
11723
|
/**
|
|
@@ -11726,16 +11747,16 @@ let _f = class extends rc {
|
|
|
11726
11747
|
createExtensionManager() {
|
|
11727
11748
|
var e, t;
|
|
11728
11749
|
const i = [...this.options.enableCoreExtensions ? [
|
|
11729
|
-
|
|
11730
|
-
|
|
11750
|
+
Wf,
|
|
11751
|
+
Sc.configure({
|
|
11731
11752
|
blockSeparator: (t = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || t === void 0 ? void 0 : t.blockSeparator
|
|
11732
11753
|
}),
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
Jf,
|
|
11754
|
+
Lf,
|
|
11755
|
+
jf,
|
|
11736
11756
|
qf,
|
|
11737
|
-
|
|
11738
|
-
|
|
11757
|
+
Hf,
|
|
11758
|
+
$f,
|
|
11759
|
+
Kf
|
|
11739
11760
|
].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
|
|
11740
11761
|
this.extensionManager = new He(i, this);
|
|
11741
11762
|
}
|
|
@@ -11772,8 +11793,8 @@ let _f = class extends rc {
|
|
|
11772
11793
|
}
|
|
11773
11794
|
}), t = Vn(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
|
|
11774
11795
|
}
|
|
11775
|
-
const n =
|
|
11776
|
-
this.view = new
|
|
11796
|
+
const n = $s(t, this.options.autofocus);
|
|
11797
|
+
this.view = new Ns(this.options.element, {
|
|
11777
11798
|
...this.options.editorProps,
|
|
11778
11799
|
attributes: {
|
|
11779
11800
|
// add `role="textbox"` to the editor element
|
|
@@ -11861,11 +11882,11 @@ let _f = class extends rc {
|
|
|
11861
11882
|
* Get attributes of the currently selected node or mark.
|
|
11862
11883
|
*/
|
|
11863
11884
|
getAttributes(e) {
|
|
11864
|
-
return
|
|
11885
|
+
return yf(this.state, e);
|
|
11865
11886
|
}
|
|
11866
11887
|
isActive(e, t) {
|
|
11867
11888
|
const n = typeof e == "string" ? e : null, i = typeof e == "string" ? t : e;
|
|
11868
|
-
return
|
|
11889
|
+
return bf(this.state, n, i);
|
|
11869
11890
|
}
|
|
11870
11891
|
/**
|
|
11871
11892
|
* Get the document as JSON.
|
|
@@ -11886,10 +11907,10 @@ let _f = class extends rc {
|
|
|
11886
11907
|
const { blockSeparator: t = `
|
|
11887
11908
|
|
|
11888
11909
|
`, textSerializers: n = {} } = e || {};
|
|
11889
|
-
return
|
|
11910
|
+
return mf(this.state.doc, {
|
|
11890
11911
|
blockSeparator: t,
|
|
11891
11912
|
textSerializers: {
|
|
11892
|
-
...
|
|
11913
|
+
...zs(this.schema),
|
|
11893
11914
|
...n
|
|
11894
11915
|
}
|
|
11895
11916
|
});
|
|
@@ -11941,8 +11962,8 @@ let _f = class extends rc {
|
|
|
11941
11962
|
return this.$pos(0);
|
|
11942
11963
|
}
|
|
11943
11964
|
};
|
|
11944
|
-
function
|
|
11945
|
-
return new
|
|
11965
|
+
function Qf(r) {
|
|
11966
|
+
return new dc({
|
|
11946
11967
|
find: r.find,
|
|
11947
11968
|
handler: ({ state: e, range: t, match: n }) => {
|
|
11948
11969
|
const i = T(r.getAttributes, void 0, n) || {}, { tr: s } = e, o = t.from;
|
|
@@ -11997,61 +12018,65 @@ class $n {
|
|
|
11997
12018
|
})), t;
|
|
11998
12019
|
}
|
|
11999
12020
|
}
|
|
12021
|
+
function ed(r) {
|
|
12022
|
+
return r.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
12023
|
+
}
|
|
12000
12024
|
export {
|
|
12001
|
-
|
|
12025
|
+
Yf as $,
|
|
12002
12026
|
Z as A,
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12027
|
+
za as B,
|
|
12028
|
+
Ba as C,
|
|
12029
|
+
v as D,
|
|
12006
12030
|
ne as E,
|
|
12007
12031
|
b as F,
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12032
|
+
Kt as G,
|
|
12033
|
+
Va as H,
|
|
12034
|
+
Wa as I,
|
|
12035
|
+
va as J,
|
|
12036
|
+
qa as K,
|
|
12037
|
+
Pa as L,
|
|
12038
|
+
Ka as M,
|
|
12015
12039
|
$n as N,
|
|
12016
|
-
|
|
12040
|
+
et as O,
|
|
12017
12041
|
oe as P,
|
|
12018
|
-
|
|
12019
|
-
|
|
12042
|
+
Ti as Q,
|
|
12043
|
+
ke as R,
|
|
12020
12044
|
N as S,
|
|
12021
12045
|
O as T,
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12046
|
+
B as U,
|
|
12047
|
+
F as V,
|
|
12048
|
+
Io as W,
|
|
12049
|
+
Ra as X,
|
|
12050
|
+
Bt as Y,
|
|
12051
|
+
Ls as Z,
|
|
12052
|
+
_f as _,
|
|
12029
12053
|
Le as a,
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12054
|
+
mf as a0,
|
|
12055
|
+
zs as a1,
|
|
12056
|
+
Xf as a2,
|
|
12057
|
+
ee as b,
|
|
12058
|
+
be as c,
|
|
12059
|
+
Ve as d,
|
|
12060
|
+
ed as e,
|
|
12036
12061
|
Bi as f,
|
|
12037
|
-
|
|
12038
|
-
|
|
12062
|
+
S as g,
|
|
12063
|
+
Xa as h,
|
|
12039
12064
|
sr as i,
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12065
|
+
k as j,
|
|
12066
|
+
Ue as k,
|
|
12067
|
+
ii as l,
|
|
12068
|
+
oc as m,
|
|
12069
|
+
Qf as n,
|
|
12070
|
+
_a as o,
|
|
12071
|
+
Ya as p,
|
|
12072
|
+
Ua as q,
|
|
12073
|
+
La as r,
|
|
12074
|
+
ic as s,
|
|
12075
|
+
Fa as t,
|
|
12076
|
+
ja as u,
|
|
12077
|
+
tc as v,
|
|
12078
|
+
Za as w,
|
|
12079
|
+
Ha as x,
|
|
12080
|
+
Ja as y,
|
|
12081
|
+
$a as z
|
|
12057
12082
|
};
|