@vnejs/plugins.views.scenario.interface 0.1.26 → 0.1.28
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/modules/controller.d.ts +4 -3
- package/dist/modules/controller.js +10 -10
- package/dist/modules/interface.d.ts +3 -3
- package/dist/modules/interface.js +11 -16
- package/dist/utils/interface.d.ts +14 -3
- package/package.json +2 -1
- package/src/modules/controller.ts +17 -12
- package/src/modules/interface.ts +19 -20
- package/src/utils/interface.ts +17 -3
- package/src/view/components/InterfaceViewWall.tsx +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleController } from "@vnejs/module.components";
|
|
2
2
|
import type { InterfacePluginConstants, InterfacePluginEvents, InterfacePluginParams, InterfacePluginSettings } from "../types.js";
|
|
3
|
-
import type { InterfaceForcePayload, InterfacePluginState } from "../utils/interface.js";
|
|
3
|
+
import type { InterfaceForcePayload, InterfacePluginState, InterfaceSpeakerChangedPayload, InterfaceTextChangedPayload, InterfaceWallChangedPayload } from "../utils/interface.js";
|
|
4
4
|
export declare class InterfaceController extends ModuleController<InterfacePluginEvents, InterfacePluginConstants, InterfacePluginSettings, InterfacePluginParams, InterfacePluginState> {
|
|
5
5
|
name: string;
|
|
6
6
|
isStateChangeInProcess: boolean;
|
|
@@ -15,8 +15,9 @@ export declare class InterfaceController extends ModuleController<InterfacePlugi
|
|
|
15
15
|
init: () => Promise<unknown[]> | undefined;
|
|
16
16
|
onShowChanged: ({ isForce }?: InterfaceForcePayload) => Promise<unknown[]> | undefined;
|
|
17
17
|
onViewChanged: ({ isForce }?: InterfaceForcePayload) => Promise<unknown[]> | undefined;
|
|
18
|
-
onTextChanged: () => Promise<unknown[] | undefined>;
|
|
19
|
-
|
|
18
|
+
onTextChanged: ({ tokens, uid, tokensVisible }?: InterfaceTextChangedPayload) => Promise<unknown[] | undefined>;
|
|
19
|
+
onWallChanged: ({ wall }?: InterfaceWallChangedPayload) => Promise<unknown[] | undefined>;
|
|
20
|
+
onSpeakerChanged: ({ speaker, meet }?: InterfaceSpeakerChangedPayload) => Promise<unknown[] | undefined>;
|
|
20
21
|
onVisibleChanged: ({ isForce }?: InterfaceForcePayload) => Promise<void>;
|
|
21
22
|
onStateChanged: () => Promise<void>;
|
|
22
23
|
getDefaultState: () => InterfacePluginState;
|
|
@@ -16,6 +16,7 @@ export class InterfaceController extends ModuleController {
|
|
|
16
16
|
this.on(this.EVENTS.INTERFACE.SHOW_CHANGED, this.onShowChanged);
|
|
17
17
|
this.on(this.EVENTS.INTERFACE.VIEW_CHANGED, this.onViewChanged);
|
|
18
18
|
this.on(this.EVENTS.INTERFACE.TEXT_CHANGED, this.onTextChanged);
|
|
19
|
+
this.on(this.EVENTS.INTERFACE.WALL_CHANGED, this.onWallChanged);
|
|
19
20
|
this.on(this.EVENTS.INTERFACE.SPEAKER_CHANGED, this.onSpeakerChanged);
|
|
20
21
|
this.on(this.EVENTS.INTERFACE.STATE_CHANGED, this.onStateChanged);
|
|
21
22
|
this.on(this.EVENTS.INTERFACE.VISIBLE_CHANGED, this.onVisibleChanged);
|
|
@@ -32,14 +33,17 @@ export class InterfaceController extends ModuleController {
|
|
|
32
33
|
if (this.state.view !== view)
|
|
33
34
|
return this.updateStateAndView({ view }, isForce, !isForce);
|
|
34
35
|
};
|
|
35
|
-
onTextChanged = async () => {
|
|
36
|
-
const { tokens = [], wall = [], uid = "", tokensVisible = 0 } = this.globalState.interface;
|
|
36
|
+
onTextChanged = async ({ tokens = [], uid = "", tokensVisible = 0 } = {}) => {
|
|
37
37
|
while (this.isStateChangeInProcess)
|
|
38
38
|
await this.waitRerender();
|
|
39
|
-
return this.updateStateAndViewFast({ tokens,
|
|
39
|
+
return this.updateStateAndViewFast({ tokens, uid, tokensVisible });
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
onWallChanged = async ({ wall = [] } = {}) => {
|
|
42
|
+
while (this.isStateChangeInProcess)
|
|
43
|
+
await this.waitRerender();
|
|
44
|
+
return this.updateStateAndViewFast({ wall });
|
|
45
|
+
};
|
|
46
|
+
onSpeakerChanged = async ({ speaker = "", meet = 0 } = {}) => {
|
|
43
47
|
while (this.isStateChangeInProcess)
|
|
44
48
|
await this.waitRerender();
|
|
45
49
|
return this.updateStateAndViewFast({ speaker, meet });
|
|
@@ -48,11 +52,7 @@ export class InterfaceController extends ModuleController {
|
|
|
48
52
|
const { isVisible = false } = this.globalState.interface;
|
|
49
53
|
if (this.state.isVisible === isVisible)
|
|
50
54
|
return;
|
|
51
|
-
const args = {
|
|
52
|
-
key: `${this.name}-unvisible`,
|
|
53
|
-
controls: this.controlsUnvisible,
|
|
54
|
-
index: this.controlsIndex + 500,
|
|
55
|
-
};
|
|
55
|
+
const args = { key: `${this.name}-unvisible`, controls: this.controlsUnvisible, index: this.controlsIndex + 500 };
|
|
56
56
|
await this.emit(isVisible ? this.EVENTS.CONTROLS.POP : this.EVENTS.CONTROLS.PUSH, args);
|
|
57
57
|
await this.updateStateAndView({ isVisible }, isForce, !isForce);
|
|
58
58
|
};
|
|
@@ -11,7 +11,7 @@ export declare class Interface extends ModuleCore<InterfacePluginEvents, Interfa
|
|
|
11
11
|
onShow: ({ isForce }?: InterfaceForcePayload) => false | Promise<unknown[] | undefined>;
|
|
12
12
|
onHide: ({ isForce }?: InterfaceForcePayload) => false | Promise<unknown[] | undefined>;
|
|
13
13
|
onVisible: ({ isForce }?: InterfaceForcePayload) => Promise<unknown[]> | undefined;
|
|
14
|
-
onTextChanged: ({ tokens,
|
|
14
|
+
onTextChanged: ({ tokens, uid, tokensVisible }?: InterfaceTextChangedPayload) => Promise<unknown[]> | undefined;
|
|
15
15
|
onTextSpeakerChanged: ({ speaker, meet }?: InterfaceSpeakerChangedPayload) => Promise<unknown[]> | undefined;
|
|
16
16
|
onTextEmitBefore: () => Promise<unknown[]> | undefined;
|
|
17
17
|
onTextHide: () => Promise<unknown[]> | undefined;
|
|
@@ -21,8 +21,8 @@ export declare class Interface extends ModuleCore<InterfacePluginEvents, Interfa
|
|
|
21
21
|
setView: (view?: string, isForce?: boolean) => Promise<unknown[]> | undefined;
|
|
22
22
|
setShow: (isShow: boolean, isForce?: boolean) => Promise<unknown[] | undefined>;
|
|
23
23
|
setVisible: (isVisible: boolean, isForce?: boolean) => Promise<unknown[]> | undefined;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
emitTextChanged: (tokens?: InterfaceTextChangedPayload["tokens"], uid?: string, tokensVisible?: number) => Promise<unknown[]> | undefined;
|
|
25
|
+
emitSpeakerChanged: (speaker?: string, meet?: number) => Promise<unknown[]> | undefined;
|
|
26
26
|
setNewState: (view?: string, isVisible?: boolean, isShow?: boolean) => Promise<unknown[]> | undefined;
|
|
27
27
|
getDefaultState: () => InterfaceModuleState;
|
|
28
28
|
}
|
|
@@ -17,7 +17,7 @@ export class Interface extends ModuleCore {
|
|
|
17
17
|
};
|
|
18
18
|
init = () => this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { module: this.name, handler: this.onLineExec });
|
|
19
19
|
onLineExec = async ({ line = "" } = {}) => {
|
|
20
|
-
const isForce =
|
|
20
|
+
const isForce = this.shared.viewForceAnimationSources.isNotEmpty();
|
|
21
21
|
const [action = "", execArg = ""] = tokenizeExecLine(line);
|
|
22
22
|
if (action === "show")
|
|
23
23
|
await this.emit(this.EVENTS.INTERFACE.SHOW, { isForce });
|
|
@@ -31,10 +31,10 @@ export class Interface extends ModuleCore {
|
|
|
31
31
|
onShow = ({ isForce = false } = {}) => !this.state.isShow && this.setShow(true, isForce);
|
|
32
32
|
onHide = ({ isForce = false } = {}) => this.state.isShow && this.setShow(false, isForce);
|
|
33
33
|
onVisible = ({ isForce = false } = {}) => this.setVisible(!this.state.isVisible, isForce);
|
|
34
|
-
onTextChanged = ({ tokens,
|
|
35
|
-
onTextSpeakerChanged = ({ speaker, meet } = {}) => this.
|
|
34
|
+
onTextChanged = ({ tokens, uid, tokensVisible } = {}) => this.emitTextChanged(tokens, uid, tokensVisible);
|
|
35
|
+
onTextSpeakerChanged = ({ speaker, meet } = {}) => this.emitSpeakerChanged(speaker, meet);
|
|
36
36
|
onTextEmitBefore = () => this.emit(this.EVENTS.INTERFACE.SHOW);
|
|
37
|
-
onTextHide = () => this.
|
|
37
|
+
onTextHide = () => this.emitTextChanged([], "", 0);
|
|
38
38
|
onView = ({ view, isForce = false } = {}) => this.setView(view, isForce);
|
|
39
39
|
onStateSet = (payload) => {
|
|
40
40
|
const moduleState = this.getStateSlice(payload);
|
|
@@ -55,20 +55,15 @@ export class Interface extends ModuleCore {
|
|
|
55
55
|
this.state.isVisible = isVisible;
|
|
56
56
|
return this.emit(this.EVENTS.INTERFACE.VISIBLE_CHANGED, { isForce });
|
|
57
57
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return this.emit(this.EVENTS.INTERFACE.TEXT_CHANGED);
|
|
61
|
-
};
|
|
62
|
-
setSpeaker = (speaker = "", meet = 0) => {
|
|
63
|
-
Object.assign(this.state, { speaker, meet });
|
|
64
|
-
return this.emit(this.EVENTS.INTERFACE.SPEAKER_CHANGED);
|
|
65
|
-
};
|
|
58
|
+
emitTextChanged = (tokens = [], uid = "", tokensVisible) => this.emit(this.EVENTS.INTERFACE.TEXT_CHANGED, { tokens, uid, tokensVisible });
|
|
59
|
+
emitSpeakerChanged = (speaker = "", meet = 0) => this.emit(this.EVENTS.INTERFACE.SPEAKER_CHANGED, { speaker, meet });
|
|
66
60
|
setNewState = (view, isVisible, isShow) => {
|
|
67
61
|
Object.assign(this.state, { isShow, view, isVisible });
|
|
68
62
|
return this.emit(this.EVENTS.INTERFACE.STATE_CHANGED);
|
|
69
63
|
};
|
|
70
|
-
getDefaultState = () => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
getDefaultState = () => ({
|
|
65
|
+
view: this.PARAMS.INTERFACE.DEFAULT_VIEW,
|
|
66
|
+
isShow: false,
|
|
67
|
+
isVisible: false,
|
|
68
|
+
});
|
|
74
69
|
}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import type { ModuleControllerState } from "@vnejs/module.components";
|
|
2
|
-
import type { TokenizedChar
|
|
2
|
+
import type { TokenizedChar } from "@vnejs/contracts.text";
|
|
3
|
+
import type { WallElement } from "@vnejs/contracts.text.wall";
|
|
3
4
|
import type { InterfaceModuleState } from "@vnejs/contracts.views.scenario.interface";
|
|
4
5
|
export type { InterfaceModuleState };
|
|
5
|
-
export type
|
|
6
|
+
export type InterfaceRuntimeState = {
|
|
7
|
+
tokens: TokenizedChar[];
|
|
8
|
+
wall: WallElement[];
|
|
9
|
+
uid: string;
|
|
10
|
+
tokensVisible: number;
|
|
11
|
+
speaker: string;
|
|
12
|
+
meet: number;
|
|
13
|
+
};
|
|
14
|
+
export type InterfacePluginState = ModuleControllerState & InterfaceModuleState & InterfaceRuntimeState & {
|
|
6
15
|
isFast?: boolean;
|
|
7
16
|
locs?: Record<string, string>;
|
|
8
17
|
prefix?: string;
|
|
@@ -22,10 +31,12 @@ export type InterfaceViewPayload = InterfaceForcePayload & {
|
|
|
22
31
|
};
|
|
23
32
|
export type InterfaceTextChangedPayload = {
|
|
24
33
|
tokens?: TokenizedChar[];
|
|
25
|
-
wall?: WallElement[];
|
|
26
34
|
uid?: string;
|
|
27
35
|
tokensVisible?: number;
|
|
28
36
|
};
|
|
37
|
+
export type InterfaceWallChangedPayload = {
|
|
38
|
+
wall?: WallElement[];
|
|
39
|
+
};
|
|
29
40
|
export type InterfaceSpeakerChangedPayload = {
|
|
30
41
|
speaker?: string;
|
|
31
42
|
meet?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/plugins.views.scenario.interface",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@vnejs/module.core": "~0.1.0",
|
|
38
38
|
"@vnejs/module.components": "~0.1.0",
|
|
39
39
|
"@vnejs/contracts.text": "~0.1.0",
|
|
40
|
+
"@vnejs/contracts.text.wall": "~0.1.0",
|
|
40
41
|
"@vnejs/shared": "~0.1.0",
|
|
41
42
|
"@vnejs/uis.react": "~0.1.0",
|
|
42
43
|
"@vnejs/uis.utils": "~0.1.0"
|
|
@@ -3,7 +3,13 @@ import type { ControlsPopPayload, ControlsPushPayload } from "@vnejs/module.comp
|
|
|
3
3
|
import { CONSTANTS as ControlsConstants } from "@vnejs/contracts.controls";
|
|
4
4
|
|
|
5
5
|
import type { InterfacePluginConstants, InterfacePluginEvents, InterfacePluginParams, InterfacePluginSettings } from "../types.js";
|
|
6
|
-
import type {
|
|
6
|
+
import type {
|
|
7
|
+
InterfaceForcePayload,
|
|
8
|
+
InterfacePluginState,
|
|
9
|
+
InterfaceSpeakerChangedPayload,
|
|
10
|
+
InterfaceTextChangedPayload,
|
|
11
|
+
InterfaceWallChangedPayload,
|
|
12
|
+
} from "../utils/interface.js";
|
|
7
13
|
|
|
8
14
|
export class InterfaceController extends ModuleController<
|
|
9
15
|
InterfacePluginEvents,
|
|
@@ -31,6 +37,7 @@ export class InterfaceController extends ModuleController<
|
|
|
31
37
|
this.on(this.EVENTS.INTERFACE.SHOW_CHANGED, this.onShowChanged);
|
|
32
38
|
this.on(this.EVENTS.INTERFACE.VIEW_CHANGED, this.onViewChanged);
|
|
33
39
|
this.on(this.EVENTS.INTERFACE.TEXT_CHANGED, this.onTextChanged);
|
|
40
|
+
this.on(this.EVENTS.INTERFACE.WALL_CHANGED, this.onWallChanged);
|
|
34
41
|
this.on(this.EVENTS.INTERFACE.SPEAKER_CHANGED, this.onSpeakerChanged);
|
|
35
42
|
this.on(this.EVENTS.INTERFACE.STATE_CHANGED, this.onStateChanged);
|
|
36
43
|
this.on(this.EVENTS.INTERFACE.VISIBLE_CHANGED, this.onVisibleChanged);
|
|
@@ -49,16 +56,17 @@ export class InterfaceController extends ModuleController<
|
|
|
49
56
|
|
|
50
57
|
if (this.state.view !== view) return this.updateStateAndView({ view }, isForce, !isForce);
|
|
51
58
|
};
|
|
52
|
-
onTextChanged = async () => {
|
|
53
|
-
const { tokens = [], wall = [], uid = "", tokensVisible = 0 } = this.globalState.interface;
|
|
54
|
-
|
|
59
|
+
onTextChanged = async ({ tokens = [], uid = "", tokensVisible = 0 }: InterfaceTextChangedPayload = {}) => {
|
|
55
60
|
while (this.isStateChangeInProcess) await this.waitRerender();
|
|
56
61
|
|
|
57
|
-
return this.updateStateAndViewFast({ tokens,
|
|
62
|
+
return this.updateStateAndViewFast({ tokens, uid, tokensVisible });
|
|
58
63
|
};
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
onWallChanged = async ({ wall = [] }: InterfaceWallChangedPayload = {}) => {
|
|
65
|
+
while (this.isStateChangeInProcess) await this.waitRerender();
|
|
61
66
|
|
|
67
|
+
return this.updateStateAndViewFast({ wall });
|
|
68
|
+
};
|
|
69
|
+
onSpeakerChanged = async ({ speaker = "", meet = 0 }: InterfaceSpeakerChangedPayload = {}) => {
|
|
62
70
|
while (this.isStateChangeInProcess) await this.waitRerender();
|
|
63
71
|
|
|
64
72
|
return this.updateStateAndViewFast({ speaker, meet });
|
|
@@ -68,11 +76,8 @@ export class InterfaceController extends ModuleController<
|
|
|
68
76
|
|
|
69
77
|
if (this.state.isVisible === isVisible) return;
|
|
70
78
|
|
|
71
|
-
const args = {
|
|
72
|
-
|
|
73
|
-
controls: this.controlsUnvisible,
|
|
74
|
-
index: this.controlsIndex + 500,
|
|
75
|
-
} satisfies ControlsPushPayload & ControlsPopPayload;
|
|
79
|
+
const args = { key: `${this.name}-unvisible`, controls: this.controlsUnvisible, index: this.controlsIndex + 500 } satisfies ControlsPushPayload &
|
|
80
|
+
ControlsPopPayload;
|
|
76
81
|
await this.emit(isVisible ? this.EVENTS.CONTROLS.POP : this.EVENTS.CONTROLS.PUSH, args);
|
|
77
82
|
await this.updateStateAndView({ isVisible }, isForce, !isForce);
|
|
78
83
|
};
|
package/src/modules/interface.ts
CHANGED
|
@@ -12,7 +12,13 @@ import type {
|
|
|
12
12
|
InterfaceViewPayload,
|
|
13
13
|
} from "../utils/interface.js";
|
|
14
14
|
|
|
15
|
-
export class Interface extends ModuleCore<
|
|
15
|
+
export class Interface extends ModuleCore<
|
|
16
|
+
InterfacePluginEvents,
|
|
17
|
+
InterfacePluginConstants,
|
|
18
|
+
InterfacePluginSettings,
|
|
19
|
+
InterfacePluginParams,
|
|
20
|
+
InterfaceModuleState
|
|
21
|
+
> {
|
|
16
22
|
name = "interface";
|
|
17
23
|
|
|
18
24
|
subscribe = () => {
|
|
@@ -34,7 +40,7 @@ export class Interface extends ModuleCore<InterfacePluginEvents, InterfacePlugin
|
|
|
34
40
|
init = () => this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { module: this.name, handler: this.onLineExec });
|
|
35
41
|
|
|
36
42
|
onLineExec = async ({ line = "" }: LineExecHandlerArg = {}) => {
|
|
37
|
-
const isForce =
|
|
43
|
+
const isForce = this.shared.viewForceAnimationSources.isNotEmpty();
|
|
38
44
|
|
|
39
45
|
const [action = "", execArg = ""] = tokenizeExecLine(line);
|
|
40
46
|
|
|
@@ -49,10 +55,10 @@ export class Interface extends ModuleCore<InterfacePluginEvents, InterfacePlugin
|
|
|
49
55
|
onShow = ({ isForce = false }: InterfaceForcePayload = {}) => !this.state.isShow && this.setShow(true, isForce);
|
|
50
56
|
onHide = ({ isForce = false }: InterfaceForcePayload = {}) => this.state.isShow && this.setShow(false, isForce);
|
|
51
57
|
onVisible = ({ isForce = false }: InterfaceForcePayload = {}) => this.setVisible(!this.state.isVisible, isForce);
|
|
52
|
-
onTextChanged = ({ tokens,
|
|
53
|
-
onTextSpeakerChanged = ({ speaker, meet }: InterfaceSpeakerChangedPayload = {}) => this.
|
|
58
|
+
onTextChanged = ({ tokens, uid, tokensVisible }: InterfaceTextChangedPayload = {}) => this.emitTextChanged(tokens, uid, tokensVisible);
|
|
59
|
+
onTextSpeakerChanged = ({ speaker, meet }: InterfaceSpeakerChangedPayload = {}) => this.emitSpeakerChanged(speaker, meet);
|
|
54
60
|
onTextEmitBefore = () => this.emit(this.EVENTS.INTERFACE.SHOW);
|
|
55
|
-
onTextHide = () => this.
|
|
61
|
+
onTextHide = () => this.emitTextChanged([], "", 0);
|
|
56
62
|
onView = ({ view, isForce = false }: InterfaceViewPayload = {}) => this.setView(view, isForce);
|
|
57
63
|
onStateSet = (payload: ModuleGlobalStateRegistry) => {
|
|
58
64
|
const moduleState = this.getStateSlice(payload);
|
|
@@ -78,25 +84,18 @@ export class Interface extends ModuleCore<InterfacePluginEvents, InterfacePlugin
|
|
|
78
84
|
|
|
79
85
|
return this.emit(this.EVENTS.INTERFACE.VISIBLE_CHANGED, { isForce });
|
|
80
86
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return this.emit(this.EVENTS.INTERFACE.TEXT_CHANGED);
|
|
85
|
-
};
|
|
86
|
-
setSpeaker = (speaker = "", meet = 0) => {
|
|
87
|
-
Object.assign(this.state, { speaker, meet });
|
|
88
|
-
|
|
89
|
-
return this.emit(this.EVENTS.INTERFACE.SPEAKER_CHANGED);
|
|
90
|
-
};
|
|
87
|
+
emitTextChanged = (tokens: InterfaceTextChangedPayload["tokens"] = [], uid = "", tokensVisible?: number) =>
|
|
88
|
+
this.emit(this.EVENTS.INTERFACE.TEXT_CHANGED, { tokens, uid, tokensVisible });
|
|
89
|
+
emitSpeakerChanged = (speaker = "", meet = 0) => this.emit(this.EVENTS.INTERFACE.SPEAKER_CHANGED, { speaker, meet });
|
|
91
90
|
setNewState = (view?: string, isVisible?: boolean, isShow?: boolean) => {
|
|
92
91
|
Object.assign(this.state, { isShow, view, isVisible });
|
|
93
92
|
|
|
94
93
|
return this.emit(this.EVENTS.INTERFACE.STATE_CHANGED);
|
|
95
94
|
};
|
|
96
95
|
|
|
97
|
-
getDefaultState = (): InterfaceModuleState => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
};
|
|
96
|
+
getDefaultState = (): InterfaceModuleState => ({
|
|
97
|
+
view: this.PARAMS.INTERFACE.DEFAULT_VIEW,
|
|
98
|
+
isShow: false,
|
|
99
|
+
isVisible: false,
|
|
100
|
+
});
|
|
102
101
|
}
|
package/src/utils/interface.ts
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import type { ModuleControllerState } from "@vnejs/module.components";
|
|
2
|
-
import type { TokenizedChar
|
|
2
|
+
import type { TokenizedChar } from "@vnejs/contracts.text";
|
|
3
|
+
import type { WallElement } from "@vnejs/contracts.text.wall";
|
|
3
4
|
import type { InterfaceModuleState } from "@vnejs/contracts.views.scenario.interface";
|
|
4
5
|
|
|
5
6
|
export type { InterfaceModuleState };
|
|
6
7
|
|
|
8
|
+
export type InterfaceRuntimeState = {
|
|
9
|
+
tokens: TokenizedChar[];
|
|
10
|
+
wall: WallElement[];
|
|
11
|
+
uid: string;
|
|
12
|
+
tokensVisible: number;
|
|
13
|
+
speaker: string;
|
|
14
|
+
meet: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
7
17
|
export type InterfacePluginState = ModuleControllerState &
|
|
8
|
-
InterfaceModuleState &
|
|
18
|
+
InterfaceModuleState &
|
|
19
|
+
InterfaceRuntimeState & {
|
|
9
20
|
isFast?: boolean;
|
|
10
21
|
locs?: Record<string, string>;
|
|
11
22
|
prefix?: string;
|
|
@@ -28,11 +39,14 @@ export type InterfaceViewPayload = InterfaceForcePayload & {
|
|
|
28
39
|
|
|
29
40
|
export type InterfaceTextChangedPayload = {
|
|
30
41
|
tokens?: TokenizedChar[];
|
|
31
|
-
wall?: WallElement[];
|
|
32
42
|
uid?: string;
|
|
33
43
|
tokensVisible?: number;
|
|
34
44
|
};
|
|
35
45
|
|
|
46
|
+
export type InterfaceWallChangedPayload = {
|
|
47
|
+
wall?: WallElement[];
|
|
48
|
+
};
|
|
49
|
+
|
|
36
50
|
export type InterfaceSpeakerChangedPayload = {
|
|
37
51
|
speaker?: string;
|
|
38
52
|
meet?: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { TextSpeakerInfo, TokenizedChar
|
|
1
|
+
import type { TextSpeakerInfo, TokenizedChar } from "@vnejs/contracts.text";
|
|
2
|
+
import type { WallElement } from "@vnejs/contracts.text.wall";
|
|
2
3
|
import { Flex, PositionBox, Scrollbar, SmoothText, Text, useMemo } from "@vnejs/uis.react";
|
|
3
4
|
|
|
4
5
|
import type { Params as InterfaceContractParams } from "@vnejs/contracts.views.scenario.interface";
|