@wizishop/wizi-block 4.2.0-beta → 4.2.1-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.
Files changed (21) hide show
  1. package/bundles/wizishop-wizi-block.umd.js +49 -17
  2. package/bundles/wizishop-wizi-block.umd.js.map +1 -1
  3. package/bundles/wizishop-wizi-block.umd.min.js +1 -1
  4. package/bundles/wizishop-wizi-block.umd.min.js.map +1 -1
  5. package/esm2015/lib/shared/components/editorjs/editorjs.component.js +4 -1
  6. package/esm2015/lib/shared/components/editorjs/tools/inline/link-tool.component.js +6 -1
  7. package/esm2015/lib/shared/components/editorjs/tools/inline/tool-type/color-tool.component.js +6 -1
  8. package/esm2015/lib/shared/components/editorjs/tools/inline/tool-type/text-tool.component.js +6 -1
  9. package/esm2015/lib/shared/components/editorjs/tools/paragraph/indent-tool.component.js +2 -2
  10. package/esm2015/lib/shared/components/editorjs/tools/paragraph/outdent-tool.component.js +2 -2
  11. package/esm2015/lib/shared/components/editorjs/tools/paragraph/tool-type/text-tool.component.js +6 -1
  12. package/esm2015/lib/shared/components/editorjs/tools/utils/editorjs-conversion.service.js +9 -8
  13. package/esm2015/lib/shared/components/editorjs/tools/utils/editorjs-tool.component.js +9 -1
  14. package/esm2015/lib/shared/components/editorjs/tools/utils/texts.component.js +8 -8
  15. package/esm2015/lib/shared/components/faq/faq.component.js +2 -2
  16. package/fesm2015/wizishop-wizi-block.js +49 -17
  17. package/fesm2015/wizishop-wizi-block.js.map +1 -1
  18. package/lib/shared/components/editorjs/tools/utils/editorjs-conversion.service.d.ts +1 -0
  19. package/package.json +1 -1
  20. package/wizi-block.scss +451 -413
  21. package/wizishop-wizi-block.metadata.json +1 -1
