onejs-core 0.3.45 → 1.0.6

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.
@@ -14,6 +14,13 @@ declare namespace CS {
14
14
  // }
15
15
  // interface $Task<T> {}
16
16
  namespace OneJS {
17
+ class WebApi extends System.Object
18
+ {
19
+ protected [__keep_incompatibility]: never;
20
+ public static getText ($uri: string, $callback: System.Action$1<string>) : UnityEngine.Coroutine
21
+ public static getImage ($uri: string, $callback: System.Action$1<UnityEngine.Texture2D>) : UnityEngine.Coroutine
22
+ public constructor ()
23
+ }
17
24
  class EventfulPropertyAttribute extends System.Attribute implements System.Runtime.InteropServices._Attribute
18
25
  {
19
26
  protected [__keep_incompatibility]: never;
@@ -284,6 +291,7 @@ declare namespace CS {
284
291
  {
285
292
  protected [__keep_incompatibility]: never;
286
293
  public get veStyle(): UnityEngine.UIElements.IStyle;
294
+ public getProperty ($key: string) : any
287
295
  public setProperty ($key: string, $value: any) : void
288
296
  public SetAlignContent ($value: UnityEngine.UIElements.Align) : void
289
297
  public SetAlignItems ($value: UnityEngine.UIElements.Align) : void
@@ -399,6 +407,14 @@ declare namespace CS {
399
407
  public set Colors(value: System.Array$1<UnityEngine.Color>);
400
408
  public constructor ()
401
409
  }
410
+ class Img extends UnityEngine.UIElements.VisualElement implements UnityEngine.UIElements.Experimental.ITransitionAnimations, UnityEngine.UIElements.IVisualElementScheduler, UnityEngine.UIElements.IResolvedStyle, UnityEngine.UIElements.IStylePropertyAnimations, UnityEngine.UIElements.IEventHandler, UnityEngine.UIElements.IExperimentalFeatures, UnityEngine.UIElements.ITransform
411
+ {
412
+ protected [__keep_incompatibility]: never;
413
+ public get Src(): string;
414
+ public set Src(value: string);
415
+ public SetSrc ($src: string) : void
416
+ public constructor ()
417
+ }
402
418
  }
403
419
  namespace OneJS.EngineHost {
404
420
  interface ActionCallback
@@ -469,6 +469,10 @@ declare global {
469
469
  * OneJS Elements
470
470
  */
471
471
 
472
+ interface Img extends Image {
473
+ src?: string
474
+ }
475
+
472
476
  interface GradientRect extends VisualElement {
473
477
  colors?: Color[]
474
478
  }
@@ -527,8 +531,9 @@ declare global {
527
531
  dropdownfield: DropdownField
528
532
 
529
533
  // /* OneJS Custom */
534
+ img: Img
530
535
  gradientrect: GradientRect
531
- // flipbook: Flipbook
536
+ flipbook: Flipbook
532
537
  // simplelistview: SimpleListView
533
538
  }
534
539
  }
@@ -5,7 +5,10 @@ interface ElementCreationOptions {
5
5
  export declare class DocumentWrapper {
6
6
  #private;
7
7
  get _doc(): CS.OneJS.Dom.Document;
8
- get body(): DomWrapper;
8
+ /**
9
+ * The body/root element of the document. Will be null for Editor documents.
10
+ */
11
+ get body(): DomWrapper | null;
9
12
  constructor(doc: CS.OneJS.Dom.Document);
10
13
  addRuntimeUSS(uss: string): void;
11
14
  clearRuntimeStyleSheets(): void;
@@ -3,11 +3,13 @@ export class DocumentWrapper {
3
3
  get _doc() { return this.#doc; }
4
4
  #doc;
5
5
  #body;
6
+ /**
7
+ * The body/root element of the document. Will be null for Editor documents.
8
+ */
6
9
  get body() { return this.#body; }
7
10
  constructor(doc) {
8
11
  this.#doc = doc;
9
- if (doc.body)
10
- this.#body = new DomWrapper(doc.body);
12
+ this.#body = doc.body ? new DomWrapper(doc.body) : null;
11
13
  }
12
14
  addRuntimeUSS(uss) {
13
15
  this.#doc.addRuntimeUSS(uss);
@@ -1,6 +1,7 @@
1
1
  export declare class DomStyleWrapper implements CS.OneJS.Dom.DomStyle {
2
2
  _domStyle: CS.OneJS.Dom.DomStyle;
3
3
  constructor(domStyle: CS.OneJS.Dom.DomStyle);
4
+ getProperty(name: string): any;
4
5
  setProperty(name: string, value: any): void;
5
6
  }
6
7
  export interface DomStyleWrapper extends CS.OneJS.Dom.DomStyle {
@@ -8,10 +8,13 @@ export class DomStyleWrapper {
8
8
  return true;
9
9
  },
10
10
  get(target, prop) {
11
- return target[prop];
11
+ return target.getProperty(prop);
12
12
  }
13
13
  });
14
14
  }
15
+ getProperty(name) {
16
+ return this._domStyle.getProperty(name);
17
+ }
15
18
  setProperty(name, value) {
16
19
  this._domStyle.setProperty(name, value);
17
20
  }
package/dist/index.js CHANGED
@@ -37,10 +37,3 @@ if (typeof ___document != "undefined") {
37
37
  // @ts-ignore
38
38
  globalThis.document = new DocumentWrapper(___document);
39
39
  }
40
- // @ts-ignore
41
- CS.OneJS.EngineHost.prototype.sub = function (a, b, c) {
42
- let unsubscribe = c ? this.subscribe(a, b, c) : this.subscribe(a, b);
43
- return () => {
44
- unsubscribe.Invoke();
45
- };
46
- };
package/dom/dom-style.ts CHANGED
@@ -12,11 +12,15 @@ export class DomStyleWrapper implements CS.OneJS.Dom.DomStyle {
12
12
  return true;
13
13
  },
14
14
  get(target, prop) {
15
- return target[prop];
15
+ return target.getProperty(prop as string);
16
16
  }
17
17
  })
18
18
  }
19
19
 
20
+ getProperty(name: string) {
21
+ return this._domStyle.getProperty(name)
22
+ }
23
+
20
24
  setProperty(name: string, value: any) {
21
25
  this._domStyle.setProperty(name, value)
22
26
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "onejs-core",
3
3
  "description": "The JS part of OneJS, a UI framework and Scripting Engine for Unity.",
4
- "version": "0.3.45",
4
+ "version": "1.0.6",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./typings.d.ts",
7
7
  "dependencies": {