vrtalk-web-sdk 0.1.521 → 0.1.523
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/index.d.ts +2 -0
- package/dist/src/model/general/free-button.d.ts +2 -1
- package/dist/src/model/general/multi-language-str.d.ts +2 -1
- package/dist/src/model/vr/vr-action.d.ts +29 -20
- package/dist/src/model/vr/vr-content-card.d.ts +3 -2
- package/dist/src/model/vr/vr-content-data.d.ts +2 -0
- package/dist/src/model/vr/vr-cover-settings.d.ts +4 -3
- package/dist/src/model/vr/vr-flow.d.ts +4 -3
- package/dist/src/model/vr/xr-hamburger-menu.d.ts +8 -2
- package/dist/src/model/vr/xr-logic.d.ts +20 -5
- package/dist/src/model/vr/xr-message-card.d.ts +3 -2
- package/dist/src/model/vr/xr-monitor.d.ts +7 -3
- package/dist/src/model/vr/xr-prepare.d.ts +3 -3
- package/dist/src/model/vr-component/vr-component-2d-panel-data.d.ts +26 -6
- package/dist/src/model/vr-component/vr-component-2d-text-data.d.ts +2 -1
- package/dist/src/model/vr-component/vr-component-tag-data.d.ts +3 -2
- package/dist/src/utils/multi-language-str-util.d.ts +34 -0
- package/dist/src/utils/xr-variable-type-enum-migration.d.ts +39 -0
- package/dist/vrtalk-web-sdk.js +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -2,3 +2,5 @@ export * from './model';
|
|
|
2
2
|
export * from './player';
|
|
3
3
|
export * from './parent';
|
|
4
4
|
export { migrateTriggersToCentralized } from './utils/trigger-migration';
|
|
5
|
+
export { migrateXrVariableTypeEnum } from './utils/xr-variable-type-enum-migration';
|
|
6
|
+
export { pickMultiLanguageStr, normalizeMultiLanguageStr, createMultiLanguageStr, normalizeBrowserLanguage, pickCurrentLanguage, } from './utils/multi-language-str-util';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { VRTalkBaseData } from './vrtalk-base-data';
|
|
2
2
|
import { XrAnyAction, XrVariable } from '@/model';
|
|
3
|
+
import { MultiLanguageStr } from './multi-language-str';
|
|
3
4
|
/**
|
|
4
5
|
* 自由按钮,在其他组件中动态创建出来的按钮
|
|
5
6
|
* 样式跟随当时的场景决定,该模型只定义按钮信息和对应的触发器
|
|
6
7
|
* 如内容卡片、vrflow步骤中等等
|
|
7
8
|
*/
|
|
8
9
|
export declare class FreeButton extends VRTalkBaseData {
|
|
9
|
-
name:
|
|
10
|
+
name: MultiLanguageStr;
|
|
10
11
|
color: import("@/model").Color;
|
|
11
12
|
textColor: import("@/model").Color;
|
|
12
13
|
additionalData: {};
|
|
@@ -11,10 +11,11 @@ export declare class LanguageTypeDefine {
|
|
|
11
11
|
static readonly ES: LanguageType;
|
|
12
12
|
static readonly FR: LanguageType;
|
|
13
13
|
static readonly DE: LanguageType;
|
|
14
|
+
static readonly ALL: LanguageType[];
|
|
14
15
|
}
|
|
15
16
|
export declare class MultiLanguageStr {
|
|
16
17
|
original_content: string;
|
|
17
|
-
|
|
18
|
+
only_use_original_content: boolean;
|
|
18
19
|
zh_cn: string;
|
|
19
20
|
zh_tw: string;
|
|
20
21
|
zh_hk: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Color, type MediaLoopMode, Vector2, Vector3, VrCameraMoveTransitionType } from '../general';
|
|
2
2
|
import { VrComponent2dDeformationSettings } from '../vr-component/vr-component-data';
|
|
3
3
|
import { XrTypedValue, XrVariableScopeType, XrVariableTarget } from './xr-logic';
|
|
4
|
+
import { MultiLanguageStr } from '../general/multi-language-str';
|
|
4
5
|
export declare type XrActionCategory = 'basic' | 'condition' | 'count_loop' | 'expression_loop';
|
|
5
6
|
export declare class XrActionCategoryDefine {
|
|
6
7
|
static readonly BASIC: XrActionCategory;
|
|
@@ -45,7 +46,7 @@ export declare class XrExpressionLoopAction {
|
|
|
45
46
|
checkExpressionPosition: XrExpressionLoopActionCheckExpressionPosition;
|
|
46
47
|
actionList: XrAnyAction[];
|
|
47
48
|
}
|
|
48
|
-
export declare type VrActionType = 'system_common_wait' | 'system_set_interactive_state' | 'system_ui_settings_change' | 'component_general_change_visibility' | 'component_general_change_transform' | 'component_general_play_transition_animation' | 'component_general_stop_transition_animation' | 'component_2d_general_change_deformation_settings' | 'component_general_audio_source_play_control' | 'component_general_audio_source_pause' | 'component_general_audio_source_change_loop_mode' | 'component_2d_image_change_source' | 'component_2d_video_change_source' | 'component_2d_video_change_play_state' | 'component_2d_video_change_mute_state' | 'component_2d_text_change_source' | 'component_2d_panel_change_scene' | 'component_2d_panel_button_change_enabled' | 'component_3d_box_change_color' | 'component_3d_model_play_animation_clip' | 'component_3d_model_stop_animation_clip' | 'information_content_card_show' | 'information_content_card_close' | 'information_link_open' | 'information_link_close' | 'audio_center_play_list' | 'audio_center_pause' | 'audio_center_player_change_display_mode' | 'audio_center_set_volume' | 'sweep_change_enabled' | 'sweep_change_panorama' | 'sweep_marker_change_enabled' | 'sweep_reset_to_default' | 'sweep_only_enable_current' | 'camera_move_to' | 'camera_dolly_move' | 'camera_dolly_stop' | 'navigation_start' | 'navigation_stop' | 'logic_variable_modify' | 'logic_variable_number_add' | 'logic_variable_number_subtract' | 'logic_variable_string_append' | 'logic_variable_string_trim_end' | 'logic_variable_string_advanced' | 'logic_variable_boolean_toggle' | 'flow_enter' | 'flow_exit' | 'monitor_change_enabled' | 'monitor_switch_active_tab' | 'monitor_component_change_visibility' | 'layer_change_visibility' | 'hamburger_menu_node_change_visibility' | 'canvas_component_change_visibility' | 'message_card_change_show_state' | 'tts_play_voice' | 'tts_realtime_stream' | 'background_thread_start' | 'background_thread_pause' | 'background_thread_stop' | 'ai_agent_activate' | 'ai_agent_hide' | 'ai_agent_trigger_monologue' | 'ai_agent_trigger_conversation' | 'ability_enable' | 'ability_stop' | 'cloud_form_show_dialog' | 'cloud_form_collect_field' | 'cloud_form_submit' | 'cloud_form_reset' | 'hit_analytics_event' | 'popup_user_form_show_dialog' | 'logic_random_number' | 'logic_random_color' | 'logic_current_time' | 'logic_random_pick_string' | 'logic_random_pick_number' | 'logic_random_pick_boolean' | 'logic_random_pick_enum' | 'logic_random_pick_color' | 'logic_random_pick_css_color';
|
|
49
|
+
export declare type VrActionType = 'system_common_wait' | 'system_set_interactive_state' | 'system_ui_settings_change' | 'component_general_change_visibility' | 'component_general_change_transform' | 'component_general_play_transition_animation' | 'component_general_stop_transition_animation' | 'component_2d_general_change_deformation_settings' | 'component_general_audio_source_play_control' | 'component_general_audio_source_pause' | 'component_general_audio_source_change_loop_mode' | 'component_2d_image_change_source' | 'component_2d_video_change_source' | 'component_2d_video_change_play_state' | 'component_2d_video_change_mute_state' | 'component_2d_text_change_source' | 'component_2d_panel_change_scene' | 'component_2d_panel_button_change_enabled' | 'component_3d_box_change_color' | 'component_3d_model_play_animation_clip' | 'component_3d_model_stop_animation_clip' | 'information_content_card_show' | 'information_content_card_close' | 'information_link_open' | 'information_link_close' | 'audio_center_play_list' | 'audio_center_pause' | 'audio_center_player_change_display_mode' | 'audio_center_set_volume' | 'sweep_change_enabled' | 'sweep_change_panorama' | 'sweep_marker_change_enabled' | 'sweep_reset_to_default' | 'sweep_only_enable_current' | 'camera_move_to' | 'camera_dolly_move' | 'camera_dolly_stop' | 'navigation_start' | 'navigation_stop' | 'logic_variable_modify' | 'logic_variable_number_add' | 'logic_variable_number_subtract' | 'logic_variable_string_append' | 'logic_variable_string_trim_end' | 'logic_variable_string_advanced' | 'logic_variable_boolean_toggle' | 'flow_enter' | 'flow_exit' | 'monitor_change_enabled' | 'monitor_switch_active_tab' | 'monitor_component_change_visibility' | 'layer_change_visibility' | 'hamburger_menu_node_change_visibility' | 'canvas_component_change_visibility' | 'message_card_change_show_state' | 'tts_play_voice' | 'tts_realtime_stream' | 'background_thread_start' | 'background_thread_pause' | 'background_thread_stop' | 'ai_agent_activate' | 'ai_agent_hide' | 'ai_agent_trigger_monologue' | 'ai_agent_trigger_conversation' | 'ability_enable' | 'ability_stop' | 'cloud_form_show_dialog' | 'cloud_form_collect_field' | 'cloud_form_submit' | 'cloud_form_reset' | 'hit_analytics_event' | 'popup_user_form_show_dialog' | 'logic_random_number' | 'logic_random_color' | 'logic_current_time' | 'logic_random_pick_string' | 'logic_random_pick_number' | 'logic_random_pick_boolean' | 'logic_random_pick_enum' | 'logic_random_pick_color' | 'logic_random_pick_css_color' | 'logic_random_pick_from_recommend_options';
|
|
49
50
|
export declare class VrActionTypeDefine {
|
|
50
51
|
static readonly SYSTEM_COMMON_WAIT: VrActionType;
|
|
51
52
|
static readonly COMPONENT_GENERAL_CHANGE_VISIBILITY: VrActionType;
|
|
@@ -125,9 +126,9 @@ export declare class VrActionTypeDefine {
|
|
|
125
126
|
static readonly LOGIC_RANDOM_PICK_STRING: VrActionType;
|
|
126
127
|
static readonly LOGIC_RANDOM_PICK_NUMBER: VrActionType;
|
|
127
128
|
static readonly LOGIC_RANDOM_PICK_BOOLEAN: VrActionType;
|
|
128
|
-
static readonly LOGIC_RANDOM_PICK_ENUM: VrActionType;
|
|
129
129
|
static readonly LOGIC_RANDOM_PICK_COLOR: VrActionType;
|
|
130
130
|
static readonly LOGIC_RANDOM_PICK_CSS_COLOR: VrActionType;
|
|
131
|
+
static readonly LOGIC_RANDOM_PICK_FROM_RECOMMEND_OPTIONS: VrActionType;
|
|
131
132
|
}
|
|
132
133
|
export declare class VrActionParamsAbilityEnable {
|
|
133
134
|
abilityId: string;
|
|
@@ -393,7 +394,7 @@ export declare class TtsTextModeDefine {
|
|
|
393
394
|
export declare class VrActionParamsTtsPlayVoice {
|
|
394
395
|
voiceId: string;
|
|
395
396
|
textMode: TtsTextMode;
|
|
396
|
-
text:
|
|
397
|
+
text: MultiLanguageStr;
|
|
397
398
|
textRef?: XrTypedValue<string>;
|
|
398
399
|
textExpression: string;
|
|
399
400
|
showSubtitle: boolean;
|
|
@@ -405,7 +406,7 @@ export declare class VrActionParamsTtsPlayVoice {
|
|
|
405
406
|
export declare class VrActionParamsTtsRealtimeStream {
|
|
406
407
|
voiceId: string;
|
|
407
408
|
textMode: TtsTextMode;
|
|
408
|
-
text:
|
|
409
|
+
text: MultiLanguageStr;
|
|
409
410
|
textRef?: XrTypedValue<string>;
|
|
410
411
|
textExpression: string;
|
|
411
412
|
showSubtitle: boolean;
|
|
@@ -526,12 +527,12 @@ export declare class PopupUserFormDataTypeDefaultVariant {
|
|
|
526
527
|
static getDefault(dataType: PopupUserFormDataType): PopupUserFormControlVariant;
|
|
527
528
|
}
|
|
528
529
|
export declare class PopupUserFormOption {
|
|
529
|
-
label:
|
|
530
|
+
label: MultiLanguageStr;
|
|
530
531
|
value: string | number;
|
|
531
532
|
iconUrl: string;
|
|
532
533
|
imageUrl: string;
|
|
533
|
-
description:
|
|
534
|
-
badge:
|
|
534
|
+
description: MultiLanguageStr;
|
|
535
|
+
badge: MultiLanguageStr;
|
|
535
536
|
color: string;
|
|
536
537
|
disabled: boolean;
|
|
537
538
|
}
|
|
@@ -580,8 +581,8 @@ export declare class PopupUserFormControlConfig {
|
|
|
580
581
|
colorSwatchSize: number;
|
|
581
582
|
colorSwatchShape: 'square' | 'circle';
|
|
582
583
|
colorSwatchColumns: number;
|
|
583
|
-
booleanTrueLabel:
|
|
584
|
-
booleanFalseLabel:
|
|
584
|
+
booleanTrueLabel: MultiLanguageStr;
|
|
585
|
+
booleanFalseLabel: MultiLanguageStr;
|
|
585
586
|
booleanTrueIconUrl: string;
|
|
586
587
|
booleanFalseIconUrl: string;
|
|
587
588
|
booleanTrueColor: string;
|
|
@@ -593,9 +594,9 @@ export declare class PopupUserFormControlConfig {
|
|
|
593
594
|
}
|
|
594
595
|
export declare class PopupUserFormField {
|
|
595
596
|
fieldKey: string;
|
|
596
|
-
label:
|
|
597
|
-
description:
|
|
598
|
-
placeholder:
|
|
597
|
+
label: MultiLanguageStr;
|
|
598
|
+
description: MultiLanguageStr;
|
|
599
|
+
placeholder: MultiLanguageStr;
|
|
599
600
|
required: boolean;
|
|
600
601
|
dataType: PopupUserFormDataType;
|
|
601
602
|
defaultValue: string | number | boolean | object | null;
|
|
@@ -604,10 +605,10 @@ export declare class PopupUserFormField {
|
|
|
604
605
|
boundVariableKey: string;
|
|
605
606
|
}
|
|
606
607
|
export declare class VrActionParamsPopupUserFormShowDialog {
|
|
607
|
-
title:
|
|
608
|
-
description:
|
|
609
|
-
submitButtonText:
|
|
610
|
-
cancelButtonText:
|
|
608
|
+
title: MultiLanguageStr;
|
|
609
|
+
description: MultiLanguageStr;
|
|
610
|
+
submitButtonText: MultiLanguageStr;
|
|
611
|
+
cancelButtonText: MultiLanguageStr;
|
|
611
612
|
showCancelButton: boolean;
|
|
612
613
|
blockInteraction: boolean;
|
|
613
614
|
closeOnOverlayClick: boolean;
|
|
@@ -661,10 +662,6 @@ export declare class VrActionParamsLogicRandomPickBoolean {
|
|
|
661
662
|
target: XrVariableTarget;
|
|
662
663
|
candidates: XrTypedValue<boolean>[];
|
|
663
664
|
}
|
|
664
|
-
export declare class VrActionParamsLogicRandomPickEnum {
|
|
665
|
-
target: XrVariableTarget;
|
|
666
|
-
candidates: XrTypedValue<string>[];
|
|
667
|
-
}
|
|
668
665
|
export declare class VrActionParamsLogicRandomPickColor {
|
|
669
666
|
target: XrVariableTarget;
|
|
670
667
|
candidates: XrTypedValue<Color>[];
|
|
@@ -673,3 +670,15 @@ export declare class VrActionParamsLogicRandomPickCssColor {
|
|
|
673
670
|
target: XrVariableTarget;
|
|
674
671
|
candidates: XrTypedValue<string>[];
|
|
675
672
|
}
|
|
673
|
+
/**
|
|
674
|
+
* 逻辑 - 从变量自身的"推荐选项"中随机选一个并写入。
|
|
675
|
+
* 运行时按变量 type 读取对应字段:
|
|
676
|
+
* - string → stringRecommendOptions[i].value
|
|
677
|
+
* - number → numberRecommendOptions[i]
|
|
678
|
+
* - color → colorRecommendOptions[i]
|
|
679
|
+
* - css_color → cssColorRecommendOptions[i]
|
|
680
|
+
* 推荐选项为空时变量值不变,仅 warn。
|
|
681
|
+
*/
|
|
682
|
+
export declare class VrActionParamsLogicRandomPickFromRecommendOptions {
|
|
683
|
+
target: XrVariableTarget;
|
|
684
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FreeButton } from '../general/free-button';
|
|
2
2
|
import { VRTalkBaseData } from '../general/vrtalk-base-data';
|
|
3
|
+
import { MultiLanguageStr } from '../general/multi-language-str';
|
|
3
4
|
export declare type VrContentCardShowStyle = 'bubble' | 'dialog' | 'drawer';
|
|
4
5
|
export declare type VrContentCardMediaType = 'video' | 'image' | 'audio' | '3d_model' | 'link' | 'document';
|
|
5
6
|
export declare class VrContentCardMediaTypeDefine {
|
|
@@ -23,8 +24,8 @@ export declare class VrContentCard extends VRTalkBaseData {
|
|
|
23
24
|
name: string;
|
|
24
25
|
dialogWidth: string;
|
|
25
26
|
dialogHeight: string;
|
|
26
|
-
title:
|
|
27
|
-
richText:
|
|
27
|
+
title: MultiLanguageStr;
|
|
28
|
+
richText: MultiLanguageStr;
|
|
28
29
|
isAvailableForAi: boolean;
|
|
29
30
|
modules: VrContentCardModule[];
|
|
30
31
|
buttonList: FreeButton[];
|
|
@@ -27,6 +27,7 @@ import { XrCameraDollyPath } from '../../model/vr/xr-camera-dolly-path';
|
|
|
27
27
|
import { XrPrepareSettings } from '../../model/vr/xr-prepare';
|
|
28
28
|
import { XrAbility, XrAbilityGroup } from '@/model/vr/xr-ability';
|
|
29
29
|
import { XrHamburgerMenu } from './xr-hamburger-menu';
|
|
30
|
+
import { LanguageType } from '../general/multi-language-str';
|
|
30
31
|
/**
|
|
31
32
|
* VR内容数据构建器
|
|
32
33
|
*/
|
|
@@ -77,6 +78,7 @@ export declare class VrContentData {
|
|
|
77
78
|
vrDataKey: string;
|
|
78
79
|
mpModelId: string;
|
|
79
80
|
vrUnicode: string;
|
|
81
|
+
supportedLanguages: LanguageType[];
|
|
80
82
|
vrCoverSettings: VrCoverSettings;
|
|
81
83
|
vrPlayerUiSettings: VrPlayerUiSettings;
|
|
82
84
|
hamburgerMenu: XrHamburgerMenu;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MultiLanguageStr } from '../general/multi-language-str';
|
|
1
2
|
/**
|
|
2
3
|
* VR封面背景类型
|
|
3
4
|
*/
|
|
@@ -56,13 +57,13 @@ export declare class VrCoverSettings {
|
|
|
56
57
|
coverContentFitType: VrCoverBackgroundFitType;
|
|
57
58
|
coverMaskColor: import("../general/color").Color;
|
|
58
59
|
coverMaskBlur: number;
|
|
59
|
-
coverTitle:
|
|
60
|
-
coverDescription:
|
|
60
|
+
coverTitle: MultiLanguageStr;
|
|
61
|
+
coverDescription: MultiLanguageStr;
|
|
61
62
|
enabledEnterVrButton: boolean;
|
|
62
63
|
enterVrButtonType: VrCoverButtonType;
|
|
63
64
|
enterButtonBackgroundColor: import("../general/color").Color;
|
|
64
65
|
enterButtonForegroundColor: import("../general/color").Color;
|
|
65
66
|
enterButtonShadowColor: import("../general/color").Color;
|
|
66
|
-
textButtonContent:
|
|
67
|
+
textButtonContent: MultiLanguageStr;
|
|
67
68
|
constructor();
|
|
68
69
|
}
|
|
@@ -3,6 +3,7 @@ import { VrSignalTrigger } from './vr-signal';
|
|
|
3
3
|
import { XrAnyAction } from './vr-action';
|
|
4
4
|
import { Vector2 } from '../general';
|
|
5
5
|
import { XrVariable } from './xr-logic';
|
|
6
|
+
import { MultiLanguageStr } from '../general/multi-language-str';
|
|
6
7
|
export declare type VrFlowStatus = 'draft' | 'published';
|
|
7
8
|
export declare class VrFlowStatusDefine {
|
|
8
9
|
static readonly DRAFT: VrFlowStatus;
|
|
@@ -41,10 +42,10 @@ export declare class VrFlowStep {
|
|
|
41
42
|
id: string;
|
|
42
43
|
type: VrFlowStepType;
|
|
43
44
|
name: string;
|
|
44
|
-
title:
|
|
45
|
-
description:
|
|
45
|
+
title: MultiLanguageStr;
|
|
46
|
+
description: MultiLanguageStr;
|
|
46
47
|
showArriveDescription: boolean;
|
|
47
|
-
arriveDescription:
|
|
48
|
+
arriveDescription: MultiLanguageStr;
|
|
48
49
|
note: string;
|
|
49
50
|
flagImageSrc: string;
|
|
50
51
|
flagImageSize: Vector2;
|
|
@@ -102,6 +102,7 @@ export declare class XrHamburgerMenuGroup extends XrHamburgerMenuNode {
|
|
|
102
102
|
constructor();
|
|
103
103
|
icon: string;
|
|
104
104
|
children: XrHamburgerMenuAnyNode[];
|
|
105
|
+
defaultExpanded: boolean;
|
|
105
106
|
}
|
|
106
107
|
/**
|
|
107
108
|
* 富文本节点
|
|
@@ -138,10 +139,13 @@ export declare type XrHamburgerMenuAnyNode = XrHamburgerMenuTextItem | XrHamburg
|
|
|
138
139
|
*/
|
|
139
140
|
export declare class XrHamburgerMenu {
|
|
140
141
|
drawerTitle: MultiLanguageStr;
|
|
142
|
+
drawerTitleColor: string;
|
|
141
143
|
drawerDescription: MultiLanguageStr;
|
|
144
|
+
drawerDescriptionColor: string;
|
|
142
145
|
nodeList: XrHamburgerMenuAnyNode[];
|
|
143
146
|
pcLayoutMode: XrHamburgerMenuPcLayoutMode;
|
|
144
147
|
backgroundColor: string;
|
|
148
|
+
backgroundBlur: number;
|
|
145
149
|
pcWidth: number;
|
|
146
150
|
}
|
|
147
151
|
export declare type XrHamburgerCanvasComponentType = 'image' | 'text' | 'progress-bar' | 'video' | 'button';
|
|
@@ -233,13 +237,14 @@ export declare class XrHamburgerCanvasComponentText extends XrHamburgerCanvasCom
|
|
|
233
237
|
type: XrHamburgerCanvasComponentType;
|
|
234
238
|
width: number;
|
|
235
239
|
height: number;
|
|
236
|
-
textContent:
|
|
240
|
+
textContent: MultiLanguageStr;
|
|
237
241
|
textColor: string;
|
|
238
242
|
textSize: number;
|
|
239
243
|
textVerticalAlign: XrHamburgerCanvasComponentVerticalAlign;
|
|
240
244
|
textAlign: XrHamburgerCanvasComponentTextAlign;
|
|
241
245
|
textBold: boolean;
|
|
242
246
|
textItalic: boolean;
|
|
247
|
+
textUnderline: boolean;
|
|
243
248
|
}
|
|
244
249
|
export declare class XrHamburgerCanvasComponentProgressBar extends XrHamburgerCanvasComponentBase {
|
|
245
250
|
type: XrHamburgerCanvasComponentType;
|
|
@@ -271,11 +276,12 @@ export declare class XrHamburgerCanvasComponentButton extends XrHamburgerCanvasC
|
|
|
271
276
|
paddingY: number;
|
|
272
277
|
backgroundColor: string;
|
|
273
278
|
hoverBackgroundColor: string;
|
|
274
|
-
textContent:
|
|
279
|
+
textContent: MultiLanguageStr;
|
|
275
280
|
textColor: string;
|
|
276
281
|
textSize: number;
|
|
277
282
|
textBold: boolean;
|
|
278
283
|
textItalic: boolean;
|
|
284
|
+
textUnderline: boolean;
|
|
279
285
|
iconSrc: string;
|
|
280
286
|
iconPosition: XrHamburgerCanvasComponentButtonIconPosition;
|
|
281
287
|
}
|
|
@@ -1,31 +1,45 @@
|
|
|
1
|
-
import { Color, type MediaLoopMode, Vector3, VRTalkBaseData } from '../general';
|
|
1
|
+
import { Color, type MediaLoopMode, MultiLanguageStr, Vector3, VRTalkBaseData } from '../general';
|
|
2
2
|
import type { XrMonitorComponentType, XrMonitorComponentImageMode, XrMonitorComponentTextAlign, XrMonitorComponentVerticalAlign, XrMonitorComponentProgressBarDirection, XrMonitorComponentVideoObjectFit, XrMonitorComponentButtonIconPosition } from './xr-monitor';
|
|
3
3
|
import { VrSignalTrigger } from '@/model';
|
|
4
4
|
import type { XrAnyAction } from './vr-action';
|
|
5
|
-
export declare type XrVariableType = 'string' | 'number' | 'boolean' | '
|
|
5
|
+
export declare type XrVariableType = 'string' | 'number' | 'boolean' | 'color' | 'css_color';
|
|
6
6
|
export declare class XrVariableTypeDefine {
|
|
7
7
|
static readonly STRING: XrVariableType;
|
|
8
8
|
static readonly NUMBER: XrVariableType;
|
|
9
9
|
static readonly BOOLEAN: XrVariableType;
|
|
10
|
-
static readonly ENUM: XrVariableType;
|
|
11
10
|
static readonly COLOR: XrVariableType;
|
|
12
11
|
static readonly CSS_COLOR: XrVariableType;
|
|
13
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* string 类型变量的"推荐选项"。
|
|
15
|
+
* value 是写入变量的实际字符串;label 用于在 UI / 2D 面板按钮上展示,支持多语言。
|
|
16
|
+
* 仅 string 类型有 label 多语言概念;number / color / css_color 的推荐选项是裸值数组。
|
|
17
|
+
*/
|
|
18
|
+
export declare class XrRecommendStringOption {
|
|
19
|
+
value: string;
|
|
20
|
+
label: MultiLanguageStr;
|
|
21
|
+
}
|
|
14
22
|
export declare class XrVariable {
|
|
15
23
|
key: string;
|
|
16
24
|
name: string;
|
|
17
25
|
type: XrVariableType;
|
|
18
26
|
value: string;
|
|
19
27
|
stringDefaultValue: string;
|
|
28
|
+
stringRecommendOptions: XrRecommendStringOption[];
|
|
20
29
|
numberDefaultValue: number;
|
|
21
30
|
numberStep: number;
|
|
22
31
|
numberMinValue: number;
|
|
23
32
|
numberMaxValue: number;
|
|
33
|
+
numberRecommendOptions: number[];
|
|
24
34
|
booleanDefaultValue: boolean;
|
|
25
|
-
enumOptions: string[];
|
|
26
|
-
enumDefaultValue: string;
|
|
27
35
|
colorDefaultValue: Color;
|
|
36
|
+
colorRecommendOptions: Color[];
|
|
28
37
|
cssColorDefaultValue: string;
|
|
38
|
+
cssColorRecommendOptions: string[];
|
|
39
|
+
/** @deprecated 已迁移至 stringRecommendOptions */
|
|
40
|
+
enumOptions?: string[];
|
|
41
|
+
/** @deprecated 已迁移至 stringDefaultValue */
|
|
42
|
+
enumDefaultValue?: string;
|
|
29
43
|
}
|
|
30
44
|
/**
|
|
31
45
|
* 变量作用域类型
|
|
@@ -249,6 +263,7 @@ export declare class XrMonitorComponentRuntimeState {
|
|
|
249
263
|
textAlign: XrMonitorComponentTextAlign;
|
|
250
264
|
textBold: boolean;
|
|
251
265
|
textItalic: boolean;
|
|
266
|
+
textUnderline: boolean;
|
|
252
267
|
textVerticalAlign: XrMonitorComponentVerticalAlign;
|
|
253
268
|
progressBarColor: string;
|
|
254
269
|
progressRange: number;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FreeButton, VRTalkBaseData } from '../../model';
|
|
2
|
+
import { MultiLanguageStr } from '../general/multi-language-str';
|
|
2
3
|
export declare class XrMessageCard extends VRTalkBaseData {
|
|
3
4
|
name: string;
|
|
4
5
|
remark: string;
|
|
5
6
|
iconSrc: string;
|
|
6
|
-
title:
|
|
7
|
-
content:
|
|
7
|
+
title: MultiLanguageStr;
|
|
8
|
+
content: MultiLanguageStr;
|
|
8
9
|
buttonList: FreeButton[];
|
|
9
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Vector2, VRTalkBaseData } from '../../model';
|
|
2
2
|
import type { XrAnyAction } from './vr-action';
|
|
3
|
+
import { MultiLanguageStr } from '../general/multi-language-str';
|
|
3
4
|
export declare type XrMonitorComponentType = 'image' | 'text' | 'progress-bar' | 'video' | 'button';
|
|
4
5
|
export declare class XrMonitorComponentTypeDefine {
|
|
5
6
|
static readonly IMAGE: XrMonitorComponentType;
|
|
@@ -79,13 +80,14 @@ export declare class XrMonitorComponentText extends XrMonitorComponentBase {
|
|
|
79
80
|
height: number;
|
|
80
81
|
positionX: number;
|
|
81
82
|
positionY: number;
|
|
82
|
-
textContent:
|
|
83
|
+
textContent: MultiLanguageStr;
|
|
83
84
|
textColor: string;
|
|
84
85
|
textSize: number;
|
|
85
86
|
textVerticalAlign: XrMonitorComponentVerticalAlign;
|
|
86
87
|
textAlign: XrMonitorComponentTextAlign;
|
|
87
88
|
textBold: boolean;
|
|
88
89
|
textItalic: boolean;
|
|
90
|
+
textUnderline: boolean;
|
|
89
91
|
}
|
|
90
92
|
export declare class XrMonitorComponentProgressBar extends XrMonitorComponentBase {
|
|
91
93
|
type: XrMonitorComponentType;
|
|
@@ -117,22 +119,24 @@ export declare class XrMonitorComponentButton extends XrMonitorComponentBase {
|
|
|
117
119
|
paddingY: number;
|
|
118
120
|
backgroundColor: string;
|
|
119
121
|
hoverBackgroundColor: string;
|
|
120
|
-
textContent:
|
|
122
|
+
textContent: MultiLanguageStr;
|
|
121
123
|
textColor: string;
|
|
122
124
|
textSize: number;
|
|
123
125
|
textBold: boolean;
|
|
124
126
|
textItalic: boolean;
|
|
127
|
+
textUnderline: boolean;
|
|
125
128
|
iconSrc: string;
|
|
126
129
|
iconPosition: XrMonitorComponentButtonIconPosition;
|
|
127
130
|
}
|
|
128
131
|
export declare class XrMonitor extends VRTalkBaseData {
|
|
129
132
|
name: string;
|
|
130
133
|
remark: string;
|
|
131
|
-
title:
|
|
134
|
+
title: MultiLanguageStr;
|
|
132
135
|
description: string;
|
|
133
136
|
icon: string;
|
|
134
137
|
size: Vector2;
|
|
135
138
|
defaultEnabled: boolean;
|
|
136
139
|
backgroundColor: import("../general/color").Color;
|
|
140
|
+
backgroundBlur: number;
|
|
137
141
|
componentList: XrMonitorComponentBase[];
|
|
138
142
|
}
|
|
@@ -13,8 +13,8 @@ export declare class XrPrepareSettings {
|
|
|
13
13
|
}
|
|
14
14
|
export declare class XrVariablePreFill {
|
|
15
15
|
variableKey: string;
|
|
16
|
-
defaultValue:
|
|
17
|
-
title:
|
|
18
|
-
hint:
|
|
16
|
+
defaultValue: MultiLanguageStr;
|
|
17
|
+
title: MultiLanguageStr;
|
|
18
|
+
hint: MultiLanguageStr;
|
|
19
19
|
required: boolean;
|
|
20
20
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { VrComponentData2d } from '../vr-component/vr-component-data';
|
|
2
2
|
import { MultiLanguageStr } from '../../model';
|
|
3
|
-
export declare type VrComponent2dPanelSceneMode = 'menu' | 'answering' | 'enum-modifier';
|
|
3
|
+
export declare type VrComponent2dPanelSceneMode = 'menu' | 'answering' | 'variable-modifier' | 'enum-modifier';
|
|
4
4
|
/**
|
|
5
5
|
* 2D面板的模式定义
|
|
6
6
|
*/
|
|
7
7
|
export declare class VrComponent2dPanelSceneModeDefine {
|
|
8
8
|
static MENU: VrComponent2dPanelSceneMode;
|
|
9
9
|
static ANSWERING: VrComponent2dPanelSceneMode;
|
|
10
|
-
static
|
|
10
|
+
static VARIABLE_MODIFIER: VrComponent2dPanelSceneMode;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* VR组件 - 2D面板组件数据
|
|
@@ -29,7 +29,9 @@ export declare class VrComponent2dPanelSceneData {
|
|
|
29
29
|
textDataList: VrComponent2dPanelTextItemData[];
|
|
30
30
|
imageDataList: VrComponent2dPanelImageItemData[];
|
|
31
31
|
answeringModeSettings: VrComponent2dPanelAnsweringModeSettings;
|
|
32
|
-
|
|
32
|
+
variableModifierModeSettings: VrComponent2dPanelVariableModifierModeSettings;
|
|
33
|
+
/** @deprecated 老 enum 数据,迁移工具读完后清空 */
|
|
34
|
+
enumModifierModeSettings?: any;
|
|
33
35
|
style: VrComponent2dPanelSceneStyle;
|
|
34
36
|
snapshotImageSrc: string;
|
|
35
37
|
}
|
|
@@ -41,10 +43,12 @@ export declare class VrComponent2dPanelAnsweringModeSettings {
|
|
|
41
43
|
correctButtonIdList: string[];
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
|
-
* 2D
|
|
46
|
+
* 2D面板-变量推荐选项修改器模式相关设置(替代旧 VrComponent2dPanelEnumModifierModeSettings)
|
|
47
|
+
* 仅支持绑定 string 或 number 类型变量;其他类型在编辑器侧禁选
|
|
45
48
|
*/
|
|
46
|
-
export declare class
|
|
49
|
+
export declare class VrComponent2dPanelVariableModifierModeSettings {
|
|
47
50
|
variableKey: string;
|
|
51
|
+
variableType?: 'string' | 'number';
|
|
48
52
|
}
|
|
49
53
|
/**
|
|
50
54
|
* 2D面板元素类型
|
|
@@ -105,7 +109,23 @@ export declare class VrComponent2dPanelTextItemData extends VrComponent2dPanelIt
|
|
|
105
109
|
export declare class VrComponent2dPanelButtonItemData extends VrComponent2dPanelItem {
|
|
106
110
|
type: VrComponent2dPanelItemType;
|
|
107
111
|
name: string;
|
|
108
|
-
|
|
112
|
+
/**
|
|
113
|
+
* 变量修改器模式下:点击按钮写入变量的"实际值"。
|
|
114
|
+
* - 当绑定 string 变量:取 string
|
|
115
|
+
* - 当绑定 number 变量:取 number
|
|
116
|
+
* 老字段 enumOptionValue (string) 在迁移时会被复制到这里。
|
|
117
|
+
*/
|
|
118
|
+
optionValue: string | number;
|
|
119
|
+
/**
|
|
120
|
+
* 变量修改器模式下:按钮显示文字(多语言、可单独编辑覆盖)。
|
|
121
|
+
* 与 buttonText 的关系:buttonText 用于 menu/answering 模式(富文本 HTML);optionLabel 仅用于 variable-modifier。
|
|
122
|
+
* 渲染端 fallback 链:
|
|
123
|
+
* 1. optionLabel.original_content 非空:按当前语言取,空则取 original_content
|
|
124
|
+
* 2. 否则:string 变量 → 查 stringRecommendOptions 中 value === optionValue 的 label;number 变量 → String(optionValue)
|
|
125
|
+
*/
|
|
126
|
+
optionLabel: MultiLanguageStr;
|
|
127
|
+
/** @deprecated 老 enum 数据,迁移工具读完后复制到 optionValue/optionLabel 并清空 */
|
|
128
|
+
enumOptionValue?: string;
|
|
109
129
|
enabled: boolean;
|
|
110
130
|
buttonType: VrComponent2dPanelButtonType;
|
|
111
131
|
buttonText: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VrComponentData2d } from '../vr-component/vr-component-data';
|
|
2
|
+
import { MultiLanguageStr } from '../general/multi-language-str';
|
|
2
3
|
export declare type VrComponent2dTextMode = 'basic' | 'marquee';
|
|
3
4
|
export declare type VrComponent2dTextHorizontalAlign = 'left' | 'center' | 'right';
|
|
4
5
|
export declare type VrComponent2dTextVerticalAlign = 'top' | 'center' | 'bottom';
|
|
@@ -44,7 +45,7 @@ export declare class VrComponent2dTextData extends VrComponentData2d {
|
|
|
44
45
|
*/
|
|
45
46
|
export declare class VrComponent2dTextSourceData {
|
|
46
47
|
id: string;
|
|
47
|
-
textContent:
|
|
48
|
+
textContent: MultiLanguageStr;
|
|
48
49
|
description: string;
|
|
49
50
|
}
|
|
50
51
|
export declare class VrComponent2dTextBasicModeSettings {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VrComponentData } from '../vr-component/vr-component-data';
|
|
2
2
|
import { Vector3 } from '../general/vector';
|
|
3
3
|
import { VrContentCardShowStyle } from '../vr';
|
|
4
|
+
import { MultiLanguageStr } from '../general/multi-language-str';
|
|
4
5
|
export declare type VrComponentTagTextLocation = 'none' | 'top' | 'bottom';
|
|
5
6
|
export declare class VrComponentTagTextLocationDefine {
|
|
6
7
|
static readonly NONE: VrComponentTagTextLocation;
|
|
@@ -29,9 +30,9 @@ export declare class VrComponentTagData extends VrComponentData {
|
|
|
29
30
|
isHoverShowContentCardBubble: boolean;
|
|
30
31
|
isClickShowContentCard: boolean;
|
|
31
32
|
clickShowContentCardStyle: VrContentCardShowStyle;
|
|
32
|
-
triggerButtonTitle:
|
|
33
|
+
triggerButtonTitle: MultiLanguageStr;
|
|
33
34
|
tipTextLocation: VrComponentTagTextLocation;
|
|
34
|
-
tipTextContent:
|
|
35
|
+
tipTextContent: MultiLanguageStr;
|
|
35
36
|
tipTextColor: import("../general/color").Color;
|
|
36
37
|
tipTextBackgroundColor: import("../general/color").Color;
|
|
37
38
|
tipTextFontSize: number;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LanguageType, MultiLanguageStr } from '../model/general/multi-language-str';
|
|
2
|
+
/**
|
|
3
|
+
* 从 MultiLanguageStr 中按当前语言取值,含 fallback 逻辑:
|
|
4
|
+
* 1) 数据为 string(老数据兜底)→ 直接返回
|
|
5
|
+
* 2) only_use_original_content 命中 → 返回 original_content
|
|
6
|
+
* 3) 当前语言有非空值 → 返回该值
|
|
7
|
+
* 4) 默认语言有非空值 → 返回默认语言值
|
|
8
|
+
* 5) 最终降级 → 返回 original_content
|
|
9
|
+
* 6) 全空 → 返回 ''
|
|
10
|
+
*/
|
|
11
|
+
export declare function pickMultiLanguageStr(mls: MultiLanguageStr | string | null | undefined, currentLang: LanguageType, defaultLang?: LanguageType): string;
|
|
12
|
+
/**
|
|
13
|
+
* 构造一个 MultiLanguageStr 实例,便于带默认 originalContent 的字段初始化。
|
|
14
|
+
*/
|
|
15
|
+
export declare function createMultiLanguageStr(originalContent?: string, onlyUseOriginalContent?: boolean): MultiLanguageStr;
|
|
16
|
+
/**
|
|
17
|
+
* 将"任意输入"统一规范化为 MultiLanguageStr 对象。
|
|
18
|
+
* 用于消费层兜底兼容:
|
|
19
|
+
* - string → { original_content: 该值, only_use_original_content: true, 其他全空 }
|
|
20
|
+
* - 已是 MultiLanguageStr 对象 → 原样返回
|
|
21
|
+
* - null / undefined → 新建空对象
|
|
22
|
+
*/
|
|
23
|
+
export declare function normalizeMultiLanguageStr(raw: MultiLanguageStr | string | null | undefined): MultiLanguageStr;
|
|
24
|
+
/**
|
|
25
|
+
* 将浏览器语言代码(如 ja-JP / zh-CN)规范化为 LanguageType。
|
|
26
|
+
* 不能匹配时返回 undefined(调用方应降级到 supportedLanguages[0])。
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizeBrowserLanguage(browserLang: string | undefined | null): LanguageType | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* 给定 vr.supportedLanguages,挑选当前应该使用的语言:
|
|
31
|
+
* - 若浏览器语言能映射到 LanguageType 且在 supportedLanguages 中 → 用浏览器语言
|
|
32
|
+
* - 否则 → 用 supportedLanguages[0](默认语言)
|
|
33
|
+
*/
|
|
34
|
+
export declare function pickCurrentLanguage(supportedLanguages: LanguageType[], browserLang: string | undefined | null): LanguageType;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 变量类型 enum → string + 推荐选项 迁移工具
|
|
3
|
+
*
|
|
4
|
+
* 背景:
|
|
5
|
+
* 重构前 XrVariableType 包含 'enum' 类型,本质是带 enumOptions 候选列表的字符串。
|
|
6
|
+
* 重构后取消 'enum' 类型,统一用 'string' + stringRecommendOptions(带多语言 label)替代。
|
|
7
|
+
* 同时 2D 面板的 'enum-modifier' 模式改名为 'variable-modifier',按钮 enumOptionValue
|
|
8
|
+
* 改为 optionValue/optionLabel;logic_random_pick_enum Action 改名为
|
|
9
|
+
* logic_random_pick_from_recommend_options(candidates 数据丢弃)。
|
|
10
|
+
*
|
|
11
|
+
* 此工具是幂等的:所有转换都基于"老字段是否存在"判断,多次调用安全。
|
|
12
|
+
*
|
|
13
|
+
* 必须遍历的所有变量列表持有者(共 18 处):
|
|
14
|
+
* 1. vrContentData.variableList (全局)
|
|
15
|
+
* 2. vrContentData.abilityList[*].contextVariableList (能力)
|
|
16
|
+
* 3. vrContentData.abilityList[*].activeActionListLocalVariableList
|
|
17
|
+
* 4. vrContentData.abilityList[*].stopActionListLocalVariableList
|
|
18
|
+
* 5. vrContentData.abilityList[*].triggerList[*].localVariableList
|
|
19
|
+
* 6. vrContentData.vrFlowList[*].flowScopeVariableList (Flow)
|
|
20
|
+
* 7. vrContentData.vrFlowList[*].stepList[*].stepScopeVariableList (Step)
|
|
21
|
+
* 8. vrContentData.vrFlowList[*].stepList[*].triggerList[*].trigger.localVariableList
|
|
22
|
+
* 9. vrContentData.vrFlowList[*].stepList[*].finishInjectTriggerList[*].localVariableList
|
|
23
|
+
* 10. vrContentData.vrFlowList[*].stepList[*].buttonList[*].localVariableList
|
|
24
|
+
* 11. vrContentData.triggerList[*].localVariableList (顶层)
|
|
25
|
+
* 12. vrContentData.backgroundThreadList[*].localVariableList (后台线程)
|
|
26
|
+
* 13. vrContentData.prepareSettings.vrInitLocalVariableList (Prepare)
|
|
27
|
+
* 14. vrContentData.prepareSettings.arInitLocalVariableList
|
|
28
|
+
* 15. vrContentData.prepareSettings.allInitLocalVariableList
|
|
29
|
+
* 16. vrContentData.componentList[*].localVariableList (装修组件)
|
|
30
|
+
* 17. vrContentData.componentList[*].triggerList[*].localVariableList
|
|
31
|
+
* 18. vrContentData.messageCardList[*].buttonList[*].localVariableList (消息卡片)
|
|
32
|
+
*/
|
|
33
|
+
import { VrContentData } from '../model/vr/vr-content-data';
|
|
34
|
+
/**
|
|
35
|
+
* 主入口:将老的 enum 变量类型迁移到 string + 推荐选项;将 2D 面板 enum-modifier 模式
|
|
36
|
+
* 迁移到 variable-modifier;将 logic_random_pick_enum Action 改为
|
|
37
|
+
* logic_random_pick_from_recommend_options。幂等。
|
|
38
|
+
*/
|
|
39
|
+
export declare function migrateXrVariableTypeEnum(vrContentData: VrContentData): void;
|