@ckeditor/ckeditor5-minimap 44.1.0-alpha.5 → 44.2.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  export {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  /**
package/src/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  /**
package/src/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  /* global CSSMediaRule */
package/theme/minimap.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
 
@@ -1,22 +0,0 @@
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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- import type { MinimapConfig, Minimap } from './index.js';
10
- declare module '@ckeditor/ckeditor5-core' {
11
- interface EditorConfig {
12
- /**
13
- * The configuration of the minimap feature. Introduced by the {@link module:minimap/minimap~Minimap} feature.
14
- *
15
- * Read more in {@link module:minimap/minimapconfig~MinimapConfig}.
16
- */
17
- minimap?: MinimapConfig;
18
- }
19
- interface PluginsMap {
20
- [Minimap.pluginName]: Minimap;
21
- }
22
- }
package/dist/index.d.ts DELETED
@@ -1,14 +0,0 @@
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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module minimap
11
- */
12
- export { default as Minimap } from './minimap.js';
13
- export type { MinimapConfig } from './minimapconfig.js';
14
- import './augmentation.js';
package/dist/minimap.d.ts DELETED
@@ -1,62 +0,0 @@
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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module minimap/minimap
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import '../theme/minimap.css';
14
- /**
15
- * The content minimap feature.
16
- */
17
- export default class Minimap extends Plugin {
18
- /**
19
- * @inheritDoc
20
- */
21
- static get pluginName(): "Minimap";
22
- /**
23
- * @inheritDoc
24
- */
25
- static get isOfficialPlugin(): true;
26
- /**
27
- * The reference to the view of the minimap.
28
- */
29
- private _minimapView;
30
- /**
31
- * The DOM element closest to the editable element of the editor as returned
32
- * by {@link module:ui/editorui/editorui~EditorUI#getEditableElement}.
33
- */
34
- private _scrollableRootAncestor;
35
- /**
36
- * The DOM element closest to the editable element of the editor as returned
37
- * by {@link module:ui/editorui/editorui~EditorUI#getEditableElement}.
38
- */
39
- private _editingRootElement?;
40
- /**
41
- * @inheritDoc
42
- */
43
- init(): void;
44
- /**
45
- * @inheritDoc
46
- */
47
- destroy(): void;
48
- /**
49
- * Initializes the minimap view element and starts the layout synchronization
50
- * on the editing view `render` event.
51
- */
52
- private _onUiReady;
53
- /**
54
- * Initializes the minimap view and attaches listeners that make it responsive to the environment (document)
55
- * but also allow the minimap to control the document (scroll position).
56
- */
57
- private _initializeMinimapView;
58
- /**
59
- * @private
60
- */
61
- private _syncMinimapToEditingRootScrollPosition;
62
- }
@@ -1,89 +0,0 @@
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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module minimap/minimapconfig
11
- */
12
- /**
13
- * The configuration of the {@link module:minimap/minimap~Minimap} feature.
14
- *
15
- * ```ts
16
- * ClassicEditor
17
- * .create( {
18
- * minimap: ... // Minimap feature config.
19
- * } )
20
- * .then( ... )
21
- * .catch( ... );
22
- * ```
23
- *
24
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
25
- */
26
- export interface MinimapConfig {
27
- /**
28
- * The DOM element container for the minimap.
29
- *
30
- * **Note**: The container must have a fixed `width` and `overflow: hidden` for the minimap to work correctly.
31
- */
32
- container: HTMLElement;
33
- /**
34
- * When set to `true`, the minimap will render content as simple boxes instead of replicating the look of the content (default).
35
- */
36
- useSimplePreview?: boolean;
37
- /**
38
- * Extra CSS class (or classes) that will be set internally on the `<body>` element of the `<iframe>` enclosing the minimap.
39
- *
40
- * By default, the minimap feature will attempt to clone all website styles and re-apply them in the `<iframe>` for the best accuracy.
41
- * However, this may not work if the content of your editor inherits the styles from parent containers, resulting in inconsistent
42
- * look and imprecise scrolling of the minimap.
43
- *
44
- * This optional configuration can address these issues by ensuring the same CSS rules apply to the content of the minimap
45
- * and the original content of the editor.
46
- *
47
- * For instance, consider the following DOM structure:
48
- *
49
- * ```html
50
- * <div class="website">
51
- * <!-- ... -->
52
- * <div class="styled-container">
53
- * <!-- ... -->
54
- * <div id="editor">
55
- * <!-- content of the editor -->
56
- * </div>
57
- * </div>
58
- * <!-- ... -->
59
- * </div>
60
- * ```
61
- *
62
- * and the following CSS styles:
63
- *
64
- * ```css
65
- * .website p {
66
- * font-size: 13px;
67
- * }
68
- *
69
- * .styled-container p {
70
- * color: #ccc;
71
- * }
72
- * ```
73
- *
74
- * To maintain the consistency of styling (`font-size` and `color` of paragraphs), you will need to pass the CSS class names
75
- * of these containers:
76
- *
77
- * ```ts
78
- * ClassicEditor
79
- * .create( document.getElementById( 'editor' ), {
80
- * minimap: {
81
- * extraClasses: 'website styled-container'
82
- * }
83
- * } )
84
- * .then( ... )
85
- * .catch( ... );
86
- * ```
87
- */
88
- extraClasses?: string;
89
- }
@@ -1,58 +0,0 @@
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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module minimap/minimapiframeview
11
- */
12
- import { IframeView } from 'ckeditor5/src/ui.js';
13
- import { type Locale } from 'ckeditor5/src/utils.js';
14
- import type { MinimapViewOptions } from './minimapview.js';
15
- /**
16
- * The internal `<iframe>` view that hosts the minimap content.
17
- *
18
- * @internal
19
- */
20
- export default class MinimapIframeView extends IframeView {
21
- /**
22
- * The CSS `top` used to scroll the minimap.
23
- *
24
- * @readonly
25
- */
26
- top: number;
27
- /**
28
- * The CSS `height` of the iframe.
29
- *
30
- * @readonly
31
- */
32
- height: number;
33
- /**
34
- * Cached view constructor options for re-use in other methods.
35
- */
36
- private readonly _options;
37
- /**
38
- * Creates an instance of the internal minimap iframe.
39
- */
40
- constructor(locale: Locale, options: MinimapViewOptions);
41
- /**
42
- * @inheritDoc
43
- */
44
- render(): Promise<unknown>;
45
- /**
46
- * Sets the new height of the iframe.
47
- */
48
- setHeight(newHeight: number): void;
49
- /**
50
- * Sets the top offset of the iframe to move it around vertically.
51
- */
52
- setTopOffset(newOffset: number): void;
53
- /**
54
- * Sets the internal structure of the `<iframe>` readying it to display the
55
- * minimap element.
56
- */
57
- private _prepareDocument;
58
- }
@@ -1,62 +0,0 @@
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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module minimap/minimappositiontrackerview
11
- */
12
- import { View } from 'ckeditor5/src/ui.js';
13
- import { type Locale } from 'ckeditor5/src/utils.js';
14
- /**
15
- * The position tracker visualizing the visible subset of the content. Displayed over the minimap.
16
- *
17
- * @internal
18
- */
19
- export default class MinimapPositionTrackerView extends View {
20
- /**
21
- * The CSS `height` of the tracker visualizing the subset of the content visible to the user.
22
- *
23
- * @readonly
24
- */
25
- height: number;
26
- /**
27
- * The CSS `top` of the tracker, used to move it vertically over the minimap.
28
- *
29
- * @readonly
30
- */
31
- top: number;
32
- /**
33
- * The scroll progress (in %) displayed over the tracker when being dragged by the user.
34
- *
35
- * @readonly
36
- */
37
- scrollProgress: number;
38
- /**
39
- * Indicates whether the tracker is being dragged by the user (e.g. using the mouse).
40
- *
41
- * @internal
42
- * @readonly
43
- */
44
- _isDragging: boolean;
45
- constructor(locale: Locale);
46
- /**
47
- * @inheritDoc
48
- */
49
- render(): void;
50
- /**
51
- * Sets the new height of the tracker to visualize the subset of the content visible to the user.
52
- */
53
- setHeight(newHeight: number): void;
54
- /**
55
- * Sets the top offset of the tracker to move it around vertically.
56
- */
57
- setTopOffset(newOffset: number): void;
58
- /**
59
- * Sets the scroll progress (in %) to inform the user using a label when the tracker is being dragged.
60
- */
61
- setScrollProgress(newProgress: number): void;
62
- }
@@ -1,113 +0,0 @@
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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module minimap/minimapview
11
- */
12
- import { View } from 'ckeditor5/src/ui.js';
13
- import { type Locale } from 'ckeditor5/src/utils.js';
14
- export type MinimapViewOptions = {
15
- domRootClone: HTMLElement;
16
- pageStyles: Array<string | {
17
- href: string;
18
- }>;
19
- scaleRatio: number;
20
- useSimplePreview?: boolean;
21
- extraClasses?: string;
22
- };
23
- /**
24
- * The main view of the minimap. It renders the original content but scaled down with a tracker element
25
- * visualizing the subset of the content visible to the user and allowing interactions (scrolling, dragging).
26
- *
27
- * @internal
28
- */
29
- export default class MinimapView extends View {
30
- /**
31
- * An instance of the tracker view displayed over the minimap.
32
- */
33
- private readonly _positionTrackerView;
34
- /**
35
- * The scale ratio of the minimap relative to the original editing DOM root with the content.
36
- */
37
- private readonly _scaleRatio;
38
- /**
39
- * An instance of the iframe view that hosts the minimap.
40
- */
41
- private readonly _minimapIframeView;
42
- /**
43
- * Creates an instance of the minimap view.
44
- */
45
- constructor({ locale, scaleRatio, pageStyles, extraClasses, useSimplePreview, domRootClone }: {
46
- locale: Locale;
47
- } & MinimapViewOptions);
48
- /**
49
- * @inheritDoc
50
- */
51
- destroy(): void;
52
- /**
53
- * Returns the DOM {@link module:utils/dom/rect~Rect} height of the minimap.
54
- */
55
- get height(): number;
56
- /**
57
- * Returns the number of available space (pixels) the position tracker (visible subset of the content) can use to scroll vertically.
58
- */
59
- get scrollHeight(): number;
60
- /**
61
- * @inheritDoc
62
- */
63
- render(): void;
64
- /**
65
- * Sets the new height of the minimap (in px) to respond to the changes in the original editing DOM root.
66
- *
67
- * **Note**:The provided value should be the `offsetHeight` of the original editing DOM root.
68
- */
69
- setContentHeight(newHeight: number): void;
70
- /**
71
- * Sets the minimap scroll progress.
72
- *
73
- * The minimap scroll progress is linked to the original editing DOM root and its scrollable container (ancestor).
74
- * Changing the progress will alter the vertical position of the minimap (and its position tracker) and give the user an accurate
75
- * overview of the visible document.
76
- *
77
- * **Note**: The value should be between 0 and 1. 0 when the DOM root has not been scrolled, 1 when the
78
- * scrolling has reached the end.
79
- */
80
- setScrollProgress(newScrollProgress: number): void;
81
- /**
82
- * Sets the new height of the tracker (in px) to visualize the subset of the content visible to the user.
83
- */
84
- setPositionTrackerHeight(trackerHeight: number): void;
85
- /**
86
- * @param data DOM event data
87
- */
88
- private _handleMinimapClick;
89
- /**
90
- * @param data DOM event data
91
- */
92
- private _handleMinimapMouseWheel;
93
- }
94
- /**
95
- * Fired when the minimap view is clicked.
96
- *
97
- * @eventName ~MinimapView#click
98
- * @param percentage The number between 0 and 1 representing a place in the minimap (its height) that was clicked.
99
- */
100
- export type MinimapClickEvent = {
101
- name: 'click';
102
- args: [percentage: number];
103
- };
104
- /**
105
- * Fired when the position tracker is dragged or the minimap is scrolled via mouse wheel.
106
- *
107
- * @eventName ~MinimapView#drag
108
- * @param movementY The vertical movement of the minimap as a result of dragging or scrolling.
109
- */
110
- export type MinimapDragEvent = {
111
- name: 'drag';
112
- args: [movementY: number];
113
- };
package/dist/utils.d.ts DELETED
@@ -1,65 +0,0 @@
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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
- */
9
- /**
10
- * @module minimap/utils
11
- */
12
- import { Rect } from 'ckeditor5/src/utils.js';
13
- import type { Editor } from 'ckeditor5/src/core.js';
14
- /**
15
- * Clones the editing view DOM root by using a dedicated pair of {@link module:engine/view/renderer~Renderer} and
16
- * {@link module:engine/view/domconverter~DomConverter}. The DOM root clone updates incrementally to stay in sync with the
17
- * source root.
18
- *
19
- * @internal
20
- * @param editor The editor instance the original editing root belongs to.
21
- * @param rootName The name of the root to clone.
22
- * @returns The editing root DOM clone element.
23
- */
24
- export declare function cloneEditingViewDomRoot(editor: Editor, rootName?: string): HTMLElement;
25
- /**
26
- * Harvests all web page styles, for instance, to allow re-using them in an `<iframe>` preserving the look of the content.
27
- *
28
- * The returned data format is as follows:
29
- *
30
- * ```ts
31
- * [
32
- * 'p { color: red; ... } h2 { font-size: 2em; ... } ...',
33
- * '.spacing { padding: 1em; ... }; ...',
34
- * '...',
35
- * { href: 'http://link.to.external.stylesheet' },
36
- * { href: '...' }
37
- * ]
38
- * ```
39
- *
40
- * **Note**: For stylesheets with `href` different than window origin, an object is returned because
41
- * accessing rules of these styles may cause CORS errors (depending on the configuration of the web page).
42
- *
43
- * @internal
44
- */
45
- export declare function getPageStyles(): Array<string | {
46
- href: string;
47
- }>;
48
- /**
49
- * Gets dimensions rectangle according to passed DOM element. Returns whole window's size for `body` element.
50
- *
51
- * @internal
52
- */
53
- export declare function getDomElementRect(domElement: HTMLElement): Rect;
54
- /**
55
- * Gets client height according to passed DOM element. Returns window's height for `body` element.
56
- *
57
- * @internal
58
- */
59
- export declare function getClientHeight(domElement: HTMLElement): number;
60
- /**
61
- * Returns the DOM element itself if it's not a `body` element, whole window otherwise.
62
- *
63
- * @internal
64
- */
65
- export declare function getScrollable(domElement: HTMLElement): Window | HTMLElement;