cloudcommerce 0.8.4 → 0.8.6
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/CHANGELOG.md +23 -0
- package/ecomplus-stores/monocard/functions/core/package.json +1 -1
- package/ecomplus-stores/monocard/functions/events/package.json +2 -2
- package/ecomplus-stores/monocard/functions/modules/package.json +2 -2
- package/ecomplus-stores/monocard/functions/passport/package.json +2 -2
- package/ecomplus-stores/monocard/functions/ssr/package.json +7 -8
- package/ecomplus-stores/monocard/functions/ssr/scripts/build.sh +14 -0
- package/ecomplus-stores/monocard/functions/ssr/src/components/CasesGrid.astro +1 -1
- package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.astro +2 -4
- package/ecomplus-stores/monocard/package.json +1 -1
- package/package.json +9 -9
- package/packages/api/package.json +2 -2
- package/packages/apps/correios/lib-mjs/calculate-correios.mjs +3 -3
- package/packages/apps/correios/package.json +2 -2
- package/packages/apps/custom-payment/package.json +2 -2
- package/packages/apps/custom-shipping/package.json +2 -2
- package/packages/apps/datafrete/package.json +2 -2
- package/packages/apps/discounts/package.json +2 -2
- package/packages/apps/emails/package.json +3 -3
- package/packages/apps/fb-conversions/package.json +2 -2
- package/packages/apps/frenet/package.json +2 -2
- package/packages/apps/galaxpay/package.json +2 -2
- package/packages/apps/galaxpay/scripts/build.sh +1 -2
- package/packages/apps/google-analytics/package.json +2 -2
- package/packages/apps/infinitepay/package.json +2 -2
- package/packages/apps/infinitepay/scripts/build.sh +1 -2
- package/packages/apps/jadlog/package.json +2 -2
- package/packages/apps/loyalty-points/package.json +2 -2
- package/packages/apps/melhor-envio/package.json +2 -2
- package/packages/apps/mercadopago/package.json +2 -2
- package/packages/apps/mercadopago/scripts/build.sh +1 -2
- package/packages/apps/pagarme/package.json +2 -2
- package/packages/apps/pagarme/scripts/build.sh +1 -2
- package/packages/apps/paghiper/package.json +2 -2
- package/packages/apps/pix/package.json +2 -2
- package/packages/apps/tiny-erp/package.json +2 -2
- package/packages/apps/webhooks/package.json +2 -2
- package/packages/cli/package.json +3 -3
- package/packages/config/package.json +2 -2
- package/packages/emails/package.json +2 -2
- package/packages/events/package.json +2 -2
- package/packages/firebase/package.json +2 -2
- package/packages/i18n/package.json +2 -2
- package/packages/modules/package.json +3 -3
- package/packages/passport/package.json +2 -2
- package/packages/ssr/package.json +2 -2
- package/packages/storefront/astro.config.mjs +1 -1
- package/packages/storefront/dist/client/_astro/{PitchBar.db7cd775.js → PitchBar.5d55c359.js} +1 -1
- package/packages/storefront/dist/client/_astro/{ShopHeader.e93c8274.js → ShopHeader.6bbe1a17.js} +1 -1
- package/packages/storefront/dist/client/_astro/_...slug_.45f0edaf.css +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.72e91a3e.js → firebase-app.d090c84e.js} +5 -5
- package/packages/storefront/dist/client/_astro/{hoisted.721ad75d.js → hoisted.541b5c05.js} +1 -1
- package/packages/storefront/dist/client/_astro/index.ff4f0b30.js +1 -0
- package/packages/storefront/dist/client/_astro/{workbox-window.prod.es5.295a6886.js → workbox-window.prod.es5.dc90f814.js} +1 -1
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/pages/{all.090434f8.mjs → all.94de1b69.mjs} +114 -38
- package/packages/storefront/dist/server/entry.mjs +2 -2
- package/packages/storefront/package.json +8 -8
- package/packages/storefront/scripts/build-prod.sh +18 -6
- package/packages/storefront/src/images/Picture.runtime.astro +52 -0
- package/packages/storefront/src/{serverless/get-image.ts → images/get-built-image.ts} +3 -3
- package/packages/storefront/src/{serverless/get-picture.ts → images/get-built-picture.ts} +3 -3
- package/packages/storefront/src/images/use-ssr-picture.ts +138 -0
- package/packages/storefront/src/lib/assets/base.css +0 -5
- package/packages/storefront/src/lib/components/Picture.astro +28 -77
- package/packages/storefront/src/lib/layouts/BaseHead.astro +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/client/_astro/_...slug_.0607a6ef.css +0 -1
- package/packages/storefront/dist/client/_astro/index.16f33784.js +0 -1
- package/packages/storefront/src/serverless/Picture.runtime.astro +0 -102
package/packages/storefront/dist/client/_astro/{firebase-app.72e91a3e.js → firebase-app.d090c84e.js}
RENAMED
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
209
209
|
* See the License for the specific language governing permissions and
|
|
210
210
|
* limitations under the License.
|
|
211
|
-
*/class or{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(ar(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function ar(n){const e=n.getComponent();return e?.type==="VERSION"}const xe="@firebase/app",at="0.9.
|
|
211
|
+
*/class or{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(ar(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function ar(n){const e=n.getComponent();return e?.type==="VERSION"}const xe="@firebase/app",at="0.9.5";/**
|
|
212
212
|
* @license
|
|
213
213
|
* Copyright 2019 Google LLC
|
|
214
214
|
*
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
224
224
|
* See the License for the specific language governing permissions and
|
|
225
225
|
* limitations under the License.
|
|
226
|
-
*/const M=new Nt("@firebase/app"),cr="@firebase/app-compat",lr="@firebase/analytics-compat",ur="@firebase/analytics",dr="@firebase/app-check-compat",hr="@firebase/app-check",fr="@firebase/auth",pr="@firebase/auth-compat",gr="@firebase/database",mr="@firebase/database-compat",_r="@firebase/functions",vr="@firebase/functions-compat",Ir="@firebase/installations",yr="@firebase/installations-compat",br="@firebase/messaging",Er="@firebase/messaging-compat",wr="@firebase/performance",Tr="@firebase/performance-compat",Sr="@firebase/remote-config",kr="@firebase/remote-config-compat",Ar="@firebase/storage",Rr="@firebase/storage-compat",Cr="@firebase/firestore",Or="@firebase/firestore-compat",Dr="firebase",Pr="9.
|
|
226
|
+
*/const M=new Nt("@firebase/app"),cr="@firebase/app-compat",lr="@firebase/analytics-compat",ur="@firebase/analytics",dr="@firebase/app-check-compat",hr="@firebase/app-check",fr="@firebase/auth",pr="@firebase/auth-compat",gr="@firebase/database",mr="@firebase/database-compat",_r="@firebase/functions",vr="@firebase/functions-compat",Ir="@firebase/installations",yr="@firebase/installations-compat",br="@firebase/messaging",Er="@firebase/messaging-compat",wr="@firebase/performance",Tr="@firebase/performance-compat",Sr="@firebase/remote-config",kr="@firebase/remote-config-compat",Ar="@firebase/storage",Rr="@firebase/storage-compat",Cr="@firebase/firestore",Or="@firebase/firestore-compat",Dr="firebase",Pr="9.18.0";/**
|
|
227
227
|
* @license
|
|
228
228
|
* Copyright 2019 Google LLC
|
|
229
229
|
*
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
344
344
|
* See the License for the specific language governing permissions and
|
|
345
345
|
* limitations under the License.
|
|
346
|
-
*/function Gr(n){K(new H("platform-logger",e=>new or(e),"PRIVATE")),K(new H("heartbeat",e=>new Wr(e),"PRIVATE")),B(xe,at,n),B(xe,at,"esm2017"),B("fire-js","")}Gr("");var Kr="firebase",qr="9.
|
|
346
|
+
*/function Gr(n){K(new H("platform-logger",e=>new or(e),"PRIVATE")),K(new H("heartbeat",e=>new Wr(e),"PRIVATE")),B(xe,at,n),B(xe,at,"esm2017"),B("fire-js","")}Gr("");var Kr="firebase",qr="9.18.0";/**
|
|
347
347
|
* @license
|
|
348
348
|
* Copyright 2020 Google LLC
|
|
349
349
|
*
|
|
@@ -658,7 +658,7 @@
|
|
|
658
658
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
659
659
|
* See the License for the specific language governing permissions and
|
|
660
660
|
* limitations under the License.
|
|
661
|
-
*/function w(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class N{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=We(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ui(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new zt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await J(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return ai(this,e)}reload(){return di(this)}_assign(e){this!==e&&(u(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){
|
|
661
|
+
*/function w(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class N{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=We(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ui(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new zt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await J(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return ai(this,e)}reload(){return di(this)}_assign(e){this!==e&&(u(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new N(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){u(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await he(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await J(this,si(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,s,o,a,c,l,d;const f=(r=t.displayName)!==null&&r!==void 0?r:void 0,g=(i=t.email)!==null&&i!==void 0?i:void 0,I=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,U=(o=t.photoURL)!==null&&o!==void 0?o:void 0,Xe=(a=t.tenantId)!==null&&a!==void 0?a:void 0,Te=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,Qe=(l=t.createdAt)!==null&&l!==void 0?l:void 0,Ze=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:Se,emailVerified:et,isAnonymous:tt,providerData:ke,stsTokenManager:nt}=t;u(Se&&nt,e,"internal-error");const mn=Y.fromJSON(this.name,nt);u(typeof Se=="string",e,"internal-error"),w(f,e.name),w(g,e.name),u(typeof et=="boolean",e,"internal-error"),u(typeof tt=="boolean",e,"internal-error"),w(I,e.name),w(U,e.name),w(Xe,e.name),w(Te,e.name),w(Qe,e.name),w(Ze,e.name);const Ae=new N({uid:Se,auth:e,email:g,emailVerified:et,displayName:f,isAnonymous:tt,photoURL:U,phoneNumber:I,tenantId:Xe,stsTokenManager:mn,createdAt:Qe,lastLoginAt:Ze});return ke&&Array.isArray(ke)&&(Ae.providerData=ke.map(_n=>Object.assign({},_n))),Te&&(Ae._redirectEventId=Te),Ae}static async _fromIdTokenResponse(e,t,r=!1){const i=new Y;i.updateFromServerResponse(t);const s=new N({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await he(s),s}}/**
|
|
662
662
|
* @license
|
|
663
663
|
* Copyright 2019 Google LLC
|
|
664
664
|
*
|
|
@@ -1378,7 +1378,7 @@
|
|
|
1378
1378
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1379
1379
|
* See the License for the specific language governing permissions and
|
|
1380
1380
|
* limitations under the License.
|
|
1381
|
-
*/const Me="webStorageSupport";class $s{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ln,this._completeRedirectFn=ds,this._overrideRedirectResult=cs}async _openPopup(e,t,r,i){var s;E((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=Tt(e,t,r,de(),i);return Ls(e,o,Je())}async _openRedirect(e,t,r,i){return await this._originValidation(e),Hi(Tt(e,t,r,de(),i)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(E(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Cs(e),r=new fs(e);return t.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Me,{type:Me},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Me];o!==void 0&&t(!!o),m(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=vs(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Zt()||Ke()||Ie()}}const Hs=$s;var St="@firebase/auth",kt="0.21.
|
|
1381
|
+
*/const Me="webStorageSupport";class $s{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ln,this._completeRedirectFn=ds,this._overrideRedirectResult=cs}async _openPopup(e,t,r,i){var s;E((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=Tt(e,t,r,de(),i);return Ls(e,o,Je())}async _openRedirect(e,t,r,i){return await this._originValidation(e),Hi(Tt(e,t,r,de(),i)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(E(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Cs(e),r=new fs(e);return t.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Me,{type:Me},i=>{var s;const o=(s=i?.[0])===null||s===void 0?void 0:s[Me];o!==void 0&&t(!!o),m(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=vs(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Zt()||Ke()||Ie()}}const Hs=$s;var St="@firebase/auth",kt="0.21.5";/**
|
|
1382
1382
|
* @license
|
|
1383
1383
|
* Copyright 2020 Google LLC
|
|
1384
1384
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./session-utm.72684b84.js";import{_ as u}from"./preload-helper.101896b7.js";function v(d={}){const{immediate:l=!1,onNeedRefresh:g,onOfflineReady:t,onRegistered:r,onRegisteredSW:o,onRegisterError:s}=d;let i,n;const c=async(a=!0)=>{await n};async function f(){if("serviceWorker"in navigator){const{Workbox:a}=await u(()=>import("./workbox-window.prod.es5.
|
|
1
|
+
import"./session-utm.72684b84.js";import{_ as u}from"./preload-helper.101896b7.js";function v(d={}){const{immediate:l=!1,onNeedRefresh:g,onOfflineReady:t,onRegistered:r,onRegisteredSW:o,onRegisterError:s}=d;let i,n;const c=async(a=!0)=>{await n};async function f(){if("serviceWorker"in navigator){const{Workbox:a}=await u(()=>import("./workbox-window.prod.es5.dc90f814.js"),[]);i=new a("/sw.js",{scope:"/",type:"classic"}),i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||t?.()}),i.register({immediate:l}).then(e=>{o?o("/sw.js",e):r?.(e)}).catch(e=>{s?.(e)})}}return n=f(),c}v({immediate:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{L as U,f as E,r as b,M as G,N as M,O as X,B as x,m as K}from"./_plugin-vue_export-helper.77ed7c18.js";var C;const S=typeof window<"u",Y=e=>typeof e=="string",y=()=>{};S&&((C=window?.navigator)!=null&&C.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function _(e){return typeof e=="function"?e():U(e)}function $(e,n){function t(...r){return new Promise((o,s)=>{Promise.resolve(e(()=>n.apply(this,r),{fn:n,thisArg:this,args:r})).then(o).catch(s)})}return t}function q(e,n={}){let t,r,o=y;const s=u=>{clearTimeout(u),o(),o=y};return u=>{const f=_(e),i=_(n.maxWait);return t&&s(t),f<=0||i!==void 0&&i<=0?(r&&(s(r),r=null),Promise.resolve(u())):new Promise((a,d)=>{o=n.rejectOnCancel?d:a,i&&!r&&(r=setTimeout(()=>{t&&s(t),r=null,a(u())},i)),t=setTimeout(()=>{r&&s(r),r=null,a(u())},f)})}}function z(e,n=!0,t=!0,r=!1){let o=0,s,l=!0,u=y,f;const i=()=>{s&&(clearTimeout(s),s=void 0,u(),u=y)};return d=>{const p=_(e),w=Date.now()-o,T=()=>f=d();if(i(),p<=0)return o=Date.now(),T();if(w>p&&(t||!l))o=Date.now(),T();else if(n)return new Promise((O,m)=>{u=r?m:O,s=setTimeout(()=>{o=Date.now(),l=!0,O(T()),i()},p-w)});return!t&&!s&&(s=setTimeout(()=>l=!0,p)),l=!1,f}}function de(e,n=!1,t="Timeout"){return new Promise((r,o)=>{setTimeout(n?()=>o(t):r,e)})}function J(e){return e}function B(e){return M()?(X(e),!0):!1}function Z(e,n=200,t={}){return $(q(n,t),e)}function k(e,n=200,t=!1,r=!0,o=!1){return $(z(n,t,r,o),e)}function ee(e,n,t={}){const{immediate:r=!0}=t,o=b(!1);let s=null;function l(){s&&(clearTimeout(s),s=null)}function u(){o.value=!1,l()}function f(...i){l(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=null,e(...i)},_(n))}return r&&(o.value=!0,S&&f()),B(u),{isPending:G(o),start:f,stop:u}}var te=Object.defineProperty,D=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,H=(e,n,t)=>n in e?te(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,oe=(e,n)=>{for(var t in n||(n={}))ne.call(n,t)&&H(e,t,n[t]);if(D)for(var t of D(n))re.call(n,t)&&H(e,t,n[t]);return e};function me(e=1e3,n={}){const{controls:t=!1,callback:r}=n,o=ee(r??y,e,n),s=E(()=>!o.isPending.value);return t?oe({ready:s},o):s}function se(e){var n;const t=_(e);return(n=t?.$el)!=null?n:t}const ae=S?window:void 0;function I(...e){let n,t,r,o;if(Y(e[0])||Array.isArray(e[0])?([t,r,o]=e,n=ae):[n,t,r,o]=e,!n)return y;Array.isArray(t)||(t=[t]),Array.isArray(r)||(r=[r]);const s=[],l=()=>{s.forEach(a=>a()),s.length=0},u=(a,d,p)=>(a.addEventListener(d,p,o),()=>a.removeEventListener(d,p,o)),f=K(()=>se(n),a=>{l(),a&&s.push(...t.flatMap(d=>r.map(p=>u(a,d,p))))},{immediate:!0,flush:"post"}),i=()=>{f(),l()};return B(i),i}const N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Q="__vueuse_ssr_handlers__";N[Q]=N[Q]||{};function ve(e){const n=b(!1);return I(e,"mouseenter",()=>n.value=!0),I(e,"mouseleave",()=>n.value=!1),n}const F=1;function _e(e,n={}){const{throttle:t=0,idle:r=200,onStop:o=y,onScroll:s=y,offset:l={left:0,right:0,top:0,bottom:0},eventListenerOptions:u={capture:!1,passive:!0},behavior:f="auto"}=n,i=b(0),a=b(0),d=E({get(){return i.value},set(c){w(c,void 0)}}),p=E({get(){return a.value},set(c){w(void 0,c)}});function w(c,g){var h,v,A;const P=_(e);P&&((A=P instanceof Document?document.body:P)==null||A.scrollTo({top:(h=_(g))!=null?h:p.value,left:(v=_(c))!=null?v:d.value,behavior:_(f)}))}const T=b(!1),O=x({left:!0,right:!1,top:!0,bottom:!1}),m=x({left:!1,right:!1,top:!1,bottom:!1}),V=Z(c=>{T.value=!1,m.left=!1,m.right=!1,m.top=!1,m.bottom=!1,o(c)},t+r),L=c=>{const g=c.target===document?c.target.documentElement:c.target,h=g.scrollLeft;m.left=h<i.value,m.right=h>a.value,O.left=h<=0+(l.left||0),O.right=h+g.clientWidth>=g.scrollWidth-(l.right||0)-F,i.value=h;let v=g.scrollTop;c.target===document&&!v&&(v=document.body.scrollTop),m.top=v<a.value,m.bottom=v>a.value,O.top=v<=0+(l.top||0),O.bottom=v+g.clientHeight>=g.scrollHeight-(l.bottom||0)-F,a.value=v,T.value=!0,V(c),s(c)};return I(e,"scroll",t?k(L,t,!0,!1):L,u),{x:d,y:p,isScrolling:T,arrivedState:O,directions:m}}var W;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(W||(W={}));var le=Object.defineProperty,j=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,R=(e,n,t)=>n in e?le(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ce=(e,n)=>{for(var t in n||(n={}))ue.call(n,t)&&R(e,t,n[t]);if(j)for(var t of j(n))ie.call(n,t)&&R(e,t,n[t]);return e};const fe={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};ce({linear:J},fe);export{ve as a,Z as b,me as c,de as p,_e as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
try{self["workbox:window:6.5.3"]&&_()}catch{}function S(t,r){return new Promise(function(e){var i=new MessageChannel;i.port1.onmessage=function(f){e(f.data)},t.postMessage(r,[i.port2])})}function W(t,r){for(var e=0;e<r.length;e++){var i=r[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function E(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,i=new Array(r);e<r;e++)i[e]=t[e];return i}function k(t,r){var e;if(typeof Symbol>"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(e=function(f,d){if(f){if(typeof f=="string")return E(f,d);var h=Object.prototype.toString.call(f).slice(8,-1);return h==="Object"&&f.constructor&&(h=f.constructor.name),h==="Map"||h==="Set"?Array.from(f):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?E(f,d):void 0}}(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(e=t[Symbol.iterator]()).next.bind(e)}try{self["workbox:core:6.5.3"]&&_()}catch{}var y=function(){var t=this;this.promise=new Promise(function(r,e){t.resolve=r,t.reject=e})};function b(t,r){var e=location.href;return new URL(t,e).href===new URL(r,e).href}var g=function(t,r){this.type=t,Object.assign(this,r)};function p(t,r,e){return e?r?r(t):t:(t&&t.then||(t=Promise.resolve(t)),r?t.then(r):t)}function L(){}var j={type:"SKIP_WAITING"};function P(t,r){if(!r)return t&&t.then?t.then(L):Promise.resolve()}var x=function(t){var r,e;function i(v,c){var n,o;return c===void 0&&(c={}),(n=t.call(this)||this).nn={},n.tn=0,n.rn=new y,n.en=new y,n.on=new y,n.un=0,n.an=new Set,n.cn=function(){var s=n.fn,a=s.installing;n.tn>0||!b(a.scriptURL,n.sn.toString())||performance.now()>n.un+6e4?(n.vn=a,s.removeEventListener("updatefound",n.cn)):(n.hn=a,n.an.add(a),n.rn.resolve(a)),++n.tn,a.addEventListener("statechange",n.ln)},n.ln=function(s){var a=n.fn,u=s.target,l=u.state,m=u===n.vn,w={sw:u,isExternal:m,originalEvent:s};!m&&n.mn&&(w.isUpdate=!0),n.dispatchEvent(new g(l,w)),l==="installed"?n.wn=self.setTimeout(function(){l==="installed"&&a.waiting===u&&n.dispatchEvent(new g("waiting",w))},200):l==="activating"&&(clearTimeout(n.wn),m||n.en.resolve(u))},n.dn=function(s){var a=n.hn,u=a!==navigator.serviceWorker.controller;n.dispatchEvent(new g("controlling",{isExternal:u,originalEvent:s,sw:a,isUpdate:n.mn})),u||n.on.resolve(a)},n.gn=(o=function(s){var a=s.data,u=s.ports,l=s.source;return p(n.getSW(),function(){n.an.has(l)&&n.dispatchEvent(new g("message",{data:a,originalEvent:s,ports:u,sw:l}))})},function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];try{return Promise.resolve(o.apply(this,s))}catch(u){return Promise.reject(u)}}),n.sn=v,n.nn=c,navigator.serviceWorker.addEventListener("message",n.gn),n}e=t,(r=i).prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var f,d,h=i.prototype;return h.register=function(v){var c=(v===void 0?{}:v).immediate,n=c!==void 0&&c;try{var o=this;return function(s,a){var u=s();return u&&u.then?u.then(a):a(u)}(function(){if(!n&&document.readyState!=="complete")return P(new Promise(function(s){return window.addEventListener("load",s)}))},function(){return o.mn
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(e=t[Symbol.iterator]()).next.bind(e)}try{self["workbox:core:6.5.3"]&&_()}catch{}var y=function(){var t=this;this.promise=new Promise(function(r,e){t.resolve=r,t.reject=e})};function b(t,r){var e=location.href;return new URL(t,e).href===new URL(r,e).href}var g=function(t,r){this.type=t,Object.assign(this,r)};function p(t,r,e){return e?r?r(t):t:(t&&t.then||(t=Promise.resolve(t)),r?t.then(r):t)}function L(){}var j={type:"SKIP_WAITING"};function P(t,r){if(!r)return t&&t.then?t.then(L):Promise.resolve()}var x=function(t){var r,e;function i(v,c){var n,o;return c===void 0&&(c={}),(n=t.call(this)||this).nn={},n.tn=0,n.rn=new y,n.en=new y,n.on=new y,n.un=0,n.an=new Set,n.cn=function(){var s=n.fn,a=s.installing;n.tn>0||!b(a.scriptURL,n.sn.toString())||performance.now()>n.un+6e4?(n.vn=a,s.removeEventListener("updatefound",n.cn)):(n.hn=a,n.an.add(a),n.rn.resolve(a)),++n.tn,a.addEventListener("statechange",n.ln)},n.ln=function(s){var a=n.fn,u=s.target,l=u.state,m=u===n.vn,w={sw:u,isExternal:m,originalEvent:s};!m&&n.mn&&(w.isUpdate=!0),n.dispatchEvent(new g(l,w)),l==="installed"?n.wn=self.setTimeout(function(){l==="installed"&&a.waiting===u&&n.dispatchEvent(new g("waiting",w))},200):l==="activating"&&(clearTimeout(n.wn),m||n.en.resolve(u))},n.dn=function(s){var a=n.hn,u=a!==navigator.serviceWorker.controller;n.dispatchEvent(new g("controlling",{isExternal:u,originalEvent:s,sw:a,isUpdate:n.mn})),u||n.on.resolve(a)},n.gn=(o=function(s){var a=s.data,u=s.ports,l=s.source;return p(n.getSW(),function(){n.an.has(l)&&n.dispatchEvent(new g("message",{data:a,originalEvent:s,ports:u,sw:l}))})},function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];try{return Promise.resolve(o.apply(this,s))}catch(u){return Promise.reject(u)}}),n.sn=v,n.nn=c,navigator.serviceWorker.addEventListener("message",n.gn),n}e=t,(r=i).prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e;var f,d,h=i.prototype;return h.register=function(v){var c=(v===void 0?{}:v).immediate,n=c!==void 0&&c;try{var o=this;return function(s,a){var u=s();return u&&u.then?u.then(a):a(u)}(function(){if(!n&&document.readyState!=="complete")return P(new Promise(function(s){return window.addEventListener("load",s)}))},function(){return o.mn=!!navigator.serviceWorker.controller,o.yn=o.pn(),p(o.bn(),function(s){o.fn=s,o.yn&&(o.hn=o.yn,o.en.resolve(o.yn),o.on.resolve(o.yn),o.yn.addEventListener("statechange",o.ln,{once:!0}));var a=o.fn.waiting;return a&&b(a.scriptURL,o.sn.toString())&&(o.hn=a,Promise.resolve().then(function(){o.dispatchEvent(new g("waiting",{sw:a,wasWaitingBeforeRegister:!0}))}).then(function(){})),o.hn&&(o.rn.resolve(o.hn),o.an.add(o.hn)),o.fn.addEventListener("updatefound",o.cn),navigator.serviceWorker.addEventListener("controllerchange",o.dn),o.fn})})}catch(s){return Promise.reject(s)}},h.update=function(){try{return this.fn?P(this.fn.update()):void 0}catch(v){return Promise.reject(v)}},h.getSW=function(){return this.hn!==void 0?Promise.resolve(this.hn):this.rn.promise},h.messageSW=function(v){try{return p(this.getSW(),function(c){return S(c,v)})}catch(c){return Promise.reject(c)}},h.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&S(this.fn.waiting,j)},h.pn=function(){var v=navigator.serviceWorker.controller;return v&&b(v.scriptURL,this.sn.toString())?v:void 0},h.bn=function(){try{var v=this;return function(c,n){try{var o=c()}catch(s){return n(s)}return o&&o.then?o.then(void 0,n):o}(function(){return p(navigator.serviceWorker.register(v.sn,v.nn),function(c){return v.un=performance.now(),c})},function(c){throw c})}catch(c){return Promise.reject(c)}},f=i,(d=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&W(f.prototype,d),i}(function(){function t(){this.Pn=new Map}var r=t.prototype;return r.addEventListener=function(e,i){this.Sn(e).add(i)},r.removeEventListener=function(e,i){this.Sn(e).delete(i)},r.dispatchEvent=function(e){e.target=this;for(var i,f=k(this.Sn(e.type));!(i=f()).done;)(0,i.value)(e)},r.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},t}());export{x as Workbox,g as WorkboxEvent,S as messageSW};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const r=(r,n)=>(r=new URL(r+".js",n).href,s[r]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=s,document.head.appendChild(e)}else e=r,importScripts(r),s()})).then((()=>{let e=s[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(n,i)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let l={};const a=e=>r(e,o),t={module:{uri:o},exports:l,require:a};s[o]=Promise.all(n.map((e=>t[e]||a(e)))).then((e=>(i(...e),l)))}}define(["./workbox-e0d788d4"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"_astro/_...slug_.
|
|
1
|
+
if(!self.define){let e,s={};const r=(r,n)=>(r=new URL(r+".js",n).href,s[r]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=s,document.head.appendChild(e)}else e=r,importScripts(r),s()})).then((()=>{let e=s[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(n,i)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let l={};const a=e=>r(e,o),t={module:{uri:o},exports:l,require:a};s[o]=Promise.all(n.map((e=>t[e]||a(e)))).then((e=>(i(...e),l)))}}define(["./workbox-e0d788d4"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"_astro/_...slug_.45f0edaf.css",revision:null},{url:"_astro/_plugin-vue_export-helper.77ed7c18.js",revision:null},{url:"_astro/client.0de2f274.js",revision:null},{url:"_astro/firebase-app.d090c84e.js",revision:null},{url:"_astro/format-money.ab6b71eb.js",revision:null},{url:"_astro/hoisted.541b5c05.js",revision:null},{url:"_astro/idle-callback.889bf0ea.js",revision:null},{url:"_astro/index.0c833781.css",revision:null},{url:"_astro/index.ff4f0b30.js",revision:null},{url:"_astro/modules-info.06ac0727.js",revision:null},{url:"_astro/PitchBar.5d55c359.js",revision:null},{url:"_astro/preload-helper.101896b7.js",revision:null},{url:"_astro/Prices.55399c72.js",revision:null},{url:"_astro/ProductCard.7e891c08.js",revision:null},{url:"_astro/runtime-dom.esm-bundler.d2f39f33.js",revision:null},{url:"_astro/server.1bc2fa51.css",revision:null},{url:"_astro/session-utm.72684b84.js",revision:null},{url:"_astro/ShopHeader.6bbe1a17.js",revision:null},{url:"_astro/workbox-window.prod.es5.dc90f814.js",revision:null},{url:"manifest.webmanifest",revision:"6a858866b0560997f368e27ab5418e15"}],{ignoreURLParametersMatching:[/.*/]}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/404"))),e.registerRoute(/^\/$/,new e.NetworkFirst,"GET"),e.registerRoute(/\/((?!(?:admin|assets|img)(\/|$))[^.]+)(\.(?!js|css|xml|txt|png|jpg|jpeg|webp|avif|svg|gif)[^.]+)*$/,new e.NetworkFirst({cacheName:"pages",plugins:[new e.ExpirationPlugin({maxEntries:50,purgeOnQuotaError:!0})]}),"GET"),e.registerRoute(/^\/assets\//,new e.StaleWhileRevalidate({cacheName:"assets",plugins:[]}),"GET"),e.registerRoute(/^\/_image$/,new e.StaleWhileRevalidate({cacheName:"optim-images",plugins:[new e.ExpirationPlugin({maxEntries:50,maxAgeSeconds:2592e3,purgeOnQuotaError:!0})]}),"GET"),e.registerRoute(/^\/img\/uploads\/.*\.(?:png|jpg|jpeg|webp|avif|svg|gif)$/,new e.StaleWhileRevalidate({cacheName:"cms-images",plugins:[new e.ExpirationPlugin({maxEntries:20,maxAgeSeconds:2592e3,purgeOnQuotaError:!0})]}),"GET"),e.registerRoute(/^https:\/\/ecomplus\.io/,new e.NetworkFirst({cacheName:"store-api",plugins:[new e.ExpirationPlugin({maxEntries:50,purgeOnQuotaError:!0})]}),"GET"),e.registerRoute(/^https:\/\/(((\w+\.)?ecoms\d)|(ecom[\w-]+(\.\w+)*\.digitaloceanspaces))\.com.*\/imgs\/normal\//,new e.CacheFirst({cacheName:"product-thumbnails",plugins:[new e.ExpirationPlugin({maxEntries:100,maxAgeSeconds:2592e3,purgeOnQuotaError:!0})]}),"GET"),e.registerRoute(/^https:\/\/(((\w+\.)?ecoms\d)|(ecom[\w-]+(\.\w+)*\.digitaloceanspaces))\.com.*\/imgs\/big\//,new e.CacheFirst({cacheName:"product-pictures",plugins:[new e.ExpirationPlugin({maxEntries:10,maxAgeSeconds:604800,purgeOnQuotaError:!0})]}),"GET")}));
|
|
@@ -17,8 +17,7 @@ import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRende
|
|
|
17
17
|
/* empty css */import { EventEmitter } from 'node:events';
|
|
18
18
|
import fs, { readFileSync } from 'node:fs';
|
|
19
19
|
import config from '@cloudcommerce/config';
|
|
20
|
-
/* empty css */import {
|
|
21
|
-
import { useScroll, useElementHover, useDebounceFn, useTimeout, promiseTimeout } from '@vueuse/core';
|
|
20
|
+
/* empty css */import { useScroll, useElementHover, useDebounceFn, useTimeout, promiseTimeout } from '@vueuse/core';
|
|
22
21
|
import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
|
|
23
22
|
|
|
24
23
|
const _export_sfc = (sfc, props) => {
|
|
@@ -476,7 +475,7 @@ const $$Astro$g = createAstro("https://ecom2-002.web.app");
|
|
|
476
475
|
const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
|
|
477
476
|
const Astro2 = $$result.createAstro($$Astro$g, $$props, $$slots);
|
|
478
477
|
Astro2.self = $$BaseHead;
|
|
479
|
-
const deployRand =
|
|
478
|
+
const deployRand = ({}).DEPLOY_RAND || "_";
|
|
480
479
|
const getIconUrl = (size) => {
|
|
481
480
|
return `/_image?f=png&w=${size}&h=${size}&href=${encodeURIComponent(settings.icon)}&V=${deployRand}`;
|
|
482
481
|
};
|
|
@@ -791,35 +790,19 @@ async function getPicture(params) {
|
|
|
791
790
|
};
|
|
792
791
|
}
|
|
793
792
|
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
dimensions = sizeOf(resolve$1(STOREFRONT_BASE_DIR, `public${src2}`));
|
|
804
|
-
} catch (e) {
|
|
805
|
-
dimensions = {};
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
return dimensions;
|
|
809
|
-
};
|
|
810
|
-
const getAspectRatio = (src2) => {
|
|
811
|
-
if (typeof src2 === "string") {
|
|
812
|
-
src2 = tryImageSize(src2);
|
|
813
|
-
}
|
|
814
|
-
if (src2.width) {
|
|
815
|
-
return src2.height ? src2.width / src2.height : 1;
|
|
816
|
-
}
|
|
817
|
-
return 0;
|
|
818
|
-
};
|
|
793
|
+
const getAspectRatio = (src, tryImageSize) => {
|
|
794
|
+
if (typeof src === "string") {
|
|
795
|
+
src = tryImageSize(src);
|
|
796
|
+
} else if (src.width) {
|
|
797
|
+
return src.height ? src.width / src.height : 1;
|
|
798
|
+
}
|
|
799
|
+
return 0;
|
|
800
|
+
};
|
|
801
|
+
const useSSRPicture = async (params) => {
|
|
819
802
|
const {
|
|
820
803
|
src,
|
|
821
804
|
alt,
|
|
822
|
-
sizes,
|
|
805
|
+
sizes: propSizes,
|
|
823
806
|
widths,
|
|
824
807
|
aspectRatio: propAspectRatio,
|
|
825
808
|
fit,
|
|
@@ -829,17 +812,60 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
829
812
|
loading = "lazy",
|
|
830
813
|
decoding = "async",
|
|
831
814
|
hasImg = true,
|
|
815
|
+
tryImageSize,
|
|
816
|
+
getPicture,
|
|
832
817
|
...attrs
|
|
833
|
-
} =
|
|
834
|
-
let aspectRatio
|
|
835
|
-
if (
|
|
818
|
+
} = params;
|
|
819
|
+
let aspectRatio;
|
|
820
|
+
if (propAspectRatio) {
|
|
821
|
+
if (typeof propAspectRatio === "number") {
|
|
822
|
+
aspectRatio = propAspectRatio;
|
|
823
|
+
} else {
|
|
824
|
+
const [width, height] = propAspectRatio.split(":");
|
|
825
|
+
aspectRatio = Number(width) / Number(height);
|
|
826
|
+
}
|
|
827
|
+
} else if ((!attrs.width || !attrs.height) && typeof src === "string") {
|
|
836
828
|
const { width, height } = tryImageSize(src);
|
|
837
829
|
if (height) {
|
|
838
|
-
aspectRatio = getAspectRatio({ width, height });
|
|
830
|
+
aspectRatio = getAspectRatio({ width, height }, tryImageSize);
|
|
839
831
|
attrs.width = width;
|
|
840
832
|
attrs.height = height;
|
|
841
833
|
}
|
|
842
834
|
}
|
|
835
|
+
let sizes = propSizes || "";
|
|
836
|
+
if (!sizes && attrs.class) {
|
|
837
|
+
const classNames = attrs.class.split(" ");
|
|
838
|
+
const classRegex = /^(\w+:)?max-w-\[(\w+)\]$/;
|
|
839
|
+
let nextSize;
|
|
840
|
+
[
|
|
841
|
+
[""],
|
|
842
|
+
["sm", 640],
|
|
843
|
+
["md", 768],
|
|
844
|
+
["lg", 1024],
|
|
845
|
+
["xl", 1280],
|
|
846
|
+
["2xl", 1536]
|
|
847
|
+
].forEach(([breakpoint, minWidth]) => {
|
|
848
|
+
const className = classNames.find((_class) => {
|
|
849
|
+
return _class.startsWith(breakpoint ? `${breakpoint}:max-w-[` : "max-w-[");
|
|
850
|
+
});
|
|
851
|
+
if (className) {
|
|
852
|
+
if (nextSize) {
|
|
853
|
+
if (sizes)
|
|
854
|
+
sizes += ", ";
|
|
855
|
+
sizes += `(max-width: ${minWidth - 1}px) ${nextSize}`;
|
|
856
|
+
}
|
|
857
|
+
nextSize = className.replace(classRegex, "$2");
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
if (nextSize) {
|
|
861
|
+
if (sizes)
|
|
862
|
+
sizes += ", ";
|
|
863
|
+
sizes += nextSize;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
if (!sizes && widths.length === 1) {
|
|
867
|
+
sizes = `${widths[0] / 2}px`;
|
|
868
|
+
}
|
|
843
869
|
const { image, sources } = await getPicture({
|
|
844
870
|
src,
|
|
845
871
|
widths,
|
|
@@ -850,8 +876,6 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
850
876
|
position,
|
|
851
877
|
alt
|
|
852
878
|
});
|
|
853
|
-
const imgSrc = `${image.src}&V=${process.env.DEPLOY_RAND}`;
|
|
854
|
-
delete image.src;
|
|
855
879
|
delete image.width;
|
|
856
880
|
delete image.height;
|
|
857
881
|
const pictureAttrs = {};
|
|
@@ -861,9 +885,61 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
861
885
|
delete pictureAttrs.width;
|
|
862
886
|
delete pictureAttrs.height;
|
|
863
887
|
}
|
|
888
|
+
return {
|
|
889
|
+
sizes,
|
|
890
|
+
aspectRatio,
|
|
891
|
+
sources,
|
|
892
|
+
pictureAttrs,
|
|
893
|
+
imgAttrs: !hasImg ? null : {
|
|
894
|
+
...image,
|
|
895
|
+
loading,
|
|
896
|
+
decoding,
|
|
897
|
+
...attrs
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
const $$Astro$e = createAstro("https://ecom2-002.web.app");
|
|
903
|
+
const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
904
|
+
const Astro2 = $$result.createAstro($$Astro$e, $$props, $$slots);
|
|
905
|
+
Astro2.self = $$Picture;
|
|
906
|
+
const deployRand = ({}).DEPLOY_RAND;
|
|
907
|
+
const versionSuffix = ({}).BUILD_OUTPUT !== "static" && deployRand ? `&V=${deployRand}` : "";
|
|
908
|
+
const getImageFilepath = (src) => {
|
|
909
|
+
return resolve(process.env.STOREFRONT_BASE_DIR, `public${src}`);
|
|
910
|
+
};
|
|
911
|
+
const tryImageSize = (src) => {
|
|
912
|
+
let dimensions = {};
|
|
913
|
+
if (typeof src === "string" && src.startsWith("/")) {
|
|
914
|
+
try {
|
|
915
|
+
dimensions = sizeOf(getImageFilepath(src));
|
|
916
|
+
} catch (e) {
|
|
917
|
+
dimensions = {};
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
return dimensions;
|
|
921
|
+
};
|
|
922
|
+
const {
|
|
923
|
+
sizes,
|
|
924
|
+
sources,
|
|
925
|
+
pictureAttrs,
|
|
926
|
+
imgAttrs
|
|
927
|
+
} = await useSSRPicture({
|
|
928
|
+
...Astro2.props,
|
|
929
|
+
tryImageSize,
|
|
930
|
+
getPicture
|
|
931
|
+
});
|
|
932
|
+
if (imgAttrs) {
|
|
933
|
+
imgAttrs.src += versionSuffix;
|
|
934
|
+
}
|
|
864
935
|
return renderTemplate`${maybeRenderHead($$result)}<picture${spreadAttributes(pictureAttrs)}>
|
|
865
|
-
${sources.map((
|
|
866
|
-
|
|
936
|
+
${sources.map((attrs) => {
|
|
937
|
+
if (versionSuffix) {
|
|
938
|
+
attrs.srcset = attrs.srcset.replace(/\s(\w+)$/, `${versionSuffix} $1`);
|
|
939
|
+
}
|
|
940
|
+
return renderTemplate`<source${spreadAttributes(attrs)}${addAttribute(sizes, "sizes")}>`;
|
|
941
|
+
})}
|
|
942
|
+
${imgAttrs && renderTemplate`<img${spreadAttributes(imgAttrs)}>`}
|
|
867
943
|
</picture>`;
|
|
868
944
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/Picture.astro");
|
|
869
945
|
|
|
@@ -3246,7 +3322,7 @@ const $$Pages = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
3246
3322
|
const { pageContext, title } = Astro2.props;
|
|
3247
3323
|
const { settings } = pageContext;
|
|
3248
3324
|
return renderTemplate`${renderComponent($$result, "Base", $$Base, { "pageContext": pageContext, "title": title }, { "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["header"], renderTemplate`
|
|
3249
|
-
${renderComponent($$result2, "Header", $$PagesHeader, { "pageContext": pageContext }, { "logo-picture": ($$result3) => renderTemplate`${renderComponent($$result3, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "
|
|
3325
|
+
${renderComponent($$result2, "Header", $$PagesHeader, { "pageContext": pageContext }, { "logo-picture": ($$result3) => renderTemplate`${renderComponent($$result3, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px]" })}` })}
|
|
3250
3326
|
`)}${renderSlot($$result2, $$slots["default"])}` })}`;
|
|
3251
3327
|
}, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Pages.astro");
|
|
3252
3328
|
|
|
@@ -14,7 +14,7 @@ import enableDestroy from 'server-destroy';
|
|
|
14
14
|
import { defineComponent, computed, useSSRContext, mergeProps, h as h$1, createSSRApp } from 'vue';
|
|
15
15
|
import { ssrRenderSlotInner, ssrRenderAttrs, ssrRenderSlot, renderToString } from 'vue/server-renderer';
|
|
16
16
|
import { img, imgSizes, i18n, formatMoney } from '@ecomplus/utils';
|
|
17
|
-
/* empty css */import { _ as _export_sfc, a as _page0, b as _page1, c as _page2, d as _page3, e as _page4, f as _page5 } from './chunks/pages/all.
|
|
17
|
+
/* empty css */import { _ as _export_sfc, a as _page0, b as _page1, c as _page2, d as _page3, e as _page4, f as _page5 } from './chunks/pages/all.94de1b69.mjs';
|
|
18
18
|
import 'mime';
|
|
19
19
|
import 'cookie';
|
|
20
20
|
import 'kleur/colors';
|
|
@@ -3062,7 +3062,7 @@ const _renderer1 = {
|
|
|
3062
3062
|
const pageMap = new Map([["../../node_modules/.pnpm/@astrojs+image@0.16.0_astro@2.1.2+sharp@0.31.3/node_modules/@astrojs/image/dist/endpoint.js", _page0],["src/pages/index.astro", _page1],["src/pages/fallback.astro", _page2],["src/pages/app/index.astro", _page3],["src/pages/app/account.astro", _page4],["src/pages/[...slug].astro", _page5],]);
|
|
3063
3063
|
const renderers = [Object.assign({"name":"astro:jsx","serverEntrypoint":"astro/jsx/server.js","jsxImportSource":"astro"}, { ssr: server_default }),Object.assign({"name":"@astrojs/vue","clientEntrypoint":"@astrojs/vue/client.js","serverEntrypoint":"@astrojs/vue/server.js"}, { ssr: _renderer1 }),];
|
|
3064
3064
|
|
|
3065
|
-
const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.16.0_astro@2.1.2+sharp@0.31.3/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.
|
|
3065
|
+
const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/@astrojs+image@0.16.0_astro@2.1.2+sharp@0.31.3/node_modules/@astrojs/image/dist/endpoint.js","pathname":"/_image","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.45f0edaf.css","_astro/index.0c833781.css"],"scripts":[{"type":"external","value":"_astro/hoisted.541b5c05.js"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.45f0edaf.css"],"scripts":[{"type":"external","value":"_astro/hoisted.541b5c05.js"}],"routeData":{"route":"/fallback","type":"page","pattern":"^\\/fallback\\/?$","segments":[[{"content":"fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/fallback.astro","pathname":"/fallback","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["_astro/_...slug_.45f0edaf.css"],"scripts":[{"type":"external","value":"_astro/hoisted.541b5c05.js"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"_meta":{"trailingSlash":"ignore"}}}],"site":"https://ecom2-002.web.app","base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"gfm":true,"smartypants":true},"pageMap":null,"propagation":[],"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"_@astrojs-ssr-virtual-entry.mjs","@@sf/components/ProductCard.vue":"_astro/ProductCard.7e891c08.js","~/components/Prices.vue":"_astro/Prices.55399c72.js","~/components/PitchBar.vue":"_astro/PitchBar.5d55c359.js","@astrojs/vue/client.js":"_astro/client.0de2f274.js","~/components/ShopHeader.vue":"_astro/ShopHeader.6bbe1a17.js","/astro/hoisted.js?q=0":"_astro/hoisted.541b5c05.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/workbox-window/build/workbox-window.prod.es5.mjs":"_astro/workbox-window.prod.es5.dc90f814.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.d090c84e.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/index.0c833781.css","/_astro/server.1bc2fa51.css","/_astro/_...slug_.45f0edaf.css","/manifest.webmanifest","/robots.txt","/sw.js","/workbox-e0d788d4.js","/_astro/PitchBar.5d55c359.js","/_astro/Prices.55399c72.js","/_astro/ProductCard.7e891c08.js","/_astro/ShopHeader.6bbe1a17.js","/_astro/_plugin-vue_export-helper.77ed7c18.js","/_astro/client.0de2f274.js","/_astro/firebase-app.d090c84e.js","/_astro/format-money.ab6b71eb.js","/_astro/hoisted.541b5c05.js","/_astro/idle-callback.889bf0ea.js","/_astro/index.ff4f0b30.js","/_astro/modules-info.06ac0727.js","/_astro/preload-helper.101896b7.js","/_astro/runtime-dom.esm-bundler.d2f39f33.js","/_astro/session-utm.72684b84.js","/_astro/workbox-window.prod.es5.dc90f814.js","/admin/config.json","/assets/cms-preview.css","/assets/cms.css","/assets/cvv.png","/assets/img-placeholder.png","/assets/payments.png","/assets/ssl-safe.png","/img/icon.png","/img/large-icon.png","/img/uploads/banner1.png","/img/uploads/banner2.png","/img/uploads/banner2.webp","/img/uploads/favicon.png","/img/uploads/headless.png","/img/uploads/headphone.png","/img/uploads/headphone.webp","/img/uploads/icon.png","/img/uploads/large-icon.png","/img/uploads/logo.png","/img/uploads/logo.webp","/img/uploads/og-image.png","/img/uploads/passion.png","/img/uploads/passion.webp","/img/uploads/pwa-reliable.png","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.png","/img/uploads/rect89.webp","/img/uploads/ssl-safe.png"]}), {
|
|
3066
3066
|
pageMap: pageMap,
|
|
3067
3067
|
renderers: renderers
|
|
3068
3068
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.6",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"bin": {
|
|
7
7
|
"storefront": "./scripts/build-prod.sh"
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"start": "astro dev --host",
|
|
24
24
|
"build": "astro build",
|
|
25
25
|
"build:static": "BUILD_OUTPUT=static astro build",
|
|
26
|
-
"build:prod": "
|
|
26
|
+
"build:prod": "bash scripts/build-prod.sh",
|
|
27
27
|
"preview": "astro preview",
|
|
28
28
|
"astro": "astro",
|
|
29
|
-
"prepare-monorepo": "
|
|
29
|
+
"prepare-monorepo": "bash scripts/prepare-monorepo.sh"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@astrojs/image": "0.16.0",
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
"astro": "2.1.2",
|
|
47
47
|
"chroma-js": "^2.4.2",
|
|
48
48
|
"dotenv": "^16.0.3",
|
|
49
|
-
"firebase": "^9.
|
|
49
|
+
"firebase": "^9.18.0",
|
|
50
50
|
"image-size": "^1.0.2",
|
|
51
51
|
"mime": "^3.0.0",
|
|
52
52
|
"semver": "^7.3.8",
|
|
53
53
|
"sharp": "^0.31.3",
|
|
54
54
|
"tailwindcss": "^3.2.7",
|
|
55
|
-
"unocss": "^0.50.
|
|
56
|
-
"vite": "^4.1
|
|
57
|
-
"vite-plugin-pwa": "^0.14.
|
|
55
|
+
"unocss": "^0.50.6",
|
|
56
|
+
"vite": "^4.2.1",
|
|
57
|
+
"vite-plugin-pwa": "^0.14.5",
|
|
58
58
|
"vue": "^3.2.47"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@babel/core": "^7.21.
|
|
61
|
+
"@babel/core": "^7.21.3",
|
|
62
62
|
"@cloudcommerce/types": "workspace:*"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
BUILD_OUTPUT=static
|
|
3
|
+
BUILD_OUTPUT=static \
|
|
4
|
+
BUILD_OUT_DIR=./.cloudcommerce/sf-tmp-dist \
|
|
5
|
+
npx astro build
|
|
4
6
|
DEPLOY_RUNTIME=serverless npx astro build
|
|
5
7
|
|
|
6
|
-
mv ./.cloudcommerce/sf-tmp-dist/_astro/*.{png,jpg,jpeg,webp,avif,svg}
|
|
8
|
+
mv ./.cloudcommerce/sf-tmp-dist/_astro/*.{png,jpg,jpeg,webp,avif,svg} \
|
|
9
|
+
./dist/client/_astro/ \
|
|
10
|
+
2>/dev/null
|
|
7
11
|
rm -rf ./.cloudcommerce/sf-tmp-dist
|
|
8
12
|
|
|
9
13
|
identify -format "%f,%w,%h\n" \
|
|
10
|
-
./dist/client/_astro/*.{png,jpg,jpeg,webp,avif,svg}
|
|
14
|
+
./dist/client/_astro/*.{png,jpg,jpeg,webp,avif,svg} \
|
|
15
|
+
> ./dist/server/images.dist.csv \
|
|
16
|
+
2>/dev/null
|
|
11
17
|
|
|
12
18
|
identify -format "assets/%f,%w,%h\n" \
|
|
13
|
-
./public/assets/*.{png,jpg,jpeg,webp,avif,svg}
|
|
19
|
+
./public/assets/*.{png,jpg,jpeg,webp,avif,svg} \
|
|
20
|
+
> ./dist/server/images.src.csv \
|
|
21
|
+
2>/dev/null
|
|
14
22
|
identify -format "img/%f,%w,%h\n" \
|
|
15
|
-
./public/img/*.{png,jpg,jpeg,webp,avif,svg}
|
|
23
|
+
./public/img/*.{png,jpg,jpeg,webp,avif,svg} \
|
|
24
|
+
>> ./dist/server/images.src.csv \
|
|
25
|
+
2>/dev/null
|
|
16
26
|
identify -format "img/uploads/%f,%w,%h\n" \
|
|
17
|
-
./public/img/uploads/*.{png,jpg,jpeg,webp,avif,svg}
|
|
27
|
+
./public/img/uploads/*.{png,jpg,jpeg,webp,avif,svg} \
|
|
28
|
+
>> ./dist/server/images.src.csv \
|
|
29
|
+
2>/dev/null
|
|
18
30
|
|
|
19
31
|
exit 0
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { join as joinPath } from 'node:path';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { getBuiltPicture } from './get-built-picture';
|
|
5
|
+
import { type PictureProps, useSSRPicture } from './use-ssr-picture';
|
|
6
|
+
|
|
7
|
+
export type Props = PictureProps;
|
|
8
|
+
|
|
9
|
+
const { STOREFRONT_BASE_DIR } = process.env;
|
|
10
|
+
const baseDir = STOREFRONT_BASE_DIR || process.cwd();
|
|
11
|
+
type OriginalImage = { filepath: string, width: number, height: number };
|
|
12
|
+
const originalImages: OriginalImage[] = [];
|
|
13
|
+
const manifestFilepath = joinPath(baseDir, 'dist/server/images.src.csv');
|
|
14
|
+
readFileSync(manifestFilepath, 'utf-8').split(/\n/).forEach((line) => {
|
|
15
|
+
const [filepath, width, height] = line.split(',');
|
|
16
|
+
originalImages.push({
|
|
17
|
+
filepath,
|
|
18
|
+
width: Number(width),
|
|
19
|
+
height: Number(height),
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const tryImageSize = (src: string) => {
|
|
24
|
+
let dimensions: { width?: number, height?: number } = {};
|
|
25
|
+
if (typeof src === 'string' && src.startsWith('/')) {
|
|
26
|
+
const originalImage = originalImages.find(({ filepath }) => {
|
|
27
|
+
return new RegExp(`^/${filepath}\\??.*`).test(src);
|
|
28
|
+
});
|
|
29
|
+
if (originalImage) {
|
|
30
|
+
const { width, height } = originalImage;
|
|
31
|
+
dimensions = { width, height };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return dimensions;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const {
|
|
38
|
+
sizes,
|
|
39
|
+
sources,
|
|
40
|
+
pictureAttrs,
|
|
41
|
+
imgAttrs,
|
|
42
|
+
} = await useSSRPicture({
|
|
43
|
+
...Astro.props,
|
|
44
|
+
tryImageSize,
|
|
45
|
+
getPicture: getBuiltPicture,
|
|
46
|
+
});
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
<picture {...pictureAttrs}>
|
|
50
|
+
{sources.map((attrs) => <source {...attrs} sizes={sizes} />)}
|
|
51
|
+
{imgAttrs && <img {...imgAttrs} />}
|
|
52
|
+
</picture>
|
|
@@ -25,7 +25,7 @@ type ImageOptions = Record<string, any> & {
|
|
|
25
25
|
width: number,
|
|
26
26
|
format: OutputFormat,
|
|
27
27
|
};
|
|
28
|
-
const
|
|
28
|
+
const getBuiltImage = async ({ src, width, format }: ImageOptions) => {
|
|
29
29
|
const filename = src.replace(/^.*\//, '').replace(/.\w+(\?.*)?$/, '');
|
|
30
30
|
const filenameRegExp = new RegExp(`[_.][a-z0-9]+\\.${format}$`, 'i');
|
|
31
31
|
const matchFilename = (_builtImage: BuiltImage) => {
|
|
@@ -48,6 +48,6 @@ const getImage = async ({ src, width, format }: ImageOptions) => {
|
|
|
48
48
|
return { src, width };
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
export default
|
|
51
|
+
export default getBuiltImage;
|
|
52
52
|
|
|
53
|
-
export {
|
|
53
|
+
export { getBuiltImage };
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from 'astro/types';
|
|
|
2
2
|
// import type { ImageMetadata } from '@astrojs/image/dist/vite-plugin-astro-image';
|
|
3
3
|
import type { OutputFormat, TransformOptions } from '@astrojs/image/dist/loaders/';
|
|
4
4
|
import mime from 'mime';
|
|
5
|
-
import
|
|
5
|
+
import getBuiltImage from './get-built-image';
|
|
6
6
|
|
|
7
7
|
function removeQueryString(src: string) {
|
|
8
8
|
const index = src.lastIndexOf('?');
|
|
@@ -76,7 +76,7 @@ async function resolveFormats({ src, formats }: GetPictureParams) {
|
|
|
76
76
|
return Array.from(unique).filter(Boolean);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
export async function
|
|
79
|
+
export async function getBuiltPicture(params: GetPictureParams): Promise<GetPictureResult> {
|
|
80
80
|
const {
|
|
81
81
|
src,
|
|
82
82
|
alt,
|
|
@@ -103,7 +103,7 @@ export async function getPicture(params: GetPictureParams): Promise<GetPictureRe
|
|
|
103
103
|
async function getSource(format: OutputFormat) {
|
|
104
104
|
const imgs = await Promise.all(
|
|
105
105
|
widths.map(async (width) => {
|
|
106
|
-
const img = await
|
|
106
|
+
const img = await getBuiltImage({
|
|
107
107
|
src,
|
|
108
108
|
alt,
|
|
109
109
|
format,
|