@ckeditor/ckeditor5-clipboard 41.3.0-alpha.4 → 41.3.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.
Files changed (100) hide show
  1. package/lang/translations/es-co.po +30 -0
  2. package/package.json +6 -7
  3. package/dist/content-index.css +0 -4
  4. package/dist/editor-index.css +0 -23
  5. package/dist/index.css +0 -42
  6. package/dist/index.css.map +0 -1
  7. package/dist/translations/ar.d.ts +0 -8
  8. package/dist/translations/ar.js +0 -5
  9. package/dist/translations/bg.d.ts +0 -8
  10. package/dist/translations/bg.js +0 -5
  11. package/dist/translations/bn.d.ts +0 -8
  12. package/dist/translations/bn.js +0 -5
  13. package/dist/translations/ca.d.ts +0 -8
  14. package/dist/translations/ca.js +0 -5
  15. package/dist/translations/cs.d.ts +0 -8
  16. package/dist/translations/cs.js +0 -5
  17. package/dist/translations/da.d.ts +0 -8
  18. package/dist/translations/da.js +0 -5
  19. package/dist/translations/de.d.ts +0 -8
  20. package/dist/translations/de.js +0 -5
  21. package/dist/translations/el.d.ts +0 -8
  22. package/dist/translations/el.js +0 -5
  23. package/dist/translations/en.d.ts +0 -8
  24. package/dist/translations/en.js +0 -5
  25. package/dist/translations/es.d.ts +0 -8
  26. package/dist/translations/es.js +0 -5
  27. package/dist/translations/et.d.ts +0 -8
  28. package/dist/translations/et.js +0 -5
  29. package/dist/translations/fi.d.ts +0 -8
  30. package/dist/translations/fi.js +0 -5
  31. package/dist/translations/fr.d.ts +0 -8
  32. package/dist/translations/fr.js +0 -5
  33. package/dist/translations/he.d.ts +0 -8
  34. package/dist/translations/he.js +0 -5
  35. package/dist/translations/hi.d.ts +0 -8
  36. package/dist/translations/hi.js +0 -5
  37. package/dist/translations/hr.d.ts +0 -8
  38. package/dist/translations/hr.js +0 -5
  39. package/dist/translations/hu.d.ts +0 -8
  40. package/dist/translations/hu.js +0 -5
  41. package/dist/translations/id.d.ts +0 -8
  42. package/dist/translations/id.js +0 -5
  43. package/dist/translations/it.d.ts +0 -8
  44. package/dist/translations/it.js +0 -5
  45. package/dist/translations/ja.d.ts +0 -8
  46. package/dist/translations/ja.js +0 -5
  47. package/dist/translations/ko.d.ts +0 -8
  48. package/dist/translations/ko.js +0 -5
  49. package/dist/translations/lt.d.ts +0 -8
  50. package/dist/translations/lt.js +0 -5
  51. package/dist/translations/lv.d.ts +0 -8
  52. package/dist/translations/lv.js +0 -5
  53. package/dist/translations/ms.d.ts +0 -8
  54. package/dist/translations/ms.js +0 -5
  55. package/dist/translations/nl.d.ts +0 -8
  56. package/dist/translations/nl.js +0 -5
  57. package/dist/translations/no.d.ts +0 -8
  58. package/dist/translations/no.js +0 -5
  59. package/dist/translations/pl.d.ts +0 -8
  60. package/dist/translations/pl.js +0 -5
  61. package/dist/translations/pt-br.d.ts +0 -8
  62. package/dist/translations/pt-br.js +0 -5
  63. package/dist/translations/pt.d.ts +0 -8
  64. package/dist/translations/pt.js +0 -5
  65. package/dist/translations/ro.d.ts +0 -8
  66. package/dist/translations/ro.js +0 -5
  67. package/dist/translations/ru.d.ts +0 -8
  68. package/dist/translations/ru.js +0 -5
  69. package/dist/translations/sk.d.ts +0 -8
  70. package/dist/translations/sk.js +0 -5
  71. package/dist/translations/sr.d.ts +0 -8
  72. package/dist/translations/sr.js +0 -5
  73. package/dist/translations/sv.d.ts +0 -8
  74. package/dist/translations/sv.js +0 -5
  75. package/dist/translations/th.d.ts +0 -8
  76. package/dist/translations/th.js +0 -5
  77. package/dist/translations/tr.d.ts +0 -8
  78. package/dist/translations/tr.js +0 -5
  79. package/dist/translations/uk.d.ts +0 -8
  80. package/dist/translations/uk.js +0 -5
  81. package/dist/translations/vi.d.ts +0 -8
  82. package/dist/translations/vi.js +0 -5
  83. package/dist/translations/zh-cn.d.ts +0 -8
  84. package/dist/translations/zh-cn.js +0 -5
  85. package/dist/translations/zh.d.ts +0 -8
  86. package/dist/translations/zh.js +0 -5
  87. package/dist/types/augmentation.d.ts +0 -20
  88. package/dist/types/clipboard.d.ts +0 -40
  89. package/dist/types/clipboardmarkersutils.d.ts +0 -204
  90. package/dist/types/clipboardobserver.d.ts +0 -316
  91. package/dist/types/clipboardpipeline.d.ts +0 -269
  92. package/dist/types/dragdrop.d.ts +0 -106
  93. package/dist/types/dragdropblocktoolbar.d.ts +0 -51
  94. package/dist/types/dragdroptarget.d.ts +0 -98
  95. package/dist/types/index.d.ts +0 -21
  96. package/dist/types/lineview.d.ts +0 -49
  97. package/dist/types/pasteplaintext.d.ts +0 -32
  98. package/dist/types/utils/normalizeclipboarddata.d.ts +0 -19
  99. package/dist/types/utils/plaintexttohtml.d.ts +0 -18
  100. package/dist/types/utils/viewtoplaintext.d.ts +0 -19
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"pt-br":{"dictionary":{"Copy selected content":"Copiar conteúdo selecionado","Paste content":"Colar conteúdo","Paste content as plain text":"Colar conteúdo como texto simples"},getPluralForm(n){return (n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"pt":{"dictionary":{"Copy selected content":"Copiar o conteúdo selecionado","Paste content":"Colar o conteúdo","Paste content as plain text":"Colar o conteúdo como texto sem formatação"},getPluralForm(n){return (n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"ro":{"dictionary":{"Copy selected content":"Copiază conținutul selectat","Paste content":"Lipește conținut","Paste content as plain text":"Lipește conținutul ca text simplu"},getPluralForm(n){return (n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"ru":{"dictionary":{"Copy selected content":"Копировать выбранное содержание","Paste content":"Вставить содержание","Paste content as plain text":"Вставить содержанрие в виде обычного текста"},getPluralForm(n){return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"sk":{"dictionary":{"Copy selected content":"Skopírovať vybraný obsah","Paste content":"Prilepiť obsah","Paste content as plain text":"Prilepiť obsah iba ako text"},getPluralForm(n){return (n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"sr":{"dictionary":{"Copy selected content":"Kopiraj odabrani sadržaj","Paste content":"Nalepi sadržaj","Paste content as plain text":"Nalepi sadržaj kao običan tekst"},getPluralForm(n){return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"sv":{"dictionary":{"Copy selected content":"Kopiera markerat innehåll","Paste content":"Klistra in innehåll","Paste content as plain text":"Klistra in innehåll som vanlig text"},getPluralForm(n){return (n != 1);}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"th":{"dictionary":{"Copy selected content":"คัดลอกเนื้อหาที่เลือกเอาไว้","Paste content":"วางเนื้อหา","Paste content as plain text":"วางเนื้อหาเป็นข้อความธรรมดา"},getPluralForm(n){return 0;}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"tr":{"dictionary":{"Copy selected content":"Seçilen içeriği kopyala","Paste content":"İçeriği yapıştır","Paste content as plain text":"İçeriği düz metin olarak yapıştır"},getPluralForm(n){return (n > 1);}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"uk":{"dictionary":{"Copy selected content":"Копіювати вибраний вміст","Paste content":"Вставити вміст","Paste content as plain text":"Вставити вміст як простий текст"},getPluralForm(n){return (n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"vi":{"dictionary":{"Copy selected content":"Sao chép nội dung đã chọn","Paste content":"Dán nội dung","Paste content as plain text":"Dán nội dung dưới dạng văn bản thuần túy"},getPluralForm(n){return 0;}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"zh-cn":{"dictionary":{"Copy selected content":"复制选定的内容","Paste content":"粘贴内容","Paste content as plain text":"将内容粘贴为纯文本"},getPluralForm(n){return 0;}}}
@@ -1,8 +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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +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
- export default {"zh":{"dictionary":{"Copy selected content":"複製所選內容","Paste content":"貼上內容","Paste content as plain text":"將內容貼上為純文字"},getPluralForm(n){return 0;}}}
@@ -1,20 +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-oss-license
8
- */
9
- import type { Clipboard, ClipboardPipeline, PastePlainText, DragDrop, DragDropTarget, DragDropBlockToolbar, ClipboardMarkersUtils } from './index.js';
10
- declare module '@ckeditor/ckeditor5-core' {
11
- interface PluginsMap {
12
- [Clipboard.pluginName]: Clipboard;
13
- [ClipboardPipeline.pluginName]: ClipboardPipeline;
14
- [ClipboardMarkersUtils.pluginName]: ClipboardMarkersUtils;
15
- [PastePlainText.pluginName]: PastePlainText;
16
- [DragDrop.pluginName]: DragDrop;
17
- [DragDropTarget.pluginName]: DragDropTarget;
18
- [DragDropBlockToolbar.pluginName]: DragDropBlockToolbar;
19
- }
20
- }
@@ -1,40 +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-oss-license
8
- */
9
- /**
10
- * @module clipboard/clipboard
11
- */
12
- import { Plugin } from '@ckeditor/ckeditor5-core';
13
- import ClipboardPipeline from './clipboardpipeline.js';
14
- import DragDrop from './dragdrop.js';
15
- import PastePlainText from './pasteplaintext.js';
16
- import ClipboardMarkersUtils from './clipboardmarkersutils.js';
17
- /**
18
- * The clipboard feature.
19
- *
20
- * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.
21
- *
22
- * This is a "glue" plugin which loads the following plugins:
23
- * * {@link module:clipboard/clipboardpipeline~ClipboardPipeline}
24
- * * {@link module:clipboard/dragdrop~DragDrop}
25
- * * {@link module:clipboard/pasteplaintext~PastePlainText}
26
- */
27
- export default class Clipboard extends Plugin {
28
- /**
29
- * @inheritDoc
30
- */
31
- static get pluginName(): "Clipboard";
32
- /**
33
- * @inheritDoc
34
- */
35
- static get requires(): readonly [typeof ClipboardMarkersUtils, typeof ClipboardPipeline, typeof DragDrop, typeof PastePlainText];
36
- /**
37
- * @inheritDoc
38
- */
39
- init(): void;
40
- }
@@ -1,204 +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-oss-license
8
- */
9
- import { Plugin, type NonEmptyArray } from '@ckeditor/ckeditor5-core';
10
- import { Range, type DocumentFragment, type Element, type DocumentSelection, type Selection, type Writer } from '@ckeditor/ckeditor5-engine';
11
- /**
12
- * Part of the clipboard logic. Responsible for collecting markers from selected fragments
13
- * and restoring them with proper positions in pasted elements.
14
- *
15
- * @internal
16
- */
17
- export default class ClipboardMarkersUtils extends Plugin {
18
- /**
19
- * Map of marker names that can be copied.
20
- *
21
- * @internal
22
- */
23
- private _markersToCopy;
24
- /**
25
- * @inheritDoc
26
- */
27
- static get pluginName(): "ClipboardMarkersUtils";
28
- /**
29
- * Registers marker name as copyable in clipboard pipeline.
30
- *
31
- * @param markerName Name of marker that can be copied.
32
- * @param config Configuration that describes what can be performed on specified marker.
33
- * @internal
34
- */
35
- _registerMarkerToCopy(markerName: string, config: ClipboardMarkerConfiguration): void;
36
- /**
37
- * Performs copy markers on provided selection and paste it to fragment returned from `getCopiedFragment`.
38
- *
39
- * 1. Picks all markers in provided selection.
40
- * 2. Inserts fake markers to document.
41
- * 3. Gets copied selection fragment from document.
42
- * 4. Removes fake elements from fragment and document.
43
- * 5. Inserts markers in the place of removed fake markers.
44
- *
45
- * Due to selection modification, when inserting items, `getCopiedFragment` must *always* operate on `writer.model.document.selection'.
46
- * Do not use any other custom selection object within callback, as this will lead to out-of-bounds exceptions in rare scenarios.
47
- *
48
- * @param action Type of clipboard action.
49
- * @param writer An instance of the model writer.
50
- * @param selection Selection to be checked.
51
- * @param getCopiedFragment Callback that performs copy of selection and returns it as fragment.
52
- * @internal
53
- */
54
- _copySelectedFragmentWithMarkers(action: ClipboardMarkerRestrictedAction, selection: Selection | DocumentSelection, getCopiedFragment?: (writer: Writer) => DocumentFragment): DocumentFragment;
55
- /**
56
- * Performs paste of markers on already pasted element.
57
- *
58
- * 1. Inserts fake markers that are present in fragment element (such fragment will be processed in `getPastedDocumentElement`).
59
- * 2. Calls `getPastedDocumentElement` and gets element that is inserted into root model.
60
- * 3. Removes all fake markers present in transformed element.
61
- * 4. Inserts new markers with removed fake markers ranges into pasted fragment.
62
- *
63
- * There are multiple edge cases that have to be considered before calling this function:
64
- *
65
- * * `markers` are inserted into the same element that must be later transformed inside `getPastedDocumentElement`.
66
- * * Fake marker elements inside `getPastedDocumentElement` can be cloned, but their ranges cannot overlap.
67
- * * If `duplicateOnPaste` is `true` in marker config then associated marker ID is regenerated before pasting.
68
- *
69
- * @param action Type of clipboard action.
70
- * @param markers Object that maps marker name to corresponding range.
71
- * @param getPastedDocumentElement Getter used to get target markers element.
72
- * @internal
73
- */
74
- _pasteMarkersIntoTransformedElement(markers: Record<string, Range> | Map<string, Range>, getPastedDocumentElement: (writer: Writer) => Element): Element;
75
- /**
76
- * Pastes document fragment with markers to document.
77
- * If `duplicateOnPaste` is `true` in marker config then associated markers IDs
78
- * are regenerated before pasting to avoid markers duplications in content.
79
- *
80
- * @param fragment Document fragment that should contain already processed by pipeline markers.
81
- * @internal
82
- */
83
- _pasteFragmentWithMarkers(fragment: DocumentFragment): Range;
84
- /**
85
- * In some situations we have to perform copy on selected fragment with certain markers. This function allows to temporarily bypass
86
- * restrictions on markers that we want to copy.
87
- *
88
- * This function executes `executor()` callback. For the duration of the callback, if the clipboard pipeline is used to copy
89
- * content, markers with the specified name will be copied to the clipboard as well.
90
- *
91
- * @param markerName Which markers should be copied.
92
- * @param executor Callback executed.
93
- * @param config Optional configuration flags used to copy (such like partial copy flag).
94
- * @internal
95
- */
96
- _forceMarkersCopy(markerName: string, executor: VoidFunction, config?: ClipboardMarkerConfiguration): void;
97
- /**
98
- * Checks if marker can be copied.
99
- *
100
- * @param markerName Name of checked marker.
101
- * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.
102
- * @internal
103
- */
104
- _isMarkerCopyable(markerName: string, action: ClipboardMarkerRestrictedAction | null): boolean;
105
- /**
106
- * Checks if marker has any clipboard copy behavior configuration.
107
- *
108
- * @param markerName Name of checked marker.
109
- */
110
- _hasMarkerConfiguration(markerName: string): boolean;
111
- /**
112
- * Returns marker's configuration flags passed during registration.
113
- *
114
- * @param markerName Name of marker that should be returned.
115
- * @internal
116
- */
117
- _getMarkerClipboardConfig(markerName: string): ClipboardMarkerConfiguration | null;
118
- /**
119
- * First step of copying markers. It looks for markers intersecting with given selection and inserts `$marker` elements
120
- * at positions where document markers start or end. This way `$marker` elements can be easily copied together with
121
- * the rest of the content of the selection.
122
- *
123
- * @param writer An instance of the model writer.
124
- * @param selection Selection to be checked.
125
- * @param action Type of clipboard action.
126
- */
127
- private _insertFakeMarkersIntoSelection;
128
- /**
129
- * Returns array of markers that can be copied in specified selection.
130
- *
131
- * If marker cannot be copied partially (according to `copyPartiallySelected` configuration flag) and
132
- * is not present entirely in any selection range then it will be skipped.
133
- *
134
- * @param writer An instance of the model writer.
135
- * @param selection Selection which will be checked.
136
- * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.
137
- */
138
- private _getCopyableMarkersFromSelection;
139
- /**
140
- * Picks all markers from markers map that can be pasted.
141
- * If `duplicateOnPaste` is `true`, it regenerates their IDs to ensure uniqueness.
142
- * If marker is not registered, it will be kept in the array anyway.
143
- *
144
- * @param markers Object that maps marker name to corresponding range.
145
- * @param action Type of clipboard action. If null then checks only if marker is registered as copyable.
146
- */
147
- private _getPasteMarkersFromRangeMap;
148
- /**
149
- * Inserts specified array of fake markers elements to document and assigns them `type` and `name` attributes.
150
- * Fake markers elements are used to calculate position of markers on pasted fragment that were transformed during
151
- * steps between copy and paste.
152
- *
153
- * @param writer An instance of the model writer.
154
- * @param markers Array of markers that will be inserted.
155
- */
156
- private _insertFakeMarkersElements;
157
- /**
158
- * Removes all `$marker` elements from the given document fragment.
159
- *
160
- * Returns an object where keys are marker names, and values are ranges corresponding to positions
161
- * where `$marker` elements were inserted.
162
- *
163
- * If the document fragment had only one `$marker` element for given marker (start or end) the other boundary is set automatically
164
- * (to the end or start of the document fragment, respectively).
165
- *
166
- * @param writer An instance of the model writer.
167
- * @param rootElement The element to be checked.
168
- */
169
- private _removeFakeMarkersInsideElement;
170
- /**
171
- * Returns array that contains list of fake markers with corresponding `$marker` elements.
172
- *
173
- * For each marker, there can be two `$marker` elements or only one (if the document fragment contained
174
- * only the beginning or only the end of a marker).
175
- *
176
- * @param writer An instance of the model writer.
177
- * @param rootElement The element to be checked.
178
- */
179
- private _getAllFakeMarkersFromElement;
180
- /**
181
- * When copy of markers occurs we have to make sure that pasted markers have different names
182
- * than source markers. This functions helps with assigning unique part to marker name to
183
- * prevent duplicated markers error.
184
- *
185
- * @param name Name of marker
186
- */
187
- private _getUniqueMarkerName;
188
- }
189
- /**
190
- * Specifies which action is performed during clipboard event.
191
- *
192
- * @internal
193
- */
194
- export type ClipboardMarkerRestrictedAction = 'copy' | 'cut' | 'dragstart';
195
- /**
196
- * Specifies behavior of markers during clipboard actions.
197
- *
198
- * @internal
199
- */
200
- export type ClipboardMarkerConfiguration = {
201
- allowedActions: NonEmptyArray<ClipboardMarkerRestrictedAction> | 'all';
202
- copyPartiallySelected?: boolean;
203
- duplicateOnPaste?: boolean;
204
- };