@ckeditor/ckeditor5-paste-from-office 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.
Files changed (68) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/paste-from-office.js +1 -1
  3. package/dist/index-content.css +2 -2
  4. package/dist/index-editor.css +2 -2
  5. package/dist/index.css +2 -2
  6. package/dist/index.js +10 -10
  7. package/dist/index.js.map +1 -1
  8. package/package.json +26 -6
  9. package/src/augmentation.d.ts +1 -1
  10. package/src/augmentation.js +1 -1
  11. package/src/filters/bookmark.d.ts +1 -1
  12. package/src/filters/bookmark.js +1 -1
  13. package/src/filters/br.d.ts +1 -1
  14. package/src/filters/br.js +1 -1
  15. package/src/filters/image.d.ts +1 -1
  16. package/src/filters/image.js +1 -1
  17. package/src/filters/list.d.ts +1 -1
  18. package/src/filters/list.js +1 -1
  19. package/src/filters/parse.d.ts +1 -1
  20. package/src/filters/parse.js +1 -1
  21. package/src/filters/removeboldwrapper.d.ts +1 -1
  22. package/src/filters/removeboldwrapper.js +1 -1
  23. package/src/filters/removegooglesheetstag.d.ts +1 -1
  24. package/src/filters/removegooglesheetstag.js +1 -1
  25. package/src/filters/removeinvalidtablewidth.d.ts +1 -1
  26. package/src/filters/removeinvalidtablewidth.js +1 -1
  27. package/src/filters/removemsattributes.d.ts +1 -1
  28. package/src/filters/removemsattributes.js +1 -1
  29. package/src/filters/removestyleblock.d.ts +1 -1
  30. package/src/filters/removestyleblock.js +1 -1
  31. package/src/filters/removexmlns.d.ts +1 -1
  32. package/src/filters/removexmlns.js +1 -1
  33. package/src/filters/space.d.ts +1 -1
  34. package/src/filters/space.js +1 -1
  35. package/src/filters/utils.d.ts +1 -1
  36. package/src/filters/utils.js +1 -1
  37. package/src/index.d.ts +1 -1
  38. package/src/index.js +1 -1
  39. package/src/normalizer.d.ts +1 -1
  40. package/src/normalizer.js +1 -1
  41. package/src/normalizers/googledocsnormalizer.d.ts +1 -1
  42. package/src/normalizers/googledocsnormalizer.js +1 -1
  43. package/src/normalizers/googlesheetsnormalizer.d.ts +1 -1
  44. package/src/normalizers/googlesheetsnormalizer.js +1 -1
  45. package/src/normalizers/mswordnormalizer.d.ts +1 -1
  46. package/src/normalizers/mswordnormalizer.js +1 -1
  47. package/src/pastefromoffice.d.ts +1 -1
  48. package/src/pastefromoffice.js +1 -1
  49. package/dist/augmentation.d.ts +0 -14
  50. package/dist/filters/bookmark.d.ts +0 -16
  51. package/dist/filters/br.d.ts +0 -18
  52. package/dist/filters/image.d.ts +0 -28
  53. package/dist/filters/list.d.ts +0 -30
  54. package/dist/filters/parse.d.ts +0 -39
  55. package/dist/filters/removeboldwrapper.d.ts +0 -18
  56. package/dist/filters/removegooglesheetstag.d.ts +0 -18
  57. package/dist/filters/removeinvalidtablewidth.d.ts +0 -18
  58. package/dist/filters/removemsattributes.d.ts +0 -18
  59. package/dist/filters/removestyleblock.d.ts +0 -18
  60. package/dist/filters/removexmlns.d.ts +0 -18
  61. package/dist/filters/space.d.ts +0 -29
  62. package/dist/filters/utils.d.ts +0 -29
  63. package/dist/index.d.ts +0 -16
  64. package/dist/normalizer.d.ts +0 -34
  65. package/dist/normalizers/googledocsnormalizer.d.ts +0 -33
  66. package/dist/normalizers/googlesheetsnormalizer.d.ts +0 -33
  67. package/dist/normalizers/mswordnormalizer.d.ts +0 -31
  68. package/dist/pastefromoffice.d.ts +0 -44
