@wizishop/wizi-block 3.3.15 → 3.3.16

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.
@@ -8874,7 +8874,7 @@
8874
8874
  this.selectedConfig = null;
8875
8875
  this.components = null;
8876
8876
  this.translation = null;
8877
- this.isHiddenConfig = false;
8877
+ this.isHiddenConfig = [];
8878
8878
  this.unsubscribe = new rxjs.Subject();
8879
8879
  this.currentTopTool = 0;
8880
8880
  this.toolUnpin = false;
@@ -9042,13 +9042,17 @@
9042
9042
  };
9043
9043
  WiziBlockComponent.prototype.changeConfigWiziblocks = function (event) {
9044
9044
  var e_1, _a;
9045
+ var _this = this;
9045
9046
  this.selectedConfig = event.config;
9046
9047
  if (typeof this.selectedConfig.forms !== typeof undefined) {
9047
9048
  try {
9048
9049
  for (var _b = __values(this.selectedConfig.forms), _c = _b.next(); !_c.done; _c = _b.next()) {
9049
9050
  var item = _c.value;
9050
- if (item.id === 'hide_block') {
9051
- this.isHiddenConfig = item.value;
9051
+ if (item.id === 'hide_block' && item.value && !this.isHiddenConfig.includes(this.selectedConfig.block.uuid)) {
9052
+ this.isHiddenConfig.push(this.selectedConfig.block.uuid);
9053
+ }
9054
+ else if (item.id === 'hide_block' && !item.value && this.isHiddenConfig.includes(this.selectedConfig.block.uuid)) {
9055
+ this.isHiddenConfig = this.isHiddenConfig.filter(function (e) { return e !== _this.selectedConfig.block.uuid; });
9052
9056
  }
9053
9057
  }
9054
9058
  }
@@ -9060,7 +9064,6 @@
9060
9064
  finally { if (e_1) throw e_1.error; }
9061
9065
  }
9062
9066
  }
9063
- console.log(this.isHiddenConfig);
9064
9067
  };
