@ckeditor/ckeditor5-minimap 41.1.0 → 41.3.0-alpha.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/build/minimap.js +1 -1
- package/dist/content-index.css +4 -0
- package/dist/editor-index.css +58 -0
- package/dist/index.css +76 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +600 -0
- package/dist/index.js.map +1 -0
- package/dist/types/augmentation.d.ts +18 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/minimap.d.ts +54 -0
- package/dist/types/minimapconfig.d.ts +85 -0
- package/dist/types/minimapiframeview.d.ts +54 -0
- package/dist/types/minimappositiontrackerview.d.ts +58 -0
- package/dist/types/minimapview.d.ts +109 -0
- package/dist/types/utils.d.ts +61 -0
- package/package.json +3 -2
- package/src/minimap.js +4 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module minimap/utils
|
|
7
|
+
*/
|
|
8
|
+
import { Rect } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
10
|
+
/**
|
|
11
|
+
* Clones the editing view DOM root by using a dedicated pair of {@link module:engine/view/renderer~Renderer} and
|
|
12
|
+
* {@link module:engine/view/domconverter~DomConverter}. The DOM root clone updates incrementally to stay in sync with the
|
|
13
|
+
* source root.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
* @param editor The editor instance the original editing root belongs to.
|
|
17
|
+
* @param rootName The name of the root to clone.
|
|
18
|
+
* @returns The editing root DOM clone element.
|
|
19
|
+
*/
|
|
20
|
+
export declare function cloneEditingViewDomRoot(editor: Editor, rootName?: string): HTMLElement;
|
|
21
|
+
/**
|
|
22
|
+
* Harvests all web page styles, for instance, to allow re-using them in an `<iframe>` preserving the look of the content.
|
|
23
|
+
*
|
|
24
|
+
* The returned data format is as follows:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* [
|
|
28
|
+
* 'p { color: red; ... } h2 { font-size: 2em; ... } ...',
|
|
29
|
+
* '.spacing { padding: 1em; ... }; ...',
|
|
30
|
+
* '...',
|
|
31
|
+
* { href: 'http://link.to.external.stylesheet' },
|
|
32
|
+
* { href: '...' }
|
|
33
|
+
* ]
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* **Note**: For stylesheets with `href` different than window origin, an object is returned because
|
|
37
|
+
* accessing rules of these styles may cause CORS errors (depending on the configuration of the web page).
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare function getPageStyles(): Array<string | {
|
|
42
|
+
href: string;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Gets dimensions rectangle according to passed DOM element. Returns whole window's size for `body` element.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function getDomElementRect(domElement: HTMLElement): Rect;
|
|
50
|
+
/**
|
|
51
|
+
* Gets client height according to passed DOM element. Returns window's height for `body` element.
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export declare function getClientHeight(domElement: HTMLElement): number;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the DOM element itself if it's not a `body` element, whole window otherwise.
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export declare function getScrollable(domElement: HTMLElement): Window | HTMLElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-minimap",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.3.0-alpha.0",
|
|
4
4
|
"description": "Content minimap feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"ckeditor5": "41.
|
|
16
|
+
"ckeditor5": "41.3.0-alpha.0"
|
|
17
17
|
},
|
|
18
18
|
"author": "CKSource (http://cksource.com/)",
|
|
19
19
|
"license": "GPL-2.0-or-later",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"directory": "packages/ckeditor5-minimap"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
|
+
"dist",
|
|
28
29
|
"lang",
|
|
29
30
|
"src/**/*.js",
|
|
30
31
|
"src/**/*.d.ts",
|
package/src/minimap.js
CHANGED
|
@@ -34,6 +34,7 @@ export default class Minimap extends Plugin {
|
|
|
34
34
|
* @inheritDoc
|
|
35
35
|
*/
|
|
36
36
|
destroy() {
|
|
37
|
+
super.destroy();
|
|
37
38
|
this._minimapView.destroy();
|
|
38
39
|
this._minimapView.element.remove();
|
|
39
40
|
}
|
|
@@ -53,6 +54,9 @@ export default class Minimap extends Plugin {
|
|
|
53
54
|
}
|
|
54
55
|
this._initializeMinimapView();
|
|
55
56
|
this.listenTo(editor.editing.view, 'render', () => {
|
|
57
|
+
if (editor.state !== 'ready') {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
56
60
|
this._syncMinimapToEditingRootScrollPosition();
|
|
57
61
|
});
|
|
58
62
|
this._syncMinimapToEditingRootScrollPosition();
|