@wizishop/wizi-block 4.2.29-beta → 4.2.32-beta

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,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@ngx-translate/core'), require('uuid'), require('@angular/cdk/drag-drop'), require('@angular/animations'), require('@angular/common/http'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/platform-browser'), require('@ctrl/tinycolor'), require('quill'), require('monaco-editor'), require('ngx-quill'), require('@fortawesome/fontawesome-svg-core'), require('@fortawesome/free-solid-svg-icons'), require('@fortawesome/free-regular-svg-icons'), require('@fortawesome/free-brands-svg-icons'), require('@wizishop/ng-wizi-bulma'), require('ngx-scrollbar'), require('@editorjs/editorjs'), require('@jaames/iro'), require('ngx-monaco-editor'), require('leaflet'), require('places.js'), require('@asymmetrik/ngx-leaflet'), require('ngx-color-picker')) :
3
- typeof define === 'function' && define.amd ? define('@wizishop/wizi-block', ['exports', '@angular/core', 'rxjs', '@ngx-translate/core', 'uuid', '@angular/cdk/drag-drop', '@angular/animations', '@angular/common/http', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/platform-browser', '@ctrl/tinycolor', 'quill', 'monaco-editor', 'ngx-quill', '@fortawesome/fontawesome-svg-core', '@fortawesome/free-solid-svg-icons', '@fortawesome/free-regular-svg-icons', '@fortawesome/free-brands-svg-icons', '@wizishop/ng-wizi-bulma', 'ngx-scrollbar', '@editorjs/editorjs', '@jaames/iro', 'ngx-monaco-editor', 'leaflet', 'places.js', '@asymmetrik/ngx-leaflet', 'ngx-color-picker'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wizishop = global.wizishop || {}, global.wizishop['wizi-block'] = {}), global.ng.core, global.rxjs, global.i1, global['^3']['3']['2'], global.ng.cdk.dragDrop, global.ng.animations, global.ng.common.http, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.platformBrowser, global['^2']['5']['2'], global['^1']['3']['6'], global.monaco, global['^5']['0']['0'], global['^1']['2']['27'], global['^5']['12']['1'], global['^5']['12']['1'], global['^5']['12']['1'], global['^7']['0']['11'], global['^7']['2']['1-beta']['0'], global.EditorJS, global.iro, global['^8']['1']['1'], global['^1']['5']['1'], global['^1']['16']['4'], global['^5']['0']['2'], global['^9']['0']['0']));
5
- }(this, (function (exports, i0, rxjs, i1, uuid, dragDrop, animations, i1$1, operators, common, forms, platformBrowser, tinycolor, QuillNamespace, monaco, ngxQuill, fontawesomeSvgCore, freeSolidSvgIcons, freeRegularSvgIcons, freeBrandsSvgIcons, ngWiziBulma, ngxScrollbar, EditorJS, iro, ngxMonacoEditor, leaflet, places, ngxLeaflet, ngxColorPicker) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@ngx-translate/core'), require('uuid'), require('@angular/cdk/drag-drop'), require('@angular/animations'), require('@angular/common/http'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/platform-browser'), require('@ctrl/tinycolor'), require('quill'), require('monaco-editor'), require('ngx-quill'), require('@fortawesome/fontawesome-svg-core'), require('@fortawesome/free-solid-svg-icons'), require('@fortawesome/free-regular-svg-icons'), require('@fortawesome/free-brands-svg-icons'), require('@wizishop/ng-wizi-bulma'), require('ngx-scrollbar'), require('@editorjs/editorjs'), require('@jaames/iro'), require('codemirror'), require('@codemirror/state'), require('@codemirror/lang-html'), require('ngx-monaco-editor'), require('leaflet'), require('places.js'), require('@asymmetrik/ngx-leaflet'), require('ngx-color-picker')) :
3
+ typeof define === 'function' && define.amd ? define('@wizishop/wizi-block', ['exports', '@angular/core', 'rxjs', '@ngx-translate/core', 'uuid', '@angular/cdk/drag-drop', '@angular/animations', '@angular/common/http', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/platform-browser', '@ctrl/tinycolor', 'quill', 'monaco-editor', 'ngx-quill', '@fortawesome/fontawesome-svg-core', '@fortawesome/free-solid-svg-icons', '@fortawesome/free-regular-svg-icons', '@fortawesome/free-brands-svg-icons', '@wizishop/ng-wizi-bulma', 'ngx-scrollbar', '@editorjs/editorjs', '@jaames/iro', 'codemirror', '@codemirror/state', '@codemirror/lang-html', 'ngx-monaco-editor', 'leaflet', 'places.js', '@asymmetrik/ngx-leaflet', 'ngx-color-picker'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wizishop = global.wizishop || {}, global.wizishop['wizi-block'] = {}), global.ng.core, global.rxjs, global.i1, global['^3']['3']['2'], global.ng.cdk.dragDrop, global.ng.animations, global.ng.common.http, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.platformBrowser, global['^2']['5']['2'], global['^1']['3']['6'], global.monaco, global['^5']['0']['0'], global['^1']['2']['27'], global['^5']['12']['1'], global['^5']['12']['1'], global['^5']['12']['1'], global['^7']['0']['11'], global['^7']['2']['1-beta']['0'], global.EditorJS, global.iro, global.codemirror, global.state, global.langHtml, global['^8']['1']['1'], global['^1']['5']['1'], global['^1']['16']['4'], global['^5']['0']['2'], global['^9']['0']['0']));
5
+ }(this, (function (exports, i0, rxjs, i1, uuid, dragDrop, animations, i1$1, operators, common, forms, platformBrowser, tinycolor, QuillNamespace, monaco, ngxQuill, fontawesomeSvgCore, freeSolidSvgIcons, freeRegularSvgIcons, freeBrandsSvgIcons, ngWiziBulma, ngxScrollbar, EditorJS, iro, codemirror, state, langHtml, ngxMonacoEditor, leaflet, places, ngxLeaflet, ngxColorPicker) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -20444,6 +20444,8 @@
20444
20444
  return [4 /*yield*/, this.saveInlineSelection(container, true)];
20445
20445
  case 1:
20446
20446
  _c.sent();
20447
+ console.log('here');
20448
+ console.log(this.hasStyle(container));
20447
20449
  _c.label = 2;
20448
20450
  case 2:
20449
20451
  _c.trys.push([2, 12, , 13]);
@@ -20457,11 +20459,14 @@
20457
20459
  !this.isContainer(this.textContainers, container) &&
20458
20460
  this.hasStyle(container) &&
20459
20461
  selection.toString() === this.hasStyle(container).innerText)) return [3 /*break*/, 6];
20462
+ console.log('update');
20460
20463
  return [4 /*yield*/, this.updateSelection(selection, this.hasStyle(container), action, this.textContainers)];
20461
20464
  case 5:
20462
20465
  _c.sent();
20463
20466
  return [3 /*break*/, 8];
20464
- case 6: return [4 /*yield*/, this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers)];
20467
+ case 6:
20468
+ console.log('replace');
20469
+ return [4 /*yield*/, this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers)];
20465
20470
  case 7:
20466
20471
  _c.sent();
20467
20472
  _c.label = 8;
@@ -20549,6 +20554,7 @@
20549
20554
  parentContainer === offsetParentContainer &&
20550
20555
  ((parentContainer.children.length > 0 && parentContainer.innerText !== parentContainer.children[0].textContent) ||
20551
20556
  parentContainer.innerText !== selection.toString()))) return [3 /*break*/, 3];
20557
+ console.log('if');
20552
20558
  range = this.getRangeObject(selection);
20553
20559
  currentFragment = range.extractContents();
20554
20560
  currentElement_1 = document.createElement('span');
@@ -20574,6 +20580,8 @@
20574
20580
  currentParentElement = container;
20575
20581
  if (parentContainer.contains(currentParentElement)) {
20576
20582
  while (currentParentElement !== parentContainer) {
20583
+ console.warn('currentParentElement');
20584
+ console.log(currentParentElement);
20577
20585
  tmpElement = document.createElement(currentParentElement.tagName);
20578
20586
  tmpElement = this.setInlineStyle(currentParentElement, tmpElement);
20579
20587
  tmpElement.appendChild(currentElementToAppend);
@@ -20593,9 +20601,13 @@
20593
20601
  newElement.appendChild(preFragment);
20594
20602
  parentContainer.parentElement.insertBefore(currentElementToAppend, parentContainer);
20595
20603
  parentContainer.parentElement.insertBefore(newElement, currentElementToAppend);
20604
+ if (!parentContainer.textContent || parentContainer.textContent.length === 0) {
20605
+ parentContainer.parentElement.removeChild(parentContainer);
20606
+ }
20596
20607
  selection.selectAllChildren(currentElementToAppend);
20597
20608
  return [3 /*break*/, 7];
20598
20609
  case 3:
20610
+ console.log('else');
20599
20611
  range = this.getRangeObject(selection);
20600
20612
  fragment = range.extractContents();
20601
20613
  fragmentElement = document.createElement('div');
@@ -20823,7 +20835,7 @@
20823
20835
  });
20824
20836
  };
20825
20837
  InlineStyleTool.prototype.cleanupContainer = function (selection, container, firstTimeCall) {
20826
- var _a, _b;
20838
+ var _a;
20827
20839
  return __awaiter(this, void 0, void 0, function () {
20828
20840
  var parentContainer, parentFound, children, currentNode, identicalElements, currentElement, nextElement, currentNodeFirstChild;
20829
20841
  return __generator(this, function (_c) {
@@ -20854,10 +20866,6 @@
20854
20866
  _c.label = 1;
20855
20867
  case 1:
20856
20868
  if (!currentNode) return [3 /*break*/, 6];
20857
- console.log('currentNode');
20858
- console.log(currentNode);
20859
- console.log(currentNode.textContent);
20860
- console.log((_b = currentNode.textContent) === null || _b === void 0 ? void 0 : _b.length);
20861
20869
  if (!(!currentNode.textContent || currentNode.textContent.length === 0)) return [3 /*break*/, 2];
20862
20870
  parentContainer.removeChild(currentNode);
20863
20871
  return [3 /*break*/, 5];
@@ -24674,16 +24682,16 @@
24674
24682
  modal.appendChild(editorContainer);
24675
24683
  modal.appendChild(buttonContainer);
24676
24684
  container.appendChild(modal);
24677
- document.querySelector('body').appendChild(container);
24678
- var monacoEditor = monaco.editor.create(editorContainer, {
24679
- value: content,
24680
- language: 'html',
24681
- ariaContainerElement: container
24685
+ document.body.appendChild(container);
24686
+ var state$1 = state.EditorState.create({
24687
+ doc: content,
24688
+ extensions: [codemirror.basicSetup, langHtml.html()],
24689
+ });
24690
+ var view = new codemirror.EditorView({
24691
+ state: state$1,
24692
+ parent: editorContainer,
24682
24693
  });
24683
- saveButton.addEventListener('click', function () {
24684
- var content = monacoEditor.getValue();
24685
- saveCodeEditModal(content);
24686
- }, true);
24694
+ saveButton.addEventListener('click', function () { return saveCodeEditModal(view.state.doc.toString()); }, true);
24687
24695
  buttonContainer.appendChild(saveButton);
24688
24696
  };
24689
24697
  TextEditionTool.prototype.getSavedEditorContent = function (name) {