@reactunity/renderer 0.10.1 → 0.13.0

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.
Files changed (51) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/src/helpers/icons.d.ts +7 -0
  4. package/dist/src/helpers/icons.js +29 -0
  5. package/dist/src/models/base.d.ts +10 -7
  6. package/dist/src/models/editor/jsx.d.ts +10 -1
  7. package/dist/src/models/environment/index.d.ts +3 -0
  8. package/dist/src/models/generated/editor.d.ts +698 -262
  9. package/dist/src/models/generated/editor.js +1 -1
  10. package/dist/src/models/generated/react.d.ts +2134 -800
  11. package/dist/src/models/generated/react.js +1 -1
  12. package/dist/src/models/generated/system.d.ts +148 -148
  13. package/dist/src/models/generated/system.js +1 -1
  14. package/dist/src/models/generated/tests.js +1 -1
  15. package/dist/src/models/generated/unity.d.ts +12737 -7216
  16. package/dist/src/models/generated/unity.js +2 -2
  17. package/dist/src/models/generated/yoga.d.ts +22 -12
  18. package/dist/src/models/generated/yoga.js +1 -1
  19. package/dist/src/models/properties/styles.d.ts +5 -4
  20. package/dist/src/models/properties/values.d.ts +7 -0
  21. package/dist/src/models/properties/yoga-enums.d.ts +1 -1
  22. package/dist/src/models/properties/yoga.d.ts +12 -10
  23. package/dist/src/models/richtext.d.ts +65 -0
  24. package/dist/src/models/richtext.js +2 -0
  25. package/dist/src/models/svg.d.ts +68 -0
  26. package/dist/src/models/svg.js +1 -0
  27. package/dist/src/models/ugui/components.d.ts +13 -7
  28. package/dist/src/models/ugui/events.d.ts +1 -0
  29. package/dist/src/models/ugui/jsx.d.ts +10 -1
  30. package/dist/src/models/uitoolkit/components.d.ts +3 -1
  31. package/dist/src/models/uitoolkit/jsx.d.ts +9 -0
  32. package/dist/src/renderer/async/callbacks.js +22 -8
  33. package/dist/src/renderer/async/reconciler.d.ts +1 -7
  34. package/dist/src/renderer/async/reconciler.js +204 -26
  35. package/dist/src/renderer/async/types.d.ts +31 -5
  36. package/dist/src/renderer/constants.d.ts +5 -0
  37. package/dist/src/renderer/constants.js +12 -0
  38. package/dist/src/renderer/diffing.js +1 -1
  39. package/dist/src/renderer/renderer.d.ts +11 -10
  40. package/dist/src/renderer/renderer.js +6 -9
  41. package/dist/src/renderer/subcontexts/index.d.ts +6 -0
  42. package/dist/src/renderer/subcontexts/index.js +6 -0
  43. package/dist/src/renderer/subcontexts/richtext.d.ts +3 -0
  44. package/dist/src/renderer/subcontexts/richtext.js +52 -0
  45. package/dist/src/renderer/subcontexts/svg.d.ts +3 -0
  46. package/dist/src/renderer/subcontexts/svg.js +70 -0
  47. package/dist/src/version.d.ts +1 -1
  48. package/dist/src/version.js +1 -1
  49. package/package.json +6 -6
  50. package/dist/src/helpers/styled-components-helper.d.ts +0 -7
  51. package/dist/src/helpers/styled-components-helper.js +0 -16
@@ -1,6 +1,6 @@
1
1
  //
2
- // Types in assemblies: UnityEngine.CoreModule, UnityEngine.VideoModule, UnityEngine.AudioModule, UnityEngine.UIModule, UnityEngine.UI, UnityEngine.TextRenderingModule, UnityEngine.AnimationModule, UnityEngine.IMGUIModule, UnityEngine.AssetBundleModule, UnityEngine.UnityAnalyticsModule, UnityEngine.UIElementsModule, UnityEngine.AIModule, UnityEngine.TestRunner, UnityEngine.TextCoreFontEngineModule, UnityEngine.TextCoreTextEngineModule, UnityEngine.XRModule, UnityEngine.PhysicsModule, UnityEngine.InputLegacyModule, UnityEngine.UI, Unity.InputSystem, Unity.InputSystem
3
- // Generated 11/07/2021 17:46:37
2
+ // Types in assemblies: UnityEngine.CoreModule, UnityEngine.VideoModule, UnityEngine.AudioModule, UnityEngine.UIModule, UnityEngine.UI, UnityEngine.TextRenderingModule, UnityEngine.AnimationModule, UnityEngine.IMGUIModule, UnityEngine.AssetBundleModule, UnityEngine.UnityAnalyticsModule, UnityEngine.UIElementsModule, UnityEngine.ParticleSystemModule, UnityEngine.UIElementsNativeModule, UnityEngine.AIModule, UnityEngine.TestRunner, UnityEngine.TextCoreFontEngineModule, UnityEngine.TextCoreTextEngineModule, UnityEngine.XRModule, UnityEngine.PhysicsModule, UnityEngine.InputLegacyModule, UnityEngine.UI, Unity.InputSystem, Unity.InputSystem
3
+ // Generated 30/06/2022 20:21:30
4
4
  //
