@xibosignage/xibo-layout-renderer 1.0.24 → 1.0.25

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.
@@ -834,31 +834,37 @@ var XiboLayoutRenderer = (function (exports) {
834
834
  case 0:
835
835
  _context2.next = 2;
836
836
  return Promise.all(list.map( /*#__PURE__*/function () {
837
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item) {
838
- var inputOverlay, overlayLayout, $overlay;
837
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item, index) {
838
+ var _item$index;
839
+ var inputOverlay, overlayLayout, $overlay, _overlayLayout$zIndex;
839
840
  return _regeneratorRuntime().wrap(function _callee$(_context) {
840
841
  while (1) switch (_context.prev = _context.next) {
841
842
  case 0:
842
843
  inputOverlay = {};
843
844
  inputOverlay = _objectSpread2(_objectSpread2({}, inputOverlay), item);
844
- inputOverlay.index = item.index;
845
+ inputOverlay.index = (_item$index = item.index) !== null && _item$index !== void 0 ? _item$index : index;
845
846
  _context.next = 5;
846
847
  return _this.parent.prepareLayoutXlf(_objectSpread2(_objectSpread2({}, initialLayout), inputOverlay));
847
848
  case 5:
848
849
  overlayLayout = _context.sent;
850
+ console.debug('<> XLR.debug OverlayLayoutManager::parseOverlays prepared overlay layout', {
851
+ overlayLayout: overlayLayout,
852
+ inputOverlay: inputOverlay
853
+ });
849
854
  // Hide all overlays first
850
855
  $overlay = document.querySelector("#".concat(overlayLayout.containerName, "[data-sequence=\"").concat(overlayLayout.index, "\"]"));
851
856
  if ($overlay !== null) {
852
- $overlay.style.setProperty('display', 'none');
857
+ $overlay.style.setProperty('visibility', 'hidden');
858
+ $overlay.style.setProperty('z-index', "".concat((_overlayLayout$zIndex = overlayLayout.zIndex) !== null && _overlayLayout$zIndex !== void 0 ? _overlayLayout$zIndex : -999));
853
859
  }
854
860
  return _context.abrupt("return", overlayLayout);
855
- case 9:
861
+ case 10:
856
862
  case "end":
857
863
  return _context.stop();
858
864
  }
859
865
  }, _callee);
860
866
  }));
861
- return function (_x2) {
867
+ return function (_x2, _x3) {
862
868
  return _ref.apply(this, arguments);
863
869
  };
864
870
  }()));
@@ -987,7 +993,7 @@ var XiboLayoutRenderer = (function (exports) {
987
993
  }
988
994
  }, _callee3, this, [[12, 21, 24, 27]]);
989
995
  }));
990
- function prepareOverlayLayouts(_x3, _x4) {
996
+ function prepareOverlayLayouts(_x4, _x5) {
991
997
  return _prepareOverlayLayouts.apply(this, arguments);
992
998
  }
993
999
  return prepareOverlayLayouts;
@@ -998,7 +1004,8 @@ var XiboLayoutRenderer = (function (exports) {
998
1004
  var _this$parent$currentL;
999
1005
  if (this.overlays.length === 0) return;
1000
1006
  if (this.parent && (_this$parent$currentL = this.parent.currentLayout) !== null && _this$parent$currentL !== void 0 && _this$parent$currentL.isInterrupt()) {
1001
- this.container.style.setProperty('display', 'none');
1007
+ this.container.style.setProperty('visibility', 'hidden');
1008
+ this.container.style.setProperty('z-index', '-999');
1002
1009
  return;
1003
1010
  }
1004
1011
  this.overlays.forEach(function (overlay) {
@@ -1016,21 +1023,25 @@ var XiboLayoutRenderer = (function (exports) {
1016
1023
  while (1) switch (_context5.prev = _context5.next) {
1017
1024
  case 0:
1018
1025
  overlayHtml = document.querySelector("#".concat(overlay.containerName, "[data-sequence=\"").concat(overlay.index, "\"]"));
1026
+ console.debug('<> XLR.debug OverlayLayoutManager::stopOverlays', {
1027
+ overlay: overlay,
1028
+ overlayHtml: overlayHtml
1029
+ });
1019
1030
  if (!(overlayHtml !== null)) {
1020
- _context5.next = 5;
1031
+ _context5.next = 6;
1021
1032
  break;
1022
1033
  }
1023
- _context5.next = 4;
1034
+ _context5.next = 5;
1024
1035
  return overlay.finishAllRegions();
1025
- case 4:
1026
- overlay.emitter.emit('end', overlay);
1027
1036
  case 5:
1037
+ overlay.emitter.emit('end', overlay);
1038
+ case 6:
1028
1039
  case "end":
1029
1040
  return _context5.stop();
1030
1041
  }
1031
1042
  }, _callee4);
1032
1043
  }));
1033
- return function (_x5) {
1044
+ return function (_x6) {
1034
1045
  return _ref2.apply(this, arguments);
1035
1046
  };
1036
1047
  }());
@@ -73806,6 +73817,13 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
73806
73817
  }));
73807
73818
  return _playerReportFault.apply(this, arguments);
73808
73819
  }
73820
+ function setLayoutIndex(layout, layoutIndex) {
73821
+ if (!layout || layout.id === null) {
73822
+ return;
73823
+ }
73824
+ layout.index = layoutIndex;
73825
+ return layout;
73826
+ }
73809
73827
 
73810
73828
  const urlAlphabet =
73811
73829
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
@@ -74981,10 +74999,16 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
74981
74999
  }, {
74982
75000
  key: "openLayoutInNewTab",
74983
75001
  value: function openLayoutInNewTab(layoutCode, options) {
74984
- if (confirm(this.translations.navigateToLayout.replace('[layoutTag]', layoutCode))) {
74985
- var url = options.layoutPreviewUrl.replace('[layoutCode]', layoutCode) + '?findByCode=1';
74986
- window.open(url, '_blank');
74987
- }
75002
+ var url = options.layoutPreviewUrl.replace('[layoutCode]', layoutCode) + '?findByCode=1';
75003
+ // Send a postMessage to the parent frame so the CMS can handle the confirmation
75004
+ // and navigation (confirm() is blocked in sandboxed iframes without allow-modals).
75005
+ window.parent.postMessage({
75006
+ type: 'xlr:navLayout',
75007
+ layoutCode: layoutCode,
75008
+ url: url
75009
+ }, '*');
75010
+ // Also emit via the XLR event system for non-iframe consumers.
75011
+ this.parent.xlr.emitter.emit('navLayout', layoutCode, url);
74988
75012
  }
74989
75013
  }, {
74990
75014
  key: "openLayoutInPlayer",
@@ -75401,8 +75425,11 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
75401
75425
  layout.state = exports.ELayoutState.PLAYED;
75402
75426
  }
75403
75427
  layout.done = true;
75404
- console.debug({
75405
- $layout: $layout
75428
+ console.debug('>>> XLR.debug Layout end emitted > Layout ID > ', {
75429
+ $layout: $layout,
75430
+ layoutId: layout.id,
75431
+ isOverlay: layout.isOverlay,
75432
+ isInterrupt: layout.isInterrupt()
75406
75433
  });
75407
75434
  if ($layout !== null) {
75408
75435
  $layout.style.setProperty('visibility', 'hidden');
@@ -76137,12 +76164,12 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
76137
76164
  $splashScreen === null || $splashScreen === void 0 || $splashScreen.hide();
76138
76165
  }
76139
76166
  if (!xlr.currentLayout.done) {
76140
- console.log('>>>> XLR.debug XLR::playSchedules > Running currentLayout', xlr.currentLayout);
76141
- xlr.currentLayout.run();
76142
76167
  // Hide overlays when current layout is interrupt
76143
76168
  if (xlr.currentLayout.isInterrupt()) {
76144
76169
  xlrObject.overlayLayoutManager.stopOverlays();
76145
76170
  }
76171
+ console.log('>>>> XLR.debug XLR::playSchedules > Running currentLayout', xlr.currentLayout);
76172
+ xlr.currentLayout.run();
76146
76173
  }
76147
76174
  } else {
76148
76175
  // Show splash screen
@@ -76490,8 +76517,10 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
76490
76517
  var tempNextLayoutIndex = getLayoutIndexByLayoutId(this.inputLayouts, this.nextLayout.layoutId);
76491
76518
  _currentLayoutIndex = tempNextLayoutIndex !== null && tempNextLayoutIndex !== void 0 ? tempNextLayoutIndex : 0;
76492
76519
  _currentLayout = this.getLayout(this.inputLayouts[tempNextLayoutIndex !== null && tempNextLayoutIndex !== void 0 ? tempNextLayoutIndex : 0]);
76520
+ _currentLayout = setLayoutIndex(_currentLayout, _currentLayoutIndex);
76493
76521
  } else {
76494
76522
  _currentLayout = this.getLayout(this.inputLayouts[0]);
76523
+ _currentLayout = setLayoutIndex(_currentLayout, 0);
76495
76524
  }
76496
76525
  if (this.inputLayouts.length > 1) {
76497
76526
  if (_currentLayoutIndex + 1 > this.inputLayouts.length - 1) {
@@ -76500,6 +76529,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
76500
76529
  _nextLayoutIndex = _currentLayoutIndex + 1;
76501
76530
  }
76502
76531
  _nextLayout = this.getLayout(this.inputLayouts[_nextLayoutIndex]);
76532
+ _nextLayout = setLayoutIndex(_nextLayout, _nextLayoutIndex);
76503
76533
  } else {
76504
76534
  _nextLayout = _currentLayout;
76505
76535
  }
@@ -76512,20 +76542,25 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
76512
76542
  if (_currentLayout) {
76513
76543
  _currentLayoutIndex = _currentLayout.index;
76514
76544
  }
76545
+ _currentLayout = setLayoutIndex(_currentLayout, _currentLayoutIndex);
76515
76546
  _nextLayoutIndex = 0;
76516
76547
  _nextLayout = this.getLayout(this.inputLayouts[_nextLayoutIndex]);
76548
+ _nextLayout = setLayoutIndex(_nextLayout, _nextLayoutIndex);
76517
76549
  }
76518
76550
  } else {
76519
76551
  _currentLayoutIndex = this.nextLayout.index > this.inputLayouts.length - 1 ? 0 : this.nextLayout.index;
76520
76552
  _currentLayout = this.getLayout(this.inputLayouts[_currentLayoutIndex]);
76553
+ _currentLayout = setLayoutIndex(_currentLayout, _currentLayoutIndex);
76521
76554
  _nextLayoutIndex = _currentLayoutIndex + 1 > this.inputLayouts.length - 1 ? 0 : _currentLayoutIndex + 1;
76522
76555
  _nextLayout = this.getLayout(this.inputLayouts[_nextLayoutIndex]);
76556
+ _nextLayout = setLayoutIndex(_nextLayout, _nextLayoutIndex);
76523
76557
  }
76524
76558
  } else {
76525
76559
  _currentLayout = this.nextLayout;
76526
76560
  _currentLayoutIndex = _currentLayout.index;
76527
76561
  _nextLayoutIndex = (_currentLayoutIndex + 1) % this.inputLayouts.length;
76528
76562
  _nextLayout = this.getLayout(this.inputLayouts[_nextLayoutIndex]);
76563
+ _nextLayout = setLayoutIndex(_nextLayout, _nextLayoutIndex);
76529
76564
  }
76530
76565
  }
76531
76566
  }
@@ -76533,17 +76568,22 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
76533
76568
  // Initial run: set both currentLayout and nextLayout
76534
76569
  if (hasLayout) {
76535
76570
  _currentLayout = this.getLayout(this.inputLayouts[_currentLayoutIndex]);
76571
+ _currentLayout = setLayoutIndex(_currentLayout, _currentLayoutIndex);
76536
76572
  if (this.inputLayouts.length > 1) {
76537
76573
  _nextLayout = this.getLayout(this.inputLayouts[_nextLayoutIndex]);
76574
+ _nextLayout = setLayoutIndex(_nextLayout, _nextLayoutIndex);
76538
76575
  } else {
76539
76576
  _nextLayout = this.getLayout(this.inputLayouts[0]);
76577
+ _nextLayout = setLayoutIndex(_nextLayout, 0);
76540
76578
  }
76541
76579
  }
76542
76580
  }
76543
76581
  if (_currentLayout === undefined && _nextLayout === undefined) {
76544
76582
  if (_hasDefaultOnly) {
76545
76583
  _currentLayout = this.getLayout(this.inputLayouts[0]);
76584
+ _currentLayout = setLayoutIndex(_currentLayout, 0);
76546
76585
  _nextLayout = this.getLayout(this.inputLayouts[0]);
76586
+ _nextLayout = setLayoutIndex(_nextLayout, 0);
76547
76587
  }
76548
76588
  }
76549
76589
  if (_currentLayout !== undefined && _nextLayout !== undefined) {
@@ -76577,6 +76617,11 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
76577
76617
  activeLayout = _objectSpread2({}, this.uniqueLayouts[inputLayout.layoutId]);
76578
76618
  }
76579
76619
  _layout = _objectSpread2(_objectSpread2({}, _layout), activeLayout);
76620
+ console.debug('XLR::getLayout > activeLayout from uniqueLayouts', {
76621
+ activeLayout: activeLayout,
76622
+ inputLayout: inputLayout,
76623
+ uniqueLayouts: this.uniqueLayouts
76624
+ });
76580
76625
  // Must set index/sequence from schedule loop
76581
76626
  _layout.index = activeLayout.index;
76582
76627
  }
@@ -76789,7 +76834,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
76789
76834
  _nextLayout = nextLayout;
76790
76835
  case 2:
76791
76836
  if (!(_nextLayout && _nextLayout.xlfString === '')) {
76792
- _context16.next = 16;
76837
+ _context16.next = 17;
76793
76838
  break;
76794
76839
  }
76795
76840
  // Remove skipped layout
@@ -76801,25 +76846,26 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
76801
76846
  _context16.next = 7;
76802
76847
  break;
76803
76848
  }
76804
- return _context16.abrupt("break", 16);
76849
+ return _context16.abrupt("break", 17);
76805
76850
  case 7:
76806
76851
  inputLayout = self.inputLayouts[nextIndex];
76807
76852
  if (inputLayout) {
76808
76853
  _context16.next = 10;
76809
76854
  break;
76810
76855
  }
76811
- return _context16.abrupt("break", 16);
76856
+ return _context16.abrupt("break", 17);
76812
76857
  case 10:
76813
76858
  nextLayoutObj = self.getLayout(inputLayout);
76814
- _context16.next = 13;
76859
+ nextLayoutObj = setLayoutIndex(nextLayoutObj, nextIndex);
76860
+ _context16.next = 14;
76815
76861
  return self.prepareLayoutXlf(nextLayoutObj);
76816
- case 13:
76862
+ case 14:
76817
76863
  _nextLayout = _context16.sent;
76818
76864
  _context16.next = 2;
76819
76865
  break;
76820
- case 16:
76821
- return _context16.abrupt("return", _nextLayout);
76822
76866
  case 17:
76867
+ return _context16.abrupt("return", _nextLayout);
76868
+ case 18:
76823
76869
  case "end":
76824
76870
  return _context16.stop();
76825
76871
  }