@reactunity/renderer 0.13.1 → 0.13.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.
- package/dist/src/helpers/dictionary-watcher.d.ts +1 -0
- package/dist/src/helpers/dictionary-watcher.js +3 -2
- package/dist/src/models/base.d.ts +6 -1
- package/dist/src/models/generated/react.d.ts +711 -271
- package/dist/src/models/generated/react.js +1 -1
- package/dist/src/models/properties/styles-enums.d.ts +1 -0
- package/dist/src/models/properties/styles.d.ts +3 -1
- package/dist/src/models/properties/yoga.d.ts +0 -1
- package/dist/src/models/ugui/components.d.ts +1 -4
- package/dist/src/renderer/async/commands.d.ts +3 -1
- package/dist/src/renderer/async/reconciler.js +2 -2
- package/dist/src/renderer/constants.d.ts +2 -0
- package/dist/src/renderer/constants.js +10 -1
- package/dist/src/renderer/diffing.js +13 -5
- package/dist/src/renderer/renderer.js +3 -2
- package/dist/src/renderer/sync/reconciler.js +2 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +2 -2
|
@@ -51,6 +51,7 @@ export interface DictionaryWatcher<T = Record<string, any>> {
|
|
|
51
51
|
export declare function createDictionaryWatcher<ValueType = any, RecordType = Record<string, ValueType>>(dictionary: ReactUnity.Helpers.WatchableRecord<ValueType>, displayName?: string): DictionaryWatcher<RecordType>;
|
|
52
52
|
export declare const globalsWatcher: DictionaryWatcher<DefaultGlobals>;
|
|
53
53
|
export declare const useGlobals: () => DefaultGlobals;
|
|
54
|
+
export declare const useGlobalsSelector: <Res>(selector: (store: DefaultGlobals) => Res) => Res;
|
|
54
55
|
export declare const GlobalsProvider: (props: {
|
|
55
56
|
children?: React.ReactNode;
|
|
56
57
|
}) => import("react").FunctionComponentElement<import("react").ProviderProps<DefaultGlobals>>;
|
|
@@ -42,8 +42,8 @@ export function createDictionaryWatcher(dictionary, displayName) {
|
|
|
42
42
|
var value = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
43
43
|
return createElement(ctx.Provider, { value: value }, children);
|
|
44
44
|
};
|
|
45
|
-
function useSelector(selector) {
|
|
46
|
-
return useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, selector);
|
|
45
|
+
function useSelector(selector, isEqual) {
|
|
46
|
+
return useSyncExternalStoreWithSelector(subscribe, getSnapshot, getSnapshot, selector, isEqual);
|
|
47
47
|
}
|
|
48
48
|
function useDictionaryContext() {
|
|
49
49
|
var context = useContext(ctx);
|
|
@@ -59,4 +59,5 @@ export function createDictionaryWatcher(dictionary, displayName) {
|
|
|
59
59
|
}
|
|
60
60
|
export var globalsWatcher = createDictionaryWatcher(Globals, 'globalsContext');
|
|
61
61
|
export var useGlobals = globalsWatcher.useContext;
|
|
62
|
+
export var useGlobalsSelector = globalsWatcher.useSelector;
|
|
62
63
|
export var GlobalsProvider = globalsWatcher.Provider;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
2
|
import { ReactUnity } from './generated';
|
|
3
|
-
import { AssetReferenceOrHttp } from './properties';
|
|
3
|
+
import { AssetReferenceOrHttp, Style } from './properties';
|
|
4
4
|
import { RichTextElements, RichTextTags } from './richtext';
|
|
5
5
|
import { SVGElements } from './svg';
|
|
6
6
|
declare type BaseCmp = ReactUnity.IReactComponent;
|
|
@@ -17,12 +17,17 @@ export interface BaseEvents<T = BaseCmp> {
|
|
|
17
17
|
onTransitionCancel?: TransitionCallback<T>;
|
|
18
18
|
onTransitionEnd?: TransitionCallback<T>;
|
|
19
19
|
}
|
|
20
|
+
export declare type PoolKey = string | number | boolean | null | undefined;
|
|
20
21
|
export declare type Textable = string | number | boolean | null | undefined;
|
|
21
22
|
export interface BaseCmpProps {
|
|
22
23
|
id?: string;
|
|
23
24
|
name?: string;
|
|
24
25
|
class?: string;
|
|
25
26
|
className?: string;
|
|
27
|
+
style?: Style | string;
|
|
28
|
+
data?: Record<string, any>;
|
|
29
|
+
custom?: Record<string, any>;
|
|
30
|
+
pool?: PoolKey;
|
|
26
31
|
}
|
|
27
32
|
export interface ContentSrcProps extends BaseCmpProps {
|
|
28
33
|
content?: string;
|