altair-static 7.3.4 → 7.3.5
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/build/dist/assets/i18n/zh-CN.json +1 -1
- package/build/dist/iframe-sandbox/assets/{index-DGxSkqdS.js → index-Bmf0paKh.js} +1 -1
- package/build/dist/iframe-sandbox/index.html +1 -1
- package/build/dist/main.js +4 -4
- package/build/dist/polyfills.js +2 -2
- package/build/dist/styles.css +1 -1
- package/package.json +4 -4
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"DELETE_TEXT": "清除",
|
|
24
24
|
"EXPORT_TEXT": "导出",
|
|
25
25
|
"SEND_BATCHED_REQUEST": "发送批量请求",
|
|
26
|
-
"REQUEST_EXTENSIONS_TEXT": "
|
|
26
|
+
"REQUEST_EXTENSIONS_TEXT": "请求扩展",
|
|
27
27
|
"REQUEST_EXTENSIONS_SUBTEXT": "Update your request extensions (in JSON format)",
|
|
28
28
|
"DOCS_GO_BACK_TEXT": "返回",
|
|
29
29
|
"DOCS_EXPORT_SDL": "导出 SDL文件",
|
|
@@ -9,4 +9,4 @@ var h=Object.defineProperty;var g=(e,r,t)=>r in e?h(e,r,{enumerable:!0,configura
|
|
|
9
9
|
${script};
|
|
10
10
|
return altair.data;
|
|
11
11
|
})(...this.__ctxE.map(e => e[1]));
|
|
12
|
-
`)}).call({__ctxE:contextEntries});return resolve(res)}catch(e){return reject(e)}});res.__toSetActiveEnvironment&&this.makeCall("updateActiveEnvironment",res.__toSetActiveEnvironment),this.makeCall("executeComplete",res)}makeCall(e,...r){return new Promise((t,n)=>{const o=v4();this.worker.onMessage(s=>{switch(s.type){case`${e}_response`:return s.payload.id!==o?void 0:t(s.payload.response);case`${e}_error`:return s.payload.id!==o?void 0:n(s.payload.error)}}),this.worker.send(e,{id:o,args:r})})}}class EvaluatorFrameWorker extends ScriptEvaluatorWorker{constructor(){super();m(this,"origin");const n=new URLSearchParams(window.location.search).get("sc");if(!n)throw new Error("Invalid source provided!");this.origin=n}onMessage(t){window.addEventListener("message",n=>{n.origin===this.origin&&t(n.data)})}send(t,n){window.parent.postMessage({type:t,payload:n},this.origin)}onError(t){window.addEventListener("error",t),window.addEventListener("unhandledrejection",n=>{n.preventDefault(),t(n.reason)})}}const injectScript=e=>new Promise((r,t)=>{const n=document.getElementsByTagName("head")[0];if(!n)return t(new Error("No head found!"));const o=document.createElement("script");o.type="text/javascript",o.src=e,o.onload=()=>r(null),o.onerror=s=>t(s),n.appendChild(o)}),injectStylesheet=e=>new Promise((r,t)=>{const n=document.getElementsByTagName("head")[0];if(!n)return t(new Error("No head found!"));const o=document.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,o.onload=()=>r(null),o.onerror=s=>t(s),n.appendChild(o)}),handlePluginSandbox=async()=>{const r=new URLSearchParams(window.location.search).get("plugin_sandbox_opts"),t=r?JSON.parse(r):void 0;if(!t)throw new Error("Invalid plugin options provided!");if(t.type!=="scripts")throw new Error("Invalid plugin option type provided!");if(document.querySelectorAll('style,link[rel="stylesheet"]').forEach(n=>n.remove()),t.styleUrls)for(const n of t.styleUrls)await injectStylesheet(n);if(t.scriptUrls)for(const n of t.scriptUrls)await injectScript(n)},searchParams=new URLSearchParams(window.location.search),sandboxType=searchParams.get("sandbox_type");switch(sandboxType){case"plugin":handlePluginSandbox();break;case"script":default:new ScriptEvaluatorWorkerEngine(new EvaluatorFrameWorker).start()}
|
|
12
|
+
`)}).call({__ctxE:contextEntries});return resolve(res)}catch(e){return reject(e)}});res.__toSetActiveEnvironment&&this.makeCall("updateActiveEnvironment",res.__toSetActiveEnvironment),this.makeCall("executeComplete",res)}makeCall(e,...r){return new Promise((t,n)=>{const o=v4();this.worker.onMessage(s=>{switch(s.type){case`${e}_response`:return s.payload.id!==o?void 0:t(s.payload.response);case`${e}_error`:return s.payload.id!==o?void 0:n(s.payload.error)}}),this.worker.send(e,{id:o,args:r})})}}class EvaluatorFrameWorker extends ScriptEvaluatorWorker{constructor(){super();m(this,"origin");const n=new URLSearchParams(window.location.search).get("sc");if(!n)throw new Error("Invalid source provided!");this.origin=n}onMessage(t){window.addEventListener("message",n=>{n.origin===this.origin&&t(n.data)})}send(t,n){window.parent.postMessage({type:t,payload:n},this.origin)}onError(t){window.addEventListener("error",t),window.addEventListener("unhandledrejection",n=>{n.preventDefault(),t(n.reason)})}}const injectScript=e=>new Promise((r,t)=>{const n=document.getElementsByTagName("head")[0];if(!n)return t(new Error("No head found!"));const o=document.createElement("script");o.type="text/javascript",o.src=e,o.crossOrigin="anonymous",o.onload=()=>r(null),o.onerror=s=>t(s),n.appendChild(o)}),injectStylesheet=e=>new Promise((r,t)=>{const n=document.getElementsByTagName("head")[0];if(!n)return t(new Error("No head found!"));const o=document.createElement("link");o.type="text/css",o.rel="stylesheet",o.crossOrigin="anonymous",o.href=e,o.onload=()=>r(null),o.onerror=s=>t(s),n.appendChild(o)}),handlePluginSandbox=async()=>{const r=new URLSearchParams(window.location.search).get("plugin_sandbox_opts"),t=r?JSON.parse(r):void 0;if(!t)throw new Error("Invalid plugin options provided!");if(t.type!=="scripts")throw new Error("Invalid plugin option type provided!");if(document.querySelectorAll('style,link[rel="stylesheet"]').forEach(n=>n.remove()),t.styleUrls)for(const n of t.styleUrls)await injectStylesheet(n);if(t.scriptUrls)for(const n of t.scriptUrls)await injectScript(n)},searchParams=new URLSearchParams(window.location.search),sandboxType=searchParams.get("sandbox_type");switch(sandboxType){case"plugin":handlePluginSandbox();break;case"script":default:new ScriptEvaluatorWorkerEngine(new EvaluatorFrameWorker).start()}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<base href="./" />
|
|
8
8
|
<title>Vite + TS</title>
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-Bmf0paKh.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="./assets/index-Cz4zGhbH.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|