@ckeditor/ckeditor5-paste-from-office 40.2.0 → 41.0.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 +1 -1
- package/LICENSE.md +1 -1
- package/build/paste-from-office.js +1 -1
- package/package.json +3 -2
- package/src/augmentation.d.ts +2 -2
- package/src/augmentation.js +1 -1
- package/src/filters/br.d.ts +2 -2
- package/src/filters/br.js +2 -2
- package/src/filters/image.d.ts +2 -2
- package/src/filters/image.js +2 -2
- package/src/filters/list.d.ts +2 -2
- package/src/filters/list.js +2 -2
- package/src/filters/parse.d.ts +2 -2
- package/src/filters/parse.js +3 -3
- package/src/filters/removeboldwrapper.d.ts +2 -2
- package/src/filters/removeboldwrapper.js +1 -1
- package/src/filters/removegooglesheetstag.d.ts +2 -2
- package/src/filters/removegooglesheetstag.js +1 -1
- package/src/filters/removeinvalidtablewidth.d.ts +2 -2
- package/src/filters/removeinvalidtablewidth.js +1 -1
- package/src/filters/removemsattributes.d.ts +2 -2
- package/src/filters/removemsattributes.js +2 -2
- package/src/filters/removestyleblock.d.ts +2 -2
- package/src/filters/removestyleblock.js +1 -1
- package/src/filters/removexmlns.d.ts +2 -2
- package/src/filters/removexmlns.js +1 -1
- package/src/filters/space.d.ts +1 -1
- package/src/filters/space.js +1 -1
- package/src/index.d.ts +6 -6
- package/src/index.js +5 -5
- package/src/normalizer.d.ts +3 -3
- package/src/normalizer.js +1 -1
- package/src/normalizers/googledocsnormalizer.d.ts +3 -3
- package/src/normalizers/googledocsnormalizer.js +5 -5
- package/src/normalizers/googlesheetsnormalizer.d.ts +3 -3
- package/src/normalizers/googlesheetsnormalizer.js +6 -6
- package/src/normalizers/mswordnormalizer.d.ts +3 -3
- package/src/normalizers/mswordnormalizer.js +4 -4
- package/src/pastefromoffice.d.ts +3 -3
- package/src/pastefromoffice.js +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -45,7 +45,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
|
45
45
|
|
|
46
46
|
### Features
|
|
47
47
|
|
|
48
|
-
* Prevent
|
|
48
|
+
* Prevent making entire content pasted from Google Docs bold. Closes [#61](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/61). ([8102de3](https://github.com/ckeditor/ckeditor5-paste-from-office/commit/8102de3))
|
|
49
49
|
* Provide support for pasting lists from Google Docs. Closes [#69](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/69). ([6ad2a62](https://github.com/ckeditor/ckeditor5-paste-from-office/commit/6ad2a62))
|
|
50
50
|
|
|
51
51
|
### Other changes
|
package/LICENSE.md
CHANGED
|
@@ -2,7 +2,7 @@ Software License Agreement
|
|
|
2
2
|
==========================
|
|
3
3
|
|
|
4
4
|
**CKEditor 5 paste from Office feature** – https://github.com/ckeditor/ckeditor5-paste-from-office <br>
|
|
5
|
-
Copyright (c) 2003–
|
|
5
|
+
Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
|
6
6
|
|
|
7
7
|
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
4
|
*/(()=>{var e={945:(e,t,n)=>{e.exports=n(79)("./src/clipboard.js")},704:(e,t,n)=>{e.exports=n(79)("./src/core.js")},492:(e,t,n)=>{e.exports=n(79)("./src/engine.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{MSWordNormalizer:()=>d,PasteFromOffice:()=>C,parseHtml:()=>x});var e=n(704),t=n(945),s=n(492);function i(e,t){if(!e.childCount)return;const n=new s.UpcastWriter(e.document),r=function(e,t){const n=t.createRangeIn(e),r=new s.Matcher({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),i=[];for(const e of n)if("elementStart"===e.type&&r.match(e.item)){const t=l(e.item);i.push({element:e.item,id:t.id,order:t.order,indent:t.indent})}return i}(e,n);if(!r.length)return;let i=null,a=1;r.forEach(((e,l)=>{const u=function(e,t){if(!e)return!0;if(e.id!==t.id)return t.indent-e.indent!=1;const n=t.element.previousSibling;if(!n)return!0;return r=n,!(r.is("element","ol")||r.is("element","ul"));var r}(r[l-1],e),m=u?null:r[l-1],f=(p=e,(d=m)?p.indent-d.indent:p.indent-1);var d,p;if(u&&(i=null,a=1),!i||0!==f){const r=function(e,t){const n=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),r=/mso-level-number-format:([^;]{0,100});/gi,s=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,i=n.exec(t);let c="decimal",l="ol",a=null;if(i&&i[1]){const t=r.exec(i[1]);if(t&&t[1]&&(c=t[1].trim(),l="bullet"!==c&&"image"!==c?"ol":"ul"),"bullet"===c){const t=function(e){const t=function(e){if(e.getChild(0).is("$text"))return null;for(const t of e.getChildren()){if(!t.is("element","span"))continue;const e=t.getChild(0);if(e)return e.is("$text")?e:e.getChild(0)}return null}(e);if(!t)return null;const n=t._data;if("o"===n)return"circle";if("·"===n)return"disc";if("§"===n)return"square";return null}(e.element);t&&(c=t)}else{const e=s.exec(i[1]);e&&e[1]&&(a=parseInt(e[1]))}}return{type:l,startIndex:a,style:o(c)}}(e,t);if(i){if(e.indent>a){const e=i.getChild(i.childCount-1),t=e.getChild(e.childCount-1);i=c(r,t,n),a+=1}else if(e.indent<a){const t=a-e.indent;i=function(e,t){const n=e.getAncestors({parentFirst:!0});let r=null,s=0;for(const e of n)if((e.is("element","ul")||e.is("element","ol"))&&s++,s===t){r=e;break}return r}(i,t),a=e.indent}}else i=c(r,e.element,n);e.indent<=a&&(i.is("element",r.type)||(i=n.rename(r.type,i)))}const g=function(e,t){return function(e,t){const n=new s.Matcher({name:"span",styles:{"mso-list":"Ignore"}}),r=t.createRangeIn(e);for(const e of r)"elementStart"===e.type&&n.match(e.item)&&t.remove(e.item)}(e,t),t.removeStyle("text-indent",e),t.rename("li",e)}(e.element,n);n.appendChild(g,i)}))}function o(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function c(e,t,n){const r=t.parent,s=n.createElement(e.type),i=r.getChildIndex(t)+1;return n.insertChild(i,s,r),e.style&&n.setStyle("list-style-type",e.style,s),e.startIndex&&e.startIndex>1&&n.setAttribute("start",e.startIndex,s),s}function l(e){const t={},n=e.getStyle("mso-list");if(n){const e=n.match(/(^|\s{1,100})l(\d+)/i),r=n.match(/\s{0,100}lfo(\d+)/i),s=n.match(/\s{0,100}level(\d+)/i);e&&r&&s&&(t.id=e[2],t.order=r[1],t.indent=parseInt(s[1]))}return t}function a(e,t){if(!e.childCount)return;const n=new s.UpcastWriter(e.document),r=function(e,t){const n=t.createRangeIn(e),r=new s.Matcher({name:/v:(.+)/}),i=[];for(const e of n){if("elementStart"!=e.type)continue;const t=e.item,n=t.previousSibling,s=n&&n.is("element")?n.name:null;r.match(t)&&t.getAttribute("o:gfxdata")&&"v:shapetype"!==s&&i.push(e.item.getAttribute("id"))}return i}(e,n);!function(e,t,n){const r=n.createRangeIn(t),i=new s.Matcher({name:"img"}),o=[];for(const t of r)if(t.item.is("element")&&i.match(t.item)){const n=t.item,r=n.getAttribute("v:shapes")?n.getAttribute("v:shapes").split(" "):[];r.length&&r.every((t=>e.indexOf(t)>-1))?o.push(n):n.getAttribute("src")||o.push(n)}for(const e of o)n.remove(e)}(r,e,n),function(e,t,n){const r=n.createRangeIn(t),s=[];for(const t of r)if("elementStart"==t.type&&t.item.is("element","v:shape")){const n=t.item.getAttribute("id");if(e.includes(n))continue;i(t.item.parent.getChildren(),n)||s.push(t.item)}for(const e of s){const t={src:o(e)};e.hasAttribute("alt")&&(t.alt=e.getAttribute("alt"));const r=n.createElement("img",t);n.insertChild(e.index+1,r,e.parent)}function i(e,t){for(const n of e)if(n.is("element")){if("img"==n.name&&n.getAttribute("v:shapes")==t)return!0;if(i(n.getChildren(),t))return!0}return!1}function o(e){for(const t of e.getChildren())if(t.is("element")&&t.getAttribute("src"))return t.getAttribute("src")}}(r,e,n),function(e,t){const n=t.createRangeIn(e),r=new s.Matcher({name:/v:(.+)/}),i=[];for(const e of n)"elementStart"==e.type&&r.match(e.item)&&i.push(e.item);for(const e of i)t.remove(e)}(e,n);const i=function(e,t){const n=t.createRangeIn(e),r=new s.Matcher({name:"img"}),i=[];for(const e of n)e.item.is("element")&&r.match(e.item)&&e.item.getAttribute("src").startsWith("file://")&&i.push(e.item);return i}(e,n);i.length&&function(e,t,n){if(e.length===t.length)for(let r=0;r<e.length;r++){const s=`data:${t[r].type};base64,${u(t[r].hex)}`;n.setAttribute("src",s,e[r])}}(i,function(e){if(!e)return[];const t=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+t.source+"))([\\da-fA-F\\s]+)\\}","g"),r=e.match(n),s=[];if(r)for(const e of r){let n=!1;e.includes("\\pngblip")?n="image/png":e.includes("\\jpegblip")&&(n="image/jpeg"),n&&s.push({hex:e.replace(t,"").replace(/[^\da-fA-F]/g,""),type:n})}return s}(t),n)}function u(e){return btoa(e.match(/\w{2}/g).map((e=>String.fromCharCode(parseInt(e,16)))).join(""))}const m=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,f=/xmlns:o="urn:schemas-microsoft-com/i;class d{constructor(e){this.document=e}isActive(e){return m.test(e)||f.test(e)}execute(e){const{body:t,stylesString:n}=e._parsedData;i(t,n),a(t,e.dataTransfer.getData("text/rtf")),function(e){const t=[],n=new s.UpcastWriter(e.document);for(const{item:r}of n.createRangeIn(e))if(r.is("element")){for(const e of r.getClassNames())/\bmso/gi.exec(e)&&n.removeClass(e,r);for(const e of r.getStyleNames())/\bmso/gi.exec(e)&&n.removeStyle(e,r);r.is("element","w:sdt")&&t.push(r)}for(const e of t){const t=e.parent,r=t.getChildIndex(e);n.insertChild(r,e.getChildren(),t),n.remove(e)}}(t),e.content=t}}function p(e,t,n,{blockElements:r,inlineObjectElements:s}){let i=n.createPositionAt(e,"forward"==t?"after":"before");return i=i.getLastMatchingPosition((({item:e})=>e.is("element")&&!r.includes(e.name)&&!s.includes(e.name)),{direction:t}),"forward"==t?i.nodeAfter:i.nodeBefore}function g(e,t){return!!e&&e.is("element")&&t.includes(e.name)}const h=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class b{constructor(e){this.document=e}isActive(e){return h.test(e)}execute(e){const t=new s.UpcastWriter(this.document),{body:n}=e._parsedData;!function(e,t){for(const n of e.getChildren())if(n.is("element","b")&&"normal"===n.getStyle("font-weight")){const r=e.getChildIndex(n);t.remove(n),t.insertChild(r,n.getChildren(),e)}}(n,t),function(e,t){for(const n of t.createRangeIn(e)){const e=n.item;if(e.is("element","li")){const n=e.getChild(0);n&&n.is("element","p")&&t.unwrapElement(n)}}}(n,t),function(e,t){const n=new s.ViewDocument(t.document.stylesProcessor),r=new s.DomConverter(n,{renderingMode:"data"}),i=r.blockElements,o=r.inlineObjectElements,c=[];for(const n of t.createRangeIn(e)){const e=n.item;if(e.is("element","br")){const n=p(e,"forward",t,{blockElements:i,inlineObjectElements:o}),r=p(e,"backward",t,{blockElements:i,inlineObjectElements:o}),s=g(n,i);(g(r,i)||s)&&c.push(e)}}for(const e of c)e.hasClass("Apple-interchange-newline")?t.remove(e):t.replace(e,t.createElement("p"))}(n,t),e.content=n}}const y=/<google-sheets-html-origin/i;class v{constructor(e){this.document=e}isActive(e){return y.test(e)}execute(e){const t=new s.UpcastWriter(this.document),{body:n}=e._parsedData;!function(e,t){for(const n of e.getChildren())if(n.is("element","google-sheets-html-origin")){const r=e.getChildIndex(n);t.remove(n),t.insertChild(r,n.getChildren(),e)}}(n,t),function(e,t){for(const n of e.getChildren())n.is("element","table")&&n.hasAttribute("xmlns")&&t.removeAttribute("xmlns",n)}(n,t),function(e,t){for(const n of e.getChildren())n.is("element","table")&&"0px"===n.getStyle("width")&&t.removeStyle("width",n)}(n,t),function(e,t){for(const n of Array.from(e.getChildren()))n.is("element","style")&&t.remove(n)}(n,t),e.content=n}}function w(e){return e.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,((e,t)=>1===t.length?" ":Array(t.length+1).join(" ").substr(0,t.length)))}function x(e,t){const n=new DOMParser,r=function(e){return w(w(e)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/(<span\s+style=['"]letter-spacing:[^'"]+?['"]>)[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}(function(e){const t="</body>",n="</html>",r=e.indexOf(t);if(r<0)return e;const s=e.indexOf(n,r+t.length);return e.substring(0,r+t.length)+(s>=0?e.substring(s):"")}(e=(e=e.replace(/<!--\[if gte vml 1]>/g,"")).replace(/<o:SmartTagType(?:\s+[^\s>=]+(?:="[^"]*")?)*\s*\/?>/gi,""))),i=n.parseFromString(r,"text/html");!function(e){e.querySelectorAll("span[style*=spacerun]").forEach((e=>{const t=e,n=t.innerText.length||0;t.innerText=Array(n+1).join(" ").substr(0,n)}))}(i);const o=i.body.innerHTML,c=function(e,t){const n=new s.ViewDocument(t),r=new s.DomConverter(n,{renderingMode:"data"}),i=e.createDocumentFragment(),o=e.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return r.domToView(i,{skipComments:!0})}(i,t),l=function(e){const t=[],n=[],r=Array.from(e.getElementsByTagName("style"));for(const e of r)e.sheet&&e.sheet.cssRules&&e.sheet.cssRules.length&&(t.push(e.sheet),n.push(e.innerHTML));return{styles:t,stylesString:n.join(" ")}}(i);return{body:c,bodyString:o,styles:l.styles,stylesString:l.stylesString}}class C extends e.Plugin{static get pluginName(){return"PasteFromOffice"}static get requires(){return[t.ClipboardPipeline]}init(){const e=this.editor,t=e.plugins.get("ClipboardPipeline"),n=e.editing.view.document,r=[];r.push(new d(n)),r.push(new b(n)),r.push(new v(n)),t.on("inputTransformation",((t,s)=>{if(s._isTransformedWithPasteFromOffice)return;if(e.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const i=s.dataTransfer.getData("text/html"),o=r.find((e=>e.isActive(i)));o&&(s._parsedData||(s._parsedData=x(i,n.stylesProcessor)),o.execute(s),s._isTransformedWithPasteFromOffice=!0)}),{priority:"high"})}}})(),(window.CKEditor5=window.CKEditor5||{}).pasteFromOffice=r})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-paste-from-office",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "41.0.0",
|
|
4
4
|
"description": "Paste from Office feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
"ckeditor5-plugin",
|
|
11
11
|
"ckeditor5-dll"
|
|
12
12
|
],
|
|
13
|
+
"type": "module",
|
|
13
14
|
"main": "src/index.js",
|
|
14
15
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "
|
|
16
|
+
"ckeditor5": "41.0.0"
|
|
16
17
|
},
|
|
17
18
|
"author": "CKSource (http://cksource.com/)",
|
|
18
19
|
"license": "GPL-2.0-or-later",
|
package/src/augmentation.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import type { PasteFromOffice } from './index';
|
|
5
|
+
import type { PasteFromOffice } from './index.js';
|
|
6
6
|
declare module '@ckeditor/ckeditor5-core' {
|
|
7
7
|
interface PluginsMap {
|
|
8
8
|
[PasteFromOffice.pluginName]: PasteFromOffice;
|
package/src/augmentation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
package/src/filters/br.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/br
|
|
7
7
|
*/
|
|
8
|
-
import { type UpcastWriter, type ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import { type UpcastWriter, type ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Transforms `<br>` elements that are siblings to some block element into a paragraphs.
|
|
11
11
|
*
|
package/src/filters/br.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/br
|
|
7
7
|
*/
|
|
8
|
-
import { DomConverter, ViewDocument } from 'ckeditor5/src/engine';
|
|
8
|
+
import { DomConverter, ViewDocument } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Transforms `<br>` elements that are siblings to some block element into a paragraphs.
|
|
11
11
|
*
|
package/src/filters/image.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/image
|
|
7
7
|
*/
|
|
8
|
-
import { type ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import { type ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Replaces source attribute of all `<img>` elements representing regular
|
|
11
11
|
* images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data.
|
package/src/filters/image.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/image
|
|
7
7
|
*/
|
|
8
8
|
/* globals btoa */
|
|
9
|
-
import { Matcher, UpcastWriter } from 'ckeditor5/src/engine';
|
|
9
|
+
import { Matcher, UpcastWriter } from 'ckeditor5/src/engine.js';
|
|
10
10
|
/**
|
|
11
11
|
* Replaces source attribute of all `<img>` elements representing regular
|
|
12
12
|
* images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data.
|
package/src/filters/list.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/list
|
|
7
7
|
*/
|
|
8
|
-
import { UpcastWriter, type ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import { UpcastWriter, type ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Transforms Word specific list-like elements to the semantic HTML lists.
|
|
11
11
|
*
|
package/src/filters/list.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/list
|
|
7
7
|
*/
|
|
8
|
-
import { Matcher, UpcastWriter } from 'ckeditor5/src/engine';
|
|
8
|
+
import { Matcher, UpcastWriter } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Transforms Word specific list-like elements to the semantic HTML lists.
|
|
11
11
|
*
|
package/src/filters/parse.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/parse
|
|
7
7
|
*/
|
|
8
|
-
import { type StylesProcessor, type ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import { type StylesProcessor, type ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Parses the provided HTML extracting contents of `<body>` and `<style>` tags.
|
|
11
11
|
*
|
package/src/filters/parse.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/parse
|
|
7
7
|
*/
|
|
8
8
|
/* globals DOMParser */
|
|
9
|
-
import { DomConverter, ViewDocument } from 'ckeditor5/src/engine';
|
|
10
|
-
import { normalizeSpacing, normalizeSpacerunSpans } from './space';
|
|
9
|
+
import { DomConverter, ViewDocument } from 'ckeditor5/src/engine.js';
|
|
10
|
+
import { normalizeSpacing, normalizeSpacerunSpans } from './space.js';
|
|
11
11
|
/**
|
|
12
12
|
* Parses the provided HTML extracting contents of `<body>` and `<style>` tags.
|
|
13
13
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/removeboldwrapper
|
|
7
7
|
*/
|
|
8
|
-
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Removes the `<b>` tag wrapper added by Google Docs to a copied content.
|
|
11
11
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/removegooglesheetstag
|
|
7
7
|
*/
|
|
8
|
-
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Removes the `<google-sheets-html-origin>` tag wrapper added by Google Sheets to a copied content.
|
|
11
11
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/removeinvalidtablewidth
|
|
7
7
|
*/
|
|
8
|
-
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Removes the `width:0px` style from table pasted from Google Sheets.
|
|
11
11
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/removemsattributes
|
|
7
7
|
*/
|
|
8
|
-
import { type ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import { type ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Cleanup MS attributes like styles, attributes and elements.
|
|
11
11
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/removemsattributes
|
|
7
7
|
*/
|
|
8
|
-
import { UpcastWriter } from 'ckeditor5/src/engine';
|
|
8
|
+
import { UpcastWriter } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Cleanup MS attributes like styles, attributes and elements.
|
|
11
11
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/removestyleblock
|
|
7
7
|
*/
|
|
8
|
-
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Removes `<style>` block added by Google Sheets to a copied content.
|
|
11
11
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/filters/removexmlns
|
|
7
7
|
*/
|
|
8
|
-
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine';
|
|
8
|
+
import type { UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Removes the `xmlns` attribute from table pasted from Google Sheets.
|
|
11
11
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/filters/space.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/filters/space.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office
|
|
7
7
|
*/
|
|
8
|
-
export { default as PasteFromOffice } from './pastefromoffice';
|
|
9
|
-
export { Normalizer, type NormalizerData } from './normalizer';
|
|
10
|
-
export { default as MSWordNormalizer } from './normalizers/mswordnormalizer';
|
|
11
|
-
export { parseHtml } from './filters/parse';
|
|
12
|
-
import './augmentation';
|
|
8
|
+
export { default as PasteFromOffice } from './pastefromoffice.js';
|
|
9
|
+
export { Normalizer, type NormalizerData } from './normalizer.js';
|
|
10
|
+
export { default as MSWordNormalizer } from './normalizers/mswordnormalizer.js';
|
|
11
|
+
export { parseHtml } from './filters/parse.js';
|
|
12
|
+
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office
|
|
7
7
|
*/
|
|
8
|
-
export { default as PasteFromOffice } from './pastefromoffice';
|
|
9
|
-
export { default as MSWordNormalizer } from './normalizers/mswordnormalizer';
|
|
10
|
-
export { parseHtml } from './filters/parse';
|
|
11
|
-
import './augmentation';
|
|
8
|
+
export { default as PasteFromOffice } from './pastefromoffice.js';
|
|
9
|
+
export { default as MSWordNormalizer } from './normalizers/mswordnormalizer.js';
|
|
10
|
+
export { parseHtml } from './filters/parse.js';
|
|
11
|
+
import './augmentation.js';
|
package/src/normalizer.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/normalizer
|
|
7
7
|
*/
|
|
8
|
-
import type { ClipboardInputTransformationData } from 'ckeditor5/src/clipboard';
|
|
9
|
-
import type { ParseHtmlResult } from './filters/parse';
|
|
8
|
+
import type { ClipboardInputTransformationData } from 'ckeditor5/src/clipboard.js';
|
|
9
|
+
import type { ParseHtmlResult } from './filters/parse.js';
|
|
10
10
|
/**
|
|
11
11
|
* Interface defining a content transformation pasted from an external editor.
|
|
12
12
|
*
|
package/src/normalizer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/normalizers/googledocsnormalizer
|
|
7
7
|
*/
|
|
8
|
-
import { type ViewDocument } from 'ckeditor5/src/engine';
|
|
9
|
-
import type { Normalizer, NormalizerData } from '../normalizer';
|
|
8
|
+
import { type ViewDocument } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import type { Normalizer, NormalizerData } from '../normalizer.js';
|
|
10
10
|
/**
|
|
11
11
|
* Normalizer for the content pasted from Google Docs.
|
|
12
12
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/normalizers/googledocsnormalizer
|
|
7
7
|
*/
|
|
8
|
-
import { UpcastWriter } from 'ckeditor5/src/engine';
|
|
9
|
-
import removeBoldWrapper from '../filters/removeboldwrapper';
|
|
10
|
-
import transformBlockBrsToParagraphs from '../filters/br';
|
|
11
|
-
import { unwrapParagraphInListItem } from '../filters/list';
|
|
8
|
+
import { UpcastWriter } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import removeBoldWrapper from '../filters/removeboldwrapper.js';
|
|
10
|
+
import transformBlockBrsToParagraphs from '../filters/br.js';
|
|
11
|
+
import { unwrapParagraphInListItem } from '../filters/list.js';
|
|
12
12
|
const googleDocsMatch = /id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;
|
|
13
13
|
/**
|
|
14
14
|
* Normalizer for the content pasted from Google Docs.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/normalizers/googlesheetsnormalizer
|
|
7
7
|
*/
|
|
8
|
-
import { type ViewDocument } from 'ckeditor5/src/engine';
|
|
9
|
-
import type { Normalizer, NormalizerData } from '../normalizer';
|
|
8
|
+
import { type ViewDocument } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import type { Normalizer, NormalizerData } from '../normalizer.js';
|
|
10
10
|
/**
|
|
11
11
|
* Normalizer for the content pasted from Google Sheets.
|
|
12
12
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/normalizers/googlesheetsnormalizer
|
|
7
7
|
*/
|
|
8
|
-
import { UpcastWriter } from 'ckeditor5/src/engine';
|
|
9
|
-
import removeXmlns from '../filters/removexmlns';
|
|
10
|
-
import removeGoogleSheetsTag from '../filters/removegooglesheetstag';
|
|
11
|
-
import removeInvalidTableWidth from '../filters/removeinvalidtablewidth';
|
|
12
|
-
import removeStyleBlock from '../filters/removestyleblock';
|
|
8
|
+
import { UpcastWriter } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import removeXmlns from '../filters/removexmlns.js';
|
|
10
|
+
import removeGoogleSheetsTag from '../filters/removegooglesheetstag.js';
|
|
11
|
+
import removeInvalidTableWidth from '../filters/removeinvalidtablewidth.js';
|
|
12
|
+
import removeStyleBlock from '../filters/removestyleblock.js';
|
|
13
13
|
const googleSheetsMatch = /<google-sheets-html-origin/i;
|
|
14
14
|
/**
|
|
15
15
|
* Normalizer for the content pasted from Google Sheets.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import type { ViewDocument } from 'ckeditor5/src/engine';
|
|
6
|
-
import type { Normalizer, NormalizerData } from '../normalizer';
|
|
5
|
+
import type { ViewDocument } from 'ckeditor5/src/engine.js';
|
|
6
|
+
import type { Normalizer, NormalizerData } from '../normalizer.js';
|
|
7
7
|
/**
|
|
8
8
|
* Normalizer for the content pasted from Microsoft Word.
|
|
9
9
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/normalizers/mswordnormalizer
|
|
7
7
|
*/
|
|
8
|
-
import { transformListItemLikeElementsIntoLists } from '../filters/list';
|
|
9
|
-
import { replaceImagesSourceWithBase64 } from '../filters/image';
|
|
10
|
-
import removeMSAttributes from '../filters/removemsattributes';
|
|
8
|
+
import { transformListItemLikeElementsIntoLists } from '../filters/list.js';
|
|
9
|
+
import { replaceImagesSourceWithBase64 } from '../filters/image.js';
|
|
10
|
+
import removeMSAttributes from '../filters/removemsattributes.js';
|
|
11
11
|
const msWordMatch1 = /<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i;
|
|
12
12
|
const msWordMatch2 = /xmlns:o="urn:schemas-microsoft-com/i;
|
|
13
13
|
/**
|
package/src/pastefromoffice.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/pastefromoffice
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { ClipboardPipeline } from 'ckeditor5/src/clipboard';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
|
|
10
10
|
/**
|
|
11
11
|
* The Paste from Office plugin.
|
|
12
12
|
*
|
package/src/pastefromoffice.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @module paste-from-office/pastefromoffice
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { ClipboardPipeline } from 'ckeditor5/src/clipboard';
|
|
10
|
-
import MSWordNormalizer from './normalizers/mswordnormalizer';
|
|
11
|
-
import GoogleDocsNormalizer from './normalizers/googledocsnormalizer';
|
|
12
|
-
import GoogleSheetsNormalizer from './normalizers/googlesheetsnormalizer';
|
|
13
|
-
import { parseHtml } from './filters/parse';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
|
|
10
|
+
import MSWordNormalizer from './normalizers/mswordnormalizer.js';
|
|
11
|
+
import GoogleDocsNormalizer from './normalizers/googledocsnormalizer.js';
|
|
12
|
+
import GoogleSheetsNormalizer from './normalizers/googlesheetsnormalizer.js';
|
|
13
|
+
import { parseHtml } from './filters/parse.js';
|
|
14
14
|
/**
|
|
15
15
|
* The Paste from Office plugin.
|
|
16
16
|
*
|