tuikit-atomicx-vue3 3.4.2 → 4.3.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 +1 -0
- package/dist/baseComp/Modal/Modal.js +431 -23
- package/dist/chat/index.d.ts +18 -18
- package/dist/components/AudioSetting/AudioMediaControl.js +39 -41
- package/dist/components/AudioSetting/AudioSettingTab.js +10 -10
- package/dist/components/AudioSetting/MicrophoneSelect.js +8 -8
- package/dist/components/AudioSetting/SpeakerSelect.js +9 -9
- package/dist/components/AudioSettingPanel/i18n/en-US/index.d.ts +1 -0
- package/dist/components/AudioSettingPanel/i18n/en-US/index.js +2 -1
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.js +2 -1
- package/dist/components/AudioSettingPanel/index.js +81 -73
- package/dist/components/BarrageInput/BarrageInputH5.js +9 -9
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +3 -3
- package/dist/components/BarrageInput/MessageInputState.d.ts +28 -0
- package/dist/components/BarrageInput/MessageInputState.js +82 -0
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +2 -2
- package/dist/components/BarrageInput/TextEditor/index.js +7 -7
- package/dist/components/BarrageInput/type.d.ts +17 -0
- package/dist/components/BarrageInput/type.js +4 -0
- package/dist/components/BarrageInput/utils.d.ts +30 -0
- package/dist/components/BarrageInput/utils.js +41 -0
- package/dist/components/BarrageList/BarrageList.js +80 -110
- package/dist/components/BarrageList/BarrageList.vue.d.ts +0 -29
- package/dist/components/BarrageList/BarrageListH5.js +95 -122
- package/dist/components/BarrageList/BarrageListH5.vue.d.ts +0 -29
- package/dist/components/BarrageList/BarrageListState.d.ts +58 -0
- package/dist/components/BarrageList/BarrageListState.js +106 -0
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.js +16 -24
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue.d.ts +5 -5
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.js +48 -73
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.vue.d.ts +5 -7
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +70 -76
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.vue.d.ts +6 -6
- package/dist/components/BarrageList/Message/TextMessage/emoji.d.ts +5 -0
- package/dist/components/BarrageList/Message/TextMessage/emoji.js +134 -0
- package/dist/components/BarrageList/index.d.ts +0 -36
- package/dist/components/CameraButton/index.js +18 -19
- package/dist/components/CoGuestPanel/CoGuestPanel.js +60 -60
- package/dist/components/CoHostPanel/BattlePanel.js +11 -11
- package/dist/components/CoHostPanel/CoHostPanel.js +10 -10
- package/dist/components/CoHostPanel/ConfigSettingPanel.js +49 -55
- package/dist/components/CoHostPanel/ConnectionPanel.js +132 -123
- package/dist/components/CoHostPanel/RecommendHostList.js +39 -36
- package/dist/components/CoHostPanel/constants.d.ts +3 -0
- package/dist/components/CoHostPanel/constants.js +6 -0
- package/dist/components/CoHostPanel/i18n/en-US/index.d.ts +1 -0
- package/dist/components/CoHostPanel/i18n/en-US/index.js +2 -1
- package/dist/components/CoHostPanel/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/CoHostPanel/i18n/zh-CN/index.js +3 -2
- package/dist/components/LiveAudienceList/LiveAudienceList.js +44 -45
- package/dist/components/LiveAudienceList/LiveAudienceListH5.js +7 -7
- package/dist/components/LiveAudienceList/UserActionMenu.js +57 -64
- package/dist/components/LiveList/LiveList.js +23 -23
- package/dist/components/LiveList/LiveListH5.js +38 -38
- package/dist/components/LiveScenePanel/CameraSettingDialog.js +10 -10
- package/dist/components/LiveScenePanel/MaterialItem.js +15 -15
- package/dist/components/LiveScenePanel/index.js +4 -4
- package/dist/components/LiveView/CoreViewDecorate/BattleDecorate.js +58 -58
- package/dist/components/LiveView/CoreViewDecorate/BattleUserDecorate.js +6 -6
- package/dist/components/LiveView/CoreViewDecorate/CoHostDecorate.js +5 -5
- package/dist/components/LiveView/DefaultStreamViewUI.js +44 -41
- package/dist/components/LiveView/PlayerControl/AudioControl.js +20 -20
- package/dist/components/LiveView/PlayerControl/MultiResolution.js +49 -48
- package/dist/components/LiveView/PlayerControl/MultiResolution.vue.d.ts +7 -1
- package/dist/components/LiveView/PlayerControl/PlayerControl.js +90 -86
- package/dist/components/LiveView/PlayerControl/PlayerControlState.js +127 -131
- package/dist/components/LiveView/PlayerControl/utils/domHelpers.d.ts +6 -0
- package/dist/components/LiveView/PlayerControl/utils/domHelpers.js +54 -22
- package/dist/components/LiveView/i18n/en-US/index.d.ts +2 -2
- package/dist/components/LiveView/i18n/en-US/index.js +2 -2
- package/dist/components/LiveView/i18n/zh-CN/index.d.ts +2 -2
- package/dist/components/LiveView/i18n/zh-CN/index.js +2 -2
- package/dist/components/LiveView/index.js +17 -17
- package/dist/components/MessageInput/TextEditor/EditorCore.js +2 -2
- package/dist/components/MessageList/MessageList.vue.d.ts +2 -2
- package/dist/components/MessageList/index.d.ts +18 -18
- package/dist/components/MicButton/index.js +11 -11
- package/dist/components/StreamMixer/LocalMixer/MixerControl.js +12 -12
- package/dist/components/StreamMixer/LocalMixer/index.js +66 -63
- package/dist/components/StreamView/Layout/CustomLayout.js +8 -8
- package/dist/components/StreamView/Layout/FloatLayout.js +124 -127
- package/dist/components/StreamView/Layout/GridLayout.js +5 -5
- package/dist/components/StreamView/index.js +25 -33
- package/dist/components/StreamView/manager/mediaManager.js +54 -60
- package/dist/components/VideoSetting/CameraSelect.js +8 -8
- package/dist/components/VideoSetting/VideoMediaControl.js +10 -10
- package/dist/components/VideoSetting/VideoPreview.js +9 -9
- package/dist/components/VideoSetting/VideoProfile.js +6 -6
- package/dist/components/VideoSetting/VideoSettingTab.js +40 -39
- package/dist/components/VideoSettingPanel/CameraSelect.js +8 -8
- package/dist/components/VideoSettingPanel/VideoPreview.js +1 -1
- package/dist/components/VideoSettingPanel/VideoProfile.js +18 -18
- package/dist/hooks/useRoomEngine.js +6 -6
- package/dist/{index-D2OVtqc8.js → index-BfIEeWMg.js} +191 -181
- package/dist/{index-Bm-QfV5o.js → index-DTi1fL-x.js} +460 -457
- package/dist/index.js +162 -144
- package/dist/report/MetricsKey.d.ts +16 -0
- package/dist/report/MetricsKey.js +4 -0
- package/dist/report/dataReport.d.ts +12 -0
- package/dist/report/dataReport.js +45 -0
- package/dist/report/index.d.ts +4 -0
- package/dist/report/index.js +6 -0
- package/dist/rtc/index.d.ts +5 -43
- package/dist/rtc/index.js +48 -48
- package/dist/states/BarrageState/BarrageState.d.ts +74 -0
- package/dist/states/BarrageState/BarrageState.js +80 -0
- package/dist/states/BarrageState/index.d.ts +1 -0
- package/dist/states/BarrageState/index.js +5 -0
- package/dist/states/{BattleState.d.ts → BattleState/BattleState.d.ts} +10 -11
- package/dist/states/BattleState/BattleState.js +203 -0
- package/dist/states/BattleState/index.d.ts +1 -0
- package/dist/states/BattleState/index.js +4 -0
- package/dist/states/CoGuestState.d.ts +24 -94
- package/dist/states/CoGuestState.js +297 -189
- package/dist/states/CoHostState/CoHostState.d.ts +2 -2
- package/dist/states/CoHostState/CoHostState.js +135 -131
- package/dist/states/{DeviceState.d.ts → DeviceState/DeviceState.d.ts} +25 -13
- package/dist/states/DeviceState/DeviceState.js +314 -0
- package/dist/states/DeviceState/index.d.ts +1 -0
- package/dist/states/DeviceState/index.js +4 -0
- package/dist/states/LiveAudienceState.d.ts +3 -1
- package/dist/states/LiveAudienceState.js +106 -63
- package/dist/states/{LiveState/index.d.ts → LiveListState/LiveListState.d.ts} +13 -8
- package/dist/states/LiveListState/LiveListState.js +285 -0
- package/dist/states/LiveListState/index.d.ts +1 -0
- package/dist/states/LiveListState/index.js +4 -0
- package/dist/states/LiveMonitorState/api/http.js +147 -129
- package/dist/states/LiveMonitorState/index.js +67 -62
- package/dist/states/LiveSeatState/index.d.ts +46 -11
- package/dist/states/LiveSeatState/index.js +34 -15
- package/dist/states/LiveSeatState/seatEventManager.d.ts +2 -0
- package/dist/states/LiveSeatState/seatEventManager.js +63 -42
- package/dist/states/LiveSeatState/seatManager.d.ts +34 -5
- package/dist/states/LiveSeatState/seatManager.js +131 -29
- package/dist/states/LiveSeatState/store.d.ts +5 -5
- package/dist/states/LiveSeatState/store.js +12 -10
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamManager.js +1 -1
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamPlayer.js +1 -1
- package/dist/states/LiveSeatState/usePlayStream/index.js +30 -28
- package/dist/states/LoginState.js +39 -34
- package/dist/states/SeatStore.js +82 -83
- package/dist/states/{VideoMixerState.d.ts → VideoMixerState/VideoMixerState.d.ts} +1 -1
- package/dist/states/VideoMixerState/VideoMixerState.js +269 -0
- package/dist/states/VideoMixerState/index.d.ts +1 -0
- package/dist/states/VideoMixerState/index.js +4 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/audience.d.ts +21 -0
- package/dist/types/audience.js +4 -1
- package/dist/types/battle.d.ts +75 -3
- package/dist/types/battle.js +5 -1
- package/dist/types/coGuest.d.ts +72 -5
- package/dist/types/coGuest.js +4 -2
- package/dist/types/device.d.ts +38 -17
- package/dist/types/device.js +10 -8
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +96 -80
- package/dist/types/live.d.ts +36 -21
- package/dist/types/live.js +6 -4
- package/dist/types/seat.d.ts +23 -4
- package/dist/types/seat.js +7 -1
- package/dist/utils/eventCenter.d.ts +88 -0
- package/dist/utils/eventCenter.js +161 -0
- package/package.json +3 -3
- package/src/components/AudioSetting/AudioMediaControl.vue +1 -3
- package/src/components/AudioSetting/AudioSettingTab.vue +1 -2
- package/src/components/AudioSetting/MicrophoneSelect.vue +1 -2
- package/src/components/AudioSetting/SpeakerSelect.vue +1 -2
- package/src/components/AudioSettingPanel/i18n/en-US/index.ts +1 -0
- package/src/components/AudioSettingPanel/i18n/zh-CN/index.ts +1 -0
- package/src/components/AudioSettingPanel/index.vue +4 -2
- package/src/components/BarrageInput/BarrageInputH5.vue +1 -1
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.vue +1 -1
- package/src/components/BarrageInput/MessageInputState.ts +160 -0
- package/src/components/BarrageInput/TextEditor/TextEditor.vue +1 -1
- package/src/components/BarrageInput/type.ts +26 -0
- package/src/components/BarrageInput/utils.ts +45 -0
- package/src/components/BarrageList/BarrageList.vue +61 -117
- package/src/components/BarrageList/BarrageListH5.vue +75 -159
- package/src/components/BarrageList/BarrageListState.ts +223 -0
- package/src/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue +8 -55
- package/src/components/BarrageList/Message/MessageLayout/MessageLayout.vue +19 -44
- package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +69 -96
- package/src/components/BarrageList/Message/TextMessage/emoji.ts +132 -0
- package/src/components/CameraButton/index.vue +0 -1
- package/src/components/CoGuestPanel/CoGuestPanel.vue +16 -91
- package/src/components/CoHostPanel/BattlePanel.vue +1 -4
- package/src/components/CoHostPanel/ConfigSettingPanel.vue +2 -8
- package/src/components/CoHostPanel/ConnectionPanel.vue +37 -33
- package/src/components/CoHostPanel/RecommendHostList.vue +12 -13
- package/src/components/CoHostPanel/constants.ts +3 -0
- package/src/components/CoHostPanel/i18n/en-US/index.ts +1 -0
- package/src/components/CoHostPanel/i18n/zh-CN/index.ts +2 -1
- package/src/components/LiveAudienceList/LiveAudienceList.vue +4 -5
- package/src/components/LiveAudienceList/LiveAudienceListH5.vue +2 -2
- package/src/components/LiveAudienceList/UserActionMenu.vue +7 -48
- package/src/components/LiveList/LiveList.vue +5 -5
- package/src/components/LiveList/LiveListH5.vue +6 -6
- package/src/components/LiveScenePanel/index.vue +2 -2
- package/src/components/LiveView/CoreViewDecorate/BattleDecorate.vue +10 -15
- package/src/components/LiveView/CoreViewDecorate/BattleUserDecorate.vue +2 -2
- package/src/components/LiveView/DefaultStreamViewUI.vue +5 -3
- package/src/components/LiveView/PlayerControl/AudioControl.vue +1 -1
- package/src/components/LiveView/PlayerControl/MultiResolution.vue +9 -3
- package/src/components/LiveView/PlayerControl/PlayerControl.vue +10 -2
- package/src/components/LiveView/PlayerControl/PlayerControlState.ts +233 -259
- package/src/components/LiveView/PlayerControl/utils/domHelpers.ts +64 -0
- package/src/components/LiveView/i18n/en-US/index.ts +2 -2
- package/src/components/LiveView/i18n/zh-CN/index.ts +2 -2
- package/src/components/LiveView/index.vue +2 -2
- package/src/components/MicButton/index.vue +3 -3
- package/src/components/StreamMixer/LocalMixer/index.vue +6 -8
- package/src/components/StreamView/Layout/CustomLayout.vue +2 -2
- package/src/components/StreamView/Layout/FloatLayout.vue +88 -83
- package/src/components/StreamView/index.vue +28 -14
- package/src/components/StreamView/manager/mediaManager.ts +38 -42
- package/src/components/VideoSetting/CameraSelect.vue +1 -2
- package/src/components/VideoSetting/VideoMediaControl.vue +1 -1
- package/src/components/VideoSetting/VideoPreview.vue +1 -2
- package/src/components/VideoSetting/VideoProfile.vue +1 -1
- package/src/components/VideoSetting/VideoSettingTab.vue +9 -5
- package/src/components/VideoSettingPanel/CameraSelect.vue +1 -2
- package/src/components/VideoSettingPanel/VideoProfile.vue +7 -7
- package/src/hooks/useRoomEngine.ts +1 -1
- package/src/report/MetricsKey.ts +16 -0
- package/src/report/dataReport.ts +55 -0
- package/src/report/index.ts +7 -0
- package/src/rtc/index.ts +7 -9
- package/src/types/audience.ts +27 -1
- package/src/types/battle.ts +87 -4
- package/src/types/coGuest.ts +87 -5
- package/src/types/device.ts +41 -16
- package/src/types/index.ts +2 -2
- package/src/types/live.ts +41 -22
- package/src/types/seat.ts +28 -4
- package/src/utils/eventCenter.ts +249 -0
- package/dist/DialogPortal-CvJcEAsn.js +0 -417
- package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.js +0 -23
- package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.vue.d.ts +0 -30
- package/dist/components/BarrageList/Message/FaceMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/FaceMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.js +0 -4
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +0 -16
- package/dist/components/BarrageList/Message/GroupTipMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/GroupTipMessage/index.js +0 -25
- package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.js +0 -71
- package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.vue.d.ts +0 -34
- package/dist/components/BarrageList/Message/ImageMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/ImageMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.js +0 -9
- package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.vue.d.ts +0 -2
- package/dist/components/BarrageList/Message/MergerMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/MergerMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.js +0 -40
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue.d.ts +0 -54
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.js +0 -26
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue.d.ts +0 -15
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.js +0 -4
- package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.js +0 -41
- package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue.d.ts +0 -35
- package/dist/components/BarrageList/Message/RecalledMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/RecalledMessage/index.js +0 -4
- package/dist/components/BarrageList/MessageForward/ForwardListItem.js +0 -45
- package/dist/components/BarrageList/MessageForward/ForwardListItem.vue.d.ts +0 -17
- package/dist/components/BarrageList/MessageForward/MessageForward.js +0 -203
- package/dist/components/BarrageList/MessageForward/MessageForward.vue.d.ts +0 -2
- package/dist/components/BarrageList/MessageForward/index.d.ts +0 -3
- package/dist/components/BarrageList/MessageForward/index.js +0 -4
- package/dist/components/StreamView/Layout/MixLayout.js +0 -89
- package/dist/components/StreamView/Layout/MixLayout.vue.d.ts +0 -31
- package/dist/states/BarrageListState/BarrageListState.d.ts +0 -26
- package/dist/states/BarrageListState/BarrageListState.js +0 -122
- package/dist/states/BarrageListState/index.d.ts +0 -1
- package/dist/states/BarrageListState/index.js +0 -4
- package/dist/states/BattleState.js +0 -117
- package/dist/states/DeviceState.js +0 -296
- package/dist/states/LiveState/index.js +0 -254
- package/dist/states/VideoMixerState.js +0 -260
- package/src/components/BarrageList/Message/FaceMessage/FaceMessage.vue +0 -43
- package/src/components/BarrageList/Message/FaceMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue +0 -55
- package/src/components/BarrageList/Message/GroupTipMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/ImageMessage/ImageMessage.vue +0 -181
- package/src/components/BarrageList/Message/ImageMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/MergerMessage/MergerMessage.vue +0 -6
- package/src/components/BarrageList/Message/MergerMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +0 -70
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue +0 -40
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/index.ts +0 -3
- package/src/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue +0 -82
- package/src/components/BarrageList/Message/RecalledMessage/index.ts +0 -3
- package/src/components/BarrageList/MessageForward/ForwardListItem.vue +0 -67
- package/src/components/BarrageList/MessageForward/MessageForward.vue +0 -388
- package/src/components/BarrageList/MessageForward/index.ts +0 -3
- package/src/components/StreamView/Layout/MixLayout.vue +0 -144
|
@@ -1791,7 +1791,7 @@ function Oi(r, e) {
|
|
|
1791
1791
|
t[n] = new so(r, n, e[n]);
|
|
1792
1792
|
return t;
|
|
1793
1793
|
}
|
|
1794
|
-
let cr = class
|
|
1794
|
+
let cr = class Ni {
|
|
1795
1795
|
/**
|
|
1796
1796
|
@internal
|
|
1797
1797
|
*/
|
|
@@ -1959,7 +1959,7 @@ let cr = class Ti {
|
|
|
1959
1959
|
*/
|
|
1960
1960
|
static compile(e, t) {
|
|
1961
1961
|
let n = /* @__PURE__ */ Object.create(null);
|
|
1962
|
-
e.forEach((s, o) => n[s] = new
|
|
1962
|
+
e.forEach((s, o) => n[s] = new Ni(s, t, o));
|
|
1963
1963
|
let i = t.spec.topNode || "doc";
|
|
1964
1964
|
if (!n[i])
|
|
1965
1965
|
throw new RangeError("Schema is missing its top node type ('" + i + "')");
|
|
@@ -2041,7 +2041,7 @@ class qt {
|
|
|
2041
2041
|
return this.excluded.indexOf(e) > -1;
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
class
|
|
2044
|
+
class Ti {
|
|
2045
2045
|
/**
|
|
2046
2046
|
Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
|
|
2047
2047
|
*/
|
|
@@ -2340,16 +2340,24 @@ class hr {
|
|
|
2340
2340
|
e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
|
|
2341
2341
|
}
|
|
2342
2342
|
addTextNode(e, t) {
|
|
2343
|
-
let n = e.nodeValue, i = this.top, s = i.options & wn ? "full" : this.localPreserveWS || (i.options & ft) > 0;
|
|
2343
|
+
let n = e.nodeValue, i = this.top, s = i.options & wn ? "full" : this.localPreserveWS || (i.options & ft) > 0, { schema: o } = this.parser;
|
|
2344
2344
|
if (s === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(n)) {
|
|
2345
2345
|
if (s)
|
|
2346
|
-
s
|
|
2346
|
+
if (s === "full")
|
|
2347
|
+
n = n.replace(/\r\n?/g, `
|
|
2347
2348
|
`);
|
|
2349
|
+
else if (o.linebreakReplacement && /[\r\n]/.test(n) && this.top.findWrapping(o.linebreakReplacement.create())) {
|
|
2350
|
+
let l = n.split(/\r?\n|\r/);
|
|
2351
|
+
for (let a = 0; a < l.length; a++)
|
|
2352
|
+
a && this.insertNode(o.linebreakReplacement.create(), t, !0), l[a] && this.insertNode(o.text(l[a]), t, !/\S/.test(l[a]));
|
|
2353
|
+
n = "";
|
|
2354
|
+
} else
|
|
2355
|
+
n = n.replace(/\r?\n|\r/g, " ");
|
|
2348
2356
|
else if (n = n.replace(/[ \t\r\n\u000c]+/g, " "), /^[ \t\r\n\u000c]/.test(n) && this.open == this.nodes.length - 1) {
|
|
2349
|
-
let
|
|
2350
|
-
(!
|
|
2357
|
+
let l = i.content[i.content.length - 1], a = e.previousSibling;
|
|
2358
|
+
(!l || a && a.nodeName == "BR" || l.isText && /[ \t\r\n\u000c]$/.test(l.text)) && (n = n.slice(1));
|
|
2351
2359
|
}
|
|
2352
|
-
n && this.insertNode(
|
|
2360
|
+
n && this.insertNode(o.text(n), t, !/\S/.test(n)), this.findInText(e);
|
|
2353
2361
|
} else
|
|
2354
2362
|
this.findInside(e);
|
|
2355
2363
|
}
|
|
@@ -2680,7 +2688,7 @@ class Fe {
|
|
|
2680
2688
|
@internal
|
|
2681
2689
|
*/
|
|
2682
2690
|
serializeNodeInner(e, t) {
|
|
2683
|
-
let { dom: n, contentDOM: i } =
|
|
2691
|
+
let { dom: n, contentDOM: i } = Tt(rn(t), this.nodes[e.type.name](e), null, e.attrs);
|
|
2684
2692
|
if (i) {
|
|
2685
2693
|
if (e.isLeaf)
|
|
2686
2694
|
throw new RangeError("Content hole not allowed in a leaf node spec");
|
|
@@ -2708,10 +2716,10 @@ class Fe {
|
|
|
2708
2716
|
*/
|
|
2709
2717
|
serializeMark(e, t, n = {}) {
|
|
2710
2718
|
let i = this.marks[e.type.name];
|
|
2711
|
-
return i &&
|
|
2719
|
+
return i && Tt(rn(n), i(e, t), null, e.attrs);
|
|
2712
2720
|
}
|
|
2713
2721
|
static renderSpec(e, t, n = null, i) {
|
|
2714
|
-
return
|
|
2722
|
+
return Tt(e, t, n, i);
|
|
2715
2723
|
}
|
|
2716
2724
|
/**
|
|
2717
2725
|
Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
|
|
@@ -2767,7 +2775,7 @@ function uo(r) {
|
|
|
2767
2775
|
}
|
|
2768
2776
|
return t(r), e;
|
|
2769
2777
|
}
|
|
2770
|
-
function
|
|
2778
|
+
function Tt(r, e, t, n) {
|
|
2771
2779
|
if (typeof e == "string")
|
|
2772
2780
|
return { dom: r.createTextNode(e) };
|
|
2773
2781
|
if (e.nodeType != null)
|
|
@@ -2797,7 +2805,7 @@ function Nt(r, e, t, n) {
|
|
|
2797
2805
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
2798
2806
|
return { dom: a, contentDOM: a };
|
|
2799
2807
|
} else {
|
|
2800
|
-
let { dom: u, contentDOM: p } =
|
|
2808
|
+
let { dom: u, contentDOM: p } = Tt(r, h, t, n);
|
|
2801
2809
|
if (a.appendChild(u), p) {
|
|
2802
2810
|
if (l)
|
|
2803
2811
|
throw new RangeError("Multiple content holes");
|
|
@@ -3313,7 +3321,7 @@ class B extends q {
|
|
|
3313
3321
|
super(), this.from = e, this.to = t, this.slice = n, this.structure = i;
|
|
3314
3322
|
}
|
|
3315
3323
|
apply(e) {
|
|
3316
|
-
return this.structure &&
|
|
3324
|
+
return this.structure && Nn(e, this.from, this.to) ? R.fail("Structure replace would overwrite content") : R.fromReplace(e, this.from, this.to, this.slice);
|
|
3317
3325
|
}
|
|
3318
3326
|
getMap() {
|
|
3319
3327
|
return new _([this.from, this.to - this.from, this.slice.size]);
|
|
@@ -3362,7 +3370,7 @@ class z extends q {
|
|
|
3362
3370
|
super(), this.from = e, this.to = t, this.gapFrom = n, this.gapTo = i, this.slice = s, this.insert = o, this.structure = l;
|
|
3363
3371
|
}
|
|
3364
3372
|
apply(e) {
|
|
3365
|
-
if (this.structure && (
|
|
3373
|
+
if (this.structure && (Nn(e, this.from, this.gapFrom) || Nn(e, this.gapTo, this.to)))
|
|
3366
3374
|
return R.fail("Structure gap-replace would overwrite content");
|
|
3367
3375
|
let t = e.slice(this.gapFrom, this.gapTo);
|
|
3368
3376
|
if (t.openStart || t.openEnd)
|
|
@@ -3409,7 +3417,7 @@ class z extends q {
|
|
|
3409
3417
|
}
|
|
3410
3418
|
}
|
|
3411
3419
|
q.jsonID("replaceAround", z);
|
|
3412
|
-
function
|
|
3420
|
+
function Nn(r, e, t) {
|
|
3413
3421
|
let n = r.resolve(e), i = t - e, s = n.depth;
|
|
3414
3422
|
for (; i > 0 && s > 0 && n.indexAfter(s) == n.node(s).childCount; )
|
|
3415
3423
|
s--, i--;
|
|
@@ -3492,12 +3500,13 @@ function bo(r, e, t) {
|
|
|
3492
3500
|
}
|
|
3493
3501
|
function et(r) {
|
|
3494
3502
|
let t = r.parent.content.cutByIndex(r.startIndex, r.endIndex);
|
|
3495
|
-
for (let n = r.depth; ; --n) {
|
|
3496
|
-
let
|
|
3497
|
-
if (n < r.depth &&
|
|
3503
|
+
for (let n = r.depth, i = 0, s = 0; ; --n) {
|
|
3504
|
+
let o = r.$from.node(n), l = r.$from.index(n) + i, a = r.$to.indexAfter(n) - s;
|
|
3505
|
+
if (n < r.depth && o.canReplace(l, a, t))
|
|
3498
3506
|
return n;
|
|
3499
|
-
if (n == 0 ||
|
|
3507
|
+
if (n == 0 || o.type.spec.isolating || !bo(o, l, a))
|
|
3500
3508
|
break;
|
|
3509
|
+
l && (i = 1), a < o.childCount && (s = 1);
|
|
3501
3510
|
}
|
|
3502
3511
|
return null;
|
|
3503
3512
|
}
|
|
@@ -3617,7 +3626,7 @@ function Ue(r, e, t = 1, n) {
|
|
|
3617
3626
|
let l = i.indexAfter(s), a = n && n[0];
|
|
3618
3627
|
return i.node(s).canReplaceWith(l, l, a ? a.type : i.node(s + 1).type);
|
|
3619
3628
|
}
|
|
3620
|
-
function
|
|
3629
|
+
function No(r, e, t = 1, n) {
|
|
3621
3630
|
let i = r.doc.resolve(e), s = b.empty, o = b.empty;
|
|
3622
3631
|
for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
|
|
3623
3632
|
s = b.from(i.node(l).copy(s));
|
|
@@ -3630,7 +3639,7 @@ function Ve(r, e) {
|
|
|
3630
3639
|
let t = r.resolve(e), n = t.index();
|
|
3631
3640
|
return Vi(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(n, n + 1);
|
|
3632
3641
|
}
|
|
3633
|
-
function
|
|
3642
|
+
function To(r, e) {
|
|
3634
3643
|
e.content.size || r.type.compatibleContent(e.type);
|
|
3635
3644
|
let t = r.contentMatchAt(r.childCount), { linebreakReplacement: n } = r.type.schema;
|
|
3636
3645
|
for (let i = 0; i < e.childCount; i++) {
|
|
@@ -3641,7 +3650,7 @@ function No(r, e) {
|
|
|
3641
3650
|
return t.validEnd;
|
|
3642
3651
|
}
|
|
3643
3652
|
function Vi(r, e) {
|
|
3644
|
-
return !!(r && e && !r.isLeaf &&
|
|
3653
|
+
return !!(r && e && !r.isLeaf && To(r, e));
|
|
3645
3654
|
}
|
|
3646
3655
|
function Kt(r, e, t = -1) {
|
|
3647
3656
|
let n = r.resolve(e);
|
|
@@ -3911,7 +3920,7 @@ function vo(r, e, t, n) {
|
|
|
3911
3920
|
let i = r.doc.resolve(e), s = r.doc.resolve(t);
|
|
3912
3921
|
if (Li(i, s, n))
|
|
3913
3922
|
return r.step(new B(e, t, n));
|
|
3914
|
-
let o = Ji(i,
|
|
3923
|
+
let o = Ji(i, s);
|
|
3915
3924
|
o[o.length - 1] == 0 && o.pop();
|
|
3916
3925
|
let l = -(i.depth + 1);
|
|
3917
3926
|
o.unshift(l);
|
|
@@ -4273,7 +4282,7 @@ class Fo {
|
|
|
4273
4282
|
use after the split (with the outermost nodes coming first).
|
|
4274
4283
|
*/
|
|
4275
4284
|
split(e, t = 1, n) {
|
|
4276
|
-
return
|
|
4285
|
+
return No(this, e, t, n), this;
|
|
4277
4286
|
}
|
|
4278
4287
|
/**
|
|
4279
4288
|
Add the given mark to the inline content between `from` and `to`.
|
|
@@ -4301,7 +4310,7 @@ class Fo {
|
|
|
4301
4310
|
}
|
|
4302
4311
|
}
|
|
4303
4312
|
const an = /* @__PURE__ */ Object.create(null);
|
|
4304
|
-
class
|
|
4313
|
+
class N {
|
|
4305
4314
|
/**
|
|
4306
4315
|
Initialize a selection with the head and anchor and ranges. If no
|
|
4307
4316
|
ranges are given, constructs a single range across `$anchor` and
|
|
@@ -4465,7 +4474,7 @@ class T {
|
|
|
4465
4474
|
return O.between(this.$anchor, this.$head).getBookmark();
|
|
4466
4475
|
}
|
|
4467
4476
|
}
|
|
4468
|
-
|
|
4477
|
+
N.prototype.visible = !0;
|
|
4469
4478
|
class Vo {
|
|
4470
4479
|
/**
|
|
4471
4480
|
Create a range.
|
|
@@ -4478,7 +4487,7 @@ let kr = !1;
|
|
|
4478
4487
|
function xr(r) {
|
|
4479
4488
|
!kr && !r.parent.inlineContent && (kr = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + r.parent.type.name + ")"));
|
|
4480
4489
|
}
|
|
4481
|
-
class O extends
|
|
4490
|
+
class O extends N {
|
|
4482
4491
|
/**
|
|
4483
4492
|
Construct a text selection between the given points.
|
|
4484
4493
|
*/
|
|
@@ -4495,7 +4504,7 @@ class O extends T {
|
|
|
4495
4504
|
map(e, t) {
|
|
4496
4505
|
let n = e.resolve(t.map(this.head));
|
|
4497
4506
|
if (!n.parent.inlineContent)
|
|
4498
|
-
return
|
|
4507
|
+
return N.near(n);
|
|
4499
4508
|
let i = e.resolve(t.map(this.anchor));
|
|
4500
4509
|
return new O(i.parent.inlineContent ? i : n, n);
|
|
4501
4510
|
}
|
|
@@ -4540,16 +4549,16 @@ class O extends T {
|
|
|
4540
4549
|
static between(e, t, n) {
|
|
4541
4550
|
let i = e.pos - t.pos;
|
|
4542
4551
|
if ((!n || i) && (n = i >= 0 ? 1 : -1), !t.parent.inlineContent) {
|
|
4543
|
-
let s =
|
|
4552
|
+
let s = N.findFrom(t, n, !0) || N.findFrom(t, -n, !0);
|
|
4544
4553
|
if (s)
|
|
4545
4554
|
t = s.$head;
|
|
4546
4555
|
else
|
|
4547
|
-
return
|
|
4556
|
+
return N.near(t, n);
|
|
4548
4557
|
}
|
|
4549
|
-
return e.parent.inlineContent || (i == 0 ? e = t : (e = (
|
|
4558
|
+
return e.parent.inlineContent || (i == 0 ? e = t : (e = (N.findFrom(e, -n, !0) || N.findFrom(e, n, !0)).$anchor, e.pos < t.pos != i < 0 && (e = t))), new O(e, t);
|
|
4550
4559
|
}
|
|
4551
4560
|
}
|
|
4552
|
-
|
|
4561
|
+
N.jsonID("text", O);
|
|
4553
4562
|
class Ut {
|
|
4554
4563
|
constructor(e, t) {
|
|
4555
4564
|
this.anchor = e, this.head = t;
|
|
@@ -4561,7 +4570,7 @@ class Ut {
|
|
|
4561
4570
|
return O.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
4562
4571
|
}
|
|
4563
4572
|
}
|
|
4564
|
-
class S extends
|
|
4573
|
+
class S extends N {
|
|
4565
4574
|
/**
|
|
4566
4575
|
Create a node selection. Does not verify the validity of its
|
|
4567
4576
|
argument.
|
|
@@ -4572,7 +4581,7 @@ class S extends T {
|
|
|
4572
4581
|
}
|
|
4573
4582
|
map(e, t) {
|
|
4574
4583
|
let { deleted: n, pos: i } = t.mapResult(this.anchor), s = e.resolve(i);
|
|
4575
|
-
return n ?
|
|
4584
|
+
return n ? N.near(s) : new S(s);
|
|
4576
4585
|
}
|
|
4577
4586
|
content() {
|
|
4578
4587
|
return new k(b.from(this.node), 0, 0);
|
|
@@ -4609,7 +4618,7 @@ class S extends T {
|
|
|
4609
4618
|
}
|
|
4610
4619
|
}
|
|
4611
4620
|
S.prototype.visible = !1;
|
|
4612
|
-
|
|
4621
|
+
N.jsonID("node", S);
|
|
4613
4622
|
class jn {
|
|
4614
4623
|
constructor(e) {
|
|
4615
4624
|
this.anchor = e;
|
|
@@ -4620,10 +4629,10 @@ class jn {
|
|
|
4620
4629
|
}
|
|
4621
4630
|
resolve(e) {
|
|
4622
4631
|
let t = e.resolve(this.anchor), n = t.nodeAfter;
|
|
4623
|
-
return n && S.isSelectable(n) ? new S(t) :
|
|
4632
|
+
return n && S.isSelectable(n) ? new S(t) : N.near(t);
|
|
4624
4633
|
}
|
|
4625
4634
|
}
|
|
4626
|
-
class Z extends
|
|
4635
|
+
class Z extends N {
|
|
4627
4636
|
/**
|
|
4628
4637
|
Create an all-selection over the given document.
|
|
4629
4638
|
*/
|
|
@@ -4633,7 +4642,7 @@ class Z extends T {
|
|
|
4633
4642
|
replace(e, t = k.empty) {
|
|
4634
4643
|
if (t == k.empty) {
|
|
4635
4644
|
e.delete(0, e.doc.content.size);
|
|
4636
|
-
let n =
|
|
4645
|
+
let n = N.atStart(e.doc);
|
|
4637
4646
|
n.eq(e.selection) || e.setSelection(n);
|
|
4638
4647
|
} else
|
|
4639
4648
|
super.replace(e, t);
|
|
@@ -4657,7 +4666,7 @@ class Z extends T {
|
|
|
4657
4666
|
return Lo;
|
|
4658
4667
|
}
|
|
4659
4668
|
}
|
|
4660
|
-
|
|
4669
|
+
N.jsonID("all", Z);
|
|
4661
4670
|
const Lo = {
|
|
4662
4671
|
map() {
|
|
4663
4672
|
return this;
|
|
@@ -4693,7 +4702,7 @@ function Sr(r, e, t) {
|
|
|
4693
4702
|
let s = r.mapping.maps[n], o;
|
|
4694
4703
|
s.forEach((l, a, c, f) => {
|
|
4695
4704
|
o == null && (o = f);
|
|
4696
|
-
}), r.setSelection(
|
|
4705
|
+
}), r.setSelection(N.near(r.doc.resolve(o), t));
|
|
4697
4706
|
}
|
|
4698
4707
|
const Cr = 1, Ct = 2, Mr = 4;
|
|
4699
4708
|
class $o extends Fo {
|
|
@@ -4801,14 +4810,14 @@ class $o extends Fo {
|
|
|
4801
4810
|
if (t == null)
|
|
4802
4811
|
return e ? this.replaceSelectionWith(i.text(e), !0) : this.deleteSelection();
|
|
4803
4812
|
{
|
|
4804
|
-
if (n == null && (n = t),
|
|
4813
|
+
if (n == null && (n = t), !e)
|
|
4805
4814
|
return this.deleteRange(t, n);
|
|
4806
4815
|
let s = this.storedMarks;
|
|
4807
4816
|
if (!s) {
|
|
4808
4817
|
let o = this.doc.resolve(t);
|
|
4809
4818
|
s = n == t ? o.marks() : o.marksAcross(this.doc.resolve(n));
|
|
4810
4819
|
}
|
|
4811
|
-
return this.replaceRangeWith(t, n, i.text(e, s)), this.selection.empty
|
|
4820
|
+
return this.replaceRangeWith(t, n, i.text(e, s)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(N.near(this.selection.$to)), this;
|
|
4812
4821
|
}
|
|
4813
4822
|
}
|
|
4814
4823
|
/**
|
|
@@ -4866,7 +4875,7 @@ const Wo = [
|
|
|
4866
4875
|
}),
|
|
4867
4876
|
new it("selection", {
|
|
4868
4877
|
init(r, e) {
|
|
4869
|
-
return r.selection ||
|
|
4878
|
+
return r.selection || N.atStart(e.doc);
|
|
4870
4879
|
},
|
|
4871
4880
|
apply(r) {
|
|
4872
4881
|
return r.selection;
|
|
@@ -4981,7 +4990,7 @@ class Ke {
|
|
|
4981
4990
|
return t;
|
|
4982
4991
|
}
|
|
4983
4992
|
/**
|
|
4984
|
-
|
|
4993
|
+
Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
|
|
4985
4994
|
*/
|
|
4986
4995
|
get tr() {
|
|
4987
4996
|
return new $o(this);
|
|
@@ -5046,7 +5055,7 @@ class Ke {
|
|
|
5046
5055
|
if (o.name == "doc")
|
|
5047
5056
|
s.doc = be.fromJSON(e.schema, t.doc);
|
|
5048
5057
|
else if (o.name == "selection")
|
|
5049
|
-
s.selection =
|
|
5058
|
+
s.selection = N.fromJSON(s.doc, t.selection);
|
|
5050
5059
|
else if (o.name == "storedMarks")
|
|
5051
5060
|
t.storedMarks && (s.storedMarks = t.storedMarks.map(e.schema.markFromJSON));
|
|
5052
5061
|
else {
|
|
@@ -5117,12 +5126,12 @@ const L = function(r) {
|
|
|
5117
5126
|
let e = r.assignedSlot || r.parentNode;
|
|
5118
5127
|
return e && e.nodeType == 11 ? e.host : e;
|
|
5119
5128
|
};
|
|
5120
|
-
let
|
|
5129
|
+
let Tn = null;
|
|
5121
5130
|
const ae = function(r, e, t) {
|
|
5122
|
-
let n =
|
|
5131
|
+
let n = Tn || (Tn = document.createRange());
|
|
5123
5132
|
return n.setEnd(r, t ?? r.nodeValue.length), n.setStart(r, e || 0), n;
|
|
5124
5133
|
}, Jo = function() {
|
|
5125
|
-
|
|
5134
|
+
Tn = null;
|
|
5126
5135
|
}, Be = function(r, e, t, n) {
|
|
5127
5136
|
return t && (Or(r, e, t, n, -1) || Or(r, e, t, n, 1));
|
|
5128
5137
|
}, jo = /^(img|br|input|textarea|hr)$/i;
|
|
@@ -5222,7 +5231,7 @@ function Go(r, e, t) {
|
|
|
5222
5231
|
return { node: n.startContainer, offset: Math.min(X(n.startContainer), n.startOffset) };
|
|
5223
5232
|
}
|
|
5224
5233
|
}
|
|
5225
|
-
const ie = typeof navigator < "u" ? navigator : null,
|
|
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), j = !!An, Hi = An ? +An[1] : 0, K = !G && !!ie && /Apple Computer/.test(ie.vendor), Ze = K && (/Mobile\/\w+/.test($e) || !!ie && ie.maxTouchPoints > 2), Y = Ze || (ie ? /Mac/.test(ie.platform) : !1), _o = 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;
|
|
5226
5235
|
function Xo(r) {
|
|
5227
5236
|
let e = r.defaultView && r.defaultView.visualViewport;
|
|
5228
5237
|
return e ? {
|
|
@@ -5249,7 +5258,7 @@ function Zo(r) {
|
|
|
5249
5258
|
bottom: e.top + r.clientHeight * n
|
|
5250
5259
|
};
|
|
5251
5260
|
}
|
|
5252
|
-
function
|
|
5261
|
+
function Tr(r, e, t) {
|
|
5253
5262
|
let n = r.someProp("scrollThreshold") || 0, i = r.someProp("scrollMargin") || 5, s = r.dom.ownerDocument;
|
|
5254
5263
|
for (let o = t || r.dom; o; ) {
|
|
5255
5264
|
if (o.nodeType != 1) {
|
|
@@ -5556,7 +5565,7 @@ let Dr = null, Ar = null, Ir = !1;
|
|
|
5556
5565
|
function dl(r, e, t) {
|
|
5557
5566
|
return Dr == e && Ar == t ? Ir : (Dr = e, Ar = t, Ir = t == "up" || t == "down" ? al(r, e, t) : fl(r, e, t));
|
|
5558
5567
|
}
|
|
5559
|
-
const Q = 0, Rr = 1,
|
|
5568
|
+
const Q = 0, Rr = 1, Te = 2, se = 3;
|
|
5560
5569
|
class kt {
|
|
5561
5570
|
constructor(e, t, n, i) {
|
|
5562
5571
|
this.parent = e, this.children = t, this.dom = n, this.contentDOM = i, this.dirty = Q, n.pmViewDesc = this;
|
|
@@ -5872,19 +5881,19 @@ class kt {
|
|
|
5872
5881
|
if (n == o ? e <= o && t >= n : e < o && t > n) {
|
|
5873
5882
|
let l = n + s.border, a = o - s.border;
|
|
5874
5883
|
if (e >= l && t <= a) {
|
|
5875
|
-
this.dirty = e == n || t == o ?
|
|
5884
|
+
this.dirty = e == n || t == o ? Te : Rr, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = se : s.markDirty(e - l, t - l);
|
|
5876
5885
|
return;
|
|
5877
5886
|
} else
|
|
5878
|
-
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ?
|
|
5887
|
+
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Te : se;
|
|
5879
5888
|
}
|
|
5880
5889
|
n = o;
|
|
5881
5890
|
}
|
|
5882
|
-
this.dirty =
|
|
5891
|
+
this.dirty = Te;
|
|
5883
5892
|
}
|
|
5884
5893
|
markParentsDirty() {
|
|
5885
5894
|
let e = 1;
|
|
5886
5895
|
for (let t = this.parent; t; t = t.parent, e++) {
|
|
5887
|
-
let n = e == 1 ?
|
|
5896
|
+
let n = e == 1 ? Te : Rr;
|
|
5888
5897
|
t.dirty < n && (t.dirty = n);
|
|
5889
5898
|
}
|
|
5890
5899
|
}
|
|
@@ -6068,7 +6077,7 @@ class Se extends kt {
|
|
|
6068
6077
|
a.syncToMarks(c.marks, n, e);
|
|
6069
6078
|
let u;
|
|
6070
6079
|
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;
|
|
6071
|
-
}), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty ==
|
|
6080
|
+
}), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Te) && (o && this.protectLocalComposition(e, o), ts(this.contentDOM, this.children, e), Ze && kl(this.dom));
|
|
6072
6081
|
}
|
|
6073
6082
|
localCompositionInfo(e, t) {
|
|
6074
6083
|
let { from: n, to: i } = e.state.selection;
|
|
@@ -6372,7 +6381,7 @@ class ml {
|
|
|
6372
6381
|
}
|
|
6373
6382
|
updateNodeAt(e, t, n, i, s) {
|
|
6374
6383
|
let o = this.top.children[i];
|
|
6375
|
-
return o.dirty == se && o.dom == o.contentDOM && (o.dirty =
|
|
6384
|
+
return o.dirty == se && o.dom == o.contentDOM && (o.dirty = Te), o.update(e, t, n, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
|
|
6376
6385
|
}
|
|
6377
6386
|
findIndexWithChild(e) {
|
|
6378
6387
|
for (; ; ) {
|
|
@@ -6404,7 +6413,7 @@ class ml {
|
|
|
6404
6413
|
if (!h && a.update(e, t, n, i))
|
|
6405
6414
|
return this.destroyBetween(this.index, l), a.dom != f && (this.changed = !0), this.index++, !0;
|
|
6406
6415
|
if (!h && (d = this.recreateWrapper(a, e, t, n, i, o)))
|
|
6407
|
-
return this.destroyBetween(this.index, l), this.top.children[this.index] = d, d.contentDOM && (d.dirty =
|
|
6416
|
+
return this.destroyBetween(this.index, l), this.top.children[this.index] = d, d.contentDOM && (d.dirty = Te, d.updateChildren(i, o + 1), d.dirty = Q), this.changed = !0, this.index++, !0;
|
|
6408
6417
|
break;
|
|
6409
6418
|
}
|
|
6410
6419
|
}
|
|
@@ -6703,7 +6712,7 @@ function Ml(r) {
|
|
|
6703
6712
|
}
|
|
6704
6713
|
function Pn(r, e) {
|
|
6705
6714
|
let { $anchor: t, $head: n } = r.selection, i = e > 0 ? t.max(n) : t.min(n), s = i.parent.inlineContent ? i.depth ? r.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
|
|
6706
|
-
return s &&
|
|
6715
|
+
return s && N.findFrom(s, e);
|
|
6707
6716
|
}
|
|
6708
6717
|
function ue(r, e) {
|
|
6709
6718
|
return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()), !0;
|
|
@@ -6820,7 +6829,7 @@ function as(r) {
|
|
|
6820
6829
|
let e = r.pmViewDesc;
|
|
6821
6830
|
return e && e.node && e.node.isBlock;
|
|
6822
6831
|
}
|
|
6823
|
-
function
|
|
6832
|
+
function Nl(r, e) {
|
|
6824
6833
|
for (; r && e == r.childNodes.length && !yt(r); )
|
|
6825
6834
|
e = L(r) + 1, r = r.parentNode;
|
|
6826
6835
|
for (; r && e < r.childNodes.length; ) {
|
|
@@ -6832,7 +6841,7 @@ function Tl(r, e) {
|
|
|
6832
6841
|
r = t, e = 0;
|
|
6833
6842
|
}
|
|
6834
6843
|
}
|
|
6835
|
-
function
|
|
6844
|
+
function Tl(r, e) {
|
|
6836
6845
|
for (; r && !e && !yt(r); )
|
|
6837
6846
|
e = L(r), r = r.parentNode;
|
|
6838
6847
|
for (; r && e; ) {
|
|
@@ -6847,7 +6856,7 @@ function Nl(r, e) {
|
|
|
6847
6856
|
function vn(r, e, t) {
|
|
6848
6857
|
if (e.nodeType != 3) {
|
|
6849
6858
|
let s, o;
|
|
6850
|
-
(o =
|
|
6859
|
+
(o = Nl(e, t)) ? (e = o, t = 0) : (s = Tl(e, t)) && (e = s, t = s.nodeValue.length);
|
|
6851
6860
|
}
|
|
6852
6861
|
let n = r.domSelection();
|
|
6853
6862
|
if (!n)
|
|
@@ -6890,7 +6899,7 @@ function Jr(r, e, t) {
|
|
|
6890
6899
|
return ue(r, o);
|
|
6891
6900
|
}
|
|
6892
6901
|
if (!i.parent.inlineContent) {
|
|
6893
|
-
let o = e < 0 ? i : s, l = n instanceof Z ?
|
|
6902
|
+
let o = e < 0 ? i : s, l = n instanceof Z ? N.near(o, e) : N.findFrom(o, e);
|
|
6894
6903
|
return l ? ue(r, l) : !1;
|
|
6895
6904
|
}
|
|
6896
6905
|
return !1;
|
|
@@ -7338,7 +7347,7 @@ class Yl {
|
|
|
7338
7347
|
// (hidden) cursor is doesn't change the selection, and
|
|
7339
7348
|
// thus doesn't get a reaction from ProseMirror. This
|
|
7340
7349
|
// works around that.
|
|
7341
|
-
j && !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,
|
|
7350
|
+
j && !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");
|
|
7342
7351
|
}
|
|
7343
7352
|
move(e) {
|
|
7344
7353
|
this.updateAllowDefault(e), ye(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -8209,7 +8218,7 @@ class ca {
|
|
|
8209
8218
|
}
|
|
8210
8219
|
}
|
|
8211
8220
|
let c = null;
|
|
8212
|
-
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(
|
|
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), fa(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));
|
|
8213
8222
|
}
|
|
8214
8223
|
registerMutation(e, t) {
|
|
8215
8224
|
if (t.indexOf(e.target) > -1)
|
|
@@ -8369,31 +8378,32 @@ function ga(r, e, t, n, i) {
|
|
|
8369
8378
|
return w(r, Oe(13, "Enter"));
|
|
8370
8379
|
});
|
|
8371
8380
|
}, 20));
|
|
8372
|
-
let M = p.start,
|
|
8373
|
-
let E = w || r.state.tr.replace(M,
|
|
8381
|
+
let M = p.start, I = p.endA, A = (w) => {
|
|
8382
|
+
let E = w || r.state.tr.replace(M, I, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
8374
8383
|
if (c.sel) {
|
|
8375
8384
|
let W = Xr(r, E.doc, c.sel);
|
|
8376
|
-
W && !(j && r.composing && W.empty && (p.start != p.endB || r.input.lastChromeDelete < Date.now() - 100) && (W.head == M || W.head == E.mapping.map(
|
|
8385
|
+
W && !(j && r.composing && W.empty && (p.start != p.endB || r.input.lastChromeDelete < Date.now() - 100) && (W.head == M || W.head == E.mapping.map(I) - 1) || G && W.empty && W.head == M) && E.setSelection(W);
|
|
8377
8386
|
}
|
|
8378
8387
|
return s && E.setMeta("composition", s), E.scrollIntoView();
|
|
8379
8388
|
}, P;
|
|
8380
|
-
if (C)
|
|
8389
|
+
if (C)
|
|
8381
8390
|
if (m.pos == g.pos) {
|
|
8382
8391
|
G && xe <= 11 && m.parentOffset == 0 && (r.domObserver.suppressSelectionUpdates(), setTimeout(() => de(r), 20));
|
|
8383
|
-
let w =
|
|
8392
|
+
let w = A(r.state.tr.delete(M, I)), E = f.resolve(p.start).marksAcross(f.resolve(p.endA));
|
|
8384
8393
|
E && w.ensureMarks(E), r.dispatch(w);
|
|
8385
8394
|
} else if (
|
|
8386
8395
|
// Adding or removing a mark
|
|
8387
8396
|
p.endA == p.endB && (P = ya(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
|
|
8388
8397
|
) {
|
|
8389
|
-
let w =
|
|
8390
|
-
P.type == "add" ? w.addMark(M,
|
|
8398
|
+
let w = A(r.state.tr);
|
|
8399
|
+
P.type == "add" ? w.addMark(M, I, P.mark) : w.removeMark(M, I, P.mark), r.dispatch(w);
|
|
8391
8400
|
} else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
8392
|
-
let w = m.parent.textBetween(m.parentOffset, g.parentOffset), E = () =>
|
|
8393
|
-
r.someProp("handleTextInput", (W) => W(r, M,
|
|
8394
|
-
}
|
|
8395
|
-
|
|
8396
|
-
|
|
8401
|
+
let w = m.parent.textBetween(m.parentOffset, g.parentOffset), E = () => A(r.state.tr.insertText(w, M, I));
|
|
8402
|
+
r.someProp("handleTextInput", (W) => W(r, M, I, w, E)) || r.dispatch(E());
|
|
8403
|
+
} else
|
|
8404
|
+
r.dispatch(A());
|
|
8405
|
+
else
|
|
8406
|
+
r.dispatch(A());
|
|
8397
8407
|
}
|
|
8398
8408
|
function Xr(r, e, t) {
|
|
8399
8409
|
return Math.max(t.anchor, t.head) > e.content.size ? null : Hn(r, e.resolve(t.anchor), e.resolve(t.head));
|
|
@@ -8562,9 +8572,9 @@ class Os {
|
|
|
8562
8572
|
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
|
|
8563
8573
|
if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof S) {
|
|
8564
8574
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
8565
|
-
t.nodeType == 1 &&
|
|
8575
|
+
t.nodeType == 1 && Tr(this, t.getBoundingClientRect(), e);
|
|
8566
8576
|
} else
|
|
8567
|
-
|
|
8577
|
+
Tr(this, this.coordsAtPos(this.state.selection.head, 1), e);
|
|
8568
8578
|
}
|
|
8569
8579
|
}
|
|
8570
8580
|
destroyPluginViews() {
|
|
@@ -8937,8 +8947,8 @@ function wa(r) {
|
|
|
8937
8947
|
var e = Ca && r.metaKey && r.shiftKey && !r.ctrlKey && !r.altKey || Ma && r.shiftKey && r.key && r.key.length == 1 || r.key == "Unidentified", t = !e && r.key || (r.shiftKey ? Wt : Me)[r.keyCode] || r.key || "Unidentified";
|
|
8938
8948
|
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;
|
|
8939
8949
|
}
|
|
8940
|
-
const Oa = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform),
|
|
8941
|
-
function
|
|
8950
|
+
const Oa = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), Na = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
8951
|
+
function Ta(r) {
|
|
8942
8952
|
let e = r.split(/-(?!$)/), t = e[e.length - 1];
|
|
8943
8953
|
t == "Space" && (t = " ");
|
|
8944
8954
|
let n, i, s, o;
|
|
@@ -8962,7 +8972,7 @@ function Na(r) {
|
|
|
8962
8972
|
function Ea(r) {
|
|
8963
8973
|
let e = /* @__PURE__ */ Object.create(null);
|
|
8964
8974
|
for (let t in r)
|
|
8965
|
-
e[
|
|
8975
|
+
e[Ta(t)] = r[t];
|
|
8966
8976
|
return e;
|
|
8967
8977
|
}
|
|
8968
8978
|
function yn(r, e, t = !0) {
|
|
@@ -8984,7 +8994,7 @@ function Aa(r) {
|
|
|
8984
8994
|
return !0;
|
|
8985
8995
|
}
|
|
8986
8996
|
if ((n.altKey || n.metaKey || n.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
8987
|
-
!(
|
|
8997
|
+
!(Na && n.ctrlKey && n.altKey) && (s = Me[n.keyCode]) && s != i) {
|
|
8988
8998
|
let l = e[yn(s, n)];
|
|
8989
8999
|
if (l && l(t.state, t.dispatch, t))
|
|
8990
9000
|
return !0;
|
|
@@ -8994,12 +9004,12 @@ function Aa(r) {
|
|
|
8994
9004
|
};
|
|
8995
9005
|
}
|
|
8996
9006
|
const Ia = (r, e) => r.selection.empty ? !1 : (e && e(r.tr.deleteSelection().scrollIntoView()), !0);
|
|
8997
|
-
function
|
|
9007
|
+
function Ns(r, e) {
|
|
8998
9008
|
let { $cursor: t } = r.selection;
|
|
8999
9009
|
return !t || (e ? !e.endOfTextblock("backward", r) : t.parentOffset > 0) ? null : t;
|
|
9000
9010
|
}
|
|
9001
9011
|
const Ra = (r, e, t) => {
|
|
9002
|
-
let n =
|
|
9012
|
+
let n = Ns(r, t);
|
|
9003
9013
|
if (!n)
|
|
9004
9014
|
return !1;
|
|
9005
9015
|
let i = Qn(n);
|
|
@@ -9016,7 +9026,7 @@ const Ra = (r, e, t) => {
|
|
|
9016
9026
|
if (l && l.slice.size < l.to - l.from) {
|
|
9017
9027
|
if (e) {
|
|
9018
9028
|
let a = r.tr.step(l);
|
|
9019
|
-
a.setSelection(Qe(s, "end") ?
|
|
9029
|
+
a.setSelection(Qe(s, "end") ? N.findFrom(a.doc.resolve(a.mapping.map(i.pos, -1)), -1) : S.create(a.doc, i.pos - s.nodeSize)), e(a.scrollIntoView());
|
|
9020
9030
|
}
|
|
9021
9031
|
return !0;
|
|
9022
9032
|
}
|
|
@@ -9025,19 +9035,19 @@ const Ra = (r, e, t) => {
|
|
|
9025
9035
|
}
|
|
9026
9036
|
return s.isAtom && i.depth == n.depth - 1 ? (e && e(r.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
|
|
9027
9037
|
}, Pa = (r, e, t) => {
|
|
9028
|
-
let n =
|
|
9038
|
+
let n = Ns(r, t);
|
|
9029
9039
|
if (!n)
|
|
9030
9040
|
return !1;
|
|
9031
9041
|
let i = Qn(n);
|
|
9032
|
-
return i ?
|
|
9042
|
+
return i ? Ts(r, i, e) : !1;
|
|
9033
9043
|
}, va = (r, e, t) => {
|
|
9034
9044
|
let n = Es(r, t);
|
|
9035
9045
|
if (!n)
|
|
9036
9046
|
return !1;
|
|
9037
9047
|
let i = er(n);
|
|
9038
|
-
return i ?
|
|
9048
|
+
return i ? Ts(r, i, e) : !1;
|
|
9039
9049
|
};
|
|
9040
|
-
function
|
|
9050
|
+
function Ts(r, e, t) {
|
|
9041
9051
|
let n = e.nodeBefore, i = n, s = e.pos - 1;
|
|
9042
9052
|
for (; !i.isTextblock; s--) {
|
|
9043
9053
|
if (i.type.spec.isolating)
|
|
@@ -9115,7 +9125,7 @@ const za = (r, e, t) => {
|
|
|
9115
9125
|
if (o && o.slice.size < o.to - o.from) {
|
|
9116
9126
|
if (e) {
|
|
9117
9127
|
let l = r.tr.step(o);
|
|
9118
|
-
l.setSelection(Qe(s, "start") ?
|
|
9128
|
+
l.setSelection(Qe(s, "start") ? N.findFrom(l.doc.resolve(l.mapping.map(i.pos)), 1) : S.create(l.doc, l.mapping.map(i.pos))), e(l.scrollIntoView());
|
|
9119
9129
|
}
|
|
9120
9130
|
return !0;
|
|
9121
9131
|
}
|
|
@@ -9191,7 +9201,7 @@ const Ja = (r, e) => {
|
|
|
9191
9201
|
return !1;
|
|
9192
9202
|
if (e) {
|
|
9193
9203
|
let l = t.after(), a = r.tr.replaceWith(l, l, o.createAndFill());
|
|
9194
|
-
a.setSelection(
|
|
9204
|
+
a.setSelection(N.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
|
|
9195
9205
|
}
|
|
9196
9206
|
return !0;
|
|
9197
9207
|
}, ja = (r, e) => {
|
|
@@ -9241,7 +9251,7 @@ function As(r, e, t, n) {
|
|
|
9241
9251
|
}
|
|
9242
9252
|
return !0;
|
|
9243
9253
|
}
|
|
9244
|
-
let f = s.type.spec.isolating || n > 0 && a ? null :
|
|
9254
|
+
let f = s.type.spec.isolating || n > 0 && a ? null : N.findFrom(e, 1), d = f && f.$from.blockRange(f.$to), h = d && et(d);
|
|
9245
9255
|
if (h != null && h >= e.depth)
|
|
9246
9256
|
return t && t(r.tr.lift(d, h).scrollIntoView()), !0;
|
|
9247
9257
|
if (c && Qe(s, "start", !0) && Qe(i, "end")) {
|
|
@@ -9612,7 +9622,7 @@ function Fn(r, e) {
|
|
|
9612
9622
|
function Ps(r) {
|
|
9613
9623
|
return typeof r == "function";
|
|
9614
9624
|
}
|
|
9615
|
-
function
|
|
9625
|
+
function T(r, e = void 0, ...t) {
|
|
9616
9626
|
return Ps(r) ? e ? r.bind(e)(...t) : r(...t) : r;
|
|
9617
9627
|
}
|
|
9618
9628
|
function sc(r = {}) {
|
|
@@ -9661,23 +9671,23 @@ function lc(r, e) {
|
|
|
9661
9671
|
};
|
|
9662
9672
|
}, {}), u = oi({
|
|
9663
9673
|
...h,
|
|
9664
|
-
content:
|
|
9665
|
-
marks:
|
|
9666
|
-
group:
|
|
9667
|
-
inline:
|
|
9668
|
-
atom:
|
|
9669
|
-
selectable:
|
|
9670
|
-
draggable:
|
|
9671
|
-
code:
|
|
9672
|
-
whitespace:
|
|
9673
|
-
linebreakReplacement:
|
|
9674
|
-
defining:
|
|
9675
|
-
isolating:
|
|
9674
|
+
content: T(x(c, "content", d)),
|
|
9675
|
+
marks: T(x(c, "marks", d)),
|
|
9676
|
+
group: T(x(c, "group", d)),
|
|
9677
|
+
inline: T(x(c, "inline", d)),
|
|
9678
|
+
atom: T(x(c, "atom", d)),
|
|
9679
|
+
selectable: T(x(c, "selectable", d)),
|
|
9680
|
+
draggable: T(x(c, "draggable", d)),
|
|
9681
|
+
code: T(x(c, "code", d)),
|
|
9682
|
+
whitespace: T(x(c, "whitespace", d)),
|
|
9683
|
+
linebreakReplacement: T(x(c, "linebreakReplacement", d)),
|
|
9684
|
+
defining: T(x(c, "defining", d)),
|
|
9685
|
+
isolating: T(x(c, "isolating", d)),
|
|
9676
9686
|
attrs: Object.fromEntries(f.map((y) => {
|
|
9677
9687
|
var C;
|
|
9678
9688
|
return [y.name, { default: (C = y == null ? void 0 : y.attribute) === null || C === void 0 ? void 0 : C.default }];
|
|
9679
9689
|
}))
|
|
9680
|
-
}), p =
|
|
9690
|
+
}), p = T(x(c, "parseHTML", d));
|
|
9681
9691
|
p && (u.parseDOM = p.map((y) => si(y, f)));
|
|
9682
9692
|
const m = x(c, "renderHTML", d);
|
|
9683
9693
|
m && (u.toDOM = (y) => m({
|
|
@@ -9700,16 +9710,16 @@ function lc(r, e) {
|
|
|
9700
9710
|
};
|
|
9701
9711
|
}, {}), u = oi({
|
|
9702
9712
|
...h,
|
|
9703
|
-
inclusive:
|
|
9704
|
-
excludes:
|
|
9705
|
-
group:
|
|
9706
|
-
spanning:
|
|
9707
|
-
code:
|
|
9713
|
+
inclusive: T(x(c, "inclusive", d)),
|
|
9714
|
+
excludes: T(x(c, "excludes", d)),
|
|
9715
|
+
group: T(x(c, "group", d)),
|
|
9716
|
+
spanning: T(x(c, "spanning", d)),
|
|
9717
|
+
code: T(x(c, "code", d)),
|
|
9708
9718
|
attrs: Object.fromEntries(f.map((g) => {
|
|
9709
9719
|
var y;
|
|
9710
9720
|
return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
|
|
9711
9721
|
}))
|
|
9712
|
-
}), p =
|
|
9722
|
+
}), p = T(x(c, "parseHTML", d));
|
|
9713
9723
|
p && (u.parseDOM = p.map((g) => si(g, f)));
|
|
9714
9724
|
const m = x(c, "renderHTML", d);
|
|
9715
9725
|
return m && (u.toDOM = (g) => m({
|
|
@@ -9717,7 +9727,7 @@ function lc(r, e) {
|
|
|
9717
9727
|
HTMLAttributes: Fn(g, f)
|
|
9718
9728
|
})), [c.name, u];
|
|
9719
9729
|
}));
|
|
9720
|
-
return new
|
|
9730
|
+
return new Ti({
|
|
9721
9731
|
topNode: o,
|
|
9722
9732
|
nodes: l,
|
|
9723
9733
|
marks: a
|
|
@@ -9900,9 +9910,9 @@ class Jt {
|
|
|
9900
9910
|
}, this.config = {
|
|
9901
9911
|
...this.config,
|
|
9902
9912
|
...e
|
|
9903
|
-
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
9913
|
+
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = T(x(this, "addOptions", {
|
|
9904
9914
|
name: this.name
|
|
9905
|
-
}))), this.storage =
|
|
9915
|
+
}))), this.storage = T(x(this, "addStorage", {
|
|
9906
9916
|
name: this.name,
|
|
9907
9917
|
options: this.options
|
|
9908
9918
|
})) || {};
|
|
@@ -9919,9 +9929,9 @@ class Jt {
|
|
|
9919
9929
|
}
|
|
9920
9930
|
extend(e = {}) {
|
|
9921
9931
|
const t = new Jt(e);
|
|
9922
|
-
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options =
|
|
9932
|
+
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = T(x(t, "addOptions", {
|
|
9923
9933
|
name: t.name
|
|
9924
|
-
})), t.storage =
|
|
9934
|
+
})), t.storage = T(x(t, "addStorage", {
|
|
9925
9935
|
name: t.name,
|
|
9926
9936
|
options: t.options
|
|
9927
9937
|
})), t;
|
|
@@ -9962,9 +9972,9 @@ function mc(r) {
|
|
|
9962
9972
|
pc(y, s.find, o).forEach((M) => {
|
|
9963
9973
|
if (M.index === void 0)
|
|
9964
9974
|
return;
|
|
9965
|
-
const
|
|
9966
|
-
from: t.tr.mapping.map(
|
|
9967
|
-
to: t.tr.mapping.map(
|
|
9975
|
+
const I = m + M.index + 1, A = I + M[0].length, P = {
|
|
9976
|
+
from: t.tr.mapping.map(I),
|
|
9977
|
+
to: t.tr.mapping.map(A)
|
|
9968
9978
|
}, w = s.handler({
|
|
9969
9979
|
state: t,
|
|
9970
9980
|
range: P,
|
|
@@ -10056,9 +10066,9 @@ function yc(r) {
|
|
|
10056
10066
|
if (!m && !g && !C)
|
|
10057
10067
|
return;
|
|
10058
10068
|
if (C) {
|
|
10059
|
-
let { text:
|
|
10060
|
-
typeof
|
|
10061
|
-
const { from: P } = y, w = P +
|
|
10069
|
+
let { text: A } = y;
|
|
10070
|
+
typeof A == "string" ? A = A : A = tr(b.from(A), u.schema);
|
|
10071
|
+
const { from: P } = y, w = P + A.length, E = gc(A);
|
|
10062
10072
|
return a({
|
|
10063
10073
|
rule: f,
|
|
10064
10074
|
state: u,
|
|
@@ -10067,13 +10077,13 @@ function yc(r) {
|
|
|
10067
10077
|
pasteEvt: E
|
|
10068
10078
|
});
|
|
10069
10079
|
}
|
|
10070
|
-
const M = h.doc.content.findDiffStart(u.doc.content),
|
|
10071
|
-
if (!(!uc(M) || !
|
|
10080
|
+
const M = h.doc.content.findDiffStart(u.doc.content), I = h.doc.content.findDiffEnd(u.doc.content);
|
|
10081
|
+
if (!(!uc(M) || !I || M === I.b))
|
|
10072
10082
|
return a({
|
|
10073
10083
|
rule: f,
|
|
10074
10084
|
state: u,
|
|
10075
10085
|
from: M,
|
|
10076
|
-
to:
|
|
10086
|
+
to: I,
|
|
10077
10087
|
pasteEvt: o
|
|
10078
10088
|
});
|
|
10079
10089
|
}
|
|
@@ -10241,7 +10251,7 @@ class He {
|
|
|
10241
10251
|
editor: this.editor,
|
|
10242
10252
|
type: bn(e.name, this.schema)
|
|
10243
10253
|
};
|
|
10244
|
-
e.type === "mark" && (!((t =
|
|
10254
|
+
e.type === "mark" && (!((t = T(x(e, "keepOnSplit", n))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
|
|
10245
10255
|
const i = x(e, "onBeforeCreate", n), s = x(e, "onCreate", n), o = x(e, "onUpdate", n), l = x(e, "onSelectionUpdate", n), a = x(e, "onTransaction", n), c = x(e, "onFocus", n), f = x(e, "onBlur", n), d = x(e, "onDestroy", n);
|
|
10246
10256
|
i && this.editor.on("beforeCreate", i), s && this.editor.on("create", s), o && this.editor.on("update", o), l && this.editor.on("selectionUpdate", l), a && this.editor.on("transaction", a), c && this.editor.on("focus", c), f && this.editor.on("blur", f), d && this.editor.on("destroy", d);
|
|
10247
10257
|
});
|
|
@@ -10255,9 +10265,9 @@ class ne {
|
|
|
10255
10265
|
}, this.config = {
|
|
10256
10266
|
...this.config,
|
|
10257
10267
|
...e
|
|
10258
|
-
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
10268
|
+
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = T(x(this, "addOptions", {
|
|
10259
10269
|
name: this.name
|
|
10260
|
-
}))), this.storage =
|
|
10270
|
+
}))), this.storage = T(x(this, "addStorage", {
|
|
10261
10271
|
name: this.name,
|
|
10262
10272
|
options: this.options
|
|
10263
10273
|
})) || {};
|
|
@@ -10274,9 +10284,9 @@ class ne {
|
|
|
10274
10284
|
}
|
|
10275
10285
|
extend(e = {}) {
|
|
10276
10286
|
const t = new ne({ ...this.config, ...e });
|
|
10277
|
-
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options =
|
|
10287
|
+
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = T(x(t, "addOptions", {
|
|
10278
10288
|
name: t.name
|
|
10279
|
-
})), t.storage =
|
|
10289
|
+
})), t.storage = T(x(t, "addStorage", {
|
|
10280
10290
|
name: t.name,
|
|
10281
10291
|
options: t.options
|
|
10282
10292
|
})), t;
|
|
@@ -10353,7 +10363,7 @@ const kc = ne.create({
|
|
|
10353
10363
|
n.deleteRange(r.from, r.to);
|
|
10354
10364
|
const o = n.mapping.map(e);
|
|
10355
10365
|
return n.insert(o, s.content), n.setSelection(new O(n.doc.resolve(Math.max(o - 1, 0)))), !0;
|
|
10356
|
-
},
|
|
10366
|
+
}, Nc = () => ({ tr: r, dispatch: e }) => {
|
|
10357
10367
|
const { selection: t } = r, n = t.$anchor.node();
|
|
10358
10368
|
if (n.content.size > 0)
|
|
10359
10369
|
return !1;
|
|
@@ -10367,7 +10377,7 @@ const kc = ne.create({
|
|
|
10367
10377
|
return !0;
|
|
10368
10378
|
}
|
|
10369
10379
|
return !1;
|
|
10370
|
-
},
|
|
10380
|
+
}, Tc = (r) => ({ tr: e, state: t, dispatch: n }) => {
|
|
10371
10381
|
const i = F(r, t.schema), s = e.selection.$anchor;
|
|
10372
10382
|
for (let o = s.depth; o > 0; o -= 1)
|
|
10373
10383
|
if (s.node(o).type === i) {
|
|
@@ -10447,7 +10457,7 @@ function fe(r = 0, e = 0, t = 0) {
|
|
|
10447
10457
|
function Ls(r, e = null) {
|
|
10448
10458
|
if (!e)
|
|
10449
10459
|
return null;
|
|
10450
|
-
const t =
|
|
10460
|
+
const t = N.atStart(r), n = N.atEnd(r);
|
|
10451
10461
|
if (e === "start" || e === !0)
|
|
10452
10462
|
return t;
|
|
10453
10463
|
if (e === "end")
|
|
@@ -10492,7 +10502,7 @@ const Bc = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) =>
|
|
|
10492
10502
|
}
|
|
10493
10503
|
return r;
|
|
10494
10504
|
};
|
|
10495
|
-
function
|
|
10505
|
+
function Nt(r) {
|
|
10496
10506
|
const e = `<body>${r}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
|
|
10497
10507
|
return $s(t);
|
|
10498
10508
|
}
|
|
@@ -10519,7 +10529,7 @@ function mt(r, e, t) {
|
|
|
10519
10529
|
if (i) {
|
|
10520
10530
|
if (t.errorOnInvalidContent) {
|
|
10521
10531
|
let o = !1, l = "";
|
|
10522
|
-
const a = new
|
|
10532
|
+
const a = new Ti({
|
|
10523
10533
|
topNode: e.spec.topNode,
|
|
10524
10534
|
marks: e.spec.marks,
|
|
10525
10535
|
// Prosemirror's schemas are executed such that: the last to execute, matches last
|
|
@@ -10537,11 +10547,11 @@ function mt(r, e, t) {
|
|
|
10537
10547
|
}
|
|
10538
10548
|
})
|
|
10539
10549
|
});
|
|
10540
|
-
if (t.slice ? ke.fromSchema(a).parseSlice(
|
|
10550
|
+
if (t.slice ? ke.fromSchema(a).parseSlice(Nt(r), t.parseOptions) : ke.fromSchema(a).parse(Nt(r), t.parseOptions), t.errorOnInvalidContent && o)
|
|
10541
10551
|
throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${l}`) });
|
|
10542
10552
|
}
|
|
10543
10553
|
const s = ke.fromSchema(e);
|
|
10544
|
-
return t.slice ? s.parseSlice(
|
|
10554
|
+
return t.slice ? s.parseSlice(Nt(r), t.parseOptions).content : s.parse(Nt(r), t.parseOptions);
|
|
10545
10555
|
}
|
|
10546
10556
|
return mt("", e, t);
|
|
10547
10557
|
}
|
|
@@ -10556,7 +10566,7 @@ function Vc(r, e, t) {
|
|
|
10556
10566
|
let o = 0;
|
|
10557
10567
|
s.forEach((l, a, c, f) => {
|
|
10558
10568
|
o === 0 && (o = f);
|
|
10559
|
-
}), r.setSelection(
|
|
10569
|
+
}), r.setSelection(N.near(r.doc.resolve(o), t));
|
|
10560
10570
|
}
|
|
10561
10571
|
const Lc = (r) => !("type" in r), $c = (r, e, t) => ({ tr: n, dispatch: i, editor: s }) => {
|
|
10562
10572
|
var o;
|
|
@@ -10813,8 +10823,8 @@ function Ln(r, e, t = {}) {
|
|
|
10813
10823
|
if (!m.isText && !m.marks.length)
|
|
10814
10824
|
return;
|
|
10815
10825
|
const y = Math.max(u, g), C = Math.min(p, g + m.nodeSize), M = C - y;
|
|
10816
|
-
o += M, l.push(...m.marks.map((
|
|
10817
|
-
mark:
|
|
10826
|
+
o += M, l.push(...m.marks.map((I) => ({
|
|
10827
|
+
mark: I,
|
|
10818
10828
|
from: y,
|
|
10819
10829
|
to: C
|
|
10820
10830
|
})));
|
|
@@ -10838,7 +10848,7 @@ function fi(r, e) {
|
|
|
10838
10848
|
name: n.name,
|
|
10839
10849
|
options: n.options,
|
|
10840
10850
|
storage: n.storage
|
|
10841
|
-
}, s =
|
|
10851
|
+
}, s = T(x(n, "group", i));
|
|
10842
10852
|
return typeof s != "string" ? !1 : s.split(" ").includes("list");
|
|
10843
10853
|
}
|
|
10844
10854
|
function sr(r, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
|
|
@@ -10997,11 +11007,11 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
10997
11007
|
const C = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
|
|
10998
11008
|
for (let E = a.depth - C; E >= a.depth - 3; E -= 1)
|
|
10999
11009
|
y = b.from(a.node(E).copy(y));
|
|
11000
|
-
const M = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3,
|
|
11010
|
+
const M = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, I = {
|
|
11001
11011
|
...Dt(h, a.node().type.name, a.node().attrs),
|
|
11002
11012
|
...e
|
|
11003
|
-
},
|
|
11004
|
-
y = y.append(b.from(l.createAndFill(null,
|
|
11013
|
+
}, A = ((o = l.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(I)) || void 0;
|
|
11014
|
+
y = y.append(b.from(l.createAndFill(null, A) || void 0));
|
|
11005
11015
|
const P = a.before(a.depth - (C - 1));
|
|
11006
11016
|
t.replace(P, a.after(-M), new k(y, 4 - C, 0));
|
|
11007
11017
|
let w = -1;
|
|
@@ -11028,11 +11038,11 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11028
11038
|
if (!Ue(t.doc, a.pos, 2))
|
|
11029
11039
|
return !1;
|
|
11030
11040
|
if (i) {
|
|
11031
|
-
const { selection: y, storedMarks: C } = n, { splittableMarks: M } = s.extensionManager,
|
|
11032
|
-
if (t.split(a.pos, 2, g).scrollIntoView(), !
|
|
11041
|
+
const { selection: y, storedMarks: C } = n, { splittableMarks: M } = s.extensionManager, I = C || y.$to.parentOffset && y.$from.marks();
|
|
11042
|
+
if (t.split(a.pos, 2, g).scrollIntoView(), !I || !i)
|
|
11033
11043
|
return !0;
|
|
11034
|
-
const
|
|
11035
|
-
t.ensureMarks(
|
|
11044
|
+
const A = I.filter((P) => M.includes(P.type.name));
|
|
11045
|
+
t.ensureMarks(A);
|
|
11036
11046
|
}
|
|
11037
11047
|
return !0;
|
|
11038
11048
|
}, kn = (r, e) => {
|
|
@@ -11053,22 +11063,22 @@ const wf = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11053
11063
|
return !0;
|
|
11054
11064
|
const i = r.doc.nodeAt(n);
|
|
11055
11065
|
return t.node.type === (i == null ? void 0 : i.type) && Ve(r.doc, n) && r.join(n), !0;
|
|
11056
|
-
},
|
|
11057
|
-
const { extensions: d, splittableMarks: h } = i.extensionManager, u = F(r, o.schema), p = F(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: C } = m, M = y.blockRange(C),
|
|
11066
|
+
}, Nf = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: f }) => {
|
|
11067
|
+
const { extensions: d, splittableMarks: h } = i.extensionManager, u = F(r, o.schema), p = F(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: C } = m, M = y.blockRange(C), I = g || m.$to.parentOffset && m.$from.marks();
|
|
11058
11068
|
if (!M)
|
|
11059
11069
|
return !1;
|
|
11060
|
-
const
|
|
11061
|
-
if (M.depth >= 1 &&
|
|
11062
|
-
if (
|
|
11070
|
+
const A = ir((P) => fi(P.type.name, d))(m);
|
|
11071
|
+
if (M.depth >= 1 && A && M.depth - A.depth <= 1) {
|
|
11072
|
+
if (A.node.type === u)
|
|
11063
11073
|
return c.liftListItem(p);
|
|
11064
|
-
if (fi(
|
|
11065
|
-
return a().command(() => (s.setNodeMarkup(
|
|
11074
|
+
if (fi(A.node.type.name, d) && u.validContent(A.node.content) && l)
|
|
11075
|
+
return a().command(() => (s.setNodeMarkup(A.pos, u), !0)).command(() => kn(s, u)).command(() => xn(s, u)).run();
|
|
11066
11076
|
}
|
|
11067
|
-
return !t || !
|
|
11068
|
-
const P = f().wrapInList(u, n), w =
|
|
11077
|
+
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), w = I.filter((E) => h.includes(E.type.name));
|
|
11069
11079
|
return s.ensureMarks(w), P ? !0 : c.clearNodes();
|
|
11070
11080
|
}).wrapInList(u, n).command(() => kn(s, u)).command(() => xn(s, u)).run();
|
|
11071
|
-
},
|
|
11081
|
+
}, Tf = (r, e = {}, t = {}) => ({ state: n, commands: i }) => {
|
|
11072
11082
|
const { extendEmptyMarkRange: s = !1 } = t, o = we(r, n.schema);
|
|
11073
11083
|
return Ln(n, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
|
|
11074
11084
|
}, Ef = (r, e, t = {}) => ({ state: n, commands: i }) => {
|
|
@@ -11163,8 +11173,8 @@ var zf = /* @__PURE__ */ Object.freeze({
|
|
|
11163
11173
|
command: Mc,
|
|
11164
11174
|
createParagraphNear: wc,
|
|
11165
11175
|
cut: Oc,
|
|
11166
|
-
deleteCurrentNode:
|
|
11167
|
-
deleteNode:
|
|
11176
|
+
deleteCurrentNode: Nc,
|
|
11177
|
+
deleteNode: Tc,
|
|
11168
11178
|
deleteRange: Ec,
|
|
11169
11179
|
deleteSelection: Dc,
|
|
11170
11180
|
enter: Ac,
|
|
@@ -11205,8 +11215,8 @@ var zf = /* @__PURE__ */ Object.freeze({
|
|
|
11205
11215
|
sinkListItem: Mf,
|
|
11206
11216
|
splitBlock: wf,
|
|
11207
11217
|
splitListItem: Of,
|
|
11208
|
-
toggleList:
|
|
11209
|
-
toggleMark:
|
|
11218
|
+
toggleList: Nf,
|
|
11219
|
+
toggleMark: Tf,
|
|
11210
11220
|
toggleNode: Ef,
|
|
11211
11221
|
toggleWrap: Df,
|
|
11212
11222
|
undoInputRule: Af,
|
|
@@ -11285,7 +11295,7 @@ const Ff = ne.create({
|
|
|
11285
11295
|
() => o.undoInputRule(),
|
|
11286
11296
|
// maybe convert first text block node to default node
|
|
11287
11297
|
() => o.command(({ tr: l }) => {
|
|
11288
|
-
const { selection: a, doc: c } = l, { empty: f, $anchor: d } = a, { pos: h, parent: u } = d, p = d.parent.isTextblock && h > 0 ? l.doc.resolve(h - 1) : d, m = p.parent.type.spec.isolating, g = d.pos - d.parentOffset, y = m && p.parent.childCount === 1 ? g === d.pos :
|
|
11298
|
+
const { selection: a, doc: c } = l, { empty: f, $anchor: d } = a, { pos: h, parent: u } = d, p = d.parent.isTextblock && h > 0 ? l.doc.resolve(h - 1) : d, m = p.parent.type.spec.isolating, g = d.pos - d.parentOffset, y = m && p.parent.childCount === 1 ? g === d.pos : N.atStart(c).from === h;
|
|
11289
11299
|
return !f || !u.type.isTextblock || u.textContent.length || !y || y && d.parent.type.name === "paragraph" ? !1 : o.clearNodes();
|
|
11290
11300
|
}),
|
|
11291
11301
|
() => o.deleteSelection(),
|
|
@@ -11340,7 +11350,7 @@ const Ff = ne.create({
|
|
|
11340
11350
|
const n = r.some((m) => m.docChanged) && !e.doc.eq(t.doc), i = r.some((m) => m.getMeta("preventClearDocument"));
|
|
11341
11351
|
if (!n || i)
|
|
11342
11352
|
return;
|
|
11343
|
-
const { empty: s, from: o, to: l } = e.selection, a =
|
|
11353
|
+
const { empty: s, from: o, to: l } = e.selection, a = N.atStart(e.doc).from, c = N.atEnd(e.doc).to;
|
|
11344
11354
|
if (s || !(o === a && l === c) || !sr(t.doc))
|
|
11345
11355
|
return;
|
|
11346
11356
|
const h = t.tr, u = Xt({
|
|
@@ -11387,7 +11397,7 @@ const Ff = ne.create({
|
|
|
11387
11397
|
];
|
|
11388
11398
|
}
|
|
11389
11399
|
});
|
|
11390
|
-
class
|
|
11400
|
+
class Ne {
|
|
11391
11401
|
get name() {
|
|
11392
11402
|
return this.node.type.name;
|
|
11393
11403
|
}
|
|
@@ -11446,15 +11456,15 @@ class Te {
|
|
|
11446
11456
|
if (this.depth === 0)
|
|
11447
11457
|
return null;
|
|
11448
11458
|
const e = this.resolvedPos.start(this.resolvedPos.depth - 1), t = this.resolvedPos.doc.resolve(e);
|
|
11449
|
-
return new
|
|
11459
|
+
return new Ne(t, this.editor);
|
|
11450
11460
|
}
|
|
11451
11461
|
get before() {
|
|
11452
11462
|
let e = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
|
|
11453
|
-
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.from - 3)), new
|
|
11463
|
+
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.from - 3)), new Ne(e, this.editor);
|
|
11454
11464
|
}
|
|
11455
11465
|
get after() {
|
|
11456
11466
|
let e = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
|
|
11457
|
-
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.to + 3)), new
|
|
11467
|
+
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.to + 3)), new Ne(e, this.editor);
|
|
11458
11468
|
}
|
|
11459
11469
|
get children() {
|
|
11460
11470
|
const e = [];
|
|
@@ -11465,8 +11475,8 @@ class Te {
|
|
|
11465
11475
|
const l = this.resolvedPos.doc.resolve(o);
|
|
11466
11476
|
if (!i && l.depth <= this.depth)
|
|
11467
11477
|
return;
|
|
11468
|
-
const a = new
|
|
11469
|
-
i && (a.actualDepth = this.depth + 1), e.push(new
|
|
11478
|
+
const a = new Ne(l, this.editor, i, i ? t : null);
|
|
11479
|
+
i && (a.actualDepth = this.depth + 1), e.push(new Ne(l, this.editor, i, i ? t : null));
|
|
11470
11480
|
}), e;
|
|
11471
11481
|
}
|
|
11472
11482
|
get firstChild() {
|
|
@@ -11925,7 +11935,7 @@ let _f = class extends rc {
|
|
|
11925
11935
|
}
|
|
11926
11936
|
$pos(e) {
|
|
11927
11937
|
const t = this.state.doc.resolve(e);
|
|
11928
|
-
return new
|
|
11938
|
+
return new Ne(t, this);
|
|
11929
11939
|
}
|
|
11930
11940
|
get $doc() {
|
|
11931
11941
|
return this.$pos(0);
|
|
@@ -11935,7 +11945,7 @@ function Xf(r) {
|
|
|
11935
11945
|
return new cc({
|
|
11936
11946
|
find: r.find,
|
|
11937
11947
|
handler: ({ state: e, range: t, match: n }) => {
|
|
11938
|
-
const i =
|
|
11948
|
+
const i = T(r.getAttributes, void 0, n) || {}, { tr: s } = e, o = t.from;
|
|
11939
11949
|
let l = t.to;
|
|
11940
11950
|
const a = r.type.create(i);
|
|
11941
11951
|
if (n[1]) {
|
|
@@ -11960,9 +11970,9 @@ class $n {
|
|
|
11960
11970
|
}, this.config = {
|
|
11961
11971
|
...this.config,
|
|
11962
11972
|
...e
|
|
11963
|
-
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
11973
|
+
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = T(x(this, "addOptions", {
|
|
11964
11974
|
name: this.name
|
|
11965
|
-
}))), this.storage =
|
|
11975
|
+
}))), this.storage = T(x(this, "addStorage", {
|
|
11966
11976
|
name: this.name,
|
|
11967
11977
|
options: this.options
|
|
11968
11978
|
})) || {};
|
|
@@ -11979,9 +11989,9 @@ class $n {
|
|
|
11979
11989
|
}
|
|
11980
11990
|
extend(e = {}) {
|
|
11981
11991
|
const t = new $n(e);
|
|
11982
|
-
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options =
|
|
11992
|
+
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = T(x(t, "addOptions", {
|
|
11983
11993
|
name: t.name
|
|
11984
|
-
})), t.storage =
|
|
11994
|
+
})), t.storage = T(x(t, "addStorage", {
|
|
11985
11995
|
name: t.name,
|
|
11986
11996
|
options: t.options
|
|
11987
11997
|
})), t;
|
|
@@ -12003,11 +12013,11 @@ export {
|
|
|
12003
12013
|
et as L,
|
|
12004
12014
|
be as M,
|
|
12005
12015
|
$n as N,
|
|
12006
|
-
|
|
12016
|
+
Ti as O,
|
|
12007
12017
|
oe as P,
|
|
12008
12018
|
ke as Q,
|
|
12009
12019
|
B as R,
|
|
12010
|
-
|
|
12020
|
+
N as S,
|
|
12011
12021
|
O as T,
|
|
12012
12022
|
z as U,
|
|
12013
12023
|
Ao as V,
|