onejs-core 0.3.44 → 0.3.45
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/definitions/Assemblies/OneJS.Runtime.d.ts +1 -0
- package/dom/document.ts +6 -4
- package/index.ts +0 -8
- package/package.json +1 -1
|
@@ -262,6 +262,7 @@ declare namespace CS {
|
|
|
262
262
|
public createTextNode ($text: string) : OneJS.Dom.Dom
|
|
263
263
|
public getElementById ($id: string) : OneJS.Dom.Dom
|
|
264
264
|
public querySelectorAll ($selector: string) : System.Array$1<OneJS.Dom.Dom>
|
|
265
|
+
public getDomFromVE ($ve: UnityEngine.UIElements.VisualElement) : OneJS.Dom.Dom
|
|
265
266
|
public loadImage ($path: string, $filterMode?: UnityEngine.FilterMode) : UnityEngine.Texture2D
|
|
266
267
|
public loadFont ($path: string) : UnityEngine.Font
|
|
267
268
|
public loadFontDefinition ($path: string) : UnityEngine.UIElements.FontDefinition
|
package/dom/document.ts
CHANGED
|
@@ -8,14 +8,16 @@ export class DocumentWrapper {
|
|
|
8
8
|
public get _doc(): CS.OneJS.Dom.Document { return this.#doc }
|
|
9
9
|
|
|
10
10
|
#doc: CS.OneJS.Dom.Document;
|
|
11
|
-
#body: DomWrapper;
|
|
11
|
+
#body: DomWrapper | null;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The body/root element of the document. Will be null for Editor documents.
|
|
15
|
+
*/
|
|
16
|
+
public get body(): DomWrapper | null { return this.#body }
|
|
14
17
|
|
|
15
18
|
constructor(doc: CS.OneJS.Dom.Document) {
|
|
16
19
|
this.#doc = doc
|
|
17
|
-
|
|
18
|
-
this.#body = new DomWrapper(doc.body)
|
|
20
|
+
this.#body = doc.body ? new DomWrapper(doc.body) : null
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
addRuntimeUSS(uss: string): void {
|
package/index.ts
CHANGED
|
@@ -49,12 +49,4 @@ declare global {
|
|
|
49
49
|
if (typeof ___document != "undefined") {
|
|
50
50
|
// @ts-ignore
|
|
51
51
|
globalThis.document = new DocumentWrapper(___document)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
CS.OneJS.EngineHost.prototype.sub = function (a, b, c) {
|
|
56
|
-
let unsubscribe = c ? this.subscribe(a, b, c) : this.subscribe(a, b)
|
|
57
|
-
return () => {
|
|
58
|
-
unsubscribe.Invoke()
|
|
59
|
-
}
|
|
60
52
|
}
|
package/package.json
CHANGED