@joystick.js/test-canary 0.0.0-canary.31 → 0.0.0-canary.32
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 +1,8 @@
|
|
|
1
|
-
import{parseHTML as a}from"linkedom";import
|
|
1
|
+
import{parseHTML as a}from"linkedom";import d from"@joystick.js/ui-canary";import c from"./event.js";import s from"../load/index.js";const p=()=>{const o=a(`
|
|
2
|
+
<html>
|
|
3
|
+
<head></head>
|
|
4
|
+
<body>
|
|
5
|
+
<div id="app"></div>
|
|
6
|
+
</body>
|
|
7
|
+
</html>
|
|
8
|
+
`),{window:t,document:e,Element:n,Event:l,HTMLElement:r}=o;return global.window=t,global.document=e,global.HTMLElement=r,global.Element=n,global.Event=l,global.console={log:console.log,warn:console.warn,error:console.error},o};var g=async(o="",t={})=>{const e=p();window.joystick={};const n=await s(o,{default:!0}),l=d.mount(n,t?.props||{},document.querySelector("#app"));return{...e,component:l,test:{event:(r="",m="")=>c(r,m,e)}}};export{g as default};
|
package/package.json
CHANGED
|
@@ -5,7 +5,14 @@ import event from './event.js';
|
|
|
5
5
|
import load from "../load/index.js";
|
|
6
6
|
|
|
7
7
|
const loadDOM = () => {
|
|
8
|
-
const dom = parseHTML(
|
|
8
|
+
const dom = parseHTML(`
|
|
9
|
+
<html>
|
|
10
|
+
<head></head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="app"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
15
|
+
`);
|
|
9
16
|
const { window, document, Element, Event, HTMLElement } = dom;
|
|
10
17
|
|
|
11
18
|
global.window = window;
|