@pyscript/core 0.3.7 → 0.3.9
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/dist/codemirror-3hMOlj_s.js +2 -0
- package/dist/codemirror-3hMOlj_s.js.map +1 -0
- package/dist/codemirror_commands-Y4OsE8Y2.js +2 -0
- package/dist/codemirror_commands-Y4OsE8Y2.js.map +1 -0
- package/dist/codemirror_lang-python-p0uky9oC.js +2 -0
- package/dist/codemirror_lang-python-p0uky9oC.js.map +1 -0
- package/dist/codemirror_language-U9l5bLBC.js +2 -0
- package/dist/codemirror_language-U9l5bLBC.js.map +1 -0
- package/dist/codemirror_state-zH-H1oSI.js +2 -0
- package/dist/codemirror_state-zH-H1oSI.js.map +1 -0
- package/dist/codemirror_view-tmIj4olz.js +2 -0
- package/dist/codemirror_view-tmIj4olz.js.map +1 -0
- package/dist/core-ifSZyON7.js +5 -0
- package/dist/core-ifSZyON7.js.map +1 -0
- package/dist/core.css +1 -1
- package/dist/core.js +1 -4
- package/dist/core.js.map +1 -1
- package/dist/deprecations-manager-u20LUlLl.js +2 -0
- package/dist/{deprecations-manager-uwH5iaZ9.js.map → deprecations-manager-u20LUlLl.js.map} +1 -1
- package/dist/error-ZSXf8h5x.js +2 -0
- package/dist/{error-96hMSEw8.js.map → error-ZSXf8h5x.js.map} +1 -1
- package/dist/index-qM2iyXcZ.js +2 -0
- package/dist/index-qM2iyXcZ.js.map +1 -0
- package/dist/py-editor-HVgDslnW.js +2 -0
- package/dist/py-editor-HVgDslnW.js.map +1 -0
- package/dist/py-terminal-lYFDY-Tg.js +2 -0
- package/dist/{py-terminal-qRUZOJY9.js.map → py-terminal-lYFDY-Tg.js.map} +1 -1
- package/dist/xterm-f2QfYNGL.js.map +1 -1
- package/dist/xterm-readline-ONk85xtH.js.map +1 -1
- package/dist/xterm.css +0 -1
- package/dist/xterm_addon-fit-E4yMPZTX.js.map +1 -1
- package/package.json +12 -5
- package/src/3rd-party/xterm-readline.js +0 -1
- package/src/3rd-party/xterm.css +0 -1
- package/src/3rd-party/xterm.js +0 -1
- package/src/3rd-party/xterm_addon-fit.js +0 -1
- package/src/config.js +38 -12
- package/src/core.css +38 -0
- package/src/exceptions.js +1 -1
- package/src/hooks.js +1 -1
- package/src/plugins/py-editor.js +229 -0
- package/src/plugins.js +1 -0
- package/src/stdlib/pyscript/magic_js.py +2 -1
- package/src/stdlib/pyscript.js +2 -2
- package/src/stdlib/pyweb/pydom.py +100 -0
- package/src/stdlib.js +7 -3
- package/types/3rd-party/codemirror.d.ts +1 -0
- package/types/3rd-party/codemirror_commands.d.ts +1 -0
- package/types/3rd-party/codemirror_lang-python.d.ts +1 -0
- package/types/3rd-party/codemirror_language.d.ts +1 -0
- package/types/3rd-party/codemirror_state.d.ts +1 -0
- package/types/3rd-party/codemirror_view.d.ts +1 -0
- package/types/plugins/py-editor.d.ts +2 -0
- package/types/plugins.d.ts +1 -0
- package/dist/deprecations-manager-uwH5iaZ9.js +0 -2
- package/dist/error-96hMSEw8.js +0 -2
- package/dist/py-terminal-qRUZOJY9.js +0 -2
- package/types/toml.d.ts +0 -12
- package/types/utils.d.ts +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
export * from "@codemirror/language";
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "@codemirror/state";
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "@codemirror/view";
|
package/types/plugins.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
declare const _default: {
|
2
2
|
"deprecations-manager": () => Promise<typeof import("./plugins/deprecations-manager.js")>;
|
3
3
|
error: () => Promise<typeof import("./plugins/error.js")>;
|
4
|
+
"py-editor": () => Promise<typeof import("./plugins/py-editor.js")>;
|
4
5
|
"py-terminal": () => Promise<typeof import("./plugins/py-terminal.js")>;
|
5
6
|
};
|
6
7
|
export default _default;
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{hooks as o}from"./core.js";import{notify as e}from"./error-96hMSEw8.js";function r(){const o=document.querySelectorAll("script");for(const e of o)s(e.src)}function s(o){/\/pyscript\.net\/latest/.test(o)&&e("Loading scripts from latest is deprecated and will be removed soon. Please use a specific version instead.")}o.main.onReady.add(r),o.main.onWorker.add(r);
|
2
|
-
//# sourceMappingURL=deprecations-manager-uwH5iaZ9.js.map
|
package/dist/error-96hMSEw8.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
import{hooks as e}from"./core.js";function o(e){const o=document.createElement("div");o.className="py-error",o.textContent=e,o.style.cssText="\n border: 1px solid red;\n background: #ffdddd;\n color: black;\n font-family: courier, monospace;\n white-space: pre;\n overflow-x: auto;\n padding: 8px;\n margin-top: 8px;\n ",document.body.append(o)}e.main.onReady.add((function n(r){e.main.onReady.delete(n);const{stderr:t}=r.io;r.io.stderr=(e,...n)=>(o(e.message||e),t(e,...n)),addEventListener("error",(({message:e})=>{e.startsWith("Uncaught PythonError")&&o(e)}))}));export{o as notify};
|
2
|
-
//# sourceMappingURL=error-96hMSEw8.js.map
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{TYPES as e,hooks as t}from"./core.js";import{notify as r}from"./error-96hMSEw8.js";const n=[...e.keys()].map((e=>`script[type="${e}"][terminal],${e}-script[terminal]`)).join(","),o=e=>{throw r(e),new Error(e)},i=async()=>{const e=document.querySelectorAll(n);if(!e.length)return;s.disconnect(),e.length>1&&o("You can use at most 1 terminal.");const[r]=e;r.matches('script[type="mpy"],mpy-script')&&o("Unsupported terminal."),document.head.append(Object.assign(document.createElement("link"),{rel:"stylesheet",href:new URL("./xterm.css",import.meta.url)}));const[{Terminal:i},{Readline:a},{FitAddon:d}]=await Promise.all([import("./xterm-f2QfYNGL.js"),import("./xterm-readline-ONk85xtH.js"),import("./xterm_addon-fit-E4yMPZTX.js")]),l=new a,c=e=>{let t=r;const n=r.getAttribute("target");if(n){if(t=document.getElementById(n)||document.querySelector(n),!t)throw new Error(`Unknown target ${n}`)}else t=document.createElement("py-terminal"),t.style.display="block",r.after(t);const o=new i({theme:{background:"#191A19",foreground:"#F5F2E7"},...e}),s=new d;o.loadAddon(s),o.loadAddon(l),o.open(t),s.fit(),o.focus()};if(r.hasAttribute("worker")){const e=({interpreter:e},{sync:t})=>{t.pyterminal_drop_hooks();const r=new TextDecoder;let n="";const o={isatty:!0,write:e=>(n=r.decode(e),t.pyterminal_write(n),e.length)};e.setStdout(o),e.setStderr(o),e.setStdin({isatty:!0,stdin:()=>t.pyterminal_read(n)})};t.main.onWorker.add((function r(n,o){t.main.onWorker.delete(r),c({disableStdin:!1,cursorBlink:!0,cursorStyle:"block"}),o.sync.pyterminal_read=l.read.bind(l),o.sync.pyterminal_write=l.write.bind(l),o.sync.pyterminal_drop_hooks=()=>{t.worker.onReady.delete(e)}})),t.worker.onReady.add(e)}else t.main.onReady.add((function e({io:r}){console.warn("py-terminal is read only on main thread"),t.main.onReady.delete(e),c({disableStdin:!0,cursorBlink:!1,cursorStyle:"underline"}),r.stdout=e=>{l.write(`${e}\n`)},r.stderr=e=>{l.write(`${e.message||e}\n`)}}))},s=new MutationObserver(i);s.observe(document,{childList:!0,subtree:!0});var a=i();export{a as default};
|
2
|
-
//# sourceMappingURL=py-terminal-qRUZOJY9.js.map
|
package/types/toml.d.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
/*! (c) Jak Wings - MIT */ declare class e extends SyntaxError {
|
2
|
-
constructor(r: any, { offset: t, line: e, column: n }: {
|
3
|
-
offset: any;
|
4
|
-
line: any;
|
5
|
-
column: any;
|
6
|
-
});
|
7
|
-
offset: any;
|
8
|
-
line: any;
|
9
|
-
column: any;
|
10
|
-
}
|
11
|
-
declare function n(n: any): any;
|
12
|
-
export { e as SyntaxError, n as parse };
|
package/types/utils.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export function htmlDecode(html: any): string;
|