@@ -20252,7 +20252,7 @@
20252
20252
  FaqComponent.decorators = [
20253
20253
  { type: i0.Component, args: [{
20254
20254
  selector: 'wb-faq',
20255
- template: "<div class=\"wb-faq\" [style.background-color]=\"backgroundColor\" [ngClass]=\"{ 'is-active': hasTooltipFocused }\">\n <div\n *ngFor=\"let row of faqRows; let i = index; first as isFirst\"\n [className]=\"type\"\n [class.isFirst]=\"isFirst\"\n [style.border-color]=\"borderColor\"\n >\n <div\n [className]=\"type + '__row wb-faq__row'\"\n [ngClass]=\"{ open: row['open'], 'is-activeRow': row['hasTooltipFocused'] }\"\n [style.background-color]=\"backgroundRowColor\"\n [style.border-color]=\"borderColor\"\n [ngStyle]=\"\n shadowRowColor && row['open']\n ? {\n 'box-shadow':\n '0 0 0 0 ' + shadowRowColor + ', 0 0 0 0 ' + shadowRowColor + ', 0 2px 14px 0 ' + shadowRowColor + ''\n }\n : {}\n \"\n >\n <div\n [className]=\"type + '__row__question wb-faq__row__question open'\"\n [ngClass]=\"{ open: row['open'] }\"\n [style.background-color]=\"row['open'] ? backgroundAnswerColor : backgroundQuestionColor\"\n [style.border-color]=\"borderColor\"\n >\n <wb-editorjs [(content)]=\"row['title']\" (contentChange)=\"persist()\" [placeholder]=\"'wb.dto.TITLE.2' | translate\">\n </wb-editorjs>\n <span (click)=\"deleteRow(i)\" *ngIf=\"i > 0\" [className]=\"type + '__row__question__delete wb-faq__row__question__delete'\">\n <i class=\"fal fa-trash-alt\"></i>\n </span>\n <span (click)=\"showHide(i)\" *ngIf=\"!row['open']\" [style.color]=\"color\">\n <i class=\"fal fa-chevron-down\"></i>\n </span>\n <span (click)=\"showHide(i)\" *ngIf=\"row['open']\" [style.color]=\"color\">\n <i class=\"fal fa-chevron-up\"></i>\n </span>\n </div>\n <div\n [className]=\"type + '__row__answer wb-faq__row__answer open'\"\n [ngClass]=\"{ open: row['open'] }\"\n [style.border-color]=\"borderColor\"\n [style.background-color]=\"backgroundAnswerColor\"\n >\n <wb-editorjs\n [(content)]=\"row[FORM_NAME_CONTENT]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.dto.CONTENT.6' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"wb-faq__menu\">\n <a class=\"wb-faq__menu__add\" (click)=\"addFaqRow()\"><i class=\"fal fa-plus\"></i> {{ 'wb.faq.1' | translate }}</a>\n </div>\n</div>\n"
20255
+ template: "<div class=\"wb-faq\" [style.background-color]=\"backgroundColor\" [ngClass]=\"{ 'is-active': hasTooltipFocused }\">\n <div\n *ngFor=\"let row of faqRows; let i = index; first as isFirst\"\n [className]=\"type\"\n [class.isFirst]=\"isFirst\"\n [style.border-color]=\"borderColor\"\n >\n <div\n [className]=\"type + '__row wb-faq__row'\"\n [ngClass]=\"{ open: row['open'], 'is-activeRow': row['hasTooltipFocused'] }\"\n [style.background-color]=\"backgroundRowColor\"\n [style.border-color]=\"borderColor\"\n [ngStyle]=\"\n shadowRowColor && row['open']\n ? {\n 'box-shadow':\n '0 0 0 0 ' + shadowRowColor + ', 0 0 0 0 ' + shadowRowColor + ', 0 2px 14px 0 ' + shadowRowColor + ''\n }\n : {}\n \"\n >\n <div\n [className]=\"type + '__row__question wb-faq__row__question open'\"\n [ngClass]=\"{ open: row['open'] }\"\n [style.background-color]=\"row['open'] ? backgroundAnswerColor : backgroundQuestionColor\"\n [style.border-color]=\"borderColor\"\n >\n <wb-editorjs [(content)]=\"row[FORM_NAME_TITLE]\" (contentChange)=\"persist()\" [placeholder]=\"'wb.dto.TITLE.2' | translate\">\n </wb-editorjs>\n <span (click)=\"deleteRow(i)\" *ngIf=\"i > 0\" [className]=\"type + '__row__question__delete wb-faq__row__question__delete'\">\n <i class=\"fal fa-trash-alt\"></i>\n </span>\n <span (click)=\"showHide(i)\" *ngIf=\"!row['open']\" [style.color]=\"color\">\n <i class=\"fal fa-chevron-down\"></i>\n </span>\n <span (click)=\"showHide(i)\" *ngIf=\"row['open']\" [style.color]=\"color\">\n <i class=\"fal fa-chevron-up\"></i>\n </span>\n </div>\n <div\n [className]=\"type + '__row__answer wb-faq__row__answer open'\"\n [ngClass]=\"{ open: row['open'] }\"\n [style.border-color]=\"borderColor\"\n [style.background-color]=\"backgroundAnswerColor\"\n >\n <wb-editorjs\n [(content)]=\"row[FORM_NAME_CONTENT]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.dto.CONTENT.6' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"wb-faq__menu\">\n <a class=\"wb-faq__menu__add\" (click)=\"addFaqRow()\"><i class=\"fal fa-plus\"></i> {{ 'wb.faq.1' | translate }}</a>\n </div>\n</div>\n"
20256
20256
  },] }
20257
20257
  ];
20258
20258
  FaqComponent.propDecorators = {
@@ -20345,12 +20345,20 @@
20345
20345
  if (!block.classList.contains('wb-blocks__container--focused')) {
20346
20346
  block.classList.add('wb-blocks__container--focused');
20347
20347
  }
20348
+ var containerToFocus = parentEditor.closest('.column');
20349
+ if (!containerToFocus.classList.contains('editorjs-focused')) {
20350
+ containerToFocus.classList.add('editorjs-focused');
20351
+ }
20348
20352
  }