@@ -1,18 +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 paste-from-office/filters/removexmlns
11
- */
12
- import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine.js';
13
- /**
14
- * Removes the `xmlns` attribute from table pasted from Google Sheets.
15
- *
16
- * @param documentFragment element `data.content` obtained from clipboard
17
- */
18
- export default function removeXmlns(documentFragment: ViewDocumentFragment, writer: UpcastWriter): void;
@@ -1,29 +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 paste-from-office/filters/space
11
- */
12
- /**
13
- * Replaces last space preceding elements closing tag with ` `. Such operation prevents spaces from being removed
14
- * during further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDomInlineNodes}).
15
- * This method also takes into account Word specific `<o:p></o:p>` empty tags.
16
- * Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).
17
- *
18
- * @param htmlString HTML string in which spacing should be normalized.
19
- * @returns Input HTML with spaces normalized.
20
- */
21
- export declare function normalizeSpacing(htmlString: string): string;
22
- /**
23
- * Normalizes spacing in special Word `spacerun spans` (`<span style='mso-spacerun:yes'>\s+</span>`) by replacing
24
- * all spaces with `&nbsp; ` pairs. This prevents spaces from being removed during further DOM/View processing
25
- * (see especially {@link module:engine/view/domconverter~DomConverter#_processDomInlineNodes}).
26
- *
27
- * @param htmlDocument Native `Document` object in which spacing should be normalized.
28
- */
29
- export declare function normalizeSpacerunSpans(htmlDocument: Document): void;
@@ -1,29 +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 paste-from-office/filters/utils
11
- */
12
- /**
13
- * Normalizes CSS length value to 'px'.
14
- *
15
- * @internal
16
- */
17
- export declare function convertCssLengthToPx(value: string): string;
18
- /**
19
- * Returns true for value with 'px' unit.
20
- *
21
- * @internal
22
- */
23
- export declare function isPx(value?: string): value is string;
24
- /**
25
- * Returns a rounded 'px' value.
26
- *
27
- * @internal
28
- */
29
- export declare function toPx(value: number): string;
package/dist/index.d.ts DELETED
@@ -1,16 +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 paste-from-office
11
- */
12
- export { default as PasteFromOffice } from './pastefromoffice.js';
13
- export type { Normalizer, NormalizerData } from './normalizer.js';
14
- export { default as MSWordNormalizer } from './normalizers/mswordnormalizer.js';
15
- export { parseHtml } from './filters/parse.js';
16
- import './augmentation.js';
@@ -1,34 +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 paste-from-office/normalizer
11
- */
12
- import type { ClipboardInputTransformationData } from 'ckeditor5/src/clipboard.js';
13
- import type { ParseHtmlResult } from './filters/parse.js';
14
- /**
15
- * Interface defining a content transformation pasted from an external editor.
16
- *
17
- * Normalizers are registered by the {@link module:paste-from-office/pastefromoffice~PasteFromOffice} plugin and run on
18
- * {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation inputTransformation event}.
19
- * They detect environment-specific quirks and transform it into a form compatible with other CKEditor features.
20
- */
21
- export interface Normalizer {
22
- /**
23
- * Must return `true` if the `htmlString` contains content which this normalizer can transform.
24
- */
25
- isActive(htmlString: string): boolean;
26
- /**
27
- * Executes the normalization of a given data.
28
- */
29
- execute(data: NormalizerData): void;
30
- }
31
- export interface NormalizerData extends ClipboardInputTransformationData {
32
- _isTransformedWithPasteFromOffice?: boolean;
33
- _parsedData: ParseHtmlResult;
34
- }
@@ -1,33 +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 paste-from-office/normalizers/googledocsnormalizer
11
- */
12
- import { type ViewDocument } from 'ckeditor5/src/engine.js';
13
- import type { Normalizer, NormalizerData } from '../normalizer.js';
14
- /**
15
- * Normalizer for the content pasted from Google Docs.
16
- */
17
- export default class GoogleDocsNormalizer implements Normalizer {
18
- readonly document: ViewDocument;
19
- /**
20
- * Creates a new `GoogleDocsNormalizer` instance.
21
- *
22
- * @param document View document.
23
- */
24
- constructor(document: ViewDocument);
25
- /**
26
- * @inheritDoc
27
- */
28
- isActive(htmlString: string): boolean;
29
- /**
30
- * @inheritDoc
31
- */
32
- execute(data: NormalizerData): void;
33
- }
@@ -1,33 +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 paste-from-office/normalizers/googlesheetsnormalizer
11
- */
12
- import { type ViewDocument } from 'ckeditor5/src/engine.js';
13
- import type { Normalizer, NormalizerData } from '../normalizer.js';
14
- /**
15
- * Normalizer for the content pasted from Google Sheets.
16
- */
17
- export default class GoogleSheetsNormalizer implements Normalizer {
18
- readonly document: ViewDocument;
19
- /**
20
- * Creates a new `GoogleSheetsNormalizer` instance.
21
- *
22
- * @param document View document.
23
- */
24
- constructor(document: ViewDocument);
25
- /**
26
- * @inheritDoc
27
- */
28
- isActive(htmlString: string): boolean;
29
- /**
30
- * @inheritDoc
31
- */
32
- execute(data: NormalizerData): void;
33
- }
@@ -1,31 +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 ViewDocument } from 'ckeditor5/src/engine.js';
10
- import type { Normalizer, NormalizerData } from '../normalizer.js';
11
- /**
12
- * Normalizer for the content pasted from Microsoft Word.
13
- */
14
- export default class MSWordNormalizer implements Normalizer {
15
- readonly document: ViewDocument;
16
- readonly hasMultiLevelListPlugin: boolean;
17
- /**
18
- * Creates a new `MSWordNormalizer` instance.
19
- *
20
- * @param document View document.
21
- */
22
- constructor(document: ViewDocument, hasMultiLevelListPlugin?: boolean);
23
- /**
24
- * @inheritDoc
25
- */
26
- isActive(htmlString: string): boolean;
27
- /**
28
- * @inheritDoc
29
- */
30
- execute(data: NormalizerData): void;
31
- }
@@ -1,44 +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 paste-from-office/pastefromoffice
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
14
- /**
15
- * The Paste from Office plugin.
16
- *
17
- * This plugin handles content pasted from Office apps and transforms it (if necessary)
18
- * to a valid structure which can then be understood by the editor features.
19
- *
20
- * Transformation is made by a set of predefined {@link module:paste-from-office/normalizer~Normalizer normalizers}.
21
- * This plugin includes following normalizers:
22
- * * {@link module:paste-from-office/normalizers/mswordnormalizer~MSWordNormalizer Microsoft Word normalizer}
23
- * * {@link module:paste-from-office/normalizers/googledocsnormalizer~GoogleDocsNormalizer Google Docs normalizer}
24
- *
25
- * For more information about this feature check the {@glink api/paste-from-office package page}.
26
- */
27
- export default class PasteFromOffice extends Plugin {
28
- /**
29
- * @inheritDoc
30
- */
31
- static get pluginName(): "PasteFromOffice";
32
- /**
33
- * @inheritDoc
34
- */
35
- static get isOfficialPlugin(): true;
36
- /**
37
- * @inheritDoc
38
- */
39
- static get requires(): readonly [typeof ClipboardPipeline];
40
- /**
41
- * @inheritDoc
42
- */
43
- init(): void;
44
- }