@lavamoat/lavadome-react
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -1,2 +0,2 @@ | ||
(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{LavaDome:()=>me,toLavaDomeToken:()=>de});const o=require("react");var n=e.n(o);const{Object:a,Array:r,Function:s,Math:l,parseInt:i,WeakMap:u,Error:p,JSON:c,navigation:d}=globalThis,{defineProperties:m,assign:f,getOwnPropertyDescriptor:v,entries:g,create:h,hasOwn:y}=a,{from:b}=r,{random:w}=l,{stringify:T}=c,O=(e,t,o)=>e&&s.prototype.call.bind(v(e,t)[o]),S=O(globalThis?.Node?.prototype,"ownerDocument","get"),D=O(globalThis?.EventTarget?.prototype,"addEventListener","value"),M=O(globalThis?.DocumentFragment?.prototype,"replaceChildren","value"),E=O(globalThis?.Element?.prototype,"attachShadow","value"),x=O(globalThis?.Document?.prototype,"createElement","value"),_=O(globalThis?.Node?.prototype,"appendChild","value"),k=O(globalThis?.Node?.prototype,"textContent","set"),I=O(globalThis?.Element?.prototype,"setAttribute","value"),L=O(globalThis?.String?.prototype,"toUpperCase","value"),N=O(globalThis?.String?.prototype,"includes","value"),j=O(globalThis?.Array?.prototype,"map","value"),P=O(globalThis?.Array?.prototype,"join","value"),C=O(globalThis?.Array?.prototype,"keys","value"),A=O(globalThis?.Array?.prototype,"at","value"),$=O(globalThis?.WeakMap?.prototype,"get","value"),F=O(globalThis?.WeakMap?.prototype,"set","value"),z=O(globalThis?.Number?.prototype,"toFixed","value"),R=O(globalThis?.NavigateEvent?.prototype,"destination","get"),U=O(globalThis?.NavigationDestination?.prototype,"url","get"),W=O(globalThis?.Event?.prototype,"preventDefault","value"),q=O(globalThis?.Event?.prototype,"stopPropagation","value"),G={isInnerInstance:Symbol("isInnerInstance"),unsafeOpenModeShadow:"unsafeOpenModeShadow"},J=e=>function(t,o,n){const a=e[t];return y(e,t)?typeof a!==o?n:a:n},Y="abcdefghijklmnopqrstuvwxyz",B="0123456789",H="!@#$%^&*()?.;:\"'[]{}+=-_/",K={letters:Y,digits:B,symbols:H,alphanumeric:Y+B,all:Y+L(Y)+B+H},{letters:Q,alphanumeric:V,all:X}=K,Z=(e,t)=>e[i(z(w()*t))],ee=e=>Z(Q,26)+P(j(b(C(r(e))),(()=>Z(V,36))),"");function te(e,t,o=""){return e=P(j(g(e),(([e,t])=>`${e}: ${t} !important`)),"; "),function(){const n=x(document,t());return I(n,"style",e),k(n,o),n}}const oe=e=>()=>e(),ne=oe(te({"font-family":ee(20),"-webkit-user-modify":"unset","-webkit-user-select":"none","user-select":"none"},(()=>ee(7)))),ae=oe(te({top:"-10px",right:"-10px",position:"fixed","font-size":"1px"},(()=>"span"),X)),re=oe(te({display:"none"},(()=>"iframe"))),se=new u;function le(e,t){t=function(e={}){const{unsafeOpenModeShadow:t,isInnerInstance:o}=G,n=J(f(h(null),e)),a=h(null);return a.isInnerInstance=n(o,"boolean",!1),a.unsafeOpenModeShadow=n(t,"boolean",!1),a}(t),m(this,{text:{value:function(e){if("string"!=typeof e)throw new p(`LavaDomeCore: first argument must be a string, instead got ${T(e)}`);if(void 0===A(b(e),1))return k(a,e);_(o,n),j(b(e),(e=>{const o=x(document,"span");t[G.isInnerInstance]=!0,new le(o,t).text(e),_(a,o)})),_(a,ae())}}});const o=function(e,t){const{unsafeOpenModeShadow:o,isInnerInstance:n}=t;let a=$(se,e);if(!a){const t={mode:"closed"};o&&(t.mode="open",n||console.warn("LavaDome:",`Initiated with "${G.unsafeOpenModeShadow}" set to true.`,"This leaves LavaDome fully vulnerable, ONLY USE FOR TESTING!")),a=E(e,t),F(se,e,a)}return a}(e,t);M(o);const n=re();D(n,"load",(()=>{if(S(n)!==document)throw M(o),new p("LavaDomeCore: The document to which LavaDome was originally introduced must be the same as the one this instance is inserted to")}));const a=ne();_(o,a)}d.addEventListener("navigate",(e=>{const t=U(R(e));if(N(t,":~:"))throw W(e),q(e),new p("LavaDomeCore: in-app redirection to text-fragments links is blocked to ensure security")}));const{all:ie}=K,ue=new u,pe=new u,ce=h(null),de=e=>{if("string"!=typeof e)throw new Error(`LavaDomeReact: first argument must be a string, instead got ${T(e)}`);if(!y(ce,e)){const t=h(null);ce[e]=t,F(ue,t,e)}return ce[e]},me=({text:e,unsafeOpenModeShadow:t})=>{const a=e,r=(0,o.useRef)(null);return n().createElement("span",{ref:r,__source:{fileName:"/Users/weizman/Documents/lavamoat/lavadome/packages/react/src/lavadome.jsx",lineNumber:57,columnNumber:9},__self:void 0},n().createElement(fe,{host:r,token:a,unsafeOpenModeShadow:t,__source:{fileName:"/Users/weizman/Documents/lavamoat/lavadome/packages/react/src/lavadome.jsx",lineNumber:58,columnNumber:13},__self:void 0}))};function fe({host:e,token:t,unsafeOpenModeShadow:a}){const r=function(e){const t=$(ue,e);if(!y(ce,t))throw new Error("LavaDomeReact: first argument must be a valid LavaDome token (replace \"text={'secret'}\" with \"text={toLavaDomeToken('secret')}\")");return t}(t),s=function(e){let t=$(pe,e);return t||(t=h(null),F(pe,e,t)),t}(t);return(0,o.useEffect)((()=>{new le(e.current,{unsafeOpenModeShadow:a}).text(r)}),[s]),n().createElement(n().Fragment,null)}var ve=exports;for(var ge in t)ve[ge]=t[ge];t.__esModule&&Object.defineProperty(ve,"__esModule",{value:!0})})(); | ||
(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{LavaDome:()=>me,toLavaDomeToken:()=>de});const o=require("react");var n=e.n(o);const{Object:a,Array:r,Function:s,Math:l,parseInt:i,WeakMap:u,Error:p,JSON:c,navigation:d}=globalThis,{defineProperties:m,assign:f,getOwnPropertyDescriptor:v,entries:g,create:h,hasOwn:y}=a,{from:b}=r,{random:w}=l,{stringify:T}=c,O=(e,t,o)=>e&&s.prototype.call.bind(v(e,t)[o]),S=O(globalThis?.Node?.prototype,"ownerDocument","get"),D=O(globalThis?.EventTarget?.prototype,"addEventListener","value"),M=O(globalThis?.DocumentFragment?.prototype,"replaceChildren","value"),E=O(globalThis?.Element?.prototype,"attachShadow","value"),x=O(globalThis?.Document?.prototype,"createElement","value"),_=O(globalThis?.Node?.prototype,"appendChild","value"),k=O(globalThis?.Node?.prototype,"textContent","set"),I=O(globalThis?.Element?.prototype,"setAttribute","value"),L=O(globalThis?.String?.prototype,"toUpperCase","value"),N=O(globalThis?.String?.prototype,"includes","value"),j=O(globalThis?.Array?.prototype,"map","value"),P=O(globalThis?.Array?.prototype,"join","value"),C=O(globalThis?.Array?.prototype,"keys","value"),A=O(globalThis?.Array?.prototype,"at","value"),$=O(globalThis?.WeakMap?.prototype,"get","value"),F=O(globalThis?.WeakMap?.prototype,"set","value"),z=O(globalThis?.Number?.prototype,"toFixed","value"),R=O(globalThis?.NavigateEvent?.prototype,"destination","get"),U=O(globalThis?.NavigationDestination?.prototype,"url","get"),W=O(globalThis?.Event?.prototype,"preventDefault","value"),q=O(globalThis?.Event?.prototype,"stopPropagation","value"),G={isInnerInstance:Symbol("isInnerInstance"),unsafeOpenModeShadow:"unsafeOpenModeShadow"},J=e=>function(t,o,n){const a=e[t];return y(e,t)?typeof a!==o?n:a:n},Y="abcdefghijklmnopqrstuvwxyz",B="0123456789",H="!@#$%^&*()?.;:\"'[]{}+=-_/",K={letters:Y,digits:B,symbols:H,alphanumeric:Y+B,all:Y+L(Y)+B+H},{letters:Q,alphanumeric:V,all:X}=K,Z=(e,t)=>e[i(z(w()*t))],ee=e=>Z(Q,26)+P(j(b(C(r(e))),(()=>Z(V,36))),"");function te(e,t,o=""){return e=P(j(g(e),(([e,t])=>`${e}: ${t} !important`)),"; "),function(){const n=x(document,t());return I(n,"style",e),k(n,o),n}}const oe=e=>()=>e(),ne=oe(te({"font-family":ee(20),"-webkit-user-modify":"unset","-webkit-user-select":"none","user-select":"none"},(()=>ee(7)))),ae=oe(te({top:"-10px",right:"-10px",position:"fixed","font-size":"1px"},(()=>"span"),X)),re=oe(te({display:"none"},(()=>"iframe"))),se=new u;function le(e,t){t=function(e={}){const{unsafeOpenModeShadow:t,isInnerInstance:o}=G,n=J(f(h(null),e)),a=h(null);return a.isInnerInstance=n(o,"boolean",!1),a.unsafeOpenModeShadow=n(t,"boolean",!1),a}(t),m(this,{text:{value:function(e){if("string"!=typeof e)throw new p(`LavaDomeCore: first argument must be a string, instead got ${T(e)}`);if(void 0===A(b(e),1))return k(a,e);_(o,n),j(b(e),(e=>{const o=x(document,"span");t[G.isInnerInstance]=!0,new le(o,t).text(e),_(a,o)})),_(a,ae())}}});const o=function(e,t){const{unsafeOpenModeShadow:o,isInnerInstance:n}=t;let a=$(se,e);if(!a){const t={mode:"closed"};o&&(t.mode="open",n||console.warn("LavaDome:",`Initiated with "${G.unsafeOpenModeShadow}" set to true.`,"This leaves LavaDome fully vulnerable, ONLY USE FOR TESTING!")),a=E(e,t),F(se,e,a)}return a}(e,t);M(o);const n=re();D(n,"load",(()=>{if(S(n)!==document)throw M(o),new p("LavaDomeCore: The document to which LavaDome was originally introduced must be the same as the one this instance is inserted to")}));const a=ne();_(o,a)}d?.addEventListener("navigate",(e=>{const t=U(R(e));if(N(t,":~:"))throw W(e),q(e),new p("LavaDomeCore: in-app redirection to text-fragments links is blocked to ensure security")}));const{all:ie}=K,ue=new u,pe=new u,ce=h(null),de=e=>{if("string"!=typeof e)throw new Error(`LavaDomeReact: first argument must be a string, instead got ${T(e)}`);if(!y(ce,e)){const t=h(null);ce[e]=t,F(ue,t,e)}return ce[e]},me=({text:e,unsafeOpenModeShadow:t})=>{const a=e,r=(0,o.useRef)(null);return n().createElement("span",{ref:r,__source:{fileName:"/Users/weizman/Documents/lavamoat/lavadome/packages/react/src/lavadome.jsx",lineNumber:57,columnNumber:9},__self:void 0},n().createElement(fe,{host:r,token:a,unsafeOpenModeShadow:t,__source:{fileName:"/Users/weizman/Documents/lavamoat/lavadome/packages/react/src/lavadome.jsx",lineNumber:58,columnNumber:13},__self:void 0}))};function fe({host:e,token:t,unsafeOpenModeShadow:a}){const r=function(e){const t=$(ue,e);if(!y(ce,t))throw new Error("LavaDomeReact: first argument must be a valid LavaDome token (replace \"text={'secret'}\" with \"text={toLavaDomeToken('secret')}\")");return t}(t),s=function(e){let t=$(pe,e);return t||(t=h(null),F(pe,e,t)),t}(t);return(0,o.useEffect)((()=>{new le(e.current,{unsafeOpenModeShadow:a}).text(r)}),[s]),n().createElement(n().Fragment,null)}var ve=exports;for(var ge in t)ve[ge]=t[ge];t.__esModule&&Object.defineProperty(ve,"__esModule",{value:!0})})(); | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "@lavamoat/lavadome-react", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"description": "", | ||
@@ -37,3 +37,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@lavamoat/lavadome-core": "^0.0.19", | ||
"@lavamoat/lavadome-core": "^0.0.20", | ||
"@lavamoat/preinstall-always-fail": "^2.0.0" | ||
@@ -40,0 +40,0 @@ }, |
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
17086
0
+ Added@lavamoat/lavadome-core@0.0.20(transitive)
- Removed@lavamoat/lavadome-core@0.0.19(transitive)