@firebase/util 1.11.0-firebase-studio-sdk-integration.fe1264c00 → 1.11.0-firebase-studio-sdk-integration.dbac496fa
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 +59 -31
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +59 -31
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +59 -31
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +59 -31
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm2017.js
CHANGED
|
@@ -786,6 +786,7 @@ function updateEmulatorBanner(name, isRunningEmulator) {
|
|
|
786
786
|
typeof document === 'undefined' ||
|
|
787
787
|
!isCloudWorkstation(window.location.host) ||
|
|
788
788
|
emulatorStatus[name] === isRunningEmulator ||
|
|
789
|
+
emulatorStatus[name] || // If already set to use emulator, can't go back to prod.
|
|
789
790
|
previouslyDismissed) {
|
|
790
791
|
return;
|
|
791
792
|
}
|
|
@@ -802,6 +803,54 @@ function updateEmulatorBanner(name, isRunningEmulator) {
|
|
|
802
803
|
element.remove();
|
|
803
804
|
}
|
|
804
805
|
}
|
|
806
|
+
function setupBannerStyles(bannerEl) {
|
|
807
|
+
bannerEl.style.display = 'flex';
|
|
808
|
+
bannerEl.style.background = '#7faaf0';
|
|
809
|
+
bannerEl.style.position = 'absolute';
|
|
810
|
+
bannerEl.style.bottom = '5px';
|
|
811
|
+
bannerEl.style.left = '5px';
|
|
812
|
+
bannerEl.style.padding = '.5em';
|
|
813
|
+
bannerEl.style.borderRadius = '5px';
|
|
814
|
+
bannerEl.style.alignContent = 'center';
|
|
815
|
+
}
|
|
816
|
+
function setupIconStyles(prependIcon, iconId) {
|
|
817
|
+
prependIcon.setAttribute('width', '24');
|
|
818
|
+
prependIcon.setAttribute('id', iconId);
|
|
819
|
+
prependIcon.setAttribute('height', '24');
|
|
820
|
+
prependIcon.setAttribute('viewBox', '0 0 24 24');
|
|
821
|
+
prependIcon.setAttribute('fill', 'none');
|
|
822
|
+
prependIcon.style.marginLeft = '-6px';
|
|
823
|
+
}
|
|
824
|
+
function setupCloseBtn() {
|
|
825
|
+
const closeBtn = document.createElement('span');
|
|
826
|
+
closeBtn.style.cursor = 'pointer';
|
|
827
|
+
closeBtn.style.paddingLeft = '5px';
|
|
828
|
+
closeBtn.style.width = '10px';
|
|
829
|
+
closeBtn.innerHTML = ' ×';
|
|
830
|
+
closeBtn.onclick = () => {
|
|
831
|
+
previouslyDismissed = true;
|
|
832
|
+
tearDown();
|
|
833
|
+
};
|
|
834
|
+
return closeBtn;
|
|
835
|
+
}
|
|
836
|
+
function setupLinkStyles(learnMoreLink, learnMoreId, svgElement) {
|
|
837
|
+
learnMoreLink.setAttribute('id', learnMoreId);
|
|
838
|
+
learnMoreLink.innerText = 'Learn more';
|
|
839
|
+
learnMoreLink.href =
|
|
840
|
+
'http://firebase.google.com/docs/studio/deploy-app#emulator ';
|
|
841
|
+
learnMoreLink.setAttribute('target', '__blank');
|
|
842
|
+
learnMoreLink.style.paddingLeft = '5px';
|
|
843
|
+
learnMoreLink.style.textDecoration = 'underline';
|
|
844
|
+
learnMoreLink.appendChild(svgElement);
|
|
845
|
+
}
|
|
846
|
+
function setupOpenExternal(svgElement, id) {
|
|
847
|
+
svgElement.setAttribute('viewBox', '0 0 16 16');
|
|
848
|
+
svgElement.setAttribute('fill', 'none');
|
|
849
|
+
svgElement.setAttribute('id', id);
|
|
850
|
+
svgElement.style.width = '16px';
|
|
851
|
+
svgElement.style.marginLeft = '4px';
|
|
852
|
+
svgElement.innerHTML = `<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6667 12.6667H3.33333V3.33333H8V2H3.33333C2.59333 2 2 2.6 2 3.33333V12.6667C2 13.4 2.59333 14 3.33333 14H12.6667C13.4 14 14 13.4 14 12.6667V8H12.6667V12.6667ZM9.33333 2V3.33333H11.7267L5.17333 9.88667L6.11333 10.8267L12.6667 4.27333V6.66667H14V2H9.33333Z" fill="#212121"/>`;
|
|
853
|
+
}
|
|
805
854
|
function setupDom() {
|
|
806
855
|
const banner = getOrCreateEl(bannerId);
|
|
807
856
|
const firebaseTextId = prefixedId('text');
|
|
@@ -812,41 +861,22 @@ function updateEmulatorBanner(name, isRunningEmulator) {
|
|
|
812
861
|
const prependIconId = prefixedId('preprendIcon');
|
|
813
862
|
const prependIcon = document.getElementById(prependIconId) ||
|
|
814
863
|
document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
864
|
+
const openExternalIconId = prefixedId('openexternal');
|
|
865
|
+
const openExternalIcon = document.getElementById(openExternalIconId) ||
|
|
866
|
+
document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
815
867
|
if (banner.created) {
|
|
816
868
|
// update styles
|
|
817
869
|
const bannerEl = banner.element;
|
|
818
|
-
bannerEl
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
bannerEl.
|
|
824
|
-
bannerEl.style.borderRadius = '5px';
|
|
825
|
-
bannerEl.style.alignContent = 'center';
|
|
826
|
-
const closeBtn = document.createElement('span');
|
|
827
|
-
closeBtn.style.cursor = 'pointer';
|
|
828
|
-
closeBtn.style.paddingLeft = '5px';
|
|
829
|
-
closeBtn.innerHTML = ' ×';
|
|
830
|
-
closeBtn.onclick = () => {
|
|
831
|
-
previouslyDismissed = true;
|
|
832
|
-
tearDown();
|
|
833
|
-
};
|
|
834
|
-
learnMoreLink.setAttribute('id', learnMoreId);
|
|
835
|
-
learnMoreLink.href =
|
|
836
|
-
'http://firebase.google.com/docs/studio/deploy-app#emulator ';
|
|
837
|
-
bannerEl.appendChild(prependIcon);
|
|
838
|
-
bannerEl.appendChild(firebaseText);
|
|
839
|
-
bannerEl.appendChild(learnMoreLink);
|
|
840
|
-
bannerEl.appendChild(closeBtn);
|
|
841
|
-
prependIcon.setAttribute('width', '24');
|
|
842
|
-
prependIcon.setAttribute('id', prependIconId);
|
|
843
|
-
prependIcon.setAttribute('height', '24');
|
|
844
|
-
prependIcon.setAttribute('viewBox', '0 0 24 24');
|
|
845
|
-
prependIcon.setAttribute('fill', 'none');
|
|
870
|
+
setupBannerStyles(bannerEl);
|
|
871
|
+
setupOpenExternal(openExternalIcon, openExternalIconId);
|
|
872
|
+
setupLinkStyles(learnMoreLink, learnMoreId, openExternalIcon);
|
|
873
|
+
const closeBtn = setupCloseBtn();
|
|
874
|
+
setupIconStyles(prependIcon, prependIconId);
|
|
875
|
+
bannerEl.append(prependIcon, firebaseText, learnMoreLink, openExternalIcon, closeBtn);
|
|
846
876
|
document.body.appendChild(bannerEl);
|
|
847
877
|
}
|
|
848
878
|
if (showError) {
|
|
849
|
-
firebaseText.innerText = `
|
|
879
|
+
firebaseText.innerText = `Not using emulated backend.`;
|
|
850
880
|
prependIcon.innerHTML = `<g clip-path="url(#clip0_6013_33858)">
|
|
851
881
|
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
|
852
882
|
</g>
|
|
@@ -866,8 +896,6 @@ function updateEmulatorBanner(name, isRunningEmulator) {
|
|
|
866
896
|
</clipPath>
|
|
867
897
|
</defs>`;
|
|
868
898
|
firebaseText.innerText = 'Using emulated backend';
|
|
869
|
-
learnMoreLink.href =
|
|
870
|
-
'https://firebase.google.com/docs/studio/solution-build-with-ai';
|
|
871
899
|
}
|
|
872
900
|
firebaseText.setAttribute('id', firebaseTextId);
|
|
873
901
|
}
|