@shijiu/jsview-vue 2.1.200 → 2.1.340-test.0

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 (120) hide show
  1. package/bin/browser/BrowserApic.vue.mjs +124 -0
  2. package/bin/browser/BrowserApic2.vue.mjs +118 -0
  3. package/bin/browser/BrowserApicLib.mjs +424 -0
  4. package/bin/browser/BrowserAudio.vue.mjs +263 -0
  5. package/bin/browser/BrowserJsvLatex.vue.mjs +110 -0
  6. package/bin/browser/BrowserJsvPlayer.vue.mjs +573 -0
  7. package/bin/browser/BrowserPreload.vue.mjs +154 -0
  8. package/bin/browser/BrowserQrcode.vue.mjs +178 -0
  9. package/bin/browser/BrowserSpray.vue.mjs +66 -0
  10. package/bin/browser/BrowserTextureAnim.vue.mjs +324 -0
  11. package/bin/export-sfc.mjs +12 -0
  12. package/bin/jsview-common.mjs +39 -0
  13. package/bin/jsview-vue.mjs +21106 -0
  14. package/index.js +3 -4
  15. package/package.json +1 -2
  16. package/tools/config/rollup.config.mjs +52 -0
  17. package/tools/config/tsconfig.json +18 -0
  18. package/tools/config/vite.config.ts +60 -0
  19. package/tools/jsview-vue-build.mjs +125 -0
  20. package/utils/JsViewEngineWidget/{JsvFocusBlock.vue → JsvFocus/JsvFocusBlock.vue} +11 -11
  21. package/utils/JsViewEngineWidget/{JsvFocusHub.ts → JsvFocus/JsvFocusHub.ts} +9 -3
  22. package/utils/JsViewEngineWidget/{JsvFocusManager.js → JsvFocus/JsvFocusManager.js} +6 -5
  23. package/utils/JsViewEngineWidget/MetroWidget/AnimationManager.ts +33 -10
  24. package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +89 -57
  25. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +118 -62
  26. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +504 -60
  27. package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +11 -1
  28. package/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue +13 -0
  29. package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +1 -1
  30. package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +1 -1
  31. package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +34 -1
  32. package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +52 -11
  33. package/utils/JsViewEngineWidget/index.js +3 -3
  34. package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +9 -0
  35. package/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue +11 -3
  36. package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +1 -0
  37. package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +8 -0
  38. package/utils/JsViewPlugin/JsvAudio/ScreenLockManager.js +16 -0
  39. package/utils/JsViewPlugin/JsvAudio/version.js +3 -3
  40. package/utils/JsViewPlugin/JsvAudio/version.mjs +3 -3
  41. package/utils/JsViewPlugin/JsvLatex/index.js +1 -1
  42. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +1 -1
  43. package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +3 -3
  44. package/utils/JsViewPlugin/JsvPlayer/index.js +2 -2
  45. package/utils/JsViewVueTools/DebugTool.js +2 -2
  46. package/utils/JsViewVueTools/DefaultKeyMap.js +1 -1
  47. package/utils/JsViewVueTools/JsvDynamicCssStyle.js +1 -1
  48. package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +2 -2
  49. package/utils/JsViewVueTools/JsvImpactTracer.js +7 -7
  50. package/utils/JsViewVueTools/JsvPreDownloader.ts +1 -1
  51. package/utils/JsViewVueTools/JsvRefTaker.js +2 -1
  52. package/utils/JsViewVueTools/JsvRuntimeBridge.js +29 -29
  53. package/utils/JsViewVueTools/JsvStyleClass.js +3 -3
  54. package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +1 -1
  55. package/utils/JsViewVueTools/JsvTextTools.js +4 -4
  56. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.ts +29 -1
  57. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +6 -5
  58. package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +60 -2
  59. package/utils/JsViewVueTools/NinePatchHelper.js +1 -1
  60. package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
  61. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
  62. package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvApic}/BrowserApic.vue +20 -23
  63. package/utils/JsViewVueWidget/JsvApic/{JsvApic.vue → JsvApic/JsvApic.vue} +3 -14
  64. package/utils/JsViewVueWidget/JsvApic/{index.js → JsvApic/index.js} +2 -4
  65. package/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue +116 -0
  66. package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +137 -0
  67. package/utils/JsViewVueWidget/JsvApic/JsvApic2/index.js +17 -0
  68. package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.js +4 -0
  69. package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/NormalLoopTool.js +16 -18
  70. package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.js +90 -0
  71. package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.js +17 -0
  72. package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.js +111 -0
  73. package/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.js +48 -0
  74. package/utils/JsViewVueWidget/JsvConnectLine/ArcLineManager.js +71 -0
  75. package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +354 -0
  76. package/utils/JsViewVueWidget/JsvConnectLine/index.js +2 -0
  77. package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +37 -18
  78. package/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.ts +7 -3
  79. package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +28 -2
  80. package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +12 -5
  81. package/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.ts +21 -0
  82. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +47 -59
  83. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +129 -12
  84. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +45 -0
  85. package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +10 -2
  86. package/utils/JsViewVueWidget/JsvGrid.vue +1 -1
  87. package/utils/JsViewVueWidget/JsvHole.js +1 -1
  88. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +1 -1
  89. package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -2
  90. package/utils/JsViewVueWidget/JsvLine/LineManager.js +6 -4
  91. package/utils/JsViewVueWidget/JsvMarquee.vue +7 -4
  92. package/utils/JsViewVueWidget/JsvPieChart.vue +1 -1
  93. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +1 -1
  94. package/utils/JsViewVueWidget/JsvPreload/index.js +1 -1
  95. package/utils/JsViewVueWidget/JsvProgressBar.vue +172 -0
  96. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +0 -1
  97. package/utils/JsViewVueWidget/JsvQrcode/index.js +1 -1
  98. package/utils/JsViewVueWidget/JsvRadarChart.vue +1 -1
  99. package/utils/JsViewVueWidget/JsvScaleTextBox.vue +0 -2
  100. package/utils/JsViewVueWidget/JsvSector.vue +1 -1
  101. package/utils/JsViewVueWidget/JsvSoundPool.js +1 -1
  102. package/utils/JsViewVueWidget/JsvSpray/index.js +1 -1
  103. package/utils/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.ts +235 -0
  104. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +433 -401
  105. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue +120 -0
  106. package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -2
  107. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +5 -5
  108. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +425 -422
  109. package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +1 -1
  110. package/utils/JsViewVueWidget/index.js +7 -3
  111. package/utils/index.js +4 -0
  112. package/utils/JsViewVueWidget/JsvApic/BrowserApic/LoopToolBase.js +0 -25
  113. package/utils/JsViewVueWidget/JsvApic/BrowserApic/PartLoopTool.js +0 -119
  114. package/utils/JsViewVueWidget/JsvApic/BrowserApic/Viewer.js +0 -106
  115. /package/utils/JsViewPlugin/JsvLatex/{JsvLatexBrowser.vue → BrowserJsvLatex.vue} +0 -0
  116. /package/utils/JsViewPlugin/JsvPlayer/{JsvPlayerBrowser-0.9.vue → BrowserJsvPlayer-0.9.vue} +0 -0
  117. /package/utils/JsViewPlugin/JsvPlayer/{JsvPlayerBrowser.vue → BrowserJsvPlayer.vue} +0 -0
  118. /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/ApicDataBase.js +0 -0
  119. /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/GifData.js +0 -0
  120. /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/WebpData.js +0 -0
