@stlite/desktop 0.55.0 → 0.56.0

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.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "/static/css/main.6fb7674e.css",
4
- "main.js": "/static/js/main.d4b476f6.js",
5
- "static/js/3936.0940f40e.chunk.js": "/static/js/3936.0940f40e.chunk.js",
4
+ "main.js": "/static/js/main.1e159f80.js",
5
+ "static/js/3936.a3e17800.chunk.js": "/static/js/3936.a3e17800.chunk.js",
6
6
  "static/js/4994.2d981099.chunk.js": "/static/js/4994.2d981099.chunk.js",
7
7
  "static/js/3685.39209b63.chunk.js": "/static/js/3685.39209b63.chunk.js",
8
- "static/js/4785.dfc6ec31.chunk.js": "/static/js/4785.dfc6ec31.chunk.js",
8
+ "static/js/4785.0c41f474.chunk.js": "/static/js/4785.0c41f474.chunk.js",
9
9
  "static/js/5299.478bd9da.chunk.js": "/static/js/5299.478bd9da.chunk.js",
10
10
  "static/js/4482.6da0ecb0.chunk.js": "/static/js/4482.6da0ecb0.chunk.js",
11
11
  "static/css/188.da3ff442.chunk.css": "/static/css/188.da3ff442.chunk.css",
@@ -17,13 +17,13 @@
17
17
  "static/js/1122.61603faa.chunk.js": "/static/js/1122.61603faa.chunk.js",
18
18
  "static/js/6802.e50f982c.chunk.js": "/static/js/6802.e50f982c.chunk.js",
19
19
  "static/js/9311.1687f2a8.chunk.js": "/static/js/9311.1687f2a8.chunk.js",
20
- "static/js/144.88686aae.chunk.js": "/static/js/144.88686aae.chunk.js",
20
+ "static/js/144.fa398340.chunk.js": "/static/js/144.fa398340.chunk.js",
21
21
  "static/js/2940.71b23ca7.chunk.js": "/static/js/2940.71b23ca7.chunk.js",
22
22
  "static/js/9001.18ff903a.chunk.js": "/static/js/9001.18ff903a.chunk.js",
23
23
  "static/js/2873.86ab0f7f.chunk.js": "/static/js/2873.86ab0f7f.chunk.js",
24
- "static/js/6134.705b9bd4.chunk.js": "/static/js/6134.705b9bd4.chunk.js",
24
+ "static/js/6134.38a4a22f.chunk.js": "/static/js/6134.38a4a22f.chunk.js",
25
25
  "static/js/1189.4d3c558f.chunk.js": "/static/js/1189.4d3c558f.chunk.js",
26
- "static/js/1740.8721df70.chunk.js": "/static/js/1740.8721df70.chunk.js",
26
+ "static/js/1740.9d03a50a.chunk.js": "/static/js/1740.9d03a50a.chunk.js",
27
27
  "static/js/698.13b8e23f.chunk.js": "/static/js/698.13b8e23f.chunk.js",
28
28
  "static/js/4724.c18f63ef.chunk.js": "/static/js/4724.c18f63ef.chunk.js",
29
29
  "static/js/1729.fd9f6660.chunk.js": "/static/js/1729.fd9f6660.chunk.js",
@@ -64,7 +64,7 @@
64
64
  "static/js/9166.e335c84b.chunk.js": "/static/js/9166.e335c84b.chunk.js",
65
65
  "static/js/6463.d6201add.chunk.js": "/static/js/6463.d6201add.chunk.js",
66
66
  "module.wasm": "/c43e2f2e6b6fd378c8e1.module.wasm",
67
- "pypi/streamlit-1.35.0-cp311-none-any.whl": "/pypi/streamlit-1.35.0-cp311-none-any.whl",
67
+ "pypi/streamlit-1.35.0-cp312-none-any.whl": "/pypi/streamlit-1.35.0-cp312-none-any.whl",
68
68
  "static/media/MaterialSymbols-Outlined.woff2": "/static/media/MaterialSymbols-Outlined.909d2dce4aba724ad02f.woff2",
69
69
  "static/media/fireworks.gif": "/static/media/fireworks.0906f02ea43f1018a6d2.gif",