20349
20353
  function resetBlockFocus(parentEditor) {
20350
20354
  var block = parentEditor.closest('.wb-blocks__container');
20351
20355
  if (block.classList.contains('wb-blocks__container--focused')) {
20352
20356
  block.classList.remove('wb-blocks__container--focused');
20353
20357
  }
20358
+ var containerToFocus = parentEditor.closest('.column');
20359
+ if (containerToFocus.classList.contains('editorjs-focused')) {
20360
+ containerToFocus.classList.remove('editorjs-focused');
20361
+ }
20354
20362
  }
20355
20363
 
20356
20364
  var InlineStyleTool = /** @class */ (function (_super) {
@@ -21966,6 +21974,11 @@
21966
21974
  colorSelection.style.left =
21967
21975
  (this.nodes.button.offsetLeft +
21968
21976
  (this.nodes.button.offsetWidth / 2 - colorSelection.offsetWidth / 2)).toString() + 'px';
21977
+ colorSelection.style.top =
21978
+ '-' +
21979
+ (this.parentEditor.querySelector('.ce-inline-toolbar__buttons').offsetHeight -
21980
+ (this.nodes.button.offsetTop + this.nodes.button.offsetHeight)).toString() +
21981
+ 'px';
21969
21982
  var viewportOffset = colorSelection.getBoundingClientRect();
21970
21983
  var totalWidth = colorSelection.offsetWidth +
21971
21984
  colorSelection.querySelector('.' + this.colorSelectionCss['colorPickerContainer']).offsetWidth;
@@ -22889,6 +22902,11 @@
22889
22902
  this.parentEditor = this.findParentEditor();
22890
22903
  }
22891
22904
  var dropdown = this.parentEditor.querySelectorAll('.' + this.CSS.textSelectionModifier)[0];
22905
+ dropdown.style.top =
22906
+ '-' +
22907
+ (this.parentEditor.querySelector('.ce-inline-toolbar__buttons').offsetHeight -
22908
+ (this.nodes.button.offsetTop + this.nodes.button.offsetHeight)).toString() +
22909
+ 'px';
22892
22910
  this.saveUserSelection();
22893
22911
  if (dropdown) {
22894
22912
  if (dropdown.classList.contains('hidden')) {
@@ -22996,7 +23014,7 @@
22996
23014
  }());
22997
23015
  var TEXT_SIZES = [
22998
23016
  {
22999
- class: 'size-small',
23017
+ class: 'we-size-small',
23000
23018
  name: 'Small',
23001
23019
  },
23002
23020
  {
@@ -23004,11 +23022,11 @@
23004
23022
  name: 'Normal',
23005
23023
  },
23006
23024
  {
23007
- class: 'size-large',
23025
+ class: 'we-size-large',
23008
23026
  name: 'Large',
23009
23027
  },
23010
23028
  {
23011
- class: 'size-huge',
23029
+ class: 'we-size-huge',
23012
23030
  name: 'Huge',
23013
23031
  },
23014
23032
  ];
@@ -23019,19 +23037,19 @@
23019
23037
  }());
23020
23038
  var TEXT_ALIGN = [
23021
23039
  {
23022
- class: 'align-left',
23040
+ class: 'we-align-left',
23023
23041
  name: 'Left',
23024
23042
  },
23025
23043
  {
23026
- class: 'align-center',
23044
+ class: 'we-align-center',
23027
23045
  name: 'Center',
23028
23046
  },
23029
23047
  {
23030
- class: 'align-right',
23048
+ class: 'we-align-right',
23031
23049
  name: 'Right',
23032
23050
  },
23033
23051
  {
23034
- class: 'align-justify',
23052
+ class: 'we-align-justify',
23035
23053
  name: 'Justify',
23036
23054
  },
23037
23055
  ];
@@ -23812,6 +23830,11 @@
23812
23830
  (viewportOffset.left + linkDropdown.offsetWidth - document.body.offsetWidth);
