@firebase/util 1.11.0-firebase-studio-sdk-integration.fe1264c00 → 1.11.0-firebase-studio-sdk-integration.a528caf5f
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 +56 -31
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +56 -31
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +56 -31
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +56 -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,51 @@ 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.innerHTML = ' ×';
|
|
829
|
+
closeBtn.onclick = () => {
|
|
830
|
+
previouslyDismissed = true;
|
|
831
|
+
tearDown();
|
|
832
|
+
};
|
|
833
|
+
return closeBtn;
|
|
834
|
+
}
|
|
835
|
+
function setupLinkStyles(learnMoreLink, learnMoreId) {
|
|
836
|
+
learnMoreLink.setAttribute('id', learnMoreId);
|
|
837
|
+
learnMoreLink.innerText = 'Learn more';
|
|
838
|
+
learnMoreLink.href =
|
|
839
|
+
'http://firebase.google.com/docs/studio/deploy-app#emulator ';
|
|
840
|
+
learnMoreLink.setAttribute('target', '__blank');
|
|
841
|
+
learnMoreLink.style.paddingLeft = '5px';
|
|
842
|
+
}
|
|
843
|
+
function setupOpenExternal(svgElement, id) {
|
|
844
|
+
svgElement.setAttribute('viewBox', '0 0 16 16');
|
|
845
|
+
svgElement.setAttribute('fill', 'none');
|
|
846
|
+
svgElement.setAttribute('id', id);
|
|
847
|
+
svgElement.style.width = '16px';
|
|
848
|
+
svgElement.style.marginLeft = '4px';
|
|
849
|
+
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"/>`;
|
|
850
|
+
}
|
|
805
851
|
function setupDom() {
|
|
806
852
|
const banner = getOrCreateEl(bannerId);
|
|
807
853
|
const firebaseTextId = prefixedId('text');
|
|
@@ -812,41 +858,22 @@ function updateEmulatorBanner(name, isRunningEmulator) {
|
|
|
812
858
|
const prependIconId = prefixedId('preprendIcon');
|
|
813
859
|
const prependIcon = document.getElementById(prependIconId) ||
|
|
814
860
|
document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
861
|
+
const openExternalIconId = prefixedId('openexternal');
|
|
862
|
+
const openExternalIcon = document.getElementById(openExternalIconId) ||
|
|
863
|
+
document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
815
864
|
if (banner.created) {
|
|
816
865
|
// update styles
|
|
817
866
|
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');
|
|
867
|
+
setupBannerStyles(bannerEl);
|
|
868
|
+
setupLinkStyles(learnMoreLink, learnMoreId);
|
|
869
|
+
setupOpenExternal(openExternalIcon, openExternalIconId);
|
|
870
|
+
const closeBtn = setupCloseBtn();
|
|
871
|
+
setupIconStyles(prependIcon, prependIconId);
|
|
872
|
+
bannerEl.append(prependIcon, firebaseText, learnMoreLink, openExternalIcon, closeBtn);
|
|
846
873
|
document.body.appendChild(bannerEl);
|
|
847
874
|
}
|
|
848
875
|
if (showError) {
|
|
849
|
-
firebaseText.innerText = `
|
|
876
|
+
firebaseText.innerText = `Not using emulated backend.`;
|
|
850
877
|
prependIcon.innerHTML = `<g clip-path="url(#clip0_6013_33858)">
|
|
851
878
|
<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
879
|
</g>
|
|
@@ -866,8 +893,6 @@ function updateEmulatorBanner(name, isRunningEmulator) {
|
|
|
866
893
|
</clipPath>
|
|
867
894
|
</defs>`;
|
|
868
895
|
firebaseText.innerText = 'Using emulated backend';
|
|
869
|
-
learnMoreLink.href =
|
|
870
|
-
'https://firebase.google.com/docs/studio/solution-build-with-ai';
|
|
871
896
|
}
|
|
872
897
|
firebaseText.setAttribute('id', firebaseTextId);
|
|
873
898
|
}
|