@reactunity/renderer 0.10.0 → 0.12.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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/src/helpers/icons.d.ts +7 -0
- package/dist/src/helpers/icons.js +29 -0
- package/dist/src/models/base.d.ts +10 -7
- package/dist/src/models/editor/jsx.d.ts +10 -1
- package/dist/src/models/environment/index.d.ts +3 -0
- package/dist/src/models/generated/editor.d.ts +456 -26
- package/dist/src/models/generated/editor.js +1 -1
- package/dist/src/models/generated/react.d.ts +1897 -731
- package/dist/src/models/generated/react.js +1 -1
- package/dist/src/models/generated/system.d.ts +148 -148
- package/dist/src/models/generated/system.js +1 -1
- package/dist/src/models/generated/tests.js +1 -1
- package/dist/src/models/generated/unity.d.ts +5392 -1283
- package/dist/src/models/generated/unity.js +2 -2
- package/dist/src/models/generated/yoga.js +1 -1
- package/dist/src/models/properties/styles.d.ts +8 -7
- package/dist/src/models/properties/values.d.ts +7 -0
- package/dist/src/models/richtext.d.ts +65 -0
- package/dist/src/models/richtext.js +2 -0
- package/dist/src/models/svg.d.ts +68 -0
- package/dist/src/models/svg.js +1 -0
- package/dist/src/models/ugui/components.d.ts +12 -7
- package/dist/src/models/ugui/events.d.ts +1 -0
- package/dist/src/models/ugui/jsx.d.ts +10 -1
- package/dist/src/models/uitoolkit/components.d.ts +3 -1
- package/dist/src/models/uitoolkit/jsx.d.ts +9 -0
- package/dist/src/renderer/async/callbacks.js +22 -8
- package/dist/src/renderer/async/reconciler.d.ts +1 -8
- package/dist/src/renderer/async/reconciler.js +208 -60
- package/dist/src/renderer/async/serializer.d.ts +9 -0
- package/dist/src/renderer/async/serializer.js +31 -0
- package/dist/src/renderer/async/types.d.ts +31 -5
- package/dist/src/renderer/constants.d.ts +5 -0
- package/dist/src/renderer/constants.js +12 -0
- package/dist/src/renderer/diffing.js +1 -1
- package/dist/src/renderer/renderer.d.ts +11 -10
- package/dist/src/renderer/renderer.js +7 -9
- package/dist/src/renderer/subcontexts/index.d.ts +6 -0
- package/dist/src/renderer/subcontexts/index.js +6 -0
- package/dist/src/renderer/subcontexts/richtext.d.ts +3 -0
- package/dist/src/renderer/subcontexts/richtext.js +52 -0
- package/dist/src/renderer/subcontexts/svg.d.ts +3 -0
- package/dist/src/renderer/subcontexts/svg.js +70 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +6 -6
|
@@ -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
|
|
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.UIElementsNativeModule, UnityEngine.AIModule, UnityEngine.TestRunner, UnityEngine.TextCoreFontEngineModule, UnityEngine.TextCoreTextEngineModule, UnityEngine.XRModule, UnityEngine.PhysicsModule, UnityEngine.InputLegacyModule, UnityEngine.UI, Unity.InputSystem, Unity.InputSystem
|
|
3
|
+
// Generated 23/05/2022 15:36:59
|
|
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?:
|
|
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?:
|
|
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?:
|
|
78
|
+
audioClip?: AssetReferenceOrHttp;
|
|
79
79
|
audioIterationCount?: number | string;
|
|
80
80
|
audioDelay?: number | string;
|
|
81
81
|
all?: string;
|
|
@@ -88,12 +88,12 @@ export interface RenderStyle {
|
|
|
88
88
|
borderBottom?: string;
|
|
89
89
|
borderLeft?: string;
|
|
90
90
|
borderWidth?: string;
|
|
91
|
-
margin?: string;
|
|
91
|
+
margin?: string | number;
|
|
92
92
|
mask?: string;
|
|
93
93
|
maskPosition?: string;
|
|
94
94
|
maskRepeat?: string;
|
|
95
|
-
padding?: string;
|
|
96
|
-
inset?: string;
|
|
95
|
+
padding?: string | number;
|
|
96
|
+
inset?: string | number;
|
|
97
97
|
flex?: string;
|
|
98
98
|
flexFlow?: string;
|
|
99
99
|
font?: string;
|
|
@@ -102,5 +102,6 @@ export interface RenderStyle {
|
|
|
102
102
|
transition?: string;
|
|
103
103
|
motion?: string;
|
|
104
104
|
audio?: string;
|
|
105
|
+
transform?: string;
|
|
105
106
|
[variable: `--${string}`]: any;
|
|
106
107
|
}
|
|
@@ -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 {};
|
|
@@ -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,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,12 @@
|
|
|
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
|
+
eventViewport?: UnityEngine.RectTransform | UnityEngine.GameObject | ReactUnity.UGUI.UGUIComponent;
|
|
9
10
|
}
|
|
10
11
|
export interface Text extends View<ReactUnity.UGUI.TextComponent> {
|
|
11
12
|
richText?: boolean;
|
|
@@ -43,16 +44,17 @@ export interface Anchor extends View<ReactUnity.UGUI.AnchorComponent> {
|
|
|
43
44
|
openInThisTab?: boolean;
|
|
44
45
|
}
|
|
45
46
|
export interface BaseImage<T = ReactUnity.UGUI.ImageComponent> extends View<T> {
|
|
47
|
+
source?: AssetReferenceOrHttp;
|
|
46
48
|
}
|
|
47
49
|
export interface Image<T = ReactUnity.UGUI.ImageComponent> extends BaseImage<T> {
|
|
48
|
-
|
|
50
|
+
preserveAspect?: boolean;
|
|
49
51
|
}
|
|
50
|
-
export interface RawImage extends
|
|
52
|
+
export interface RawImage extends BaseImage<ReactUnity.UGUI.RawImageComponent> {
|
|
51
53
|
}
|
|
52
|
-
export interface Video extends
|
|
54
|
+
export interface Video extends BaseImage<ReactUnity.UGUI.VideoComponent> {
|
|
55
|
+
source?: AssetReference;
|
|
53
56
|
}
|
|
54
|
-
export interface SvgImage
|
|
55
|
-
preserveAspect?: boolean;
|
|
57
|
+
export interface SvgImage<T = ReactUnity.UGUI.SvgImageComponent> extends Image<T> {
|
|
56
58
|
}
|
|
57
59
|
export interface Render<T = ReactUnity.UGUI.RenderComponent> extends BaseImage<T> {
|
|
58
60
|
width: number;
|
|
@@ -72,6 +74,9 @@ export interface Prefab<T = ReactUnity.UGUI.PrefabComponent> extends View<T> {
|
|
|
72
74
|
}
|
|
73
75
|
export interface Portal<T = ReactUnity.UGUI.PortalComponent> extends View<T> {
|
|
74
76
|
target?: UnityEngine.GameObject | UnityEngine.Component | UnityEngine.Transform | ReactUnity.UGUI.UGUIComponent;
|
|
77
|
+
eventCamera?: UnityEngine.Camera | UnityEngine.GameObject;
|
|
75
78
|
onMount?: (camera: UnityEngine.Transform, sender: T) => void;
|
|
76
79
|
onUnmount?: (camera: UnityEngine.Transform, sender: T) => void;
|
|
77
80
|
}
|
|
81
|
+
export interface Svg<T = ReactUnity.UGUI.SvgComponent> extends SvgImage<T>, ContentSrcProps {
|
|
82
|
+
}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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,9 +1,2 @@
|
|
|
1
1
|
import * as Reconciler from 'react-reconciler';
|
|
2
|
-
|
|
3
|
-
import { AsyncHostContext } from './types';
|
|
4
|
-
export declare const asyncReconciler: Reconciler.Reconciler<AsyncHostContext & {
|
|
5
|
-
refId: number;
|
|
6
|
-
} & {
|
|
7
|
-
component: import("../../..").ReactUnity.IReactComponent;
|
|
8
|
-
fiberCache: ObjectsRepo<any>;
|
|
9
|
-
}, 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>;
|