canvasengine 2.0.0-beta.29 → 2.0.0-beta.30
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/{DebugRenderer-DhQSLsCe.js → DebugRenderer-DcvJLrrD.js} +2 -2
- package/dist/{DebugRenderer-DhQSLsCe.js.map → DebugRenderer-DcvJLrrD.js.map} +1 -1
- package/dist/engine/signal.d.ts +1 -1
- package/dist/engine/signal.d.ts.map +1 -1
- package/dist/{index-DQHrtntP.js → index-C-iY-lCt.js} +459 -459
- package/dist/index-C-iY-lCt.js.map +1 -0
- package/dist/index.global.js +6 -6
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/engine/signal.ts +18 -2
- package/dist/index-DQHrtntP.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as a } from "./index-
|
|
2
|
-
import { A as r, B as n, w as o, C as c, m as l, l as p, D as S, v as m, a5 as u, a4 as g, a2 as b, n as d, G as C, c as j, M as T, N as E, O, P as f, a3 as v, R as w, o as h, p as D, S as P, q as k, r as x, T as y, b as A, V as H, t as M, a1 as V, a0 as B, _ as G, d as N, J as R, H as q, K as U, e as z, W as I, $ as J, f as K, g as L, x as Q, j as W, i as X, y as Y, k as Z, X as _, I as $, Q as F, L as aa, Z as sa, z as ea, s as ta, U as ia, Y as ra, a as na, u as oa } from "./index-
|
|
1
|
+
import { h as a } from "./index-C-iY-lCt.js";
|
|
2
|
+
import { A as r, B as n, w as o, C as c, m as l, l as p, D as S, v as m, a5 as u, a4 as g, a2 as b, n as d, G as C, c as j, M as T, N as E, O, P as f, a3 as v, R as w, o as h, p as D, S as P, q as k, r as x, T as y, b as A, V as H, t as M, a1 as V, a0 as B, _ as G, d as N, J as R, H as q, K as U, e as z, W as I, $ as J, f as K, g as L, x as Q, j as W, i as X, y as Y, k as Z, X as _, I as $, Q as F, L as aa, Z as sa, z as ea, s as ta, U as ia, Y as ra, a as na, u as oa } from "./index-C-iY-lCt.js";
|
|
3
3
|
const e = a.Howler;
|
|
4
4
|
export {
|
|
5
5
|
r as ArraySubject,
|
package/package.json
CHANGED
package/src/engine/signal.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
} from "rxjs";
|
|
4
4
|
import type { Element } from "./reactive";
|
|
5
5
|
import { Tick } from "../directives/Scheduler";
|
|
6
|
+
import { Container } from "../components";
|
|
6
7
|
|
|
7
8
|
type MountFunction = (fn: (element: Element) => void) => void;
|
|
8
9
|
|
|
@@ -91,7 +92,7 @@ export function tick(fn: (tickValue: Tick, element: Element) => void) {
|
|
|
91
92
|
* ```
|
|
92
93
|
*/
|
|
93
94
|
export function h<C extends ComponentFunction<any>>(
|
|
94
|
-
componentFunction: C,
|
|
95
|
+
componentFunction: C | Element,
|
|
95
96
|
props: Parameters<C>[0] = {} as Parameters<C>[0],
|
|
96
97
|
...children: any[]
|
|
97
98
|
): ReturnType<C> {
|
|
@@ -110,7 +111,22 @@ export function h<C extends ComponentFunction<any>>(
|
|
|
110
111
|
children = children[0]
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
let component
|
|
114
|
+
let component: Element
|
|
115
|
+
|
|
116
|
+
if (Array.isArray(componentFunction)) {
|
|
117
|
+
if (componentFunction.length === 1) {
|
|
118
|
+
component = componentFunction[0]
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
component = h(Container, {}, ...componentFunction) as Element
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else if ('tag' in componentFunction) {
|
|
125
|
+
component = componentFunction
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
component = componentFunction({ ...props, children }) as Element;
|
|
129
|
+
}
|
|
114
130
|
|
|
115
131
|
if (!component) {
|
|
116
132
|
component = {} as any
|