@dropins/tools 1.4.1-alpha008 → 1.4.1-alpha009

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/event-bus.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- var f=Object.defineProperty;var n=(i,e,t)=>e in i?f(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var l=(i,e,t)=>n(i,typeof e!="symbol"?e+"":e,t);const d=Date.now().toString(36).substring(2);class c{static _getScopedEvent(e){return t=>e?`${e}/${t}`:t}static lastPayload(e,t){var r;return t!=null&&t.scope&&(e=this._getScopedEvent(t==null?void 0:t.scope)(e)),(r=this._lastEvent[e])==null?void 0:r.payload}static on(e,t,r){if(typeof BroadcastChannel>"u")return;const s=new BroadcastChannel("ElsieSDK/EventBus");if(r!=null&&r.scope&&(e=this._getScopedEvent(r==null?void 0:r.scope)(e)),r!=null&&r.eager){const a=this._lastEvent[e];a&&t(a.payload)}return s.addEventListener("message",({data:a})=>{this._identifier&&this._identifier!==a.identifier||a.event===e&&t(a.payload)}),{off(){s.close()}}}static emit(e,t,r){if(typeof BroadcastChannel>"u")return;const s=new BroadcastChannel("ElsieSDK/EventBus");r!=null&&r.scope&&(e=this._getScopedEvent(r==null?void 0:r.scope)(e)),s.postMessage({event:e,identifier:this._identifier,payload:t}),this._lastEvent[e]={payload:t},s.close()}static enableLogger(e){var t;typeof BroadcastChannel>"u"||((t=this._logger)==null||t.close(),this._logger=null,e!==!1&&(this._logger=new BroadcastChannel("ElsieSDK/EventBus"),this._logger.addEventListener("message",({data:r})=>{this._identifier&&this._identifier!==r.identifier||(console.group(`📡 Event (${r.identifier}) ➡ ${r.event}`),console.log(r.payload),console.groupEnd())})))}}l(c,"_identifier",d),l(c,"_logger",null),l(c,"_lastEvent",{});export{c as events};
3
+ var o=Object.defineProperty;var f=(n,e,t)=>e in n?o(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>f(n,typeof e!="symbol"?e+"":e,t);const c=Date.now().toString(36).substring(2);class a{static lastPayload(e){var t;return(t=this._lastEvent[e])==null?void 0:t.payload}static on(e,t,i){if(typeof BroadcastChannel>"u")return;const l=new BroadcastChannel("ElsieSDK/EventBus");if(i!=null&&i.eager){const s=this._lastEvent[e];s&&t(s.payload)}return l.addEventListener("message",({data:s})=>{this._identifier&&this._identifier!==s.identifier||s.event===e&&t(s.payload)}),{off(){l.close()}}}static emit(e,t){if(typeof BroadcastChannel>"u")return;const i=new BroadcastChannel("ElsieSDK/EventBus");i.postMessage({event:e,identifier:this._identifier,payload:t}),this._lastEvent[e]={payload:t},i.close()}static enableLogger(e){var t;typeof BroadcastChannel>"u"||((t=this._logger)==null||t.close(),this._logger=null,e!==!1&&(this._logger=new BroadcastChannel("ElsieSDK/EventBus"),this._logger.addEventListener("message",({data:i})=>{this._identifier&&this._identifier!==i.identifier||(console.group(`📡 Event (${i.identifier}) ➡ ${i.event}`),console.log(i.payload),console.groupEnd())})))}}r(a,"_identifier",c),r(a,"_logger",null),r(a,"_lastEvent",{});export{a as events};
4
4
  //# sourceMappingURL=event-bus.js.map
package/event-bus.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"event-bus.js","sources":["@dropins/tools/src/event-bus/index.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { Events } from './events-catalog';\n\nexport * from './events-catalog';\n\nconst hash = Date.now().toString(36).substring(2);\n\n/**\n * The `events` class provides static methods for event handling.\n * It allows subscribing to events, emitting events, and enabling or disabling event logging.\n *\n * @class\n * @extends {Events}\n *\n * @property {Function} on - Subscribes to an event.\n * @property {Function} emit - Emits an event.\n * @property {Function} enableLogger - Enables or disables event logging.\n * @property {Function} lastPayload - Returns the last payload of the event.\n */\nexport class events {\n static _identifier = hash;\n\n static _logger: BroadcastChannel | null = null;\n\n static _lastEvent: { [key: string]: { payload: any } } = {};\n\n /**\n * Returns a scoped event key.\n * @param scope - The scope to get the event from.\n * @returns - The scoped event key.\n */\n static _getScopedEvent(scope?: string) {\n return <K extends keyof Events>(event: K): K => {\n return (scope ? `${scope}/${event}` : event) as K;\n };\n }\n\n /**\n * Returns the last payload of the event.\n * @param event – The event to get the last payload from.\n * @param options - Optional configuration for the event.\n * @returns – The last payload of the event.\n */\n static lastPayload<K extends keyof Events>(event: K, options?: { scope?: string }) {\n if (options?.scope) {\n event = this._getScopedEvent(options?.scope)(event);\n }\n\n return this._lastEvent[event]?.payload;\n }\n\n /**\n * Subscribes to an event.\n * @param event - The event to subscribe to.\n * @param handler - The event handler.\n * @param options - Optional configuration for the event handler.\n */\n static on<K extends keyof Events>(\n event: K,\n handler: (payload: Events[K]) => void,\n options?: { eager?: boolean, scope?: string }\n ) {\n if (typeof BroadcastChannel === 'undefined') {\n return;\n }\n\n const subscriber = new BroadcastChannel('ElsieSDK/EventBus');\n\n // if scope is provided, get the scoped event key\n if (options?.scope) {\n event = this._getScopedEvent(options?.scope)(event);\n }\n\n if (options?.eager) {\n const lastEvent = this._lastEvent[event];\n\n if (lastEvent) {\n handler(lastEvent.payload);\n }\n }\n\n subscriber.addEventListener('message', ({ data }) => {\n // ignore events from other instances (only if identifier is set)\n if (this._identifier && this._identifier !== data.identifier) return;\n\n if (data.event === event) {\n handler(data.payload);\n }\n });\n\n // NOTE: disabled as it causes loading issues with \"bfcache\"\n // unsubscribe if leaving page\n // window.addEventListener('beforeunload', () => {\n // subscriber.close();\n // });\n\n return {\n off() {\n subscriber.close();\n },\n };\n }\n /**\n * Emits an event.\n * @param event - The event to emit.\n * @param payload - The event payload.\n * @param options - Optional configuration for the event.\n */\n\n static emit<K extends keyof Events>(event: K, payload: Events[K], options?: { scope?: string }) {\n if (typeof BroadcastChannel === 'undefined') {\n return;\n }\n\n const publisher = new BroadcastChannel('ElsieSDK/EventBus');\n\n // if scope is provided, get the scoped event key\n if (options?.scope) {\n event = this._getScopedEvent(options?.scope)(event);\n }\n\n publisher.postMessage({ event, identifier: this._identifier, payload });\n\n this._lastEvent[event] = {\n payload,\n };\n\n publisher.close();\n }\n /**\n * Enables or disables event logging.\n * @param enabled - Whether to enable or disable event logging.\n */\n static enableLogger(enabled: boolean) {\n if (typeof BroadcastChannel === 'undefined') {\n return;\n }\n\n // reset logger\n this._logger?.close();\n this._logger = null;\n\n if (enabled === false) return;\n\n // create new logger\n this._logger = new BroadcastChannel('ElsieSDK/EventBus');\n\n this._logger.addEventListener('message', ({ data }) => {\n if (this._identifier && this._identifier !== data.identifier) return;\n console.group(`📡 Event (${data.identifier}) ➡ ${data.event}`);\n console.log(data.payload);\n console.groupEnd();\n });\n\n // NOTE: disabled as it causes loading issues with \"bfcache\"\n // unsubscribe if leaving page\n // window.addEventListener('beforeunload', () => {\n // this._logger?.close();\n // });\n }\n}\n"],"names":["hash","events","scope","event","options","_a","handler","subscriber","lastEvent","data","payload","publisher","enabled","__publicField"],"mappings":"oKAaA,MAAMA,EAAO,KAAK,IAAI,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,EAczC,MAAMC,CAAO,CAYlB,OAAO,gBAAgBC,EAAgB,CACrC,OAAgCC,GACpBD,EAAQ,GAAGA,CAAK,IAAIC,CAAK,GAAKA,CAC1C,CASF,OAAO,YAAoCA,EAAUC,EAA8B,CAtCrF,IAAAC,EAuCI,OAAID,GAAA,MAAAA,EAAS,QACXD,EAAQ,KAAK,gBAAgBC,GAAA,YAAAA,EAAS,KAAK,EAAED,CAAK,IAG7CE,EAAA,KAAK,WAAWF,CAAK,IAArB,YAAAE,EAAwB,OAAA,CASjC,OAAO,GACLF,EACAG,EACAF,EACA,CACI,GAAA,OAAO,iBAAqB,IAC9B,OAGI,MAAAG,EAAa,IAAI,iBAAiB,mBAAmB,EAO3D,GAJIH,GAAA,MAAAA,EAAS,QACXD,EAAQ,KAAK,gBAAgBC,GAAA,YAAAA,EAAS,KAAK,EAAED,CAAK,GAGhDC,GAAA,MAAAA,EAAS,MAAO,CACZ,MAAAI,EAAY,KAAK,WAAWL,CAAK,EAEnCK,GACFF,EAAQE,EAAU,OAAO,CAC3B,CAGF,OAAAD,EAAW,iBAAiB,UAAW,CAAC,CAAE,KAAAE,KAAW,CAE/C,KAAK,aAAe,KAAK,cAAgBA,EAAK,YAE9CA,EAAK,QAAUN,GACjBG,EAAQG,EAAK,OAAO,CACtB,CACD,EAQM,CACL,KAAM,CACJF,EAAW,MAAM,CAAA,CAErB,CAAA,CASF,OAAO,KAA6BJ,EAAUO,EAAoBN,EAA8B,CAC1F,GAAA,OAAO,iBAAqB,IAC9B,OAGI,MAAAO,EAAY,IAAI,iBAAiB,mBAAmB,EAGtDP,GAAA,MAAAA,EAAS,QACXD,EAAQ,KAAK,gBAAgBC,GAAA,YAAAA,EAAS,KAAK,EAAED,CAAK,GAGpDQ,EAAU,YAAY,CAAE,MAAAR,EAAO,WAAY,KAAK,YAAa,QAAAO,EAAS,EAEjE,KAAA,WAAWP,CAAK,EAAI,CACvB,QAAAO,CACF,EAEAC,EAAU,MAAM,CAAA,CAMlB,OAAO,aAAaC,EAAkB,CAhIxC,IAAAP,EAiIQ,OAAO,iBAAqB,OAKhCA,EAAA,KAAK,UAAL,MAAAA,EAAc,QACd,KAAK,QAAU,KAEXO,IAAY,KAGX,KAAA,QAAU,IAAI,iBAAiB,mBAAmB,EAEvD,KAAK,QAAQ,iBAAiB,UAAW,CAAC,CAAE,KAAAH,KAAW,CACjD,KAAK,aAAe,KAAK,cAAgBA,EAAK,aAClD,QAAQ,MAAM,aAAaA,EAAK,UAAU,OAAOA,EAAK,KAAK,EAAE,EACrD,QAAA,IAAIA,EAAK,OAAO,EACxB,QAAQ,SAAS,EAAA,CAClB,GAAA,CAQL,CA5IEI,EADWZ,EACJ,cAAcD,GAErBa,EAHWZ,EAGJ,UAAmC,MAE1CY,EALWZ,EAKJ,aAAkD,CAAC"}
1
+ {"version":3,"file":"event-bus.js","sources":["@dropins/tools/src/event-bus/index.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { Events } from './events-catalog';\n\nexport * from './events-catalog';\n\nconst hash = Date.now().toString(36).substring(2);\n\n/**\n * The `events` class provides static methods for event handling.\n * It allows subscribing to events, emitting events, and enabling or disabling event logging.\n *\n * @class\n * @extends {Events}\n *\n * @property {Function} on - Subscribes to an event.\n * @property {Function} emit - Emits an event.\n * @property {Function} enableLogger - Enables or disables event logging.\n * @property {Function} lastPayload - Returns the last payload of the event.\n */\nexport class events {\n static _identifier = hash;\n\n static _logger: BroadcastChannel | null = null;\n\n static _lastEvent: { [key: string]: { payload: any } } = {};\n\n /**\n * Returns the last payload of the event.\n * @param event – The event to get the last payload from.\n * @returns – The last payload of the event.\n */\n static lastPayload(event: string) {\n return this._lastEvent[event]?.payload;\n }\n\n /**\n * Subscribes to an event.\n * @param event - The event to subscribe to.\n * @param handler - The event handler.\n * @param options - Optional configuration for the event handler.\n */\n static on<K extends keyof Events>(\n event: K,\n handler: (payload: Events[K]) => void,\n options?: { eager?: boolean }\n ) {\n if (typeof BroadcastChannel === 'undefined') {\n return;\n }\n\n const subscriber = new BroadcastChannel('ElsieSDK/EventBus');\n\n if (options?.eager) {\n const lastEvent = this._lastEvent[event];\n\n if (lastEvent) {\n handler(lastEvent.payload);\n }\n }\n\n subscriber.addEventListener('message', ({ data }) => {\n // ignore events from other instances (only if identifier is set)\n if (this._identifier && this._identifier !== data.identifier) return;\n\n if (data.event === event) {\n handler(data.payload);\n }\n });\n\n // NOTE: disabled as it causes loading issues with \"bfcache\"\n // unsubscribe if leaving page\n // window.addEventListener('beforeunload', () => {\n // subscriber.close();\n // });\n\n return {\n off() {\n subscriber.close();\n },\n };\n }\n /**\n * Emits an event.\n * @param event - The event to emit.\n * @param payload - The event payload.\n */\n\n static emit<K extends keyof Events>(event: K, payload: Events[K]) {\n if (typeof BroadcastChannel === 'undefined') {\n return;\n }\n\n const publisher = new BroadcastChannel('ElsieSDK/EventBus');\n\n publisher.postMessage({ event, identifier: this._identifier, payload });\n\n this._lastEvent[event] = {\n payload,\n };\n\n publisher.close();\n }\n /**\n * Enables or disables event logging.\n * @param enabled - Whether to enable or disable event logging.\n */\n static enableLogger(enabled: boolean) {\n if (typeof BroadcastChannel === 'undefined') {\n return;\n }\n\n // reset logger\n this._logger?.close();\n this._logger = null;\n\n if (enabled === false) return;\n\n // create new logger\n this._logger = new BroadcastChannel('ElsieSDK/EventBus');\n\n this._logger.addEventListener('message', ({ data }) => {\n if (this._identifier && this._identifier !== data.identifier) return;\n console.group(`📡 Event (${data.identifier}) ➡ ${data.event}`);\n console.log(data.payload);\n console.groupEnd();\n });\n\n // NOTE: disabled as it causes loading issues with \"bfcache\"\n // unsubscribe if leaving page\n // window.addEventListener('beforeunload', () => {\n // this._logger?.close();\n // });\n }\n}\n"],"names":["hash","events","event","_a","handler","options","subscriber","lastEvent","data","payload","publisher","enabled","__publicField"],"mappings":"oKAaA,MAAMA,EAAO,KAAK,IAAI,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,EAczC,MAAMC,CAAO,CAYlB,OAAO,YAAYC,EAAe,CA1BpC,IAAAC,EA2BW,OAAAA,EAAA,KAAK,WAAWD,CAAK,IAArB,YAAAC,EAAwB,OAAA,CASjC,OAAO,GACLD,EACAE,EACAC,EACA,CACI,GAAA,OAAO,iBAAqB,IAC9B,OAGI,MAAAC,EAAa,IAAI,iBAAiB,mBAAmB,EAE3D,GAAID,GAAA,MAAAA,EAAS,MAAO,CACZ,MAAAE,EAAY,KAAK,WAAWL,CAAK,EAEnCK,GACFH,EAAQG,EAAU,OAAO,CAC3B,CAGF,OAAAD,EAAW,iBAAiB,UAAW,CAAC,CAAE,KAAAE,KAAW,CAE/C,KAAK,aAAe,KAAK,cAAgBA,EAAK,YAE9CA,EAAK,QAAUN,GACjBE,EAAQI,EAAK,OAAO,CACtB,CACD,EAQM,CACL,KAAM,CACJF,EAAW,MAAM,CAAA,CAErB,CAAA,CAQF,OAAO,KAA6BJ,EAAUO,EAAoB,CAC5D,GAAA,OAAO,iBAAqB,IAC9B,OAGI,MAAAC,EAAY,IAAI,iBAAiB,mBAAmB,EAE1DA,EAAU,YAAY,CAAE,MAAAR,EAAO,WAAY,KAAK,YAAa,QAAAO,EAAS,EAEjE,KAAA,WAAWP,CAAK,EAAI,CACvB,QAAAO,CACF,EAEAC,EAAU,MAAM,CAAA,CAMlB,OAAO,aAAaC,EAAkB,CArGxC,IAAAR,EAsGQ,OAAO,iBAAqB,OAKhCA,EAAA,KAAK,UAAL,MAAAA,EAAc,QACd,KAAK,QAAU,KAEXQ,IAAY,KAGX,KAAA,QAAU,IAAI,iBAAiB,mBAAmB,EAEvD,KAAK,QAAQ,iBAAiB,UAAW,CAAC,CAAE,KAAAH,KAAW,CACjD,KAAK,aAAe,KAAK,cAAgBA,EAAK,aAClD,QAAQ,MAAM,aAAaA,EAAK,UAAU,OAAOA,EAAK,KAAK,EAAE,EACrD,QAAA,IAAIA,EAAK,OAAO,EACxB,QAAQ,SAAS,EAAA,CAClB,GAAA,CAQL,CAjHEI,EADWX,EACJ,cAAcD,GAErBY,EAHWX,EAGJ,UAAmC,MAE1CW,EALWX,EAKJ,aAAkD,CAAC"}
package/lib/aem/assets.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{getConfigValue as O}from"./configs.js";import{p as f,I as g}from"../../chunks/Image.js";import"../../chunks/get-path-value.js";import"../../chunks/cjs.js";import"../../preact-jsx-runtime.js";import"../../chunks/icons/Add.js";import"../../i18n.js";import"../../chunks/vcomponent.js";import"../../chunks/image-params-keymap.js";import"../../signals.js";const b=["gif","jpg","jpeg","png","webp"],v=[90,180,270],U=["h","v","hv"];function l(e){let t=e;if(t.startsWith("//")){const{protocol:s}=window.location;t=s+t}return t}function I(e){return U.includes(e)}function L(e){return v.includes(e)}function y(e){return b.includes(e)}function u(e,t,s){if(e!==void 0&&!t(e))throw new Error(s)}function h(){const e=O("commerce-assets-enabled");return e&&(typeof e=="string"&&e.toLowerCase()==="true"||typeof e=="boolean"&&e===!0)}function R(){return{quality:80,format:"webp"}}function A(e){return!!(typeof e=="string"?new URL(l(e)):e).pathname.startsWith("/adobe/assets/urn:aaid:aem")}function w(e,t,s={}){const r={...R(),...s},{format:i,crop:n,...o}=r;u(i,y,"Invalid format"),u(o.flip,I,"Invalid flip"),u(o.rotate,L,"Invalid rotation");const a=Object.fromEntries(Object.entries(o).map(([p,d])=>[p,String(d)])),c=new URLSearchParams(a);if(n){const[p,d]=[n.xOrigin||0,n.yOrigin||0],[P,E]=[n.width||100,n.height||100],S=`${p}p,${d}p,${P}p,${E}p`;c.set("crop",S)}return`${e}/as/${t}.${i}?${c.toString()}`}function q(e,t,s={}){if(!h())return e;const r=new URL(l(e));if(!A(r))return e;const i=r.origin+r.pathname;return w(i,t,s)}function _(e){return t=>{const{wrapper:s,alias:m,params:r,imageProps:i}=e;if(!i.src)throw new Error("An image source is required. Please provide a `src` or `imageProps.src`.");const n=s??document.createElement("div"),o=w(i.src,m,r),a={width:r.width,height:r.height,crop:void 0,fit:void 0,auto:void 0},c={...i,width:r.width,height:r.height,src:o,params:a};f.render(g,c)(n),t.replaceWith(n)}}function x(e,t){function s(){const i=t.wrapper??document.createElement("div"),{imageProps:n,params:o}=t,a={...n,width:o.width,height:o.height};f.render(g,a)(i),e.replaceWith(i)}if(!h()){s();return}if(!t.imageProps.src)throw new Error("An image source is required. Please provide a `src` or `imageProps.src`.");const r=new URL(l(t.imageProps.src));if(!A(r)){s();return}_(t)(e)}export{w as generateAemAssetsOptimizedUrl,R as getDefaultAemAssetsOptimizationParams,h as isAemAssetsEnabled,A as isAemAssetsUrl,_ as makeAemAssetsImageSlot,q as tryGenerateAemAssetsOptimizedUrl,x as tryRenderAemAssetsImage};
3
+ import{getConfigValue as O}from"./configs.js";import{p as f,I as g}from"../../chunks/Image.js";import"../../chunks/cjs.js";import"../../chunks/get-path-value.js";import"../../preact-jsx-runtime.js";import"../../chunks/icons/Add.js";import"../../i18n.js";import"../../chunks/vcomponent.js";import"../../chunks/image-params-keymap.js";import"../../signals.js";const b=["gif","jpg","jpeg","png","webp"],v=[90,180,270],U=["h","v","hv"];function l(e){let t=e;if(t.startsWith("//")){const{protocol:s}=window.location;t=s+t}return t}function I(e){return U.includes(e)}function L(e){return v.includes(e)}function y(e){return b.includes(e)}function u(e,t,s){if(e!==void 0&&!t(e))throw new Error(s)}function h(){const e=O("commerce-assets-enabled");return e&&(typeof e=="string"&&e.toLowerCase()==="true"||typeof e=="boolean"&&e===!0)}function R(){return{quality:80,format:"webp"}}function A(e){return!!(typeof e=="string"?new URL(l(e)):e).pathname.startsWith("/adobe/assets/urn:aaid:aem")}function w(e,t,s={}){const r={...R(),...s},{format:i,crop:n,...o}=r;u(i,y,"Invalid format"),u(o.flip,I,"Invalid flip"),u(o.rotate,L,"Invalid rotation");const a=Object.fromEntries(Object.entries(o).map(([p,d])=>[p,String(d)])),c=new URLSearchParams(a);if(n){const[p,d]=[n.xOrigin||0,n.yOrigin||0],[P,E]=[n.width||100,n.height||100],S=`${p}p,${d}p,${P}p,${E}p`;c.set("crop",S)}return`${e}/as/${t}.${i}?${c.toString()}`}function q(e,t,s={}){if(!h())return e;const r=new URL(l(e));if(!A(r))return e;const i=r.origin+r.pathname;return w(i,t,s)}function _(e){return t=>{const{wrapper:s,alias:m,params:r,imageProps:i}=e;if(!i.src)throw new Error("An image source is required. Please provide a `src` or `imageProps.src`.");const n=s??document.createElement("div"),o=w(i.src,m,r),a={width:r.width,height:r.height,crop:void 0,fit:void 0,auto:void 0},c={...i,width:r.width,height:r.height,src:o,params:a};f.render(g,c)(n),t.replaceWith(n)}}function x(e,t){function s(){const i=t.wrapper??document.createElement("div"),{imageProps:n,params:o}=t,a={...n,width:o.width,height:o.height};f.render(g,a)(i),e.replaceWith(i)}if(!h()){s();return}if(!t.imageProps.src)throw new Error("An image source is required. Please provide a `src` or `imageProps.src`.");const r=new URL(l(t.imageProps.src));if(!A(r)){s();return}_(t)(e)}export{w as generateAemAssetsOptimizedUrl,R as getDefaultAemAssetsOptimizationParams,h as isAemAssetsEnabled,A as isAemAssetsUrl,_ as makeAemAssetsImageSlot,q as tryGenerateAemAssetsOptimizedUrl,x as tryRenderAemAssetsImage};
4
4
  //# sourceMappingURL=assets.js.map
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{g as u}from"../../chunks/get-path-value.js";import{d as f}from"../../chunks/cjs.js";let e=null,r=null,l=null;function C(){e=null,r=null,l=null}function s(t=e){return t?Object.keys(t==null?void 0:t.public).sort((i,o)=>{const a=i.split("/").filter(Boolean).length;return o.split("/").filter(Boolean).length-a}).find(i=>window.location.pathname===i||window.location.pathname.startsWith(i))??"/":(console.warn("No config found. Please call initializeConfig() first."),"/")}function c(){return e?Object.keys(e.public).filter(t=>t!=="default"):(console.warn("No config found. Please call initializeConfig() first."),[])}function m(){return c().length>=1}function w(t){if(!l)throw new Error("Configuration not initialized. Call initializeConfig() first.");const n=l.headers??{};return{...n.all??{},...n[t]??{}}}function g(t,n){var o;const i=(o=t.public)==null?void 0:o.default;return n==="/"||!t.public[n]?i:f(i,t.public[n])}function z(t){return e=t,r=s(e),l=g(e,r),l}function P(t){if(!l)throw new Error("Configuration not initialized. Call initializeConfig() first.");return u(l,t)}export{P as getConfigValue,w as getHeaders,c as getListOfRootPaths,s as getRootPath,z as initializeConfig,m as isMultistore,C as resetConfig};
3
+ import{d as u}from"../../chunks/cjs.js";import{g as f}from"../../chunks/get-path-value.js";let e=null,r=null,l=null;function C(){e=null,r=null,l=null}function s(t=e){return t?Object.keys(t==null?void 0:t.public).sort((i,o)=>{const a=i.split("/").filter(Boolean).length;return o.split("/").filter(Boolean).length-a}).find(i=>window.location.pathname===i||window.location.pathname.startsWith(i))??"/":(console.warn("No config found. Please call initializeConfig() first."),"/")}function c(){return e?Object.keys(e.public).filter(t=>t!=="default"):(console.warn("No config found. Please call initializeConfig() first."),[])}function m(){return c().length>=1}function w(t){if(!l)throw new Error("Configuration not initialized. Call initializeConfig() first.");const n=l.headers??{};return{...n.all??{},...n[t]??{}}}function g(t,n){var o;const i=(o=t.public)==null?void 0:o.default;return n==="/"||!t.public[n]?i:u(i,t.public[n])}function z(t){return e=t,r=s(e),l=g(e,r),l}function P(t){if(!l)throw new Error("Configuration not initialized. Call initializeConfig() first.");return f(l,t)}export{P as getConfigValue,w as getHeaders,c as getListOfRootPaths,s as getRootPath,z as initializeConfig,m as isMultistore,C as resetConfig};
4
4
  //# sourceMappingURL=configs.js.map
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/tools", "version": "1.4.1-alpha008", "license": "SEE LICENSE IN LICENSE.md"}
1
+ {"name": "@dropins/tools", "version": "1.4.1-alpha009", "license": "SEE LICENSE IN LICENSE.md"}
@@ -12,7 +12,6 @@ export interface CartItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'tit
12
12
  totalExcludingTax?: VNode;
13
13
  sku?: VNode;
14
14
  quantity?: number;
15
- quantityContent?: VNode;
16
15
  description?: VNode;
17
16
  attributes?: VNode;
18
17
  footer?: VNode;
@@ -24,7 +23,6 @@ export interface CartItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'tit
24
23
  discount?: VNode;
25
24
  savings?: VNode;
26
25
  actions?: VNode;
27
- removeContent?: VNode;
28
26
  loading?: boolean;
29
27
  updating?: boolean;
30
28
  onRemove?: () => void;
@@ -21,21 +21,12 @@ export declare class events {
21
21
  payload: any;
22
22
  };
23
23
  };
24
- /**
25
- * Returns a scoped event key.
26
- * @param scope - The scope to get the event from.
27
- * @returns - The scoped event key.
28
- */
29
- static _getScopedEvent(scope?: string): <K extends keyof Events>(event: K) => K;
30
24
  /**
31
25
  * Returns the last payload of the event.
32
26
  * @param event – The event to get the last payload from.
33
- * @param options - Optional configuration for the event.
34
27
  * @returns – The last payload of the event.
35
28
  */
36
- static lastPayload<K extends keyof Events>(event: K, options?: {
37
- scope?: string;
38
- }): any;
29
+ static lastPayload(event: string): any;
39
30
  /**
40
31
  * Subscribes to an event.
41
32
  * @param event - The event to subscribe to.
@@ -44,7 +35,6 @@ export declare class events {
44
35
  */
45
36
  static on<K extends keyof Events>(event: K, handler: (payload: Events[K]) => void, options?: {
46
37
  eager?: boolean;
47
- scope?: string;
48
38
  }): {
49
39
  off(): void;
50
40
  } | undefined;
@@ -52,11 +42,8 @@ export declare class events {
52
42
  * Emits an event.
53
43
  * @param event - The event to emit.
54
44
  * @param payload - The event payload.
55
- * @param options - Optional configuration for the event.
56
45
  */
57
- static emit<K extends keyof Events>(event: K, payload: Events[K], options?: {
58
- scope?: string;
59
- }): void;
46
+ static emit<K extends keyof Events>(event: K, payload: Events[K]): void;
60
47
  /**
61
48
  * Enables or disables event logging.
62
49
  * @param enabled - Whether to enable or disable event logging.