@shijiu/jsview-vue 2.1.5 → 2.1.23

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.
Files changed (31) hide show
  1. package/package.json +1 -1
  2. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +22 -1
  3. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +6 -0
  4. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +24 -15
  5. package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +3 -3
  6. package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +20 -0
  7. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +1847 -0
  8. package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +101 -0
  9. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +369 -0
  10. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-0.9.vue +53 -0
  11. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +505 -0
  12. package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +60 -0
  13. package/utils/JsViewPlugin/JsvPlayer/index.js +59 -0
  14. package/utils/JsViewPlugin/JsvPlayer/version.mjs +18 -0
  15. package/utils/JsViewPlugin/index.js +1 -0
  16. package/utils/JsViewVueTools/JsvRuntimeBridge.js +5 -4
  17. package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.js +112 -0
  18. package/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.js +68 -0
  19. package/utils/JsViewVueWidget/JsvFreeMoveActor/CommonTools.js +18 -0
  20. package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +46 -0
  21. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.js +216 -0
  22. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.js +66 -0
  23. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.js +38 -0
  24. package/utils/JsViewVueWidget/JsvFreeMoveActor/TypeDefine.js +12 -0
  25. package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +3 -0
  26. package/utils/JsViewVueWidget/JsvPosterImage.vue +16 -10
  27. package/utils/JsViewVueWidget/JsvRipple/Constant.js +4 -0
  28. package/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue +134 -0
  29. package/utils/JsViewVueWidget/JsvRipple/index.js +7 -0
  30. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +55 -68
  31. package/utils/JsViewVueWidget/index.js +2 -0