23813
23831
  linkDropdown.style.left = left.toString() + 'px';
23814
23832
  }
23833
+ linkDropdown.style.top =
23834
+ '-' +
23835
+ (this.parentEditor.querySelector('.ce-inline-toolbar__buttons').offsetHeight -
23836
+ (this.nodes.button.offsetTop + this.nodes.button.offsetHeight)).toString() +
23837
+ 'px';
23815
23838
  linkDropdown.classList.remove('hidden');
23816
23839
  this.currentSelection = this.getSelection();
23817
23840
  document.addEventListener('click', function ($event) { return _this.isLinkDropdownFocusedOut($event); });
@@ -23863,7 +23886,7 @@
23863
23886
  button: undefined,
23864
23887
  };
23865
23888
  _this.tag = 'SPAN';
23866
- _this.classes = 'indent-{{input}}';
23889
+ _this.classes = 'we-indent-{{input}}';
23867
23890
  _this.input = 1;
23868
23891
  _this.api = api;
23869
23892
  _this._state = false;
@@ -23947,7 +23970,7 @@
23947
23970
  button: undefined,
23948
23971
  };
23949
23972
  _this.tag = 'SPAN';
23950
- _this.classes = 'indent-{{input}}';
23973
+ _this.classes = 'we-indent-{{input}}';
23951
23974
  _this.input = -1;
23952
23975
  _this.api = api;
23953
23976
  _this._state = false;
@@ -24040,6 +24063,11 @@
24040
24063
  if (dropdown) {
24041
24064
  if (dropdown.classList.contains('hidden')) {
24042
24065
  dropdown.style.left = this.nodes.button.offsetLeft.toString() + 'px';
24066
+ dropdown.style.top =
24067
+ '-' +
24068
+ (this.parentEditor.querySelector('.ce-inline-toolbar__buttons').offsetHeight -
24069
+ (this.nodes.button.offsetTop + this.nodes.button.offsetHeight)).toString() +
24070
+ 'px';
24043
24071
  dropdown.classList.remove('hidden');
24044
24072
  this.currentSelection = this.getSelection();
24045
24073
  document.addEventListener('click', function ($event) { return _this.isDropdownFocusedOut($event); });
@@ -24790,13 +24818,14 @@
24790
24818
  function EditorJSConversionService() {
24791
24819
  this.container = null;
24792
24820
  this.classesToReplace = {
24793
- 'ql-size-small': 'size-small',
24794
- 'ql-size-large': 'size-large',
24795
- 'ql-size-huge': 'size-huge',
24796
- 'ql-align-center': 'align-center',
24797
- 'ql-align-right': 'align-right',
24798
- 'ql-align-justify': 'align-justify',
24799
- 'ql-indent-{input}': 'indent-{input}',
24821
+ 'ql-size-small': 'we-size-small',
24822
+ 'ql-size-large': 'we-size-large',
24823
+ 'ql-size-huge': 'we-size-huge',
24824
+ 'ql-align-left': 'we-align-left',
24825
+ 'ql-align-center': 'we-align-center',
24826
+ 'ql-align-right': 'we-align-right',
24827
+ 'ql-align-justify': 'we-align-justify',
24828
+ 'ql-indent-{input}': 'we-indent-{input}',
24800
24829
  };
24801
24830
  }
24802
24831
  EditorJSConversionService.prototype.convert = function (content) {
@@ -25073,6 +25102,9 @@
25073
25102
  var _this = this;
25074
25103
  var currentEditor = document.querySelectorAll('#editorJs-' + this.uuid)[0];
25075
25104
  var editorBlocks = currentEditor.querySelectorAll('.codex-editor__redactor .ce-paragraph');
25105
+ if (editorBlocks.length === 1 && editorBlocks[0].innerText.length === 0) {
25106
+ return;
25107
+ }
25076
25108
  editorBlocks.forEach(function (block) {
25077
25109
  if (block.childElementCount !== 1 || !_this.hasWrapper(block)) {
25078
25110
  var selection = _this.getSelection();