@faintlines/widget-standalone
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -1,2 +0,2 @@ | ||
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(require("@faintlines/widget"),require("@faintlines/widget/dist/index.css"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["@faintlines/widget","@faintlines/widget/dist/index.css","react","react-dom"],i):i((e="undefined"!=typeof globalThis?globalThis:e||self).Widget,null,e.react,e.ReactDOM)}(this,(function(e,i,t,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=o(e),f=o(n);!function(){if(["localhost","amazinganchors.com"].includes(window.location.hostname)){var e=window.WIDGET||{},i=e.config,n=e.storyConfig;if(i&&n){var o=document.createElement("div");document.body.appendChild(o),f.default.render(t.createElement(d.default,{config:i,storyConfig:n}),o)}}}()})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("react"),require("react-dom"),require("classnames")):"function"==typeof define&&define.amd?define(["react","react-dom","classnames"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).React,e.ReactDOM,e.classnames)}(this,(function(e,t,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e),l=o(t),r=o(n),d={exports:{}};function u(){}function a(){}a.resetWarningCache=u;d.exports=function(){function e(e,t,n,o,i,l){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==l){var r=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw r.name="Invariant Violation",r}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:u};return n.PropTypes=n,n}();var _=d.exports;function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function m(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var g=e.forwardRef((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,l=e.size,r=void 0===l?24:l,d=m(e,["color","size"]);return i.default.createElement("svg",c({ref:t,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},d),i.default.createElement("line",{x1:"12",y1:"2",x2:"12",y2:"6"}),i.default.createElement("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),i.default.createElement("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"}),i.default.createElement("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"}),i.default.createElement("line",{x1:"2",y1:"12",x2:"6",y2:"12"}),i.default.createElement("line",{x1:"18",y1:"12",x2:"22",y2:"12"}),i.default.createElement("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"}),i.default.createElement("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"}))}));g.propTypes={color:_.string,size:_.oneOfType([_.string,_.number])},g.displayName="Loader";var f=g;function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var o,i,l=[],r=!0,d=!1;try{for(n=n.call(e);!(r=(o=n.next()).done)&&(l.push(o.value),!t||l.length!==t);r=!0);}catch(e){d=!0,i=e}finally{try{r||null==n.return||n.return()}finally{if(d)throw i}}return l}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var x={bubble:"Widget-module_bubble__3_xTo",dialog:"Widget-module_dialog__2Z0Jl",open:"Widget-module_open__2Vcee",topRight:"Widget-module_topRight__2Bl2v",topLeft:"Widget-module_topLeft__3maJ_",bottomRight:"Widget-module_bottomRight__2XhL5",bottomLeft:"Widget-module_bottomLeft__cdvON",visible:"Widget-module_visible__aogw6",frame:"Widget-module_frame__3KhlT",spinner:"Widget-module_spinner__3Hf-F",spinner__icon:"Widget-module_spinner__icon__2ePMO",spin:"Widget-module_spin__7WHQQ",widget:"Widget-module_widget__35l4R"},v="bottomRight",w=window.location.hostname.includes("adventurestore.me")?"https://".concat(window.location.hostname):"https://adventurestore.me";function O(t){var n=t.config,o=t.storyConfig,l=t.context;t.onChatClick;var r=y(e.useState(!1),2),d=r[0],u=r[1],a=Object.assign({},n||{},{story:o||null});return i.default.createElement(T,null,i.default.createElement(E,{visible:d,config:a,userContext:l,onClose:function(){return u(!1)}}),i.default.createElement(L,{open:d,config:a,onClick:function(){return u(!d)}}))}function T(e){var n=e.children;return t.createPortal(n,document.body)}function L(e){var t=e.open,n=e.config,o=e.onClick,l=n.bubble,d=n.position;return i.default.createElement("div",{className:r.default(x.bubble,null==l?void 0:l.className,t?x.open:null,x[d||v]),onClick:o},t?"CLOSE":"HELP")}function E(t){var n=t.visible,o=t.config,l=t.userContext;t.onClose;var d=y(e.useState(!0),2),u=d[0],a=d[1],_=o.position,c=e.useCallback((function(){return a(!1)}),[]);return i.default.createElement("div",{className:r.default(x.dialog,n?x.visible:null,x[_||v])},u?i.default.createElement(j,null):null,i.default.createElement(R,{config:o,userContext:l,onLoaded:c}))}function R(t){var n=t.config,o=t.userContext,l=t.onLoaded,r=y(e.useState({}),2),d=r[0],u=r[1],a=e.useRef(),_=e.useRef(!1),c="".concat(w,"/widget");return e.useEffect((function(){function e(e){if(e.origin===w&&"object"===b(e.data)&&e.data.widget){var t=e.data.widget;t.hello&&(_.current=!0,l&&l(),C(a,{config:n,context:p({path:window.location.href},o)})),t.height&&t.height>150&&u({height:t.height})}}return window.addEventListener("message",e,!1),function(){return window.removeEventListener("message",e,!1)}}),[n,l]),e.useEffect((function(){return e={onChange:function(e){return C(a,{context:{path:e}})}}.onChange,t=document.location.href,(n=new MutationObserver((function(n){n.forEach((function(n){t!==document.location.href&&(t=document.location.href,e&&e(document.location.href))}))}))).observe(document.querySelector("body"),{childList:!0,subtree:!0}),function(){return n.disconnect()};var e,t,n}),[]),e.useEffect((function(){_.current&&C(a,{context:o})}),[o]),i.default.createElement("iframe",{className:x.frame,src:c,ref:a,style:d,title:"Widget",allowFullScreen:!1,allowpaymentrequest:"true",loading:"eager",referrerPolicy:"origin-when-cross-origin",onLoad:l})}function j(){return i.default.createElement("div",{className:x.spinner},i.default.createElement(f,{className:x.spinner__icon,size:50}))}function C(e,t){var n;null!==(n=e.current)&&void 0!==n&&n.contentWindow?e.current.contentWindow.postMessage({widget:t},w):console.warn("No content window")}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('.Widget-module_bubble__3_xTo,\n.Widget-module_dialog__2Z0Jl {\n\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",\n\t\t"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",\n\t\t"Helvetica Neue", sans-serif;\n}\n\n.Widget-module_bubble__3_xTo {\n\tposition: fixed;\n\twidth: 70px;\n\theight: 70px;\n\tborder-radius: 35px;\n\tz-index: 10000;\n\tcursor: pointer;\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tuser-select: none;\n\topacity: 0.9;\n\ttransform: rotate(0deg);\n\ttransition: opacity 0.1s, transform 0.5s;\n\n\tbackground-color: white;\n\tcolor: black;\n}\n\n.Widget-module_bubble__3_xTo:hover {\n\topacity: 1;\n}\n\n.Widget-module_bubble__3_xTo.Widget-module_open__2Vcee {\n\ttransform: rotate(720deg);\n}\n\n.Widget-module_bubble__3_xTo.Widget-module_topRight__2Bl2v,\n.Widget-module_bubble__3_xTo.Widget-module_topLeft__3maJ_ {\n\ttop: 20px;\n}\n\n.Widget-module_bubble__3_xTo.Widget-module_bottomRight__2XhL5,\n.Widget-module_bubble__3_xTo.Widget-module_bottomLeft__cdvON {\n\tbottom: 20px;\n}\n\n.Widget-module_bubble__3_xTo.Widget-module_topRight__2Bl2v,\n.Widget-module_bubble__3_xTo.Widget-module_bottomRight__2XhL5 {\n\tright: 20px;\n}\n\n.Widget-module_bubble__3_xTo.Widget-module_topLeft__3maJ_,\n.Widget-module_bubble__3_xTo.Widget-module_bottomLeft__cdvON {\n\tleft: 20px;\n}\n\n.Widget-module_dialog__2Z0Jl {\n\tposition: fixed;\n\tborder-radius: 10px;\n\tz-index: 10000;\n\tfont-size: 16px;\n\toverflow: hidden;\n\tdisplay: none;\n\n\tbackground-color: white;\n\tcolor: #000;\n}\n\n.Widget-module_dialog__2Z0Jl.Widget-module_topRight__2Bl2v,\n.Widget-module_dialog__2Z0Jl.Widget-module_bottomRight__2XhL5 {\n\tright: 20px;\n}\n\n.Widget-module_dialog__2Z0Jl.Widget-module_topLeft__3maJ_,\n.Widget-module_dialog__2Z0Jl.Widget-module_bottomLeft__cdvON {\n\tleft: 20px;\n}\n\n.Widget-module_dialog__2Z0Jl.Widget-module_bottomRight__2XhL5,\n.Widget-module_dialog__2Z0Jl.Widget-module_bottomLeft__cdvON {\n\tbottom: 100px;\n}\n\n.Widget-module_dialog__2Z0Jl.Widget-module_topRight__2Bl2v,\n.Widget-module_dialog__2Z0Jl.Widget-module_topLeft__3maJ_ {\n\ttop: 100px;\n}\n\n.Widget-module_dialog__2Z0Jl.Widget-module_visible__aogw6 {\n\tdisplay: block;\n}\n\n.Widget-module_frame__3KhlT {\n\theight: 100%;\n\twidth: 100%;\n\tborder: none;\n\tdisplay: block;\n\ttransition: height 0.2s linear;\n}\n\n.Widget-module_spinner__3Hf-F {\n\twidth: 100%;\n\theight: 100%;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.Widget-module_spinner__icon__2ePMO {\n\tanimation: Widget-module_spin__7WHQQ linear infinite 4s;\n}\n\n@keyframes Widget-module_spin__7WHQQ {\n\tfrom {\n\t\ttransform: rotate(0);\n\t}\n\tto {\n\t\ttransform: rotate(360deg);\n\t}\n}\n\n@media screen and (max-width: 400px) {\n\t.Widget-module_bubble__3_xTo {\n\t\twidth: 50px;\n\t\theight: 50px;\n\t\tfont-size: 13px;\n\t}\n\n\t.Widget-module_dialog__2Z0Jl {\n\t\tmax-height: calc(100% - 80px);\n\t}\n\n\t.Widget-module_bubble__3_xTo.Widget-module_topRight__2Bl2v,\n\t.Widget-module_bubble__3_xTo.Widget-module_topLeft__3maJ_ {\n\t\ttop: 10px;\n\t}\n\n\t.Widget-module_bubble__3_xTo.Widget-module_bottomRight__2XhL5,\n\t.Widget-module_bubble__3_xTo.Widget-module_bottomLeft__cdvON {\n\t\tbottom: 10px;\n\t}\n\n\t.Widget-module_bubble__3_xTo.Widget-module_topRight__2Bl2v,\n\t.Widget-module_bubble__3_xTo.Widget-module_bottomRight__2XhL5 {\n\t\tright: 10px;\n\t}\n\n\t.Widget-module_bubble__3_xTo.Widget-module_topLeft__3maJ_,\n\t.Widget-module_bubble__3_xTo.Widget-module_bottomLeft__cdvON {\n\t\tleft: 10px;\n\t}\n\n\t.Widget-module_dialog__2Z0Jl.Widget-module_topRight__2Bl2v,\n\t.Widget-module_dialog__2Z0Jl.Widget-module_bottomRight__2XhL5 {\n\t\tright: 10px;\n\t}\n\n\t.Widget-module_dialog__2Z0Jl.Widget-module_topLeft__3maJ_,\n\t.Widget-module_dialog__2Z0Jl.Widget-module_bottomLeft__cdvON {\n\t\tleft: 10px;\n\t}\n\n\t.Widget-module_dialog__2Z0Jl.Widget-module_bottomRight__2XhL5,\n\t.Widget-module_dialog__2Z0Jl.Widget-module_bottomLeft__cdvON {\n\t\tbottom: 65px;\n\t}\n\n\t.Widget-module_dialog__2Z0Jl.Widget-module_topRight__2Bl2v,\n\t.Widget-module_dialog__2Z0Jl.Widget-module_topLeft__3maJ_ {\n\t\ttop: 65px;\n\t}\n}\n\n@media screen and (max-width: 360px) {\n\t.Widget-module_widget__35l4R {\n\t\twidth: calc(100% - 20px);\n\t}\n}\n'),function(){if(["localhost","amazinganchors.com"].includes(window.location.hostname)){var t=window.WIDGET||{},n=t.config,o=t.storyConfig;if(n&&o){var i=document.createElement("div");document.body.appendChild(i),l.default.render(e.createElement(O,{config:n,storyConfig:o}),i)}}}()})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@faintlines/widget-standalone", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "", | ||
@@ -12,3 +12,3 @@ "license": "UNLICENSED", | ||
"dependencies": { | ||
"@faintlines/widget": "^2.2.3" | ||
"@faintlines/widget": "^2.2.4" | ||
}, | ||
@@ -26,3 +26,3 @@ "babel": { | ||
}, | ||
"gitHead": "e47b5c318c565bf0172a61d6764410a89dee4b83" | ||
"gitHead": "a00a92626ff6dd6c7128841d057c94316de48914" | ||
} |
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
37559
50
0
2
Updated@faintlines/widget@^2.2.4