@vizbeetv/homesso-sdk-qa 1.0.7 → 1.0.8-rc2

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/es5/index.cjs CHANGED
@@ -585,7 +585,7 @@ var VizbeeMetricsManager = /** @class */ (function () {
585
585
  var _a, _b, _c, _d;
586
586
  var attributes = {};
587
587
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
588
- '1.0.7';
588
+ '1.0.8-rc2';
589
589
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
590
590
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
591
591
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -1106,6 +1106,7 @@ var VizbeeSnackbar = /** @class */ (function () {
1106
1106
  * Creates a new instance of VizbeeSnackbar
1107
1107
  */
1108
1108
  function VizbeeSnackbar() {
1109
+ this.currentPosition = 'bottom-right';
1109
1110
  this.BASE_DIMENSIONS = {
1110
1111
  REFERENCE_WIDTH: 1920,
1111
1112
  REFERENCE_HEIGHT: 1080,
@@ -1131,10 +1132,6 @@ var VizbeeSnackbar = /** @class */ (function () {
1131
1132
  clearTimeout(this.showSnackbarTimerId);
1132
1133
  this.showSnackbarTimerId = window.setTimeout(function () {
1133
1134
  _this.createSnackbar(options);
1134
- if (_this.currentSnackbar) {
1135
- _this.currentSnackbar.style.transform =
1136
- _this.getSlideTransform('top-right');
1137
- }
1138
1135
  if (options === null || options === void 0 ? void 0 : options.shouldAnimateIcon) {
1139
1136
  _this.startIconAnimation(options.iconBase64Strings);
1140
1137
  }
@@ -1148,13 +1145,15 @@ var VizbeeSnackbar = /** @class */ (function () {
1148
1145
  */
1149
1146
  VizbeeSnackbar.prototype.hide = function () {
1150
1147
  var _this = this;
1148
+ var _a;
1151
1149
  this.stopIconAnimation();
1152
1150
  if (this.timeoutId) {
1153
1151
  clearTimeout(this.timeoutId);
1154
1152
  this.timeoutId = undefined;
1155
1153
  }
1156
1154
  if (this.currentSnackbar) {
1157
- this.currentSnackbar.style.transform = this.getSlideTransform('bottom-right', true);
1155
+ // Slide out toward the same edge the snackbar entered from.
1156
+ this.currentSnackbar.style.transform = this.getSlideTransform(this.currentPosition, true);
1158
1157
  this.currentSnackbar.style.opacity = '0';
1159
1158
  setTimeout(function () {
1160
1159
  var _a;
@@ -1163,6 +1162,7 @@ var VizbeeSnackbar = /** @class */ (function () {
1163
1162
  }
1164
1163
  _this.currentSnackbar = undefined;
1165
1164
  }, 300);
1165
+ (_a = this.onHide) === null || _a === void 0 ? void 0 : _a.call(this);
1166
1166
  }
1167
1167
  };
1168
1168
  VizbeeSnackbar.prototype.getScreenScale = function () {
@@ -1223,6 +1223,7 @@ var VizbeeSnackbar = /** @class */ (function () {
1223
1223
  return ((options === null || options === void 0 ? void 0 : options.direction) || 'ltr') === 'rtl';
1224
1224
  };
1225
1225
  VizbeeSnackbar.prototype.createSnackbar = function (options) {
1226
+ this.currentPosition = (options === null || options === void 0 ? void 0 : options.position) || 'bottom-right';
1226
1227
  var snackbar = document.createElement('div');
1227
1228
  snackbar.style.cssText = this.getSnackbarStyles(options);
1228
1229
  var isRtl = this.isRtl(options);
@@ -1332,6 +1333,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1332
1333
  * @internal
1333
1334
  */
1334
1335
  function VizbeeHomeSSOManager() {
1336
+ var _this = this;
1335
1337
  /** @internal List of sign-in information for different services */
1336
1338
  this.signInInfoList = [];
1337
1339
  /** @internal Tracks if remote device is signed in */
@@ -1340,6 +1342,8 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1340
1342
  this.isScreenSignedIn = false;
1341
1343
  /** @internal Tracks if sign-in process is currently active */
1342
1344
  this.isSignInInProgress = false;
1345
+ /** @internal Tracks which SSO modal is currently displayed to avoid redundant re-renders */
1346
+ this.currentModalType = 'none';
1343
1347
  /** @internal Information about the sender device */
1344
1348
  this.senderInfo = null;
1345
1349
  this.signInHandler = null;
@@ -1350,6 +1354,10 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1350
1354
  this.modalPreferences = {};
1351
1355
  this.vizbeeHomeSSOUIManager = VizbeeHomeSSOUIManager.getInstance();
1352
1356
  this.snackbar = new VizbeeSnackbar();
1357
+ // Keep tracked modal state in sync when the snackbar auto-hides.
1358
+ this.snackbar.onHide = function () {
1359
+ _this.currentModalType = 'none';
1360
+ };
1353
1361
  this.vizbeeMetricsManager = new VizbeeMetricsManager();
1354
1362
  }
1355
1363
  /**
@@ -1716,6 +1724,14 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1716
1724
  * @internal
1717
1725
  */
1718
1726
  VizbeeHomeSSOManager.prototype.updateProgressUI = function () {
1727
+ var targetModalType = this.isRemoteSignedIn
1728
+ ? 'progress'
1729
+ : 'informational';
1730
+ // Same modal already showing; skip to avoid a hide + reshow flicker.
1731
+ if (this.currentModalType === targetModalType) {
1732
+ logger.debug("[".concat(LOG_TAG, "][updateProgressUI] - '").concat(targetModalType, "' modal already showing, skipping re-render"));
1733
+ return;
1734
+ }
1719
1735
  if (!this.isRemoteSignedIn) {
1720
1736
  var modalOptions = this.vizbeeHomeSSOUIManager.getInformationalSignInModalConfig();
1721
1737
  this.snackbar.show(modalOptions);
@@ -1724,6 +1740,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1724
1740
  var modalOptions = this.vizbeeHomeSSOUIManager.getProgressSignInModalConfig();
1725
1741
  this.snackbar.show(__assign(__assign({}, modalOptions), { shouldAnimateIcon: true }));
1726
1742
  }
1743
+ this.currentModalType = targetModalType;
1727
1744
  };
1728
1745
  /**
1729
1746
  * Updates UI for successful sign-in
@@ -1732,8 +1749,14 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1732
1749
  * @internal
1733
1750
  */
1734
1751
  VizbeeHomeSSOManager.prototype.updateSuccessUI = function () {
1752
+ // Success modal already showing; leave it as-is.
1753
+ if (this.currentModalType === 'success') {
1754
+ logger.debug("[".concat(LOG_TAG, "][updateSuccessUI] - 'success' modal already showing, skipping re-render"));
1755
+ return;
1756
+ }
1735
1757
  var modalOptions = this.vizbeeHomeSSOUIManager.getSuccessSignInModalConfig();
1736
1758
  this.snackbar.show(modalOptions);
1759
+ this.currentModalType = 'success';
1737
1760
  };
1738
1761
  /**
1739
1762
  * Updates UI for failed sign-in
@@ -1742,7 +1765,13 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1742
1765
  * @internal
1743
1766
  */
1744
1767
  VizbeeHomeSSOManager.prototype.updateFailureUI = function () {
1768
+ // Nothing showing; nothing to hide.
1769
+ if (this.currentModalType === 'none') {
1770
+ logger.debug("[".concat(LOG_TAG, "][updateFailureUI] - no modal showing, nothing to hide"));
1771
+ return;
1772
+ }
1745
1773
  this.snackbar.hide();
1774
+ this.currentModalType = 'none';
1746
1775
  };
1747
1776
  /** @internal Singleton instance of the manager */
1748
1777
  VizbeeHomeSSOManager.instance = null;
@@ -1827,7 +1856,7 @@ var setupHomeSSO = function () {
1827
1856
  // Replaced at build time with package.json's version by
1828
1857
  // @rollup/plugin-replace (same token the metrics manager uses), so
1829
1858
  // integrators can read the loaded SDK version off the namespace.
1830
- VERSION: '1.0.7',
1859
+ VERSION: '1.0.8-rc2',
1831
1860
  };
1832
1861
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1833
1862
  };
package/es5/index.mjs CHANGED
@@ -581,7 +581,7 @@ var VizbeeMetricsManager = /** @class */ (function () {
581
581
  var _a, _b, _c, _d;
582
582
  var attributes = {};
583
583
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
584
- '1.0.7';
584
+ '1.0.8-rc2';
585
585
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
586
586
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
587
587
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -1102,6 +1102,7 @@ var VizbeeSnackbar = /** @class */ (function () {
1102
1102
  * Creates a new instance of VizbeeSnackbar
1103
1103
  */
1104
1104
  function VizbeeSnackbar() {
1105
+ this.currentPosition = 'bottom-right';
1105
1106
  this.BASE_DIMENSIONS = {
1106
1107
  REFERENCE_WIDTH: 1920,
1107
1108
  REFERENCE_HEIGHT: 1080,
@@ -1127,10 +1128,6 @@ var VizbeeSnackbar = /** @class */ (function () {
1127
1128
  clearTimeout(this.showSnackbarTimerId);
1128
1129
  this.showSnackbarTimerId = window.setTimeout(function () {
1129
1130
  _this.createSnackbar(options);
1130
- if (_this.currentSnackbar) {
1131
- _this.currentSnackbar.style.transform =
1132
- _this.getSlideTransform('top-right');
1133
- }
1134
1131
  if (options === null || options === void 0 ? void 0 : options.shouldAnimateIcon) {
1135
1132
  _this.startIconAnimation(options.iconBase64Strings);
1136
1133
  }
@@ -1144,13 +1141,15 @@ var VizbeeSnackbar = /** @class */ (function () {
1144
1141
  */
1145
1142
  VizbeeSnackbar.prototype.hide = function () {
1146
1143
  var _this = this;
1144
+ var _a;
1147
1145
  this.stopIconAnimation();
1148
1146
  if (this.timeoutId) {
1149
1147
  clearTimeout(this.timeoutId);
1150
1148
  this.timeoutId = undefined;
1151
1149
  }
1152
1150
  if (this.currentSnackbar) {
1153
- this.currentSnackbar.style.transform = this.getSlideTransform('bottom-right', true);
1151
+ // Slide out toward the same edge the snackbar entered from.
1152
+ this.currentSnackbar.style.transform = this.getSlideTransform(this.currentPosition, true);
1154
1153
  this.currentSnackbar.style.opacity = '0';
1155
1154
  setTimeout(function () {
1156
1155
  var _a;
@@ -1159,6 +1158,7 @@ var VizbeeSnackbar = /** @class */ (function () {
1159
1158
  }
1160
1159
  _this.currentSnackbar = undefined;
1161
1160
  }, 300);
1161
+ (_a = this.onHide) === null || _a === void 0 ? void 0 : _a.call(this);
1162
1162
  }
1163
1163
  };
1164
1164
  VizbeeSnackbar.prototype.getScreenScale = function () {
@@ -1219,6 +1219,7 @@ var VizbeeSnackbar = /** @class */ (function () {
1219
1219
  return ((options === null || options === void 0 ? void 0 : options.direction) || 'ltr') === 'rtl';
1220
1220
  };
1221
1221
  VizbeeSnackbar.prototype.createSnackbar = function (options) {
1222
+ this.currentPosition = (options === null || options === void 0 ? void 0 : options.position) || 'bottom-right';
1222
1223
  var snackbar = document.createElement('div');
1223
1224
  snackbar.style.cssText = this.getSnackbarStyles(options);
1224
1225
  var isRtl = this.isRtl(options);
@@ -1328,6 +1329,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1328
1329
  * @internal
1329
1330
  */
1330
1331
  function VizbeeHomeSSOManager() {
1332
+ var _this = this;
1331
1333
  /** @internal List of sign-in information for different services */
1332
1334
  this.signInInfoList = [];
1333
1335
  /** @internal Tracks if remote device is signed in */
@@ -1336,6 +1338,8 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1336
1338
  this.isScreenSignedIn = false;
1337
1339
  /** @internal Tracks if sign-in process is currently active */
1338
1340
  this.isSignInInProgress = false;
1341
+ /** @internal Tracks which SSO modal is currently displayed to avoid redundant re-renders */
1342
+ this.currentModalType = 'none';
1339
1343
  /** @internal Information about the sender device */
1340
1344
  this.senderInfo = null;
1341
1345
  this.signInHandler = null;
@@ -1346,6 +1350,10 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1346
1350
  this.modalPreferences = {};
1347
1351
  this.vizbeeHomeSSOUIManager = VizbeeHomeSSOUIManager.getInstance();
1348
1352
  this.snackbar = new VizbeeSnackbar();
1353
+ // Keep tracked modal state in sync when the snackbar auto-hides.
1354
+ this.snackbar.onHide = function () {
1355
+ _this.currentModalType = 'none';
1356
+ };
1349
1357
  this.vizbeeMetricsManager = new VizbeeMetricsManager();
1350
1358
  }
1351
1359
  /**
@@ -1712,6 +1720,14 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1712
1720
  * @internal
1713
1721
  */
1714
1722
  VizbeeHomeSSOManager.prototype.updateProgressUI = function () {
1723
+ var targetModalType = this.isRemoteSignedIn
1724
+ ? 'progress'
1725
+ : 'informational';
1726
+ // Same modal already showing; skip to avoid a hide + reshow flicker.
1727
+ if (this.currentModalType === targetModalType) {
1728
+ logger.debug("[".concat(LOG_TAG, "][updateProgressUI] - '").concat(targetModalType, "' modal already showing, skipping re-render"));
1729
+ return;
1730
+ }
1715
1731
  if (!this.isRemoteSignedIn) {
1716
1732
  var modalOptions = this.vizbeeHomeSSOUIManager.getInformationalSignInModalConfig();
1717
1733
  this.snackbar.show(modalOptions);
@@ -1720,6 +1736,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1720
1736
  var modalOptions = this.vizbeeHomeSSOUIManager.getProgressSignInModalConfig();
1721
1737
  this.snackbar.show(__assign(__assign({}, modalOptions), { shouldAnimateIcon: true }));
1722
1738
  }
1739
+ this.currentModalType = targetModalType;
1723
1740
  };
1724
1741
  /**
1725
1742
  * Updates UI for successful sign-in
@@ -1728,8 +1745,14 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1728
1745
  * @internal
1729
1746
  */
1730
1747
  VizbeeHomeSSOManager.prototype.updateSuccessUI = function () {
1748
+ // Success modal already showing; leave it as-is.
1749
+ if (this.currentModalType === 'success') {
1750
+ logger.debug("[".concat(LOG_TAG, "][updateSuccessUI] - 'success' modal already showing, skipping re-render"));
1751
+ return;
1752
+ }
1731
1753
  var modalOptions = this.vizbeeHomeSSOUIManager.getSuccessSignInModalConfig();
1732
1754
  this.snackbar.show(modalOptions);
1755
+ this.currentModalType = 'success';
1733
1756
  };
1734
1757
  /**
1735
1758
  * Updates UI for failed sign-in
@@ -1738,7 +1761,13 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1738
1761
  * @internal
1739
1762
  */
1740
1763
  VizbeeHomeSSOManager.prototype.updateFailureUI = function () {
1764
+ // Nothing showing; nothing to hide.
1765
+ if (this.currentModalType === 'none') {
1766
+ logger.debug("[".concat(LOG_TAG, "][updateFailureUI] - no modal showing, nothing to hide"));
1767
+ return;
1768
+ }
1741
1769
  this.snackbar.hide();
1770
+ this.currentModalType = 'none';
1742
1771
  };
1743
1772
  /** @internal Singleton instance of the manager */
1744
1773
  VizbeeHomeSSOManager.instance = null;
@@ -1823,7 +1852,7 @@ var setupHomeSSO = function () {
1823
1852
  // Replaced at build time with package.json's version by
1824
1853
  // @rollup/plugin-replace (same token the metrics manager uses), so
1825
1854
  // integrators can read the loaded SDK version off the namespace.
1826
- VERSION: '1.0.7',
1855
+ VERSION: '1.0.8-rc2',
1827
1856
  };
1828
1857
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1829
1858
  };
package/es6/index.cjs CHANGED
@@ -482,7 +482,7 @@ class VizbeeMetricsManager {
482
482
  var _a, _b, _c, _d;
483
483
  const attributes = {};
484
484
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
485
- '1.0.7';
485
+ '1.0.8-rc2';
486
486
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
487
487
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
488
488
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -977,6 +977,7 @@ class VizbeeSnackbar {
977
977
  * Creates a new instance of VizbeeSnackbar
978
978
  */
979
979
  constructor() {
980
+ this.currentPosition = 'bottom-right';
980
981
  this.BASE_DIMENSIONS = {
981
982
  REFERENCE_WIDTH: 1920,
982
983
  REFERENCE_HEIGHT: 1080,
@@ -1001,10 +1002,6 @@ class VizbeeSnackbar {
1001
1002
  clearTimeout(this.showSnackbarTimerId);
1002
1003
  this.showSnackbarTimerId = window.setTimeout(() => {
1003
1004
  this.createSnackbar(options);
1004
- if (this.currentSnackbar) {
1005
- this.currentSnackbar.style.transform =
1006
- this.getSlideTransform('top-right');
1007
- }
1008
1005
  if (options === null || options === void 0 ? void 0 : options.shouldAnimateIcon) {
1009
1006
  this.startIconAnimation(options.iconBase64Strings);
1010
1007
  }
@@ -1017,13 +1014,15 @@ class VizbeeSnackbar {
1017
1014
  * Hides the currently displayed snackbar
1018
1015
  */
1019
1016
  hide() {
1017
+ var _a;
1020
1018
  this.stopIconAnimation();
1021
1019
  if (this.timeoutId) {
1022
1020
  clearTimeout(this.timeoutId);
1023
1021
  this.timeoutId = undefined;
1024
1022
  }
1025
1023
  if (this.currentSnackbar) {
1026
- this.currentSnackbar.style.transform = this.getSlideTransform('bottom-right', true);
1024
+ // Slide out toward the same edge the snackbar entered from.
1025
+ this.currentSnackbar.style.transform = this.getSlideTransform(this.currentPosition, true);
1027
1026
  this.currentSnackbar.style.opacity = '0';
1028
1027
  setTimeout(() => {
1029
1028
  var _a;
@@ -1032,6 +1031,7 @@ class VizbeeSnackbar {
1032
1031
  }
1033
1032
  this.currentSnackbar = undefined;
1034
1033
  }, 300);
1034
+ (_a = this.onHide) === null || _a === void 0 ? void 0 : _a.call(this);
1035
1035
  }
1036
1036
  }
1037
1037
  getScreenScale() {
@@ -1098,6 +1098,7 @@ class VizbeeSnackbar {
1098
1098
  return ((options === null || options === void 0 ? void 0 : options.direction) || 'ltr') === 'rtl';
1099
1099
  }
1100
1100
  createSnackbar(options) {
1101
+ this.currentPosition = (options === null || options === void 0 ? void 0 : options.position) || 'bottom-right';
1101
1102
  const snackbar = document.createElement('div');
1102
1103
  snackbar.style.cssText = this.getSnackbarStyles(options);
1103
1104
  const isRtl = this.isRtl(options);
@@ -1275,6 +1276,8 @@ class VizbeeHomeSSOManager {
1275
1276
  this.isScreenSignedIn = false;
1276
1277
  /** @internal Tracks if sign-in process is currently active */
1277
1278
  this.isSignInInProgress = false;
1279
+ /** @internal Tracks which SSO modal is currently displayed to avoid redundant re-renders */
1280
+ this.currentModalType = 'none';
1278
1281
  /** @internal Information about the sender device */
1279
1282
  this.senderInfo = null;
1280
1283
  this.signInHandler = null;
@@ -1285,6 +1288,10 @@ class VizbeeHomeSSOManager {
1285
1288
  this.modalPreferences = {};
1286
1289
  this.vizbeeHomeSSOUIManager = VizbeeHomeSSOUIManager.getInstance();
1287
1290
  this.snackbar = new VizbeeSnackbar();
1291
+ // Keep tracked modal state in sync when the snackbar auto-hides.
1292
+ this.snackbar.onHide = () => {
1293
+ this.currentModalType = 'none';
1294
+ };
1288
1295
  this.vizbeeMetricsManager = new VizbeeMetricsManager();
1289
1296
  }
1290
1297
  /**
@@ -1610,6 +1617,14 @@ class VizbeeHomeSSOManager {
1610
1617
  * @internal
1611
1618
  */
1612
1619
  updateProgressUI() {
1620
+ const targetModalType = this.isRemoteSignedIn
1621
+ ? 'progress'
1622
+ : 'informational';
1623
+ // Same modal already showing; skip to avoid a hide + reshow flicker.
1624
+ if (this.currentModalType === targetModalType) {
1625
+ logger.debug(`[${LOG_TAG}][updateProgressUI] - '${targetModalType}' modal already showing, skipping re-render`);
1626
+ return;
1627
+ }
1613
1628
  if (!this.isRemoteSignedIn) {
1614
1629
  const modalOptions = this.vizbeeHomeSSOUIManager.getInformationalSignInModalConfig();
1615
1630
  this.snackbar.show(modalOptions);
@@ -1618,6 +1633,7 @@ class VizbeeHomeSSOManager {
1618
1633
  const modalOptions = this.vizbeeHomeSSOUIManager.getProgressSignInModalConfig();
1619
1634
  this.snackbar.show(Object.assign(Object.assign({}, modalOptions), { shouldAnimateIcon: true }));
1620
1635
  }
1636
+ this.currentModalType = targetModalType;
1621
1637
  }
1622
1638
  /**
1623
1639
  * Updates UI for successful sign-in
@@ -1626,8 +1642,14 @@ class VizbeeHomeSSOManager {
1626
1642
  * @internal
1627
1643
  */
1628
1644
  updateSuccessUI() {
1645
+ // Success modal already showing; leave it as-is.
1646
+ if (this.currentModalType === 'success') {
1647
+ logger.debug(`[${LOG_TAG}][updateSuccessUI] - 'success' modal already showing, skipping re-render`);
1648
+ return;
1649
+ }
1629
1650
  const modalOptions = this.vizbeeHomeSSOUIManager.getSuccessSignInModalConfig();
1630
1651
  this.snackbar.show(modalOptions);
1652
+ this.currentModalType = 'success';
1631
1653
  }
1632
1654
  /**
1633
1655
  * Updates UI for failed sign-in
@@ -1636,7 +1658,13 @@ class VizbeeHomeSSOManager {
1636
1658
  * @internal
1637
1659
  */
1638
1660
  updateFailureUI() {
1661
+ // Nothing showing; nothing to hide.
1662
+ if (this.currentModalType === 'none') {
1663
+ logger.debug(`[${LOG_TAG}][updateFailureUI] - no modal showing, nothing to hide`);
1664
+ return;
1665
+ }
1639
1666
  this.snackbar.hide();
1667
+ this.currentModalType = 'none';
1640
1668
  }
1641
1669
  }
1642
1670
  /** @internal Singleton instance of the manager */
@@ -1719,7 +1747,7 @@ const setupHomeSSO = () => {
1719
1747
  // Replaced at build time with package.json's version by
1720
1748
  // @rollup/plugin-replace (same token the metrics manager uses), so
1721
1749
  // integrators can read the loaded SDK version off the namespace.
1722
- VERSION: '1.0.7',
1750
+ VERSION: '1.0.8-rc2',
1723
1751
  };
1724
1752
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1725
1753
  };
package/es6/index.mjs CHANGED
@@ -478,7 +478,7 @@ class VizbeeMetricsManager {
478
478
  var _a, _b, _c, _d;
479
479
  const attributes = {};
480
480
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
481
- '1.0.7';
481
+ '1.0.8-rc2';
482
482
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
483
483
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
484
484
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -973,6 +973,7 @@ class VizbeeSnackbar {
973
973
  * Creates a new instance of VizbeeSnackbar
974
974
  */
975
975
  constructor() {
976
+ this.currentPosition = 'bottom-right';
976
977
  this.BASE_DIMENSIONS = {
977
978
  REFERENCE_WIDTH: 1920,
978
979
  REFERENCE_HEIGHT: 1080,
@@ -997,10 +998,6 @@ class VizbeeSnackbar {
997
998
  clearTimeout(this.showSnackbarTimerId);
998
999
  this.showSnackbarTimerId = window.setTimeout(() => {
999
1000
  this.createSnackbar(options);
1000
- if (this.currentSnackbar) {
1001
- this.currentSnackbar.style.transform =
1002
- this.getSlideTransform('top-right');
1003
- }
1004
1001
  if (options === null || options === void 0 ? void 0 : options.shouldAnimateIcon) {
1005
1002
  this.startIconAnimation(options.iconBase64Strings);
1006
1003
  }
@@ -1013,13 +1010,15 @@ class VizbeeSnackbar {
1013
1010
  * Hides the currently displayed snackbar
1014
1011
  */
1015
1012
  hide() {
1013
+ var _a;
1016
1014
  this.stopIconAnimation();
1017
1015
  if (this.timeoutId) {
1018
1016
  clearTimeout(this.timeoutId);
1019
1017
  this.timeoutId = undefined;
1020
1018
  }
1021
1019
  if (this.currentSnackbar) {
1022
- this.currentSnackbar.style.transform = this.getSlideTransform('bottom-right', true);
1020
+ // Slide out toward the same edge the snackbar entered from.
1021
+ this.currentSnackbar.style.transform = this.getSlideTransform(this.currentPosition, true);
1023
1022
  this.currentSnackbar.style.opacity = '0';
1024
1023
  setTimeout(() => {
1025
1024
  var _a;
@@ -1028,6 +1027,7 @@ class VizbeeSnackbar {
1028
1027
  }
1029
1028
  this.currentSnackbar = undefined;
1030
1029
  }, 300);
1030
+ (_a = this.onHide) === null || _a === void 0 ? void 0 : _a.call(this);
1031
1031
  }
1032
1032
  }
1033
1033
  getScreenScale() {
@@ -1094,6 +1094,7 @@ class VizbeeSnackbar {
1094
1094
  return ((options === null || options === void 0 ? void 0 : options.direction) || 'ltr') === 'rtl';
1095
1095
  }
1096
1096
  createSnackbar(options) {
1097
+ this.currentPosition = (options === null || options === void 0 ? void 0 : options.position) || 'bottom-right';
1097
1098
  const snackbar = document.createElement('div');
1098
1099
  snackbar.style.cssText = this.getSnackbarStyles(options);
1099
1100
  const isRtl = this.isRtl(options);
@@ -1271,6 +1272,8 @@ class VizbeeHomeSSOManager {
1271
1272
  this.isScreenSignedIn = false;
1272
1273
  /** @internal Tracks if sign-in process is currently active */
1273
1274
  this.isSignInInProgress = false;
1275
+ /** @internal Tracks which SSO modal is currently displayed to avoid redundant re-renders */
1276
+ this.currentModalType = 'none';
1274
1277
  /** @internal Information about the sender device */
1275
1278
  this.senderInfo = null;
1276
1279
  this.signInHandler = null;
@@ -1281,6 +1284,10 @@ class VizbeeHomeSSOManager {
1281
1284
  this.modalPreferences = {};
1282
1285
  this.vizbeeHomeSSOUIManager = VizbeeHomeSSOUIManager.getInstance();
1283
1286
  this.snackbar = new VizbeeSnackbar();
1287
+ // Keep tracked modal state in sync when the snackbar auto-hides.
1288
+ this.snackbar.onHide = () => {
1289
+ this.currentModalType = 'none';
1290
+ };
1284
1291
  this.vizbeeMetricsManager = new VizbeeMetricsManager();
1285
1292
  }
1286
1293
  /**
@@ -1606,6 +1613,14 @@ class VizbeeHomeSSOManager {
1606
1613
  * @internal
1607
1614
  */
1608
1615
  updateProgressUI() {
1616
+ const targetModalType = this.isRemoteSignedIn
1617
+ ? 'progress'
1618
+ : 'informational';
1619
+ // Same modal already showing; skip to avoid a hide + reshow flicker.
1620
+ if (this.currentModalType === targetModalType) {
1621
+ logger.debug(`[${LOG_TAG}][updateProgressUI] - '${targetModalType}' modal already showing, skipping re-render`);
1622
+ return;
1623
+ }
1609
1624
  if (!this.isRemoteSignedIn) {
1610
1625
  const modalOptions = this.vizbeeHomeSSOUIManager.getInformationalSignInModalConfig();
1611
1626
  this.snackbar.show(modalOptions);
@@ -1614,6 +1629,7 @@ class VizbeeHomeSSOManager {
1614
1629
  const modalOptions = this.vizbeeHomeSSOUIManager.getProgressSignInModalConfig();
1615
1630
  this.snackbar.show(Object.assign(Object.assign({}, modalOptions), { shouldAnimateIcon: true }));
1616
1631
  }
1632
+ this.currentModalType = targetModalType;
1617
1633
  }
1618
1634
  /**
1619
1635
  * Updates UI for successful sign-in
@@ -1622,8 +1638,14 @@ class VizbeeHomeSSOManager {
1622
1638
  * @internal
1623
1639
  */
1624
1640
  updateSuccessUI() {
1641
+ // Success modal already showing; leave it as-is.
1642
+ if (this.currentModalType === 'success') {
1643
+ logger.debug(`[${LOG_TAG}][updateSuccessUI] - 'success' modal already showing, skipping re-render`);
1644
+ return;
1645
+ }
1625
1646
  const modalOptions = this.vizbeeHomeSSOUIManager.getSuccessSignInModalConfig();
1626
1647
  this.snackbar.show(modalOptions);
1648
+ this.currentModalType = 'success';
1627
1649
  }
1628
1650
  /**
1629
1651
  * Updates UI for failed sign-in
@@ -1632,7 +1654,13 @@ class VizbeeHomeSSOManager {
1632
1654
  * @internal
1633
1655
  */
1634
1656
  updateFailureUI() {
1657
+ // Nothing showing; nothing to hide.
1658
+ if (this.currentModalType === 'none') {
1659
+ logger.debug(`[${LOG_TAG}][updateFailureUI] - no modal showing, nothing to hide`);
1660
+ return;
1661
+ }
1635
1662
  this.snackbar.hide();
1663
+ this.currentModalType = 'none';
1636
1664
  }
1637
1665
  }
1638
1666
  /** @internal Singleton instance of the manager */
@@ -1715,7 +1743,7 @@ const setupHomeSSO = () => {
1715
1743
  // Replaced at build time with package.json's version by
1716
1744
  // @rollup/plugin-replace (same token the metrics manager uses), so
1717
1745
  // integrators can read the loaded SDK version off the namespace.
1718
- VERSION: '1.0.7',
1746
+ VERSION: '1.0.8-rc2',
1719
1747
  };
1720
1748
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1721
1749
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizbeetv/homesso-sdk-qa",
3
- "version": "1.0.7",
3
+ "version": "1.0.8-rc2",
4
4
  "description": "TV app authentication library (QA)",
5
5
  "main": "./es5/index.cjs",
6
6
  "module": "./es5/index.mjs",
@@ -41,6 +41,8 @@ export declare class VizbeeHomeSSOManager implements VizbeeSignInStatusCallback
41
41
  private vizbeeHomeSSOUIManager;
42
42
  /** @internal Snackbar instance for showing notifications */
43
43
  private readonly snackbar;
44
+ /** @internal Tracks which SSO modal is currently displayed to avoid redundant re-renders */
45
+ private currentModalType;
44
46
  /** @internal Information about the sender device */
45
47
  private senderInfo;
46
48
  /** @internal Manager for handling metrics and analytics */
@@ -66,7 +66,10 @@ export declare class VizbeeSnackbar {
66
66
  private currentSnackbar?;
67
67
  private animationInterval?;
68
68
  private currentIconElement?;
69
+ private currentPosition;
69
70
  private readonly uiManager;
71
+ /** Invoked whenever a visible snackbar is torn down (manual hide or auto-hide). */
72
+ onHide?: () => void;
70
73
  private readonly BASE_DIMENSIONS;
71
74
  /**
72
75
  * Creates a new instance of VizbeeSnackbar