tuikit-atomicx-vue3 4.5.0 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jPzZ5INK.js → MessageInput.vue_vue_type_script_setup_true_lang-3RVYOdkv.js} +38 -38
- package/dist/{PopoverTrigger-L8abAry7.js → PopoverPortal-DV6zFXcf.js} +91 -136
- package/dist/PopoverTrigger-DIjW4PKa.js +54 -0
- package/dist/{PopperContent-XdhqL8Y2.js → PopperContent-D__dbwpA.js} +6 -6
- package/dist/{Teleport-CSEuZbpM.js → Teleport-98QrIYDI.js} +280 -270
- package/dist/baseComp/Modal/Modal.js +3 -3
- package/dist/components/AudioSettingPanel/index.js +14 -14
- 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 -15
- package/dist/components/ConversationList/ConversationActions/ConversationActions.js +53 -50
- package/dist/components/ConversationList/ConversationActions/ConversationActions.vue.d.ts +2 -0
- package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +25 -25
- package/dist/components/ConversationList/ConversationList.vue.d.ts +16 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +16 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +62 -40
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +28 -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 +81 -70
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +4 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +33 -31
- package/dist/components/ConversationList/ConversationPreview/utils.d.ts +2 -2
- package/dist/components/ConversationList/ConversationPreview/utils.js +81 -35
- package/dist/components/ConversationList/i18n/en-US.d.ts +11 -1
- package/dist/components/ConversationList/i18n/en-US.js +12 -2
- package/dist/components/ConversationList/i18n/zh-CN.d.ts +11 -1
- package/dist/components/ConversationList/i18n/zh-CN.js +12 -2
- package/dist/components/ConversationList/index.d.ts +48 -0
- package/dist/components/MessageInput/AttachmentPicker/index.js +10 -9
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +17 -16
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/QuotedMessagePreview/index.js +35 -35
- package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +13 -12
- package/dist/components/MessageInput/TextEditor/EditorCore.js +54 -89
- 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.js +1 -1
- 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.js +2 -2
- 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 +62 -62
- 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 +6 -0
- package/dist/components/MessageInput/i18n/zh-CN.d.ts +3 -0
- package/dist/components/MessageInput/i18n/zh-CN.js +4 -1
- package/dist/components/MessageInput/index.js +1 -1
- 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 +69 -58
- package/dist/components/MessageList/Message/MessageLayout/MessageLayout.vue.d.ts +8 -0
- package/dist/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.js +37 -28
- package/dist/components/MessageList/Message/index.js +8 -4
- package/dist/components/MessageList/MessageList.js +109 -91
- package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
- package/dist/components/MessageList/index.d.ts +21 -3
- package/dist/components/ScheduleRoomPanel/RoomDetail.js +22 -22
- package/dist/components/ScheduleRoomPanel/RoomEdit.js +1 -1
- package/dist/components/ScheduleRoomPanel/RoomShare.js +4 -4
- package/dist/components/ScheduleRoomPanel/ScheduleRoomPanel.js +1 -1
- package/dist/components/ScheduleRoomPanel/ScheduledRoomList.js +1 -1
- 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/UIKitModal/chatErrorModal/chatErrorModal.d.ts +72 -0
- package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.js +95 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.d.ts +40 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.js +51 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/index.d.ts +4 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/index.js +6 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.d.ts +40 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.js +51 -0
- package/dist/components/UIKitModal/chatErrorModal/index.d.ts +3 -0
- package/dist/components/UIKitModal/chatErrorModal/index.js +11 -0
- package/dist/components/VideoSettingPanel/index.js +1 -1
- package/dist/hooks/useReadReceipt/useReadReceipt.js +44 -41
- package/dist/index-CTthrJb2.js +1461 -0
- package/dist/index-DXC5bPY4.js +2174 -0
- package/dist/{index-Do-2CngU.js → index-DuAffztD.js} +115 -142
- package/dist/{index-7vNB_Vx8.js → index-hHVD-MG2.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +150 -149
- package/dist/states/GroupSettingState/GroupSettingState.js +109 -102
- package/dist/states/LoginState.js +43 -43
- package/dist/states/MessageActionState/MessageActionState.js +83 -223
- package/dist/states/MessageInputState/MessageInputState.js +111 -82
- 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 +1 -1
- package/dist/states/MessageListState/MessageListState.js +26 -23
- package/dist/states/RoomParticipantState/index.js +83 -24
- package/dist/states/RoomParticipantState/participantEventManager.d.ts +2 -2
- package/dist/states/RoomParticipantState/participantEventManager.js +217 -205
- package/dist/states/RoomParticipantState/participantManager.d.ts +4 -0
- package/dist/states/RoomParticipantState/participantManager.js +159 -127
- package/dist/states/RoomState/callManager.d.ts +3 -3
- package/dist/states/RoomState/callManager.js +20 -20
- package/dist/states/RoomState/common.d.ts +3 -2
- package/dist/states/RoomState/common.js +34 -24
- package/dist/states/RoomState/roomManager.d.ts +0 -1
- package/dist/states/RoomState/roomManager.js +21 -27
- package/dist/states/RoomState/scheduleManager.js +2 -2
- package/dist/styles/index.css +1 -1
- package/dist/{chat/index.d.ts → subEntry/chat/chat.d.ts} +2160 -2087
- 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/live/index.js +46 -45
- package/dist/subEntry/room/index.js +39 -38
- package/dist/types/beauty.d.ts +20 -0
- package/dist/types/index.js +37 -36
- package/dist/types/participant.d.ts +2 -0
- package/dist/types/room.d.ts +45 -1
- package/dist/types/room.js +4 -3
- package/dist/{useId-CtirfF0W.js → useId-B1VwPJLm.js} +1 -1
- package/dist/utils/call.js +77 -71
- package/dist/{utils-DaB7eSu5.js → utils-BU8IkP_V.js} +1 -1
- package/package.json +8 -7
- package/src/components/AudioSettingPanel/index.vue +4 -5
- package/src/components/ConversationList/ConversationActions/ConversationActions.vue +7 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +5 -1
- package/src/components/ConversationList/ConversationList.vue +0 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +10 -2
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +32 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +3 -2
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +15 -0
- package/src/components/ConversationList/ConversationPreview/utils.ts +98 -28
- package/src/components/ConversationList/i18n/en-US.ts +11 -1
- package/src/components/ConversationList/i18n/zh-CN.ts +11 -1
- package/src/components/MessageInput/MessageInput.module.scss +1 -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 +79 -99
- package/src/components/MessageInput/TextEditor/TextEditor.vue +64 -68
- package/src/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue +449 -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/index.ts +8 -0
- package/src/components/MessageInput/TextEditor/extensions/mentionExtension.ts +87 -0
- package/src/components/MessageInput/i18n/en-US.ts +3 -0
- package/src/components/MessageInput/i18n/zh-CN.ts +3 -0
- 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 +8 -1
- package/src/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +12 -3
- package/src/components/MessageList/MessageList.vue +50 -14
- package/src/components/ScheduleRoomPanel/RoomDetail.vue +1 -0
- package/src/components/ScheduleRoomPanel/RoomEdit.vue +2 -1
- package/src/components/ScheduleRoomPanel/RoomShare.vue +1 -0
- package/src/components/ScheduleRoomPanel/ScheduleRoomPanel.vue +1 -0
- package/src/components/ScheduleRoomPanel/ScheduledRoomList.vue +1 -0
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +30 -31
- package/src/components/UIKitModal/chatErrorModal/chatErrorModal.ts +205 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/en-US/index.ts +56 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/index.ts +4 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.ts +56 -0
- package/src/components/UIKitModal/chatErrorModal/index.ts +16 -0
- package/src/components/VideoSettingPanel/index.vue +1 -0
- package/src/hooks/useReadReceipt/useReadReceipt.ts +5 -4
- package/src/index.ts +1 -1
- 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/types/beauty.ts +20 -0
- package/src/types/participant.ts +3 -0
- package/src/types/room.ts +49 -1
- package/src/utils/call.ts +8 -0
- package/dist/chat/index.js +0 -59
- package/dist/index-ZILx4LYk.js +0 -4826
- package/dist/states/SearchState.d.ts +0 -314
- /package/dist/{chat → subEntry/chat}/server.d.ts +0 -0
|
@@ -3142,11 +3142,11 @@ class R {
|
|
|
3142
3142
|
}
|
|
3143
3143
|
}
|
|
3144
3144
|
}
|
|
3145
|
-
function
|
|
3145
|
+
function jn(r, e, t) {
|
|
3146
3146
|
let n = [];
|
|
3147
3147
|
for (let i = 0; i < r.childCount; i++) {
|
|
3148
3148
|
let s = r.child(i);
|
|
3149
|
-
s.content.size && (s = s.copy(
|
|
3149
|
+
s.content.size && (s = s.copy(jn(s.content, e, s))), s.isInline && (s = e(s, t, i)), n.push(s);
|
|
3150
3150
|
}
|
|
3151
3151
|
return b.fromArray(n);
|
|
3152
3152
|
}
|
|
@@ -3158,7 +3158,7 @@ class me extends K {
|
|
|
3158
3158
|
super(), this.from = e, this.to = t, this.mark = n;
|
|
3159
3159
|
}
|
|
3160
3160
|
apply(e) {
|
|
3161
|
-
let t = e.slice(this.from, this.to), n = e.resolve(this.from), i = n.node(n.sharedDepth(this.to)), s = new k(
|
|
3161
|
+
let t = e.slice(this.from, this.to), n = e.resolve(this.from), i = n.node(n.sharedDepth(this.to)), s = new k(jn(t.content, (o, l) => !o.isAtom || !l.type.allowsMarkType(this.mark.type) ? o : o.mark(this.mark.addToSet(o.marks)), i), t.openStart, t.openEnd);
|
|
3162
3162
|
return R.fromReplace(e, this.from, this.to, s);
|
|
3163
3163
|
}
|
|
3164
3164
|
invert() {
|
|
@@ -3197,7 +3197,7 @@ class re extends K {
|
|
|
3197
3197
|
super(), this.from = e, this.to = t, this.mark = n;
|
|
3198
3198
|
}
|
|
3199
3199
|
apply(e) {
|
|
3200
|
-
let t = e.slice(this.from, this.to), n = new k(
|
|
3200
|
+
let t = e.slice(this.from, this.to), n = new k(jn(t.content, (i) => i.mark(this.mark.removeFromSet(i.marks)), e), t.openStart, t.openEnd);
|
|
3201
3201
|
return R.fromReplace(e, this.from, this.to, n);
|
|
3202
3202
|
}
|
|
3203
3203
|
invert() {
|
|
@@ -3470,7 +3470,7 @@ function xo(r, e, t, n) {
|
|
|
3470
3470
|
}
|
|
3471
3471
|
}), i.forEach((o) => r.step(new re(o.from, o.to, o.style)));
|
|
3472
3472
|
}
|
|
3473
|
-
function
|
|
3473
|
+
function Jn(r, e, t, n = t.contentMatch, i = !0) {
|
|
3474
3474
|
let s = r.doc.nodeAt(e), o = [], l = e + 1;
|
|
3475
3475
|
for (let a = 0; a < s.childCount; a++) {
|
|
3476
3476
|
let c = s.child(a), f = l + c.nodeSize, d = n.matchType(c.type);
|
|
@@ -3567,7 +3567,7 @@ function No(r, e, t, n, i) {
|
|
|
3567
3567
|
let h = n.whitespace == "pre", p = !!n.contentMatch.matchType(n.schema.linebreakReplacement);
|
|
3568
3568
|
h && !p ? c = !1 : !h && p && (c = !0);
|
|
3569
3569
|
}
|
|
3570
|
-
c === !1 && $i(r, o, l, s),
|
|
3570
|
+
c === !1 && $i(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), u = f.map(l + o.nodeSize, 1);
|
|
3572
3572
|
return r.step(new F(d, u, d + 1, u - 1, new k(b.from(n.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && Vi(r, o, l, s), !1;
|
|
3573
3573
|
}
|
|
@@ -3674,7 +3674,7 @@ function Io(r, e, t) {
|
|
|
3674
3674
|
let f = r.doc.resolve(e + t);
|
|
3675
3675
|
$i(r, f.node(), f.before(), l);
|
|
3676
3676
|
}
|
|
3677
|
-
o.inlineContent &&
|
|
3677
|
+
o.inlineContent && Jn(r, e + t - 1, o, s.node().contentMatchAt(s.index()), n == null);
|
|
3678
3678
|
let a = r.mapping.slice(l), c = a.map(e - t);
|
|
3679
3679
|
if (r.step(new B(c, a.map(e + t, -1), k.empty, !0)), n === !0) {
|
|
3680
3680
|
let f = r.doc.resolve(c);
|
|
@@ -3825,7 +3825,7 @@ class vo {
|
|
|
3825
3825
|
let m = l.child(c), g = d.matchType(m.type);
|
|
3826
3826
|
if (!g)
|
|
3827
3827
|
break;
|
|
3828
|
-
c++, (c > 1 || a == 0 || m.content.size) && (d = g, f.push(
|
|
3828
|
+
c++, (c > 1 || a == 0 || m.content.size) && (d = g, f.push(ji(m.mark(u.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
|
|
3829
3829
|
}
|
|
3830
3830
|
let p = c == l.childCount;
|
|
3831
3831
|
p || (h = -1), this.placed = rt(this.placed, t, b.from(f)), this.frontier[t].match = d, p && h < 0 && n && n.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
@@ -3892,11 +3892,11 @@ function ln(r, e) {
|
|
|
3892
3892
|
r = r.firstChild.content;
|
|
3893
3893
|
return r;
|
|
3894
3894
|
}
|
|
3895
|
-
function
|
|
3895
|
+
function ji(r, e, t) {
|
|
3896
3896
|
if (e <= 0)
|
|
3897
3897
|
return r;
|
|
3898
3898
|
let n = r.content;
|
|
3899
|
-
return e > 1 && (n = n.replaceChild(0,
|
|
3899
|
+
return e > 1 && (n = n.replaceChild(0, ji(n.firstChild, e - 1, n.childCount == 1 ? t - 1 : 0))), e > 0 && (n = r.type.contentMatch.fillBefore(n).append(n), t <= 0 && (n = n.append(r.type.contentMatch.matchFragment(n).fillBefore(b.empty, !0)))), r.copy(n);
|
|
3900
3900
|
}
|
|
3901
3901
|
function an(r, e, t, n, i) {
|
|
3902
3902
|
let s = r.node(e), o = i ? r.indexAfter(e) : r.index(e);
|
|
@@ -3952,7 +3952,7 @@ function Fo(r, e, t, n) {
|
|
|
3952
3952
|
g < 0 && (y = !1, g = -g);
|
|
3953
3953
|
let w = i.node(g - 1), C = i.index(g - 1);
|
|
3954
3954
|
if (w.canReplaceWith(C, C, p.type, p.marks))
|
|
3955
|
-
return r.replace(i.before(g), y ? s.after(g) : t, new k(
|
|
3955
|
+
return r.replace(i.before(g), y ? s.after(g) : t, new k(Ji(n.content, 0, n.openStart, h), h, n.openEnd));
|
|
3956
3956
|
}
|
|
3957
3957
|
}
|
|
3958
3958
|
let d = r.steps.length;
|
|
@@ -3961,10 +3961,10 @@ function Fo(r, e, t, n) {
|
|
|
3961
3961
|
h < 0 || (e = i.before(h), t = s.after(h));
|
|
3962
3962
|
}
|
|
3963
3963
|
}
|
|
3964
|
-
function
|
|
3964
|
+
function Ji(r, e, t, n, i) {
|
|
3965
3965
|
if (e < t) {
|
|
3966
3966
|
let s = r.firstChild;
|
|
3967
|
-
r = r.replaceChild(0, s.copy(
|
|
3967
|
+
r = r.replaceChild(0, s.copy(Ji(s.content, e + 1, t, n, s)));
|
|
3968
3968
|
}
|
|
3969
3969
|
if (e > n) {
|
|
3970
3970
|
let s = i.contentMatchAt(0), o = s.fillBefore(r).append(r);
|
|
@@ -4306,7 +4306,7 @@ class Lo {
|
|
|
4306
4306
|
third argument.
|
|
4307
4307
|
*/
|
|
4308
4308
|
clearIncompatible(e, t, n) {
|
|
4309
|
-
return
|
|
4309
|
+
return Jn(this, e, t, n), this;
|
|
4310
4310
|
}
|
|
4311
4311
|
}
|
|
4312
4312
|
const cn = /* @__PURE__ */ Object.create(null);
|
|
@@ -4404,11 +4404,11 @@ class T {
|
|
|
4404
4404
|
found.
|
|
4405
4405
|
*/
|
|
4406
4406
|
static findFrom(e, t, n = !1) {
|
|
4407
|
-
let i = e.parent.inlineContent ? new N(e) :
|
|
4407
|
+
let i = e.parent.inlineContent ? new N(e) : Je(e.node(0), e.parent, e.pos, e.index(), t, n);
|
|
4408
4408
|
if (i)
|
|
4409
4409
|
return i;
|
|
4410
4410
|
for (let s = e.depth - 1; s >= 0; s--) {
|
|
4411
|
-
let o = t < 0 ?
|
|
4411
|
+
let o = t < 0 ? Je(e.node(0), e.node(s), e.before(s + 1), e.index(s), t, n) : Je(e.node(0), e.node(s), e.after(s + 1), e.index(s) + 1, t, n);
|
|
4412
4412
|
if (o)
|
|
4413
4413
|
return o;
|
|
4414
4414
|
}
|
|
@@ -4429,14 +4429,14 @@ class T {
|
|
|
4429
4429
|
exists.
|
|
4430
4430
|
*/
|
|
4431
4431
|
static atStart(e) {
|
|
4432
|
-
return
|
|
4432
|
+
return Je(e, e, 0, 0, 1) || new Z(e);
|
|
4433
4433
|
}
|
|
4434
4434
|
/**
|
|
4435
4435
|
Find the cursor or leaf node selection closest to the end of the
|
|
4436
4436
|
given document.
|
|
4437
4437
|
*/
|
|
4438
4438
|
static atEnd(e) {
|
|
4439
|
-
return
|
|
4439
|
+
return Je(e, e, e.content.size, e.childCount, -1) || new Z(e);
|
|
4440
4440
|
}
|
|
4441
4441
|
/**
|
|
4442
4442
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -4663,11 +4663,11 @@ class Z extends T {
|
|
|
4663
4663
|
return e instanceof Z;
|
|
4664
4664
|
}
|
|
4665
4665
|
getBookmark() {
|
|
4666
|
-
return
|
|
4666
|
+
return jo;
|
|
4667
4667
|
}
|
|
4668
4668
|
}
|
|
4669
4669
|
T.jsonID("all", Z);
|
|
4670
|
-
const
|
|
4670
|
+
const jo = {
|
|
4671
4671
|
map() {
|
|
4672
4672
|
return this;
|
|
4673
4673
|
},
|
|
@@ -4675,7 +4675,7 @@ const Jo = {
|
|
|
4675
4675
|
return new Z(r);
|
|
4676
4676
|
}
|
|
4677
4677
|
};
|
|
4678
|
-
function
|
|
4678
|
+
function Je(r, e, t, n, i, s = !1) {
|
|
4679
4679
|
if (e.inlineContent)
|
|
4680
4680
|
return N.create(r, t);
|
|
4681
4681
|
for (let o = n - (i > 0 ? 0 : 1); i > 0 ? o < e.childCount : o >= 0; o += i) {
|
|
@@ -4684,7 +4684,7 @@ function je(r, e, t, n, i, s = !1) {
|
|
|
4684
4684
|
if (!s && S.isSelectable(l))
|
|
4685
4685
|
return S.create(r, t - (i < 0 ? l.nodeSize : 0));
|
|
4686
4686
|
} else {
|
|
4687
|
-
let a =
|
|
4687
|
+
let a = Je(r, l, t + i, i < 0 ? l.childCount : 0, i, s);
|
|
4688
4688
|
if (a)
|
|
4689
4689
|
return a;
|
|
4690
4690
|
}
|
|
@@ -4705,7 +4705,7 @@ function wr(r, e, t) {
|
|
|
4705
4705
|
}), r.setSelection(T.near(r.doc.resolve(o), t));
|
|
4706
4706
|
}
|
|
4707
4707
|
const Or = 1, Ct = 2, Nr = 4;
|
|
4708
|
-
class
|
|
4708
|
+
class Jo extends Lo {
|
|
4709
4709
|
/**
|
|
4710
4710
|
@internal
|
|
4711
4711
|
*/
|
|
@@ -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 Jo(this);
|
|
4997
4997
|
}
|
|
4998
4998
|
/**
|
|
4999
4999
|
Create a new state.
|
|
@@ -6695,7 +6695,7 @@ function Wr(r) {
|
|
|
6695
6695
|
function Gn(r, e, t, n) {
|
|
6696
6696
|
return r.someProp("createSelectionBetween", (i) => i(r, e, t)) || N.between(e, t, n);
|
|
6697
6697
|
}
|
|
6698
|
-
function
|
|
6698
|
+
function jr(r) {
|
|
6699
6699
|
return r.editable && !r.hasFocus() ? !1 : fs(r);
|
|
6700
6700
|
}
|
|
6701
6701
|
function fs(r) {
|
|
@@ -6719,7 +6719,7 @@ function vn(r, e) {
|
|
|
6719
6719
|
function he(r, e) {
|
|
6720
6720
|
return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()), !0;
|
|
6721
6721
|
}
|
|
6722
|
-
function
|
|
6722
|
+
function Jr(r, e, t) {
|
|
6723
6723
|
let n = r.state.selection;
|
|
6724
6724
|
if (n instanceof N)
|
|
6725
6725
|
if (t.indexOf("s") > -1) {
|
|
@@ -6756,7 +6756,7 @@ function at(r, e) {
|
|
|
6756
6756
|
let t = r.pmViewDesc;
|
|
6757
6757
|
return t && t.size == 0 && (e < 0 || r.nextSibling || r.nodeName != "BR");
|
|
6758
6758
|
}
|
|
6759
|
-
function
|
|
6759
|
+
function je(r, e) {
|
|
6760
6760
|
return e < 0 ? Nl(r) : Tl(r);
|
|
6761
6761
|
}
|
|
6762
6762
|
function Nl(r) {
|
|
@@ -6943,22 +6943,22 @@ function Il(r) {
|
|
|
6943
6943
|
function Rl(r, e) {
|
|
6944
6944
|
let t = e.keyCode, n = Il(e);
|
|
6945
6945
|
if (t == 8 || Y && t == 72 && n == "c")
|
|
6946
|
-
return Hr(r, -1) ||
|
|
6946
|
+
return Hr(r, -1) || je(r, -1);
|
|
6947
6947
|
if (t == 46 && !e.shiftKey || Y && t == 68 && n == "c")
|
|
6948
|
-
return Hr(r, 1) ||
|
|
6948
|
+
return Hr(r, 1) || je(r, 1);
|
|
6949
6949
|
if (t == 13 || t == 27)
|
|
6950
6950
|
return !0;
|
|
6951
6951
|
if (t == 37 || Y && t == 66 && n == "c") {
|
|
6952
6952
|
let i = t == 37 ? qr(r, r.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
6953
|
-
return
|
|
6953
|
+
return Jr(r, i, n) || je(r, i);
|
|
6954
6954
|
} else if (t == 39 || Y && t == 70 && n == "c") {
|
|
6955
6955
|
let i = t == 39 ? qr(r, r.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
6956
|
-
return
|
|
6956
|
+
return Jr(r, i, n) || je(r, i);
|
|
6957
6957
|
} else {
|
|
6958
6958
|
if (t == 38 || Y && t == 80 && n == "c")
|
|
6959
|
-
return Kr(r, -1, n) ||
|
|
6959
|
+
return Kr(r, -1, n) || je(r, -1);
|
|
6960
6960
|
if (t == 40 || Y && t == 78 && n == "c")
|
|
6961
|
-
return Al(r) || Kr(r, 1, n) ||
|
|
6961
|
+
return Al(r) || Kr(r, 1, n) || je(r, 1);
|
|
6962
6962
|
if (n == (Y ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
6963
6963
|
return !0;
|
|
6964
6964
|
}
|
|
@@ -7164,7 +7164,7 @@ function Wl(r) {
|
|
|
7164
7164
|
for (let e in H) {
|
|
7165
7165
|
let t = H[e];
|
|
7166
7166
|
r.dom.addEventListener(e, r.input.eventHandlers[e] = (n) => {
|
|
7167
|
-
|
|
7167
|
+
Jl(r, n) && !Yn(r, n) && (r.editable || !(n.type in U)) && t(r, n);
|
|
7168
7168
|
}, $l[e] ? { passive: !0 } : void 0);
|
|
7169
7169
|
}
|
|
7170
7170
|
q && r.dom.addEventListener("input", () => null), Fn(r);
|
|
@@ -7172,7 +7172,7 @@ function Wl(r) {
|
|
|
7172
7172
|
function ye(r, e) {
|
|
7173
7173
|
r.input.lastSelectionOrigin = e, r.input.lastSelectionTime = Date.now();
|
|
7174
7174
|
}
|
|
7175
|
-
function
|
|
7175
|
+
function jl(r) {
|
|
7176
7176
|
r.domObserver.stop();
|
|
7177
7177
|
for (let e in r.input.eventHandlers)
|
|
7178
7178
|
r.dom.removeEventListener(e, r.input.eventHandlers[e]);
|
|
@@ -7190,7 +7190,7 @@ function Yn(r, e) {
|
|
|
7190
7190
|
return n ? n(r, e) || e.defaultPrevented : !1;
|
|
7191
7191
|
});
|
|
7192
7192
|
}
|
|
7193
|
-
function
|
|
7193
|
+
function Jl(r, e) {
|
|
7194
7194
|
if (!e.bubbles)
|
|
7195
7195
|
return !0;
|
|
7196
7196
|
if (e.defaultPrevented)
|
|
@@ -7751,7 +7751,7 @@ class v {
|
|
|
7751
7751
|
you must make a copy if you want need to preserve that.
|
|
7752
7752
|
*/
|
|
7753
7753
|
static create(e, t) {
|
|
7754
|
-
return t.length ? Lt(t, e, 0, Re) :
|
|
7754
|
+
return t.length ? Lt(t, e, 0, Re) : J;
|
|
7755
7755
|
}
|
|
7756
7756
|
/**
|
|
7757
7757
|
Find all decorations in this set which touch the given range
|
|
@@ -7781,7 +7781,7 @@ class v {
|
|
|
7781
7781
|
document.
|
|
7782
7782
|
*/
|
|
7783
7783
|
map(e, t, n) {
|
|
7784
|
-
return this ==
|
|
7784
|
+
return this == J || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, n || Re);
|
|
7785
7785
|
}
|
|
7786
7786
|
/**
|
|
7787
7787
|
@internal
|
|
@@ -7792,7 +7792,7 @@ class v {
|
|
|
7792
7792
|
let a = this.local[l].map(e, n, i);
|
|
7793
7793
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
7794
7794
|
}
|
|
7795
|
-
return this.children.length ? aa(this.children, o || [], e, t, n, i, s) : o ? new v(o.sort(Pe), qe) :
|
|
7795
|
+
return this.children.length ? aa(this.children, o || [], e, t, n, i, s) : o ? new v(o.sort(Pe), qe) : J;
|
|
7796
7796
|
}
|
|
7797
7797
|
/**
|
|
7798
7798
|
Add the given array of decorations to the ones in the set,
|
|
@@ -7801,7 +7801,7 @@ class v {
|
|
|
7801
7801
|
structure.
|
|
7802
7802
|
*/
|
|
7803
7803
|
add(e, t) {
|
|
7804
|
-
return t.length ? this ==
|
|
7804
|
+
return t.length ? this == J ? v.create(e, t) : this.addInner(e, t, 0) : this;
|
|
7805
7805
|
}
|
|
7806
7806
|
addInner(e, t, n) {
|
|
7807
7807
|
let i, s = 0;
|
|
@@ -7823,7 +7823,7 @@ class v {
|
|
|
7823
7823
|
the ones in the given array.
|
|
7824
7824
|
*/
|
|
7825
7825
|
remove(e) {
|
|
7826
|
-
return e.length == 0 || this ==
|
|
7826
|
+
return e.length == 0 || this == J ? this : this.removeInner(e, 0);
|
|
7827
7827
|
}
|
|
7828
7828
|
removeInner(e, t) {
|
|
7829
7829
|
let n = this.children, i = this.local;
|
|
@@ -7835,7 +7835,7 @@ class v {
|
|
|
7835
7835
|
continue;
|
|
7836
7836
|
n == this.children && (n = this.children.slice());
|
|
7837
7837
|
let c = n[s + 2].removeInner(o, l + 1);
|
|
7838
|
-
c !=
|
|
7838
|
+
c != J ? n[s + 2] = c : (n.splice(s, 3), s -= 3);
|
|
7839
7839
|
}
|
|
7840
7840
|
if (i.length) {
|
|
7841
7841
|
for (let s = 0, o; s < e.length; s++)
|
|
@@ -7843,10 +7843,10 @@ class v {
|
|
|
7843
7843
|
for (let l = 0; l < i.length; l++)
|
|
7844
7844
|
i[l].eq(o, t) && (i == this.local && (i = this.local.slice()), i.splice(l--, 1));
|
|
7845
7845
|
}
|
|
7846
|
-
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;
|
|
7847
7847
|
}
|
|
7848
7848
|
forChild(e, t) {
|
|
7849
|
-
if (this ==
|
|
7849
|
+
if (this == J)
|
|
7850
7850
|
return this;
|
|
7851
7851
|
if (t.isLeaf)
|
|
7852
7852
|
return v.empty;
|
|
@@ -7868,7 +7868,7 @@ class v {
|
|
|
7868
7868
|
let l = new v(i.sort(Pe), qe);
|
|
7869
7869
|
return n ? new pe([l, n]) : l;
|
|
7870
7870
|
}
|
|
7871
|
-
return n ||
|
|
7871
|
+
return n || J;
|
|
7872
7872
|
}
|
|
7873
7873
|
/**
|
|
7874
7874
|
@internal
|
|
@@ -7896,7 +7896,7 @@ class v {
|
|
|
7896
7896
|
@internal
|
|
7897
7897
|
*/
|
|
7898
7898
|
localsInner(e) {
|
|
7899
|
-
if (this ==
|
|
7899
|
+
if (this == J)
|
|
7900
7900
|
return qe;
|
|
7901
7901
|
if (e.inlineContent || !this.local.some(Ce.is))
|
|
7902
7902
|
return this.local;
|
|
@@ -7911,7 +7911,7 @@ class v {
|
|
|
7911
7911
|
}
|
|
7912
7912
|
v.empty = new v([], []);
|
|
7913
7913
|
v.removeOverlap = er;
|
|
7914
|
-
const
|
|
7914
|
+
const J = v.empty;
|
|
7915
7915
|
class pe {
|
|
7916
7916
|
constructor(e) {
|
|
7917
7917
|
this.members = e;
|
|
@@ -7926,7 +7926,7 @@ class pe {
|
|
|
7926
7926
|
let n = [];
|
|
7927
7927
|
for (let i = 0; i < this.members.length; i++) {
|
|
7928
7928
|
let s = this.members[i].forChild(e, t);
|
|
7929
|
-
s !=
|
|
7929
|
+
s != J && (s instanceof pe ? n = n.concat(s.members) : n.push(s));
|
|
7930
7930
|
}
|
|
7931
7931
|
return pe.from(n);
|
|
7932
7932
|
}
|
|
@@ -7958,7 +7958,7 @@ class pe {
|
|
|
7958
7958
|
static from(e) {
|
|
7959
7959
|
switch (e.length) {
|
|
7960
7960
|
case 0:
|
|
7961
|
-
return
|
|
7961
|
+
return J;
|
|
7962
7962
|
case 1:
|
|
7963
7963
|
return e[0];
|
|
7964
7964
|
default:
|
|
@@ -8001,7 +8001,7 @@ function aa(r, e, t, n, i, s, o) {
|
|
|
8001
8001
|
let u = t.map(r[c + 1] + s, -1), h = u - i, { index: p, offset: m } = n.content.findIndex(d), g = n.maybeChild(p);
|
|
8002
8002
|
if (g && m == d && m + g.nodeSize == h) {
|
|
8003
8003
|
let y = l[c + 2].mapInner(t, g, f + 1, r[c] + s + 1, o);
|
|
8004
|
-
y !=
|
|
8004
|
+
y != J ? (l[c] = d, l[c + 1] = h, l[c + 2] = y) : (l[c + 1] = -2, a = !0);
|
|
8005
8005
|
} else
|
|
8006
8006
|
a = !0;
|
|
8007
8007
|
}
|
|
@@ -8063,13 +8063,13 @@ function Lt(r, e, t, n) {
|
|
|
8063
8063
|
if (c) {
|
|
8064
8064
|
s = !0;
|
|
8065
8065
|
let f = Lt(c, l, t + a + 1, n);
|
|
8066
|
-
f !=
|
|
8066
|
+
f != J && i.push(a, a + l.nodeSize, f);
|
|
8067
8067
|
}
|
|
8068
8068
|
});
|
|
8069
8069
|
let o = Os(s ? Ts(r) : r, -t).sort(Pe);
|
|
8070
8070
|
for (let l = 0; l < o.length; l++)
|
|
8071
8071
|
o[l].type.valid(e, o[l]) || (n.onRemove && n.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8072
|
-
return o.length || i.length ? new v(o, i) :
|
|
8072
|
+
return o.length || i.length ? new v(o, i) : J;
|
|
8073
8073
|
}
|
|
8074
8074
|
function Pe(r, e) {
|
|
8075
8075
|
return r.from - e.from || r.to - e.to;
|
|
@@ -8101,7 +8101,7 @@ function mn(r) {
|
|
|
8101
8101
|
let e = [];
|
|
8102
8102
|
return r.someProp("decorations", (t) => {
|
|
8103
8103
|
let n = t(r.state);
|
|
8104
|
-
n && n !=
|
|
8104
|
+
n && n != J && e.push(n);
|
|
8105
8105
|
}), r.cursorWrapper && e.push(v.create(r.state.doc, [r.cursorWrapper.deco])), pe.from(e);
|
|
8106
8106
|
}
|
|
8107
8107
|
const fa = {
|
|
@@ -8169,7 +8169,7 @@ class ha {
|
|
|
8169
8169
|
this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
|
|
8170
8170
|
}
|
|
8171
8171
|
onSelectionChange() {
|
|
8172
|
-
if (
|
|
8172
|
+
if (jr(this.view)) {
|
|
8173
8173
|
if (this.suppressingSelectionUpdates)
|
|
8174
8174
|
return de(this.view);
|
|
8175
8175
|
if (G && xe <= 11 && !this.view.state.selection.empty) {
|
|
@@ -8213,7 +8213,7 @@ class ha {
|
|
|
8213
8213
|
return;
|
|
8214
8214
|
let t = this.pendingRecords();
|
|
8215
8215
|
t.length && (this.queue = []);
|
|
8216
|
-
let n = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(n) &&
|
|
8216
|
+
let n = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(n) && jr(e) && !this.ignoreSelectionChange(n), s = -1, o = -1, l = !1, a = [];
|
|
8217
8217
|
if (e.editable)
|
|
8218
8218
|
for (let f = 0; f < t.length; f++) {
|
|
8219
8219
|
let d = this.registerMutation(t[f], a);
|
|
@@ -8357,8 +8357,8 @@ function xa(r, e, t, n, i) {
|
|
|
8357
8357
|
if (E && !r.state.selection.eq(E)) {
|
|
8358
8358
|
if (z && ce && r.input.lastKeyCode === 13 && Date.now() - 100 < r.input.lastKeyCodeTime && r.someProp("handleKeyDown", (Hs) => Hs(r, Ne(13, "Enter"))))
|
|
8359
8359
|
return;
|
|
8360
|
-
let
|
|
8361
|
-
M == "pointer" ?
|
|
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);
|
|
8362
8362
|
}
|
|
8363
8363
|
return;
|
|
8364
8364
|
}
|
|
@@ -8402,8 +8402,8 @@ function xa(r, e, t, n, i) {
|
|
|
8402
8402
|
let C = p.start, I = p.endA, A = (M) => {
|
|
8403
8403
|
let E = M || r.state.tr.replace(C, I, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
8404
8404
|
if (c.sel) {
|
|
8405
|
-
let
|
|
8406
|
-
|
|
8405
|
+
let j = ei(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);
|
|
8407
8407
|
}
|
|
8408
8408
|
return s && E.setMeta("composition", s), E.scrollIntoView();
|
|
8409
8409
|
}, P;
|
|
@@ -8420,7 +8420,7 @@ function xa(r, e, t, n, i) {
|
|
|
8420
8420
|
P.type == "add" ? M.addMark(C, I, P.mark) : M.removeMark(C, I, P.mark), r.dispatch(M);
|
|
8421
8421
|
} else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
8422
8422
|
let M = m.parent.textBetween(m.parentOffset, g.parentOffset), E = () => A(r.state.tr.insertText(M, C, I));
|
|
8423
|
-
r.someProp("handleTextInput", (
|
|
8423
|
+
r.someProp("handleTextInput", (j) => j(r, C, I, M, E)) || r.dispatch(E());
|
|
8424
8424
|
} else
|
|
8425
8425
|
r.dispatch(A());
|
|
8426
8426
|
else
|
|
@@ -8801,7 +8801,7 @@ class Es {
|
|
|
8801
8801
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
8802
8802
|
*/
|
|
8803
8803
|
destroy() {
|
|
8804
|
-
this.docView && (
|
|
8804
|
+
this.docView && (jl(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], mn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Ko());
|
|
8805
8805
|
}
|
|
8806
8806
|
/**
|
|
8807
8807
|
This is true when the view has been
|
|
@@ -9175,7 +9175,7 @@ function nr(r) {
|
|
|
9175
9175
|
}
|
|
9176
9176
|
return null;
|
|
9177
9177
|
}
|
|
9178
|
-
const
|
|
9178
|
+
const ja = (r, e) => {
|
|
9179
9179
|
let t = r.selection, n = t instanceof S, i;
|
|
9180
9180
|
if (n) {
|
|
9181
9181
|
if (t.node.isTextblock || !we(r.doc, t.from))
|
|
@@ -9188,7 +9188,7 @@ const Ja = (r, e) => {
|
|
|
9188
9188
|
n && s.setSelection(S.create(s.doc, i - r.doc.resolve(i).nodeBefore.nodeSize)), e(s.scrollIntoView());
|
|
9189
9189
|
}
|
|
9190
9190
|
return !0;
|
|
9191
|
-
},
|
|
9191
|
+
}, Ja = (r, e) => {
|
|
9192
9192
|
let t = r.selection, n;
|
|
9193
9193
|
if (t instanceof S) {
|
|
9194
9194
|
if (t.node.isTextblock || !we(r.doc, t.to))
|
|
@@ -9923,7 +9923,7 @@ function tn(r, e) {
|
|
|
9923
9923
|
wt(e[n]) && wt(r[n]) ? t[n] = tn(r[n], e[n]) : t[n] = e[n];
|
|
9924
9924
|
}), t;
|
|
9925
9925
|
}
|
|
9926
|
-
class
|
|
9926
|
+
class jt {
|
|
9927
9927
|
constructor(e = {}) {
|
|
9928
9928
|
this.type = "mark", this.name = "mark", this.parent = null, this.child = null, this.config = {
|
|
9929
9929
|
name: this.name,
|
|
@@ -9939,7 +9939,7 @@ class Jt {
|
|
|
9939
9939
|
})) || {};
|
|
9940
9940
|
}
|
|
9941
9941
|
static create(e = {}) {
|
|
9942
|
-
return new
|
|
9942
|
+
return new jt(e);
|
|
9943
9943
|
}
|
|
9944
9944
|
configure(e = {}) {
|
|
9945
9945
|
const t = this.extend({
|
|
@@ -9949,7 +9949,7 @@ class Jt {
|
|
|
9949
9949
|
return t.name = this.name, t.parent = this.parent, t;
|
|
9950
9950
|
}
|
|
9951
9951
|
extend(e = {}) {
|
|
9952
|
-
const t = new
|
|
9952
|
+
const t = new jt(e);
|
|
9953
9953
|
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 = O(x(t, "addOptions", {
|
|
9954
9954
|
name: t.name
|
|
9955
9955
|
})), t.storage = O(x(t, "addStorage", {
|
|
@@ -10192,7 +10192,7 @@ class He {
|
|
|
10192
10192
|
type: kn(o.name, this.schema)
|
|
10193
10193
|
}, a = [], c = x(o, "addKeyboardShortcuts", l);
|
|
10194
10194
|
let f = {};
|
|
10195
|
-
if (o.type === "mark" && x(o, "exitable", l) && (f.ArrowRight = () =>
|
|
10195
|
+
if (o.type === "mark" && x(o, "exitable", l) && (f.ArrowRight = () => jt.handleExit({ editor: e, mark: o })), c) {
|
|
10196
10196
|
const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
|
|
10197
10197
|
f = { ...f, ...m };
|
|
10198
10198
|
}
|
|
@@ -10418,12 +10418,12 @@ const Mc = ne.create({
|
|
|
10418
10418
|
const { from: n, to: i } = r;
|
|
10419
10419
|
return t && e.delete(n, i), !0;
|
|
10420
10420
|
}, Pc = () => ({ state: r, dispatch: e }) => Ba(r, e), vc = () => ({ commands: r }) => r.keyboardShortcut("Enter"), Bc = () => ({ state: r, dispatch: e }) => Ha(r, e);
|
|
10421
|
-
function
|
|
10421
|
+
function Jt(r, e, t = { strict: !0 }) {
|
|
10422
10422
|
const n = Object.keys(e);
|
|
10423
10423
|
return n.length ? n.every((i) => t.strict ? e[i] === r[i] : ir(e[i]) ? e[i].test(r[i]) : e[i] === r[i]) : !0;
|
|
10424
10424
|
}
|
|
10425
10425
|
function $s(r, e, t = {}) {
|
|
10426
|
-
return r.find((n) => n.type === e &&
|
|
10426
|
+
return r.find((n) => n.type === e && Jt(
|
|
10427
10427
|
// Only check equality for the attributes that are provided
|
|
10428
10428
|
Object.fromEntries(Object.keys(t).map((i) => [i, n.attrs[i]])),
|
|
10429
10429
|
t
|
|
@@ -10520,17 +10520,17 @@ const $c = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) =>
|
|
|
10520
10520
|
return o(), !0;
|
|
10521
10521
|
const l = Ws(i.doc, r) || t.state.selection, a = t.state.selection.eq(l);
|
|
10522
10522
|
return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
10523
|
-
}, Lc = (r, e) => (t) => r.every((n, i) => e(n, { ...t, index: i })), Wc = (r, e) => ({ tr: t, commands: n }) => n.insertContentAt({ from: t.selection.from, to: t.selection.to }, r, e),
|
|
10523
|
+
}, Lc = (r, e) => (t) => r.every((n, i) => e(n, { ...t, index: i })), Wc = (r, e) => ({ tr: t, commands: n }) => n.insertContentAt({ from: t.selection.from, to: t.selection.to }, r, e), js = (r) => {
|
|
10524
10524
|
const e = r.childNodes;
|
|
10525
10525
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
10526
10526
|
const n = e[t];
|
|
10527
|
-
n.nodeType === 3 && n.nodeValue && /^(\n\s\s|\n)$/.test(n.nodeValue) ? r.removeChild(n) : n.nodeType === 1 &&
|
|
10527
|
+
n.nodeType === 3 && n.nodeValue && /^(\n\s\s|\n)$/.test(n.nodeValue) ? r.removeChild(n) : n.nodeType === 1 && js(n);
|
|
10528
10528
|
}
|
|
10529
10529
|
return r;
|
|
10530
10530
|
};
|
|
10531
10531
|
function Nt(r) {
|
|
10532
10532
|
const e = `<body>${r}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
|
|
10533
|
-
return
|
|
10533
|
+
return js(t);
|
|
10534
10534
|
}
|
|
10535
10535
|
function mt(r, e, t) {
|
|
10536
10536
|
if (r instanceof be || r instanceof b)
|
|
@@ -10581,7 +10581,7 @@ function mt(r, e, t) {
|
|
|
10581
10581
|
}
|
|
10582
10582
|
return mt("", e, t);
|
|
10583
10583
|
}
|
|
10584
|
-
function
|
|
10584
|
+
function jc(r, e, t) {
|
|
10585
10585
|
const n = r.steps.length - 1;
|
|
10586
10586
|
if (n < e)
|
|
10587
10587
|
return;
|
|
@@ -10594,7 +10594,7 @@ function Jc(r, e, t) {
|
|
|
10594
10594
|
o === 0 && (o = f);
|
|
10595
10595
|
}), r.setSelection(T.near(r.doc.resolve(o), t));
|
|
10596
10596
|
}
|
|
10597
|
-
const
|
|
10597
|
+
const Jc = (r) => !("type" in r), qc = (r, e, t) => ({ tr: n, dispatch: i, editor: s }) => {
|
|
10598
10598
|
var o;
|
|
10599
10599
|
if (i) {
|
|
10600
10600
|
t = {
|
|
@@ -10635,7 +10635,7 @@ const jc = (r) => !("type" in r), qc = (r, e, t) => ({ tr: n, dispatch: i, edito
|
|
|
10635
10635
|
return a(g), !1;
|
|
10636
10636
|
}
|
|
10637
10637
|
let { from: f, to: d } = typeof r == "number" ? { from: r, to: r } : { from: r.from, to: r.to }, u = !0, h = !0;
|
|
10638
|
-
if ((
|
|
10638
|
+
if ((Jc(l) ? l : [l]).forEach((g) => {
|
|
10639
10639
|
g.check(), u = u ? g.isText && g.marks.length === 0 : !1, h = h ? g.isBlock : !1;
|
|
10640
10640
|
}), f === d && h) {
|
|
10641
10641
|
const { parent: g } = n.doc.resolve(f);
|
|
@@ -10654,10 +10654,10 @@ const jc = (r) => !("type" in r), qc = (r, e, t) => ({ tr: n, dispatch: i, edito
|
|
|
10654
10654
|
n.insertText(m, f, d);
|
|
10655
10655
|
} else
|
|
10656
10656
|
m = l, n.replaceWith(f, d, m);
|
|
10657
|
-
t.updateSelection &&
|
|
10657
|
+
t.updateSelection && jc(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: f, text: m }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: f, text: m });
|
|
10658
10658
|
}
|
|
10659
10659
|
return !0;
|
|
10660
|
-
}, Kc = () => ({ state: r, dispatch: e }) =>
|
|
10660
|
+
}, Kc = () => ({ state: r, dispatch: e }) => ja(r, e), Hc = () => ({ state: r, dispatch: e }) => Ja(r, e), Uc = () => ({ state: r, dispatch: e }) => za(r, e), Gc = () => ({ state: r, dispatch: e }) => La(r, e), _c = () => ({ state: r, dispatch: e, tr: t }) => {
|
|
10661
10661
|
try {
|
|
10662
10662
|
const n = Kt(r.doc, r.selection.$from.pos, -1);
|
|
10663
10663
|
return n == null ? !1 : (t.join(n, 2), e && e(t), !0);
|
|
@@ -10672,7 +10672,7 @@ const jc = (r) => !("type" in r), qc = (r, e, t) => ({ tr: n, dispatch: i, edito
|
|
|
10672
10672
|
return !1;
|
|
10673
10673
|
}
|
|
10674
10674
|
}, Xc = () => ({ state: r, dispatch: e }) => Fa(r, e), Zc = () => ({ state: r, dispatch: e }) => Va(r, e);
|
|
10675
|
-
function
|
|
10675
|
+
function Js() {
|
|
10676
10676
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
10677
10677
|
}
|
|
10678
10678
|
function Qc(r) {
|
|
@@ -10691,7 +10691,7 @@ function Qc(r) {
|
|
|
10691
10691
|
else if (/^s(hift)?$/i.test(a))
|
|
10692
10692
|
s = !0;
|
|
10693
10693
|
else if (/^mod$/i.test(a))
|
|
10694
|
-
or() ||
|
|
10694
|
+
or() || Js() ? o = !0 : i = !0;
|
|
10695
10695
|
else
|
|
10696
10696
|
throw new Error(`Unrecognized modifier name: ${a}`);
|
|
10697
10697
|
}
|
|
@@ -10726,7 +10726,7 @@ function gt(r, e, t = {}) {
|
|
|
10726
10726
|
to: p
|
|
10727
10727
|
});
|
|
10728
10728
|
});
|
|
10729
|
-
const a = i - n, c = l.filter((d) => o ? o.name === d.node.type.name : !0).filter((d) =>
|
|
10729
|
+
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 }));
|
|
10730
10730
|
return s ? !!c.length : c.reduce((d, u) => d + u.to - u.from, 0) >= a;
|
|
10731
10731
|
}
|
|
10732
10732
|
const tf = (r, e = {}) => ({ state: t, dispatch: n }) => {
|
|
@@ -10856,7 +10856,7 @@ function Dt(r, e, t) {
|
|
|
10856
10856
|
function Ln(r, e, t = {}) {
|
|
10857
10857
|
const { empty: n, ranges: i } = r.selection, s = e ? Oe(e, r.schema) : null;
|
|
10858
10858
|
if (n)
|
|
10859
|
-
return !!(r.storedMarks || r.selection.$from.marks()).filter((d) => s ? s.name === d.type.name : !0).find((d) =>
|
|
10859
|
+
return !!(r.storedMarks || r.selection.$from.marks()).filter((d) => s ? s.name === d.type.name : !0).find((d) => Jt(d.attrs, t, { strict: !1 }));
|
|
10860
10860
|
let o = 0;
|
|
10861
10861
|
const l = [];
|
|
10862
10862
|
if (i.forEach(({ $from: d, $to: u }) => {
|
|
@@ -10873,7 +10873,7 @@ function Ln(r, e, t = {}) {
|
|
|
10873
10873
|
});
|
|
10874
10874
|
}), o === 0)
|
|
10875
10875
|
return !1;
|
|
10876
|
-
const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) =>
|
|
10876
|
+
const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) => Jt(d.mark.attrs, t, { strict: !1 })).reduce((d, u) => d + u.to - u.from, 0), c = l.filter((d) => s ? d.mark.type !== s && d.mark.type.excludes(s) : !0).reduce((d, u) => d + u.to - u.from, 0);
|
|
10877
10877
|
return (a > 0 ? a + c : a) >= o;
|
|
10878
10878
|
}
|
|
10879
10879
|
function xf(r, e, t = {}) {
|
|
@@ -11057,10 +11057,10 @@ const Ef = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11057
11057
|
const P = a.before(a.depth - (w - 1));
|
|
11058
11058
|
t.replace(P, a.after(-C), new k(y, 4 - w, 0));
|
|
11059
11059
|
let M = -1;
|
|
11060
|
-
t.doc.nodesBetween(P, t.doc.content.size, (E,
|
|
11060
|
+
t.doc.nodesBetween(P, t.doc.content.size, (E, j) => {
|
|
11061
11061
|
if (M > -1)
|
|
11062
11062
|
return !1;
|
|
11063
|
-
E.isTextblock && E.content.size === 0 && (M =
|
|
11063
|
+
E.isTextblock && E.content.size === 0 && (M = j + 1);
|
|
11064
11064
|
}), M > -1 && t.setSelection(N.near(t.doc.resolve(M))), t.scrollIntoView();
|
|
11065
11065
|
}
|
|
11066
11066
|
return !0;
|
|
@@ -11275,7 +11275,7 @@ const Wf = ne.create({
|
|
|
11275
11275
|
...Lf
|
|
11276
11276
|
};
|
|
11277
11277
|
}
|
|
11278
|
-
}),
|
|
11278
|
+
}), jf = ne.create({
|
|
11279
11279
|
name: "drop",
|
|
11280
11280
|
addProseMirrorPlugins() {
|
|
11281
11281
|
return [
|
|
@@ -11294,7 +11294,7 @@ const Wf = ne.create({
|
|
|
11294
11294
|
})
|
|
11295
11295
|
];
|
|
11296
11296
|
}
|
|
11297
|
-
}),
|
|
11297
|
+
}), Jf = ne.create({
|
|
11298
11298
|
name: "editable",
|
|
11299
11299
|
addProseMirrorPlugins() {
|
|
11300
11300
|
return [
|
|
@@ -11375,7 +11375,7 @@ const Wf = ne.create({
|
|
|
11375
11375
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
11376
11376
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
11377
11377
|
};
|
|
11378
|
-
return or() ||
|
|
11378
|
+
return or() || Js() ? s : i;
|
|
11379
11379
|
},
|
|
11380
11380
|
addProseMirrorPlugins() {
|
|
11381
11381
|
return [
|
|
@@ -11768,7 +11768,7 @@ let Qf = class extends lc {
|
|
|
11768
11768
|
createExtensionManager() {
|
|
11769
11769
|
var e, t;
|
|
11770
11770
|
const i = [...this.options.enableCoreExtensions ? [
|
|
11771
|
-
|
|
11771
|
+
Jf,
|
|
11772
11772
|
Mc.configure({
|
|
11773
11773
|
blockSeparator: (t = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || t === void 0 ? void 0 : t.blockSeparator
|
|
11774
11774
|
}),
|
|
@@ -11776,7 +11776,7 @@ let Qf = class extends lc {
|
|
|
11776
11776
|
Kf,
|
|
11777
11777
|
Hf,
|
|
11778
11778
|
Gf,
|
|
11779
|
-
|
|
11779
|
+
jf,
|
|
11780
11780
|
Uf
|
|
11781
11781
|
].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));
|
|
11782
11782
|
this.extensionManager = new He(i, this);
|
|
@@ -12125,68 +12125,41 @@ function od(r, e) {
|
|
|
12125
12125
|
}
|
|
12126
12126
|
return !1;
|
|
12127
12127
|
}
|
|
12128
|
+
function ld(r) {
|
|
12129
|
+
return r.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
12130
|
+
}
|
|
12128
12131
|
export {
|
|
12129
|
-
|
|
12130
|
-
Z as A,
|
|
12131
|
-
ja as B,
|
|
12132
|
-
za as C,
|
|
12133
|
-
ee as D,
|
|
12132
|
+
v as D,
|
|
12134
12133
|
ne as E,
|
|
12135
12134
|
b as F,
|
|
12136
|
-
|
|
12137
|
-
Ba as H,
|
|
12138
|
-
Ua as I,
|
|
12139
|
-
et as J,
|
|
12140
|
-
we as K,
|
|
12141
|
-
be as L,
|
|
12142
|
-
Ai as M,
|
|
12135
|
+
jt as M,
|
|
12143
12136
|
Wn as N,
|
|
12144
|
-
ke as O,
|
|
12145
12137
|
oe as P,
|
|
12146
|
-
F as Q,
|
|
12147
|
-
B as R,
|
|
12148
12138
|
T as S,
|
|
12149
12139
|
N as T,
|
|
12150
|
-
id as U,
|
|
12151
|
-
Jt as V,
|
|
12152
|
-
sd as W,
|
|
12153
|
-
td as X,
|
|
12154
|
-
rd as Y,
|
|
12155
|
-
Po as Z,
|
|
12156
|
-
va as _,
|
|
12157
12140
|
$e as a,
|
|
12158
|
-
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
Vs as a7,
|
|
12166
|
-
Qf as a8,
|
|
12167
|
-
v as b,
|
|
12168
|
-
Qa as c,
|
|
12169
|
-
k as d,
|
|
12170
|
-
Ue as e,
|
|
12171
|
-
S as f,
|
|
12172
|
-
li as g,
|
|
12173
|
-
Xa as h,
|
|
12141
|
+
ee as b,
|
|
12142
|
+
be as c,
|
|
12143
|
+
sd as d,
|
|
12144
|
+
ld as e,
|
|
12145
|
+
td as f,
|
|
12146
|
+
Po as g,
|
|
12147
|
+
k as h,
|
|
12174
12148
|
ar as i,
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12149
|
+
S as j,
|
|
12150
|
+
va as k,
|
|
12151
|
+
O as l,
|
|
12178
12152
|
ac as m,
|
|
12179
12153
|
nd as n,
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
|
|
12189
|
-
|
|
12190
|
-
|
|
12191
|
-
La as z
|
|
12154
|
+
x as o,
|
|
12155
|
+
Bt as p,
|
|
12156
|
+
od as q,
|
|
12157
|
+
Xf as r,
|
|
12158
|
+
Ls as s,
|
|
12159
|
+
rd as t,
|
|
12160
|
+
Zf as u,
|
|
12161
|
+
yf as v,
|
|
12162
|
+
id as w,
|
|
12163
|
+
Vs as x,
|
|
12164
|
+
Qf as y
|
|
12192
12165
|
};
|