9065
9068
  WiziBlockComponent.prototype.ngOnDestroy = function () {
9066
9069
  this.wiziBlockService._blocksService = [];
@@ -9710,7 +9713,7 @@
9710
9713
  StructureToolsComponent.decorators = [
9711
9714
  { type: i0.Component, args: [{
9712
9715
  selector: 'wb-structure-tools',
9713
- template: "<div class=\"wb-structure-tools\" [ngClass]=\"{ hidden: blockIsHidden || dynamicHiddenStructure }\">\n <div>\n <div class=\"wb-structure-tools__move\" *ngIf=\"currentLength > 1\">\n <div>\n <a\n [nwbToolTip]=\"'wb.shared.components.structureTools.1' | translate\"\n nwbToolTipPosition=\"bottom\"\n class=\"button is-rounded is-tooltip-info\"\n (click)=\"$event.stopPropagation()\"\n ><i class=\"fas fa-th\"></i\n ></a>\n <a\n [nwbToolTip]=\"'wb.shared.components.structureTools.2' | translate\"\n nwbToolTipPosition=\"bottom\"\n class=\"button is-rounded is-tooltip-info\"\n *ngIf=\"currentIndex + 1 !== currentLength\"\n (click)=\"goDown($event)\"\n ><i class=\"fal fa-arrow-down\"></i\n ></a>\n <a\n [nwbToolTip]=\"'wb.shared.components.structureTools.3' | translate\"\n nwbToolTipPosition=\"bottom\"\n class=\"button is-rounded is-tooltip-info\"\n *ngIf=\"currentIndex !== 0\"\n (click)=\"goUp($event)\"\n ><i class=\"fal fa-arrow-up\"></i\n ></a>\n </div>\n </div>\n <div class=\"wb-structure-tools__edit\">\n <div>\n <!--<i class=\"fas fa-eye-slash\" *ngIf=\"blockIsHidden || dynamicHiddenStructure\"></i>-->\n <p>{{ name | translate }}</p>\n <div>\n <a\n href\n class=\"button is-rounded is-tooltip-info\"\n [nwbToolTip]=\"'wb.shared.components.structureTools.4' | translate\"\n nwbToolTipPosition=\"bottom\"\n (click)=\"configThis($event)\"\n *ngIf=\"!hideConfig\"\n ><span></span><i class=\"fas fa-cog\"></i\n ></a>\n <a\n href\n class=\"button is-rounded is-tooltip-link\"\n [nwbToolTip]=\"'wb.shared.components.structureTools.5' | translate\"\n nwbToolTipPosition=\"bottom\"\n (click)=\"duplicateThis($event)\"\n ><span></span><i class=\"far fa-paste\"></i\n ></a>\n <a\n #deleteButton\n class=\"button is-rounded is-tooltip-danger\"\n [nwbToolTip]=\"'wb.shared.components.structureTools.6' | translate\"\n nwbToolTipPosition=\"bottom\"\n wbHoldable\n (mousedown)=\"deleteButton.hold = true\"\n (mouseup)=\"deleteButton.hold = false\"\n (holdTime)=\"removeThis($event)\"\n [ngClass]=\"{ 'is-on-hold': deleteButton.hold }\"\n ><span></span><i class=\"fas fa-trash\"></i\n ></a>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
9716
+ template: "<div class=\"wb-structure-tools\" [ngClass]=\"{ hidden: blockIsHidden || dynamicHiddenStructure }\">\n <div>\n <div class=\"wb-structure-tools__move\" *ngIf=\"currentLength > 1\">\n <div>\n <a\n [nwbToolTip]=\"'wb.shared.components.structureTools.1' | translate\"\n nwbToolTipPosition=\"bottom\"\n class=\"button is-rounded is-tooltip-info\"\n (click)=\"$event.stopPropagation()\"\n ><i class=\"fas fa-th\"></i\n ></a>\n <a\n [nwbToolTip]=\"'wb.shared.components.structureTools.2' | translate\"\n nwbToolTipPosition=\"bottom\"\n class=\"button is-rounded is-tooltip-info\"\n *ngIf=\"currentIndex + 1 !== currentLength\"\n (click)=\"goDown($event)\"\n ><i class=\"fal fa-arrow-down\"></i\n ></a>\n <a\n [nwbToolTip]=\"'wb.shared.components.structureTools.3' | translate\"\n nwbToolTipPosition=\"bottom\"\n class=\"button is-rounded is-tooltip-info\"\n *ngIf=\"currentIndex !== 0\"\n (click)=\"goUp($event)\"\n ><i class=\"fal fa-arrow-up\"></i\n ></a>\n </div>\n </div>\n <div class=\"wb-structure-tools__edit\">\n <div>\n <i class=\"fas fa-eye-slash\" *ngIf=\"blockIsHidden || dynamicHiddenStructure\"></i>\n <p>{{ name | translate }}</p>\n <div>\n <a\n href\n class=\"button is-rounded is-tooltip-info\"\n [nwbToolTip]=\"'wb.shared.components.structureTools.4' | translate\"\n nwbToolTipPosition=\"bottom\"\n (click)=\"configThis($event)\"\n *ngIf=\"!hideConfig\"\n ><span></span><i class=\"fas fa-cog\"></i\n ></a>\n <a\n href\n class=\"button is-rounded is-tooltip-link\"\n [nwbToolTip]=\"'wb.shared.components.structureTools.5' | translate\"\n nwbToolTipPosition=\"bottom\"\n (click)=\"duplicateThis($event)\"\n ><span></span><i class=\"far fa-paste\"></i\n ></a>\n <a\n #deleteButton\n class=\"button is-rounded is-tooltip-danger\"\n [nwbToolTip]=\"'wb.shared.components.structureTools.6' | translate\"\n nwbToolTipPosition=\"bottom\"\n wbHoldable\n (mousedown)=\"deleteButton.hold = true\"\n (mouseup)=\"deleteButton.hold = false\"\n (holdTime)=\"removeThis($event)\"\n [ngClass]=\"{ 'is-on-hold': deleteButton.hold }\"\n ><span></span><i class=\"fas fa-trash\"></i\n ></a>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
9714
9717
  },] }
9715
9718
  ];
9716
9719
  StructureToolsComponent.ctorParameters = function () { return [
@@ -26564,7 +26567,7 @@
26564
26567
  this.configService = configService;
26565
26568
  this.externalConfigService = externalConfigService;
26566
26569
  this.contents = [];
26567
- this.dynamicHidden = false;
26570
+ this.dynamicHidden = [];
26568
26571
  this.hideConfig = false;
26569
26572
  this.parsedContent = [];
26570
26573
  }
@@ -26641,6 +26644,12 @@
26641
26644
  }
26642
26645
  });
26643
26646
  };
