@pyscript/core 0.7.26 → 0.7.28
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/{core-BnOlAruz.js → core-of365ts-.js} +3 -3
- package/dist/{core-BnOlAruz.js.map → core-of365ts-.js.map} +1 -1
- package/dist/core.css +1 -1
- package/dist/core.js +1 -1
- package/dist/{deprecations-manager-BWA24KIW.js → deprecations-manager-kmj_AGsV.js} +2 -2
- package/dist/{deprecations-manager-BWA24KIW.js.map → deprecations-manager-kmj_AGsV.js.map} +1 -1
- package/dist/{donkey-CO7t2Z4u.js → donkey-CKcbaOhQ.js} +2 -2
- package/dist/{donkey-CO7t2Z4u.js.map → donkey-CKcbaOhQ.js.map} +1 -1
- package/dist/{error-C-EDWVqG.js → error-DN097_kl.js} +2 -2
- package/dist/{error-C-EDWVqG.js.map → error-DN097_kl.js.map} +1 -1
- package/dist/{mpy-xrBobQd9.js → mpy-CmHIC_T4.js} +2 -2
- package/dist/{mpy-xrBobQd9.js.map → mpy-CmHIC_T4.js.map} +1 -1
- package/dist/{py-DIWsUuve.js → py-BY9OyURr.js} +2 -2
- package/dist/{py-DIWsUuve.js.map → py-BY9OyURr.js.map} +1 -1
- package/dist/{py-editor-QV6vNT6B.js → py-editor-md0FEZ4Z.js} +2 -2
- package/dist/{py-editor-QV6vNT6B.js.map → py-editor-md0FEZ4Z.js.map} +1 -1
- package/dist/{py-game-Bw4ByfDi.js → py-game-CDWnCqy1.js} +2 -2
- package/dist/{py-game-Bw4ByfDi.js.map → py-game-CDWnCqy1.js.map} +1 -1
- package/dist/{py-terminal-Bmqp7Vua.js → py-terminal-DDBTLKy-.js} +2 -2
- package/dist/{py-terminal-Bmqp7Vua.js.map → py-terminal-DDBTLKy-.js.map} +1 -1
- package/package.json +1 -1
- package/src/core.css +1 -1
- package/src/plugins/py-editor.js +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"py-terminal-
|
|
1
|
+
{"version":3,"file":"py-terminal-DDBTLKy-.js","sources":["../src/plugins/py-terminal.js"],"sourcesContent":["// PyScript py-terminal plugin\nimport { TYPES, relative_url } from \"../core.js\";\nimport { notify } from \"./error.js\";\nimport { customObserver } from \"polyscript/exports\";\n\n// will contain all valid selectors\nconst SELECTORS = [];\n\n// avoid processing same elements twice\nconst processed = new WeakSet();\n\n// show the error on main and\n// stops the module from keep executing\nconst notifyAndThrow = (message) => {\n notify(message);\n throw new Error(message);\n};\n\nconst onceOnMain = ({ attributes: { worker } }) => !worker;\n\nlet addStyle = true;\n\nfor (const type of TYPES.keys()) {\n const selector = `script[type=\"${type}\"][terminal],${type}-script[terminal]`;\n SELECTORS.push(selector);\n customObserver.set(selector, async (element) => {\n // we currently support only one terminal on main as in \"classic\"\n const terminals = document.querySelectorAll(SELECTORS.join(\",\"));\n if ([].filter.call(terminals, onceOnMain).length > 1)\n notifyAndThrow(\"You can use at most 1 main terminal\");\n\n // import styles lazily\n if (addStyle) {\n addStyle = false;\n document.head.append(\n Object.assign(document.createElement(\"link\"), {\n rel: \"stylesheet\",\n href: relative_url(\"./xterm.css\", import.meta.url),\n }),\n );\n }\n\n if (processed.has(element)) return;\n processed.add(element);\n\n const bootstrap = (module) => module.default(element);\n\n // we can't be smart with template literals for the dynamic import\n // or bundlers are incapable of producing multiple files around\n if (type === \"mpy\") {\n await import(/* webpackIgnore: true */ \"./py-terminal/mpy.js\").then(\n bootstrap,\n );\n } else {\n await import(/* webpackIgnore: true */ \"./py-terminal/py.js\").then(\n bootstrap,\n );\n }\n });\n}\n"],"names":["SELECTORS","processed","WeakSet","notifyAndThrow","message","notify","Error","onceOnMain","attributes","worker","addStyle","type","TYPES","keys","selector","push","customObserver","set","async","element","terminals","document","querySelectorAll","join","filter","call","length","head","append","Object","assign","createElement","rel","href","relative_url","url","has","add","bootstrap","module","default","import","then"],"mappings":"6FAMA,MAAMA,EAAY,GAGZC,EAAY,IAAIC,QAIhBC,EAAkBC,IAEpB,MADAC,EAAOD,GACD,IAAIE,MAAMF,IAGdG,EAAa,EAAGC,YAAcC,cAAgBA,EAEpD,IAAIC,GAAW,EAEf,IAAK,MAAMC,KAAQC,EAAMC,OAAQ,CAC7B,MAAMC,EAAW,gBAAgBH,iBAAoBA,qBACrDX,EAAUe,KAAKD,GACfE,EAAeC,IAAIH,EAAUI,MAAOC,IAEhC,MAAMC,EAAYC,SAASC,iBAAiBtB,EAAUuB,KAAK,MAe3D,GAdI,GAAGC,OAAOC,KAAKL,EAAWb,GAAYmB,OAAS,GAC/CvB,EAAe,uCAGfO,IACAA,GAAW,EACXW,SAASM,KAAKC,OACVC,OAAOC,OAAOT,SAASU,cAAc,QAAS,CAC1CC,IAAK,aACLC,KAAMC,EAAa,0BAA2BC,SAKtDlC,EAAUmC,IAAIjB,GAAU,OAC5BlB,EAAUoC,IAAIlB,GAEd,MAAMmB,EAAaC,GAAWA,EAAOC,QAAQrB,GAIhC,QAATR,QACM8B,OAAiC,qBAAwBC,KAC3DJ,SAGEG,OAAiC,oBAAuBC,KAC1DJ,IAIhB"}
|
package/package.json
CHANGED
package/src/core.css
CHANGED
package/src/plugins/py-editor.js
CHANGED
|
@@ -445,7 +445,8 @@ const init = async (script, type, interpreter) => {
|
|
|
445
445
|
const rows = script.getAttribute("rows");
|
|
446
446
|
if (rows) {
|
|
447
447
|
const maxHeight = Math.floor(parseInt(rows) * 18.5) + "px";
|
|
448
|
-
|
|
448
|
+
const minHeight = Math.floor(3 * 18.5) + "px";
|
|
449
|
+
styles.push(`.cm-editor { height: auto; max-height: ${maxHeight}; min-height: ${minHeight}; }`);
|
|
449
450
|
}
|
|
450
451
|
parent.innerHTML = `<style>${styles.join("\n")}</style>`;
|
|
451
452
|
|