Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rax-embed

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rax-embed - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

es/miniapp-native/ali-miniapp/genFixedUrl.sjs

7

CHANGELOG.md
# Changelog
## 1.2.0
- Support exports field
- Support more miniapp platforms
- Reduce npm files
- Adjust miniapp native code
## 1.1.3

@@ -4,0 +11,0 @@

2

dist/index-es6.js

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

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=2)}([function(e,t){e.exports=require("universal-env")},function(e,t){e.exports=require("rax")},function(e,t,r){e.exports=r(3)},function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(0);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}const a={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:i.isWeex,useIframeInWeb:!1},urlParam:{},src:""};t.default=e=>{e=Object.assign(Object.assign({},a),e);let{useIframeInWeb:t}=e,r=function(e){let t=e.src;const r=t.indexOf("?")>=0?"&":"?";if("string"==typeof e.urlParam)t+=r+e.urlParam;else{let n=[],i=Object.assign({},e.urlParam,e.defaultUrlParam);for(let e in i)n.push(e+"="+i[e]);t+=r+n.join("&")}return t}(e);return i.isMiniApp||i.isWeChatMiniProgram?Object(n.createElement)("web-view",{id:e.id||"",src:r,onMessage:e.onMessage}):t&&i.isWeb?Object(n.createElement)("iframe",s({},e,{type:i.isWeex?"weex":"",itemId:1,src:r,style:Object.assign(Object.assign({borderWidth:0},e.style),{visibility:"visible"})})):i.isWeex&&function(e){return/(_wx_tpl=[^\s&]|wh_weex=true)/.test(e)}(r)||i.isWeb?Object(n.createElement)("embed",s({},e,{type:i.isWeex?"weex":"",itemId:1,src:r,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})})):Object(n.createElement)("web",s({},e,{src:r,style:e.style}))}}]);
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=7)}([function(e,t){e.exports=require("rax")},function(e,t){e.exports=require("universal-env")},function(e,t,r){"use strict";function n(e){let t=e.src;const r=t.indexOf("?")>=0?"&":"?";if("string"==typeof e.urlParam)t+=r+e.urlParam;else{const n=[],i=Object.assign({},e.urlParam,e.defaultUrlParam);for(let e in i)n.push(e+"="+i[e]);t+=r+n.join("&")}return t}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(0),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}const s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:!1,useIframeInWeb:!1},urlParam:{},src:""};t.a=e=>{e=Object.assign(Object.assign({},s),e);let{useIframeInWeb:t}=e,r=Object(i.a)(e);return t?Object(n.createElement)("iframe",a({},e,{type:"",itemId:1,src:r,style:Object.assign(Object.assign({borderWidth:0},e.style),{visibility:"visible"})})):Object(n.createElement)("embed",a({},e,{type:"",itemId:1,src:r,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})}))}},function(e,t){},function(e,t,r){"use strict";var n=r(0),i=r(2);const a={urlParam:{},src:""};t.a=e=>{e=Object.assign(Object.assign({},a),e);let t=Object(i.a)(e);return Object(n.createElement)("web-view",{id:e.id||"",src:t,onMessage:e.onMessage})}},function(e,t,r){"use strict";var n=r(0),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}const s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:!0,useIframeInWeb:!1},urlParam:{},src:""};t.a=e=>{e=Object.assign(Object.assign({},s),e);let t=Object(i.a)(e);return function(e){return/(_wx_tpl=[^\s&]|wh_weex=true)/.test(e)}(t)?Object(n.createElement)("embed",a({},e,{type:"weex",itemId:1,src:t,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})})):Object(n.createElement)("web",a({},e,{src:t,style:e.style}))}},function(e,t,r){e.exports=r(8)},function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(3),a=r(5),s=r(6),u=r(4);for(var c in u)["default"].indexOf(c)<0&&function(e){r.d(t,e,(function(){return u[e]}))}(c);let o=null;o=n.isWeb?i.a:n.isMiniApp||n.isWeChatMiniProgram||n.isByteDanceMicroApp||n.isBaiduSmartProgram||n.isKuaiShouMiniProgram?a.a:n.isWeex?s.a:i.a,t.default=o}]);

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

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=2)}([function(e,t){e.exports=require("universal-env")},function(e,t){e.exports=require("rax")},function(e,t,r){e.exports=r(3)},function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(0);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var a={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:i.isWeex,useIframeInWeb:!1},urlParam:{},src:""};t.default=function(e){var t=(e=Object.assign(Object.assign({},a),e)).useIframeInWeb,r=function(e){var t=e.src,r=t.indexOf("?")>=0?"&":"?";if("string"==typeof e.urlParam)t+=r+e.urlParam;else{var n=[],i=Object.assign({},e.urlParam,e.defaultUrlParam);for(var s in i)n.push(s+"="+i[s]);t+=r+n.join("&")}return t}(e);return i.isMiniApp||i.isWeChatMiniProgram?Object(n.createElement)("web-view",{id:e.id||"",src:r,onMessage:e.onMessage}):t&&i.isWeb?Object(n.createElement)("iframe",s({},e,{type:i.isWeex?"weex":"",itemId:1,src:r,style:Object.assign(Object.assign({borderWidth:0},e.style),{visibility:"visible"})})):i.isWeex&&function(e){return/(_wx_tpl=[^\s&]|wh_weex=true)/.test(e)}(r)||i.isWeb?Object(n.createElement)("embed",s({},e,{type:i.isWeex?"weex":"",itemId:1,src:r,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})})):Object(n.createElement)("web",s({},e,{src:r,style:e.style}))}}]);
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=7)}([function(e,t){e.exports=require("rax")},function(e,t){e.exports=require("universal-env")},function(e,t,r){"use strict";function n(e){var t=e.src,r=t.indexOf("?")>=0?"&":"?";if("string"==typeof e.urlParam)t+=r+e.urlParam;else{var n=[],i=Object.assign({},e.urlParam,e.defaultUrlParam);for(var a in i)n.push(a+"="+i[a]);t+=r+n.join("&")}return t}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(0),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:!1,useIframeInWeb:!1},urlParam:{},src:""};t.a=function(e){var t=(e=Object.assign(Object.assign({},s),e)).useIframeInWeb,r=Object(i.a)(e);return t?Object(n.createElement)("iframe",a({},e,{type:"",itemId:1,src:r,style:Object.assign(Object.assign({borderWidth:0},e.style),{visibility:"visible"})})):Object(n.createElement)("embed",a({},e,{type:"",itemId:1,src:r,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})}))}},function(e,t){},function(e,t,r){"use strict";var n=r(0),i=r(2),a={urlParam:{},src:""};t.a=function(e){e=Object.assign(Object.assign({},a),e);var t=Object(i.a)(e);return Object(n.createElement)("web-view",{id:e.id||"",src:t,onMessage:e.onMessage})}},function(e,t,r){"use strict";var n=r(0),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:!0,useIframeInWeb:!1},urlParam:{},src:""};t.a=function(e){e=Object.assign(Object.assign({},s),e);var t=Object(i.a)(e);return function(e){return/(_wx_tpl=[^\s&]|wh_weex=true)/.test(e)}(t)?Object(n.createElement)("embed",a({},e,{type:"weex",itemId:1,src:t,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})})):Object(n.createElement)("web",a({},e,{src:t,style:e.style}))}},function(e,t,r){e.exports=r(8)},function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(3),a=r(5),s=r(6),u=r(4);for(var c in u)["default"].indexOf(c)<0&&function(e){r.d(t,e,(function(){return u[e]}))}(c);var o=null;o=n.isWeb?i.a:n.isMiniApp||n.isWeChatMiniProgram||n.isByteDanceMicroApp||n.isBaiduSmartProgram||n.isKuaiShouMiniProgram?a.a:n.isWeex?s.a:i.a,t.default=o}]);

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

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=2)}([function(e,t){e.exports=require("universal-env")},function(e,t){e.exports=require("rax")},function(e,t,r){e.exports=r(3)},function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(0);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var a={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:i.isWeex,useIframeInWeb:!1},urlParam:{},src:""};t.default=function(e){var t=(e=Object.assign(Object.assign({},a),e)).useIframeInWeb,r=function(e){var t=e.src,r=t.indexOf("?")>=0?"&":"?";if("string"==typeof e.urlParam)t+=r+e.urlParam;else{var n=[],i=Object.assign({},e.urlParam,e.defaultUrlParam);for(var s in i)n.push(s+"="+i[s]);t+=r+n.join("&")}return t}(e);return i.isMiniApp||i.isWeChatMiniProgram?Object(n.createElement)("web-view",{id:e.id||"",src:r,onMessage:e.onMessage}):t&&i.isWeb?Object(n.createElement)("iframe",s({},e,{type:i.isWeex?"weex":"",itemId:1,src:r,style:Object.assign(Object.assign({borderWidth:0},e.style),{visibility:"visible"})})):i.isWeex&&function(e){return/(_wx_tpl=[^\s&]|wh_weex=true)/.test(e)}(r)||i.isWeb?Object(n.createElement)("embed",s({},e,{type:i.isWeex?"weex":"",itemId:1,src:r,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})})):Object(n.createElement)("web",s({},e,{src:r,style:e.style}))}}]);
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=7)}([function(e,t){e.exports=require("rax")},function(e,t){e.exports=require("universal-env")},function(e,t,r){"use strict";function n(e){var t=e.src,r=t.indexOf("?")>=0?"&":"?";if("string"==typeof e.urlParam)t+=r+e.urlParam;else{var n=[],i=Object.assign({},e.urlParam,e.defaultUrlParam);for(var a in i)n.push(a+"="+i[a]);t+=r+n.join("&")}return t}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(0),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:!1,useIframeInWeb:!1},urlParam:{},src:""};t.a=function(e){var t=(e=Object.assign(Object.assign({},s),e)).useIframeInWeb,r=Object(i.a)(e);return t?Object(n.createElement)("iframe",a({},e,{type:"",itemId:1,src:r,style:Object.assign(Object.assign({borderWidth:0},e.style),{visibility:"visible"})})):Object(n.createElement)("embed",a({},e,{type:"",itemId:1,src:r,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})}))}},function(e,t){},function(e,t,r){"use strict";var n=r(0),i=r(2),a={urlParam:{},src:""};t.a=function(e){e=Object.assign(Object.assign({},a),e);var t=Object(i.a)(e);return Object(n.createElement)("web-view",{id:e.id||"",src:t,onMessage:e.onMessage})}},function(e,t,r){"use strict";var n=r(0),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:!0,useIframeInWeb:!1},urlParam:{},src:""};t.a=function(e){e=Object.assign(Object.assign({},s),e);var t=Object(i.a)(e);return function(e){return/(_wx_tpl=[^\s&]|wh_weex=true)/.test(e)}(t)?Object(n.createElement)("embed",a({},e,{type:"weex",itemId:1,src:t,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})})):Object(n.createElement)("web",a({},e,{src:t,style:e.style}))}},function(e,t,r){e.exports=r(8)},function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(3),a=r(5),s=r(6),u=r(4);for(var c in u)["default"].indexOf(c)<0&&function(e){r.d(t,e,(function(){return u[e]}))}(c);var o=null;o=n.isWeb?i.a:n.isMiniApp||n.isWeChatMiniProgram||n.isByteDanceMicroApp||n.isBaiduSmartProgram||n.isKuaiShouMiniProgram?a.a:n.isWeex?s.a:i.a,t.default=o}]);

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.raxEmbed=t():e.raxEmbed=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=2)}([function(e,t){e.exports=require("universal-env")},function(e,t){e.exports=require("rax")},function(e,t,r){e.exports=r(3)},function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(0);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:i.isWeex,useIframeInWeb:!1},urlParam:{},src:""};t.default=function(e){var t=(e=Object.assign(Object.assign({},s),e)).useIframeInWeb,r=function(e){var t=e.src,r=t.indexOf("?")>=0?"&":"?";if("string"==typeof e.urlParam)t+=r+e.urlParam;else{var n=[],i=Object.assign({},e.urlParam,e.defaultUrlParam);for(var o in i)n.push(o+"="+i[o]);t+=r+n.join("&")}return t}(e);return i.isMiniApp||i.isWeChatMiniProgram?Object(n.createElement)("web-view",{id:e.id||"",src:r,onMessage:e.onMessage}):t&&i.isWeb?Object(n.createElement)("iframe",o({},e,{type:i.isWeex?"weex":"",itemId:1,src:r,style:Object.assign(Object.assign({borderWidth:0},e.style),{visibility:"visible"})})):i.isWeex&&function(e){return/(_wx_tpl=[^\s&]|wh_weex=true)/.test(e)}(r)||i.isWeb?Object(n.createElement)("embed",o({},e,{type:i.isWeex?"weex":"",itemId:1,src:r,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})})):Object(n.createElement)("web",o({},e,{src:r,style:e.style}))}}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.raxEmbed=t():e.raxEmbed=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=7)}([function(e,t){e.exports=require("rax")},function(e,t){e.exports=require("universal-env")},function(e,t,r){"use strict";function n(e){var t=e.src,r=t.indexOf("?")>=0?"&":"?";if("string"==typeof e.urlParam)t+=r+e.urlParam;else{var n=[],i=Object.assign({},e.urlParam,e.defaultUrlParam);for(var a in i)n.push(a+"="+i[a]);t+=r+n.join("&")}return t}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=r(0),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:!1,useIframeInWeb:!1},urlParam:{},src:""};t.a=function(e){var t=(e=Object.assign(Object.assign({},s),e)).useIframeInWeb,r=Object(i.a)(e);return t?Object(n.createElement)("iframe",a({},e,{type:"",itemId:1,src:r,style:Object.assign(Object.assign({borderWidth:0},e.style),{visibility:"visible"})})):Object(n.createElement)("embed",a({},e,{type:"",itemId:1,src:r,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})}))}},function(e,t){},function(e,t,r){"use strict";var n=r(0),i=r(2),a={urlParam:{},src:""};t.a=function(e){e=Object.assign(Object.assign({},a),e);var t=Object(i.a)(e);return Object(n.createElement)("web-view",{id:e.id||"",src:t,onMessage:e.onMessage})}},function(e,t,r){"use strict";var n=r(0),i=r(2);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s={defaultUrlParam:{_page_inside_embed_:"true",_page_home_isweex_:!0,useIframeInWeb:!1},urlParam:{},src:""};t.a=function(e){e=Object.assign(Object.assign({},s),e);var t=Object(i.a)(e);return function(e){return/(_wx_tpl=[^\s&]|wh_weex=true)/.test(e)}(t)?Object(n.createElement)("embed",a({},e,{type:"weex",itemId:1,src:t,style:Object.assign(Object.assign({},e.style),{visibility:"visible"})})):Object(n.createElement)("web",a({},e,{src:t,style:e.style}))}},function(e,t,r){e.exports=r(8)},function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(3),a=r(5),s=r(6),o=r(4);for(var u in o)["default"].indexOf(u)<0&&function(e){r.d(t,e,(function(){return o[e]}))}(u);var c=null;c=n.isWeb?i.a:n.isMiniApp||n.isWeChatMiniProgram||n.isByteDanceMicroApp||n.isBaiduSmartProgram||n.isKuaiShouMiniProgram?a.a:n.isWeex?s.a:i.a,t.default=c}])}));

