@flogeez/angular-tiptap-editor 3.8.1 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/esm2022/lib/components/editor/ate-block-controls.component.mjs +67 -18
- package/esm2022/lib/extensions/ate-block-controls.extension.mjs +222 -4
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +436 -171
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/lib/components/editor/ate-block-controls.component.d.ts +9 -0
- package/lib/extensions/ate-block-controls.extension.d.ts +10 -0
- package/package.json +1 -1
- package/src/lib/styles/index.css +13 -0
- package/styles/index.css +13 -0
|
@@ -20,11 +20,20 @@ export declare class AteBlockControlsComponent implements AfterViewInit, OnDestr
|
|
|
20
20
|
private lastValidRect;
|
|
21
21
|
private tippyInstance;
|
|
22
22
|
private updateTimeout;
|
|
23
|
+
private glideFrame;
|
|
23
24
|
constructor();
|
|
24
25
|
ngAfterViewInit(): void;
|
|
25
26
|
ngOnDestroy(): void;
|
|
26
27
|
private initTippy;
|
|
27
28
|
private updateMenu;
|
|
29
|
+
/** While scrolling, the controls follow their block every frame: a glide would make them trail behind it */
|
|
30
|
+
private onScroll;
|
|
31
|
+
/**
|
|
32
|
+
* Moves the controls without gliding until the position settles (two frames after the last call).
|
|
33
|
+
* Tippy only skips the move transition on its very first show: the controls are never unmounted
|
|
34
|
+
* afterwards, so they would otherwise glide in from wherever they were last shown.
|
|
35
|
+
*/
|
|
36
|
+
private withoutGlide;
|
|
28
37
|
private showTippy;
|
|
29
38
|
private hideTippy;
|
|
30
39
|
private getSelectionRect;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { Extension } from "@tiptap/core";
|
|
2
|
+
import { EditorState } from "@tiptap/pm/state";
|
|
3
|
+
import { EditorView } from "@tiptap/pm/view";
|
|
2
4
|
import { Node } from "@tiptap/pm/model";
|
|
5
|
+
export declare const ATE_BLOCK_DRAG_MIME = "application/x-ate-block-drag";
|
|
6
|
+
interface PosRange {
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function endAteBlockDrag(view: EditorView): void;
|
|
11
|
+
export declare function ateMultiBlockSelection(state: EditorState, blockPos: number): PosRange | null;
|
|
3
12
|
export interface AteBlockControlsOptions {
|
|
4
13
|
onHover?: (data: {
|
|
5
14
|
node: Node;
|
|
@@ -8,3 +17,4 @@ export interface AteBlockControlsOptions {
|
|
|
8
17
|
} | null) => void;
|
|
9
18
|
}
|
|
10
19
|
export declare const AteBlockControlsExtension: Extension<AteBlockControlsOptions, any>;
|
|
20
|
+
export {};
|
package/package.json
CHANGED
package/src/lib/styles/index.css
CHANGED
|
@@ -40,3 +40,16 @@
|
|
|
40
40
|
.ProseMirror .has-text-align-justify {
|
|
41
41
|
text-align: justify;
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
.ate-block-dragging > .prosemirror-dropcursor-block,
|
|
45
|
+
.ate-block-dragging > .prosemirror-dropcursor-inline {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ProseMirror > .ate-block-drop-before {
|
|
50
|
+
box-shadow: 0 -2px 0 0 var(--ate-primary, #2563eb);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ProseMirror > .ate-block-drop-after {
|
|
54
|
+
box-shadow: 0 2px 0 0 var(--ate-primary, #2563eb);
|
|
55
|
+
}
|
package/styles/index.css
CHANGED
|
@@ -40,3 +40,16 @@
|
|
|
40
40
|
.ProseMirror .has-text-align-justify {
|
|
41
41
|
text-align: justify;
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
.ate-block-dragging > .prosemirror-dropcursor-block,
|
|
45
|
+
.ate-block-dragging > .prosemirror-dropcursor-inline {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ProseMirror > .ate-block-drop-before {
|
|
50
|
+
box-shadow: 0 -2px 0 0 var(--ate-primary, #2563eb);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ProseMirror > .ate-block-drop-after {
|
|
54
|
+
box-shadow: 0 2px 0 0 var(--ate-primary, #2563eb);
|
|
55
|
+
}
|