70
70
  "static/media/flake-2.png": "/static/media/flake-2.e3f07d06933dd0e84c24.png",
@@ -163,6 +163,6 @@
163
163
  },
164
164
  "entrypoints": [
165
165
  "static/css/main.6fb7674e.css",
166
- "static/js/main.d4b476f6.js"
166
+ "static/js/main.1e159f80.js"
167
167
  ]
168
168
  }
@@ -1,5 +1,5 @@
1
- var ce=Object.create;var J=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty;var F=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var me=(o,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of ge(e))!ue.call(o,t)&&t!==r&&J(o,t,{get:()=>e[t],enumerable:!(s=de(e,t))||s.enumerable});return o};var K=(o,e,r)=>(r=o!=null?ce(fe(o)):{},me(e||!o||!o.__esModule?J(r,"default",{value:o,enumerable:!0}):r,o));var V=F(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.validateRequirements=void 0;var pe="[",_e="(<=>!~",ye=";",he="@",ve=new RegExp(`[${pe+_e+ye+he}]`);function be(o){return o.split(ve)[0].trim()}function Pe(o){return o.forEach(r=>{let s;try{s=new URL(r)}catch{return}if(s.protocol==="emfs:"||s.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${r})`)}),o.filter(r=>be(r)==="streamlit"?(console.warn(`Streamlit is specified in the requirements ("${r}"), but it will be ignored. A built-in version of Streamlit will be used.`),!1):!0)}E.validateRequirements=Pe});var X=F(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.parseRequirementsTxt=void 0;var we=/\s#.*$/;function Se(o){return o.split(`
2
- `).filter(e=>!e.startsWith("#")).map(e=>e.replace(we,"")).map(e=>e.trim()).filter(e=>e!=="")}T.parseRequirementsTxt=Se});var G=F(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.PromiseDelegate=void 0;var D=class{constructor(){this.promise=new Promise((e,r)=>{this.resolveInternal=e,this.rejectInternal=r})}resolve(e){this.resolveInternal(e)}reject(e){this.rejectInternal(e)}};M.PromiseDelegate=D});var Q=F(w=>{"use strict";var ke=w&&w.__createBinding||(Object.create?function(o,e,r,s){s===void 0&&(s=r);var t=Object.getOwnPropertyDescriptor(e,r);(!t||("get"in t?!e.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(o,s,t)}:function(o,e,r,s){s===void 0&&(s=r),o[s]=e[r]}),L=w&&w.__exportStar||function(o,e){for(var r in o)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ke(e,o,r)};Object.defineProperty(w,"__esModule",{value:!0});L(V(),w);L(X(),w);L(G(),w)});var ee=F((je,Z)=>{"use strict";function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function Y(o,e){for(var r="",s=0,t=-1,a=0,n,i=0;i<=o.length;++i){if(i<o.length)n=o.charCodeAt(i);else{if(n===47)break;n=47}if(n===47){if(!(t===i-1||a===1))if(t!==i-1&&a===2){if(r.length<2||s!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var d=r.lastIndexOf("/");if(d!==r.length-1){d===-1?(r="",s=0):(r=r.slice(0,d),s=r.length-1-r.lastIndexOf("/")),t=i,a=0;continue}}else if(r.length===2||r.length===1){r="",s=0,t=i,a=0;continue}}e&&(r.length>0?r+="/..":r="..",s=2)}else r.length>0?r+="/"+o.slice(t+1,i):r=o.slice(t+1,i),s=i-t-1;t=i,a=0}else n===46&&a!==-1?++a:a=-1}return r}function Re(o,e){var r=e.dir||e.root,s=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+s:r+o+s:s}var k={resolve:function(){for(var e="",r=!1,s,t=arguments.length-1;t>=-1&&!r;t--){var a;t>=0?a=arguments[t]:(s===void 0&&(s=process.cwd()),a=s),v(a),a.length!==0&&(e=a+"/"+e,r=a.charCodeAt(0)===47)}return e=Y(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,s=e.charCodeAt(e.length-1)===47;return e=Y(e,!r),e.length===0&&!r&&(e="."),e.length>0&&s&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var s=arguments[r];v(s),s.length>0&&(e===void 0?e=s:e+="/"+s)}return e===void 0?".":k.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=k.resolve(e),r=k.resolve(r),e===r))return"";for(var s=1;s<e.length&&e.charCodeAt(s)===47;++s);for(var t=e.length,a=t-s,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var i=r.length,d=i-n,p=a<d?a:d,f=-1,l=0;l<=p;++l){if(l===p){if(d>p){if(r.charCodeAt(n+l)===47)return r.slice(n+l+1);if(l===0)return r.slice(n+l)}else a>p&&(e.charCodeAt(s+l)===47?f=l:l===0&&(f=0));break}var _=e.charCodeAt(s+l),c=r.charCodeAt(n+l);if(_!==c)break;_===47&&(f=l)}var u="";for(l=s+f+1;l<=t;++l)(l===t||e.charCodeAt(l)===47)&&(u.length===0?u+="..":u+="/..");return u.length>0?u+r.slice(n+f):(n+=f,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),s=r===47,t=-1,a=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!a){t=n;break}}else a=!1;return t===-1?s?"/":".":s&&t===1?"//":e.slice(0,t)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var s=0,t=-1,a=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,d=-1;for(n=e.length-1;n>=0;--n){var p=e.charCodeAt(n);if(p===47){if(!a){s=n+1;break}}else d===-1&&(a=!1,d=n+1),i>=0&&(p===r.charCodeAt(i)?--i===-1&&(t=n):(i=-1,t=d))}return s===t?t=d:t===-1&&(t=e.length),e.slice(s,t)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!a){s=n+1;break}}else t===-1&&(a=!1,t=n+1);return t===-1?"":e.slice(s,t)}},extname:function(e){v(e);for(var r=-1,s=0,t=-1,a=!0,n=0,i=e.length-1;i>=0;--i){var d=e.charCodeAt(i);if(d===47){if(!a){s=i+1;break}continue}t===-1&&(a=!1,t=i+1),d===46?r===-1?r=i:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||t===-1||n===0||n===1&&r===t-1&&r===s+1?"":e.slice(r,t)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return Re("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var s=e.charCodeAt(0),t=s===47,a;t?(r.root="/",a=1):a=0;for(var n=-1,i=0,d=-1,p=!0,f=e.length-1,l=0;f>=a;--f){if(s=e.charCodeAt(f),s===47){if(!p){i=f+1;break}continue}d===-1&&(p=!1,d=f+1),s===46?n===-1?n=f:l!==1&&(l=1):n!==-1&&(l=-1)}return n===-1||d===-1||l===0||l===1&&n===d-1&&n===i+1?d!==-1&&(i===0&&t?r.base=r.name=e.slice(1,d):r.base=r.name=e.slice(i,d)):(i===0&&t?(r.name=e.slice(1,n),r.base=e.slice(1,d)):(r.name=e.slice(i,n),r.base=e.slice(i,d)),r.ext=e.slice(n,d)),i>0?r.dir=e.slice(0,i-1):t&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};k.posix=k;Z.exports=k});var j=require("node:worker_threads");var oe=K(Q());var U=K(ee());function re(o,e){let r=U.default.normalize(e),t=U.default.dirname(r).split("/"),a=[];for(let n of t){a.push(n);let i=a.join("/");if(o.FS.analyzePath(i).exists){if(o.FS.isDir(i))throw new Error(`"${i}" already exists and is not a directory.`);continue}try{o.FS.mkdir(i)}catch(d){throw console.error(`Failed to create a directory "${i}"`),d}}}function q(o,e,r,s){re(o,e),o.FS.writeFile(e,r,s)}function te(o,e,r){re(o,r),o.FS.rename(e,r)}var Ae="[",Fe="(<=>!~",Oe=";",Ie="@",Ce=new RegExp(`[${Ae+Fe+Oe+Ie}]`);function Ee(o){return o.split(Ce)[0].trim()}function H(o){return o.forEach(r=>{let s;try{s=new URL(r)}catch{return}if(s.protocol==="emfs:"||s.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${r})`)}),o.filter(r=>Ee(r)==="streamlit"?(console.warn(`Streamlit is specified in the requirements ("${r}"), but it will be ignored. A built-in version of Streamlit will be used.`),!1):!0)}function $(o){o.runPython(`
1
+ var ce=Object.create;var J=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty;var F=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var me=(o,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of ge(e))!ue.call(o,t)&&t!==r&&J(o,t,{get:()=>e[t],enumerable:!(s=de(e,t))||s.enumerable});return o};var K=(o,e,r)=>(r=o!=null?ce(fe(o)):{},me(e||!o||!o.__esModule?J(r,"default",{value:o,enumerable:!0}):r,o));var V=F(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.validateRequirements=void 0;var pe="[",_e="(<=>!~",ye=";",he="@",ve=new RegExp(`[${pe+_e+ye+he}]`);function be(o){return o.split(ve)[0].trim()}function Pe(o){return o.forEach(r=>{let s;try{s=new URL(r)}catch{return}if(s.protocol==="emfs:"||s.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${r})`)}),o.filter(r=>be(r)==="streamlit"?(console.warn(`Streamlit is specified in the requirements ("${r}"), but it will be ignored. A built-in version of Streamlit will be used.`),!1):!0)}E.validateRequirements=Pe});var X=F(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.parseRequirementsTxt=void 0;var we=/\s#.*$/;function Se(o){return o.split(`
2
+ `).filter(e=>!e.startsWith("#")).map(e=>e.replace(we,"")).map(e=>e.trim()).filter(e=>e!=="")}M.parseRequirementsTxt=Se});var G=F(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.PromiseDelegate=void 0;var D=class{constructor(){this.promise=new Promise((e,r)=>{this.resolveInternal=e,this.rejectInternal=r})}resolve(e){this.resolveInternal(e)}reject(e){this.rejectInternal(e)}};T.PromiseDelegate=D});var Q=F(w=>{"use strict";var ke=w&&w.__createBinding||(Object.create?function(o,e,r,s){s===void 0&&(s=r);var t=Object.getOwnPropertyDescriptor(e,r);(!t||("get"in t?!e.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(o,s,t)}:function(o,e,r,s){s===void 0&&(s=r),o[s]=e[r]}),L=w&&w.__exportStar||function(o,e){for(var r in o)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ke(e,o,r)};Object.defineProperty(w,"__esModule",{value:!0});L(V(),w);L(X(),w);L(G(),w)});var ee=F((je,Z)=>{"use strict";function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function Y(o,e){for(var r="",s=0,t=-1,a=0,n,i=0;i<=o.length;++i){if(i<o.length)n=o.charCodeAt(i);else{if(n===47)break;n=47}if(n===47){if(!(t===i-1||a===1))if(t!==i-1&&a===2){if(r.length<2||s!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var d=r.lastIndexOf("/");if(d!==r.length-1){d===-1?(r="",s=0):(r=r.slice(0,d),s=r.length-1-r.lastIndexOf("/")),t=i,a=0;continue}}else if(r.length===2||r.length===1){r="",s=0,t=i,a=0;continue}}e&&(r.length>0?r+="/..":r="..",s=2)}else r.length>0?r+="/"+o.slice(t+1,i):r=o.slice(t+1,i),s=i-t-1;t=i,a=0}else n===46&&a!==-1?++a:a=-1}return r}function Re(o,e){var r=e.dir||e.root,s=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+s:r+o+s:s}var k={resolve:function(){for(var e="",r=!1,s,t=arguments.length-1;t>=-1&&!r;t--){var a;t>=0?a=arguments[t]:(s===void 0&&(s=process.cwd()),a=s),v(a),a.length!==0&&(e=a+"/"+e,r=a.charCodeAt(0)===47)}return e=Y(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,s=e.charCodeAt(e.length-1)===47;return e=Y(e,!r),e.length===0&&!r&&(e="."),e.length>0&&s&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var s=arguments[r];v(s),s.length>0&&(e===void 0?e=s:e+="/"+s)}return e===void 0?".":k.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=k.resolve(e),r=k.resolve(r),e===r))return"";for(var s=1;s<e.length&&e.charCodeAt(s)===47;++s);for(var t=e.length,a=t-s,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var i=r.length,d=i-n,p=a<d?a:d,f=-1,l=0;l<=p;++l){if(l===p){if(d>p){if(r.charCodeAt(n+l)===47)return r.slice(n+l+1);if(l===0)return r.slice(n+l)}else a>p&&(e.charCodeAt(s+l)===47?f=l:l===0&&(f=0));break}var _=e.charCodeAt(s+l),c=r.charCodeAt(n+l);if(_!==c)break;_===47&&(f=l)}var u="";for(l=s+f+1;l<=t;++l)(l===t||e.charCodeAt(l)===47)&&(u.length===0?u+="..":u+="/..");return u.length>0?u+r.slice(n+f):(n+=f,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),s=r===47,t=-1,a=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!a){t=n;break}}else a=!1;return t===-1?s?"/":".":s&&t===1?"//":e.slice(0,t)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var s=0,t=-1,a=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,d=-1;for(n=e.length-1;n>=0;--n){var p=e.charCodeAt(n);if(p===47){if(!a){s=n+1;break}}else d===-1&&(a=!1,d=n+1),i>=0&&(p===r.charCodeAt(i)?--i===-1&&(t=n):(i=-1,t=d))}return s===t?t=d:t===-1&&(t=e.length),e.slice(s,t)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!a){s=n+1;break}}else t===-1&&(a=!1,t=n+1);return t===-1?"":e.slice(s,t)}},extname:function(e){v(e);for(var r=-1,s=0,t=-1,a=!0,n=0,i=e.length-1;i>=0;--i){var d=e.charCodeAt(i);if(d===47){if(!a){s=i+1;break}continue}t===-1&&(a=!1,t=i+1),d===46?r===-1?r=i:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||t===-1||n===0||n===1&&r===t-1&&r===s+1?"":e.slice(r,t)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return Re("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var s=e.charCodeAt(0),t=s===47,a;t?(r.root="/",a=1):a=0;for(var n=-1,i=0,d=-1,p=!0,f=e.length-1,l=0;f>=a;--f){if(s=e.charCodeAt(f),s===47){if(!p){i=f+1;break}continue}d===-1&&(p=!1,d=f+1),s===46?n===-1?n=f:l!==1&&(l=1):n!==-1&&(l=-1)}return n===-1||d===-1||l===0||l===1&&n===d-1&&n===i+1?d!==-1&&(i===0&&t?r.base=r.name=e.slice(1,d):r.base=r.name=e.slice(i,d)):(i===0&&t?(r.name=e.slice(1,n),r.base=e.slice(1,d)):(r.name=e.slice(i,n),r.base=e.slice(i,d)),r.ext=e.slice(n,d)),i>0?r.dir=e.slice(0,i-1):t&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};k.posix=k;Z.exports=k});var j=require("node:worker_threads");var oe=K(Q());var U=K(ee());function re(o,e){let r=U.default.normalize(e),t=U.default.dirname(r).split("/"),a=[];for(let n of t){a.push(n);let i=a.join("/");if(o.FS.analyzePath(i).exists){if(o.FS.isDir(i))throw new Error(`"${i}" already exists and is not a directory.`);continue}try{o.FS.mkdir(i)}catch(d){throw console.error(`Failed to create a directory "${i}"`),d}}}function q(o,e,r,s){re(o,e),o.FS.writeFile(e,r,s)}function te(o,e,r){re(o,r),o.FS.rename(e,r)}var Ae="[",Fe="(<=>!~",Oe=";",Ie="@",Ce=new RegExp(`[${Ae+Fe+Oe+Ie}]`);function Ee(o){return o.split(Ce)[0].trim()}function H(o){return o.forEach(r=>{let s;try{s=new URL(r)}catch{return}if(s.protocol==="emfs:"||s.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${r})`)}),o.filter(r=>Ee(r)==="streamlit"?(console.warn(`Streamlit is specified in the requirements ("${r}"), but it will be ignored. A built-in version of Streamlit will be used.`),!1):!0)}function $(o){o.runPython(`
3
3
  import micropip
4
4
  micropip.add_mock_package(
5
5
  "pyarrow", "0.0.1",
@@ -15,7 +15,7 @@ class Table:
15
15
  """
16
16
  }
17
17
  )
18
- `)}async function Te(o,e){let r=o.slice(0,o.lastIndexOf("/")+1),s;return o.endsWith(".mjs")?s=(await import(o)).loadPyodide:(importScripts(o),s=N.loadPyodide),s({...e,indexURL:r})}var N=global;function se(o,e,r){function s(f){e({type:"event:progress",data:{message:f}})}let t,a,n=new oe.PromiseDelegate;async function i(){let f=await n.promise,l={...r,...f};console.debug("Initial data",l);let{entrypoint:_,files:c,archives:u,requirements:y,prebuiltPackageNames:S,wheels:h,mountedSitePackagesSnapshotFilePath:b,pyodideUrl:O=o,streamlitConfig:R,idbfsMountpoints:W,nodefsMountpoints:x}=l,I=H(y);s("Loading Pyodide."),console.debug("Loading Pyodide"),t=await Te(O,{stdout:console.log,stderr:console.error}),console.debug("Loaded Pyodide");let B=!1;if(W&&(B=!0,W.forEach(g=>{t.FS.mkdir(g),t.FS.mount(t.FS.filesystems.IDBFS,{},g)}),await new Promise((g,m)=>{t.FS.syncfs(!0,P=>{P?m(P):g()})})),x&&Object.entries(x).forEach(([g,m])=>{t.FS.mkdir(g),t.FS.mount(t.FS.filesystems.NODEFS,{root:m},g)}),s("Mounting files."),await Promise.all(Object.keys(c).map(async g=>{let m=c[g],P;"url"in m?(console.debug(`Fetch a file from ${m.url}`),P=await fetch(m.url).then(A=>A.arrayBuffer()).then(A=>new Uint8Array(A))):P=m.data;let{opts:C}=c[g];console.debug(`Write a file "${g}"`),q(t,g,P,C)})),s("Unpacking archives."),await Promise.all(u.map(async g=>{let m;"url"in g?(console.debug(`Fetch an archive from ${g.url}`),m=await fetch(g.url).then(A=>A.arrayBuffer())):m=g.buffer;let{format:P,options:C}=g;console.debug("Unpack an archive",{format:P,options:C}),t.unpackArchive(m,P,C)})),!b&&!h)throw new Error("Neither snapshot nor wheel files are provided.");b&&(s("Restoring the snapshot."),await t.runPythonAsync("import tarfile, shutil, site"),await t.runPythonAsync(`
18
+ `)}async function Me(o,e){let r=o.slice(0,o.lastIndexOf("/")+1),s;return o.endsWith(".mjs")?s=(await import(o)).loadPyodide:(importScripts(o),s=N.loadPyodide),s({...e,indexURL:r})}var N=global;function se(o,e,r){function s(f){e({type:"event:progress",data:{message:f}})}let t,a,n=new oe.PromiseDelegate;async function i(){let f=await n.promise,l={...r,...f};console.debug("Initial data",l);let{entrypoint:_,files:c,archives:u,requirements:y,prebuiltPackageNames:S,wheels:h,mountedSitePackagesSnapshotFilePath:b,pyodideUrl:O=o,streamlitConfig:R,idbfsMountpoints:W,nodefsMountpoints:x}=l,I=H(y);s("Loading Pyodide."),console.debug("Loading Pyodide"),t=await Me(O,{stdout:console.log,stderr:console.error}),console.debug("Loaded Pyodide");let B=!1;if(W&&(B=!0,W.forEach(g=>{t.FS.mkdir(g),t.FS.mount(t.FS.filesystems.IDBFS,{},g)}),await new Promise((g,m)=>{t.FS.syncfs(!0,P=>{P?m(P):g()})})),x&&Object.entries(x).forEach(([g,m])=>{t.FS.mkdir(g),t.FS.mount(t.FS.filesystems.NODEFS,{root:m},g)}),s("Mounting files."),await Promise.all(Object.keys(c).map(async g=>{let m=c[g],P;"url"in m?(console.debug(`Fetch a file from ${m.url}`),P=await fetch(m.url).then(A=>A.arrayBuffer()).then(A=>new Uint8Array(A))):P=m.data;let{opts:C}=c[g];console.debug(`Write a file "${g}"`),q(t,g,P,C)})),s("Unpacking archives."),await Promise.all(u.map(async g=>{let m;"url"in g?(console.debug(`Fetch an archive from ${g.url}`),m=await fetch(g.url).then(A=>A.arrayBuffer())):m=g.buffer;let{format:P,options:C}=g;console.debug("Unpack an archive",{format:P,options:C}),t.unpackArchive(m,P,C)})),!b&&!h)throw new Error("Neither snapshot nor wheel files are provided.");b&&(s("Restoring the snapshot."),await t.runPythonAsync("import tarfile, shutil, site"),await t.runPythonAsync(`
19
19
  site_packages_dirs = site.getsitepackages()
20
20
  for site_packages in site_packages_dirs:
21
21
  shutil.rmtree(site_packages)
@@ -111,4 +111,4 @@ prepare(main_script_path, args)
111
111
 
112
112
  server = Server(main_script_path)
113
113
  server.start()
114
- `),console.debug("Booted up the Streamlit server"),console.debug("Setting up the HTTP server"),a=t.globals.get("server").copy(),console.debug("Set up the HTTP server"),e({type:"event:loaded"})}let d=i().catch(f=>{throw e({type:"event:error",data:{error:f}}),f}),p=async f=>{let l=f.data;if(l.type==="initData"){n.resolve(l.data);return}await d;let _=f.ports[0];try{switch(l.type){case"websocket:connect":{console.debug("websocket:connect",l.data);let{path:c}=l.data;a.start_websocket(c,(u,y)=>{if(y){let S=u,h=S.getBuffer("u8");S.destroy();let b=new Uint8ClampedArray(h.data.buffer,h.data.byteOffset,h.data.byteLength);e({type:"websocket:message",data:{payload:new Uint8Array(b)}})}else e({type:"websocket:message",data:{payload:u}})}),_.postMessage({type:"reply"});break}case"websocket:send":{console.debug("websocket:send",l.data);let{payload:c}=l.data;a.receive_websocket_from_js(c);break}case"http:request":{console.debug("http:request",l.data);let{request:c}=l.data,u=(y,S,h)=>{let b=S.toJs(),O=h.toJs();console.debug({statusCode:y,headers:b,body:O});let R={type:"http:response",data:{response:{statusCode:y,headers:b,body:O}}};_.postMessage(R)};a.receive_http_from_js(c.method,decodeURIComponent(c.path),c.headers,c.body,u);break}case"file:write":{let{path:c,data:u,opts:y}=l.data;console.debug(`Write a file "${c}"`),q(t,c,u,y),_.postMessage({type:"reply"});break}case"file:rename":{let{oldPath:c,newPath:u}=l.data;console.debug(`Rename "${c}" to ${u}`),te(t,c,u),_.postMessage({type:"reply"});break}case"file:unlink":{let{path:c}=l.data;console.debug(`Remove "${c}`),t.FS.unlink(c),_.postMessage({type:"reply"});break}case"install":{let{requirements:c}=l.data,u=t.pyimport("micropip"),y=H(c);console.debug("Install the requirements:",y),await u.install.callKwargs(y,{keep_going:!0}).then(()=>{console.debug("Successfully installed"),_.postMessage({type:"reply"})})}}}catch(c){if(console.error(c),!(c instanceof Error))throw c;let u=new Error(c.message);u.name=c.name,u.stack=c.stack,_.postMessage({type:"reply",error:u})}};return e({type:"event:start"}),p}function ne(){let o=process.env.NODEFS_MOUNTPOINTS;if(!o)return;let e;try{e=JSON.parse(o)}catch{console.error(`Failed to parse NODEFS_MOUNTPOINTS as JSON: ${o}`);return}if(typeof e!="object"){console.error(`NODEFS_MOUNTPOINTS is not an object: ${o}`);return}if(Array.isArray(e)){console.error(`NODEFS_MOUNTPOINTS is an array: ${o}`);return}if(Object.keys(e).some(r=>typeof r!="string")){console.error(`NODEFS_MOUNTPOINTS has non-string keys: ${o}`);return}if(Object.values(e).some(r=>typeof r!="string")){console.error(`NODEFS_MOUNTPOINTS has non-string values: ${o}`);return}return e}function Me(o){console.debug("[worker thread] postMessage from worker",o),j.parentPort?.postMessage(o)}var Ne=se(process.env.PYODIDE_URL,Me,{nodefsMountpoints:ne()});j.parentPort?.on("message",({data:o,port:e})=>{console.debug("[worker thread] parentPort.onMessage",{data:o,port:e}),Ne({data:o,ports:[e]})});
114
+ `),console.debug("Booted up the Streamlit server"),console.debug("Setting up the HTTP server"),a=t.globals.get("server").copy(),console.debug("Set up the HTTP server"),e({type:"event:loaded"})}let d=i().catch(f=>{throw e({type:"event:error",data:{error:f}}),f}),p=async f=>{let l=f.data;if(l.type==="initData"){n.resolve(l.data);return}await d;let _=f.ports[0];try{switch(l.type){case"websocket:connect":{console.debug("websocket:connect",l.data);let{path:c}=l.data;a.start_websocket(c,(u,y)=>{if(y){let S=u,h=S.getBuffer("u8");S.destroy();let b=new Uint8ClampedArray(h.data.buffer,h.data.byteOffset,h.data.byteLength);e({type:"websocket:message",data:{payload:new Uint8Array(b)}})}else e({type:"websocket:message",data:{payload:u}})}),_.postMessage({type:"reply"});break}case"websocket:send":{console.debug("websocket:send",l.data);let{payload:c}=l.data;a.receive_websocket_from_js(c);break}case"http:request":{console.debug("http:request",l.data);let{request:c}=l.data,u=(y,S,h)=>{let b=new Map(S.toJs()),O=h.toJs();console.debug({statusCode:y,headers:b,body:O});let R={type:"http:response",data:{response:{statusCode:y,headers:b,body:O}}};_.postMessage(R)};a.receive_http_from_js(c.method,decodeURIComponent(c.path),c.headers,c.body,u);break}case"file:write":{let{path:c,data:u,opts:y}=l.data;console.debug(`Write a file "${c}"`),q(t,c,u,y),_.postMessage({type:"reply"});break}case"file:rename":{let{oldPath:c,newPath:u}=l.data;console.debug(`Rename "${c}" to ${u}`),te(t,c,u),_.postMessage({type:"reply"});break}case"file:unlink":{let{path:c}=l.data;console.debug(`Remove "${c}`),t.FS.unlink(c),_.postMessage({type:"reply"});break}case"install":{let{requirements:c}=l.data,u=t.pyimport("micropip"),y=H(c);console.debug("Install the requirements:",y),await u.install.callKwargs(y,{keep_going:!0}).then(()=>{console.debug("Successfully installed"),_.postMessage({type:"reply"})})}}}catch(c){if(console.error(c),!(c instanceof Error))throw c;let u=new Error(c.message);u.name=c.name,u.stack=c.stack,_.postMessage({type:"reply",error:u})}};return e({type:"event:start"}),p}function ne(){let o=process.env.NODEFS_MOUNTPOINTS;if(!o)return;let e;try{e=JSON.parse(o)}catch{console.error(`Failed to parse NODEFS_MOUNTPOINTS as JSON: ${o}`);return}if(typeof e!="object"){console.error(`NODEFS_MOUNTPOINTS is not an object: ${o}`);return}if(Array.isArray(e)){console.error(`NODEFS_MOUNTPOINTS is an array: ${o}`);return}if(Object.keys(e).some(r=>typeof r!="string")){console.error(`NODEFS_MOUNTPOINTS has non-string keys: ${o}`);return}if(Object.values(e).some(r=>typeof r!="string")){console.error(`NODEFS_MOUNTPOINTS has non-string values: ${o}`);return}return e}function Te(o){console.debug("[worker thread] postMessage from worker",o),j.parentPort?.postMessage(o)}var Ne=se(process.env.PYODIDE_URL,Te,{nodefsMountpoints:ne()});j.parentPort?.on("message",({data:o,port:e})=>{console.debug("[worker thread] parentPort.onMessage",{data:o,port:e}),Ne({data:o,ports:[e]})});
package/build/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>stlite</title><script defer="defer" src="/static/js/main.d4b476f6.js"></script><link href="/static/css/main.6fb7674e.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>stlite</title><script defer="defer" src="/static/js/main.1e159f80.js"></script><link href="/static/css/main.6fb7674e.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>