Fix #1538 - use same customElements Registry utilities (#1542)

This commit is contained in:
Andrea Giammarchi
2023-06-16 15:34:05 +02:00
committed by GitHub
parent 6df5905b2b
commit bccd5e3750
8 changed files with 194 additions and 113 deletions

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Plugins</title>
<style>
py-script {
lua-script {
display: none;
}
</style>
@@ -13,9 +13,9 @@
{ "imports": { "@pyscript/core": "../../min.js" } }
</script>
<script type="module">
import { registerPlugin } from "@pyscript/core";
registerPlugin("lua-script", {
type: "wasmoon",
import { define } from "@pyscript/core";
define("lua", {
interpreter: "wasmoon",
async onRuntimeReady(wasmoon, element) {
// Somehow this doesn't work in Wasmoon
wasmoon.io.stdout = (message) => {
@@ -29,6 +29,8 @@
</script>
</head>
<body>
<lua-script> print('Hello Console!') </lua-script>
<lua-script lua-click="print(event.type)">
print('Hello Console!')
</lua-script>
</body>
</html>