@chaindoc_io/embed-sdk 2.2.0-alpha.1 → 2.2.0-alpha.2
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 +6 -0
- package/dist/embed-sdk.umd.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.2.0-alpha.2] - 2026-05-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **ESLint config (`.eslintrc.cjs`)**: project had ESLint dependencies and a `lint` script but no config file, so `yarn lint` was a no-op. Adding the standard `@typescript-eslint/recommended` config makes the script functional and lets us enforce the type tightening introduced alongside this release. Dev-only artifact — not shipped in the published tarball.
|
|
13
|
+
|
|
8
14
|
## [2.2.0-alpha.1] - 2026-05-07
|
|
9
15
|
|
|
10
16
|
### Changed
|
package/dist/embed-sdk.umd.js
CHANGED
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
padding: 0;
|
|
49
49
|
display: block;
|
|
50
50
|
z-index: 2147483647;
|
|
51
|
-
`.trim()),this.isFullscreen=!0)}exitFullscreen(){this.isFullscreen&&(this.logger.log("Exiting fullscreen"),this.previousIframeStyle!==null?this.iframe.setAttribute("style",this.previousIframeStyle):this.iframe.removeAttribute("style"),this.previousIframeStyle=null,this.isFullscreen=!1)}sendMessage(e){if(!this.iframe.contentWindow){this.logger.error("Cannot send message: iframe contentWindow not available");return}this.iframe.contentWindow.postMessage(e,this.allowedOrigin),this.logger.log("Sent message to iframe:",e.type)}close(){if(this.state.isClosed){this.logger.warn("Instance already closed");return}this.logger.log("Closing instance"),this.sendMessage({source:"chaindoc-embed",type:"CLOSE"}),setTimeout(()=>{this.state.isClosed||(this.logger.warn("Iframe did not respond to CLOSE, forcing cleanup"),this.cleanup())},3e3)}changeTheme(e){this.logger.log("Changing theme to:",e),this.state.theme=e,this.sendMessage({source:"chaindoc-embed",type:"THEME_CHANGE",data:{theme:e}})}isReady(){return this.state.isReady}getSessionId(){return this.state.sessionId}_internalOn(e,t){let n=this.internalEventHandlers.get(e);if(n){n.add(t);return}this.internalEventHandlers.set(e,new Set([t]))}emit(e){let t=this.internalEventHandlers.get(e);t&&t.forEach(n=>n())}cleanup(){this.state.isClosed||(this.logger.log("Cleaning up instance"),this.isFullscreen&&this.exitFullscreen(),this.state.isClosed=!0,window.removeEventListener("message",this.messageListener),this.overlay&&(this.overlay.remove(),document.body.style.overflow=this.previousOverflow),this.container&&this.container.querySelector("[data-chaindoc-inline]")?.remove(),this.options.onClose?.(),this.emit("close"),this.internalEventHandlers.clear())}};var d=class{constructor(e){this.instances=new Set;if(!e.publicKey)throw new Error("ChaindocEmbed: publicKey is required");if(!e.publicKey.startsWith("pk_"))throw new Error('ChaindocEmbed: publicKey must start with "pk_"');this.config={publicKey:e.publicKey,environment:e.environment||"production",debug:e.debug||!1},this.logger=new l(this.config.debug),this.logger.log("SDK initialized",this.config)}openSignatureFlow(e){if(!e.sessionId)throw new Error("openSignatureFlow: sessionId is required");if(!e.sessionId.startsWith("ses_"))throw new Error('openSignatureFlow: sessionId must start with "ses_"');if((e.mode||"modal")==="inline"&&!e.container)throw new Error("openSignatureFlow: container is required for inline mode");this.logger.log("Opening signature flow",e);let n=new o(this.config,e,this.logger);return this.instances.add(n),n._internalOn("close",()=>{this.instances.delete(n)}),n}destroy(){this.logger.log("Destroying SDK and all instances");for(let e of this.instances)e.close();this.instances.clear()}static get version(){return"2.2.0-alpha.
|
|
51
|
+
`.trim()),this.isFullscreen=!0)}exitFullscreen(){this.isFullscreen&&(this.logger.log("Exiting fullscreen"),this.previousIframeStyle!==null?this.iframe.setAttribute("style",this.previousIframeStyle):this.iframe.removeAttribute("style"),this.previousIframeStyle=null,this.isFullscreen=!1)}sendMessage(e){if(!this.iframe.contentWindow){this.logger.error("Cannot send message: iframe contentWindow not available");return}this.iframe.contentWindow.postMessage(e,this.allowedOrigin),this.logger.log("Sent message to iframe:",e.type)}close(){if(this.state.isClosed){this.logger.warn("Instance already closed");return}this.logger.log("Closing instance"),this.sendMessage({source:"chaindoc-embed",type:"CLOSE"}),setTimeout(()=>{this.state.isClosed||(this.logger.warn("Iframe did not respond to CLOSE, forcing cleanup"),this.cleanup())},3e3)}changeTheme(e){this.logger.log("Changing theme to:",e),this.state.theme=e,this.sendMessage({source:"chaindoc-embed",type:"THEME_CHANGE",data:{theme:e}})}isReady(){return this.state.isReady}getSessionId(){return this.state.sessionId}_internalOn(e,t){let n=this.internalEventHandlers.get(e);if(n){n.add(t);return}this.internalEventHandlers.set(e,new Set([t]))}emit(e){let t=this.internalEventHandlers.get(e);t&&t.forEach(n=>n())}cleanup(){this.state.isClosed||(this.logger.log("Cleaning up instance"),this.isFullscreen&&this.exitFullscreen(),this.state.isClosed=!0,window.removeEventListener("message",this.messageListener),this.overlay&&(this.overlay.remove(),document.body.style.overflow=this.previousOverflow),this.container&&this.container.querySelector("[data-chaindoc-inline]")?.remove(),this.options.onClose?.(),this.emit("close"),this.internalEventHandlers.clear())}};var d=class{constructor(e){this.instances=new Set;if(!e.publicKey)throw new Error("ChaindocEmbed: publicKey is required");if(!e.publicKey.startsWith("pk_"))throw new Error('ChaindocEmbed: publicKey must start with "pk_"');this.config={publicKey:e.publicKey,environment:e.environment||"production",debug:e.debug||!1},this.logger=new l(this.config.debug),this.logger.log("SDK initialized",this.config)}openSignatureFlow(e){if(!e.sessionId)throw new Error("openSignatureFlow: sessionId is required");if(!e.sessionId.startsWith("ses_"))throw new Error('openSignatureFlow: sessionId must start with "ses_"');if((e.mode||"modal")==="inline"&&!e.container)throw new Error("openSignatureFlow: container is required for inline mode");this.logger.log("Opening signature flow",e);let n=new o(this.config,e,this.logger);return this.instances.add(n),n._internalOn("close",()=>{this.instances.delete(n)}),n}destroy(){this.logger.log("Destroying SDK and all instances");for(let e of this.instances)e.close();this.instances.clear()}static get version(){return"2.2.0-alpha.2"}};return O(k);})();
|
|
52
52
|
//# sourceMappingURL=embed-sdk.umd.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
padding: 0;
|
|
49
49
|
display: block;
|
|
50
50
|
z-index: 2147483647;
|
|
51
|
-
`.trim()),this.isFullscreen=!0)}exitFullscreen(){this.isFullscreen&&(this.logger.log("Exiting fullscreen"),this.previousIframeStyle!==null?this.iframe.setAttribute("style",this.previousIframeStyle):this.iframe.removeAttribute("style"),this.previousIframeStyle=null,this.isFullscreen=!1)}sendMessage(e){if(!this.iframe.contentWindow){this.logger.error("Cannot send message: iframe contentWindow not available");return}this.iframe.contentWindow.postMessage(e,this.allowedOrigin),this.logger.log("Sent message to iframe:",e.type)}close(){if(this.state.isClosed){this.logger.warn("Instance already closed");return}this.logger.log("Closing instance"),this.sendMessage({source:"chaindoc-embed",type:"CLOSE"}),setTimeout(()=>{this.state.isClosed||(this.logger.warn("Iframe did not respond to CLOSE, forcing cleanup"),this.cleanup())},3e3)}changeTheme(e){this.logger.log("Changing theme to:",e),this.state.theme=e,this.sendMessage({source:"chaindoc-embed",type:"THEME_CHANGE",data:{theme:e}})}isReady(){return this.state.isReady}getSessionId(){return this.state.sessionId}_internalOn(e,t){let n=this.internalEventHandlers.get(e);if(n){n.add(t);return}this.internalEventHandlers.set(e,new Set([t]))}emit(e){let t=this.internalEventHandlers.get(e);t&&t.forEach(n=>n())}cleanup(){this.state.isClosed||(this.logger.log("Cleaning up instance"),this.isFullscreen&&this.exitFullscreen(),this.state.isClosed=!0,window.removeEventListener("message",this.messageListener),this.overlay&&(this.overlay.remove(),document.body.style.overflow=this.previousOverflow),this.container&&this.container.querySelector("[data-chaindoc-inline]")?.remove(),this.options.onClose?.(),this.emit("close"),this.internalEventHandlers.clear())}};var d=class{constructor(e){this.instances=new Set;if(!e.publicKey)throw new Error("ChaindocEmbed: publicKey is required");if(!e.publicKey.startsWith("pk_"))throw new Error('ChaindocEmbed: publicKey must start with "pk_"');this.config={publicKey:e.publicKey,environment:e.environment||"production",debug:e.debug||!1},this.logger=new l(this.config.debug),this.logger.log("SDK initialized",this.config)}openSignatureFlow(e){if(!e.sessionId)throw new Error("openSignatureFlow: sessionId is required");if(!e.sessionId.startsWith("ses_"))throw new Error('openSignatureFlow: sessionId must start with "ses_"');if((e.mode||"modal")==="inline"&&!e.container)throw new Error("openSignatureFlow: container is required for inline mode");this.logger.log("Opening signature flow",e);let n=new o(this.config,e,this.logger);return this.instances.add(n),n._internalOn("close",()=>{this.instances.delete(n)}),n}destroy(){this.logger.log("Destroying SDK and all instances");for(let e of this.instances)e.close();this.instances.clear()}static get version(){return"2.2.0-alpha.
|
|
51
|
+
`.trim()),this.isFullscreen=!0)}exitFullscreen(){this.isFullscreen&&(this.logger.log("Exiting fullscreen"),this.previousIframeStyle!==null?this.iframe.setAttribute("style",this.previousIframeStyle):this.iframe.removeAttribute("style"),this.previousIframeStyle=null,this.isFullscreen=!1)}sendMessage(e){if(!this.iframe.contentWindow){this.logger.error("Cannot send message: iframe contentWindow not available");return}this.iframe.contentWindow.postMessage(e,this.allowedOrigin),this.logger.log("Sent message to iframe:",e.type)}close(){if(this.state.isClosed){this.logger.warn("Instance already closed");return}this.logger.log("Closing instance"),this.sendMessage({source:"chaindoc-embed",type:"CLOSE"}),setTimeout(()=>{this.state.isClosed||(this.logger.warn("Iframe did not respond to CLOSE, forcing cleanup"),this.cleanup())},3e3)}changeTheme(e){this.logger.log("Changing theme to:",e),this.state.theme=e,this.sendMessage({source:"chaindoc-embed",type:"THEME_CHANGE",data:{theme:e}})}isReady(){return this.state.isReady}getSessionId(){return this.state.sessionId}_internalOn(e,t){let n=this.internalEventHandlers.get(e);if(n){n.add(t);return}this.internalEventHandlers.set(e,new Set([t]))}emit(e){let t=this.internalEventHandlers.get(e);t&&t.forEach(n=>n())}cleanup(){this.state.isClosed||(this.logger.log("Cleaning up instance"),this.isFullscreen&&this.exitFullscreen(),this.state.isClosed=!0,window.removeEventListener("message",this.messageListener),this.overlay&&(this.overlay.remove(),document.body.style.overflow=this.previousOverflow),this.container&&this.container.querySelector("[data-chaindoc-inline]")?.remove(),this.options.onClose?.(),this.emit("close"),this.internalEventHandlers.clear())}};var d=class{constructor(e){this.instances=new Set;if(!e.publicKey)throw new Error("ChaindocEmbed: publicKey is required");if(!e.publicKey.startsWith("pk_"))throw new Error('ChaindocEmbed: publicKey must start with "pk_"');this.config={publicKey:e.publicKey,environment:e.environment||"production",debug:e.debug||!1},this.logger=new l(this.config.debug),this.logger.log("SDK initialized",this.config)}openSignatureFlow(e){if(!e.sessionId)throw new Error("openSignatureFlow: sessionId is required");if(!e.sessionId.startsWith("ses_"))throw new Error('openSignatureFlow: sessionId must start with "ses_"');if((e.mode||"modal")==="inline"&&!e.container)throw new Error("openSignatureFlow: container is required for inline mode");this.logger.log("Opening signature flow",e);let n=new o(this.config,e,this.logger);return this.instances.add(n),n._internalOn("close",()=>{this.instances.delete(n)}),n}destroy(){this.logger.log("Destroying SDK and all instances");for(let e of this.instances)e.close();this.instances.clear()}static get version(){return"2.2.0-alpha.2"}};0&&(module.exports={ChaindocEmbed,EmbedInstance});
|
|
52
52
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -48,5 +48,5 @@ function d(i){switch(i){case"production":return"https://embed.chaindoc.io";case"
|
|
|
48
48
|
padding: 0;
|
|
49
49
|
display: block;
|
|
50
50
|
z-index: 2147483647;
|
|
51
|
-
`.trim()),this.isFullscreen=!0)}exitFullscreen(){this.isFullscreen&&(this.logger.log("Exiting fullscreen"),this.previousIframeStyle!==null?this.iframe.setAttribute("style",this.previousIframeStyle):this.iframe.removeAttribute("style"),this.previousIframeStyle=null,this.isFullscreen=!1)}sendMessage(e){if(!this.iframe.contentWindow){this.logger.error("Cannot send message: iframe contentWindow not available");return}this.iframe.contentWindow.postMessage(e,this.allowedOrigin),this.logger.log("Sent message to iframe:",e.type)}close(){if(this.state.isClosed){this.logger.warn("Instance already closed");return}this.logger.log("Closing instance"),this.sendMessage({source:"chaindoc-embed",type:"CLOSE"}),setTimeout(()=>{this.state.isClosed||(this.logger.warn("Iframe did not respond to CLOSE, forcing cleanup"),this.cleanup())},3e3)}changeTheme(e){this.logger.log("Changing theme to:",e),this.state.theme=e,this.sendMessage({source:"chaindoc-embed",type:"THEME_CHANGE",data:{theme:e}})}isReady(){return this.state.isReady}getSessionId(){return this.state.sessionId}_internalOn(e,t){let n=this.internalEventHandlers.get(e);if(n){n.add(t);return}this.internalEventHandlers.set(e,new Set([t]))}emit(e){let t=this.internalEventHandlers.get(e);t&&t.forEach(n=>n())}cleanup(){this.state.isClosed||(this.logger.log("Cleaning up instance"),this.isFullscreen&&this.exitFullscreen(),this.state.isClosed=!0,window.removeEventListener("message",this.messageListener),this.overlay&&(this.overlay.remove(),document.body.style.overflow=this.previousOverflow),this.container&&this.container.querySelector("[data-chaindoc-inline]")?.remove(),this.options.onClose?.(),this.emit("close"),this.internalEventHandlers.clear())}};var h=class{constructor(e){this.instances=new Set;if(!e.publicKey)throw new Error("ChaindocEmbed: publicKey is required");if(!e.publicKey.startsWith("pk_"))throw new Error('ChaindocEmbed: publicKey must start with "pk_"');this.config={publicKey:e.publicKey,environment:e.environment||"production",debug:e.debug||!1},this.logger=new l(this.config.debug),this.logger.log("SDK initialized",this.config)}openSignatureFlow(e){if(!e.sessionId)throw new Error("openSignatureFlow: sessionId is required");if(!e.sessionId.startsWith("ses_"))throw new Error('openSignatureFlow: sessionId must start with "ses_"');if((e.mode||"modal")==="inline"&&!e.container)throw new Error("openSignatureFlow: container is required for inline mode");this.logger.log("Opening signature flow",e);let n=new r(this.config,e,this.logger);return this.instances.add(n),n._internalOn("close",()=>{this.instances.delete(n)}),n}destroy(){this.logger.log("Destroying SDK and all instances");for(let e of this.instances)e.close();this.instances.clear()}static get version(){return"2.2.0-alpha.
|
|
51
|
+
`.trim()),this.isFullscreen=!0)}exitFullscreen(){this.isFullscreen&&(this.logger.log("Exiting fullscreen"),this.previousIframeStyle!==null?this.iframe.setAttribute("style",this.previousIframeStyle):this.iframe.removeAttribute("style"),this.previousIframeStyle=null,this.isFullscreen=!1)}sendMessage(e){if(!this.iframe.contentWindow){this.logger.error("Cannot send message: iframe contentWindow not available");return}this.iframe.contentWindow.postMessage(e,this.allowedOrigin),this.logger.log("Sent message to iframe:",e.type)}close(){if(this.state.isClosed){this.logger.warn("Instance already closed");return}this.logger.log("Closing instance"),this.sendMessage({source:"chaindoc-embed",type:"CLOSE"}),setTimeout(()=>{this.state.isClosed||(this.logger.warn("Iframe did not respond to CLOSE, forcing cleanup"),this.cleanup())},3e3)}changeTheme(e){this.logger.log("Changing theme to:",e),this.state.theme=e,this.sendMessage({source:"chaindoc-embed",type:"THEME_CHANGE",data:{theme:e}})}isReady(){return this.state.isReady}getSessionId(){return this.state.sessionId}_internalOn(e,t){let n=this.internalEventHandlers.get(e);if(n){n.add(t);return}this.internalEventHandlers.set(e,new Set([t]))}emit(e){let t=this.internalEventHandlers.get(e);t&&t.forEach(n=>n())}cleanup(){this.state.isClosed||(this.logger.log("Cleaning up instance"),this.isFullscreen&&this.exitFullscreen(),this.state.isClosed=!0,window.removeEventListener("message",this.messageListener),this.overlay&&(this.overlay.remove(),document.body.style.overflow=this.previousOverflow),this.container&&this.container.querySelector("[data-chaindoc-inline]")?.remove(),this.options.onClose?.(),this.emit("close"),this.internalEventHandlers.clear())}};var h=class{constructor(e){this.instances=new Set;if(!e.publicKey)throw new Error("ChaindocEmbed: publicKey is required");if(!e.publicKey.startsWith("pk_"))throw new Error('ChaindocEmbed: publicKey must start with "pk_"');this.config={publicKey:e.publicKey,environment:e.environment||"production",debug:e.debug||!1},this.logger=new l(this.config.debug),this.logger.log("SDK initialized",this.config)}openSignatureFlow(e){if(!e.sessionId)throw new Error("openSignatureFlow: sessionId is required");if(!e.sessionId.startsWith("ses_"))throw new Error('openSignatureFlow: sessionId must start with "ses_"');if((e.mode||"modal")==="inline"&&!e.container)throw new Error("openSignatureFlow: container is required for inline mode");this.logger.log("Opening signature flow",e);let n=new r(this.config,e,this.logger);return this.instances.add(n),n._internalOn("close",()=>{this.instances.delete(n)}),n}destroy(){this.logger.log("Destroying SDK and all instances");for(let e of this.instances)e.close();this.instances.clear()}static get version(){return"2.2.0-alpha.2"}};export{h as ChaindocEmbed,r as EmbedInstance};
|
|
52
52
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED