New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@videsk/headway-sdk

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@videsk/headway-sdk - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

dist/headway-sdk.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).HeadwaySDK=e()}(this,(function(){return class{constructor(t,e={}){if(this.options=Object.assign({hostname:"https://headway-widget.net",endpoints:{widgets:"/widgets"},storageKeys:{read:"HW_readItems",seen:"HW_seenItems"},iframeAttributes:{id:"HW_frame",allow:"allow-same-origin allow-scripts allow-top-navigation allow-popups allow-forms allow-popups-to-escape-sandbox","aria-hidden":!0,referrerpolicy:"strict-origin",tabindex:0}},e),this.account=t,this.events={badge:()=>{},height:()=>{},ready:()=>{}},this.changelogs=[],this.badge=0,this.options.iframeAttributes.src=`${this.options.hostname}${this.options.endpoints.widgets}/${this.account}`,!this.account)throw new Error("Account cannot be empty.");this.postMessagesEvents={setHeight:t=>this.constructor.setHeight(t,this.events.height),widgetReady:t=>this.constructor.ready(t,this),setState:t=>this.constructor.saveState(t,this)},this._postMessageManager=this._handleEvents.bind(this),window.addEventListener("message",this._postMessageManager)}on(t="",e=(()=>{})){if(!t||"function"!=typeof e)throw new Error("Provide valid event name and callback");this.events[t]=e}render(t=""){const{iframeAttributes:e}=this.options;this.remove();const s="string"==typeof t?document.querySelector(t):t,o=document.createElement("iframe");Object.keys(e).forEach((t=>o.setAttribute(t,e[t]))),o.addEventListener("load",(()=>{const t=this.constructor.payloadReady(this.account,this.options,s);this.constructor.sendPostMessage(o,"CaptainAmerica","ready",t)})),s.appendChild(o)}remove(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.remove()}saveActivity(t=[],e=[]){const{read:s,seen:o}=this.options.storageKeys;window.localStorage.setItem(`${o}[${this.account}]`,t.toString()),window.localStorage.setItem(`${s}[${this.account}]`,e.toString())}_handleEvents(t){const{origin:e,data:s}=t;if(!e.includes(this.options.hostname))return;const[o,i,n]=s;i in this.postMessagesEvents&&this.postMessagesEvents[i](n[0])}static sendPostMessage(t,e,s,o){const i=JSON.parse(JSON.stringify([e,s,[o]]));t.contentWindow.postMessage(i,"*")}static payloadReady(t,e,s){const{storageKeys:o}=e,i=window.localStorage.getItem(o.seen),n=window.localStorage.getItem(o.read);return{host:window.location.hostname,newWidgetPositioning:void 0,localStorage:{seen:i||[],read:n||[]},position:{x:"right",y:"bottom",version:"v0"},options:{account:t,callbacks:null,enabled:!0,selector:s}}}static setHeight(t,e=(()=>{})){const{height:s}=t;e(s)}static ready(t,e){const{changelogs:s,state:o,badgeCount:i}=t;e.badge=i,e.events.badge(i),e.changelogs=s,e.saveActivity(o.seen,o.read),e.events.ready(e.changelogs)}static saveState(t,e){const{seen:s=[],read:o=[]}=t;e.saveActivity(s,o)}}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).HeadwaySDK=e()}(this,(function(){return class{constructor(t,e={}){if(this.options=Object.assign({hostname:"https://headway-widget.net",endpoints:{widgets:"/widgets"},storageKeys:{read:"HW_readItems",seen:"HW_seenItems"},iframeAttributes:{id:"HW_frame",allow:"allow-same-origin allow-scripts allow-top-navigation allow-popups allow-forms allow-popups-to-escape-sandbox","aria-hidden":!0,referrerpolicy:"strict-origin",tabindex:0}},e),this.account=t,this.events={badge:()=>{},height:()=>{},ready:()=>{}},this.changelogs=[],this.badge=0,this.options.iframeAttributes.src=`${this.options.hostname}${this.options.endpoints.widgets}/${this.account}`,!this.account)throw new Error("Account cannot be empty.");this.postMessagesEvents={setHeight:t=>this.constructor.setHeight(t,this.events.height),widgetReady:t=>this.constructor.ready(t,this),setState:t=>this.constructor.saveState(t,this)},this._postMessageManager=this._handleEvents.bind(this),this._version="1.1.1",window.addEventListener("message",this._postMessageManager)}on(t="",e=(()=>{})){if(!t||"function"!=typeof e)throw new Error("Provide valid event name and callback");this.events[t]=e}render(t=""){const{iframeAttributes:e}=this.options;this.remove();const s="string"==typeof t?document.querySelector(t):t,o=document.createElement("iframe");Object.keys(e).forEach((t=>o.setAttribute(t,e[t]))),o.addEventListener("load",(()=>{const t=this.constructor.payloadReady(this.account,this.options,s);this.constructor.sendPostMessage(o,"CaptainAmerica","ready",t)})),s.appendChild(o)}remove(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.remove()}reload(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.contentWindow.location.reload()}saveActivity(t=[],e=[]){const{read:s,seen:o}=this.options.storageKeys;window.localStorage.setItem(`${o}[${this.account}]`,t.toString()),window.localStorage.setItem(`${s}[${this.account}]`,e.toString())}_handleEvents(t){const{origin:e,data:s}=t;if(!e.includes(this.options.hostname))return;const[o,i,n]=s;i in this.postMessagesEvents&&this.postMessagesEvents[i](n[0])}static sendPostMessage(t,e,s,o){const i=JSON.parse(JSON.stringify([e,s,[o]]));t.contentWindow.postMessage(i,"*")}static payloadReady(t,e,s){const{storageKeys:o}=e,i=window.localStorage.getItem(o.seen),n=window.localStorage.getItem(o.read);return{host:window.location.hostname,newWidgetPositioning:void 0,localStorage:{seen:i||[],read:n||[]},position:{x:"right",y:"bottom",version:"v0"},options:{account:t,callbacks:null,enabled:!0,selector:s}}}static setHeight(t,e=(()=>{})){const{height:s}=t;e(s)}static ready(t,e){const{changelogs:s,state:o,badgeCount:i}=t;e.badge=i,e.events.badge(i),e.changelogs=s,e.saveActivity(o.seen,o.read),e.events.ready(e.changelogs)}static saveState(t,e){const{seen:s=[],read:o=[]}=t;e.saveActivity(s,o)}}}));

@@ -1,1 +0,1 @@

"use strict";var t=class{constructor(t,e={}){if(this.options=Object.assign({hostname:"https://headway-widget.net",endpoints:{widgets:"/widgets"},storageKeys:{read:"HW_readItems",seen:"HW_seenItems"},iframeAttributes:{id:"HW_frame",allow:"allow-same-origin allow-scripts allow-top-navigation allow-popups allow-forms allow-popups-to-escape-sandbox","aria-hidden":!0,referrerpolicy:"strict-origin",tabindex:0}},e),this.account=t,this.events={badge:()=>{},height:()=>{},ready:()=>{}},this.changelogs=[],this.badge=0,this.options.iframeAttributes.src=`${this.options.hostname}${this.options.endpoints.widgets}/${this.account}`,!this.account)throw new Error("Account cannot be empty.");this.postMessagesEvents={setHeight:t=>this.constructor.setHeight(t,this.events.height),widgetReady:t=>this.constructor.ready(t,this),setState:t=>this.constructor.saveState(t,this)},this._postMessageManager=this._handleEvents.bind(this),window.addEventListener("message",this._postMessageManager)}on(t="",e=(()=>{})){if(!t||"function"!=typeof e)throw new Error("Provide valid event name and callback");this.events[t]=e}render(t=""){const{iframeAttributes:e}=this.options;this.remove();const s="string"==typeof t?document.querySelector(t):t,o=document.createElement("iframe");Object.keys(e).forEach((t=>o.setAttribute(t,e[t]))),o.addEventListener("load",(()=>{const t=this.constructor.payloadReady(this.account,this.options,s);this.constructor.sendPostMessage(o,"CaptainAmerica","ready",t)})),s.appendChild(o)}remove(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.remove()}saveActivity(t=[],e=[]){const{read:s,seen:o}=this.options.storageKeys;window.localStorage.setItem(`${o}[${this.account}]`,t.toString()),window.localStorage.setItem(`${s}[${this.account}]`,e.toString())}_handleEvents(t){const{origin:e,data:s}=t;if(!e.includes(this.options.hostname))return;const[o,i,a]=s;i in this.postMessagesEvents&&this.postMessagesEvents[i](a[0])}static sendPostMessage(t,e,s,o){const i=JSON.parse(JSON.stringify([e,s,[o]]));t.contentWindow.postMessage(i,"*")}static payloadReady(t,e,s){const{storageKeys:o}=e,i=window.localStorage.getItem(o.seen),a=window.localStorage.getItem(o.read);return{host:window.location.hostname,newWidgetPositioning:void 0,localStorage:{seen:i||[],read:a||[]},position:{x:"right",y:"bottom",version:"v0"},options:{account:t,callbacks:null,enabled:!0,selector:s}}}static setHeight(t,e=(()=>{})){const{height:s}=t;e(s)}static ready(t,e){const{changelogs:s,state:o,badgeCount:i}=t;e.badge=i,e.events.badge(i),e.changelogs=s,e.saveActivity(o.seen,o.read),e.events.ready(e.changelogs)}static saveState(t,e){const{seen:s=[],read:o=[]}=t;e.saveActivity(s,o)}};module.exports=t;
"use strict";var t=class{constructor(t,e={}){if(this.options=Object.assign({hostname:"https://headway-widget.net",endpoints:{widgets:"/widgets"},storageKeys:{read:"HW_readItems",seen:"HW_seenItems"},iframeAttributes:{id:"HW_frame",allow:"allow-same-origin allow-scripts allow-top-navigation allow-popups allow-forms allow-popups-to-escape-sandbox","aria-hidden":!0,referrerpolicy:"strict-origin",tabindex:0}},e),this.account=t,this.events={badge:()=>{},height:()=>{},ready:()=>{}},this.changelogs=[],this.badge=0,this.options.iframeAttributes.src=`${this.options.hostname}${this.options.endpoints.widgets}/${this.account}`,!this.account)throw new Error("Account cannot be empty.");this.postMessagesEvents={setHeight:t=>this.constructor.setHeight(t,this.events.height),widgetReady:t=>this.constructor.ready(t,this),setState:t=>this.constructor.saveState(t,this)},this._postMessageManager=this._handleEvents.bind(this),this._version="1.1.1",window.addEventListener("message",this._postMessageManager)}on(t="",e=(()=>{})){if(!t||"function"!=typeof e)throw new Error("Provide valid event name and callback");this.events[t]=e}render(t=""){const{iframeAttributes:e}=this.options;this.remove();const s="string"==typeof t?document.querySelector(t):t,o=document.createElement("iframe");Object.keys(e).forEach((t=>o.setAttribute(t,e[t]))),o.addEventListener("load",(()=>{const t=this.constructor.payloadReady(this.account,this.options,s);this.constructor.sendPostMessage(o,"CaptainAmerica","ready",t)})),s.appendChild(o)}remove(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.remove()}reload(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.contentWindow.location.reload()}saveActivity(t=[],e=[]){const{read:s,seen:o}=this.options.storageKeys;window.localStorage.setItem(`${o}[${this.account}]`,t.toString()),window.localStorage.setItem(`${s}[${this.account}]`,e.toString())}_handleEvents(t){const{origin:e,data:s}=t;if(!e.includes(this.options.hostname))return;const[o,i,n]=s;i in this.postMessagesEvents&&this.postMessagesEvents[i](n[0])}static sendPostMessage(t,e,s,o){const i=JSON.parse(JSON.stringify([e,s,[o]]));t.contentWindow.postMessage(i,"*")}static payloadReady(t,e,s){const{storageKeys:o}=e,i=window.localStorage.getItem(o.seen),n=window.localStorage.getItem(o.read);return{host:window.location.hostname,newWidgetPositioning:void 0,localStorage:{seen:i||[],read:n||[]},position:{x:"right",y:"bottom",version:"v0"},options:{account:t,callbacks:null,enabled:!0,selector:s}}}static setHeight(t,e=(()=>{})){const{height:s}=t;e(s)}static ready(t,e){const{changelogs:s,state:o,badgeCount:i}=t;e.badge=i,e.events.badge(i),e.changelogs=s,e.saveActivity(o.seen,o.read),e.events.ready(e.changelogs)}static saveState(t,e){const{seen:s=[],read:o=[]}=t;e.saveActivity(s,o)}};module.exports=t;

@@ -1,1 +0,1 @@

var t=class{constructor(t,e={}){if(this.options=Object.assign({hostname:"https://headway-widget.net",endpoints:{widgets:"/widgets"},storageKeys:{read:"HW_readItems",seen:"HW_seenItems"},iframeAttributes:{id:"HW_frame",allow:"allow-same-origin allow-scripts allow-top-navigation allow-popups allow-forms allow-popups-to-escape-sandbox","aria-hidden":!0,referrerpolicy:"strict-origin",tabindex:0}},e),this.account=t,this.events={badge:()=>{},height:()=>{},ready:()=>{}},this.changelogs=[],this.badge=0,this.options.iframeAttributes.src=`${this.options.hostname}${this.options.endpoints.widgets}/${this.account}`,!this.account)throw new Error("Account cannot be empty.");this.postMessagesEvents={setHeight:t=>this.constructor.setHeight(t,this.events.height),widgetReady:t=>this.constructor.ready(t,this),setState:t=>this.constructor.saveState(t,this)},this._postMessageManager=this._handleEvents.bind(this),window.addEventListener("message",this._postMessageManager)}on(t="",e=(()=>{})){if(!t||"function"!=typeof e)throw new Error("Provide valid event name and callback");this.events[t]=e}render(t=""){const{iframeAttributes:e}=this.options;this.remove();const s="string"==typeof t?document.querySelector(t):t,o=document.createElement("iframe");Object.keys(e).forEach((t=>o.setAttribute(t,e[t]))),o.addEventListener("load",(()=>{const t=this.constructor.payloadReady(this.account,this.options,s);this.constructor.sendPostMessage(o,"CaptainAmerica","ready",t)})),s.appendChild(o)}remove(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.remove()}saveActivity(t=[],e=[]){const{read:s,seen:o}=this.options.storageKeys;window.localStorage.setItem(`${o}[${this.account}]`,t.toString()),window.localStorage.setItem(`${s}[${this.account}]`,e.toString())}_handleEvents(t){const{origin:e,data:s}=t;if(!e.includes(this.options.hostname))return;const[o,i,a]=s;i in this.postMessagesEvents&&this.postMessagesEvents[i](a[0])}static sendPostMessage(t,e,s,o){const i=JSON.parse(JSON.stringify([e,s,[o]]));t.contentWindow.postMessage(i,"*")}static payloadReady(t,e,s){const{storageKeys:o}=e,i=window.localStorage.getItem(o.seen),a=window.localStorage.getItem(o.read);return{host:window.location.hostname,newWidgetPositioning:void 0,localStorage:{seen:i||[],read:a||[]},position:{x:"right",y:"bottom",version:"v0"},options:{account:t,callbacks:null,enabled:!0,selector:s}}}static setHeight(t,e=(()=>{})){const{height:s}=t;e(s)}static ready(t,e){const{changelogs:s,state:o,badgeCount:i}=t;e.badge=i,e.events.badge(i),e.changelogs=s,e.saveActivity(o.seen,o.read),e.events.ready(e.changelogs)}static saveState(t,e){const{seen:s=[],read:o=[]}=t;e.saveActivity(s,o)}};export default t;
var t=class{constructor(t,e={}){if(this.options=Object.assign({hostname:"https://headway-widget.net",endpoints:{widgets:"/widgets"},storageKeys:{read:"HW_readItems",seen:"HW_seenItems"},iframeAttributes:{id:"HW_frame",allow:"allow-same-origin allow-scripts allow-top-navigation allow-popups allow-forms allow-popups-to-escape-sandbox","aria-hidden":!0,referrerpolicy:"strict-origin",tabindex:0}},e),this.account=t,this.events={badge:()=>{},height:()=>{},ready:()=>{}},this.changelogs=[],this.badge=0,this.options.iframeAttributes.src=`${this.options.hostname}${this.options.endpoints.widgets}/${this.account}`,!this.account)throw new Error("Account cannot be empty.");this.postMessagesEvents={setHeight:t=>this.constructor.setHeight(t,this.events.height),widgetReady:t=>this.constructor.ready(t,this),setState:t=>this.constructor.saveState(t,this)},this._postMessageManager=this._handleEvents.bind(this),this._version="1.1.1",window.addEventListener("message",this._postMessageManager)}on(t="",e=(()=>{})){if(!t||"function"!=typeof e)throw new Error("Provide valid event name and callback");this.events[t]=e}render(t=""){const{iframeAttributes:e}=this.options;this.remove();const s="string"==typeof t?document.querySelector(t):t,o=document.createElement("iframe");Object.keys(e).forEach((t=>o.setAttribute(t,e[t]))),o.addEventListener("load",(()=>{const t=this.constructor.payloadReady(this.account,this.options,s);this.constructor.sendPostMessage(o,"CaptainAmerica","ready",t)})),s.appendChild(o)}remove(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.remove()}reload(){const t=document.querySelector(`#${this.options.iframeAttributes.id}`);t&&t.contentWindow.location.reload()}saveActivity(t=[],e=[]){const{read:s,seen:o}=this.options.storageKeys;window.localStorage.setItem(`${o}[${this.account}]`,t.toString()),window.localStorage.setItem(`${s}[${this.account}]`,e.toString())}_handleEvents(t){const{origin:e,data:s}=t;if(!e.includes(this.options.hostname))return;const[o,i,n]=s;i in this.postMessagesEvents&&this.postMessagesEvents[i](n[0])}static sendPostMessage(t,e,s,o){const i=JSON.parse(JSON.stringify([e,s,[o]]));t.contentWindow.postMessage(i,"*")}static payloadReady(t,e,s){const{storageKeys:o}=e,i=window.localStorage.getItem(o.seen),n=window.localStorage.getItem(o.read);return{host:window.location.hostname,newWidgetPositioning:void 0,localStorage:{seen:i||[],read:n||[]},position:{x:"right",y:"bottom",version:"v0"},options:{account:t,callbacks:null,enabled:!0,selector:s}}}static setHeight(t,e=(()=>{})){const{height:s}=t;e(s)}static ready(t,e){const{changelogs:s,state:o,badgeCount:i}=t;e.badge=i,e.events.badge(i),e.changelogs=s,e.saveActivity(o.seen,o.read),e.events.ready(e.changelogs)}static saveState(t,e){const{seen:s=[],read:o=[]}=t;e.saveActivity(s,o)}};export default t;
{
"name": "@videsk/headway-sdk",
"umdName": "HeadwaySDK",
"version": "1.1.0",
"version": "1.1.1",
"description": "Headway SDK for integrate changelog in custom HTML node.",

@@ -32,2 +32,3 @@ "files": [

"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.0",

@@ -34,0 +35,0 @@ "@rollup/plugin-replace": "^2.4.2",

@@ -7,3 +7,3 @@ # Headway SDK

Headway App, Inc. can decide to make this code public, transfer to them or delete it.
###### Headway App, Inc. can decide to make this code public, transfer to them or delete it.

@@ -10,0 +10,0 @@ Please take as real needs of a customer, not intent of break copyrights.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc