@reactunity/renderer 0.5.2 → 0.8.1
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/editor.d.ts +1 -1
- package/dist/editor.js +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.js +4 -5
- package/dist/src/helpers/dictionary-watcher.d.ts +1 -1
- package/dist/src/helpers/dictionary-watcher.js +2 -2
- package/dist/{models → src/models}/base.d.ts +24 -5
- package/dist/{models/ugui/events.js → src/models/base.js} +0 -0
- package/dist/{models → src/models}/editor/components.d.ts +0 -0
- package/dist/{models → src/models}/editor/components.js +0 -0
- package/dist/{models → src/models}/editor/environment.d.ts +0 -0
- package/dist/{models → src/models}/editor/environment.js +0 -0
- package/dist/{models → src/models}/editor/events.d.ts +0 -0
- package/dist/{models → src/models}/editor/events.js +0 -0
- package/dist/{models → src/models}/editor/index.d.ts +0 -0
- package/dist/{models → src/models}/editor/index.js +0 -0
- package/dist/{models → src/models}/editor/jsx.d.ts +2 -4
- package/dist/{models → src/models}/editor/jsx.js +0 -0
- package/dist/src/models/environment/index.d.ts +41 -0
- package/dist/src/models/environment/index.js +1 -0
- package/dist/{models → src/models/environment}/interop.d.ts +2 -2
- package/dist/{models → src/models/environment}/interop.js +0 -0
- package/dist/{models → src/models}/generated/editor.d.ts +0 -0
- package/dist/src/models/generated/editor.js +6 -0
- package/dist/{models → src/models}/generated/index.d.ts +1 -0
- package/dist/{models → src/models}/generated/index.js +1 -0
- package/dist/{models → src/models}/generated/react.d.ts +3474 -2904
- package/dist/src/models/generated/react.js +6 -0
- package/dist/{models → src/models}/generated/system.d.ts +0 -0
- package/dist/{models → src/models}/generated/system.js +1 -0
- package/dist/{models → src/models}/generated/tests.d.ts +0 -0
- package/dist/src/models/generated/tests.js +6 -0
- package/dist/{models → src/models}/generated/unity.d.ts +0 -0
- package/dist/src/models/generated/unity.js +6 -0
- package/dist/src/models/generated/yoga.d.ts +358 -0
- package/dist/src/models/generated/yoga.js +6 -0
- package/dist/{models → src/models}/properties/colors.d.ts +0 -0
- package/dist/{models → src/models}/properties/colors.js +0 -0
- package/dist/{models → src/models}/properties/index.d.ts +0 -0
- package/dist/{models → src/models}/properties/index.js +0 -0
- package/dist/{models → src/models}/properties/style.d.ts +0 -0
- package/dist/{models → src/models}/properties/style.js +0 -0
- package/dist/{models → src/models}/properties/styles-enums.d.ts +5 -0
- package/dist/{models → src/models}/properties/styles-enums.js +0 -0
- package/dist/src/models/properties/styles.d.ts +104 -0
- package/dist/{models → src/models}/properties/styles.js +0 -0
- package/dist/{models → src/models}/properties/values.d.ts +1 -1
- package/dist/{models → src/models}/properties/values.js +0 -0
- package/dist/{models → src/models}/properties/yoga-enums.d.ts +0 -0
- package/dist/{models → src/models}/properties/yoga-enums.js +0 -0
- package/dist/{models → src/models}/properties/yoga.d.ts +0 -0
- package/dist/{models → src/models}/properties/yoga.js +0 -0
- package/dist/{models → src/models}/renderer.d.ts +0 -0
- package/dist/{models → src/models}/renderer.js +0 -0
- package/dist/src/models/tests/index.d.ts +12 -0
- package/dist/{models → src/models}/tests/index.js +0 -0
- package/dist/{models → src/models}/ugui/components.d.ts +3 -5
- package/dist/{models → src/models}/ugui/components.js +0 -0
- package/dist/{models → src/models}/ugui/events.d.ts +0 -0
- package/dist/src/models/ugui/events.js +2 -0
- package/dist/{models → src/models}/ugui/index.d.ts +0 -0
- package/dist/{models → src/models}/ugui/index.js +0 -0
- package/dist/{models → src/models}/ugui/input.d.ts +0 -0
- package/dist/{models → src/models}/ugui/input.js +0 -0
- package/dist/{models → src/models}/ugui/jsx.d.ts +2 -4
- package/dist/{models → src/models}/ugui/jsx.js +0 -0
- package/dist/{models → src/models}/uitoolkit/components.d.ts +3 -5
- package/dist/{models → src/models}/uitoolkit/components.js +0 -0
- package/dist/{models → src/models}/uitoolkit/events.d.ts +0 -0
- package/dist/{models → src/models}/uitoolkit/events.js +0 -0
- package/dist/{models → src/models}/uitoolkit/index.d.ts +0 -0
- package/dist/{models → src/models}/uitoolkit/index.js +0 -0
- package/dist/{models → src/models}/uitoolkit/jsx.d.ts +2 -4
- package/dist/{models → src/models}/uitoolkit/jsx.js +0 -0
- package/dist/src/renderer/diffing.d.ts +3 -2
- package/dist/src/renderer/diffing.js +11 -6
- package/dist/src/renderer/renderer.d.ts +1 -1
- package/dist/src/renderer/renderer.js +42 -102
- package/dist/tests.d.ts +1 -1
- package/dist/tests.js +1 -1
- package/dist/ugui.d.ts +1 -1
- package/dist/ugui.js +1 -1
- package/dist/uitoolkit.d.ts +1 -1
- package/dist/uitoolkit.js +1 -1
- package/editor.ts +1 -1
- package/package.json +5 -8
- package/tests.ts +1 -1
- package/ugui.ts +1 -1
- package/uitoolkit.ts +1 -1
- package/dist/models/base.js +0 -1
- package/dist/models/environment.d.ts +0 -30
- package/dist/models/environment.js +0 -1
- package/dist/models/generated/editor.js +0 -1
- package/dist/models/generated/react.js +0 -1
- package/dist/models/generated/tests.js +0 -1
- package/dist/models/generated/unity.js +0 -1
- package/dist/models/properties/styles.d.ts +0 -67
- package/dist/models/tests/index.d.ts +0 -12
package/dist/editor.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './models/editor';
|
|
1
|
+
export * from './src/models/editor';
|
package/dist/editor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './models/editor';
|
|
1
|
+
export * from './src/models/editor';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export * from './models/environment';
|
|
2
|
-
export * from './models/generated';
|
|
3
|
-
export * from './models/interop';
|
|
4
|
-
export * from './models/properties';
|
|
5
|
-
export * from './models/renderer';
|
|
6
1
|
export * from './src/helpers/dictionary-watcher';
|
|
7
2
|
export * from './src/helpers/styled-components-helper';
|
|
3
|
+
export * from './src/models/environment';
|
|
4
|
+
export * from './src/models/generated';
|
|
5
|
+
export * from './src/models/properties';
|
|
6
|
+
export * from './src/models/renderer';
|
|
8
7
|
export { Renderer } from './src/renderer/renderer';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export * from './models/environment';
|
|
2
|
-
export * from './models/generated';
|
|
3
|
-
export * from './models/interop';
|
|
4
|
-
export * from './models/properties';
|
|
5
|
-
export * from './models/renderer';
|
|
6
1
|
export * from './src/helpers/dictionary-watcher';
|
|
7
2
|
export * from './src/helpers/styled-components-helper';
|
|
3
|
+
export * from './src/models/environment';
|
|
4
|
+
export * from './src/models/generated';
|
|
5
|
+
export * from './src/models/properties';
|
|
6
|
+
export * from './src/models/renderer';
|
|
8
7
|
export { Renderer } from './src/renderer/renderer';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ReactUnity } from '
|
|
2
|
+
import { ReactUnity } from '../models/generated';
|
|
3
3
|
export interface DictionaryWatcher<T = Record<string, any>> {
|
|
4
4
|
/** React Context that provides the value */
|
|
5
5
|
context: React.Context<T>;
|
|
@@ -28,7 +28,7 @@ export function createDictionaryWatcher(dictionary, displayName) {
|
|
|
28
28
|
});
|
|
29
29
|
if (!remove) {
|
|
30
30
|
if (displayName)
|
|
31
|
-
console.warn(displayName
|
|
31
|
+
console.warn("".concat(displayName, " dictionary does not provide a change listener"));
|
|
32
32
|
else
|
|
33
33
|
console.warn('The dictionary does not provide a change listener');
|
|
34
34
|
}
|
|
@@ -42,7 +42,7 @@ export function createDictionaryWatcher(dictionary, displayName) {
|
|
|
42
42
|
var context = React.useContext(ctx);
|
|
43
43
|
if (context === undefined) {
|
|
44
44
|
if (displayName)
|
|
45
|
-
throw new Error(displayName
|
|
45
|
+
throw new Error("".concat(displayName, ".useContext must be used within a ").concat(displayName, ".Provider"));
|
|
46
46
|
else
|
|
47
47
|
throw new Error('useContext must be used within a provider');
|
|
48
48
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
2
|
import { ReactUnity } from './generated';
|
|
3
3
|
declare type BaseCmp = ReactUnity.IReactComponent;
|
|
4
|
-
export declare type AnimationCallback<T = BaseCmp> = (ev: ReactUnity.Animations.AnimationEvent, sender: T) => void;
|
|
5
|
-
export declare type TransitionCallback<T = BaseCmp> = (ev: ReactUnity.Animations.TransitionEvent, sender: T) => void;
|
|
4
|
+
export declare type AnimationCallback<T = BaseCmp> = (ev: ReactUnity.Styling.Animations.AnimationEvent, sender: T) => void;
|
|
5
|
+
export declare type TransitionCallback<T = BaseCmp> = (ev: ReactUnity.Styling.Animations.TransitionEvent, sender: T) => void;
|
|
6
6
|
export interface BaseEvents<T = BaseCmp> {
|
|
7
7
|
onAnimationRun?: AnimationCallback<T>;
|
|
8
8
|
onAnimationStart?: AnimationCallback<T>;
|
|
@@ -15,15 +15,34 @@ export interface BaseEvents<T = BaseCmp> {
|
|
|
15
15
|
onTransitionEnd?: AnimationCallback<T>;
|
|
16
16
|
}
|
|
17
17
|
export declare type Textable = string | number | boolean | null | undefined;
|
|
18
|
-
export interface
|
|
19
|
-
active?: boolean;
|
|
18
|
+
export interface BaseCmpProps {
|
|
20
19
|
id?: string;
|
|
21
20
|
name?: string;
|
|
21
|
+
class?: string;
|
|
22
22
|
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ContentSrcProps extends BaseCmpProps {
|
|
25
|
+
content?: string;
|
|
26
|
+
source?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface StyleCmpProps extends ContentSrcProps {
|
|
29
|
+
active?: boolean;
|
|
23
30
|
scope?: string | BaseCmp;
|
|
24
31
|
importance?: number;
|
|
25
32
|
}
|
|
26
|
-
export declare type StyleCmpDef = StyleCmpProps & RefAttributes<ReactUnity.StyleComponent> & {
|
|
33
|
+
export declare type StyleCmpDef = StyleCmpProps & RefAttributes<ReactUnity.Styling.StyleComponent> & {
|
|
27
34
|
children?: Textable | Textable[];
|
|
28
35
|
};
|
|
36
|
+
export declare type ScriptCmpDef = ContentSrcProps & RefAttributes<ReactUnity.Scripting.ScriptComponent> & {
|
|
37
|
+
children?: Textable | Textable[];
|
|
38
|
+
};
|
|
39
|
+
export declare type HtmlCmpDef = ContentSrcProps & RefAttributes<ReactUnity.Html.HtmlComponent> & {
|
|
40
|
+
children?: never;
|
|
41
|
+
};
|
|
42
|
+
export interface BaseElements<BaseCmpType> {
|
|
43
|
+
[key: string]: BaseCmpType;
|
|
44
|
+
style: BaseCmpType & StyleCmpDef;
|
|
45
|
+
script: BaseCmpType & ScriptCmpDef;
|
|
46
|
+
html: BaseCmpType & HtmlCmpDef;
|
|
47
|
+
}
|
|
29
48
|
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as rc from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseElements, Textable } from '../base';
|
|
3
3
|
import { ReactUnity, UnityEngine } from '../generated';
|
|
4
4
|
import * as Components from '../uitoolkit/components';
|
|
5
5
|
import * as EComponents from './components';
|
|
@@ -12,9 +12,7 @@ declare type BaseElement<T = Cmp.UIToolkitComponent> = Components.View<T> & rc.R
|
|
|
12
12
|
declare type BaseFieldComponent<T> = Cmp.BaseFieldComponent<BaseElement, T>;
|
|
13
13
|
declare type BaseFieldElement<T, TSender = BaseFieldComponent<T>> = Components.BaseField<T, TSender> & rc.RefAttributes<TSender> & Children<never>;
|
|
14
14
|
declare type BaseFieldElementSimple<T> = BaseFieldElement<T, BaseFieldComponent<T>>;
|
|
15
|
-
export interface EditorElements {
|
|
16
|
-
[key: string]: BaseElement<any> | StyleCmpDef;
|
|
17
|
-
style: StyleCmpDef;
|
|
15
|
+
export interface EditorElements extends BaseElements<BaseElement<any>> {
|
|
18
16
|
view: BaseElement & {
|
|
19
17
|
tag?: string;
|
|
20
18
|
};
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactUnity } from '../generated';
|
|
2
|
+
export * from './interop';
|
|
3
|
+
interface Console {
|
|
4
|
+
assert(condition?: boolean, ...data: any[]): void;
|
|
5
|
+
clear(): void;
|
|
6
|
+
debug(...data: any[]): void;
|
|
7
|
+
dir(item?: any, options?: any): void;
|
|
8
|
+
error(...data: any[]): void;
|
|
9
|
+
exception(message?: string, ...optionalParams: any[]): void;
|
|
10
|
+
info(...data: any[]): void;
|
|
11
|
+
log(...data: any[]): void;
|
|
12
|
+
trace(...data: any[]): void;
|
|
13
|
+
warn(...data: any[]): void;
|
|
14
|
+
}
|
|
15
|
+
interface ReactUnityDocument {
|
|
16
|
+
querySelector: (query: string) => ReactUnity.IReactComponent;
|
|
17
|
+
querySelectorAll: (query: string) => ReactUnity.IReactComponent[];
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
var Context: ReactUnity.ReactContext;
|
|
21
|
+
var HostContainer: ReactUnity.IContainerComponent;
|
|
22
|
+
var UnityBridge: ReactUnity.ReactUnityBridge;
|
|
23
|
+
var document: ReactUnityDocument;
|
|
24
|
+
var location: ReactUnity.Scripting.DomProxies.Location;
|
|
25
|
+
var localStorage: ReactUnity.Scripting.DomProxies.LocalStorage;
|
|
26
|
+
var console: Console;
|
|
27
|
+
var global: typeof globalThis;
|
|
28
|
+
function matchMedia(query: string): ReactUnity.Styling.Rules.MediaQueryList;
|
|
29
|
+
interface DefaultGlobals {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
var Globals: ReactUnity.Helpers.WatchableRecord<any> & DefaultGlobals;
|
|
33
|
+
var setImmediate: (callback: () => void) => number;
|
|
34
|
+
var setTimeout: (callback: () => void, timeout: number) => number;
|
|
35
|
+
var setInterval: (callback: () => void, timeout: number) => number;
|
|
36
|
+
var requestAnimationFrame: (callback: () => void) => number;
|
|
37
|
+
var clearTimeout: (handle: number) => void;
|
|
38
|
+
var clearInterval: (handle: number) => void;
|
|
39
|
+
var clearImmediate: (handle: number) => void;
|
|
40
|
+
var cancelAnimationFrame: (handle: number) => void;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './interop';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Facebook, ReactUnity, System, UnityEditor, UnityEngine } from '
|
|
1
|
+
import { Facebook, ReactUnity, System, UnityEditor, UnityEngine } from '../generated';
|
|
2
2
|
export declare type NamespaceMap = {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
System: typeof System;
|
|
@@ -16,5 +16,5 @@ declare global {
|
|
|
16
16
|
ReactUnity: typeof ReactUnity;
|
|
17
17
|
Facebook: typeof Facebook;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
var Interop: ReactUnity.Helpers.ReactInterop & DefaultInterop;
|
|
20
20
|
}
|
|
File without changes
|
|
File without changes
|