mirror of https://github.com/halo-dev/halo
chore: upgrade tiptap to 2.24.1 (#7613)
#### What type of PR is this? /kind chore /area editor #### What this PR does / why we need it: 升级 tiptap 至 2.24.1 #### Does this PR introduce a user-facing change? ```release-note 升级 tiptap 至 2.24.1 ```pull/7614/head^2
parent
3dd0d00288
commit
6246da9b85
|
@ -22,7 +22,8 @@ import run.halo.app.infra.utils.PathUtils;
|
|||
@Component
|
||||
public class HaloTrackerProcessor implements TemplateHeadProcessor {
|
||||
|
||||
public static final String SKIP_TRACKER = HaloTrackerProcessor.class.getName() + ".SKIP_TRACKER";
|
||||
public static final String SKIP_TRACKER =
|
||||
HaloTrackerProcessor.class.getName() + ".SKIP_TRACKER";
|
||||
|
||||
private final ExternalUrlSupplier externalUrlGetter;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
"@he-tree/vue": "^2.9.4",
|
||||
"@number-flow/vue": "^0.4.8",
|
||||
"@tanstack/vue-query": "^4.37.1",
|
||||
"@tiptap/extension-character-count": "^2.11.2",
|
||||
"@tiptap/extension-character-count": "^2.24.1",
|
||||
"@uppy/core": "^3.11.3",
|
||||
"@uppy/dashboard": "^3.8.3",
|
||||
"@uppy/drag-drop": "^3.1.0",
|
||||
|
@ -171,7 +171,10 @@
|
|||
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184",
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"vite": "npm:rolldown-vite@7.0.3"
|
||||
"vite": "npm:rolldown-vite@7.0.3",
|
||||
"prosemirror-model": "1.25.1",
|
||||
"prosemirror-view": "1.40.0",
|
||||
"prosemirror-transform": "1.10.4"
|
||||
},
|
||||
"onlyBuiltDependencies": [
|
||||
"@nestjs/core",
|
||||
|
|
|
@ -40,45 +40,45 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@ckpack/vue-color": "^1.5.0",
|
||||
"@tiptap/core": "^2.11.2",
|
||||
"@tiptap/extension-blockquote": "^2.11.2",
|
||||
"@tiptap/extension-bold": "^2.11.2",
|
||||
"@tiptap/extension-bullet-list": "^2.11.2",
|
||||
"@tiptap/extension-code": "^2.11.2",
|
||||
"@tiptap/extension-code-block": "^2.11.2",
|
||||
"@tiptap/extension-color": "^2.11.2",
|
||||
"@tiptap/extension-details": "^2.22.3",
|
||||
"@tiptap/extension-details-content": "^2.22.3",
|
||||
"@tiptap/extension-details-summary": "^2.22.3",
|
||||
"@tiptap/extension-document": "^2.11.2",
|
||||
"@tiptap/extension-dropcursor": "^2.11.2",
|
||||
"@tiptap/extension-hard-break": "^2.11.2",
|
||||
"@tiptap/extension-heading": "^2.11.2",
|
||||
"@tiptap/extension-highlight": "^2.11.2",
|
||||
"@tiptap/extension-history": "^2.11.2",
|
||||
"@tiptap/extension-horizontal-rule": "^2.11.2",
|
||||
"@tiptap/extension-image": "^2.11.2",
|
||||
"@tiptap/extension-italic": "^2.11.2",
|
||||
"@tiptap/extension-link": "^2.11.2",
|
||||
"@tiptap/extension-list-item": "^2.11.2",
|
||||
"@tiptap/extension-list-keymap": "^2.11.2",
|
||||
"@tiptap/extension-ordered-list": "^2.11.2",
|
||||
"@tiptap/extension-paragraph": "^2.11.2",
|
||||
"@tiptap/extension-placeholder": "^2.11.2",
|
||||
"@tiptap/extension-strike": "^2.11.2",
|
||||
"@tiptap/extension-subscript": "^2.11.2",
|
||||
"@tiptap/extension-superscript": "^2.11.2",
|
||||
"@tiptap/extension-table": "^2.11.2",
|
||||
"@tiptap/extension-table-row": "^2.11.2",
|
||||
"@tiptap/extension-task-item": "^2.11.2",
|
||||
"@tiptap/extension-task-list": "^2.11.2",
|
||||
"@tiptap/extension-text": "^2.11.2",
|
||||
"@tiptap/extension-text-align": "^2.11.2",
|
||||
"@tiptap/extension-text-style": "^2.11.2",
|
||||
"@tiptap/extension-underline": "^2.11.2",
|
||||
"@tiptap/pm": "^2.11.2",
|
||||
"@tiptap/suggestion": "^2.11.2",
|
||||
"@tiptap/vue-3": "^2.11.2",
|
||||
"@tiptap/core": "^2.24.1",
|
||||
"@tiptap/extension-blockquote": "^2.24.1",
|
||||
"@tiptap/extension-bold": "^2.24.1",
|
||||
"@tiptap/extension-bullet-list": "^2.24.1",
|
||||
"@tiptap/extension-code": "^2.24.1",
|
||||
"@tiptap/extension-code-block": "^2.24.1",
|
||||
"@tiptap/extension-color": "^2.24.1",
|
||||
"@tiptap/extension-details": "^2.24.1",
|
||||
"@tiptap/extension-details-content": "^2.24.1",
|
||||
"@tiptap/extension-details-summary": "^2.24.1",
|
||||
"@tiptap/extension-document": "^2.24.1",
|
||||
"@tiptap/extension-dropcursor": "^2.24.1",
|
||||
"@tiptap/extension-hard-break": "^2.24.1",
|
||||
"@tiptap/extension-heading": "^2.24.1",
|
||||
"@tiptap/extension-highlight": "^2.24.1",
|
||||
"@tiptap/extension-history": "^2.24.1",
|
||||
"@tiptap/extension-horizontal-rule": "^2.24.1",
|
||||
"@tiptap/extension-image": "^2.24.1",
|
||||
"@tiptap/extension-italic": "^2.24.1",
|
||||
"@tiptap/extension-link": "^2.24.1",
|
||||
"@tiptap/extension-list-item": "^2.24.1",
|
||||
"@tiptap/extension-list-keymap": "^2.24.1",
|
||||
"@tiptap/extension-ordered-list": "^2.24.1",
|
||||
"@tiptap/extension-paragraph": "^2.24.1",
|
||||
"@tiptap/extension-placeholder": "^2.24.1",
|
||||
"@tiptap/extension-strike": "^2.24.1",
|
||||
"@tiptap/extension-subscript": "^2.24.1",
|
||||
"@tiptap/extension-superscript": "^2.24.1",
|
||||
"@tiptap/extension-table": "^2.24.1",
|
||||
"@tiptap/extension-table-row": "^2.24.1",
|
||||
"@tiptap/extension-task-item": "^2.24.1",
|
||||
"@tiptap/extension-task-list": "^2.24.1",
|
||||
"@tiptap/extension-text": "^2.24.1",
|
||||
"@tiptap/extension-text-align": "^2.24.1",
|
||||
"@tiptap/extension-text-style": "^2.24.1",
|
||||
"@tiptap/extension-underline": "^2.24.1",
|
||||
"@tiptap/pm": "^2.24.1",
|
||||
"@tiptap/suggestion": "^2.24.1",
|
||||
"@tiptap/vue-3": "^2.24.1",
|
||||
"floating-vue": "^5.2.2",
|
||||
"github-markdown-css": "^5.2.0",
|
||||
"linkifyjs": "^4.1.3",
|
||||
|
|
|
@ -11,8 +11,6 @@ import {
|
|||
PluginKey,
|
||||
ResolvedPos,
|
||||
Slice,
|
||||
// @ts-ignore
|
||||
__serializeForClipboard as serializeForClipboard,
|
||||
} from "@/tiptap/pm";
|
||||
import { Editor, Extension } from "@/tiptap/vue-3";
|
||||
import type { DraggableItemType, ExtensionOptions } from "@/types";
|
||||
|
@ -159,7 +157,8 @@ const handleDragStartEvent = (event: DragEvent) => {
|
|||
const slice = activeSelection.content();
|
||||
event.dataTransfer.effectAllowed = "move";
|
||||
|
||||
const { dom, text } = serializeForClipboard(currEditorView, slice);
|
||||
// @ts-ignore
|
||||
const { dom, text } = currEditorView.serializeForClipboard(slice);
|
||||
event.dataTransfer.clearData();
|
||||
event.dataTransfer.setData("text/html", dom.innerHTML);
|
||||
event.dataTransfer.setData("text/plain", text);
|
||||
|
@ -377,8 +376,8 @@ const dropPoint = (doc: Node, pos: number, slice: Slice) => {
|
|||
dep == $pos.depth
|
||||
? 0
|
||||
: $pos.pos <= ($pos.start(dep + 1) + $pos.end(dep + 1)) / 2
|
||||
? -1
|
||||
: 1;
|
||||
? -1
|
||||
: 1;
|
||||
const insertPos = $pos.index(dep) + (bias > 0 ? 1 : 0);
|
||||
const parent = $pos.node(dep);
|
||||
let fits = false;
|
||||
|
@ -397,8 +396,8 @@ const dropPoint = (doc: Node, pos: number, slice: Slice) => {
|
|||
return bias == 0
|
||||
? $pos.pos
|
||||
: bias < 0
|
||||
? $pos.before(dep + 1)
|
||||
: $pos.after(dep + 1);
|
||||
? $pos.before(dep + 1)
|
||||
: $pos.after(dep + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import type { EditorState, Rect, Selection, Transaction } from "@/tiptap/pm";
|
||||
import { CellSelection, Node, TableMap, selectedRect } from "@/tiptap/pm";
|
||||
import { CellSelection, Node, selectedRect, TableMap } from "@/tiptap/pm";
|
||||
import { findParentNode } from "@/tiptap/vue-3";
|
||||
|
||||
export const selectTable = (tr: Transaction) => {
|
||||
const table = findTable(tr.selection);
|
||||
if (table) {
|
||||
const { map } = TableMap.get(table.node);
|
||||
const { node } = table;
|
||||
const { map } = TableMap.get(node);
|
||||
if (map && map.length) {
|
||||
const head = table.start + map[0];
|
||||
const anchor = table.start + map[map.length - 1];
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue