@firebase/util 1.11.0-firebase-studio-sdk-integration.bffdabd70 → 1.11.0-firebase-studio-sdk-integration.927daddb8

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.cjs.js CHANGED
@@ -718,14 +718,20 @@ function createMockUserToken(token, projectId) {
718
718
  }
719
719
  const emulatorStatus = {};
720
720
  // Checks whether any products are running on an emulator
721
- function areRunningEmulator() {
722
- let runningEmulator = false;
721
+ function getEmulatorSummary() {
722
+ const summary = {
723
+ prod: [],
724
+ emulator: []
725
+ };
723
726
  for (const key of Object.keys(emulatorStatus)) {
724
727
  if (emulatorStatus[key]) {
725
- runningEmulator = true;
728
+ summary.emulator.push(key);
729
+ }
730
+ else {
731
+ summary.prod.push(key);
726
732
  }
727
733
  }
728
- return runningEmulator;
734
+ return summary;
729
735
  }
730
736
  function getOrCreateEl(id) {
731
737
  let parentDiv = document.getElementById(id);
@@ -751,10 +757,8 @@ function updateEmulatorBanner(name, isRunningEmulator) {
751
757
  }
752
758
  emulatorStatus[name] = isRunningEmulator;
753
759
  const bannerId = '__firebase__banner';
754
- if (!areRunningEmulator()) {
755
- tearDown();
756
- return;
757
- }
760
+ const summary = getEmulatorSummary();
761
+ const showError = summary.prod.length > 0;
758
762
  function tearDown() {
759
763
  const element = document.getElementById(bannerId);
760
764
  if (element) {
@@ -785,10 +789,16 @@ function updateEmulatorBanner(name, isRunningEmulator) {
785
789
  };
786
790
  bannerEl.appendChild(firebaseText);
787
791
  bannerEl.appendChild(closeBtn);
788
- document.body.appendChild(banner.element);
792
+ document.body.appendChild(bannerEl);
793
+ }
794
+ if (showError) {
795
+ banner.element.style.background = '#cd5c5c';
796
+ firebaseText.innerText = `Product${summary.prod.length > 0 ? 's' : ''} Running in Production: ${summary.prod.join(', ')}`;
797
+ }
798
+ else {
799
+ firebaseText.innerText = 'Running in this workspace';
789
800
  }
790
801
  firebaseText.setAttribute('id', '__firebase__text');
791
- firebaseText.innerText = 'Running in this workspace';
792
802
  }
793
803
  if (document.readyState === 'loading') {
794
804
  window.addEventListener('DOMContentLoaded', setupDom);