@brndts/brndts-ads 1.11.0 → 1.11.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/dist/index.js CHANGED
@@ -70362,6 +70362,7 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70362
70362
  PrebidGAMEventsInstance.onSlotRenderEnd(function(event) {
70363
70363
  var slot = event.slot;
70364
70364
  if ("".concat(_this.workingSlotId) === event.slot.getSlotElementId()) {
70365
+ var _this_content_extra_sz, _this_content_extra_sz1;
70365
70366
  if (!_this.content.extra) {
70366
70367
  _this.content.extra = {};
70367
70368
  }
@@ -70371,6 +70372,10 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70371
70372
  if (slot.getTargeting("hb_bidder").length) {
70372
70373
  _this.content.extra.bidder = slot.getTargeting("hb_bidder")[0];
70373
70374
  }
70375
+ _this.content.extra.sz = {
70376
+ w: event.size[0] || ((_this_content_extra_sz = _this.content.extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) || 0,
70377
+ h: event.size[1] || ((_this_content_extra_sz1 = _this.content.extra.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) || 0
70378
+ };
70374
70379
  _this.content.pending = false;
70375
70380
  _this.fullfill();
70376
70381
  }
@@ -71111,20 +71116,26 @@ var RegionBorderPlugin = /*#__PURE__*/ function() {
71111
71116
  {
71112
71117
  key: "afterShow",
71113
71118
  value: function afterShow(region) {
71119
+ var styles2 = window.getComputedStyle(region.content.view);
71120
+ var width = parseFloat(styles2.width);
71121
+ var height = parseFloat(styles2.height);
71114
71122
  region.view.style.width = "".concat(region.boxWidth + 4, "px");
71115
71123
  region.view.style.height = "".concat(region.boxHeight + 4, "px");
71116
- region.content.view.style.width = "".concat(region.boxWidth + 4, "px");
71117
- region.content.view.style.height = "".concat(region.boxHeight + 4, "px");
71124
+ region.content.view.style.width = "".concat(width + 4, "px");
71125
+ region.content.view.style.height = "".concat(height + 4, "px");
71118
71126
  return Promise.resolve();
71119
71127
  }
71120
71128
  },
71121
71129
  {
71122
71130
  key: "reRender",
71123
71131
  value: function reRender(region) {
71132
+ var styles2 = window.getComputedStyle(region.content.view);
71133
+ var width = parseFloat(styles2.width);
71134
+ var height = parseFloat(styles2.height);
71124
71135
  region.view.style.width = "".concat(region.boxWidth + 4, "px");
71125
71136
  region.view.style.height = "".concat(region.boxHeight + 4, "px");
71126
- region.content.view.style.width = "".concat(region.boxWidth + 4, "px");
71127
- region.content.view.style.height = "".concat(region.boxHeight + 4, "px");
71137
+ region.content.view.style.width = "".concat(width + 4, "px");
71138
+ region.content.view.style.height = "".concat(height + 4, "px");
71128
71139
  return Promise.resolve();
71129
71140
  }
71130
71141
  },
@@ -71655,6 +71666,46 @@ var Region = /*#__PURE__*/ function() {
71655
71666
  return Region;
71656
71667
  }();
71657
71668
  // src/Ads/Regions/StaticAdRegion.ts
71669
+ var StaticRegionContent = /*#__PURE__*/ function(RegionContent) {
71670
+ _inherits(StaticRegionContent, RegionContent);
71671
+ function StaticRegionContent(id, plane, box, ctx) {
71672
+ _class_call_check(this, StaticRegionContent);
71673
+ var _this;
71674
+ _this = _call_super(this, StaticRegionContent, [
71675
+ id,
71676
+ plane,
71677
+ box,
71678
+ ctx
71679
+ ]);
71680
+ _this.container.style.left = "50%";
71681
+ _this.container.style.top = "50%";
71682
+ _this.container.style.transform = "translate(-50%, -50%)";
71683
+ return _this;
71684
+ }
71685
+ _create_class(StaticRegionContent, [
71686
+ {
71687
+ key: "render",
71688
+ value: function render(force) {
71689
+ var _this = this;
71690
+ var _this_content, _this_content_extra_sz, _this_content_extra, _this_content1, _this_content_extra_sz1, _this_content_extra1, _this_content2;
71691
+ if ((_this_content = this.content) === null || _this_content === void 0 ? void 0 : _this_content.pending) {
71692
+ return;
71693
+ }
71694
+ this.container.style.width = "".concat((_this_content1 = this.content) === null || _this_content1 === void 0 ? void 0 : (_this_content_extra = _this_content1.extra) === null || _this_content_extra === void 0 ? void 0 : (_this_content_extra_sz = _this_content_extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w, "px");
71695
+ this.container.style.height = "".concat((_this_content2 = this.content) === null || _this_content2 === void 0 ? void 0 : (_this_content_extra1 = _this_content2.extra) === null || _this_content_extra1 === void 0 ? void 0 : (_this_content_extra_sz1 = _this_content_extra1.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h, "px");
71696
+ this.container.dataset.state = this.box.area(this.plane.size) > 0 ? "visible" : "hidden";
71697
+ this.container.childNodes.forEach(function(node) {
71698
+ if (_instanceof(node, HTMLElement)) {
71699
+ var _this_content_extra_sz, _this_content_extra, _this_content, _this_content_extra_sz1, _this_content_extra1, _this_content1;
71700
+ node.style.width = "".concat((_this_content = _this.content) === null || _this_content === void 0 ? void 0 : (_this_content_extra = _this_content.extra) === null || _this_content_extra === void 0 ? void 0 : (_this_content_extra_sz = _this_content_extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w, "px");
71701
+ node.style.height = "".concat((_this_content1 = _this.content) === null || _this_content1 === void 0 ? void 0 : (_this_content_extra1 = _this_content1.extra) === null || _this_content_extra1 === void 0 ? void 0 : (_this_content_extra_sz1 = _this_content_extra1.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h, "px");
71702
+ }
71703
+ });
71704
+ }
71705
+ }
71706
+ ]);
71707
+ return StaticRegionContent;
71708
+ }(RegionContent);
71658
71709
  var StaticAdRegion = /*#__PURE__*/ function(Region) {
71659
71710
  _inherits(StaticAdRegion, Region);
71660
71711
  function StaticAdRegion(id, planeDescriptor, options, deps) {
@@ -71677,6 +71728,9 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
71677
71728
  deps
71678
71729
  ]);
71679
71730
  _this.requestWithSize = true;
71731
+ _this.content.view.remove();
71732
+ _this.content = new StaticRegionContent(_this.id, _this.plane, _this.box, _this.deps.debug ? _this.regionDescriptor.ctx : void 0);
71733
+ _this.container.appendChild(_this.content.view);
71680
71734
  return _this;
71681
71735
  }
71682
71736
  _create_class(StaticAdRegion, [