@@ -0,0 +1,354 @@
1
+ <!--
2
+ * 【模块 export 内容】
3
+ * JsvConnectLine:Vue高阶组件,由JsvLine组件变化而来,用于连接两个区域的线条。
4
+ * props说明(注意:全部属性非响应式, 需要变更时用 key 来触发重绘):
5
+ * startPos {Object} (必填) 起始位置,属性:x,y
6
+ * endPos {Object} (必填) 结束位置, 属性:x,y
7
+ * lineWidth {Number} (必填) 线条的粗细程度
8
+ * backgroundColor {String} 背景颜色,默认值:白色#FFFFFF
9
+ * radius {Number} 圆角半径,若半径超过起点终点距离的一半,则没有曲线为直线。
10
+ * isVertical {Boolean} (必填) true为y轴拐点,false为x轴拐点
11
+ * percent {Number} (必填) 承接isVertical,百分比拐点。
12
+ * RoundSet {Object} 圆角配置对象,可选开始拐点和结束拐点,false代表不配置,true代表配置。属性值:start,end
13
+ *
14
+ -->
15
+ <template>
16
+ <div v-if="isOneDirection">
17
+ <JsvLine
18
+ :startPos="props.startPos"
19
+ :endPos="props.endPos"
20
+ :lineWidth="lineWidth"
21
+ :backgroundColor="props.backgroundColor"
22
+ ></JsvLine>
23
+ </div>
24
+ <div v-else>
25
+ <!-- 第一根线 -->
26
+ <JsvLine
27
+ :startPos="props.startPos"
28
+ :endPos="endPos1"
29
+ :lineWidth="lineWidth"
30
+ :backgroundColor="props.backgroundColor"
31
+ ></JsvLine>
32
+ <!-- 第二根线 -->
33
+ <JsvLine
34
+ :startPos="startPos2"
35
+ :endPos="endPos2"
36
+ :lineWidth="lineWidth"
37
+ :backgroundColor="props.backgroundColor"
38
+ ></JsvLine>
39
+ <!-- 第三根线 -->
40
+ <JsvLine
41
+ :startPos="startPos3"
42
+ :endPos="props.endPos"
43
+ :lineWidth="lineWidth"
44
+ :backgroundColor="props.backgroundColor"
45
+ ></JsvLine>
46
+ <!-- 起始圆弧 -->
47
+ <div
48
+ v-if="start"
49
+ :style="{
50
+ width: props.radius + lineWidth / 2 + 2,
51
+ height: props.radius + lineWidth / 2 + 2,
52
+ left: startCircleLeft,
53
+ top: startCircleTop,
54
+ backgroundImage: `jsvtexturestore://${sourceId}`,
55
+ transform: `rotate3d(0,0,1, ${angleStart}deg)`,
56
+ transformOrigin: 'left top',
57
+ }"
58
+ ></div>
59
+ <!-- 结束圆弧 -->
60
+ <div
61
+ v-if="end"
62
+ :style="{
63
+ width: props.radius + lineWidth / 2 + 2,
64
+ height: props.radius + lineWidth / 2 + 2,
65
+ left: endCircleLeft,
66
+ top: endCircleTop,
67
+ backgroundImage: `jsvtexturestore://${sourceId}`,
68
+ transform: `rotate3d(0,0,1, ${angleEnd}deg)`,
69
+ transformOrigin: 'left top',
70
+ }"
71
+ ></div>
72
+ </div>
73
+ </template>
74
+
75
+ <script setup>
76
+ import JsvLine from "../JsvLine/index";
77
+ import { createTexture } from "./ArcLineManager";
78
+ import { shallowRef } from "vue";
79
+ const props = defineProps({
80
+ startPos: {
81
+ type: Object,
82
+ require: true,
83
+ },
84
+ endPos: {
85
+ type: Object,
86
+ require: true,
87
+ },
88
+ lineWidth: {
89
+ type: Number,
90
+ require: true,
91
+ },
92
+ isVertical: {
93
+ type: Boolean,
94
+ require: true,
95
+ },
96
+ percent: {
97
+ type: Number,
98
+ require: true,
99
+ },
100
+ backgroundColor: {
101
+ type: String,
102
+ },
103
+ radius: {
104
+ type: Number,
105
+ },
106
+ RoundSet: {
107
+ type: Object,
108
+ default: {
109
+ start: false,
110
+ end: false,
111
+ },
112
+ },
113
+ });
114
+ //检查传值是否合法
115
+ if (props.percent < 0 || props.percent > 100) {
116
+ throw new Error("请传入正确的百分比值:0-100!");
117
+ }
118
+ let isNormal = shallowRef(false);
119
+ let isOneDirection = shallowRef(false);
120
+ let angleStart = 0;
121
+ let angleEnd = 0;
122
+ let start = shallowRef(false);
123
+ let end = shallowRef(false);
124
+ let endPos1 = {};
125
+ let startPos2 = {};
126
+ let endPos2 = {};
127
+ let startPos3 = {};
128
+ let endCircleLeft = 0;
129
+ let endCircleTop = 0;
130
+ let startCircleLeft = 0;
131
+ let startCircleTop = 0;
132
+ //单数线宽强制变为双数线宽
133
+ let lineWidth;
134
+ if (props.lineWidth % 2 == 0) {
135
+ lineWidth = props.lineWidth;
136
+ } else {
137
+ lineWidth = props.lineWidth + 1;
138
+ }
139
+ //首先判断起始点终点是否在同一个位置
140
+ if (props.startPos.x == props.endPos.x || props.startPos.y == props.endPos.y) {
141
+ isOneDirection.value = true;
142
+ } else {
143
+ isOneDirection.value = false;
144
+ }
145
+ //抗锯齿处理
146
+ let myLineTexture = null;
147
+ let sourceId = null;
148
+ myLineTexture = createTexture(lineWidth, props.backgroundColor, props.radius);
149
+ sourceId = myLineTexture.getSourceId();
150
+
151
+ //转折点坐标
152
+ let InflectionPoint = {
153
+ x: props.isVertical
154
+ ? props.startPos.x
155
+ : props.startPos.x +
156
+ ((props.endPos.x - props.startPos.x) * props.percent) / 100,
157
+ y: props.isVertical
158
+ ? props.startPos.y +
159
+ ((props.endPos.y - props.startPos.y) * props.percent) / 100
160
+ : props.startPos.y,
161
+ };
162
+ //分离距离用以比较是否可以画圆弧
163
+ let startDistanceX;
164
+ let startDistanceY;
165
+ let endDistanceX;
166
+ let endDistanceY;
167
+ if (props.isVertical) {
168
+ //isNormal的值
169
+ if (props.startPos.y < props.endPos.y) {
170
+ isNormal.value = true;
171
+ angleStart = 90;
172
+ angleEnd = -90;
173
+ } else {
174
+ isNormal.value = false;
175
+ angleStart = 180;
176
+ angleEnd = 0;
177
+ }
178
+ endDistanceX = startDistanceX =
179
+ Math.abs(props.startPos.x - props.endPos.x) / 2;
180
+ startDistanceY = Math.abs(props.startPos.y - InflectionPoint.y);
181
+ endDistanceY = Math.abs(props.endPos.y - InflectionPoint.y);
182
+ } else {
183
+ if (props.startPos.y < props.endPos.y) {
184
+ isNormal.value = true;
185
+ angleStart = -90;
186
+ angleEnd = 90;
187
+ } else {
188
+ isNormal.value = false;
189
+ angleStart = 0;
190
+ angleEnd = 180;
191
+ }
192
+ startDistanceX = Math.abs(props.startPos.x - InflectionPoint.x);
193
+ endDistanceX = Math.abs(props.endPos.x - InflectionPoint.x);
194
+ endDistanceY = startDistanceY =
195
+ Math.abs(props.startPos.y - props.endPos.y) / 2;
196
+ }
197
+ //比较半径与距离的关系
198
+ if (props.radius) {
199
+ //判断起始拐点和结束拐点是否能画圆
200
+ if (props.RoundSet.start) {
201
+ //起始拐点
202
+ if (
203
+ props.radius + lineWidth / 2 + 2 <= startDistanceX &&
204
+ props.radius + lineWidth / 2 + 2 <= startDistanceY
205
+ ) {
206
+ start.value = true;
207
+
208
+ endPos1.x = props.isVertical
209
+ ? props.startPos.x
210
+ : InflectionPoint.x - props.radius;
211
+ if (props.isVertical) {
212
+ endPos1.y = isNormal.value
213
+ ? InflectionPoint.y - props.radius + 2
214
+ : InflectionPoint.y + props.radius - 2;
215
+ } else {
216
+ endPos1.y = props.startPos.y;
217
+ }
218
+ let startPos2Extra = isNormal.value ? props.radius : -props.radius;
219
+ startPos2.x = props.isVertical
220
+ ? props.startPos.x + props.radius
221
+ : InflectionPoint.x;
222
+ startPos2.y = props.isVertical
223
+ ? InflectionPoint.y
224
+ : props.startPos.y + startPos2Extra;
225
+ startCircleLeft = props.isVertical
226
+ ? props.startPos.x + props.radius
227
+ : InflectionPoint.x - props.radius;
228
+ if (props.isVertical) {
229
+ startCircleTop = isNormal.value
230
+ ? InflectionPoint.y - props.radius + 2
231
+ : InflectionPoint.y + props.radius + 2;
232
+ } else {
233
+ startCircleTop = isNormal.value
234
+ ? props.startPos.y + props.radius + 2
235
+ : props.startPos.y - props.radius + 2;
236
+ }
237
+ } else {
238
+ let startPos2Extra = isNormal.value
239
+ ? -lineWidth / 2 - 1
240
+ : lineWidth / 2 + 1;
241
+ let endPos1Extra = isNormal.value
242
+ ? lineWidth / 2 + 1
243
+ : -lineWidth / 2 - 1;
244
+ endPos1.x = props.isVertical ? props.startPos.x : InflectionPoint.x;
245
+ endPos1.y = props.isVertical
246
+ ? InflectionPoint.y + endPos1Extra
247
+ : props.startPos.y;
248
+ startPos2.x = props.isVertical ? props.startPos.x : InflectionPoint.x;
249
+ startPos2.y = props.isVertical
250
+ ? InflectionPoint.y
251
+ : props.startPos.y + startPos2Extra;
252
+ }
253
+ } else {
254
+ let startPos2Extra = isNormal.value
255
+ ? -lineWidth / 2 - 1
256
+ : lineWidth / 2 + 1;
257
+ let endPos1Extra = isNormal.value ? lineWidth / 2 + 1 : -lineWidth / 2 - 1;
258
+ endPos1.x = props.isVertical ? props.startPos.x : InflectionPoint.x;
259
+ endPos1.y = props.isVertical
260
+ ? InflectionPoint.y + endPos1Extra
261
+ : props.startPos.y;
262
+ startPos2.x = props.isVertical ? props.startPos.x : InflectionPoint.x;
263
+ startPos2.y = props.isVertical
264
+ ? InflectionPoint.y
265
+ : props.startPos.y + startPos2Extra;
266
+ }
267
+ //结束拐点
268
+ if (props.RoundSet.end) {
269
+ if (
270
+ props.radius + lineWidth / 2 + 2 <= endDistanceX &&
271
+ props.radius + lineWidth / 2 + 2 <= endDistanceY
272
+ ) {
273
+ let startPos3Extra = isNormal.value ? props.radius : -props.radius;
274
+ end.value = true;
275
+ endPos2.x = props.isVertical
276
+ ? props.endPos.x - props.radius
277
+ : InflectionPoint.x;
278
+ let endPos2Extra = isNormal.value ? -props.radius + 2 : props.radius - 2;
279
+ endPos2.y = props.isVertical
280
+ ? InflectionPoint.y
281
+ : props.endPos.y + endPos2Extra;
282
+ startPos3.x = props.isVertical
283
+ ? props.endPos.x
284
+ : InflectionPoint.x + props.radius;
285
+ startPos3.y = props.isVertical
286
+ ? InflectionPoint.y + startPos3Extra
287
+ : props.endPos.y;
288
+ endCircleLeft = props.isVertical
289
+ ? props.endPos.x - props.radius
290
+ : InflectionPoint.x + props.radius;
291
+ if (props.isVertical) {
292
+ endCircleTop = isNormal.value
293
+ ? InflectionPoint.y + props.radius + 2
294
+ : InflectionPoint.y - props.radius + 2;
295
+ } else {
296
+ endCircleTop = isNormal.value
297
+ ? props.endPos.y - props.radius + 2
298
+ : props.endPos.y + props.radius + 2;
299
+ }
300
+ } else {
301
+ let endPos2Extra = isNormal.value
302
+ ? lineWidth / 2 + 1
303
+ : -lineWidth / 2 - 1;
304
+ let startPos3Extra = isNormal.value
305
+ ? -lineWidth / 2 - 1
306
+ : lineWidth / 2 + 1;
307
+ endPos2.x = props.isVertical ? props.endPos.x : InflectionPoint.x;
308
+ endPos2.y = props.isVertical
309
+ ? InflectionPoint.y
310
+ : props.endPos.y + endPos2Extra;
311
+ startPos3.x = props.isVertical ? props.endPos.x : InflectionPoint.x;
312
+ startPos3.y = props.isVertical
313
+ ? InflectionPoint.y + startPos3Extra
314
+ : props.endPos.y;
315
+ }
316
+ } else {
317
+ let endPos2Extra = isNormal.value ? lineWidth / 2 + 1 : -lineWidth / 2 - 1;
318
+ let startPos3Extra = isNormal.value
319
+ ? -lineWidth / 2 - 1
320
+ : lineWidth / 2 + 1;
321
+ endPos2.x = props.isVertical ? props.endPos.x : InflectionPoint.x;
322
+ endPos2.y = props.isVertical
323
+ ? InflectionPoint.y
324
+ : props.endPos.y + endPos2Extra;
325
+ startPos3.x = props.isVertical ? props.endPos.x : InflectionPoint.x;
326
+ startPos3.y = props.isVertical
327
+ ? InflectionPoint.y + startPos3Extra
328
+ : props.endPos.y;
329
+ }
330
+ } else {
331
+ let startPos2Extra = isNormal.value ? -lineWidth / 2 - 1 : lineWidth / 2 + 1;
332
+ let endPos1Extra = isNormal.value ? lineWidth / 2 + 1 : -lineWidth / 2 - 1;
333
+ endPos1.x = props.isVertical ? props.startPos.x : InflectionPoint.x;
334
+ endPos1.y = props.isVertical
335
+ ? InflectionPoint.y + endPos1Extra
336
+ : props.startPos.y;
337
+ startPos2.x = props.isVertical ? props.startPos.x : InflectionPoint.x;
338
+ startPos2.y = props.isVertical
339
+ ? InflectionPoint.y
340
+ : props.startPos.y + startPos2Extra;
341
+ let endPos2Extra = isNormal.value ? lineWidth / 2 + 1 : -lineWidth / 2 - 1;
342
+ let startPos3Extra = isNormal.value ? -lineWidth / 2 - 1 : lineWidth / 2 + 1;
343
+ endPos2.x = props.isVertical ? props.endPos.x : InflectionPoint.x;
344
+ endPos2.y = props.isVertical
345
+ ? InflectionPoint.y
346
+ : props.endPos.y + endPos2Extra;
347
+ startPos3.x = props.isVertical ? props.endPos.x : InflectionPoint.x;
348
+ startPos3.y = props.isVertical
349
+ ? InflectionPoint.y + startPos3Extra
350
+ : props.endPos.y;
351
+ }
352
+ </script>
353
+
354
+ <style scoped></style>
@@ -0,0 +1,2 @@
1
+ import JsvConnectLine from "./JsvConnectLine.vue"
2
+ export default JsvConnectLine
@@ -9,24 +9,27 @@ import ActionPackBuilder from "./SetAction"
9
9
  import StatePackBuilder from "./SetState";
10
10
  import CallbackManager from "./CallbackManager";
11
11
  import ActionRefObject from "./ActionRefObject";
12
- import { RunFreeMoveCmdPacks, FreeMoveAnimClass } from "./ForgeTypeDefine"
12
+ import { RunFreeMoveCmdPacks, FreeMoveAnimClass, FinishRenderBreak } from "./ForgeTypeDefine"
13
+ import { NexusNode, newNexus } from "./NexusNode";
13
14
 
14
15
 
15
16
  class ActorControl {
16
17
  private _BindView: any;
17
18
  private _BindAnim: any;
18
19
  private _Callbacks: CallbackManager;
20
+ private _SelfNexusRecv: NexusNode;
19
21
 
20
- private _ConditionPackBuilder: ConditionPackBuilder;
21
- private _ActionPackBuilder: ActionPackBuilder;
22
+ private _SharedQuickConditionPackBuilder: ConditionPackBuilder;
23
+ private _SharedQuickActionPackBuilder: ActionPackBuilder;
22
24
  private _StatePackBuilder: StatePackBuilder;
23
25
 
24
26
  constructor() {
25
27
  this._BindView = null;
26
28
  this._BindAnim = null;
27
29
  this._Callbacks = new CallbackManager();
28
- this._ConditionPackBuilder = new ConditionPackBuilder(this._Callbacks);
29
- this._ActionPackBuilder = new ActionPackBuilder(this._Callbacks);
30
+ this._SelfNexusRecv = newNexus();
31
+ this._SharedQuickConditionPackBuilder = new ConditionPackBuilder(this._Callbacks, this._SelfNexusRecv);
32
+ this._SharedQuickActionPackBuilder = new ActionPackBuilder(this._Callbacks, this._SelfNexusRecv);
30
33
  this._StatePackBuilder = new StatePackBuilder();
31
34
  }
32
35
 
@@ -74,16 +77,23 @@ class ActorControl {
74
77
  * @param {int} group 可选参数,默认为0, 有效值为0~3, 对应默认组, 1组, 2组, 3组, 便于remove时,按组进行清理
75
78
  * @param {boolean} multiTimes 可选参数,默认为false, 是否要多次执行, 若为单次,则执行后condition作废
76
79
  * @param {string} specName 可选参数,默认null, 命名condition, 用于指定名字进行active/deactive动作的场景
80
+ * @param {boolean} shoudRenderBreak 可选参数,默认false, 关联的回调是否会发起RenderBreak
77
81
  * @return {ConditionPackBuilder} ConditionPack 的工厂对象
78
82
  */
79
83
  condition(
80
84
  group: number = 0,
81
85
  multiTimes: boolean = false,
82
- specName: string | null = null
86
+ specName: string | null = null,
87
+ shoudRenderBreak: boolean = false
83
88
  ): ConditionPackBuilder {
84
89
  // 注意: 不支持获取condition后,多次复制
85
- this._ConditionPackBuilder.updateCommandInfo(group, multiTimes, specName);
86
- return this._ConditionPackBuilder;
90
+ let builder: ConditionPackBuilder = this._SharedQuickConditionPackBuilder;
91
+ if (builder.isInUsing()) {
92
+ // 用于加速的builder被占用了,为了防止状态问题,使用新建builder
93
+ builder = new ConditionPackBuilder(this._Callbacks, this._SelfNexusRecv);
94
+ }
95
+ builder.updateCommandInfo(group, multiTimes, specName, shoudRenderBreak);
96
+ return builder;
87
97
  }
88
98
 
89
99
  /**
@@ -98,16 +108,21 @@ class ActorControl {
98
108
  * x轴保持为1, y轴保持为2,可"与或"让两个轴都保持
99
109
  * @param {int} xyAccKeeps xy轴上的加速度是否保持(与新Action不冲突的才会被保留),
100
110
  * x轴保持为1, y轴保持为2,可"与或"让两个轴都保持
101
- * @param {Object} actRef 一个Object, 传入后会填入对此action的ref,用于后续制作
111
+ * @param {NexusNode} nexusRecv 此动作发出的 nexusEvent 的接受者
102
112
  * @return {ActionPackBuilder} ActionPack 的工厂对象
103
113
  */
104
114
  action(
105
115
  xySpeedKeeps: number = 0,
106
116
  xyAccKeeps: number = 0,
107
- actRef: ActionRefObject | null = null
117
+ nexusRecv: NexusNode | null = null
108
118
  ): ActionPackBuilder {
109
- this._ActionPackBuilder.updateCommonInfo(xySpeedKeeps, xyAccKeeps, actRef);
110
- return this._ActionPackBuilder;
119
+ let builder: ActionPackBuilder = this._SharedQuickActionPackBuilder;
120
+ if (builder.isInUsing()) {
121
+ // 用于加速的builder被占用了,为了防止状态问题,使用新建builder
122
+ builder = new ActionPackBuilder(this._Callbacks, this._SelfNexusRecv);
123
+ }
124
+ builder.updateCommonInfo(xySpeedKeeps, xyAccKeeps, nexusRecv);
125
+ return builder;
111
126
  }
112
127
 
113
128
  /**
@@ -124,18 +139,22 @@ class ActorControl {
124
139
  _OnEchoEvent(retJson: string) {
125
140
  // 遇到layout后仍然会因为新broadcast有动作时,一帧中可能会有多次回调
126
141
  let retJsonObject: Object = JSON.parse(retJson);
127
- let actorState = retJsonObject;
128
- let echoTokens = retJsonObject["eTkns"];
129
- if (echoTokens) {
130
- for (let etoken of echoTokens) {
131
- this._Callbacks.invokeCallback(etoken, actorState);
142
+ let echoRetList = retJsonObject["retList"];
143
+ if (echoRetList) {
144
+ for (let echoRet of echoRetList) {
145
+ let renderBreakId = echoRet["rbTkn"];
146
+ if (renderBreakId != 0) {
147
+ // 标识此RenderBreak完成
148
+ FinishRenderBreak(renderBreakId);
149
+ }
150
+ this._Callbacks.invokeCallback(echoRet["eTkn"], retJsonObject);
132
151
  }
133
152
  }
134
153
  }
135
154
 
136
155
  _EnsureAnim() {
137
156
  if (!this._BindAnim) {
138
- this._BindAnim = new FreeMoveAnimClass(this._OnEchoEvent.bind(this));
157
+ this._BindAnim = new FreeMoveAnimClass(this._OnEchoEvent.bind(this), this._SelfNexusRecv.token);
139
158
  this._BindView.StartAnimation(this._BindAnim);
140
159
  }
141
160
  }
@@ -5,7 +5,7 @@
5
5
  * @Description: file content
6
6
  */
7
7
 
8
- import { Forge } from "@shijiu/jsview/dom/jsv-forge-define.mjs";
8
+ import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
9
9
 
10
10
  // 此文件声明来自engine-js的api和类型声明
11
11
 
@@ -20,6 +20,7 @@ const ActEventDefine = {
20
20
 
21
21
  // GroupType
22
22
  const GroupType_ActionAssoc: number = Forge.FreeMoveExternType?.GroupType_ActionAssoc;
23
+ const GroupType_Invalid: number = Forge.FreeMoveExternType?.GroupType_Invalid;
23
24
 
24
25
  // Builders
25
26
  const ConditionSetBuilder: any = Forge.FreeMoveConditionSet;
@@ -33,6 +34,8 @@ const FreeMoveAnimClass: any = Forge.FreeMoveAnimation;
33
34
  // Run function
34
35
  const RunFreeMoveCmdPacks: Function = Forge.AnimFireCommand.RunFreeMoveCmdPacks;
35
36
 
37
+ const FinishRenderBreak: Function = Forge.sRenderBridge.FinishRenderBreak.bind(Forge.sRenderBridge);
38
+
36
39
  export {
37
40
  GroupType_ActionAssoc,
38
41
  ActEventDefine,
@@ -41,5 +44,6 @@ export {
41
44
  StateCmdBuilder,
42
45
  CmdPackBuilder,
43
46
  FreeMoveAnimClass,
44
- RunFreeMoveCmdPacks
45
- }
47
+ RunFreeMoveCmdPacks,
48
+ FinishRenderBreak
49
+ }
@@ -17,6 +17,17 @@ import ActControl from "./ActorControl.ts";
17
17
  import { shallowRef, onMounted } from "vue";
18
18
 
19
19
  const props = defineProps({
20
+ // 设置给父节点,动画节点必须top/left为0, 以保证PC端模拟通过style直接获取当前位置信息的逻辑能通过
21
+ top: {
22
+ default: 0,
23
+ type: Number,
24
+ },
25
+ left: {
26
+ default: 0,
27
+ type: Number,
28
+ },
29
+
30
+ // 设置给实际的动画节点
20
31
  width: {
21
32
  default: 0,
22
33
  type: Number,
@@ -40,7 +51,22 @@ defineExpose({
40
51
  </script>
41
52
 
42
53
  <template>
43
- <div ref="mainDivRef" :style="{ width: props.width, height: props.height }">
44
- <slot></slot>
54
+ <div
55
+ :style="{
56
+ top: props.top,
57
+ left: props.left,
58
+ }"
59
+ >
60
+ <div
61
+ ref="mainDivRef"
62
+ :style="{
63
+ top: 0,
64
+ left: 0,
65
+ width: props.width,
66
+ height: props.height,
67
+ }"
68
+ >
69
+ <slot></slot>
70
+ </div>
45
71
  </div>
46
72
  </template>
@@ -30,6 +30,8 @@ import {
30
30
  toRaw,
31
31
  watchEffect,
32
32
  onMounted,
33
+ onUnmounted,
34
+ reactive,
33
35
  onActivated,
34
36
  onDeactivated,
35
37
  } from "vue";
@@ -83,16 +85,16 @@ let sensorRef = null;
83
85
  // 变更四边检测开关和关联id
84
86
  watchEffect(() => {
85
87
  if (viewMounted.status) {
86
- if (!isNan(props.TopGID)) {
87
- sensorRef.ResetTopGID(props.TopGID);
88
+ if (!isNaN(props.topGID)) {
89
+ sensorRef.ResetTopGID(props.topGID);
88
90
  }
89
- if (!isNan(props.bottomGID)) {
91
+ if (!isNaN(props.bottomGID)) {
90
92
  sensorRef.ResetBottomGID(props.bottomGID);
91
93
  }
92
- if (!isNan(props.leftGID)) {
94
+ if (!isNaN(props.leftGID)) {
93
95
  sensorRef.ResetLeftGID(props.leftGID);
94
96
  }
95
- if (!isNan(props.rightGID)) {
97
+ if (!isNaN(props.rightGID)) {
96
98
  sensorRef.ResetRightGID(props.rightGID);
97
99
  }
98
100
  }
@@ -114,6 +116,11 @@ onMounted(() => {
114
116
  viewMounted.status = true;
115
117
  });
116
118
 
119
+ onUnmounted(() => {
120
+ viewMounted.status = false;
121
+ sensorRef.Enable(false);
122
+ });
123
+
117
124
  onActivated(() => {
118
125
  sensorRef.Enable(props.enable);
119
126
  });
@@ -0,0 +1,21 @@
1
+
2
+ let sNexusIdGen = 0x4000_0000; // 预留0为无效值
3
+
4
+ //js端预留的id范围为 0x40000000-0x7FFFFFFF
5
+ class NexusNode {
6
+ public token: number;
7
+
8
+ constructor() {
9
+ sNexusIdGen = (sNexusIdGen + 1 - 0x4000_0000) % 0x4000_0000 + 0x4000_0000
10
+ this.token = sNexusIdGen;
11
+ }
12
+ }
13
+
14
+ function newNexus(): NexusNode {
15
+ return new NexusNode();
16
+ }
17
+
18
+ export {
19
+ NexusNode,
20
+ newNexus
21
+ }