26647
+ BlocksComponent.prototype.isHiddenBLocks = function (id) {
26648
+ if (this.dynamicHidden.includes(id)) {
26649
+ return true;
26650
+ }
26651
+ return false;
26652
+ };
26644
26653
  BlocksComponent.prototype.onDrop = function (event) {
26645
26654
  if (event.item.element.nativeElement.getAttribute('id')) {
26646
26655
  this.addThis(event.currentIndex, event.item.element.nativeElement.getAttribute('id'));
@@ -26654,7 +26663,7 @@
26654
26663
  BlocksComponent.decorators = [
26655
26664
  { type: i0.Component, args: [{
26656
26665
  selector: 'wb-blocks',
26657
- template: "<div\n class=\"wb-blocks\"\n cdkDropList\n (cdkDropListDropped)=\"onDrop($event)\"\n id=\"block-content\"\n *ngIf=\"contents.length > 0\"\n [@animateListFromLeft]=\"contents.length\"\n>\n <a\n class=\"button is-hidden-button is-danger is-rounded is-tooltip-info\"\n [ngClass]=\"{ 'is-danger': hideConfig, 'is-dark is-outlined': !hideConfig }\"\n (click)=\"setHideConfig()\"\n [nwbToolTip]=\"(!hideConfig ? 'wb.blocks.html.1' : 'wb.blocks.html.2') | translate\"\n nwbToolTipPosition=\"left\"\n ><i class=\"fal fa-eye\" *ngIf=\"!hideConfig\"></i><i class=\"fal fa-eye-slash\" *ngIf=\"hideConfig\"></i\n ></a>\n <wb-previews [contents]=\"parsedContent\" *ngIf=\"preview && hideConfig\"></wb-previews>\n <div class=\"wb-blocks__container\" *ngFor=\"let content of contents\" cdkDrag>\n <div class=\"wb-component\" [ngClass]=\"{ 'is-inactive': hideConfig }\">\n <wb-structure-tools [dynamicHiddenStructure]=\"dynamicHidden\" [uuid]=\"content.block.uuid\" cdkDragHandle></wb-structure-tools>\n <div class=\"wb-component__container\">\n <wb-container-block [content]=\"content\"></wb-container-block>\n </div>\n </div>\n </div>\n</div>\n<div class=\"wb-blocks-empty\" *ngIf=\"contents.length === 0\">\n <img src=\"assets/blocks/images/icons/Icon_Drag.svg\" />\n <p>{{ translation.select_component | translate }}</p>\n <p>{{ translation.doc_component | translate }}</p>\n</div>\n",
26666
+ template: "<div\n class=\"wb-blocks\"\n cdkDropList\n (cdkDropListDropped)=\"onDrop($event)\"\n id=\"block-content\"\n *ngIf=\"contents.length > 0\"\n [@animateListFromLeft]=\"contents.length\"\n>\n <a\n class=\"button is-hidden-button is-danger is-rounded is-tooltip-info\"\n [ngClass]=\"{ 'is-danger': hideConfig, 'is-dark is-outlined': !hideConfig }\"\n (click)=\"setHideConfig()\"\n [nwbToolTip]=\"(!hideConfig ? 'wb.blocks.html.1' : 'wb.blocks.html.2') | translate\"\n nwbToolTipPosition=\"left\"\n ><i class=\"fal fa-eye\" *ngIf=\"!hideConfig\"></i><i class=\"fal fa-eye-slash\" *ngIf=\"hideConfig\"></i\n ></a>\n <wb-previews [contents]=\"parsedContent\" *ngIf=\"preview && hideConfig\"></wb-previews>\n <div class=\"wb-blocks__container\" *ngFor=\"let content of contents\" cdkDrag>\n <div class=\"wb-component\" [ngClass]=\"{ 'is-inactive': hideConfig, 'border-grey': isHiddenBLocks(content.block.uuid) }\">\n <wb-structure-tools\n [dynamicHiddenStructure]=\"isHiddenBLocks(content.block.uuid)\"\n [uuid]=\"content.block.uuid\"\n cdkDragHandle\n ></wb-structure-tools>\n <div class=\"wb-component__container\">\n <wb-container-block [content]=\"content\"></wb-container-block>\n </div>\n </div>\n </div>\n</div>\n<div class=\"wb-blocks-empty\" *ngIf=\"contents.length === 0\">\n <img src=\"assets/blocks/images/icons/Icon_Drag.svg\" />\n <p>{{ translation.select_component | translate }}</p>\n <p>{{ translation.doc_component | translate }}</p>\n</div>\n",
26658
26667
  animations: [animateListFromLeft('100ms ease-in-out')]
26659
26668
  },] }
26660
26669
  ];