@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.mjs CHANGED
@@ -70413,6 +70413,7 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70413
70413
  PrebidGAMEventsInstance.onSlotRenderEnd(function(event) {
70414
70414
  var slot = event.slot;
70415
70415
  if ("".concat(_this.workingSlotId) === event.slot.getSlotElementId()) {
70416
+ var _this_content_extra_sz, _this_content_extra_sz1;
70416
70417
  if (!_this.content.extra) {
70417
70418
  _this.content.extra = {};
70418
70419
  }
@@ -70422,6 +70423,10 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70422
70423
  if (slot.getTargeting("hb_bidder").length) {
70423
70424
  _this.content.extra.bidder = slot.getTargeting("hb_bidder")[0];
70424
70425
  }
70426
+ _this.content.extra.sz = {
70427
+ 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,
70428
+ 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
70429
+ };
70425
70430
  _this.content.pending = false;
70426
70431
  _this.fullfill();
70427
70432
  }
@@ -71173,20 +71178,26 @@ var RegionBorderPlugin = /*#__PURE__*/ function() {
71173
71178
  {
71174
71179
  key: "afterShow",
71175
71180
  value: function afterShow(region) {
71181
+ var styles2 = window.getComputedStyle(region.content.view);
71182
+ var width = parseFloat(styles2.width);
71183
+ var height = parseFloat(styles2.height);
71176
71184
  region.view.style.width = "".concat(region.boxWidth + 4, "px");
71177
71185
  region.view.style.height = "".concat(region.boxHeight + 4, "px");
71178
- region.content.view.style.width = "".concat(region.boxWidth + 4, "px");
71179
- region.content.view.style.height = "".concat(region.boxHeight + 4, "px");
71186
+ region.content.view.style.width = "".concat(width + 4, "px");
71187
+ region.content.view.style.height = "".concat(height + 4, "px");
71180
71188
  return Promise.resolve();
71181
71189
  }
71182
71190
  },
71183
71191
  {
71184
71192
  key: "reRender",
71185
71193
  value: function reRender(region) {
71194
+ var styles2 = window.getComputedStyle(region.content.view);
71195
+ var width = parseFloat(styles2.width);
71196
+ var height = parseFloat(styles2.height);
71186
71197
  region.view.style.width = "".concat(region.boxWidth + 4, "px");
71187
71198
  region.view.style.height = "".concat(region.boxHeight + 4, "px");
71188
- region.content.view.style.width = "".concat(region.boxWidth + 4, "px");
71189
- region.content.view.style.height = "".concat(region.boxHeight + 4, "px");
71199
+ region.content.view.style.width = "".concat(width + 4, "px");
71200
+ region.content.view.style.height = "".concat(height + 4, "px");
71190
71201
  return Promise.resolve();
71191
71202
  }
71192
71203
  },
@@ -71719,6 +71730,47 @@ var Region = /*#__PURE__*/ function() {
71719
71730
  return Region;
71720
71731
  }();
71721
71732
  // src/Ads/Regions/StaticAdRegion.ts
71733
+ var StaticRegionContent = /*#__PURE__*/ function(RegionContent) {
71734
+ "use strict";
71735
+ _inherits(StaticRegionContent, RegionContent);
71736
+ function StaticRegionContent(id, plane, box, ctx) {
71737
+ _class_call_check(this, StaticRegionContent);
71738
+ var _this;
71739
+ _this = _call_super(this, StaticRegionContent, [
71740
+ id,
71741
+ plane,
71742
+ box,
71743
+ ctx
71744
+ ]);
71745
+ _this.container.style.left = "50%";
71746
+ _this.container.style.top = "50%";
71747
+ _this.container.style.transform = "translate(-50%, -50%)";
71748
+ return _this;
71749
+ }
71750
+ _create_class(StaticRegionContent, [
71751
+ {
71752
+ key: "render",
71753
+ value: function render(force) {
71754
+ var _this = this;
71755
+ var _this_content, _this_content_extra_sz, _this_content_extra, _this_content1, _this_content_extra_sz1, _this_content_extra1, _this_content2;
71756
+ if ((_this_content = this.content) === null || _this_content === void 0 ? void 0 : _this_content.pending) {
71757
+ return;
71758
+ }
71759
+ 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");
71760
+ 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");
71761
+ this.container.dataset.state = this.box.area(this.plane.size) > 0 ? "visible" : "hidden";
71762
+ this.container.childNodes.forEach(function(node) {
71763
+ if (_instanceof(node, HTMLElement)) {
71764
+ var _this_content_extra_sz, _this_content_extra, _this_content, _this_content_extra_sz1, _this_content_extra1, _this_content1;
71765
+ 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");
71766
+ 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");
71767
+ }
71768
+ });
71769
+ }
71770
+ }
71771
+ ]);
71772
+ return StaticRegionContent;
71773
+ }(RegionContent);
71722
71774
  var StaticAdRegion = /*#__PURE__*/ function(Region) {
71723
71775
  "use strict";
71724
71776
  _inherits(StaticAdRegion, Region);
@@ -71742,6 +71794,9 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
71742
71794
  deps
71743
71795
  ]);
71744
71796
  _this.requestWithSize = true;
71797
+ _this.content.view.remove();
71798
+ _this.content = new StaticRegionContent(_this.id, _this.plane, _this.box, _this.deps.debug ? _this.regionDescriptor.ctx : void 0);
71799
+ _this.container.appendChild(_this.content.view);
71745
71800
  return _this;
71746
71801
  }
71747
71802
  _create_class(StaticAdRegion, [