5
5
  /* eslint-disable */
6
6
  export {};
@@ -6,7 +6,7 @@ export declare namespace Facebook {
6
6
  Method: System.Reflection.MethodInfo;
7
7
  Target: any;
8
8
  Invoke(node: Facebook.Yoga.YogaNode, width: number, height: number): number;
9
- BeginInvoke(node: Facebook.Yoga.YogaNode, width: number, height: number, callback: System.AsyncCallback, object: any): System.IAsyncResult;
9
+ BeginInvoke(node: Facebook.Yoga.YogaNode, width: number, height: number, callback: ((ar: System.IAsyncResult) => void), object: any): System.IAsyncResult;
10
10
  EndInvoke(result: System.IAsyncResult): number;
11
11
  GetObjectData(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext): void;
12
12
  Equals(obj: any): boolean;
@@ -22,7 +22,7 @@ export declare namespace Facebook {
22
22
  Method: System.Reflection.MethodInfo;
23
23
  Target: any;
24
24
  Invoke(config: Facebook.Yoga.YogaConfig, node: Facebook.Yoga.YogaNode, level: Facebook.Yoga.YogaLogLevel, message: string): void;
25
- BeginInvoke(config: Facebook.Yoga.YogaConfig, node: Facebook.Yoga.YogaNode, level: Facebook.Yoga.YogaLogLevel, message: string, callback: System.AsyncCallback, object: any): System.IAsyncResult;
25
+ BeginInvoke(config: Facebook.Yoga.YogaConfig, node: Facebook.Yoga.YogaNode, level: Facebook.Yoga.YogaLogLevel, message: string, callback: ((ar: System.IAsyncResult) => void), object: any): System.IAsyncResult;
26
26
  EndInvoke(result: System.IAsyncResult): void;
27
27
  GetObjectData(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext): void;
28
28
  Equals(obj: any): boolean;
@@ -38,7 +38,7 @@ export declare namespace Facebook {
38
38
  Method: System.Reflection.MethodInfo;
39
39
  Target: any;
40
40
  Invoke(node: Facebook.Yoga.YogaNode, width: number, widthMode: Facebook.Yoga.YogaMeasureMode, height: number, heightMode: Facebook.Yoga.YogaMeasureMode): Facebook.Yoga.YogaSize;
41
- BeginInvoke(node: Facebook.Yoga.YogaNode, width: number, widthMode: Facebook.Yoga.YogaMeasureMode, height: number, heightMode: Facebook.Yoga.YogaMeasureMode, callback: System.AsyncCallback, object: any): System.IAsyncResult;
41
+ BeginInvoke(node: Facebook.Yoga.YogaNode, width: number, widthMode: Facebook.Yoga.YogaMeasureMode, height: number, heightMode: Facebook.Yoga.YogaMeasureMode, callback: ((ar: System.IAsyncResult) => void), object: any): System.IAsyncResult;
42
42
  EndInvoke(result: System.IAsyncResult): Facebook.Yoga.YogaSize;
43
43
  GetObjectData(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext): void;
44
44
  Equals(obj: any): boolean;
@@ -72,7 +72,7 @@ export declare namespace Facebook {
72
72
  Method: System.Reflection.MethodInfo;
73
73
  Target: any;
74
74
  Invoke(unmanagedNodePtr: System.IntPtr, width: number, height: number): number;
75
- BeginInvoke(unmanagedNodePtr: System.IntPtr, width: number, height: number, callback: System.AsyncCallback, object: any): System.IAsyncResult;
75
+ BeginInvoke(unmanagedNodePtr: System.IntPtr, width: number, height: number, callback: ((ar: System.IAsyncResult) => void), object: any): System.IAsyncResult;
76
76
  EndInvoke(result: System.IAsyncResult): number;
77
77
  GetObjectData(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext): void;
78
78
  Equals(obj: any): boolean;
@@ -85,13 +85,13 @@ export declare namespace Facebook {
85
85
  }
86
86
  class YogaConfig {
87
87
  constructor();
88
- Logger: Facebook.Yoga.Logger;
88
+ Logger: ((config: Facebook.Yoga.YogaConfig, node: Facebook.Yoga.YogaNode, level: Facebook.Yoga.YogaLogLevel, message: string) => void);
89
89
  UseWebDefaults: boolean;
90
90
  PointScaleFactor: number;
91
91
  SetExperimentalFeatureEnabled(feature: Facebook.Yoga.YogaExperimentalFeature, enabled: boolean): void;
92
92
  IsExperimentalFeatureEnabled(feature: Facebook.Yoga.YogaExperimentalFeature): boolean;
93
93
  static GetInstanceCount(): number;
94
- static SetDefaultLogger(logger: Facebook.Yoga.Logger): void;
94
+ static SetDefaultLogger(logger: ((config: Facebook.Yoga.YogaConfig, node: Facebook.Yoga.YogaNode, level: Facebook.Yoga.YogaLogLevel, message: string) => void)): void;
95
95
  Equals(obj: any): boolean;
96
96
  GetHashCode(): number;
97
97
  GetType(): System.Type;
@@ -139,6 +139,11 @@ export declare namespace Facebook {
139
139
  Row = 2,
140
140
  RowReverse = 3
141
141
  }
142
+ enum YogaGap {
143
+ Column = 0,
144
+ Row = 1,
145
+ All = 2
146
+ }
142
147
  enum YogaJustify {
143
148
  FlexStart = 0,
144
149
  Center = 1,
@@ -152,7 +157,7 @@ export declare namespace Facebook {
152
157
  Method: System.Reflection.MethodInfo;
153
158
  Target: any;
154
159
  Invoke(unmanagedConfigPtr: System.IntPtr, unmanagedNotePtr: System.IntPtr, level: Facebook.Yoga.YogaLogLevel, message: string): void;
155
- BeginInvoke(unmanagedConfigPtr: System.IntPtr, unmanagedNotePtr: System.IntPtr, level: Facebook.Yoga.YogaLogLevel, message: string, callback: System.AsyncCallback, object: any): System.IAsyncResult;
160
+ BeginInvoke(unmanagedConfigPtr: System.IntPtr, unmanagedNotePtr: System.IntPtr, level: Facebook.Yoga.YogaLogLevel, message: string, callback: ((ar: System.IAsyncResult) => void), object: any): System.IAsyncResult;
156
161
  EndInvoke(result: System.IAsyncResult): void;
157
162
  GetObjectData(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext): void;
158
163
  Equals(obj: any): boolean;
@@ -176,7 +181,7 @@ export declare namespace Facebook {
176
181
  Method: System.Reflection.MethodInfo;
177
182
  Target: any;
178
183
  Invoke(unmanagedNodePtr: System.IntPtr, width: number, widthMode: Facebook.Yoga.YogaMeasureMode, height: number, heightMode: Facebook.Yoga.YogaMeasureMode): Facebook.Yoga.YogaSize;
179
- BeginInvoke(unmanagedNodePtr: System.IntPtr, width: number, widthMode: Facebook.Yoga.YogaMeasureMode, height: number, heightMode: Facebook.Yoga.YogaMeasureMode, callback: System.AsyncCallback, object: any): System.IAsyncResult;
184
+ BeginInvoke(unmanagedNodePtr: System.IntPtr, width: number, widthMode: Facebook.Yoga.YogaMeasureMode, height: number, heightMode: Facebook.Yoga.YogaMeasureMode, callback: ((ar: System.IAsyncResult) => void), object: any): System.IAsyncResult;
180
185
  EndInvoke(result: System.IAsyncResult): Facebook.Yoga.YogaSize;
181
186
  GetObjectData(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext): void;
182
187
  Equals(obj: any): boolean;
@@ -260,6 +265,9 @@ export declare namespace Facebook {
260
265
  BorderStartWidth: number;
261
266
  BorderEndWidth: number;
262
267
  BorderWidth: number;
268
+ Gap: number;
269
+ RowGap: number;
270
+ ColumnGap: number;
263
271
  LayoutMarginLeft: number;
264
272
  LayoutMarginTop: number;
265
273
  LayoutMarginRight: number;
@@ -284,8 +292,8 @@ export declare namespace Facebook {
284
292
  RemoveChild(child: Facebook.Yoga.YogaNode): void;
285
293
  Clear(): void;
286
294
  IndexOf(node: Facebook.Yoga.YogaNode): number;
287
- SetMeasureFunction(measureFunction: Facebook.Yoga.MeasureFunction): void;
288
- SetBaselineFunction(baselineFunction: Facebook.Yoga.BaselineFunction): void;
295
+ SetMeasureFunction(measureFunction: ((node: Facebook.Yoga.YogaNode, width: number, widthMode: Facebook.Yoga.YogaMeasureMode, height: number, heightMode: Facebook.Yoga.YogaMeasureMode) => Facebook.Yoga.YogaSize)): void;
296
+ SetBaselineFunction(baselineFunction: ((node: Facebook.Yoga.YogaNode, width: number, height: number) => number)): void;
289
297
  CalculateLayout(width?: number, height?: number): void;
290
298
  Print(options?: Facebook.Yoga.YogaPrintOptions): string;
291
299
  GetEnumerator(): System.Collections.Generic.IEnumerator<Facebook.Yoga.YogaNode>;
@@ -304,8 +312,10 @@ export declare namespace Facebook {
304
312
  Scroll = 2
305
313
  }
306
314
  enum YogaPositionType {
307
- Relative = 0,
308
- Absolute = 1
315
+ Default = 1,
316
+ Static = 0,
317
+ Relative = 1,
318
+ Absolute = 2
309
319
  }
310
320
  enum YogaPrintOptions {
311
321
  Layout = 1,
@@ -1,6 +1,6 @@
1
1
  //
2
2
  // Types in assemblies: Facebook.Yoga
3
- // Generated 18/09/2021 23:11:55
3
+ // Generated 30/06/2022 20:21:41
4
4
  //
5
5
  /* eslint-disable */
6
6
  export {};
@@ -1,5 +1,5 @@
1
1
  import { AnimationDirection, AnimationFillMode, AnimationPlayState, Appearance, BackgroundBlendMode, BackgroundSize, CursorType, FontStyles, FontWeight, NavigationMode, ObjectFit, PointerEvents, TextAlign, TextOverflowModes, TextTransform, TimingFunctionType, Visibility, WhiteSpace } from './styles-enums';
2
- import { Array2Aux, AssetReference, ColorAux, NumberAux, Vector2Aux, Vector3Aux } from './values';
2
+ import { Array2Aux, AssetReference, AssetReferenceOrHttp, ColorAux, NumberAux, Vector2Aux, Vector3Aux } from './values';
3
3
  import { YogaValue2Aux, YogaValueAux } from './yoga';
4
4
  export interface RenderStyle {
5
5
  opacity?: NumberAux;
@@ -13,13 +13,13 @@ export interface RenderStyle {
13
13
  navigation?: NavigationMode;
14
14
  backgroundBlendMode?: BackgroundBlendMode;
15
15
  backgroundColor?: ColorAux;
16
- backgroundImage?: AssetReference;
16
+ backgroundImage?: AssetReferenceOrHttp;
17
17
  backgroundPositionX?: YogaValueAux;
18
18
  backgroundPositionY?: YogaValueAux;
19
19
  backgroundSize?: BackgroundSize | YogaValue2Aux;
20
20
  backgroundRepeatX?: YogaValueAux;
21
21
  backgroundRepeatY?: YogaValueAux;
22
- maskImage?: AssetReference;
22
+ maskImage?: AssetReferenceOrHttp;
23
23
  maskPositionX?: YogaValueAux;
24
24
  maskPositionY?: YogaValueAux;
25
25
  maskSize?: BackgroundSize | YogaValue2Aux;
@@ -75,7 +75,7 @@ export interface RenderStyle {
75
75
  animationName?: string | string;
76
76
  animationPlayState?: AnimationPlayState | string;
77
77
  animationTimingFunction?: TimingFunctionType | string;
78
- audioClip?: AssetReference;
78
+ audioClip?: AssetReferenceOrHttp;
79
79
  audioIterationCount?: number | string;
80
80
  audioDelay?: number | string;
81
81
  all?: string;
@@ -103,5 +103,6 @@ export interface RenderStyle {
103
103
  motion?: string;
104
104
  audio?: string;
105
105
  transform?: string;
106
+ gap?: string | number;
106
107
  [variable: `--${string}`]: any;
107
108
  }
@@ -13,5 +13,12 @@ export declare type KnownColor = keyof KnownColors;
13
13
  export declare type HexColor = string;
14
14
  export declare type ColorAux = KnownColor | HexColor | number | Array4Aux<number> | UnityEngine.Color;
15
15
  export declare type NumberAux = string | number;
16
+ export declare type HttpSource = {
17
+ url: string;
18
+ body?: string;
19
+ headers?: Record<string, string>;
20
+ method?: string;
21
+ };
16
22
  export declare type AssetReference = string | UnityEngine.Object;
23
+ export declare type AssetReferenceOrHttp = AssetReference | HttpSource;
17
24
  export {};
@@ -3,6 +3,6 @@ export declare type YogaAlign = 'auto' | 'flex-start' | 'center' | 'flex-end' |
3
3
  export declare type YogaJustify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around';
4
4
  export declare type Display = 'flex' | 'none';
5
5
  export declare type Wrap = 'no-wrap' | 'wrap' | 'wrap-reverse';
6
- export declare type Position = 'relative' | 'absolute' | 'fixed' | 'static' | 'sticky';
6
+ export declare type Position = 'relative' | 'absolute' | 'fixed' | 'static' | 'sticky' | 'inset';
7
7
  export declare type Overflow = 'visible' | 'hidden' | 'scroll';
8
8
  export declare type Direction = 'inherit' | 'ltr' | 'rtl';
@@ -14,17 +14,17 @@ export interface Layout {
14
14
  alignContent?: YogaAlign;
15
15
  alignSelf?: YogaAlign;
16
16
  alignItems?: YogaAlign;
17
- borderWidth?: number;
18
- borderStartWidth?: number;
19
- borderEndWidth?: number;
20
- borderTopWidth?: number;
21
- borderRightWidth?: number;
22
- borderBottomWidth?: number;
23
- borderLeftWidth?: number;
24
- aspectRatio?: number;
17
+ borderWidth?: number | string;
18
+ borderStartWidth?: number | string;
19
+ borderEndWidth?: number | string;
20
+ borderTopWidth?: number | string;
21
+ borderRightWidth?: number | string;
22
+ borderBottomWidth?: number | string;
23
+ borderLeftWidth?: number | string;
24
+ aspectRatio?: number | string;
25
25
  flexDirection?: FlexDirection;
26
- flexShrink?: number;
27
- flexGrow?: number;
26
+ flexShrink?: number | string;
27
+ flexGrow?: number | string;
28
28
  flexBasis?: YogaValueAux;
29
29
  minHeight?: YogaValueAux;
30
30
  minWidth?: YogaValueAux;
@@ -56,6 +56,8 @@ export interface Layout {
56
56
  paddingTop?: YogaValueAux;
57
57
  paddingEnd?: YogaValueAux;
58
58
  paddingLeft?: YogaValueAux;
59
+ rowGap?: number | string;
60
+ columnGap?: number | string;
59
61
  }
60
62
  export interface LayoutExtended {
61
63
  position?: Position;
@@ -0,0 +1,65 @@
1
+ import * as React from 'react';
2
+ import { UnityEngine } from './generated';
3
+ export declare type RichTextTags = RichTextValueTag;
4
+ export interface RichTextVoidTag extends React.Attributes {
5
+ children?: any;
6
+ }
7
+ export interface RichTextValueTag<T = string | number> extends React.Attributes {
8
+ value?: T | string;
9
+ children?: any;
10
+ }
11
+ export interface RichTextColorTag extends React.Attributes {
12
+ value?: string | UnityEngine.Color;
13
+ children?: any;
14
+ }
15
+ export interface RichTextFontTag extends React.Attributes {
16
+ value?: string;
17
+ material?: string;
18
+ children?: any;
19
+ }
20
+ export interface RichTextSpriteTag extends React.Attributes {
21
+ value?: string | number;
22
+ children?: any;
23
+ name?: string;
24
+ index?: string | number;
25
+ color?: string;
26
+ }
27
+ export interface RichTextElements {
28
+ 'nbsp': RichTextVoidTag;
29
+ 'zwsp': RichTextVoidTag;
30
+ 'br': RichTextVoidTag;
31
+ 'align': RichTextValueTag<'right' | 'center' | 'left'>;
32
+ 'alpha': RichTextValueTag<string>;
33
+ 'color': RichTextColorTag;
34
+ 'b': RichTextVoidTag;
35
+ 'i': RichTextVoidTag;
36
+ 'cspace': RichTextValueTag<number>;
37
+ 'font': RichTextFontTag;
38
+ 'indent': RichTextValueTag<number>;
39
+ 'line-height': RichTextValueTag<number>;
40
+ 'line-indent': RichTextValueTag<number>;
41
+ 'link': RichTextValueTag;
42
+ 'lowercase': RichTextVoidTag;
43
+ 'uppercase': RichTextVoidTag;
44
+ 'smallcaps': RichTextVoidTag;
45
+ 'allcaps': RichTextVoidTag;
46
+ 'margin': RichTextValueTag<number>;
47
+ 'margin-left': RichTextValueTag<number>;
48
+ 'margin-right': RichTextValueTag<number>;
49
+ 'mark': RichTextValueTag;
50
+ 'mspace': RichTextVoidTag;
51
+ 'noparse': RichTextVoidTag;
52
+ 'nobr': RichTextVoidTag;
53
+ 'page': RichTextVoidTag;
54
+ 'pos': RichTextValueTag<number>;
55
+ 'size': RichTextValueTag<number>;
56
+ 'space': RichTextValueTag<number>;
57
+ 'sprite': RichTextSpriteTag;
58
+ 's': RichTextVoidTag;
59
+ 'u': RichTextVoidTag;
60
+ 'style': RichTextValueTag;
61
+ 'sub': RichTextVoidTag;
62
+ 'sup': RichTextVoidTag;
63
+ 'voffset': RichTextValueTag<number>;
64
+ 'width': RichTextValueTag<number>;
65
+ }
@@ -0,0 +1,2 @@
1
+ ;
2
+ export {};
@@ -0,0 +1,68 @@
1
+ import type * as React from 'react';
2
+ import { Style } from './properties';
3
+ declare type SVGProps<T> = React.Attributes & Omit<React.SVGAttributes<T>, keyof React.DOMAttributes<T> | keyof React.AriaAttributes | 'style'> & {
4
+ style?: Style | React.CSSProperties | string | undefined;
5
+ children?: any;
6
+ };
7
+ export declare type SVGEelement = SVGProps<SVGSVGElement>;
8
+ export interface SVGElements {
9
+ svg: SVGEelement;
10
+ animate: SVGProps<SVGElement>;
11
+ animateMotion: SVGProps<SVGElement>;
12
+ animateTransform: SVGProps<SVGElement>;
13
+ circle: SVGProps<SVGCircleElement>;
14
+ clipPath: SVGProps<SVGClipPathElement>;
15
+ defs: SVGProps<SVGDefsElement>;
16
+ desc: SVGProps<SVGDescElement>;
17
+ ellipse: SVGProps<SVGEllipseElement>;
18
+ feBlend: SVGProps<SVGFEBlendElement>;
19
+ feColorMatrix: SVGProps<SVGFEColorMatrixElement>;
20
+ feComponentTransfer: SVGProps<SVGFEComponentTransferElement>;
21
+ feComposite: SVGProps<SVGFECompositeElement>;
22
+ feConvolveMatrix: SVGProps<SVGFEConvolveMatrixElement>;
23
+ feDiffuseLighting: SVGProps<SVGFEDiffuseLightingElement>;
24
+ feDisplacementMap: SVGProps<SVGFEDisplacementMapElement>;
25
+ feDistantLight: SVGProps<SVGFEDistantLightElement>;
26
+ feDropShadow: SVGProps<SVGFEDropShadowElement>;
27
+ feFlood: SVGProps<SVGFEFloodElement>;
28
+ feFuncA: SVGProps<SVGFEFuncAElement>;
29
+ feFuncB: SVGProps<SVGFEFuncBElement>;
30
+ feFuncG: SVGProps<SVGFEFuncGElement>;
31
+ feFuncR: SVGProps<SVGFEFuncRElement>;
32
+ feGaussianBlur: SVGProps<SVGFEGaussianBlurElement>;
33
+ feImage: SVGProps<SVGFEImageElement>;
34
+ feMerge: SVGProps<SVGFEMergeElement>;
35
+ feMergeNode: SVGProps<SVGFEMergeNodeElement>;
36
+ feMorphology: SVGProps<SVGFEMorphologyElement>;
37
+ feOffset: SVGProps<SVGFEOffsetElement>;
38
+ fePointLight: SVGProps<SVGFEPointLightElement>;
39
+ feSpecularLighting: SVGProps<SVGFESpecularLightingElement>;
40
+ feSpotLight: SVGProps<SVGFESpotLightElement>;
41
+ feTile: SVGProps<SVGFETileElement>;
42
+ feTurbulence: SVGProps<SVGFETurbulenceElement>;
43
+ filter: SVGProps<SVGFilterElement>;
44
+ foreignObject: SVGProps<SVGForeignObjectElement>;
45
+ g: SVGProps<SVGGElement>;
46
+ image: SVGProps<SVGImageElement>;
47
+ line: SVGProps<SVGLineElement>;
48
+ linearGradient: SVGProps<SVGLinearGradientElement>;
49
+ marker: SVGProps<SVGMarkerElement>;
50
+ mask: SVGProps<SVGMaskElement>;
51
+ metadata: SVGProps<SVGMetadataElement>;
52
+ mpath: SVGProps<SVGElement>;
53
+ path: SVGProps<SVGPathElement>;
54
+ pattern: SVGProps<SVGPatternElement>;
55
+ polygon: SVGProps<SVGPolygonElement>;
56
+ polyline: SVGProps<SVGPolylineElement>;
57
+ radialGradient: SVGProps<SVGRadialGradientElement>;
58
+ rect: SVGProps<SVGRectElement>;
59
+ stop: SVGProps<SVGStopElement>;
60
+ switch: SVGProps<SVGSwitchElement>;
61
+ symbol: SVGProps<SVGSymbolElement>;
62
+ text: SVGProps<SVGTextElement>;
63
+ textPath: SVGProps<SVGTextPathElement>;
64
+ tspan: SVGProps<SVGTSpanElement>;
65
+ use: SVGProps<SVGUseElement>;
66
+ view: SVGProps<SVGViewElement>;
67
+ }
68
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,13 @@
1
- import { BaseCmpProps } from '../base';
1
+ import { BaseCmpProps, ContentSrcProps } from '../base';
2
2
  import { ReactUnity, UnityEngine } from '../generated';
3
3
  import { Style } from '../properties';
4
- import { AssetReference } from '../properties/values';
4
+ import { AssetReference, AssetReferenceOrHttp } from '../properties/values';
5
5
  import { ActionCallback, Events } from './events';
6
6
  export interface View<T = ReactUnity.UGUI.UGUIComponent> extends Events<T>, BaseCmpProps {
7
7
  active?: boolean;
8
8
  style?: Style | string;
9
+ data?: Record<string, any>;
10
+ eventViewport?: UnityEngine.RectTransform | UnityEngine.GameObject | ReactUnity.UGUI.UGUIComponent;
9
11
  }
10
12
  export interface Text extends View<ReactUnity.UGUI.TextComponent> {
11
13
  richText?: boolean;
@@ -43,16 +45,17 @@ export interface Anchor extends View<ReactUnity.UGUI.AnchorComponent> {
43
45
  openInThisTab?: boolean;
44
46
  }
45
47
  export interface BaseImage<T = ReactUnity.UGUI.ImageComponent> extends View<T> {
48
+ source?: AssetReferenceOrHttp;
46
49
  }
47
50
  export interface Image<T = ReactUnity.UGUI.ImageComponent> extends BaseImage<T> {
48
- source?: AssetReference;
51
+ preserveAspect?: boolean;
49
52
  }
50
- export interface RawImage extends Image<ReactUnity.UGUI.RawImageComponent> {
53
+ export interface RawImage extends BaseImage<ReactUnity.UGUI.RawImageComponent> {
51
54
  }
52
- export interface Video extends Image<ReactUnity.UGUI.VideoComponent> {
55
+ export interface Video extends BaseImage<ReactUnity.UGUI.VideoComponent> {
56
+ source?: AssetReference;
53
57
  }
54
- export interface SvgImage extends Image<ReactUnity.UGUI.SvgComponent> {
55
- preserveAspect?: boolean;
58
+ export interface SvgImage<T = ReactUnity.UGUI.SvgImageComponent> extends Image<T> {
56
59
  }
57
60
  export interface Render<T = ReactUnity.UGUI.RenderComponent> extends BaseImage<T> {
58
61
  width: number;
@@ -72,6 +75,9 @@ export interface Prefab<T = ReactUnity.UGUI.PrefabComponent> extends View<T> {
72
75
  }
73
76
  export interface Portal<T = ReactUnity.UGUI.PortalComponent> extends View<T> {
74
77
  target?: UnityEngine.GameObject | UnityEngine.Component | UnityEngine.Transform | ReactUnity.UGUI.UGUIComponent;
78
+ eventCamera?: UnityEngine.Camera | UnityEngine.GameObject;
75
79
  onMount?: (camera: UnityEngine.Transform, sender: T) => void;
76
80
  onUnmount?: (camera: UnityEngine.Transform, sender: T) => void;
77
81
  }
82
+ export interface Svg<T = ReactUnity.UGUI.SvgComponent> extends SvgImage<T>, ContentSrcProps {
83
+ }
@@ -13,6 +13,7 @@ export interface Events<T = BaseCmp> extends BaseEvents<T> {
13
13
  onPointerDown?: PointerEventCallback<T>;
14
14
  onPointerEnter?: PointerEventCallback<T>;
15
15
  onPointerExit?: PointerEventCallback<T>;
16
+ onPointerMove?: PointerEventCallback<T>;
16
17
  onSubmit?: BaseEventCallback<T>;
17
18
  onCancel?: BaseEventCallback<T>;
18
19
  onSelect?: BaseEventCallback<T>;
@@ -1,6 +1,7 @@
1
1
  import { Attributes, ClassAttributes, RefAttributes } from 'react';
2
2
  import { BaseElements, Textable } from '../base';
3
3
  import { ReactUnity } from '../generated';
4
+ import { SVGEelement } from '../svg';
4
5
  import * as Components from './components';
5
6
  import { Input } from './input';
6
7
  import NS = ReactUnity.UGUI;
@@ -14,14 +15,17 @@ export interface UGUIElements extends BaseElements<BaseCmp> {
14
15
  } & Children;
15
16
  anchor: Components.Anchor & RefAttributes<NS.AnchorComponent> & Children;
16
17
  text: Components.Text & RefAttributes<NS.TextComponent> & Children<Textable | Textable[]>;
18
+ richtext: Components.Text & RefAttributes<NS.TextComponent> & Children<any>;
17
19
  label: Components.Label & RefAttributes<NS.LabelComponent> & Children;
18
20
  icon: Components.Icon & RefAttributes<NS.IconComponent> & Children<Textable | Textable[]>;
19
21
  button: Components.Button & RefAttributes<NS.ButtonComponent> & Children;
20
22
  input: Input & RefAttributes<NS.InputComponent> & Children<never>;
21
23
  scroll: Components.Scroll & RefAttributes<NS.ScrollComponent> & Children;
24
+ img: Components.Image & RefAttributes<NS.ImageComponent> & Children<never>;
22
25
  image: Components.Image & RefAttributes<NS.ImageComponent> & Children<never>;
23
26
  rawimage: Components.RawImage & RefAttributes<NS.RawImageComponent> & Children<never>;
24
- svg: Components.SvgImage & RefAttributes<NS.SvgComponent> & Children<never>;
27
+ svgimage: Components.SvgImage & RefAttributes<NS.SvgImageComponent> & Children<never>;
28
+ svg: Components.Svg & RefAttributes<NS.SvgComponent> & Children<any> & SVGEelement;
25
29
  video: Components.Video & RefAttributes<NS.VideoComponent> & Children<never>;
26
30
  render: Components.Render & RefAttributes<NS.RenderComponent> & Children<never>;
27
31
  object: Components.Object & RefAttributes<NS.ObjectComponent> & Children<never>;
@@ -45,4 +49,9 @@ declare module 'react/jsx-runtime' {
45
49
  }
46
50
  }
47
51
  }
52
+ declare global {
53
+ interface DefaultComponentProps extends Components.View {
54
+ ref?: React.Ref<ReactUnity.UGUI.UGUIComponent>;
55
+ }
56
+ }
48
57
  export {};
@@ -1,4 +1,4 @@
1
- import { BaseCmpProps } from '../base';
1
+ import { BaseCmpProps, ContentSrcProps } from '../base';
2
2
  import { ReactUnity, UnityEditor, UnityEngine } from '../generated';
3
3
  import { Style } from '../properties';
4
4
  import { AssetReference } from '../properties/values';
@@ -72,4 +72,6 @@ export interface IMGUI extends View<Cmp.IMGUIComponent> {
72
72
  onGUI?: ActionCallback<Cmp.IMGUIComponent>;
73
73
  cullingEnabled?: boolean;
74
74
  }
75
+ export interface Svg extends View<Cmp.SvgComponent>, ContentSrcProps {
76
+ }
75
77
  export {};
@@ -1,6 +1,7 @@
1
1
  import * as rc from 'react';
2
2
  import { BaseElements, Textable } from '../base';
3
3
  import { ReactUnity } from '../generated';
4
+ import { SVGEelement } from '../svg';
4
5
  import * as Components from './components';
5
6
  import Cmp = ReactUnity.UIToolkit;
6
7
  declare type Children<T = any> = {
@@ -14,9 +15,12 @@ export interface UIToolkitElements extends BaseElements<BaseElement<any>> {
14
15
  box: BaseElement;
15
16
  anchor: Components.Anchor & rc.RefAttributes<Cmp.UIToolkitComponent> & Children;
16
17
  text: Components.View & rc.RefAttributes<Cmp.TextComponent> & Children<Textable | Textable[]>;
18
+ richtext: Components.View & rc.RefAttributes<Cmp.TextComponent> & Children<Textable | Textable[]>;
17
19
  label: Components.View & rc.RefAttributes<Cmp.TextComponent> & Children<Textable | Textable[]>;
18
20
  button: Components.Button & rc.RefAttributes<Cmp.ButtonComponent> & Children;
19
21
  scroll: BaseElement;
22
+ svg: Components.Svg & rc.RefAttributes<Cmp.SvgComponent> & Children<any> & SVGEelement;
23
+ img: Components.Image & rc.RefAttributes<Cmp.ImageComponent> & Children<never>;
20
24
  image: Components.Image & rc.RefAttributes<Cmp.ImageComponent> & Children<never>;
21
25
  toggle: Components.Toggle & rc.RefAttributes<Cmp.ToggleComponent> & Children<never>;
22
26
  input: Components.TextField<Cmp.TextFieldComponent> & rc.RefAttributes<Cmp.TextFieldComponent> & Children<never>;
@@ -49,4 +53,9 @@ declare module 'react/jsx-runtime' {
49
53
  }
50
54
  }
51
55
  }
56
+ declare global {
57
+ interface DefaultComponentProps extends Components.View {
58
+ ref?: React.Ref<ReactUnity.UIToolkit.UIToolkitComponent>;
59
+ }
60
+ }
52
61
  export {};
@@ -20,14 +20,28 @@ var CallbacksRepo = /** @class */ (function (_super) {
20
20
  var _this = _super.call(this) || this;
21
21
  _this.call = function (ind, args) {
22
22
  var cb = _this.getObject(ind);
23
- if ('Length' in args) {
24
- var newArgs = [];
25
- var length = args['Length'];
26
- for (var index = 0; index < length; index++) {
27
- var element = args[index];
28
- newArgs.push(element);
29
- }
30
- args = newArgs;
23
+ var argsAsList = args;
24
+ var argsAsArray = args;
25
+ if (typeof argsAsArray.Length === 'number') {
26
+ // C# Array
27
+ args = [];
28
+ var length = argsAsArray.Length;
29
+ for (var index = 0; index < length; index++)
30
+ args.push(argsAsArray.GetValue(index));
31
+ }
32
+ else if (typeof argsAsList.Count === 'number') {
33
+ // C# List
34
+ args = [];
35
+ var length = argsAsList.Count;
36
+ for (var index = 0; index < length; index++)
37
+ args.push(argsAsList[index]);
38
+ }
39
+ else if (typeof argsAsList.Count === 'function') {
40
+ // C# IList
41
+ args = [];
42
+ var length = argsAsList.Count();
43
+ for (var index = 0; index < length; index++)
44
+ args.push(argsAsArray.GetValue(index));
31
45
  }
32
46
  return cb.apply(null, args);
33
47
  };
@@ -1,8 +1,2 @@
1
1
  import * as Reconciler from 'react-reconciler';
2
- import { AsyncHostContext } from './types';
3
- export declare const asyncReconciler: Reconciler.Reconciler<AsyncHostContext & {
4
- refId: number;
5
- } & {
6
- component: import("../../..").ReactUnity.IReactComponent;
7
- fiberCache: import("./objects").ObjectsRepo<any>;
8
- }, import("./types").AsyncNativeInstance, import("./types").AsyncNativeInstance, import("./types").AsyncNativeInstance, import("../../..").ReactUnity.IReactComponent>;
2
+ export declare const asyncReconciler: Reconciler.Reconciler<import("./types").AsyncContainerInstance, import("./types").AsyncInstance, import("./types").AsyncInstance, import("./types").AsyncNativeInstance, import("../../..").ReactUnity.IReactComponent>;