@@ -0,0 +1,112 @@
1
+ /*
2
+ * @Author: donglin.lu@qcast.cn
3
+ * @Date: 2023-07-05 15:41:00
4
+ * @LastEditors: donglin.lu@qcast.cn
5
+ * @Description: file content
6
+ */
7
+
8
+ import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
9
+
10
+ import ConditionPackBuilder from "./SetCondition.js";
11
+ import ActionPackBuilder from "./SetAction.js"
12
+ import StatePackBuilder from "./SetState.js";
13
+ import CallbackManager from "./CallbackManager.js";
14
+
15
+
16
+ class ActorControl {
17
+ constructor() {
18
+ this._BindView = null;
19
+ this._BindAnim = null;
20
+ this._Callbacks = new CallbackManager();
21
+ this._ConditionPackBuilder = new ConditionPackBuilder(this._Callbacks);
22
+ this._ActionPackBuilder = new ActionPackBuilder(this._Callbacks);
23
+ this._StatePackBuilder = new StatePackBuilder();
24
+ }
25
+
26
+ bindForgeView(bindView) {
27
+ this._BindView = bindView;
28
+ }
29
+
30
+ /**
31
+ * run 执行编排好的intent集合
32
+ *
33
+ * @param {Array} cmdPackList 内容来自 Condition(), State(), Action() 这些工厂类创建的Command pack
34
+ */
35
+ run(cmdPackList) {
36
+ if (window.JsView) {
37
+ this._WrappedRun(cmdPackList);
38
+ } else {
39
+ // Browser场景DomProxy需要onReady调用
40
+ let that = this;
41
+ this._BindView.RegisterOnProxyReady(()=>{
42
+ that._WrappedRun(cmdPackList);
43
+ })
44
+ }
45
+ }
46
+
47
+ _WrappedRun(cmdPackList) {
48
+ this._EnsureAnim();
49
+
50
+ if (!(cmdPackList instanceof Array)) {
51
+ console.error("params error");
52
+ return;
53
+ }
54
+
55
+ Forge.AnimFireCommand.RunFreeMoveCmdPacks(this._BindView, cmdPackList);
56
+ }
57
+
58
+ /**
59
+ * Condition
60
+ * 获取创建 ConditionPack 的工厂对象
61
+ * ConditionPack对应支持 .then(cmdPackList), 可传入同 Run 的处理队列
62
+ * 可用方法见 ./SetCondition.js
63
+ */
64
+ condition(group, multiTimes, specName) {
65
+ // 注意: 不支持获取condition后,多次复制
66
+ this._ConditionPackBuilder.updateCommandInfo(group, multiTimes, specName);
67
+ return this._ConditionPackBuilder;
68
+ }
69
+
70
+ /**
71
+ * Action
72
+ * 获取创建 ActionPack 的工厂对象
73
+ * 注意: ActionPack 是指会改变 speed 或 accelerate 的指令,每个新的Action会覆盖掉前一次的Action设置,包括其关联的condition
74
+ * 可用方法见 ./SetAction.js
75
+ *
76
+ * @param {int} xySpeedKeeps xy轴上的速度是否保持,x轴保持为1, y轴保持为2,可"与或"让两个轴都保持
77
+ * @param {int} xyAccKeeps xy轴上的加速度是否保持,x轴保持为1, y轴保持为2,可"与或"让两个轴都保持
78
+ * @return {ActionPackBuilder} ActionPack 的工厂对象
79
+ */
80
+ action(xySpeedKeeps, xyAccKeeps) {
81
+ this._ActionPackBuilder.updateCommonInfo(xySpeedKeeps, xyAccKeeps);
82
+ return this._ActionPackBuilder;
83
+ }
84
+
85
+ /**
86
+ * State
87
+ * 获取创建 StatePack 的工厂对象
88
+ * 可用方法见 ./SetState.js
89
+ */
90
+ state() {
91
+ return this._StatePackBuilder;
92
+ }
93
+
94
+ _OnEchoEvent(retJsonObject) {
95
+ let actorState = retJsonObject;
96
+ let echoTokens = retJsonObject["eTkns"];
97
+ if (echoTokens) {
98
+ for (let etoken of echoTokens) {
99
+ this._Callbacks.invokeCallback(etoken, actorState);
100
+ }
101
+ }
102
+ }
103
+
104
+ _EnsureAnim() {
105
+ if (!this._BindAnim) {
106
+ this._BindAnim = new Forge.FreeMoveAnimation(this._OnEchoEvent.bind(this));
107
+ this._BindView.StartAnimation(this._BindAnim);
108
+ }
109
+ }
110
+ }
111
+
112
+ export default ActorControl;
@@ -0,0 +1,68 @@
1
+ /*
2
+ * @Author: donglin.lu@qcast.cn
3
+ * @Date: 2023-07-18 11:14:00
4
+ * @LastEditors: donglin.lu@qcast.cn
5
+ * @Description: file content
6
+ */
7
+
8
+ import { StateCmdBuilder } from "./CommonTools.js"
9
+
10
+ class CallbackManager {
11
+ constructor() {
12
+ this._CallbackMap = new Map();
13
+ this._IdGen = 1;
14
+ }
15
+
16
+ addCallback(func, callMulti) {
17
+ let id = "" + this._IdGen++;
18
+ this._CallbackMap.set(id, {
19
+ f: func, // 回调函数
20
+ times: 0, // 回调的次数
21
+ once: !callMulti, // 是否单次回调就销毁
22
+ })
23
+ return id;
24
+ }
25
+
26
+ clearCallback() {
27
+ this._CallbackMap = new Map();
28
+ }
29
+
30
+ expiredIds(ids) {
31
+ // 删除已经无效的ids
32
+ if (ids) {
33
+ for (let key of this._CallbackMap.keys()) {
34
+ for (let id of ids) {
35
+ if (id === key) {
36
+ this._CallbackMap.delete(id);
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+ invokeCallback(id, actorState) {
44
+ if (this._CallbackMap.has(id)) {
45
+ let callbackObj = this._CallbackMap.get(id);
46
+ if (callbackObj.once) {
47
+ this._CallbackMap.delete(id);
48
+ } else {
49
+ callbackObj.times++;
50
+ }
51
+ try {
52
+ callbackObj.f?.(actorState);
53
+ } catch (e) {
54
+ // 规避 callback 执行出错导致流程执行不下去
55
+ console.error("Error: callback error", e);
56
+ }
57
+ }
58
+ }
59
+
60
+ buildCallbackCmd(func) {
61
+ let funcIdStr = this.addCallback(func, true);
62
+ return StateCmdBuilder.FireEcho(funcIdStr); // 以funcIdStr 作为echoToken
63
+ }
64
+
65
+
66
+ }
67
+
68
+ export default CallbackManager;
@@ -0,0 +1,18 @@
1
+ /*
2
+ * @Author: donglin.lu@qcast.cn
3
+ * @Date: 2023-07-18 11:14:00
4
+ * @LastEditors: donglin.lu@qcast.cn
5
+ * @Description: file content
6
+ */
7
+
8
+ const ConditionSetBuilder = Forge.FreeMoveConditionSet;
9
+ const StateCmdBuilder = Forge.FreeMoveStateBuilder;
10
+ const ActionCmdBuilder = Forge.FreeMoveActionBuilder;
11
+ const CmdPackBuilder = Forge.FreeMoveCmdPackBuilder;
12
+
13
+ export {
14
+ ConditionSetBuilder,
15
+ ActionCmdBuilder,
16
+ StateCmdBuilder,
17
+ CmdPackBuilder
18
+ }
@@ -0,0 +1,46 @@
1
+ <!--
2
+ * @Author: donglin.lu@qcast.cn
3
+ * @Date: 2023-07-05 17:21:21
4
+ * @LastEditors: donglin.lu@qcast.cn
5
+ * @Description: file content
6
+ -->
7
+
8
+ <!--
9
+ * 【模块 export 内容】
10
+ * JsvFreeMoveActor:单轴(X 或 Y)运动控制控件,可控制完成单方向的匀速运动和变速运动(抛物运动),
11
+ * 若想进行X和Y轴同时的运动,可以通过运动分解后的两个JsvActorMove进行组合来实现
12
+ * props说明:
13
+ *
14
+ -->
15
+ <script setup>
16
+ import ActControl from "./ActorControl.js";
17
+ import { shallowRef, onMounted } from "vue";
18
+
19
+ const props = defineProps({
20
+ width: {
21
+ default: 0,
22
+ type: Number,
23
+ },
24
+ height: {
25
+ default: 0,
26
+ type: Number,
27
+ },
28
+ });
29
+
30
+ let mainDivRef = shallowRef(null);
31
+ let controller = new ActControl();
32
+
33
+ onMounted(() => {
34
+ controller.bindForgeView(mainDivRef.value.jsvGetProxyView());
35
+ });
36
+
37
+ defineExpose({
38
+ control: controller,
39
+ });
40
+ </script>
41
+
42
+ <template>
43
+ <div ref="mainDivRef" :style="{ width: props.width, height: props.height }">
44
+ <slot></slot>
45
+ </div>
46
+ </template>
@@ -0,0 +1,216 @@
1
+ /*
2
+ * @Author: donglin.lu@qcast.cn
3
+ * @Date: 2023-07-18 11:14:00
4
+ * @LastEditors: donglin.lu@qcast.cn
5
+ * @Description: file content
6
+ */
7
+
8
+ import { ConditionSetBuilder, StateCmdBuilder, CmdPackBuilder, ActionCmdBuilder } from "./CommonTools.js"
9
+ import { GroupType_FromAction } from "./TypeDefine.js"
10
+
11
+ const ConditionCmdCreator = (builderThis, setCondFunc, acts, isFinal, callback) => {
12
+ let commonInfo = ConditionSetBuilder.InitCommonInfo();
13
+ ConditionSetBuilder.UpdateCommonInfo(commonInfo, GroupType_FromAction);
14
+
15
+ // 创建位置条件
16
+ let conditionSet = setCondFunc(commonInfo);;
17
+
18
+ let conditionSubCmds = acts;
19
+
20
+ // 设置达到条件后的callback
21
+ if (callback) {
22
+ // callback接受参数为({xPos, yPos, xSpd, ySpd, xAcc, yAcc})
23
+ conditionSubCmds.push(builderThis._CallbackManager.buildCallbackCmd(callback));
24
+ }
25
+
26
+ if (isFinal) {
27
+ // 结束时清理临时condition
28
+ conditionSubCmds.push(StateCmdBuilder.DelFromActionCondition());
29
+ }
30
+
31
+ // 挂载设置好的Sub command list
32
+ ConditionSetBuilder.SetCmdList(conditionSet, conditionSubCmds);
33
+
34
+ return StateCmdBuilder.NewCondition(conditionSet);
35
+ }
36
+
37
+ const ActOnReachPosition = (builderThis, xPos, yPos, acts, isFinal, callback) => {
38
+ return ConditionCmdCreator(builderThis, (commonInfo) => {
39
+ return ConditionSetBuilder.ReachPosition(xPos, yPos, commonInfo);
40
+ }, acts, isFinal, callback);
41
+ }
42
+
43
+ const ActOnGetToSpeed = (builderThis, xSpeed, ySpeed, acts, isFinal, callback) => {
44
+ return ConditionCmdCreator((commonInfo) => {
45
+ return ConditionSetBuilder.ReachSpeed(xSpeed, ySpeed, commonInfo);
46
+ }, acts, isFinal, callback);
47
+ }
48
+
49
+ class ActorPackBuilder {
50
+ constructor(callbackManager) {
51
+ this._CallbackManager = callbackManager;
52
+
53
+ // 下一个Act指令时所保留的状态
54
+ this._SpeedKeeps = 0;
55
+ this._AccKeeps = 0;
56
+ this._CommonInfoValid = false;
57
+ }
58
+
59
+ updateCommonInfo(xySpdEnables, xyAccEnables) {
60
+ this._SpeedKeeps = xySpdEnables;
61
+ this._AccKeeps = xyAccEnables;
62
+ this._CommonInfoValid = true;
63
+ }
64
+
65
+ _CheckCommonInfo() {
66
+ if (!this._CommonInfoValid) {
67
+ console.error("Error: must call from new action()");
68
+ return false;
69
+ }
70
+ return true;
71
+ }
72
+
73
+ /**
74
+ * moveTo 以给定速度移动到目标位置
75
+ *
76
+ * @param {int} targetX 带符号整数,标识运动的目标位置,相对于Actor当前位置, 如果设置为undefined, 则表示该轴不设目标
77
+ * @param {int} targetY 带符号整数,标识运动的目标位置,相对于Actor当前位置, 如果设置为undefined, 则表示该轴不设目标
78
+ * @param {double} xSpeed 带符号整数,符号表示方向,标识运动的运行速度,单位(pixel/帧), 可设undefined代表不改变该轴速度
79
+ * @param {double} ySpeed 带符号整数,符号表示方向,标识运动的运行速度,单位(pixel/帧), 可设undefined代表不改变该轴速度
80
+ * @param {function} endCallback 参数(x, y) 运动到目标位置后的回调函数, x或者y达到后即回调,以先到为准,回报当前Actor的相对于原始位置的x,y
81
+ * @return CommandPack(放入run或者then的CmdPackList队列)
82
+ */
83
+ moveTo(targetX, targetY, xSpeed, ySpeed, endCallback) {
84
+ if (!this._BasicPreProcess("moveTo")) {
85
+ return;
86
+ }
87
+
88
+ // x, y 都没有速度, 无内容
89
+ if (!xSpeed && !ySpeed) {
90
+ return null;
91
+ }
92
+
93
+ // 处理步骤备忘:
94
+ // 1. 构造 command list (cmdList), 加入通过 ActionCmdBuilder 构建的各种改变速度的行为
95
+ // 2. 构筑结束的条件处理(包含回调和 delFromActionCondtion 动作), 通过 StateCmdBuilder.NewCondtion 创建并加入 cmdList
96
+ // 3. 通过 CmdPackBuilder.InitActCmdPack,送入 cmdList 和预设好的keep, 完成commandPack构建
97
+
98
+ let cmdList = [];
99
+
100
+ // 设置运动速度
101
+ cmdList.push(ActionCmdBuilder.SetArrowSpeed(targetX, targetY, xSpeed, ySpeed));
102
+
103
+ // 设置达到目标位置的condition
104
+ cmdList.push(
105
+ ActOnReachPosition(
106
+ this,
107
+ targetX, targetY,
108
+ [ActionCmdBuilder.StopMoving()],
109
+ true,
110
+ (actorState) => {
111
+ endCallback(actorState.xPos, actorState.yPos);
112
+ }
113
+ )
114
+ );
115
+
116
+ //return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, cmdList);
117
+
118
+ let c = CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, cmdList);
119
+ return c;
120
+ }
121
+
122
+ /*
123
+ * altSpeed 调整速度,costTime不为0时为平滑过渡
124
+ * 参数说明:
125
+ * xSpeed (double) 带符号整数,符号表示方向,标识运动的运行速度,单位(pixel/帧), 可设undefined代表不改变该轴速度
126
+ * ySpeed (double) 带符号整数,符号表示方向,标识运动的运行速度,单位(pixel/帧), 可设undefined代表不改变该轴速度
127
+ * spreadFrame (int) 选填,正整数, 变速需要经历帧数, 若为立即变速,则设置为0,或者不再设置(undefined)
128
+ * finishCallback (Function(xSpeed, ySpeed)) 选填,达到目标速度后的回调,当costTime不为0时有效
129
+ */
130
+ altSpeed(xSpeed, ySpeed, spreadFrame, finishCallback) {
131
+ if (!this._BasicPreProcess("altSpeed")) {
132
+ return;
133
+ }
134
+
135
+ // 处理步骤备忘:
136
+ // 1. 构造 command list (cmdList), 加入通过 ActionCmdBuilder 构建的各种改变速度的行为
137
+ // 2. 构筑结束的条件处理(包含回调和 delFromActionCondtion 动作), 通过 StateCmdBuilder.NewCondtion 创建并加入 cmdList
138
+ // 3. 通过 CmdPackBuilder.InitActCmdPack,送入 cmdList 和预设好的keep, 完成commandPack构建
139
+
140
+ let cmdList = [];
141
+
142
+ if (isNaN(spreadFrame) || spreadFrame == 0) {
143
+ // 经历的帧数为0, 即为立即变速
144
+ cmdList.push(ActionCmdBuilder.SetSpeed(xSpeed, ySpeed));
145
+ return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, cmdList);
146
+ } else {
147
+ // 均匀变速逻辑
148
+ cmdList.push(ActionCmdBuilder.AltSpeed(xSpeed, ySpeed, spreadFrame));
149
+
150
+ // 创建结束ConditionSet
151
+ cmdList.push(
152
+ ActOnGetToSpeed(
153
+ this,
154
+ xSpeed, ySpeed,
155
+ [ActionCmdBuilder.ResetAcc(0, 0)],
156
+ true, // isFinal
157
+ (actorState) => {
158
+ finishCallback(actorState.xSpd, actorState.ySpd);
159
+ }
160
+ )
161
+ )
162
+
163
+ return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, cmdList);
164
+ }
165
+ }
166
+
167
+ /*
168
+ * breakToPosition 以当前速度开始,减速并停止到目标位置
169
+ * 参数说明:
170
+ * targetX (int) 带符号整数,目标运动终点位置,如果设置为undefined,标识不以此轴为终点
171
+ * targetY (int) 带符号整数,目标运动终点位置,如果设置为undefined,标识不以此轴为终点
172
+ * finishCallback (Function(x,y)) 运动到目标位置后的回调函数, x或者y达到后即回调,以先到为准,回报当前Actor的相对于原始位置的x,y
173
+ */
174
+ breakToPosition(targetX, targetY, finishCallback) {
175
+ if (!this._BasicPreProcess("breakToPosition")) {
176
+ return;
177
+ }
178
+
179
+ // 处理步骤备忘:
180
+ // 1. 构造 command list (cmdList), 加入通过 ActionCmdBuilder 构建的各种改变速度的行为
181
+ // 2. 构筑结束的条件处理(包含回调和 delFromActionCondtion 动作), 通过 StateCmdBuilder.NewCondtion 创建并加入 cmdList
182
+ // 3. 通过 CmdPackBuilder.InitActCmdPack,送入 cmdList 和预设好的keep, 完成commandPack构建
183
+
184
+ let cmdList = [];
185
+
186
+ // 通过targetX和targetY以及内部当前的 xSpeed 和 ySpeed 状态,计算 xAcc 和 yAcc, 使运动接近目标位置时停止
187
+ cmdList.push(ActionCmdBuilder.BreakToPos(targetX, targetY));
188
+
189
+ // 创建结束ConditionSet
190
+ cmdList.push(
191
+ ActOnReachPosition(
192
+ this,
193
+ targetX, targetY,
194
+ [ActionCmdBuilder.StopMoving()],
195
+ true,
196
+ (actorState) => {
197
+ finishCallback(actorState.xPos, actorState.yPos);
198
+ }
199
+ )
200
+ );
201
+
202
+ return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, cmdList);
203
+ }
204
+
205
+ _BasicPreProcess(procName) {
206
+ // CommonInfo 只能使用一次,规避多次使用问题
207
+ if (!this._CheckCommonInfo()) {
208
+ return false;
209
+ }
210
+ this._CommonInfoValid = false;
211
+
212
+ return true;
213
+ }
214
+ }
215
+
216
+ export default ActorPackBuilder;
@@ -0,0 +1,66 @@
1
+ /*
2
+ * @Author: donglin.lu@qcast.cn
3
+ * @Date: 2023-07-18 11:14:00
4
+ * @LastEditors: donglin.lu@qcast.cn
5
+ * @Description: file content
6
+ */
7
+
8
+ import { ConditionSetBuilder, StateCmdBuilder, CmdPackBuilder } from "./CommonTools.js"
9
+
10
+ const setChildCommnadPackList = (conditionSet, callbackManager, cmdPackList) => {
11
+ for (let i = 0; i < cmdPackList.length; i++) {
12
+ if (typeof cmdPackList[i] == "function") {
13
+ // 将回调函数更换为对应CommandPack, 内容为 FireEcho 的 stateCommand
14
+ cmdPackList[i] = CmdPackBuilder.InitStateCmdPack(callbackManager.buildCallbackCmd(cmdPackList[i]));
15
+ }
16
+ }
17
+
18
+ // 将此cmdPackList设置给ConditionSet
19
+ ConditionSetBuilder.SetCmdPackList(conditionSet, cmdPackList);
20
+ }
21
+
22
+ class ConditionPackBuilder {
23
+ constructor(callbackManager) {
24
+ this._Callbacks = callbackManager;
25
+ this._CommonInfo = ConditionSetBuilder.InitCommonInfo();
26
+ this._CommonInfoValid = false;
27
+ }
28
+
29
+ updateCommandInfo(group, multiTimes, specName) {
30
+ ConditionSetBuilder.UpdateCommonInfo(this._CommonInfo, group, multiTimes, specName);
31
+ this._CommonInfoValid = true;
32
+ }
33
+
34
+ reachPosition(xPosition, yPosition) {
35
+ // CommonInfo 只能使用一次,规避多次使用问题
36
+ if (!this._CheckCommonInfo()) {
37
+ return;
38
+ }
39
+ this._CommonInfoValid = false;
40
+
41
+ return this._BuildPack(ConditionSetBuilder.ReachPosition(xPosition, yPosition, this._CommonInfo));
42
+ }
43
+
44
+ _CheckCommonInfo() {
45
+ if (!this._CommonInfoValid) {
46
+ console.error("Error: must call from new conditoin()");
47
+ return false;
48
+ }
49
+ return true;
50
+ }
51
+
52
+ _BuildPack(conditionSet) {
53
+ let cmdPack = CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.NewCondition(conditionSet));
54
+
55
+ // 追加then处理
56
+ let callbackManager = this._Callbacks;
57
+ cmdPack["then"] = (childCmdPackList) => {
58
+ setChildCommnadPackList(conditionSet, callbackManager, childCmdPackList);
59
+ return cmdPack;
60
+ };
61
+
62
+ return cmdPack;
63
+ }
64
+ }
65
+
66
+ export default ConditionPackBuilder;
@@ -0,0 +1,38 @@
1
+
2
+ import { ConditionSetBuilder, StateCmdBuilder, CmdPackBuilder, ActionCmdBuilder } from "./CommonTools.js"
3
+
4
+ class StatePackBuilder {
5
+ constructor() {
6
+
7
+ }
8
+
9
+ /*
10
+ * clearConditions
11
+ * 清理所有预制的condition
12
+ */
13
+ clearAllConditions() {
14
+ return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.RemoveAllCondtions());
15
+ }
16
+
17
+ /*
18
+ * jumpToPosition 立刻将actor移动到目标位置
19
+ * 参数说明:
20
+ * targetX (int) 带符号整数,目标位置,如果设置为undefined,标识不以此轴为终点
21
+ * targetY (int) 带符号整数,目标位置,如果设置为undefined,标识不以此轴为终点
22
+ */
23
+ jumpToPos(targetX, targetY) {
24
+ return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.SetPos(targetX, targetY));
25
+ }
26
+
27
+ /*
28
+ * jumpOffsetPos 立刻将actor移动以当前位置相对位移的位置
29
+ * 参数说明:
30
+ * targetX (int) 带符号整数,目标位置,如果设置为undefined,标识不以此轴为终点
31
+ * targetY (int) 带符号整数,目标位置,如果设置为undefined,标识不以此轴为终点
32
+ */
33
+ jumpOffsetPos(offsetX, offsetY) {
34
+ return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.SetOffsetPos(offsetX, offsetY));
35
+ }
36
+ }
37
+
38
+ export default StatePackBuilder;
@@ -0,0 +1,12 @@
1
+ /*
2
+ * @Author: donglin.lu@qcast.cn
3
+ * @Date: 2023-07-18 11:14:00
4
+ * @LastEditors: donglin.lu@qcast.cn
5
+ * @Description: file content
6
+ */
7
+
8
+ const GroupType_FromAction = Forge.FreeMoveExternType?.GroupType_FromAction;
9
+
10
+ export {
11
+ GroupType_FromAction
12
+ }
@@ -0,0 +1,3 @@
1
+ import JsvFreeMoveActor from "./FreeMoveActor.vue";
2
+
3
+ export default JsvFreeMoveActor;
@@ -4,37 +4,43 @@
4
4
  * props说明:
5
5
  * colorSpace {String} 颜色空间,默认RGBA_8888
6
6
  * style {Object} 包含left/top/width/height/border-radius的style设置
7
+ * imageCompress {boolean} 是否压缩图片, 默认打开
7
8
  -->
8
9
 
9
10
  <script setup>
10
-
11
- import { reactive, watchEffect } from "vue";
11
+ import { reactive, watchEffect, computed } from "vue";
12
12
 
13
13
  const props = defineProps({
14
14
  colorSpace: {
15
15
  type: String,
16
16
  default: "RGBA_8888",
17
+ imageCompress: {
18
+ type: Boolean,
19
+ default: true,
20
+ },
17
21
  },
18
-
19
22
  style: Object,
20
23
  });
21
24
 
25
+ const scaleddown = computed(() => {
26
+ return props.imageCompress ? "true" : "false";
27
+ });
28
+
22
29
  let common_style = reactive({});
23
30
  let image_style = reactive({});
24
31
 
25
- watchEffect(()=>{
32
+ watchEffect(() => {
26
33
  if (props.style) {
27
- let {left, top, width, height, ...others} = props.style;
34
+ let { left, top, width, height, ...others } = props.style;
28
35
 
29
36
  common_style.left = left;
30
37
  common_style.top = top;
31
38
 
32
39
  image_style.width = width;
33
40
  image_style.height = height;
34
- Object.assign(image_style, others)
41
+ Object.assign(image_style, others);
35
42
  }
36
- })
37
-
43
+ });
38
44
  </script>
39
45
 
40
46
  <template>
@@ -43,10 +49,10 @@ watchEffect(()=>{
43
49
  <img
44
50
  data-jsv-vw-enable-fade="true"
45
51
  data-jsv-vw-mask-poster-on-top="true"
46
- data-jsv-img-scaledown-tex="true"
52
+ :data-jsv-img-scaledown-tex="scaleddown"
47
53
  :data-jsv-img-color-space="colorSpace"
48
54
  :style="image_style"
49
55
  v-bind="$attrs"
50
56
  />
51
57
  </div>
52
- </template>
58
+ </template>
@@ -0,0 +1,4 @@
1
+ export const JsvRippleShape = {
2
+ CIRCLE: Forge.FilterView.WAVE.CIRCLE_WAVE,
3
+ RECTANGLE: Forge.FilterView.WAVE.RECTANGLE_WAVE,
4
+ }