@innovastudio/contentbox 1.1.1 → 1.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "",
5
5
  "main": "public/contentbox/contentbox.esm.js",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "webpack-dev-server": "^4.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@innovastudio/contentbuilder": "^1.0.81",
41
+ "@innovastudio/contentbuilder": "^1.0.82",
42
42
  "axios": "^0.21.4",
43
43
  "cors": "^2.8.5",
44
44
  "express": "^4.17.1",
@@ -70660,7 +70660,35 @@ class ContentBuilder {
70660
70660
  sPastedText = util.cleanHTML(sPastedText, true);
70661
70661
  }
70662
70662
 
70663
- contentword.innerHTML = sPastedText; // NOTE: paste <h1><p> jadi nempel
70663
+ contentword.innerHTML = sPastedText;
70664
+
70665
+ if (this.opts.paste === 'html') {
70666
+ //with styles
70667
+ let elms = contentword.querySelectorAll('*');
70668
+ Array.prototype.forEach.call(elms, elm => {
70669
+ for (let n = 0; n < elm.attributes.length; n++) {
70670
+ if (elm.attributes[n].name !== 'style') elm.removeAttribute(elm.attributes[n].name);
70671
+ }
70672
+ }); // Extra:
70673
+ // Remove li with white-space: pre;
70674
+
70675
+ elms = contentword.querySelectorAll('li');
70676
+ Array.prototype.forEach.call(elms, elm => {
70677
+ elm.style.whiteSpace = '';
70678
+ });
70679
+ } else {
70680
+ //html-without-styles (default)
70681
+ const removeAttributes = element => {
70682
+ while (element.attributes.length > 0) {
70683
+ element.removeAttribute(element.attributes[0].name);
70684
+ }
70685
+ };
70686
+
70687
+ let elms = contentword.querySelectorAll('*');
70688
+ Array.prototype.forEach.call(elms, elm => {
70689
+ removeAttributes(elm);
70690
+ });
70691
+ } // NOTE: paste <h1><p> jadi nempel
70664
70692
  // NOTE ($editor => contentword)
70665
70693
  // if($editor.children('p,h1,h2,h3,h4,h5,h6,ul,li').length>1){
70666
70694
  // //Fix text that doesn't have paragraph
@@ -70720,6 +70748,7 @@ class ContentBuilder {
70720
70748
  // //jQuery("[class^='Mso']", $editor).removeAttr('class'); //done (see cleanHTML)
70721
70749
  // jQuery('p:empty', $editor).remove();
70722
70750
 
70751
+
70723
70752
  sPastedText = contentword.innerHTML;
70724
70753
  }
70725
70754
  }
@@ -72196,6 +72225,7 @@ class ContentBox {
72196
72225
  undoRedoStyles: true,
72197
72226
  undoContainerOnly: false,
72198
72227
  absolutePath: false,
72228
+ maxEmbedImageWidth: 1600,
72199
72229
  zoom: 0.6,
72200
72230
  contentStyleWithSample: false,
72201
72231
  contentStyles: {
@@ -74283,6 +74313,7 @@ class ContentBox {
74283
74313
  snippetJSON: window.data_basic,
74284
74314
  snippetPathReplace: this.settings.snippetPathReplace,
74285
74315
  maxColumns: 6,
74316
+ maxEmbedImageWidth: this.settings.maxEmbedImageWidth,
74286
74317
  slider: this.settings.slider,
74287
74318
  onRender: this.settings.onRender,
74288
74319
  onChange: this.settings.onChange,