onejs-core 3.0.0 → 3.0.2

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.
@@ -71,6 +71,7 @@ type OverflowClipBox = CS.UnityEngine.UIElements.OverflowClipBox;
71
71
  type Visibility = CS.UnityEngine.UIElements.Visibility;
72
72
  type WhiteSpace = CS.UnityEngine.UIElements.WhiteSpace;
73
73
  type TextOverflowPosition = CS.UnityEngine.UIElements.TextOverflowPosition;
74
+ type FilterFunction = CS.UnityEngine.UIElements.FilterFunction;
74
75
 
75
76
  declare namespace CS.OneJS.Dom {
76
77
 
@@ -104,6 +105,7 @@ declare namespace CS.OneJS.Dom {
104
105
  color: StyleColor | Color | string | null | number[] | float4;
105
106
  cursor: StyleCursor | Cursor | null;
106
107
  display: StyleEnum<DisplayStyle> | DisplayStyle | string | null | number;
108
+ filter: StyleList<FilterFunction> | FilterFunction | string | null;
107
109
  flexBasis: StyleLength | Length | string | null | number;
108
110
  flexDirection: StyleEnum<FlexDirection> | FlexDirection | string | null | number;
109
111
  flexGrow: StyleFloat | number | string | null;
package/dist/index.js CHANGED
@@ -36,7 +36,8 @@ export { emo } from "./styling/index";
36
36
  if (typeof globalThis.___document != "undefined") {
37
37
  // @ts-ignore
38
38
  globalThis.onejsDocument = new DocumentWrapper(globalThis.___document);
39
- if (!globalThis.ONEJS_WEBGL) {
39
+ // @ts-ignore
40
+ if (!globalThis.ONEJS_WEBGL && !globalThis.document) {
40
41
  // @ts-ignore
41
42
  globalThis.document = globalThis.onejsDocument;
42
43
  }
@@ -8,7 +8,7 @@ export function hashAndAddRuntimeUSS(style) {
8
8
  return compId;
9
9
  style = `.${compId} {${style}}`;
10
10
  style = flatten(style);
11
- document.addRuntimeUSS(style);
11
+ globalThis.___document.addRuntimeUSS(style);
12
12
  _pastCompIds.add(compId);
13
13
  return compId;
14
14
  }
package/index.ts CHANGED
@@ -50,7 +50,8 @@ declare global {
50
50
  if (typeof globalThis.___document != "undefined") {
51
51
  // @ts-ignore
52
52
  globalThis.onejsDocument = new DocumentWrapper(globalThis.___document)
53
- if (!globalThis.ONEJS_WEBGL) {
53
+ // @ts-ignore
54
+ if (!globalThis.ONEJS_WEBGL && !globalThis.document) {
54
55
  // @ts-ignore
55
56
  globalThis.document = globalThis.onejsDocument
56
57
  }
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": "3.0.0",
4
+ "version": "3.0.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/Singtaa/onejs-core"
package/styling/index.tsx CHANGED
@@ -10,7 +10,7 @@ export function hashAndAddRuntimeUSS(style: string) {
10
10
  return compId
11
11
  style = `.${compId} {${style}}`
12
12
  style = flatten(style)
13
- document.addRuntimeUSS(style)
13
+ globalThis.___document.addRuntimeUSS(style)
14
14
  _pastCompIds.add(compId)
15
15
 
16
16
  return compId