@vnejs/plugins.views.scenario.interface 0.1.15 → 0.1.17
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import "@vnejs/plugins.views.scenario.interface.contract";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "@vnejs/plugins.views.scenario.interface.contract";
|
|
1
2
|
import { regPlugin } from "@vnejs/shared";
|
|
2
3
|
import { PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/plugins.views.scenario.interface.contract";
|
|
3
4
|
import { InterfaceController } from "./modules/controller.js";
|
|
@@ -6,7 +6,7 @@ export const useTokensHook = (isShow, tokens, tokensVisible, uid) => {
|
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
if (isShow)
|
|
8
8
|
setTokensWrong(tokens);
|
|
9
|
-
}, [isShow
|
|
9
|
+
}, [isShow]);
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
setTimeout(() => {
|
|
12
12
|
if (savedUid === uid) {
|
|
@@ -22,7 +22,7 @@ export const useTokensHook = (isShow, tokens, tokensVisible, uid) => {
|
|
|
22
22
|
setTokensSync(tokens);
|
|
23
23
|
});
|
|
24
24
|
}, 0);
|
|
25
|
-
}, [tokens
|
|
25
|
+
}, [tokens]);
|
|
26
26
|
const isShowTokens = useMemo(() => tokensSync !== tokensWrong, [tokensSync, tokensWrong]);
|
|
27
27
|
const realTokensVisible = useMemo(() => (isShowTokens ? tokensVisible : 0), [isShowTokens, tokensVisible]);
|
|
28
28
|
const realTokens = useMemo(() => (isShowTokens ? tokensSync : []), [isShowTokens, tokensSync]);
|
package/dist/view/index.js
CHANGED
|
@@ -17,11 +17,11 @@ const Interface = (props) => {
|
|
|
17
17
|
const propsCommon = useMemo(() => ({ isForce: isRealForce, transition, tokensVisible, tokens, wall, uid, locs }), [isRealForce, transition, tokensVisible, tokens, wall, uid, locs]);
|
|
18
18
|
const propsSpeaker = useMemo(() => ({ speakerText, speakerName, speakerColor }), [speakerText, speakerName, speakerColor]);
|
|
19
19
|
const propsText = useMemo(() => ({ opacity, color }), [opacity, color]);
|
|
20
|
-
const propsView = useMemo(() => ({ ...propsCommon, ...propsSpeaker, ...propsText }), [propsCommon, propsSpeaker, propsText]);
|
|
20
|
+
const propsView = useMemo(() => ({ isShow, ...propsCommon, ...propsSpeaker, ...propsText }), [isShow, propsCommon, propsSpeaker, propsText]);
|
|
21
21
|
const propsBackdrop = useMemo(() => ({ view, transition, ...props }), [view, transition, props]);
|
|
22
|
-
const propsDialog = useMemo(() => ({ isViewActive: view === "adv", ...propsView, ...props }), [view, propsView, props]);
|
|
23
|
-
const propsLine = useMemo(() => ({ isViewActive: view === "line", ...propsView, ...props }), [view, propsView, props]);
|
|
24
|
-
const propsWall = useMemo(() => ({ isViewActive: view === "wall", ...propsView, ...props }), [view, propsView, props]);
|
|
22
|
+
const propsDialog = useMemo(() => ({ view, isViewActive: view === "adv", ...propsView, ...props }), [view, propsView, props]);
|
|
23
|
+
const propsLine = useMemo(() => ({ view, isViewActive: view === "line", ...propsView, ...props }), [view, propsView, props]);
|
|
24
|
+
const propsWall = useMemo(() => ({ view, isViewActive: view === "wall", ...propsView, ...props }), [view, propsView, props]);
|
|
25
25
|
return (_jsxs(Screen, { isShow: isShow, isForce: isRealForce, isHidden: !isVisible, isDisableAutoread: false, isAllowAutoread: Boolean(isShow && isVisible), isIgnoreOnScreenshot: false, transition: transition, zIndex: PARAMS.INTERFACE.ZINDEX, onClick: onClick, children: [_jsx(InterfaceBackdrop, { ...propsBackdrop }), _jsx(InterfaceViewDialog, { ...propsDialog }), _jsx(InterfaceViewLine, { ...propsLine }), _jsx(InterfaceViewWall, { ...propsWall })] }));
|
|
26
26
|
};
|
|
27
27
|
export const render = createRenderFunc(Interface);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const useTokensHook = (isShow: boolean, tokens: TokenizedChar[], tokensVi
|
|
|
8
8
|
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
if (isShow) setTokensWrong(tokens);
|
|
11
|
-
}, [isShow
|
|
11
|
+
}, [isShow]);
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
setTimeout(() => {
|
|
14
14
|
if (savedUid === uid) {
|
|
@@ -22,7 +22,7 @@ export const useTokensHook = (isShow: boolean, tokens: TokenizedChar[], tokensVi
|
|
|
22
22
|
setTokensSync(tokens);
|
|
23
23
|
});
|
|
24
24
|
}, 0);
|
|
25
|
-
}, [tokens
|
|
25
|
+
}, [tokens]);
|
|
26
26
|
|
|
27
27
|
const isShowTokens = useMemo(() => tokensSync !== tokensWrong, [tokensSync, tokensWrong]);
|
|
28
28
|
const realTokensVisible = useMemo(() => (isShowTokens ? tokensVisible : 0), [isShowTokens, tokensVisible]);
|
package/src/view/index.tsx
CHANGED
|
@@ -40,12 +40,12 @@ const Interface = (props: InterfaceComponentProps) => {
|
|
|
40
40
|
);
|
|
41
41
|
const propsSpeaker = useMemo(() => ({ speakerText, speakerName, speakerColor }), [speakerText, speakerName, speakerColor]);
|
|
42
42
|
const propsText = useMemo(() => ({ opacity, color }), [opacity, color]);
|
|
43
|
-
const propsView = useMemo(() => ({ ...propsCommon, ...propsSpeaker, ...propsText }), [propsCommon, propsSpeaker, propsText]);
|
|
43
|
+
const propsView = useMemo(() => ({ isShow, ...propsCommon, ...propsSpeaker, ...propsText }), [isShow, propsCommon, propsSpeaker, propsText]);
|
|
44
44
|
|
|
45
45
|
const propsBackdrop = useMemo(() => ({ view, transition, ...props }), [view, transition, props]);
|
|
46
|
-
const propsDialog = useMemo(() => ({ isViewActive: view === "adv", ...propsView, ...props }), [view, propsView, props]);
|
|
47
|
-
const propsLine = useMemo(() => ({ isViewActive: view === "line", ...propsView, ...props }), [view, propsView, props]);
|
|
48
|
-
const propsWall = useMemo(() => ({ isViewActive: view === "wall", ...propsView, ...props }), [view, propsView, props]);
|
|
46
|
+
const propsDialog = useMemo(() => ({ view, isViewActive: view === "adv", ...propsView, ...props }), [view, propsView, props]);
|
|
47
|
+
const propsLine = useMemo(() => ({ view, isViewActive: view === "line", ...propsView, ...props }), [view, propsView, props]);
|
|
48
|
+
const propsWall = useMemo(() => ({ view, isViewActive: view === "wall", ...propsView, ...props }), [view, propsView, props]);
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<Screen
|