@@ -1,4 +0,3 @@

/// <reference types="rax" />
import { Props } from './types';
declare const Embed: (props: Props) => JSX.Element;
declare let Embed: any;
export default Embed;
export * from './types';

@@ -1,87 +0,18 @@

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { isWeb, isWeex, isMiniApp, isWeChatMiniProgram, isByteDanceMicroApp, isBaiduSmartProgram, isKuaiShouMiniProgram } from 'universal-env';
import EmbedWeb from './web';
import EmbedMiniApp from './miniapp';
import EmbedWeex from './weex';
var Embed = null;
import { createElement } from 'rax';
import { isWeex, isWeb, isMiniApp, isWeChatMiniProgram } from 'universal-env';
function isWeexUrl(url) {
return /(_wx_tpl=[^\s&]|wh_weex=true)/.test(url);
if (isWeb) {
Embed = EmbedWeb;
} else if (isMiniApp || isWeChatMiniProgram || isByteDanceMicroApp || isBaiduSmartProgram || isKuaiShouMiniProgram) {
Embed = EmbedMiniApp;
} else if (isWeex) {
Embed = EmbedWeex;
} else {
Embed = EmbedWeb;
}
function genFixedUrl(props) {
// handle android ios
var fixedUrl = props.src;
var prefix = fixedUrl.indexOf('?') >= 0 ? '&' : '?';
if (typeof props.urlParam == 'string') {
fixedUrl += prefix + props.urlParam;
} else {
var paramsStrArr = [];
var assignUrlParam = Object.assign({}, props.urlParam, props.defaultUrlParam);
for (var k in assignUrlParam) {
paramsStrArr.push(k + '=' + assignUrlParam[k]);
}
fixedUrl += prefix + paramsStrArr.join('&');
}
return fixedUrl;
}
var defaultProps = {
defaultUrlParam: {
// eslint-disable-next-line @typescript-eslint/camelcase
_page_inside_embed_: 'true',
// eslint-disable-next-line @typescript-eslint/camelcase
_page_home_isweex_: isWeex,
useIframeInWeb: false
},
urlParam: {},
src: ''
};
var Embed = function (props) {
props = _extends({}, defaultProps, props);
var _props = props,
useIframeInWeb = _props.useIframeInWeb;
var url = genFixedUrl(props);
if (isMiniApp || isWeChatMiniProgram) {
return createElement("web-view", {
id: props.id || '',
src: url,
onMessage: props.onMessage
});
}
if (useIframeInWeb && isWeb) {
return createElement("iframe", _extends({}, props, {
type: isWeex ? 'weex' : '',
itemId: 1,
src: url,
style: _extends({}, {
borderWidth: 0
}, props.style, {
visibility: 'visible'
})
}));
}
if (isWeex && isWeexUrl(url) || isWeb) {
return createElement("embed", _extends({}, props, {
type: isWeex ? 'weex' : '',
itemId: 1,
src: url,
style: _extends({}, props.style, {
visibility: 'visible'
})
}));
} else {
return createElement("web", _extends({}, props, {
src: url,
style: props.style
}));
}
};
export default Embed;
export default Embed;
export * from './types';

@@ -1,15 +0,20 @@

Component({
data: {
url: ''
},
props: {
id: '',
src: '',
urlParam: ''
},
methods: {
onMessage: function onMessage(e) {
this.props.onMessage(e);
}
}
});
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { createElement } from 'rax';
import genFixedUrl from '../utils/genFixedUrl';
var defaultProps = {
urlParam: {},
src: ''
};
var Embed = function (props) {
props = _extends({}, defaultProps, props);
var url = genFixedUrl(props);
return createElement("web-view", {
id: props.id || '',
src: url,
onMessage: props.onMessage
});
};
export default Embed;

@@ -1,4 +0,3 @@

/// <reference types="rax" />
import { Props } from './types';
declare const Embed: (props: Props) => JSX.Element;
declare let Embed: any;
export default Embed;
export * from './types';
"use strict";
exports.__esModule = true;
var _exportNames = {};
exports.default = void 0;
var _rax = require("rax");
var _universalEnv = require("universal-env");
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var _web = _interopRequireDefault(require("./web"));
function isWeexUrl(url) {
return /(_wx_tpl=[^\s&]|wh_weex=true)/.test(url);
}
var _miniapp = _interopRequireDefault(require("./miniapp"));
function genFixedUrl(props) {
// handle android ios
var fixedUrl = props.src;
var prefix = fixedUrl.indexOf('?') >= 0 ? '&' : '?';
var _weex = _interopRequireDefault(require("./weex"));
if (typeof props.urlParam == 'string') {
fixedUrl += prefix + props.urlParam;
} else {
var paramsStrArr = [];
var assignUrlParam = Object.assign({}, props.urlParam, props.defaultUrlParam);
var _types = require("./types");
for (var k in assignUrlParam) {
paramsStrArr.push(k + '=' + assignUrlParam[k]);
}
Object.keys(_types).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _types[key]) return;
exports[key] = _types[key];
});
fixedUrl += prefix + paramsStrArr.join('&');
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
return fixedUrl;
var Embed = null;
if (_universalEnv.isWeb) {
Embed = _web.default;
} else if (_universalEnv.isMiniApp || _universalEnv.isWeChatMiniProgram || _universalEnv.isByteDanceMicroApp || _universalEnv.isBaiduSmartProgram || _universalEnv.isKuaiShouMiniProgram) {
Embed = _miniapp.default;
} else if (_universalEnv.isWeex) {
Embed = _weex.default;
} else {
Embed = _web.default;
}
var defaultProps = {
defaultUrlParam: {
// eslint-disable-next-line @typescript-eslint/camelcase
_page_inside_embed_: 'true',
// eslint-disable-next-line @typescript-eslint/camelcase
_page_home_isweex_: _universalEnv.isWeex,
useIframeInWeb: false
},
urlParam: {},
src: ''
};
var Embed = function (props) {
props = _extends({}, defaultProps, props);
var _props = props,
useIframeInWeb = _props.useIframeInWeb;
var url = genFixedUrl(props);
if (_universalEnv.isMiniApp || _universalEnv.isWeChatMiniProgram) {
return (0, _rax.createElement)("web-view", {
id: props.id || '',
src: url,
onMessage: props.onMessage
});
}
if (useIframeInWeb && _universalEnv.isWeb) {
return (0, _rax.createElement)("iframe", _extends({}, props, {
type: _universalEnv.isWeex ? 'weex' : '',
itemId: 1,
src: url,
style: _extends({}, {
borderWidth: 0
}, props.style, {
visibility: 'visible'
})
}));
}
if (_universalEnv.isWeex && isWeexUrl(url) || _universalEnv.isWeb) {
return (0, _rax.createElement)("embed", _extends({}, props, {
type: _universalEnv.isWeex ? 'weex' : '',
itemId: 1,
src: url,
style: _extends({}, props.style, {
visibility: 'visible'
})
}));
} else {
return (0, _rax.createElement)("web", _extends({}, props, {
src: url,
style: props.style
}));
}
};
var _default = Embed;
exports.default = _default;
"use strict";
Component({
data: {
url: ''
},
props: {
id: '',
src: '',
urlParam: ''
},
methods: {
onMessage: function onMessage(e) {
this.props.onMessage(e);
}
}
});
exports.__esModule = true;
exports.default = void 0;
var _rax = require("rax");
var _genFixedUrl = _interopRequireDefault(require("../utils/genFixedUrl"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var defaultProps = {
urlParam: {},
src: ''
};
var Embed = function (props) {
props = _extends({}, defaultProps, props);
var url = (0, _genFixedUrl.default)(props);
return (0, _rax.createElement)("web-view", {
id: props.id || '',
src: url,
onMessage: props.onMessage
});
};
var _default = Embed;
exports.default = _default;

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

"use strict";
"use strict";
exports.__esModule = true;
{
"name": "rax-embed",
"version": "1.1.3",
"version": "1.2.0",
"description": "Embed container for Rax.",

@@ -9,7 +9,25 @@ "license": "BSD-3-Clause",

"types": "lib/index.d.ts",
"files": [
"es",
"lib",
"dist"
],
"exports": {
".": {
"web": "./es/web/index.js",
"weex": "./es/weex/index.js",
"miniapp": "./es/miniapp/index.js",
"wechat-miniprogram": "./es/miniapp/index.js",
"bytedance-microapp": "./es/miniapp/index.js",
"baidu-smartprogram": "./es/miniapp/index.js",
"kuaishou-miniprogram": "./es/miniapp/index.js",
"default": "./es/index.js"
},
"./*": "./*"
},
"miniprogram": ".",
"miniappConfig": {
"main": "lib/miniapp/index",
"main:wechat": "lib/miniapp-wechat/index",
"main:bytedance": "lib/bytedance-microapp/index"
"main": "lib/miniapp-native/ali-miniapp/index",
"main:wechat": "lib/miniapp-native/wechat-miniprogram/index",
"main:bytedance": "lib/miniapp-native/bytedance-microapp/index"
},

@@ -16,0 +34,0 @@ "scripts": {

@@ -29,3 +29,3 @@ # rax-embed

| src | `string` | '' | false | 嵌入的页面地址 | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /> <img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /><img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /> <img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"> <img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px" /> |
| urlParam | `string/object` | '' | false | 传递给子页面的参数 | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /> <img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /><img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /> <img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"> <img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px" /> |
| urlParam | `string/object` | {} | false | 传递给子页面的参数 | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /> <img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /><img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg" width="25px" height="25px" /> <img alt="wechatMiniprogram" src="https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg" width="25px" height="25px"> <img alt="miniApp" src="https://gw.alicdn.com/tfs/TB1jFtVzO_1gK0jSZFqXXcpaXXa-200-200.svg" width="25px" height="25px" /> |
| _page_inside_embed_ | `boolean` | true | false | 页面是否在embed中 | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /> <img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /> |

@@ -32,0 +32,0 @@ | _page_home_isweex_ | `boolean` | | false | 子页面的宿主页面是否是 weex 渲染 | <img alt="browser" src="https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg" width="25px" height="25px" /> <img alt="weex" src="https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg" width="25px" height="25px" /> |

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