@shijiu/jsview-vue 2.2.128 → 2.2.201

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 (91) hide show
  1. package/bin/browser/BrowserApic.vue.mjs +2 -2
  2. package/bin/browser/BrowserApic2.vue.mjs +2 -2
  3. package/bin/browser/BrowserApicLib.mjs +8 -2
  4. package/bin/browser/BrowserJsvFragShaderView.vue.mjs +63 -0
  5. package/bin/jsview-vue.mjs +1604 -423
  6. package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +8 -6
  7. package/bin/types/JsViewEngineWidget/MetroWidget/Dispatcher.d.ts +10 -12
  8. package/bin/types/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +3 -3
  9. package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +3 -3
  10. package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +2 -2
  11. package/bin/types/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +3 -0
  12. package/bin/types/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +1 -0
  13. package/bin/types/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +1 -1
  14. package/bin/types/JsViewEngineWidget/index.d.ts +10 -1
  15. package/bin/types/JsViewVueTools/ConstSymbol.d.ts +2 -2
  16. package/bin/types/JsViewVueTools/JsvFederationTools.d.ts +16 -0
  17. package/bin/types/JsViewVueTools/JsvPerformance.d.ts +5 -0
  18. package/bin/types/JsViewVueTools/JsvPreDownloader.d.ts +33 -0
  19. package/bin/types/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +45 -1
  20. package/bin/types/JsViewVueTools/index.d.ts +19 -11
  21. package/bin/types/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +1 -1
  22. package/bin/types/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +1 -1
  23. package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +1 -1
  24. package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +1 -1
  25. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.d.ts +2 -1
  26. package/bin/types/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +70 -0
  27. package/bin/types/JsViewVueWidget/JsvClipDiv/index.d.ts +1 -0
  28. package/bin/types/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +104 -0
  29. package/bin/types/JsViewVueWidget/JsvDriftScope/index.d.ts +1 -0
  30. package/bin/types/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue.d.ts +13 -0
  31. package/bin/types/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +13 -0
  32. package/bin/types/JsViewVueWidget/JsvFragShaderView/index.d.ts +2 -0
  33. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +43 -17
  34. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +5 -5
  35. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +4 -2
  36. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +7 -7
  37. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.d.ts +18 -0
  38. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +2 -0
  39. package/bin/types/JsViewVueWidget/JsvNinePatch.vue.d.ts +1 -0
  40. package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +61 -1
  41. package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +153 -0
  42. package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.d.ts +4 -0
  43. package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollSymbol.d.ts +9 -4
  44. package/bin/types/JsViewVueWidget/JsvScrollBox/index.d.ts +2 -0
  45. package/bin/types/JsViewVueWidget/index.d.ts +3 -0
  46. package/package.json +1 -1
  47. package/tools/config/rollup.config.mjs +1 -0
  48. package/utils/JsViewEngineWidget/JsvFocus/{JsvFocusManager.js → JsvFocusManager.ts} +12 -12
  49. package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.ts +20 -0
  50. package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +27 -10
  51. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +42 -10
  52. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +320 -203
  53. package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +11 -0
  54. package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +8 -0
  55. package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +20 -10
  56. package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +18 -0
  57. package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +7 -0
  58. package/utils/JsViewEngineWidget/{index.js → index.ts} +1 -1
  59. package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +21 -2
  60. package/utils/JsViewVueTools/ConstSymbol.ts +2 -2
  61. package/utils/JsViewVueTools/JsvPreDownloader.ts +3 -3
  62. package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +1 -1
  63. package/utils/JsViewVueTools/index.js +19 -19
  64. package/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue +2 -2
  65. package/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue +3 -3
  66. package/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue +2 -2
  67. package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +3 -3
  68. package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.js +8 -3
  69. package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +42 -0
  70. package/utils/JsViewVueWidget/JsvClipDiv/index.ts +1 -0
  71. package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +5 -1
  72. package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +82 -0
  73. package/utils/JsViewVueWidget/JsvDriftScope/index.ts +1 -0
  74. package/utils/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue +48 -0
  75. package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +145 -0
  76. package/utils/JsViewVueWidget/JsvFragShaderView/index.js +18 -0
  77. package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +142 -63
  78. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +15 -6
  79. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +19 -7
  80. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +15 -11
  81. package/utils/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.ts +120 -0
  82. package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +5 -1
  83. package/utils/JsViewVueWidget/JsvNinePatch.vue +13 -1
  84. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +257 -48
  85. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +468 -0
  86. package/utils/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.ts +9 -0
  87. package/utils/JsViewVueWidget/JsvScrollBox/ScrollSymbol.ts +13 -4
  88. package/utils/JsViewVueWidget/JsvScrollBox/index.ts +3 -0
  89. package/utils/JsViewVueWidget/index.js +3 -0
  90. package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.js +0 -19
  91. package/utils/JsViewVueWidget/JsvScrollBox/index.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { Forge as Forge$1 } from '@shijiu/jsview/dom/jsv-forge-define.mjs';
2
- import { ref, computed, toRaw, reactive, nextTick, onMounted, onUpdated, onBeforeUnmount, onBeforeUpdate, openBlock, createElementBlock, renderSlot, shallowRef, resolveComponent, normalizeStyle, createElementVNode, unref, mergeProps, toHandlers, createVNode, withCtx, Fragment, renderList, createCommentVNode, inject, provide, onUnmounted, onActivated, onDeactivated, createBlock, defineAsyncComponent, normalizeProps, guardReactiveProps, watchEffect, toDisplayString, watch, shallowReactive, withDirectives, vShow, defineComponent } from 'vue';
2
+ import { ref, computed, toRaw, reactive, nextTick, onMounted, onUpdated, onBeforeUnmount, onBeforeUpdate, openBlock, createElementBlock, renderSlot, shallowRef, resolveComponent, normalizeStyle, createElementVNode, unref, createVNode, withCtx, Fragment, renderList, createCommentVNode, inject, provide, onUnmounted, onActivated, onDeactivated, createBlock, defineAsyncComponent, normalizeProps, guardReactiveProps, watchEffect, mergeProps, toDisplayString, watch, shallowReactive, withDirectives, vShow, defineComponent } from 'vue';
3
3
  import { Forge as Forge$2, ForgeExtension } from '@shijiu/jsview/dom/jsv-forge-define';
4
4
  import { createWebHashHistory, createMemoryHistory } from 'vue-router';
5
5
  import { L as LoopType } from './jsview-vue-common.mjs';
@@ -196,17 +196,17 @@ const FocusMoveType = {
196
196
  const RENDER_ITEM_BREAK_KEY = "__QcodeJsviewMetroWidgetSlot";
197
197
 
198
198
  //
199
- // utils/JsViewEngineWidget/MetroWidget/Dispatcher.js;
199
+ // utils/JsViewEngineWidget/MetroWidget/Dispatcher.ts;
200
200
  //
201
201
  class Dispatcher extends BaseDispatcher {
202
+ static Type = {
203
+ setFocusId: Symbol("setFocusId"),
204
+ updateItem: Symbol("updateItem"),
205
+ slideToItem: Symbol("slideTo"),
206
+ setEnterFocusId: Symbol("setEnterFocusId"),
207
+ setEnterFocusRect: Symbol("setEnterFocusRect")
208
+ };
202
209
  }
203
- Dispatcher.Type = {
204
- setFocusId: Symbol("setFocusId"),
205
- updateItem: Symbol("updateItem"),
206
- slideToItem: Symbol("slideTo"),
207
- setEnterFocusId: Symbol("setEnterFocusId"),
208
- setEnterFocusRect: Symbol("setEnterFocusRect")
209
- };
210
210
 
211
211
  //
212
212
  // utils/JsViewEngineWidget/TemplateParser/Fence.ts;
@@ -1596,18 +1596,28 @@ class CommonMetroTemplate extends MetroTemplate {
1596
1596
  endIndex = baseItem.index;
1597
1597
  }
1598
1598
  if (Math.abs(startIndex - endIndex) <= 1) {
1599
- const tailItem = this.templateList[this.getTailItemIndex()];
1600
- let tailInfo = null;
1601
- if (tailItem) {
1602
- tailInfo = {
1603
- left: tailItem.left,
1604
- top: tailItem.top,
1605
- width: tailItem.width,
1606
- height: tailItem.height
1607
- };
1599
+ const startItem = this.templateList[startIndex];
1600
+ const endItem = this.templateList[endIndex];
1601
+ if (visible(startItem[posKey], startItem[posKey] + startItem[sizeKey])) {
1602
+ baseItem = startItem;
1603
+ break;
1604
+ } else if (visible(endItem[posKey], endItem[posKey] + endItem[sizeKey])) {
1605
+ baseItem = endItem;
1606
+ break;
1607
+ } else {
1608
+ const tailItem = this.templateList[this.getTailItemIndex()];
1609
+ let tailInfo = null;
1610
+ if (tailItem) {
1611
+ tailInfo = {
1612
+ left: tailItem.left,
1613
+ top: tailItem.top,
1614
+ width: tailItem.width,
1615
+ height: tailItem.height
1616
+ };
1617
+ }
1618
+ console.log("MetroWidget: can not find visible item", visibleStart, visibleEnd, tailInfo);
1619
+ return [-1, -1];
1608
1620
  }
1609
- console.log("MetroWidget: can not find visible item", visibleStart, visibleEnd, tailInfo);
1610
- return [-1, -1];
1611
1621
  } else {
1612
1622
  baseItem = this.templateList[Math.round((startIndex + endIndex) / 2)];
1613
1623
  }
@@ -1983,6 +1993,9 @@ class TemplateItemAdder {
1983
1993
  return { templateObj: templateItem, measureObj };
1984
1994
  }
1985
1995
  tryAddItem(cur_item = null, page_num = 1) {
1996
+ if (!this._Data || this._Data.length <= 0) {
1997
+ return;
1998
+ }
1986
1999
  let added = false;
1987
2000
  if (this._CurIndex < this._Data.length && (!cur_item || cur_item[this._Key] >= (this._CurPage - 1) * this._PageRange)) {
1988
2001
  while (this._CurIndex < this._Data.length) {
@@ -2008,6 +2021,9 @@ class TemplateItemAdder {
2008
2021
  return added;
2009
2022
  }
2010
2023
  tryAddItemByPosition(position) {
2024
+ if (!this._Data || this._Data.length <= 0) {
2025
+ return;
2026
+ }
2011
2027
  const page_num = Math.ceil(position / this._PageRange + 1);
2012
2028
  if (page_num > this._CurPage) {
2013
2029
  this.tryAddItem(null, page_num - this._CurPage);
@@ -2015,6 +2031,9 @@ class TemplateItemAdder {
2015
2031
  this._OnAddDone?.();
2016
2032
  }
2017
2033
  tryAddItemByIndex(index) {
2034
+ if (!this._Data || this._Data.length <= 0) {
2035
+ return;
2036
+ }
2018
2037
  let _index = Math.min(index, this._Data.length - 1);
2019
2038
  let added = false;
2020
2039
  while (this._CurIndex <= _index) {
@@ -2040,6 +2059,9 @@ class TemplateItemAdder {
2040
2059
  this._OnAddDone?.();
2041
2060
  }
2042
2061
  tryAddItemById(id) {
2062
+ if (!this._Data || this._Data.length <= 0) {
2063
+ return;
2064
+ }
2043
2065
  let _id = Math.min(id, this._Data.length - 1);
2044
2066
  const last_id = this._MetroTemplate.focusableSize - 1;
2045
2067
  if (last_id < _id) {
@@ -2070,6 +2092,9 @@ class TemplateItemAdder {
2070
2092
  this._OnAddDone?.();
2071
2093
  }
2072
2094
  tryAddItemByUid(uid) {
2095
+ if (!this._Data || this._Data.length <= 0) {
2096
+ return;
2097
+ }
2073
2098
  if (this._MetroTemplate.getItemByUid(uid)) {
2074
2099
  return;
2075
2100
  }
@@ -2243,6 +2268,20 @@ class ListMetroTemplate extends MetroTemplate {
2243
2268
  }
2244
2269
  return [start, end];
2245
2270
  }
2271
+ cleanResizeChangeItem(i) {
2272
+ i.neighborIndexList.left = [];
2273
+ i.neighborIndexList.top = [];
2274
+ i.neighborIndexList.right = [];
2275
+ i.neighborIndexList.bottom = [];
2276
+ i.tmpNeighborIndexList.left = [];
2277
+ i.tmpNeighborIndexList.top = [];
2278
+ i.tmpNeighborIndexList.right = [];
2279
+ i.tmpNeighborIndexList.bottom = [];
2280
+ i.pathHistory.left = -1;
2281
+ i.pathHistory.top = -1;
2282
+ i.pathHistory.right = -1;
2283
+ i.pathHistory.bottom = -1;
2284
+ }
2246
2285
  updateItemSize(index, newSize) {
2247
2286
  const item = this.templateList[index];
2248
2287
  if (!item || item.width == newSize.width && item.height == newSize.height) {
@@ -2258,6 +2297,7 @@ class ListMetroTemplate extends MetroTemplate {
2258
2297
  }
2259
2298
  }
2260
2299
  for (let i of needChangeList) {
2300
+ this.cleanResizeChangeItem(i);
2261
2301
  this._addTemplateItem(i);
2262
2302
  i.layoutCache.cache({
2263
2303
  left: i.left,
@@ -2390,6 +2430,7 @@ class RenderItem {
2390
2430
  touchInit = false;
2391
2431
  rootDiv = null;
2392
2432
  enableTap = false;
2433
+ renderKey = ref(0);
2393
2434
  customerCallbackMap = {};
2394
2435
  onRef;
2395
2436
  registerObj;
@@ -2411,6 +2452,13 @@ class RenderItem {
2411
2452
  get index() {
2412
2453
  return this.templateInfo.index;
2413
2454
  }
2455
+ updateCustomData(newCustomData, newItemConfig) {
2456
+ this.customerData = newCustomData;
2457
+ this.itemConfig = newItemConfig;
2458
+ this.customerCallbackMap = {};
2459
+ this.mounted.value = false;
2460
+ this.renderKey.value++;
2461
+ }
2414
2462
  //TODO item的div ref 会调用多次, 待调查
2415
2463
  divRef = (ele) => {
2416
2464
  this.rootDiv = ele;
@@ -2492,6 +2540,7 @@ class RenderItem {
2492
2540
  onDivUnmounted() {
2493
2541
  this.touchInit = false;
2494
2542
  this.divMountedCallback.clear();
2543
+ this.customerCallbackMap = {};
2495
2544
  }
2496
2545
  }
2497
2546
 
@@ -2612,11 +2661,13 @@ class ConditionPackBuilder {
2612
2661
  _CommonInfo;
2613
2662
  _CommonInfoValid;
2614
2663
  _ContorlSlefNexus;
2615
- constructor(callbackManager, selfNexus) {
2664
+ _BuildersFactory;
2665
+ constructor(callbackManager, selfNexus, buildersFactory) {
2616
2666
  this._Callbacks = callbackManager;
2617
2667
  this._CommonInfo = ConditionSetBuilder.InitCommonInfo();
2618
2668
  this._CommonInfoValid = false;
2619
2669
  this._ContorlSlefNexus = selfNexus;
2670
+ this._BuildersFactory = buildersFactory;
2620
2671
  }
2621
2672
  isInUsing() {
2622
2673
  return this._CommonInfoValid;
@@ -2733,6 +2784,7 @@ class ConditionPackBuilder {
2733
2784
  /**
2734
2785
  * onNextTick
2735
2786
  * 用于对一些Condition激活进行延迟,例如teleportTo处理后延迟激活 OnHitBlock 动作,规避teleportTo处理直接触发OnHitBlocker
2787
+ * 特别场景: onNextTick(0) 可用于充当前帧命令执行完毕的回调,相当于为命令执行完毕做一个callback
2736
2788
  *
2737
2789
  */
2738
2790
  onNextTick(tickGap = 1) {
@@ -2740,8 +2792,8 @@ class ConditionPackBuilder {
2740
2792
  return null;
2741
2793
  }
2742
2794
  this._CommonInfoValid = false;
2743
- if (tickGap <= 0) {
2744
- tickGap = 1;
2795
+ if (tickGap < 0) {
2796
+ tickGap = 0;
2745
2797
  }
2746
2798
  return this._BuildPack(ConditionSetBuilder.OnNextTick(tickGap, this._CommonInfo));
2747
2799
  }
@@ -2878,8 +2930,17 @@ class ConditionPackBuilder {
2878
2930
  _BuildPack(conditionSet) {
2879
2931
  let cmdPack = CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.NewCondition(conditionSet));
2880
2932
  let callbackManager = this._Callbacks;
2881
- cmdPack["then"] = (childCmdPackList) => {
2882
- setChildCommnadPackList(conditionSet, callbackManager, childCmdPackList);
2933
+ cmdPack["then"] = (creatorOrArray) => {
2934
+ if (creatorOrArray) {
2935
+ let childCmdPackList;
2936
+ if (typeof creatorOrArray == "function") {
2937
+ childCmdPackList = creatorOrArray(this._BuildersFactory);
2938
+ } else {
2939
+ childCmdPackList = creatorOrArray;
2940
+ }
2941
+ setChildCommnadPackList(conditionSet, callbackManager, childCmdPackList);
2942
+ return cmdPack;
2943
+ }
2883
2944
  return cmdPack;
2884
2945
  };
2885
2946
  return cmdPack;
@@ -3179,21 +3240,28 @@ class ActorPackBuilder {
3179
3240
  * 只能放在 movementSync 的then中,用于将Sync同步信息按比例转化成
3180
3241
  * (注意): 如果触发链条上有自己发出的信息,则将不再产生动作,规避循环触发
3181
3242
  *
3182
- * @param {int} left 运动识别区域的left, 可以为负
3183
- * @param {int} top 运动识别区域的top, 可以为负
3184
- * @param {int} right 运动识别区域的right, 可以为负,必须大于left
3185
- * @param {int} bottom 运动识别区域的bottom, 可以为负,必须大于bottom
3243
+ * @param {int} horizontalStart 横向运动识别区域的0%对应位置, 可以为负
3244
+ * @param {int} horizontalEnd 横向运动识别区域的100%对应位置, 可以为负,可以小于start
3245
+ * @param {int} verticalStart 纵向运动识别区域的0%对应位置, 可以为负
3246
+ * @param {int} verticalEnd 纵向运动识别区域的100%对应位置, 可以为负,可以小于end
3186
3247
  * @param {int} xyEnable x,y是否都触发, 0b01对应x, 0b10对应y, 可以或运算在一起
3187
3248
  * @param {int} syncType 换算公式:
3188
3249
  * 1: 正比公式:selfPercent = givenPercent
3189
3250
  * 2: 反比公式:selfPercent = (1 - givenPercent)
3190
3251
  */
3191
- ackMovementSync(left, top, right, bottom, xyEnable, syncType) {
3252
+ ackMovementSync(horizontalStart, horizontalEnd, verticalStart, verticalEnd, xyEnable, syncType) {
3192
3253
  if (!this._BasicPreProcess("ackMovementSync")) {
3193
3254
  return;
3194
3255
  }
3195
3256
  let cmdList = [];
3196
- cmdList.push(ActionCmdBuilder.AckMovementSync(left, top, right, bottom, xyEnable, syncType));
3257
+ cmdList.push(ActionCmdBuilder.AckMovementSync(
3258
+ horizontalStart,
3259
+ horizontalEnd,
3260
+ verticalStart,
3261
+ verticalEnd,
3262
+ xyEnable,
3263
+ syncType
3264
+ ));
3197
3265
  return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
3198
3266
  }
3199
3267
  _BuildAccelOnPole(builderThis, cmdList, nexusRecv, onRevertX, onRevertY) {
@@ -3351,26 +3419,26 @@ class StatePackBuilder {
3351
3419
  *
3352
3420
  * 发出进度同步信号(可以一个FreeMove绑定多个信号发生器,但目前场景估计只需要一个发生器即可)
3353
3421
  * 计算当前freeMove的postion和运动识别区域的比值
3354
- * xPercent = (xPos - left) / (right - left)
3355
- * yPercent = (yPos - top) / (bottom - top)
3422
+ * xPercent = (xPos - horizontalStart) / (horizontalEnd - horizontalStart)
3423
+ * yPercent = (yPos - verticalStart) / (verticalEnd - verticalStart)
3356
3424
  * x和y可以为负数,也可能>100%
3357
3425
  *
3358
3426
  * 当多次调用时,nexusRef相同时,则为更新运动识别区域,nexusRef不同时则为新建信号发起器
3359
3427
  *
3360
3428
  * @param {NexusNode} nexusRef 绑定的nexus句柄,接受者用这个句柄来进行监听
3361
- * @param {int} left 运动识别区域的left, 可以为负
3362
- * @param {int} top 运动识别区域的top, 可以为负
3363
- * @param {int} right 运动识别区域的right, 可以为负,必须大于left
3364
- * @param {int} bottom 运动识别区域的bottom, 可以为负,必须大于bottom
3429
+ * @param {int} horizontalStart 横向运动识别区域的0%对应位置, 可以为负
3430
+ * @param {int} horizontalEnd 横向运动识别区域的100%对应位置, 可以为负,可以小于start
3431
+ * @param {int} verticalStart 纵向运动识别区域的0%对应位置, 可以为负
3432
+ * @param {int} verticalEnd 纵向运动识别区域的100%对应位置, 可以为负,可以小于end
3365
3433
  * @param {int} xyEnable x,y是否都触发, 0b01对应x, 0b10对应y, 可以或运算在一起
3366
3434
  */
3367
- startMovementSync(nexusRef, left, top, right, bottom, xyEnable) {
3435
+ startMovementSync(nexusRef, horizontalStart, horizontalEnd, verticalStart, verticalEnd, xyEnable) {
3368
3436
  return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.StartMovementSync(
3369
3437
  nexusRef?.token ? nexusRef.token : 0,
3370
- left,
3371
- top,
3372
- right,
3373
- bottom,
3438
+ horizontalStart,
3439
+ horizontalEnd,
3440
+ verticalStart,
3441
+ verticalEnd,
3374
3442
  xyEnable
3375
3443
  ));
3376
3444
  }
@@ -3468,70 +3536,29 @@ function newNexus() {
3468
3536
  //
3469
3537
  // utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts;
3470
3538
  //
3471
- class ActorControl {
3472
- _BindView;
3473
- _BindAnim;
3474
- _Callbacks;
3475
- _SelfNexusRecv;
3476
- _SizeMode = false;
3539
+ class BuilderFactory {
3477
3540
  _SharedQuickConditionPackBuilder;
3478
3541
  _SharedQuickActionPackBuilder;
3479
3542
  _StatePackBuilder;
3480
- constructor() {
3481
- this._BindView = null;
3482
- this._BindAnim = null;
3483
- this._Callbacks = new CallbackManager();
3484
- this._SelfNexusRecv = newNexus();
3485
- this._SharedQuickConditionPackBuilder = new ConditionPackBuilder(this._Callbacks, this._SelfNexusRecv);
3543
+ _Callbacks;
3544
+ _SelfNexusRecv;
3545
+ _OwnerControl;
3546
+ constructor(owner, callbackManager, selfNexusRecv) {
3547
+ this._OwnerControl = owner;
3548
+ this._Callbacks = callbackManager;
3549
+ this._SelfNexusRecv = selfNexusRecv;
3550
+ this._SharedQuickConditionPackBuilder = new ConditionPackBuilder(this._Callbacks, this._SelfNexusRecv, this);
3486
3551
  this._SharedQuickActionPackBuilder = new ActorPackBuilder(this._Callbacks, this._SelfNexusRecv);
3487
3552
  this._StatePackBuilder = new StatePackBuilder();
3488
3553
  }
3489
- asSizeMode() {
3490
- if (this._BindAnim != null) {
3491
- console.error("error: asSizeMode should call before bindForgeView");
3492
- } else {
3493
- this._SizeMode = true;
3494
- }
3495
- }
3496
- // debugGetAnimId() {
3497
- // return this._BindAnim?.AnimNativeId;
3498
- // }
3499
- bindForgeView(bindView, instantActive) {
3500
- this._BindView = bindView;
3501
- if (instantActive) {
3502
- this._EnsureAnim();
3503
- }
3504
- }
3505
- /**
3506
- * run 执行编排好的intent集合
3507
- *
3508
- * @param {Array} cmdPackList 内容来自 Condition(), State(), Action() 这些工厂类创建的Command pack
3509
- */
3510
- run(cmdPackList) {
3511
- if (window.JsView) {
3512
- this._WrappedRun(cmdPackList);
3513
- } else {
3514
- let that = this;
3515
- this._BindView.RegisterOnProxyReady(() => {
3516
- that._WrappedRun(cmdPackList);
3517
- });
3518
- }
3519
- }
3520
- _WrappedRun(cmdPackList) {
3521
- this._EnsureAnim();
3522
- if (!(cmdPackList instanceof Array)) {
3523
- console.error("params error");
3524
- return;
3525
- }
3526
- RunFreeMoveCmdPacks(this._BindView, cmdPackList);
3527
- }
3528
3554
  /**
3529
3555
  * Condition
3530
3556
  * 获取创建 ConditionPack 的工厂对象
3531
3557
  * ConditionPack对应支持 .then(cmdPackList), 可传入同 Run 的处理队列
3532
3558
  * 可用方法见 ./SetCondition.js
3533
3559
  * @param {int} group 可选参数,默认为0, 有效值为0~3, 对应默认组, 1组, 2组, 3组, 便于remove时,按组进行清理
3534
- * @param {boolean} multiTimes 可选参数,默认为false, 是否要多次执行, 若为单次,则执行后condition作废
3560
+ * @param {boolean} multiTimes 可选参数,默认为false, 是否要多次执行,
3561
+ * 若为单次, 当group未设定时自动作废,当group设定时,不作废但改为deactive状态
3535
3562
  * @param {string} specName 可选参数,默认null, 命名condition, 用于指定名字进行active/deactive动作的场景
3536
3563
  * @param {boolean} shoudRenderBreak 可选参数,默认false, 关联的回调是否会发起RenderBreak
3537
3564
  * @return {ConditionPackBuilder} ConditionPack 的工厂对象
@@ -3539,7 +3566,7 @@ class ActorControl {
3539
3566
  condition(group = 0, multiTimes = false, specName = null, shoudRenderBreak = false) {
3540
3567
  let builder = this._SharedQuickConditionPackBuilder;
3541
3568
  if (builder.isInUsing()) {
3542
- builder = new ConditionPackBuilder(this._Callbacks, this._SelfNexusRecv);
3569
+ builder = new ConditionPackBuilder(this._Callbacks, this._SelfNexusRecv, this);
3543
3570
  }
3544
3571
  builder.updateCommandInfo(group, multiTimes, specName, shoudRenderBreak);
3545
3572
  return builder;
@@ -3577,6 +3604,68 @@ class ActorControl {
3577
3604
  state() {
3578
3605
  return this._StatePackBuilder;
3579
3606
  }
3607
+ }
3608
+ class ActorControl {
3609
+ _BindView;
3610
+ _BindAnim;
3611
+ _Callbacks;
3612
+ _SelfNexusRecv;
3613
+ _SizeMode = false;
3614
+ _CondCycleStartList = void 0;
3615
+ _CondCycleEndList = void 0;
3616
+ _Builders;
3617
+ constructor() {
3618
+ this._BindView = null;
3619
+ this._BindAnim = null;
3620
+ this._Callbacks = new CallbackManager();
3621
+ this._SelfNexusRecv = newNexus();
3622
+ this._Builders = new BuilderFactory(this, this._Callbacks, this._SelfNexusRecv);
3623
+ }
3624
+ asSizeMode() {
3625
+ if (this._BindAnim != null) {
3626
+ console.error("error: asSizeMode should call before bindForgeView");
3627
+ } else {
3628
+ this._SizeMode = true;
3629
+ }
3630
+ }
3631
+ // debugGetAnimId() {
3632
+ // return this._BindAnim?.AnimNativeId;
3633
+ // }
3634
+ bindForgeView(bindView, instantActive) {
3635
+ this._BindView = bindView;
3636
+ if (instantActive) {
3637
+ this._EnsureAnim();
3638
+ }
3639
+ }
3640
+ /**
3641
+ * run 执行编排好的intent集合
3642
+ *
3643
+ * @param {CmdListCreator} commandsCreator
3644
+ * 命令指令队列创建回调
3645
+ * 此回调返回值为一个数组,数组内容内容来自 Condition(), State(), Action()
3646
+ * 这些工厂类创建的Command pack
3647
+ */
3648
+ run(commandsCreator) {
3649
+ if (commandsCreator) {
3650
+ let cmdPackList = commandsCreator(this._Builders);
3651
+ if (window.JsView) {
3652
+ this._WrappedRun(cmdPackList);
3653
+ } else {
3654
+ let that = this;
3655
+ this._BindView.RegisterOnProxyReady(() => {
3656
+ that._WrappedRun(cmdPackList);
3657
+ });
3658
+ }
3659
+ }
3660
+ }
3661
+ _WrappedRun(cmdPackList) {
3662
+ this._EnsureAnim();
3663
+ if (!(cmdPackList instanceof Array)) {
3664
+ console.error("params error");
3665
+ return;
3666
+ }
3667
+ RunFreeMoveCmdPacks(this._BindView, cmdPackList);
3668
+ }
3580
3669
  getBindedAnim() {
3581
3670
  this._EnsureAnim();
3582
3671
  return this._BindAnim;
@@ -3585,10 +3674,54 @@ class ActorControl {
3585
3674
  this._EnsureAnim();
3586
3675
  return this._BindView;
3587
3676
  }
3677
+ /**
3678
+ * addCondCycleListener
3679
+ * 追加 cond cycle listener,可以根据start和end来进行callback时序排序
3680
+ *
3681
+ * @param {Function} startCycleCallback 开始执行一帧的js回调(condition的callback)
3682
+ * @param {Function} endCycleCallback 执行一帧的js回调完毕
3683
+ */
3684
+ addCondCycleListener(startCycleCallback, endCycleCallback) {
3685
+ if (startCycleCallback) {
3686
+ if (!this._CondCycleStartList) {
3687
+ this._CondCycleStartList = new Array();
3688
+ }
3689
+ this._CondCycleStartList.push(startCycleCallback);
3690
+ }
3691
+ if (endCycleCallback) {
3692
+ if (!this._CondCycleEndList) {
3693
+ this._CondCycleEndList = new Array();
3694
+ }
3695
+ this._CondCycleEndList.push(endCycleCallback);
3696
+ }
3697
+ }
3698
+ removeCondCycleListener(startCycleCallback, endCycleCallback) {
3699
+ if (startCycleCallback && this._CondCycleStartList) {
3700
+ for (let i = 0; i < this._CondCycleStartList.length; i++) {
3701
+ if (this._CondCycleStartList[i] == startCycleCallback) {
3702
+ this._CondCycleStartList.splice(i, 1);
3703
+ break;
3704
+ }
3705
+ }
3706
+ }
3707
+ if (endCycleCallback && this._CondCycleEndList) {
3708
+ for (let i = 0; i < this._CondCycleEndList.length; i++) {
3709
+ if (this._CondCycleEndList[i] == endCycleCallback) {
3710
+ this._CondCycleEndList.splice(i, 1);
3711
+ break;
3712
+ }
3713
+ }
3714
+ }
3715
+ }
3588
3716
  _OnEchoEvent(retJson) {
3589
3717
  let retJsonObject = JSON.parse(retJson);
3590
3718
  let echoRetList = retJsonObject["retList"];
3591
3719
  if (echoRetList) {
3720
+ if (this._CondCycleStartList && this._CondCycleStartList.length > 0) {
3721
+ for (let startCb of this._CondCycleStartList) {
3722
+ startCb();
3723
+ }
3724
+ }
3592
3725
  for (let echoRet of echoRetList) {
3593
3726
  let renderBreakId = echoRet["rbTkn"];
3594
3727
  if (renderBreakId != 0) {
@@ -3596,6 +3729,11 @@ class ActorControl {
3596
3729
  }
3597
3730
  this._Callbacks.invokeCallback(echoRet["eTkn"], retJsonObject, echoRet["cds"], echoRet["ncds"]);
3598
3731
  }
3732
+ if (this._CondCycleEndList && this._CondCycleEndList.length > 0) {
3733
+ for (let endCb of this._CondCycleEndList) {
3734
+ endCb();
3735
+ }
3736
+ }
3599
3737
  }
3600
3738
  }
3601
3739
  _EnsureAnim() {
@@ -3771,12 +3909,20 @@ class TaskManager {
3771
3909
  this.cancellableRunnerList.push(cancellableRunner);
3772
3910
  cancellableRunner.run();
3773
3911
  }
3912
+ cancelAllTask() {
3913
+ this.cleanTaskCache();
3914
+ this.cancellableRunnerList.forEach((t) => {
3915
+ t.cancel();
3916
+ });
3917
+ this.cancellableRunnerList = [];
3918
+ }
3774
3919
  }
3775
3920
 
3776
3921
  //
3777
3922
  // utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js;
3778
3923
  //
3779
3924
  const TAG$3 = "MetroWidget";
3925
+ let metroWidgetTokenGen = 1;
3780
3926
  const _getMetroTemplate = function(widgetRectInfo, direction, support_history_path, layout_type, mode) {
3781
3927
  let page_size;
3782
3928
  let line_max;
@@ -3844,25 +3990,37 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
3844
3990
  const mode = {
3845
3991
  _mode: FOCUS_MODE,
3846
3992
  _touchState: TouchState.IDLE,
3993
+ _touchCount: 0,
3994
+ // 触控流流程ID,解决fling等事件晚于新的touchDown时引起的混乱问题
3847
3995
  _duringTouch: false,
3848
3996
  _duringFling: false,
3849
- touchStart() {
3997
+ touchStart(touchCount) {
3850
3998
  this._mode = TOUCH_MODE;
3851
3999
  modeForExport.value = TOUCH_MODE;
3852
4000
  this._touchState = TouchState.TAP;
4001
+ this._touchCount = touchCount;
3853
4002
  },
3854
- touchEnd() {
3855
- this._touchState = TouchState.IDLE;
4003
+ touchEnd(touchCount) {
4004
+ if (touchCount == this._touchCount) {
4005
+ this._touchState = TouchState.IDLE;
4006
+ }
3856
4007
  },
3857
- flingStart() {
3858
- this._touchState = TouchState.FLING;
4008
+ flingStart(touchCount) {
4009
+ if (touchCount == this._touchCount) {
4010
+ this._touchState = TouchState.FLING;
4011
+ }
3859
4012
  },
3860
- flingEnd() {
4013
+ flingEnd(touchCount) {
4014
+ if (touchCount == this._touchCount) {
4015
+ this._touchState = TouchState.IDLE;
4016
+ }
3861
4017
  },
3862
- dragStart() {
3863
- this._touchState = TouchState.DRAG;
4018
+ dragStart(touchCount) {
4019
+ if (touchCount == this._touchCount) {
4020
+ this._touchState = TouchState.DRAG;
4021
+ }
3864
4022
  },
3865
- dragEnd() {
4023
+ dragEnd(touchCount) {
3866
4024
  },
3867
4025
  keyDown() {
3868
4026
  this._mode = FOCUS_MODE;
@@ -3903,6 +4061,8 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
3903
4061
  let alreadyCallItemFocus = false;
3904
4062
  let innerSlideSetting = props.slideSetting;
3905
4063
  const currentFocusIndex = ref(0);
4064
+ let freeMoveSlideGapTop = 0;
4065
+ let freeMoveSlideGapLeft = 0;
3906
4066
  const DEFAULT_ANIMATION_DURATION = 200;
3907
4067
  const isItemVisible = (item) => {
3908
4068
  let pos_key = vertical ? "top" : "left";
@@ -3916,6 +4076,9 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
3916
4076
  return null;
3917
4077
  };
3918
4078
  const onAddTask = (allTask) => {
4079
+ if (!innerData || innerData.length <= 0) {
4080
+ return;
4081
+ }
3919
4082
  let resizeTaskMap = {};
3920
4083
  let minIndex = Infinity;
3921
4084
  let mergeTmp = false;
@@ -4026,8 +4189,10 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
4026
4189
  if (!validSlideTask && resizeList.length > 0) {
4027
4190
  if (anchorInfo) {
4028
4191
  const focusItem = getItemById(focusId);
4029
- const start = focusItem.templateInfo[pos_key] + focusItem.templateInfo[size_key] * anchorInfo.anchor - 1 - anchorInfo.anchorPosition;
4030
- targetVisibleStart = normalizeVisibleStart(start, focusItem.templateInfo, focusItem.templateInfo.index);
4192
+ let start = focusItem.templateInfo[pos_key] + focusItem.templateInfo[size_key] * anchorInfo.anchor - 1 - anchorInfo.anchorPosition;
4193
+ let totalSize = metroTemplate.getBoundingBoxSize();
4194
+ start = Math.min(Math.max(0, start), totalSize[size_key] - visibleInfo.range);
4195
+ targetVisibleStart = normalizeVisibleStart(start, focusItem.templateInfo, focusItem.templateInfo.index, visibleInfo);
4031
4196
  } else {
4032
4197
  targetRect = getItemById(focusId).templateInfo;
4033
4198
  }
@@ -4039,8 +4204,9 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
4039
4204
  if (resizeList.length > 0) {
4040
4205
  preInfo = mRectCache.getPreRect();
4041
4206
  if (preInfo) {
4042
- v.start = targetRect.left - preInfo.left + v.start;
4043
- preInfo.left += v.start - visibleInfo.start;
4207
+ let totalSize = metroTemplate.getBoundingBoxSize();
4208
+ v.start = Math.min(Math.max(0, targetRect[pos_key] - preInfo[pos_key] + v.start), totalSize[size_key] - v.range);
4209
+ preInfo[pos_key] += v.start - visibleInfo.start;
4044
4210
  }
4045
4211
  }
4046
4212
  targetVisibleStart = _calculateVisibleStart(targetRect, direction, targetRect, v, preInfo);
@@ -4318,7 +4484,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
4318
4484
  return false;
4319
4485
  };
4320
4486
  const setFocusByUid = (uid, needSlide = true, doAnim = false, extraSetting) => {
4321
- if (!uid) {
4487
+ if (!uid || innerData.length <= 0) {
4322
4488
  return;
4323
4489
  }
4324
4490
  templateItemAdder.tryAddItemByUid(uid);
@@ -4330,7 +4496,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
4330
4496
  setFocusId(item.id, needSlide, doAnim, extraSetting);
4331
4497
  };
4332
4498
  const setFocusId = (id, needSlide = true, doAnim = false, extraSetting) => {
4333
- if (id == focusId) {
4499
+ if (id == focusId || innerData.length <= 0) {
4334
4500
  return;
4335
4501
  }
4336
4502
  tryCancelDelayLoad();
@@ -4479,88 +4645,125 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
4479
4645
  );
4480
4646
  }
4481
4647
  };
4482
- const refreshData = (force_update) => {
4648
+ const DATA_ID_KEY = "jsvKey";
4649
+ const refreshData = (forceUpdate) => {
4483
4650
  if (!props.provideData) {
4484
4651
  console.error("refreshData: provideData is null.");
4485
4652
  return;
4486
4653
  }
4487
- let _force_update = force_update;
4488
- if (metroTemplate.size === 0) {
4489
- _force_update = true;
4490
- }
4491
- let new_list = toRaw(props.provideData());
4492
- if (focusId >= new_list.length) {
4493
- _changeFocusId(new_list.length - 1, false);
4494
- }
4495
- let new_index = 0;
4496
- if (!_force_update) {
4497
- for (new_index = 0; new_index < new_list.length; ++new_index) {
4498
- let already_add = false;
4499
- for (let j = 0; j < innerData.length; ++j) {
4500
- if (new_list[new_index] === innerData[j].customerData) {
4501
- already_add = true;
4502
- break;
4654
+ try {
4655
+ let newData = toRaw(props.provideData());
4656
+ if (newData instanceof Array) {
4657
+ let maxSameIndex = -1;
4658
+ let layoutChange = false;
4659
+ let onlyDataChangeList = [];
4660
+ if (focusId >= newData.length) {
4661
+ _changeFocusId(newData.length - 1, false);
4662
+ }
4663
+ if (!forceUpdate) {
4664
+ for (let i = 0; i < dataList.length; ++i) {
4665
+ let oldItem = dataList[i];
4666
+ let newItem = newData[i];
4667
+ if (newItem) {
4668
+ if (newItem === oldItem || typeof newItem[DATA_ID_KEY] !== "undefined" && typeof oldItem[DATA_ID_KEY] !== "undefined" && newItem[DATA_ID_KEY] === oldItem[DATA_ID_KEY]) {
4669
+ maxSameIndex = Math.max(maxSameIndex, i);
4670
+ } else {
4671
+ const newMeasureItem = props.measures(newItem);
4672
+ const oldMeasureItem = props.measures(oldItem);
4673
+ if (props.layoutType == "relative") {
4674
+ layoutChange = newMeasureItem.width !== oldMeasureItem.width || newMeasureItem.height !== oldMeasureItem.height;
4675
+ } else {
4676
+ layoutChange = newMeasureItem.width !== oldMeasureItem.width || newMeasureItem.height !== oldMeasureItem.height || newMeasureItem.left !== oldMeasureItem.left || newMeasureItem.top !== oldMeasureItem.top;
4677
+ }
4678
+ if (layoutChange) {
4679
+ break;
4680
+ } else {
4681
+ if (i < innerData.length) {
4682
+ onlyDataChangeList.push({
4683
+ templateInfo: innerData[i].templateInfo,
4684
+ measureObj: newMeasureItem,
4685
+ data: newItem,
4686
+ index: i
4687
+ });
4688
+ }
4689
+ }
4690
+ }
4691
+ } else {
4692
+ if (i >= newData.length) {
4693
+ layoutChange = true;
4694
+ break;
4695
+ } else {
4696
+ throw new Error("undefined item in data list.", i, newData);
4697
+ }
4698
+ }
4503
4699
  }
4504
4700
  }
4505
- if (!already_add) {
4506
- break;
4701
+ dataList = newData.concat();
4702
+ if (forceUpdate || layoutChange) {
4703
+ pageUpdateToken.value++;
4704
+ permanentItemList = [];
4705
+ metroTemplate = _getMetroTemplate(
4706
+ widgetRectInfo,
4707
+ props.direction,
4708
+ props.supportHistoryPath,
4709
+ props.layoutType,
4710
+ templateMode
4711
+ );
4712
+ innerData = [];
4713
+ templateItemAdder = new TemplateItemAdder(
4714
+ metroTemplate,
4715
+ dataList,
4716
+ props.measures,
4717
+ pageRange,
4718
+ _onTemplateItemAdd,
4719
+ props.name,
4720
+ _onTemplateAddDone
4721
+ );
4722
+ if (props.onScroll) {
4723
+ templateItemAdder.tryAddItemByIndex(dataList.length - 1);
4724
+ } else {
4725
+ templateItemAdder.tryAddItemById(focusId);
4726
+ }
4727
+ } else {
4728
+ if (maxSameIndex < newData.length) {
4729
+ templateItemAdder.updateData(newData);
4730
+ if (props.onScroll) {
4731
+ templateItemAdder.tryAddItemByIndex(dataList.length - 1);
4732
+ } else {
4733
+ templateItemAdder.tryAddItemById(focusId);
4734
+ }
4735
+ }
4736
+ if (onlyDataChangeList.length > 0) {
4737
+ for (let i of onlyDataChangeList) {
4738
+ if (i.index < innerData.length) {
4739
+ innerData[i.index].updateCustomData(i.data, _getItemConfigFromMeasursObj(i.measureObj));
4740
+ } else {
4741
+ break;
4742
+ }
4743
+ }
4744
+ }
4507
4745
  }
4746
+ const updater = pageUpdater.update(
4747
+ metroTemplate,
4748
+ visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
4749
+ visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
4750
+ focusId,
4751
+ false,
4752
+ permanentItemList
4753
+ );
4754
+ updater.apply();
4755
+ onItemFocus(getItemById(focusId), null);
4756
+ let targetRect = mRectCache.getCurRect() ?? mRectCache.getPreRect();
4757
+ if (targetRect) {
4758
+ slideToRect(targetRect, false);
4759
+ } else {
4760
+ slideToItem(id2Index(focusId), false);
4761
+ }
4762
+ updateTouchBoxCondition();
4508
4763
  }
4764
+ } catch (e) {
4765
+ console.log(TAG$3, "refresh error", e);
4509
4766
  }
4510
- let need_update_content = false;
4511
- if (!_force_update && new_index === metroTemplate.size) {
4512
- if (new_index !== new_list.length) {
4513
- need_update_content = true;
4514
- templateItemAdder.updateData(new_list);
4515
- } else {
4516
- }
4517
- } else {
4518
- pageUpdateToken.value++;
4519
- permanentItemList = [];
4520
- need_update_content = true;
4521
- metroTemplate = _getMetroTemplate(
4522
- widgetRectInfo,
4523
- props.direction,
4524
- props.supportHistoryPath,
4525
- props.layoutType,
4526
- templateMode
4527
- );
4528
- innerData = [];
4529
- dataList = new_list;
4530
- templateItemAdder = new TemplateItemAdder(
4531
- metroTemplate,
4532
- dataList,
4533
- props.measures,
4534
- pageRange,
4535
- _onTemplateItemAdd,
4536
- props.name,
4537
- _onTemplateAddDone
4538
- );
4539
- }
4540
- if (need_update_content) {
4541
- if (props.onScroll) {
4542
- templateItemAdder.tryAddItemByIndex(dataList.length - 1);
4543
- } else {
4544
- templateItemAdder.tryAddItemById(focusId);
4545
- }
4546
- }
4547
- const updater = pageUpdater.update(
4548
- metroTemplate,
4549
- visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
4550
- visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
4551
- focusId,
4552
- false,
4553
- permanentItemList
4554
- );
4555
- updater.apply();
4556
- onItemFocus(getItemById(focusId), null);
4557
- let targetRect = mRectCache.getCurRect() ?? mRectCache.getPreRect();
4558
- if (targetRect) {
4559
- slideToRect(targetRect, false);
4560
- } else {
4561
- slideToItem(id2Index(focusId), false);
4562
- }
4563
- updateTouchBoxCondition();
4564
4767
  };
4565
4768
  const getVisibleItems = () => {
4566
4769
  const [visibleStart, visibleEnd] = metroTemplate.getVisibleItemList(
@@ -4575,6 +4778,9 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
4575
4778
  };
4576
4779
  };
4577
4780
  const moveFocus = (direction) => {
4781
+ if (innerData.length <= 0) {
4782
+ return;
4783
+ }
4578
4784
  tryCancelDelayLoad();
4579
4785
  if (direction == "left" || direction == 37 || direction == EdgeDirection.left) {
4580
4786
  _moveToNext(-1, 0);
@@ -4836,7 +5042,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
4836
5042
  }
4837
5043
  }
4838
5044
  };
4839
- const _onTemplateItemAdd = (customerData, templateItem, measuresObj) => {
5045
+ const _getItemConfigFromMeasursObj = (measuresObj) => {
4840
5046
  let focusZIndex = -1, normalZIndex = -1;
4841
5047
  if (typeof measuresObj["zIndex"] != "undefined" && measuresObj["zIndex"] != null) {
4842
5048
  if (typeof measuresObj["zIndex"] == "object") {
@@ -4851,12 +5057,16 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
4851
5057
  normalZIndex = measuresObj["zIndex"];
4852
5058
  }
4853
5059
  }
4854
- let itemConfig = {
5060
+ return {
4855
5061
  focusZIndex,
4856
5062
  normalZIndex,
4857
5063
  permanent: measuresObj.permanent ?? false,
4858
- itemSlide: measuresObj.itemSlide ?? METRO_WIDGET.ITEM_SLIDE.ACT_ITEM_FOCUS
5064
+ itemSlide: measuresObj.itemSlide ?? METRO_WIDGET.ITEM_SLIDE.ACT_ITEM_FOCUS,
5065
+ showSkeleton: measuresObj.showSkeleton ?? true
4859
5066
  };
5067
+ };
5068
+ const _onTemplateItemAdd = (customerData, templateItem, measuresObj) => {
5069
+ let itemConfig = _getItemConfigFromMeasursObj(measuresObj);
4860
5070
  const renderStyle = reactive({
4861
5071
  left: templateItem.left,
4862
5072
  top: templateItem.top,
@@ -5101,40 +5311,41 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5101
5311
  });
5102
5312
  }
5103
5313
  };
5104
- const normalizeVisibleStart = (origin, targetRect = void 0, index = void 0) => {
5314
+ const normalizeVisibleStart = (origin, targetRect, index, _visibleInfo) => {
5105
5315
  let pos_key = vertical ? "top" : "left";
5106
5316
  let size_key = vertical ? "height" : "width";
5107
5317
  let visibleStart = origin;
5318
+ let vInfo = _visibleInfo;
5108
5319
  if ((innerSlideSetting.BoundaryProtect & SlideSetting.START_PROTECT) > 0) {
5109
- if (visibleInfo.start >= 0) {
5320
+ if (vInfo.start >= 0) {
5110
5321
  let boundary = 0;
5111
5322
  const headTemplateInfo = getItemByIndex(0).templateInfo;
5112
- if (targetRect && (!headTemplateInfo.focusable || index == headTemplateInfo.index) && targetRect[pos_key] + targetRect[size_key] <= visibleInfo.range) {
5323
+ if (targetRect && (!headTemplateInfo.focusable || index == headTemplateInfo.index) && targetRect[pos_key] + targetRect[size_key] <= vInfo.range) {
5113
5324
  boundary = headTemplateInfo[size_key];
5114
5325
  }
5115
5326
  visibleStart = visibleStart < boundary ? 0 : visibleStart;
5116
5327
  } else {
5117
- visibleStart = visibleStart < visibleInfo.start ? visibleInfo.start : visibleStart;
5328
+ visibleStart = visibleStart < vInfo.start ? vInfo.start : visibleStart;
5118
5329
  }
5119
5330
  }
5120
5331
  if ((innerSlideSetting.BoundaryProtect & SlideSetting.END_PROTECT) > 0) {
5121
5332
  let lastTemplateInfo = getItemByIndex(metroTemplate.getTailItemIndex()).templateInfo;
5122
5333
  const lastEnd = lastTemplateInfo[pos_key] + lastTemplateInfo[size_key];
5123
- const lastVisibleStart = Math.max(lastEnd - visibleInfo.range, 0);
5124
- if (visibleInfo.end <= lastEnd) {
5334
+ const lastVisibleStart = Math.max(lastEnd - vInfo.range, 0);
5335
+ if (vInfo.end <= lastEnd) {
5125
5336
  let boundary = lastVisibleStart;
5126
5337
  if (targetRect && (!lastTemplateInfo.focusable || index == lastTemplateInfo.index) && targetRect[pos_key] - lastVisibleStart >= 0) {
5127
- boundary = lastTemplateInfo[pos_key] - visibleInfo.range;
5338
+ boundary = lastTemplateInfo[pos_key] - vInfo.range;
5128
5339
  }
5129
5340
  visibleStart = visibleStart > boundary ? lastVisibleStart : visibleStart;
5130
5341
  } else {
5131
- visibleStart = visibleStart > visibleInfo.start ? visibleInfo.start : visibleStart;
5342
+ visibleStart = visibleStart > vInfo.start ? vInfo.start : visibleStart;
5132
5343
  }
5133
5344
  }
5134
5345
  return visibleStart;
5135
5346
  };
5136
5347
  const mRectCache = new RectCache();
5137
- const _calculateVisibleStart = (targetRect, _direction, templateInfo, visibleInfo2, preInfo = null) => {
5348
+ const _calculateVisibleStart = (targetRect, _direction, templateInfo, vInfo, preInfo = null) => {
5138
5349
  if (!targetRect) {
5139
5350
  console.error("MetroWidget: _calculateVisibleStart target item is null");
5140
5351
  return 0;
@@ -5159,19 +5370,19 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5159
5370
  let pos_key = vertical ? "top" : "left";
5160
5371
  let size_key = vertical ? "height" : "width";
5161
5372
  let center_key = vertical ? "centerYPos" : "centerXPos";
5162
- let new_visible_start = visibleInfo2.start;
5373
+ let new_visible_start = vInfo.start;
5163
5374
  let needCalculate = true;
5164
5375
  switch (innerSlideSetting.Type) {
5165
5376
  case SlideSetting.Type.FIX_POSITION:
5166
5377
  if (innerSlideSetting.FixFirstPage) {
5167
- if (targetRect[pos_key] + targetRect[size_key] - 1 < visibleInfo2.range) {
5378
+ if (targetRect[pos_key] + targetRect[size_key] - 1 < vInfo.range) {
5168
5379
  new_visible_start = 0;
5169
5380
  needCalculate = false;
5170
5381
  }
5171
5382
  }
5172
5383
  if (needCalculate) {
5173
5384
  new_visible_start = Math.ceil(
5174
- targetRect[pos_key] + targetRect[size_key] / 2 - visibleInfo2.range * innerSlideSetting.FixPercent
5385
+ targetRect[pos_key] + targetRect[size_key] / 2 - vInfo.range * innerSlideSetting.FixPercent
5175
5386
  );
5176
5387
  }
5177
5388
  break;
@@ -5186,7 +5397,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5186
5397
  break;
5187
5398
  case SlideSetting.Type.SEAMLESS:
5188
5399
  if (innerSlideSetting.FixFirstPage) {
5189
- if (targetRect[pos_key] + targetRect[size_key] - 1 < visibleInfo2.range) {
5400
+ if (targetRect[pos_key] + targetRect[size_key] - 1 < vInfo.range) {
5190
5401
  new_visible_start = 0;
5191
5402
  needCalculate = false;
5192
5403
  }
@@ -5196,11 +5407,11 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5196
5407
  const itemEnd = targetRect[pos_key] + targetRect[size_key] - 1;
5197
5408
  const itemMainSize = targetRect[size_key];
5198
5409
  if (preRect) {
5199
- const rect0Start = visibleInfo2.start;
5200
- const rect0End = visibleInfo2.start + visibleInfo2.range * innerSlideSetting.StartPercent;
5410
+ const rect0Start = vInfo.start;
5411
+ const rect0End = vInfo.start + vInfo.range * innerSlideSetting.StartPercent;
5201
5412
  const rect0Range = rect0End - rect0Start + 1;
5202
- const rect1Start = visibleInfo2.start + visibleInfo2.range * innerSlideSetting.EndPercent;
5203
- const rect1End = visibleInfo2.start + visibleInfo2.range - 1;
5413
+ const rect1Start = vInfo.start + vInfo.range * innerSlideSetting.EndPercent;
5414
+ const rect1End = vInfo.start + vInfo.range - 1;
5204
5415
  const rect1Range = rect1End - rect1Start + 1;
5205
5416
  let target0 = Math.min(preRect[pos_key], rect0End);
5206
5417
  let target1 = Math.max(preRect[pos_key] + preRect[size_key] - 1, rect1Start);
@@ -5210,7 +5421,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5210
5421
  if (target0 < rect0Start) {
5211
5422
  } else {
5212
5423
  if (direction <= 0) {
5213
- rect0Result = visibleInfo2.start + (itemStart - target0);
5424
+ rect0Result = vInfo.start + (itemStart - target0);
5214
5425
  }
5215
5426
  }
5216
5427
  }
@@ -5218,7 +5429,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5218
5429
  if (target1 > rect1End) {
5219
5430
  } else {
5220
5431
  if (direction >= 0) {
5221
- rect1Result = visibleInfo2.start + (itemEnd - target1);
5432
+ rect1Result = vInfo.start + (itemEnd - target1);
5222
5433
  }
5223
5434
  }
5224
5435
  }
@@ -5230,15 +5441,15 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5230
5441
  new_visible_start = rect1Result;
5231
5442
  }
5232
5443
  }
5233
- const headSafeArea = innerSlideSetting.HeadSafeArea * visibleInfo2.range;
5234
- const tailSafeArea = innerSlideSetting.TailSafeArea * visibleInfo2.range;
5235
- if (itemMainSize > visibleInfo2.range - headSafeArea - tailSafeArea) {
5236
- new_visible_start = Math.round(itemStart - (visibleInfo2.range - itemMainSize) / 2);
5444
+ const headSafeArea = innerSlideSetting.HeadSafeArea * vInfo.range;
5445
+ const tailSafeArea = innerSlideSetting.TailSafeArea * vInfo.range;
5446
+ if (itemMainSize > vInfo.range - headSafeArea - tailSafeArea) {
5447
+ new_visible_start = Math.round(itemStart - (vInfo.range - itemMainSize) / 2);
5237
5448
  } else {
5238
5449
  if (itemStart < new_visible_start + headSafeArea) {
5239
5450
  new_visible_start = itemStart - headSafeArea;
5240
- } else if (itemEnd > new_visible_start + visibleInfo2.range - 1 - tailSafeArea) {
5241
- new_visible_start = itemEnd - visibleInfo2.range + tailSafeArea;
5451
+ } else if (itemEnd > new_visible_start + vInfo.range - 1 - tailSafeArea) {
5452
+ new_visible_start = itemEnd - vInfo.range + tailSafeArea;
5242
5453
  }
5243
5454
  }
5244
5455
  }
@@ -5249,7 +5460,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5249
5460
  innerSlideSetting.Type
5250
5461
  );
5251
5462
  }
5252
- new_visible_start = normalizeVisibleStart(new_visible_start, targetRect, templateInfo?.index);
5463
+ new_visible_start = normalizeVisibleStart(new_visible_start, targetRect, templateInfo?.index, vInfo);
5253
5464
  return Math.round(new_visible_start);
5254
5465
  };
5255
5466
  const _onFocusableItemEdge = (edge_info) => {
@@ -5358,9 +5569,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5358
5569
  let divPos = -1;
5359
5570
  let frameCount = -1;
5360
5571
  const getVisibleStart = (moveInfo) => {
5361
- if (frameCount != Forge$2.sFrameCount.count) {
5362
- divPos = vertical ? slideDivTop.value : slideDivLeft.value;
5363
- }
5572
+ divPos = vertical ? slideDivTop.value + freeMoveSlideGapTop : slideDivLeft.value + freeMoveSlideGapLeft;
5364
5573
  if (vertical) {
5365
5574
  return -(divPos + Math.round(moveInfo.yPos));
5366
5575
  } else {
@@ -5379,23 +5588,30 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5379
5588
  return touchCount;
5380
5589
  };
5381
5590
  const mergeTouchSlideToSlideDiv = (touchCount) => {
5591
+ let originSlideDivTop = slideDivTop.value;
5592
+ let originSlideDivLeft = slideDivLeft.value;
5382
5593
  if (vertical) {
5383
5594
  slideDivTop.value = -visibleInfo.start;
5384
5595
  } else {
5385
5596
  slideDivLeft.value = -visibleInfo.start;
5386
5597
  }
5598
+ let newSlideGapTop = originSlideDivTop - slideDivTop.value;
5599
+ let newSlideGapLeft = originSlideDivLeft - slideDivLeft.value;
5600
+ freeMoveSlideGapTop += newSlideGapTop;
5601
+ freeMoveSlideGapLeft += newSlideGapLeft;
5387
5602
  const walls = getTouchWall();
5388
- actorController.run([
5389
- actorController.state().removeConditionByGroup(wallConditionGroup),
5390
- actorController.condition(wallConditionGroup, true).boxPosition(walls.left, walls.top, walls.right, walls.bottom).then([actorController.state().setHitWallOverflow()]),
5603
+ actorController.run((cmds) => [
5604
+ cmds.state().removeConditionByGroup(wallConditionGroup),
5605
+ cmds.condition(wallConditionGroup, true).boxPosition(walls.left, walls.top, walls.right, walls.bottom).then([cmds.state().setHitWallOverflow()]),
5391
5606
  //TODO 通过prop设置哪个方向overflow
5392
- actorController.condition(touchCountGroup, false).touchCount(touchCount).then([
5393
- actorController.action().teleportTo(0, 0)
5394
- ])
5395
- ]);
5396
- actorController.run([
5397
- actorController.condition().onNextTick().then([
5398
- actorController.state().removeConditionByGroup(touchCountGroup)
5607
+ cmds.state().setStartOffsetPos(newSlideGapLeft, newSlideGapTop),
5608
+ // 将div的位置调整回馈给FreeMove计量系统
5609
+ cmds.condition().onNextTick(0).then([
5610
+ SliderEditFuncReOrderWrap(() => {
5611
+ freeMoveSlideGapTop -= newSlideGapTop;
5612
+ freeMoveSlideGapLeft -= newSlideGapLeft;
5613
+ }, true)
5614
+ // Slide调整回调要放在其他事件之前,调整slide的gap值
5399
5615
  ])
5400
5616
  ]);
5401
5617
  };
@@ -5406,18 +5622,23 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5406
5622
  if (mode.getMode() == FOCUS_MODE) {
5407
5623
  updateTouchBoxCondition();
5408
5624
  }
5409
- mode.touchStart();
5410
- mode.flingEnd();
5411
- const t = 100;
5625
+ mode.touchStart(touchCount);
5626
+ const lockThreshhold = 10;
5627
+ const unlockThreshold = 100;
5412
5628
  const offsetThreshold = {
5413
- left: vertical ? void 0 : t,
5414
- right: vertical ? void 0 : t,
5415
- top: vertical ? t : void 0,
5416
- bottom: vertical ? t : void 0
5629
+ left: vertical ? void 0 : lockThreshhold,
5630
+ right: vertical ? void 0 : lockThreshhold,
5631
+ top: vertical ? lockThreshhold : void 0,
5632
+ bottom: vertical ? lockThreshhold : void 0
5417
5633
  };
5418
- actorController.run([
5419
- actorController.condition(void 0, false).offsetPosition(offsetThreshold.left, offsetThreshold.top, offsetThreshold.right, offsetThreshold.bottom).then([actorController.state().touchLockSwitch(true, vertical ? 1 : 2, t)]),
5420
- actorController.condition(void 0, false).startMove(true, true).then([onDragStart])
5634
+ let passDownTouchInfo = nexusCustomData;
5635
+ actorController.run((cmds) => [
5636
+ cmds.condition(void 0, false).offsetPosition(offsetThreshold.left, offsetThreshold.top, offsetThreshold.right, offsetThreshold.bottom).then([
5637
+ cmds.state().touchLockSwitch(true, vertical ? 1 : 2, unlockThreshold)
5638
+ ]),
5639
+ cmds.condition(void 0, false).startMove(true, true).then([SliderEditFuncReOrderWrap((d) => {
5640
+ onDragStart(d, null, passDownTouchInfo);
5641
+ })])
5421
5642
  ]);
5422
5643
  onItemBlur(getItemById(focusId));
5423
5644
  templateItemAdder.tryAddItemByPosition(visibleInfo.end + visibleInfo.range);
@@ -5439,61 +5660,70 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5439
5660
  anchorPosList.push(-visibleInfo.start - visibleInfo.range - anchorPos + 1);
5440
5661
  anchorPos += anchorSpacing;
5441
5662
  }
5442
- const reachConditionList = anchorPosList.map((pos) => {
5443
- return actorController.condition(reachAnchorGroup).reachPosition(pos, void 0).then([(data2) => {
5444
- updateRenderItems(true, true);
5445
- }]);
5663
+ actorController.run((cmds) => {
5664
+ const reachConditionList = anchorPosList.map((pos) => {
5665
+ return cmds.condition(reachAnchorGroup).reachPosition(pos, void 0).then([SliderEditFuncReOrderWrap((data2) => {
5666
+ updateRenderItems(true, true);
5667
+ })]);
5668
+ });
5669
+ reachConditionList.unshift(
5670
+ cmds.state().removeConditionByGroup(reachAnchorGroup)
5671
+ );
5672
+ return reachConditionList;
5446
5673
  });
5447
- reachConditionList.unshift(
5448
- actorController.state().removeConditionByGroup(reachAnchorGroup)
5449
- );
5450
- actorController.run(reachConditionList);
5451
5674
  };
5452
- const onTouchRelease = () => {
5675
+ const onTouchRelease = (touchCount) => {
5453
5676
  if (mode.getTouchState() == TouchState.TAP) {
5454
5677
  updateRenderItems(false, false);
5455
- mode.touchEnd();
5678
+ mode.touchEnd(touchCount);
5456
5679
  } else {
5457
5680
  if (touchRecorder.moved && !mode.duringFling()) {
5458
5681
  mergeTouchSlideToSlideDiv(touchRecorder.touchCount);
5459
5682
  updateRenderItems(false, false);
5460
- mode.touchEnd();
5683
+ mode.touchEnd(touchCount);
5461
5684
  }
5462
5685
  }
5463
5686
  };
5464
5687
  const exportOnTouchRelease = props.touchFlag > 0 ? onTouchRelease : void 0;
5465
5688
  const onDragStart = (data, customData, nexusCustomData) => {
5689
+ let touchCount = getTouchCount(nexusCustomData);
5466
5690
  touchRecorder.move();
5467
- mode.dragStart();
5691
+ mode.dragStart(touchCount);
5468
5692
  visibleInfo.start = getVisibleStart(data);
5469
5693
  };
5470
5694
  const onDragEnd = (data, customData, nexusCustomData) => {
5695
+ let touchCount = getTouchCount(nexusCustomData);
5696
+ mode.dragEnd(touchCount);
5471
5697
  visibleInfo.start = getVisibleStart(data);
5472
- actorController.run([
5473
- actorController.state().removeConditionByGroup(reachAnchorGroup)
5698
+ actorController.run((cmds) => [
5699
+ cmds.state().removeConditionByGroup(reachAnchorGroup)
5474
5700
  ]);
5475
5701
  };
5476
5702
  const onFlingStart = (data, customData, nexusCustomData) => {
5703
+ let touchCount = getTouchCount(nexusCustomData);
5477
5704
  touchRecorder.move();
5478
- mode.flingStart();
5705
+ mode.flingStart(touchCount);
5479
5706
  visibleInfo.start = getVisibleStart(data);
5480
5707
  updateRenderItems(true, true);
5481
5708
  };
5482
5709
  const onFlingProgress = (data, customData, nexusCustomData) => {
5710
+ let touchCount = getTouchCount(nexusCustomData);
5483
5711
  visibleInfo.start = getVisibleStart(data);
5484
5712
  updateRenderItems(true, true);
5485
5713
  };
5486
5714
  const onFlingEnd = (data, customData, nexusCustomData) => {
5715
+ let touchCount = getTouchCount(nexusCustomData);
5487
5716
  visibleInfo.start = getVisibleStart(data);
5488
5717
  if (mode.duringFling()) {
5489
- let touchCount = getTouchCount(nexusCustomData);
5490
- mergeTouchSlideToSlideDiv(touchCount);
5718
+ let touchCount2 = getTouchCount(nexusCustomData);
5719
+ mergeTouchSlideToSlideDiv(touchCount2);
5491
5720
  updateRenderItems(false, false);
5492
- mode.flingEnd();
5493
- mode.touchEnd();
5721
+ mode.flingEnd(touchCount2);
5722
+ mode.touchEnd(touchCount2);
5494
5723
  }
5495
5724
  };
5496
5725
  const onFlingDrop = (data, customData, nexusCustomData) => {
5726
+ let touchCount = getTouchCount(nexusCustomData);
5497
5727
  visibleInfo.start = getVisibleStart(data);
5498
5728
  };
5499
5729
  const getTouchWall = () => {
@@ -5534,9 +5764,9 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5534
5764
  const updateTouchBoxCondition = () => {
5535
5765
  if (actorController != null) {
5536
5766
  const walls = getTouchWall();
5537
- actorController.run([
5538
- actorController.state().removeConditionByGroup(wallConditionGroup),
5539
- actorController.condition(wallConditionGroup, true).boxPosition(walls.left, walls.top, walls.right, walls.bottom).then([actorController.state().setHitWallOverflow()])
5767
+ actorController.run((cmds) => [
5768
+ cmds.state().removeConditionByGroup(wallConditionGroup),
5769
+ cmds.condition(wallConditionGroup, true).boxPosition(walls.left, walls.top, walls.right, walls.bottom).then([cmds.state().setHitWallOverflow()])
5540
5770
  //TODO 通过prop设置哪个方向overflow
5541
5771
  ]);
5542
5772
  }
@@ -5555,24 +5785,46 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5555
5785
  this.touchCount = count;
5556
5786
  }
5557
5787
  };
5788
+ const metroWidgetToken = metroWidgetTokenGen++;
5789
+ let orderTouchSlideCallbacks;
5790
+ const SliderEditFuncReOrderWrap = (callback, addHeader = false) => {
5791
+ return (...args) => {
5792
+ let pkg = { cb: callback, a: args };
5793
+ if (addHeader) {
5794
+ orderTouchSlideCallbacks.splice(0, 0, pkg);
5795
+ } else {
5796
+ orderTouchSlideCallbacks.push(pkg);
5797
+ }
5798
+ };
5799
+ };
5558
5800
  const initTouch = () => {
5559
5801
  actorController = new ActorControl();
5560
5802
  const divView = touchDiv.value.jsvGetProxyView();
5561
5803
  actorController.bindForgeView(divView, true);
5562
- divView.DragEnables?.(
5563
- ForgeConst.DragFlags.TOUCH_RECV_MOVE_BIT | ForgeConst.DragFlags.TOUCH_RECV_FLING_BIT | ForgeConst.DragFlags.TOUCH_RECV_FIRST_START | ForgeConst.DragFlags.TOUCH_RECV_LAST_END
5804
+ orderTouchSlideCallbacks = new Array();
5805
+ actorController.addCondCycleListener(
5806
+ // starter
5807
+ () => {
5808
+ },
5809
+ // finish
5810
+ () => {
5811
+ for (let pkg of orderTouchSlideCallbacks) {
5812
+ pkg.cb(...pkg.a);
5813
+ }
5814
+ orderTouchSlideCallbacks.length = 0;
5815
+ }
5564
5816
  );
5565
5817
  const walls = getTouchWall();
5566
- actorController.run([
5567
- actorController.condition(void 0, true).onTouchDown().then([onTouchDown]),
5568
- actorController.condition(void 0, true).onDragStart().then([onDragStart]),
5569
- actorController.condition(void 0, true).onDragEnd().then([onDragEnd]),
5570
- actorController.condition(void 0, true).onFlingStart().then([onFlingStart]),
5571
- actorController.condition(void 0, true).onFlingProgress().then([onFlingProgress]),
5572
- actorController.condition(void 0, true).onFlingEnd().then([onFlingEnd]),
5573
- actorController.condition(void 0, true).onFlingDrop().then([onFlingDrop]),
5574
- actorController.condition(void 0, true).onTouchRelease().then([actorController.state().touchLockSwitch(false, vertical ? 1 : 2)]),
5575
- actorController.condition(wallConditionGroup, true).boxPosition(walls.left, walls.top, walls.right, walls.bottom).then([actorController.state().setHitWallOverflow()])
5818
+ actorController.run((cmds) => [
5819
+ cmds.condition(void 0, true).onTouchDown().then([SliderEditFuncReOrderWrap(onTouchDown)]),
5820
+ cmds.condition(void 0, true).onDragStart().then([SliderEditFuncReOrderWrap(onDragStart)]),
5821
+ cmds.condition(void 0, true).onDragEnd().then([SliderEditFuncReOrderWrap(onDragEnd)]),
5822
+ cmds.condition(void 0, true).onFlingStart().then([SliderEditFuncReOrderWrap(onFlingStart)]),
5823
+ cmds.condition(void 0, true).onFlingProgress().then([SliderEditFuncReOrderWrap(onFlingProgress)]),
5824
+ cmds.condition(void 0, true).onFlingEnd().then([SliderEditFuncReOrderWrap(onFlingEnd)]),
5825
+ cmds.condition(void 0, true).onFlingDrop().then([SliderEditFuncReOrderWrap(onFlingDrop)]),
5826
+ cmds.condition(void 0, true).onTouchRelease().then([cmds.state().touchLockSwitch(false, vertical ? 1 : 2)]),
5827
+ cmds.condition(wallConditionGroup, true).boxPosition(walls.left, walls.top, walls.right, walls.bottom).then([cmds.state().setHitWallOverflow()])
5576
5828
  //TODO 通过prop设置哪个方向overflow
5577
5829
  ]);
5578
5830
  };
@@ -5657,6 +5909,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5657
5909
  onUpdated(() => {
5658
5910
  });
5659
5911
  onBeforeUnmount(() => {
5912
+ taskManager.cancelAllTask();
5660
5913
  tryCancelDelayLoad();
5661
5914
  mounted = false;
5662
5915
  });
@@ -5685,7 +5938,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
5685
5938
 
5686
5939
 
5687
5940
  */
5688
- const _sfc_main$I = {
5941
+ const _sfc_main$M = {
5689
5942
  __name: "SlotComponent",
5690
5943
  setup(__props) {
5691
5944
  onBeforeUpdate(() => {
@@ -5786,6 +6039,7 @@ const _sfc_main$I = {
5786
6039
  uid {string}: item的uid, 可以通过uid来设置焦点
5787
6040
  permanent {boolean}: 出去与是否保留
5788
6041
  enableTap {boolean}: 是否接受触控tap
6042
+ showSkeleton {boolean}: 打断描画时, 是否显示骨架图
5789
6043
  }
5790
6044
  *
5791
6045
  * onFocus {function} 控件获取焦点的回调
@@ -5860,7 +6114,21 @@ const _sfc_main$I = {
5860
6114
  lockChildSlideEvent: {boolean} 设置焦点时忽略子发过来的滚动事件
5861
6115
  }
5862
6116
  refreshData
5863
- @description 刷新数据, 只有存在provideData时才会生效. refresh时对比的array里的object, 所以可以建一个新的array, 只要保证数据成员还是之前的那个object就行
6117
+ @description 刷新数据, 只有存在provideData时才会生效
6118
+ 当refresh时,根据下面的数据对比规则找出变化的数据
6119
+ refresh时的对比逻辑:
6120
+ 1. 对比array里的object是否是同一个对象
6121
+ 2. 对比array里的jsvKey字段, 若一致则认为该数据未改变,即使object不相同
6122
+ 发现array中存在数据变化时,会如下的场景进行处理
6123
+ 场景1: array内部的数据变化了,无论末尾有没有增加: 变化的项目会重新触发measure,
6124
+ 若measure返回尺寸变化则调用所有项目measure重做布局
6125
+ 若measure返回尺寸未变化,则仅对变化项目的div进行key的调整来触发item的remount
6126
+ 场景2: array内部未变化,仅array末尾新增内容: 对末尾内容的项目做measure,布局进行追加处理,原布局内容保持(节省性能)
6127
+ 特别说明: jsvKey的使用方法提示
6128
+ 1. 用lastModify设置jsvKey,并将所有的item设置成同一个jsvKey,后续局部更新项目的jsvKey代表的lastModify
6129
+ 2. 后台运营对于素材是只新增不改动的策略时,用素材的id来命名jsvKey,array中间位置素材变化的时候,
6130
+ 更换jsvKey,以达到局部更新的目的,防止全体更新,从而提高响应的性能
6131
+
5864
6132
  @params {boolean} forceUpdate 是否强制刷新
5865
6133
  getVisibleItems
5866
6134
  @description 获取可视item的列表信息
@@ -5962,7 +6230,7 @@ const _sfc_main$I = {
5962
6230
 
5963
6231
 
5964
6232
  */
5965
- const _sfc_main$H = {
6233
+ const _sfc_main$L = {
5966
6234
  __name: "MetroWidget",
5967
6235
  props: {
5968
6236
  padding: {
@@ -6149,10 +6417,16 @@ const _sfc_main$H = {
6149
6417
  touchDivSize,
6150
6418
  "common"
6151
6419
  );
6152
- let touchDivVOn = {};
6153
- if (onTouchRelease) {
6154
- touchDivVOn["jsv-touchend"] = onTouchRelease;
6155
- }
6420
+ onMounted(() => {
6421
+ if (onTouchRelease) {
6422
+ touchDiv.value.jsvSetTapListener(
6423
+ {
6424
+ onTouchEnd: onTouchRelease
6425
+ },
6426
+ ForgeConst.DragFlags.TOUCH_RECV_MOVE_BIT | ForgeConst.DragFlags.TOUCH_RECV_FLING_BIT | ForgeConst.DragFlags.TOUCH_RECV_LAST_END
6427
+ );
6428
+ }
6429
+ });
6156
6430
  expose(exportObject);
6157
6431
  return (_ctx, _cache) => {
6158
6432
  const _component_jsv_focus_block = resolveComponent("jsv-focus-block");
@@ -6181,14 +6455,14 @@ const _sfc_main$H = {
6181
6455
  top: slideDivTop.value
6182
6456
  })
6183
6457
  }, [
6184
- createElementVNode("div", mergeProps({
6458
+ createElementVNode("div", {
6185
6459
  ref_key: "touchDiv",
6186
6460
  ref: touchDiv,
6187
- style: {
6461
+ style: normalizeStyle({
6188
6462
  width: touchDivSize.width,
6189
6463
  height: touchDivSize.height
6190
- }
6191
- }, toHandlers(unref(touchDivVOn), true)), [
6464
+ })
6465
+ }, [
6192
6466
  createElementVNode("div", null, [
6193
6467
  renderSlot(_ctx.$slots, "background")
6194
6468
  ]),
@@ -6210,7 +6484,7 @@ const _sfc_main$H = {
6210
6484
  default: withCtx(() => [
6211
6485
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(renderData), (item, index) => {
6212
6486
  return openBlock(), createElementBlock("div", {
6213
- key: pageUpdateToken.value + "_" + item.index,
6487
+ key: pageUpdateToken.value + "_" + item.index + "-" + item.renderKey.value,
6214
6488
  ref_for: true,
6215
6489
  ref: item.divRef,
6216
6490
  "data-jsv-vw-test-rect": "1",
@@ -6229,7 +6503,7 @@ const _sfc_main$H = {
6229
6503
  ref: item.slotRef,
6230
6504
  id: `${__props.name}_${index}`
6231
6505
  }, [
6232
- createVNode(_sfc_main$I, { key: "__QcodeJsviewFreezeComponent" }, {
6506
+ createVNode(_sfc_main$M, { key: "__QcodeJsviewFreezeComponent" }, {
6233
6507
  default: withCtx(() => [
6234
6508
  renderSlot(_ctx.$slots, "renderItem", {
6235
6509
  data: item.customerData,
@@ -6242,7 +6516,7 @@ const _sfc_main$H = {
6242
6516
  _: 2
6243
6517
  }, 1024)
6244
6518
  ], 8, ["id"])) : createCommentVNode("", true),
6245
- __props.enableItemRenderBreak && __props.placeHolderSetting && !item.mounted.value ? (openBlock(), createElementBlock("div", {
6519
+ __props.enableItemRenderBreak && __props.placeHolderSetting && !item.mounted.value && item.itemConfig.showSkeleton ? (openBlock(), createElementBlock("div", {
6246
6520
  key: 1,
6247
6521
  style: normalizeStyle({
6248
6522
  width: item.renderStyle.width - unref(normalizedPlaceHolder).gap,
@@ -6257,7 +6531,7 @@ const _sfc_main$H = {
6257
6531
  _: 3
6258
6532
  }, 8, ["name", "onAction"])
6259
6533
  ], 512)
6260
- ], 16),
6534
+ ], 4),
6261
6535
  createElementVNode("div", null, [
6262
6536
  renderSlot(_ctx.$slots, "foreground")
6263
6537
  ])
@@ -6278,7 +6552,7 @@ const _sfc_main$H = {
6278
6552
 
6279
6553
 
6280
6554
  */
6281
- const _sfc_main$G = {
6555
+ const _sfc_main$K = {
6282
6556
  __name: "ListWidget",
6283
6557
  props: {
6284
6558
  padding: {
@@ -6464,10 +6738,16 @@ const _sfc_main$G = {
6464
6738
  touchDivSize,
6465
6739
  "list"
6466
6740
  );
6467
- let touchDivVOn = {};
6468
- if (onTouchRelease) {
6469
- touchDivVOn["jsv-touchend"] = onTouchRelease;
6470
- }
6741
+ onMounted(() => {
6742
+ if (onTouchRelease) {
6743
+ touchDiv.value.jsvSetTapListener(
6744
+ {
6745
+ onTouchEnd: onTouchRelease
6746
+ },
6747
+ ForgeConst.DragFlags.TOUCH_RECV_MOVE_BIT | ForgeConst.DragFlags.TOUCH_RECV_FLING_BIT | ForgeConst.DragFlags.TOUCH_RECV_LAST_END
6748
+ );
6749
+ }
6750
+ });
6471
6751
  expose(exportObject);
6472
6752
  return (_ctx, _cache) => {
6473
6753
  const _component_jsv_focus_block = resolveComponent("jsv-focus-block");
@@ -6496,14 +6776,14 @@ const _sfc_main$G = {
6496
6776
  top: slideDivTop.value
6497
6777
  })
6498
6778
  }, [
6499
- createElementVNode("div", mergeProps({
6779
+ createElementVNode("div", {
6500
6780
  ref_key: "touchDiv",
6501
6781
  ref: touchDiv,
6502
- style: {
6782
+ style: normalizeStyle({
6503
6783
  width: touchDivSize.width,
6504
6784
  height: touchDivSize.height
6505
- }
6506
- }, toHandlers(unref(touchDivVOn), true)), [
6785
+ })
6786
+ }, [
6507
6787
  createElementVNode("div", null, [
6508
6788
  renderSlot(_ctx.$slots, "background")
6509
6789
  ]),
@@ -6525,7 +6805,7 @@ const _sfc_main$G = {
6525
6805
  default: withCtx(() => [
6526
6806
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(renderData), (item, index) => {
6527
6807
  return openBlock(), createElementBlock("div", {
6528
- key: pageUpdateToken.value + "_" + item.index,
6808
+ key: pageUpdateToken.value + "_" + item.index + "-" + item.renderKey.value,
6529
6809
  ref_for: true,
6530
6810
  ref: item.divRef,
6531
6811
  "data-jsv-vw-test-rect": "1",
@@ -6552,7 +6832,7 @@ const _sfc_main$G = {
6552
6832
  onItemEdge: unref(_onFocusableItemEdge)
6553
6833
  })
6554
6834
  ], 8, ["id"])) : createCommentVNode("", true),
6555
- __props.enableItemRenderBreak && __props.placeHolderSetting && !item.mounted.value ? (openBlock(), createElementBlock("div", {
6835
+ __props.enableItemRenderBreak && __props.placeHolderSetting && !item.mounted.value && item.itemConfig.showSkeleton ? (openBlock(), createElementBlock("div", {
6556
6836
  key: 1,
6557
6837
  style: normalizeStyle({
6558
6838
  width: item.renderStyle.width - unref(normalizedPlaceHolder).gap,
@@ -6567,7 +6847,7 @@ const _sfc_main$G = {
6567
6847
  _: 3
6568
6848
  }, 8, ["name", "onAction"])
6569
6849
  ], 512)
6570
- ], 16),
6850
+ ], 4),
6571
6851
  createElementVNode("div", null, [
6572
6852
  renderSlot(_ctx.$slots, "foreground")
6573
6853
  ])
@@ -6728,7 +7008,7 @@ const HUB_NS_PROVIDE_NAME = "__jsvFocusNameSpace__";
6728
7008
 
6729
7009
 
6730
7010
  */
6731
- const _sfc_main$F = {
7011
+ const _sfc_main$J = {
6732
7012
  __name: "JsvFocusBlock",
6733
7013
  props: {
6734
7014
  name: String,
@@ -6913,7 +7193,7 @@ const _sfc_main$F = {
6913
7193
  };
6914
7194
 
6915
7195
  //
6916
- // utils/JsViewEngineWidget/JsvFocus/JsvFocusManager.js;
7196
+ // utils/JsViewEngineWidget/JsvFocus/JsvFocusManager.ts;
6917
7197
  //
6918
7198
  const useFocusHub = (withNameSpace) => {
6919
7199
  if (withNameSpace) {
@@ -6925,6 +7205,9 @@ const useFocusHub = (withNameSpace) => {
6925
7205
  return inject(ROOT_HUB_PROVIDE_NAME);
6926
7206
  };
6927
7207
  class JsvFocusManager {
7208
+ // #aliasMap = {}
7209
+ $_appMount = void 0;
7210
+ $_topFDiv = void 0;
6928
7211
  constructor() {
6929
7212
  }
6930
7213
  install(app, ...options) {
@@ -6936,7 +7219,7 @@ class JsvFocusManager {
6936
7219
  }
6937
7220
  const doAppMount = this.$_hookMount(app, options[0]);
6938
7221
  app.mount = doAppMount;
6939
- app.component("JsvFocusBlock", _sfc_main$F);
7222
+ app.component("JsvFocusBlock", _sfc_main$J);
6940
7223
  app.config.globalProperties.$jsvFocusManager = this;
6941
7224
  app.provide(HUB_NS_PROVIDE_NAME, null);
6942
7225
  app.provide(ROOT_HUB_PROVIDE_NAME, new JsvFocusHubApi(this.$_topFDiv.getHub()));
@@ -6990,16 +7273,13 @@ class JsvFocusManager {
6990
7273
  this.$_topFDiv.onMounted();
6991
7274
  return rootComponent;
6992
7275
  }
6993
- // #aliasMap = {}
6994
- $_appMount = void 0;
6995
- $_topFDiv = void 0;
6996
7276
  }
6997
7277
  function jsvCreateFocusManager() {
6998
7278
  return new JsvFocusManager();
6999
7279
  }
7000
7280
 
7001
7281
  //
7002
- // utils/JsViewEngineWidget/index.js;
7282
+ // utils/JsViewEngineWidget/index.ts;
7003
7283
  //
7004
7284
 
7005
7285
  //
@@ -7481,7 +7761,7 @@ class ScreenLockManager {
7481
7761
  // utils/JsViewPlugin/JsvAudio/AudioProxy.js;
7482
7762
  //
7483
7763
  let sPluginLoader$1 = GetPluginLoader$1();
7484
- const TAG$2 = "JsvAudio";
7764
+ const TAG$2 = "JsvAudio:";
7485
7765
  let keyToken = 0;
7486
7766
  const getKeyToken = () => {
7487
7767
  return ++keyToken;
@@ -7538,6 +7818,8 @@ class AudioProxy {
7538
7818
  this._created = false;
7539
7819
  this._eventListener = {};
7540
7820
  this._propCache = {};
7821
+ this._unloaded = false;
7822
+ this._visibility = window.JsView?.getVisibility();
7541
7823
  this._onVisibilityChange = this.onVisibilityChange.bind(this);
7542
7824
  window.JsView?.onVisibilityChange(this._onVisibilityChange);
7543
7825
  }
@@ -7655,15 +7937,30 @@ class AudioProxy {
7655
7937
  }
7656
7938
  /** control */
7657
7939
  load() {
7940
+ if (this._unloaded) {
7941
+ console.warn(TAG$2, "Instead of calling load() after unload(), please update component's key to create a new JsvAudio.");
7942
+ return;
7943
+ }
7658
7944
  this.setProperty("enablePlayer", true);
7659
7945
  }
7660
7946
  play() {
7661
- this.setProperty("paused", false);
7947
+ if (this._visibility) {
7948
+ this.setProperty("paused", false);
7949
+ if (typeof this._propCache["customerPause"] !== "undefined") {
7950
+ this._propCache["customerPause"] = false;
7951
+ }
7952
+ } else {
7953
+ console.warn(TAG$2, "JsvAudio can not play when it is invisible.");
7954
+ }
7662
7955
  }
7663
7956
  pause() {
7664
7957
  this.setProperty("paused", true);
7958
+ if (typeof this._propCache["customerPause"] !== "undefined") {
7959
+ this._propCache["customerPause"] = true;
7960
+ }
7665
7961
  }
7666
7962
  unload() {
7963
+ this._unloaded = true;
7667
7964
  this.pause();
7668
7965
  this.setProperty("enablePlayer", false);
7669
7966
  }
@@ -7766,6 +8063,7 @@ class AudioProxy {
7766
8063
  onVisibilityChange(state) {
7767
8064
  console.log(TAG$2, "audio visibility change", JSON.stringify(state));
7768
8065
  if (state.status == "show") {
8066
+ this._visibility = true;
7769
8067
  if (typeof this._propCache["customerPause"] != "undefined") {
7770
8068
  const customerPause = this._propCache["customerPause"];
7771
8069
  delete this._propCache["customerPause"];
@@ -7774,6 +8072,7 @@ class AudioProxy {
7774
8072
  }
7775
8073
  }
7776
8074
  } else {
8075
+ this._visibility = false;
7777
8076
  this._propCache["customerPause"] = this._propCache["paused"];
7778
8077
  this.pause();
7779
8078
  }
@@ -7794,7 +8093,7 @@ class AudioProxy {
7794
8093
 
7795
8094
 
7796
8095
  */
7797
- const _sfc_main$E = {
8096
+ const _sfc_main$I = {
7798
8097
  __name: "JsvAudio",
7799
8098
  props: {
7800
8099
  /**
@@ -7941,7 +8240,7 @@ const _sfc_main$E = {
7941
8240
 
7942
8241
 
7943
8242
  */
7944
- const _sfc_main$D = {
8243
+ const _sfc_main$H = {
7945
8244
  __name: "JsvAudioProxy",
7946
8245
  setup(__props) {
7947
8246
  const AsyncComp = defineAsyncComponent(() => {
@@ -7951,7 +8250,7 @@ const _sfc_main$D = {
7951
8250
  const BrowserAudio = import('./browser/BrowserAudio.vue.mjs');
7952
8251
  resolve(BrowserAudio);
7953
8252
  } else {
7954
- resolve(_sfc_main$E);
8253
+ resolve(_sfc_main$I);
7955
8254
  }
7956
8255
  });
7957
8256
  });
@@ -8246,7 +8545,7 @@ const cssColor2Android = (cssColor) => {
8246
8545
 
8247
8546
 
8248
8547
  */
8249
- const _sfc_main$C = {
8548
+ const _sfc_main$G = {
8250
8549
  __name: "JsvLatex",
8251
8550
  props: {
8252
8551
  latexStr: {
@@ -8368,7 +8667,7 @@ const _sfc_main$C = {
8368
8667
 
8369
8668
 
8370
8669
  */
8371
- const _sfc_main$B = {
8670
+ const _sfc_main$F = {
8372
8671
  __name: "JsvLatexProxy",
8373
8672
  setup(__props) {
8374
8673
  const AsyncComp = defineAsyncComponent(() => {
@@ -8378,7 +8677,7 @@ const _sfc_main$B = {
8378
8677
  const BrowserJsvLatex = import('./browser/BrowserJsvLatex.vue.mjs');
8379
8678
  resolve(BrowserJsvLatex);
8380
8679
  } else {
8381
- resolve(_sfc_main$C);
8680
+ resolve(_sfc_main$G);
8382
8681
  }
8383
8682
  });
8384
8683
  });
@@ -10840,7 +11139,7 @@ class JsvActorMoveControl extends ActorControlBase {
10840
11139
 
10841
11140
 
10842
11141
  */
10843
- const _sfc_main$A = {
11142
+ const _sfc_main$E = {
10844
11143
  __name: "JsvActorMove",
10845
11144
  props: {
10846
11145
  control: {
@@ -10904,7 +11203,7 @@ const _sfc_main$A = {
10904
11203
 
10905
11204
 
10906
11205
  */
10907
- const _sfc_main$z = {
11206
+ const _sfc_main$D = {
10908
11207
  __name: "FreeMoveActor",
10909
11208
  props: {
10910
11209
  // div的style设置,
@@ -11014,7 +11313,7 @@ const KeepFlags = {
11014
11313
 
11015
11314
 
11016
11315
  */
11017
- const _sfc_main$y = {
11316
+ const _sfc_main$C = {
11018
11317
  __name: "JsvEnvBlocker",
11019
11318
  props: {
11020
11319
  // (支持reactive)位置信息
@@ -11113,6 +11412,97 @@ const _sfc_main$y = {
11113
11412
  }
11114
11413
  };
11115
11414
 
11415
+ //
11416
+ // utils/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.ts;
11417
+ //
11418
+ class SyncLinkSource {
11419
+ nexusNode;
11420
+ linkName;
11421
+ constructor(name, node) {
11422
+ this.nexusNode = node;
11423
+ this.linkName = name;
11424
+ }
11425
+ }
11426
+ class SyncLinkManager {
11427
+ // 等待中的未回复的link
11428
+ pendingPromiseList = [];
11429
+ syncSourceMap = /* @__PURE__ */ new Map();
11430
+ constructor() {
11431
+ }
11432
+ // 将LinkSource加入map
11433
+ SourceOnMounted(syncSource) {
11434
+ if (syncSource != null) {
11435
+ let linkName = syncSource.linkName;
11436
+ if (this.syncSourceMap.has(linkName)) {
11437
+ console.error(`Error: sync link name duplicate:${linkName}`);
11438
+ return;
11439
+ }
11440
+ this.syncSourceMap.set(linkName, syncSource);
11441
+ if (this.pendingPromiseList.length != 0) {
11442
+ for (let index = this.pendingPromiseList.length - 1; index >= 0; index--) {
11443
+ let promiseItem = this.pendingPromiseList[index];
11444
+ if (promiseItem.linkName == linkName) {
11445
+ promiseItem.promiseResolve?.();
11446
+ this.pendingPromiseList.splice(index, 1);
11447
+ }
11448
+ }
11449
+ }
11450
+ }
11451
+ }
11452
+ // 将LinkSource移出map
11453
+ SourceOnUnmounted(linkName) {
11454
+ if (this.syncSourceMap.has(linkName)) {
11455
+ this.syncSourceMap.delete(linkName);
11456
+ } else {
11457
+ console.error(`ERROR: unmount linkname(${linkName}) not found`);
11458
+ }
11459
+ }
11460
+ // 加入wait处理在.then中再进行 GetSyncSource, 以保证节点完成了mounted
11461
+ WaitSourceMounted(name) {
11462
+ let newPromiseItem = {
11463
+ promiseRef: null,
11464
+ promiseResolve: null,
11465
+ linkName: name
11466
+ };
11467
+ newPromiseItem.promiseRef = new Promise((resolve) => {
11468
+ newPromiseItem.promiseResolve = resolve;
11469
+ if (this.syncSourceMap.has(name)) {
11470
+ resolve();
11471
+ } else {
11472
+ this.pendingPromiseList.push(newPromiseItem);
11473
+ }
11474
+ });
11475
+ return newPromiseItem.promiseRef;
11476
+ }
11477
+ // 取消 WaitSourceMounted 发起的Promise, 用在unmounted中, 规避内存泄漏
11478
+ UnListen(waitPromise) {
11479
+ if (this.pendingPromiseList.length != 0) {
11480
+ for (let index = this.pendingPromiseList.length; index >= 0; index--) {
11481
+ let promiseItem = this.pendingPromiseList[index];
11482
+ if (promiseItem.promiseRef == waitPromise) {
11483
+ this.pendingPromiseList.splice(index, 1);
11484
+ break;
11485
+ }
11486
+ }
11487
+ }
11488
+ }
11489
+ GetSourceNexusNode(linkName) {
11490
+ let sourceItem = this.syncSourceMap.get(linkName);
11491
+ if (sourceItem) {
11492
+ return sourceItem.nexusNode;
11493
+ } else {
11494
+ return null;
11495
+ }
11496
+ }
11497
+ }
11498
+ let sSyncLinkManager = null;
11499
+ function GetSyncLinkManager() {
11500
+ if (sSyncLinkManager == null) {
11501
+ sSyncLinkManager = new SyncLinkManager();
11502
+ }
11503
+ return sSyncLinkManager;
11504
+ }
11505
+
11116
11506
  //
11117
11507
  // utils/JsViewVueWidget/JsvFreeMoveActor/index.js;
11118
11508
  //
@@ -11122,7 +11512,9 @@ let FreeMoveDef = {
11122
11512
  };
11123
11513
  let FreeMoveFunc = {
11124
11514
  newNexus,
11125
- ActControlDebug: ActorControl
11515
+ ActControlDebug: ActorControl,
11516
+ GetSyncLinkManager,
11517
+ SyncLinkSource
11126
11518
  };
11127
11519
 
11128
11520
  //
@@ -11165,7 +11557,7 @@ let FreeMoveFunc = {
11165
11557
 
11166
11558
 
11167
11559
  */
11168
- const _sfc_main$x = {
11560
+ const _sfc_main$B = {
11169
11561
  __name: "JsvFlexDiv",
11170
11562
  props: {
11171
11563
  style: Object,
@@ -11272,7 +11664,7 @@ const _sfc_main$x = {
11272
11664
 
11273
11665
 
11274
11666
  */
11275
- const _sfc_main$w = {
11667
+ const _sfc_main$A = {
11276
11668
  props: {
11277
11669
  src: String,
11278
11670
  style: Object,
@@ -11327,12 +11719,12 @@ const _sfc_main$w = {
11327
11719
  }
11328
11720
  }
11329
11721
  },
11330
- stop() {
11722
+ stop(frameCount = -1) {
11331
11723
  if (this.$refs.element) {
11332
11724
  let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
11333
11725
  handles.TextureManager
11334
11726
  );
11335
- mainViewTexture.DispatchCommand(Forge.NativeConstant.APIC_STOP, "");
11727
+ mainViewTexture.DispatchCommand(Forge.NativeConstant.APIC_STOP, `{"TF":${frameCount}}`);
11336
11728
  }
11337
11729
  }
11338
11730
  },
@@ -11350,7 +11742,7 @@ const _sfc_main$w = {
11350
11742
  }
11351
11743
  },
11352
11744
  beforeUnmount() {
11353
- this.stop();
11745
+ this.stop(0);
11354
11746
  if (this.$refs.element) {
11355
11747
  let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
11356
11748
  handles.TextureManager
@@ -11373,7 +11765,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
11373
11765
  style: normalizeStyle($props.style)
11374
11766
  }, null, 12, ["src"]);
11375
11767
  }
11376
- const JsvApic = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$a]]);
11768
+ const JsvApic = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$a]]);
11377
11769
 
11378
11770
  //
11379
11771
  // utils/JsViewVueWidget/JsvApic/JsvApic/index.js;
@@ -11424,7 +11816,7 @@ const _JsvApic$1 = _JsvApic;
11424
11816
 
11425
11817
 
11426
11818
  */
11427
- const _sfc_main$v = {
11819
+ const _sfc_main$z = {
11428
11820
  props: {
11429
11821
  src: String,
11430
11822
  style: Object,
@@ -11479,12 +11871,12 @@ const _sfc_main$v = {
11479
11871
  }
11480
11872
  }
11481
11873
  },
11482
- stop() {
11874
+ stop(frameCount = -1) {
11483
11875
  if (this.$refs.element) {
11484
11876
  let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
11485
11877
  handles.TextureManager
11486
11878
  );
11487
- mainViewTexture.DispatchCommand(Forge.NativeConstant.APIC_STOP, "");
11879
+ mainViewTexture.DispatchCommand(Forge.NativeConstant.APIC_STOP, `{"TF":${frameCount}}`);
11488
11880
  }
11489
11881
  }
11490
11882
  },
@@ -11499,7 +11891,7 @@ const _sfc_main$v = {
11499
11891
  }
11500
11892
  },
11501
11893
  beforeUnmount() {
11502
- this.stop();
11894
+ this.stop(0);
11503
11895
  if (this.$refs.element) {
11504
11896
  let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
11505
11897
  handles.TextureManager
@@ -11522,7 +11914,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
11522
11914
  style: normalizeStyle($props.style)
11523
11915
  }, null, 12, ["src"]);
11524
11916
  }
11525
- const JsvApic2 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$9]]);
11917
+ const JsvApic2 = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$9]]);
11526
11918
 
11527
11919
  //
11528
11920
  // utils/JsViewVueWidget/JsvApic/JsvApic2/index.js;
@@ -11549,7 +11941,7 @@ const _JsvApic2$1 = _JsvApic2;
11549
11941
 
11550
11942
 
11551
11943
  */
11552
- const _sfc_main$u = {
11944
+ const _sfc_main$y = {
11553
11945
  props: {
11554
11946
  left: {
11555
11947
  type: Number,
@@ -11603,7 +11995,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
11603
11995
  })
11604
11996
  }, null, 4);
11605
11997
  }
11606
- const CursorVue = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$8]]);
11998
+ const CursorVue = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$8]]);
11607
11999
 
11608
12000
  //
11609
12001
  // utils/JsViewVueWidget/JsvInput/JsvInput.vue;
@@ -11631,7 +12023,7 @@ const edgeMap = {
11631
12023
  40: EdgeDirection.bottom
11632
12024
  };
11633
12025
  const MAX_WIDTH = 1920;
11634
- const _sfc_main$t = {
12026
+ const _sfc_main$x = {
11635
12027
  components: {
11636
12028
  CursorVue
11637
12029
  },
@@ -12234,7 +12626,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
12234
12626
  _: 1
12235
12627
  }, 8, ["name", "onAction", "style"]);
12236
12628
  }
12237
- const JsvInput = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$7]]);
12629
+ const JsvInput = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$7]]);
12238
12630
 
12239
12631
  //
12240
12632
  // utils/JsViewVueWidget/JsvInput/index.js;
@@ -12305,7 +12697,7 @@ const buildDownloadInfo$1 = (url, net_setting = null, get_image_size) => {
12305
12697
  // 用于格式校验
12306
12698
  };
12307
12699
  };
12308
- const _sfc_main$s = {
12700
+ const _sfc_main$w = {
12309
12701
  __name: "JsvPreload",
12310
12702
  props: {
12311
12703
  preloadList: Object,
@@ -12586,7 +12978,7 @@ const _sfc_main$s = {
12586
12978
  // 考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
12587
12979
  let _JsvPreload;
12588
12980
  if (window.JsView) {
12589
- _JsvPreload = _sfc_main$s;
12981
+ _JsvPreload = _sfc_main$w;
12590
12982
  } else {
12591
12983
  const BrowserPreload = await import('./browser/BrowserPreload.vue.mjs');
12592
12984
  _JsvPreload = BrowserPreload.default;
@@ -12620,7 +13012,7 @@ const JsvPreload = _JsvPreload;
12620
13012
 
12621
13013
 
12622
13014
  */
12623
- const _sfc_main$r = {
13015
+ const _sfc_main$v = {
12624
13016
  props: {
12625
13017
  value: String,
12626
13018
  size: Number,
@@ -12756,7 +13148,7 @@ const _sfc_main$r = {
12756
13148
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
12757
13149
  return openBlock(), createElementBlock("div", { "data-jsv-vw-innerview": $data.innerViewId }, null, 8, ["data-jsv-vw-innerview"]);
12758
13150
  }
12759
- const JsvQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$6]]);
13151
+ const JsvQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$6]]);
12760
13152
 
12761
13153
  //
12762
13154
  // utils/JsViewVueWidget/JsvQrcode/index.js;
@@ -12884,7 +13276,7 @@ let buildForgeView = (pointRes, sprayStyle, sizeRef, ignoreClip) => {
12884
13276
  sizeRef.height = view_height;
12885
13277
  return Forge$2.sViewStore.add(new Forge$2.ViewInfo(spray_view, null));
12886
13278
  };
12887
- const _sfc_main$q = {
13279
+ const _sfc_main$u = {
12888
13280
  props: {
12889
13281
  pointRes: {
12890
13282
  type: String,
@@ -12943,7 +13335,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
12943
13335
  "data-jsv-vw-innerview": $data.viewId
12944
13336
  }, null, 12, ["data-jsv-vw-innerview"]);
12945
13337
  }
12946
- const JsvSpray = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$5]]);
13338
+ const JsvSpray = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$5]]);
12947
13339
 
12948
13340
  //
12949
13341
  // utils/JsViewVueWidget/JsvSpray/index.js;
@@ -13199,7 +13591,7 @@ const JsvSpriteAnim_vue_vue_type_style_index_0_scoped_00add5ef_lang = "";
13199
13591
 
13200
13592
 
13201
13593
  */
13202
- const _sfc_main$p = {
13594
+ const _sfc_main$t = {
13203
13595
  __name: "JsvSpriteAnim",
13204
13596
  props: {
13205
13597
  spriteInfo: Object,
@@ -13536,7 +13928,7 @@ const _sfc_main$p = {
13536
13928
  };
13537
13929
  const styleSheetsContent$1 = { "0": { "sprite-tag-00add5ef": "@keyframes sprite-tag-00add5ef {}" } };
13538
13930
  window.JsvCode.Dom.DeclareStyleSheets(styleSheetsContent$1);
13539
- const JsvSpriteAnim = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-00add5ef"]]);
13931
+ const JsvSpriteAnim = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-00add5ef"]]);
13540
13932
 
13541
13933
  //
13542
13934
  // utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue;
@@ -13556,7 +13948,7 @@ const JsvSpriteAnim = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "d
13556
13948
 
13557
13949
 
13558
13950
  */
13559
- const _sfc_main$o = {
13951
+ const _sfc_main$s = {
13560
13952
  __name: "JsvSpriteLoader",
13561
13953
  props: {
13562
13954
  imageUrl: String,
@@ -13762,7 +14154,7 @@ let JsvSpriteTools = {
13762
14154
 
13763
14155
 
13764
14156
  */
13765
- const _sfc_main$n = {
14157
+ const _sfc_main$r = {
13766
14158
  __name: "JsvVisibleSensor",
13767
14159
  props: {
13768
14160
  // (支持reactive)可视区域设定
@@ -13885,7 +14277,7 @@ const _sfc_main$n = {
13885
14277
 
13886
14278
  var JsvVisibleSensor$1 = /*#__PURE__*/Object.freeze({
13887
14279
  __proto__: null,
13888
- default: _sfc_main$n
14280
+ default: _sfc_main$r
13889
14281
  });
13890
14282
 
13891
14283
  //
@@ -13960,8 +14352,8 @@ const keyCode2EdgeDirection = (keyCode) => {
13960
14352
  return null;
13961
14353
  }
13962
14354
  };
13963
- const _sfc_main$m = {
13964
- components: { JsvActorMove: _sfc_main$A, JsvVisibleSensor },
14355
+ const _sfc_main$q = {
14356
+ components: { JsvActorMove: _sfc_main$E, JsvVisibleSensor },
13965
14357
  props: {
13966
14358
  showIndicator: {
13967
14359
  type: Boolean,
@@ -14448,7 +14840,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
14448
14840
  }, 8, ["name", "style", "onAction"])
14449
14841
  ], 64);
14450
14842
  }
14451
- const JsvSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$4]]);
14843
+ const JsvSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$4]]);
14452
14844
 
14453
14845
  //
14454
14846
  // utils/JsViewVueWidget/JsvSwiper/index.js;
@@ -14481,7 +14873,7 @@ const JsvSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_rend
14481
14873
 
14482
14874
 
14483
14875
  */
14484
- const _sfc_main$l = {
14876
+ const _sfc_main$p = {
14485
14877
  __name: "JsvSwiper",
14486
14878
  props: {
14487
14879
  dispNumber: { type: Number, require: true },
@@ -14927,7 +15319,7 @@ const TexAlignAnchor$1 = {
14927
15319
  CENTER_BOTTOM: 8,
14928
15320
  RIGHT_BOTTOM: 9
14929
15321
  };
14930
- const _sfc_main$k = {
15322
+ const _sfc_main$o = {
14931
15323
  props: {
14932
15324
  src: String,
14933
15325
  top: Number,
@@ -15201,7 +15593,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
15201
15593
  "data-jsv-vw-innerview": $setup.innerViewId
15202
15594
  }, null, 12, ["data-jsv-vw-innerview"]);
15203
15595
  }
15204
- const JsvTextureAnim = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$3]]);
15596
+ const JsvTextureAnim = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$3]]);
15205
15597
 
15206
15598
  //
15207
15599
  // utils/JsViewVueWidget/JsvTextureAnim/index.js;
@@ -15234,7 +15626,7 @@ const TexAlignAnchor = TexAlignAnchor$1;
15234
15626
 
15235
15627
 
15236
15628
  */
15237
- const _sfc_main$j = {
15629
+ const _sfc_main$n = {
15238
15630
  __name: "JsvFilterView",
15239
15631
  props: {
15240
15632
  width: {
@@ -15387,7 +15779,7 @@ class LineType extends UpdateType {
15387
15779
  this.end = end;
15388
15780
  }
15389
15781
  }
15390
- const _sfc_main$i = {
15782
+ const _sfc_main$m = {
15391
15783
  props: {
15392
15784
  left: {
15393
15785
  type: Number
@@ -15887,7 +16279,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
15887
16279
  _: 3
15888
16280
  }, 8, ["name", "onAction", "style"]);
15889
16281
  }
15890
- const JsvGrid = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$2]]);
16282
+ const JsvGrid = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$2]]);
15891
16283
 
15892
16284
  //
15893
16285
  // utils/JsViewVueWidget/JsvNinePatch.vue;
@@ -15895,6 +16287,8 @@ const JsvGrid = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render
15895
16287
  /* <!--
15896
16288
  * 【模块 export 内容】
15897
16289
  * JsvNinePatch:Vue高阶组件,.9图展示控件,该控件的原图要求为正方形,延展后可为长方形
16290
+ * centerWidth和borderOutset传值比较抽象,若 imageDspWidth 和图片素材的原图尺寸一直,
16291
+ * 则可以参考 samples/NinePatchTester 的样例图示
15898
16292
  * props说明:
15899
16293
  * style {Object} 同div的Style,通过width/height来控制.9图片延展后的显示尺寸,另外通过top/left控制坐标
15900
16294
  * imageUrl {String} (必填)显示图片的加载地址
@@ -15916,7 +16310,7 @@ const JsvGrid = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render
15916
16310
 
15917
16311
 
15918
16312
  */
15919
- const _sfc_main$h = {
16313
+ const _sfc_main$l = {
15920
16314
  __name: "JsvNinePatch",
15921
16315
  props: {
15922
16316
  style: {
@@ -15937,7 +16331,9 @@ const _sfc_main$h = {
15937
16331
  animTime: { type: Number, default: 0 },
15938
16332
  onTransitionEnd: { type: Function },
15939
16333
  animation: { type: String },
15940
- imageBlendType: { type: String, default: null }
16334
+ imageBlendType: { type: String, default: null },
16335
+ // 获取实际div的句柄
16336
+ onDivRef: { type: Function, default: null }
15941
16337
  },
15942
16338
  setup(__props) {
15943
16339
  const props = __props;
@@ -15980,9 +16376,13 @@ const _sfc_main$h = {
15980
16376
  );
15981
16377
  }
15982
16378
  });
16379
+ function innerOnDivRef(ref2) {
16380
+ props.onDivRef?.(ref2);
16381
+ }
15983
16382
  return (_ctx, _cache) => {
15984
16383
  return isReady() ? (openBlock(), createElementBlock("div", {
15985
16384
  key: 0,
16385
+ ref: innerOnDivRef,
15986
16386
  style: normalizeStyle({
15987
16387
  ...__props.style,
15988
16388
  transition: !!__props.animation ? null : getTransition(),
@@ -16016,7 +16416,7 @@ const _sfc_main$h = {
16016
16416
 
16017
16417
 
16018
16418
  */
16019
- const _sfc_main$g = {
16419
+ const _sfc_main$k = {
16020
16420
  __name: "JsvNativeSharedDiv",
16021
16421
  props: {
16022
16422
  style: {
@@ -16094,7 +16494,7 @@ const _sfc_main$g = {
16094
16494
  top: __props.style.top
16095
16495
  })
16096
16496
  }, [
16097
- unref(ninePatchSet) != null ? (openBlock(), createBlock(_sfc_main$h, {
16497
+ unref(ninePatchSet) != null ? (openBlock(), createBlock(_sfc_main$l, {
16098
16498
  key: 0,
16099
16499
  style: normalizeStyle({
16100
16500
  width: __props.style.width,
@@ -16160,7 +16560,7 @@ const _sfc_main$g = {
16160
16560
 
16161
16561
 
16162
16562
  */
16163
- const _sfc_main$f = {
16563
+ const _sfc_main$j = {
16164
16564
  __name: "JsvMarquee",
16165
16565
  props: {
16166
16566
  text: {
@@ -16567,7 +16967,7 @@ const _sfc_main$f = {
16567
16967
 
16568
16968
  */
16569
16969
  const renderDocument = window.JsvCode.Dom.RenderDocument ? window.JsvCode.Dom.RenderDocument : window.JsvCode.Dom.BrowserDocument;
16570
- const _sfc_main$e = {
16970
+ const _sfc_main$i = {
16571
16971
  props: {
16572
16972
  class: {
16573
16973
  type: String
@@ -16742,7 +17142,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
16742
17142
  })
16743
17143
  }, null, 12, ["data-jsv-vw-innerview"]));
16744
17144
  }
16745
- const JsvMaskClipDiv = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$1]]);
17145
+ const JsvMaskClipDiv = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$1]]);
16746
17146
 
16747
17147
  //
16748
17148
  // utils/JsViewVueWidget/JsvPosterDiv.vue;
@@ -16761,7 +17161,7 @@ const JsvMaskClipDiv = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc
16761
17161
 
16762
17162
 
16763
17163
  */
16764
- const _sfc_main$d = {
17164
+ const _sfc_main$h = {
16765
17165
  __name: "JsvPosterDiv",
16766
17166
  props: {
16767
17167
  style: Object
@@ -16814,7 +17214,7 @@ const _sfc_main$d = {
16814
17214
 
16815
17215
 
16816
17216
  */
16817
- const _sfc_main$c = {
17217
+ const _sfc_main$g = {
16818
17218
  __name: "JsvPosterImage",
16819
17219
  props: {
16820
17220
  colorSpace: {
@@ -16905,7 +17305,7 @@ const _sfc_main$c = {
16905
17305
 
16906
17306
 
16907
17307
  */
16908
- const _sfc_main$b = {
17308
+ const _sfc_main$f = {
16909
17309
  props: {
16910
17310
  definitionScale: {
16911
17311
  type: String
@@ -16917,7 +17317,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
16917
17317
  renderSlot(_ctx.$slots, "default")
16918
17318
  ], 8, ["data-jsv-vw-text-definition"]);
16919
17319
  }
16920
- const JsvScaleTextBox = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render]]);
17320
+ const JsvScaleTextBox = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render]]);
16921
17321
 
16922
17322
  //
16923
17323
  // utils/JsViewVueWidget/JsvSoundPool.js;
@@ -17148,7 +17548,7 @@ class JsvSoundPool {
17148
17548
  /* <!--
17149
17549
  * Created by chunfeng.luo@qcast.cn on 10/13/20.
17150
17550
  */
17151
- const _sfc_main$a = {
17551
+ const _sfc_main$e = {
17152
17552
  __name: "JsvTextBox",
17153
17553
  props: {
17154
17554
  style: Object,
@@ -17194,7 +17594,7 @@ const _sfc_main$a = {
17194
17594
  return props.enableLatex ? 1 : 0;
17195
17595
  });
17196
17596
  return (_ctx, _cache) => {
17197
- return openBlock(), createBlock(unref(_sfc_main$x), {
17597
+ return openBlock(), createBlock(unref(_sfc_main$B), {
17198
17598
  style: normalizeStyle({
17199
17599
  ...props.style,
17200
17600
  flexDirection: "row",
@@ -17242,7 +17642,7 @@ const _sfc_main$a = {
17242
17642
  -->
17243
17643
 
17244
17644
  */
17245
- const _sfc_main$9 = {
17645
+ const _sfc_main$d = {
17246
17646
  __name: "JsvRadarChart",
17247
17647
  props: {
17248
17648
  style: {
@@ -17486,7 +17886,7 @@ const JsvRippleShape = {
17486
17886
 
17487
17887
 
17488
17888
  */
17489
- const _sfc_main$8 = {
17889
+ const _sfc_main$c = {
17490
17890
  __name: "JsvRipple",
17491
17891
  props: {
17492
17892
  width: {
@@ -17660,7 +18060,7 @@ const JsvLine_vue_vue_type_style_index_0_scoped_10b9ebcf_lang = "";
17660
18060
 
17661
18061
 
17662
18062
  */
17663
- const _sfc_main$7 = {
18063
+ const _sfc_main$b = {
17664
18064
  __name: "JsvLine",
17665
18065
  props: {
17666
18066
  startPos: { type: Object, require: true },
@@ -17721,7 +18121,7 @@ const _sfc_main$7 = {
17721
18121
  };
17722
18122
  const styleSheetsContent = { "0": { "fadeIn-10b9ebcf": "@keyframes fadeIn-10b9ebcf {0%{opacity:0;}100%{opacity:1;}}", "fadeOut-10b9ebcf": "@keyframes fadeOut-10b9ebcf {0%{opacity:1;}100%{opacity:0;}}" } };
17723
18123
  window.JsvCode.Dom.DeclareStyleSheets(styleSheetsContent);
17724
- const JsvLine = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-10b9ebcf"]]);
18124
+ const JsvLine = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-10b9ebcf"]]);
17725
18125
 
17726
18126
  //
17727
18127
  // utils/JsViewVueWidget/JsvLine/index.js;
@@ -17747,7 +18147,7 @@ const JsvLine = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
17747
18147
 
17748
18148
 
17749
18149
  */
17750
- const _sfc_main$6 = {
18150
+ const _sfc_main$a = {
17751
18151
  __name: "JsvSector",
17752
18152
  props: {
17753
18153
  centerPosition: { type: Object, require: true },
@@ -17861,7 +18261,7 @@ const _sfc_main$6 = {
17861
18261
 
17862
18262
 
17863
18263
  */
17864
- const _sfc_main$5 = {
18264
+ const _sfc_main$9 = {
17865
18265
  __name: "JsvPieChart",
17866
18266
  props: {
17867
18267
  centerPosition: { type: Object, required: true },
@@ -17947,7 +18347,7 @@ const _sfc_main$5 = {
17947
18347
  }, [
17948
18348
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(finalData).slice().reverse(), (item, index) => {
17949
18349
  return openBlock(), createElementBlock("div", null, [
17950
- (openBlock(), createBlock(_sfc_main$6, {
18350
+ (openBlock(), createBlock(_sfc_main$a, {
17951
18351
  radius: props.radius,
17952
18352
  config: {
17953
18353
  startAngle: Number(item.startAngle),
@@ -18055,7 +18455,7 @@ class ConnectLineTexture {
18055
18455
 
18056
18456
 
18057
18457
  */
18058
- const _sfc_main$4 = {
18458
+ const _sfc_main$8 = {
18059
18459
  __name: "JsvConnectLine",
18060
18460
  props: {
18061
18461
  startPos: {
@@ -18241,6 +18641,9 @@ const _sfc_main$4 = {
18241
18641
  startPos3.x = props.isVertical ? props.endPos.x : InflectionPoint.x;
18242
18642
  startPos3.y = props.isVertical ? InflectionPoint.y + startPos3Extra : props.endPos.y;
18243
18643
  }
18644
+ onBeforeUnmount(() => {
18645
+ myLineTexture.UnRef();
18646
+ });
18244
18647
  return (_ctx, _cache) => {
18245
18648
  return unref(isOneDirection) ? (openBlock(), createElementBlock("div", { key: 0 }, [
18246
18649
  createVNode(unref(JsvLine), {
@@ -18323,7 +18726,7 @@ const _sfc_main$4 = {
18323
18726
 
18324
18727
 
18325
18728
  */
18326
- const _sfc_main$3 = {
18729
+ const _sfc_main$7 = {
18327
18730
  __name: "JsvProgressBar",
18328
18731
  props: {
18329
18732
  width: { type: Number, required: true },
@@ -18400,7 +18803,7 @@ const _sfc_main$3 = {
18400
18803
  return openBlock(), createElementBlock(Fragment, null, [
18401
18804
  props.isCanvas ? (openBlock(), createElementBlock("div", { key: 0 }, [
18402
18805
  withDirectives(createElementVNode("div", null, [
18403
- createVNode(_sfc_main$h, {
18806
+ createVNode(_sfc_main$l, {
18404
18807
  style: normalizeStyle({
18405
18808
  left: 0,
18406
18809
  top: 0,
@@ -18442,7 +18845,7 @@ const _sfc_main$3 = {
18442
18845
  }, null, 4)
18443
18846
  ], 4)
18444
18847
  ])),
18445
- createVNode(_sfc_main$h, {
18848
+ createVNode(_sfc_main$l, {
18446
18849
  style: normalizeStyle({
18447
18850
  left: 0,
18448
18851
  top: 0,
@@ -18467,7 +18870,7 @@ const _sfc_main$3 = {
18467
18870
  /*
18468
18871
 
18469
18872
  */
18470
- const _sfc_main$2 = {
18873
+ const _sfc_main$6 = {
18471
18874
  __name: "JsvEnableRenderBreak",
18472
18875
  setup(__props) {
18473
18876
  const itemMounted = shallowRef(false);
@@ -19684,7 +20087,7 @@ function multiSelect(arr, left, right, n, compare) {
19684
20087
 
19685
20088
 
19686
20089
  */
19687
- const _sfc_main$1 = {
20090
+ const _sfc_main$5 = {
19688
20091
  __name: "JsvMindMap",
19689
20092
  props: {
19690
20093
  name: {
@@ -20177,21 +20580,35 @@ const _sfc_main$1 = {
20177
20580
  //
20178
20581
  // utils/JsViewVueWidget/JsvScrollBox/ScrollSymbol.ts;
20179
20582
  //
20180
- const ScrollStyle = {
20583
+ const ScrollBoxStyle = {
20181
20584
  // 运动模式
20182
20585
  DrawerMode: Symbol("DrawerMode"),
20183
20586
  PinMode: Symbol("PinMode"),
20184
20587
  // 同步模式
20185
- SyncParallel: Symbol("AckParallel"),
20588
+ SyncForward: Symbol("SyncForward"),
20186
20589
  // 百分比完全对齐的同步模式
20187
- SyncRevert: Symbol("SyncRevert")
20590
+ SyncReverse: Symbol("SyncReverse"),
20188
20591
  // (1-百分比)的同步模式
20592
+ // Follow的同步模式
20593
+ Position: Symbol("Position"),
20594
+ Size: Symbol("Size"),
20595
+ // Follow的类型定义
20596
+ SizeDiv: Symbol("SizeDiv"),
20597
+ SizeClip: Symbol("SizeClip"),
20598
+ JsvNinePatch: Symbol("JsvNinePatch")
20599
+ };
20600
+
20601
+ //
20602
+ // utils/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.ts;
20603
+ //
20604
+ const ScrollInnerStyle = {
20605
+ UpdatePercentNexusCode: 10001
20189
20606
  };
20190
20607
 
20191
20608
  //
20192
20609
  // utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue?vue&type=script&setup=true&lang.ts;
20193
20610
  //
20194
- const _sfc_main = /* @__PURE__ */ defineComponent({
20611
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
20195
20612
  __name: "JsvScrollBox",
20196
20613
  props: {
20197
20614
  // 底座的尺寸
@@ -20211,11 +20628,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20211
20628
  require: true
20212
20629
  },
20213
20630
  // 滑块模式
20214
- // ScrollStyle.PinMode: 滑块小于底座
20215
- // ScrollStyle.DrawerMode: 滑块大于底座
20631
+ // ScrollBoxStyle.PinMode: 滑块小于底座
20632
+ // ScrollBoxStyle.DrawerMode: 滑块大于底座
20216
20633
  mode: {
20217
20634
  type: Symbol,
20218
- default: ScrollStyle.PinMode
20635
+ default: ScrollBoxStyle.PinMode
20219
20636
  },
20220
20637
  // 初始进度条的进度
20221
20638
  initPercent: {
@@ -20225,6 +20642,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20225
20642
  enableFling: {
20226
20643
  type: Boolean,
20227
20644
  default: false
20645
+ },
20646
+ linkName: {
20647
+ type: String,
20648
+ default: null
20649
+ },
20650
+ syncWith: {
20651
+ type: String,
20652
+ default: null
20653
+ },
20654
+ syncType: {
20655
+ type: Symbol,
20656
+ default: ScrollBoxStyle.SyncForward
20228
20657
  }
20229
20658
  },
20230
20659
  setup(__props, { expose }) {
@@ -20234,19 +20663,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20234
20663
  const cInitPercent = rProps.initPercent;
20235
20664
  const cEnableFling = rProps.enableFling;
20236
20665
  const cSliderActor = new ActorControl();
20237
- const cFixedBoxActor = cMode == ScrollStyle.PinMode ? new ActorControl() : null;
20666
+ const cFixedBoxActor = cMode == ScrollBoxStyle.PinMode ? new ActorControl() : null;
20667
+ const cLinkName = rProps.linkName;
20668
+ const cSyncLinkManager = GetSyncLinkManager();
20238
20669
  const cWallConditionGroup = 1;
20239
20670
  const cSensorConditionGroup = 2;
20671
+ const cLinkConditionGroup = 3;
20672
+ const cLinkMasterGroup = 4;
20240
20673
  let vMounted = false;
20241
20674
  let vHorizontalGap = 0;
20242
20675
  let vVerticalGap = 0;
20243
- let vSubSyncList = [];
20676
+ let vLinkProvide = null;
20677
+ let vWaitMasterLinkSourceReady = null;
20678
+ let vSyncWithNameCache = null;
20679
+ let vSyncTypeCache = ScrollBoxStyle.SyncForward;
20680
+ let vSyncLinkNexusNode = null;
20681
+ let vCurrentPercent = 0;
20244
20682
  let rFixedBoxWidth = shallowRef(NaN);
20245
20683
  let rFixedBoxHeight = shallowRef(NaN);
20246
20684
  let rFixedViewRef = shallowRef(null);
20247
20685
  let rSliderWidth = shallowRef(NaN);
20248
20686
  let rSliderHeight = shallowRef(NaN);
20249
20687
  let rSliderViewRef = shallowRef(null);
20688
+ let rSliderEdgeBox = {
20689
+ top: 0,
20690
+ bottom: 0,
20691
+ left: 0,
20692
+ right: 0
20693
+ };
20250
20694
  watchEffect(() => {
20251
20695
  let fixedBoxSize = {
20252
20696
  width: rProps.style.width,
@@ -20261,12 +20705,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20261
20705
  } else {
20262
20706
  sliderSize.height = fixedBoxSize.height;
20263
20707
  }
20264
- if (cMode == ScrollStyle.PinMode && (sliderSize.height > fixedBoxSize.height || sliderSize.width > fixedBoxSize.width)) {
20708
+ if (cMode == ScrollBoxStyle.PinMode && (sliderSize.height > fixedBoxSize.height || sliderSize.width > fixedBoxSize.width)) {
20265
20709
  console.error(
20266
20710
  `slider oversize in pin-mode bw=${fixedBoxSize.width} bh=${fixedBoxSize.height} sw=${sliderSize.width} sh=${sliderSize.height}`
20267
20711
  );
20268
20712
  return;
20269
- } else if (cMode == ScrollStyle.DrawerMode && (sliderSize.height < fixedBoxSize.height || sliderSize.width < fixedBoxSize.width)) {
20713
+ } else if (cMode == ScrollBoxStyle.DrawerMode && (sliderSize.height < fixedBoxSize.height || sliderSize.width < fixedBoxSize.width)) {
20270
20714
  console.error(
20271
20715
  `box oversize in drawer-mode bw=${fixedBoxSize.width} bh=${fixedBoxSize.height} sw=${sliderSize.width} sh=${sliderSize.height}`
20272
20716
  );
@@ -20279,41 +20723,134 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20279
20723
  rFixedBoxHeight.value = fixedBoxSize.height;
20280
20724
  rebuildSliderSet();
20281
20725
  }
20726
+ if (vSyncWithNameCache != rProps.syncWith || vSyncTypeCache != rProps.syncType) {
20727
+ vSyncWithNameCache = rProps.syncWith;
20728
+ vSyncTypeCache = rProps.syncType;
20729
+ changeSyncLink(vSyncWithNameCache);
20730
+ }
20282
20731
  });
20732
+ function changeSyncLink(newSyncSourceName) {
20733
+ vSyncLinkNexusNode = null;
20734
+ rebuildAckSync();
20735
+ if (newSyncSourceName != null) {
20736
+ vWaitMasterLinkSourceReady = cSyncLinkManager.WaitSourceMounted(newSyncSourceName).then(() => {
20737
+ vSyncLinkNexusNode = cSyncLinkManager.GetSourceNexusNode(newSyncSourceName);
20738
+ rebuildAckSync();
20739
+ });
20740
+ }
20741
+ }
20742
+ function rebuildAckSync() {
20743
+ if (!vMounted)
20744
+ return;
20745
+ cSliderActor.run((cmds) => {
20746
+ return [cmds.state().removeConditionByGroup(cLinkConditionGroup)];
20747
+ });
20748
+ if (vSyncLinkNexusNode != null) {
20749
+ cSliderActor.run((cmds) => {
20750
+ return [
20751
+ cmds.condition(cLinkConditionGroup, true).movementSync(vSyncLinkNexusNode).then([
20752
+ cmds.action().ackMovementSync(
20753
+ 0,
20754
+ vHorizontalGap,
20755
+ 0,
20756
+ vVerticalGap,
20757
+ 3,
20758
+ vSyncTypeCache == ScrollBoxStyle.SyncForward ? 1 : 2
20759
+ )
20760
+ ])
20761
+ ];
20762
+ });
20763
+ }
20764
+ }
20765
+ function rebuildSyncMaster() {
20766
+ if (vLinkProvide != null) {
20767
+ cSliderActor.run((cmds) => {
20768
+ return [
20769
+ cmds.state().removeConditionByGroup(cLinkMasterGroup),
20770
+ cmds.state().startMovementSync(
20771
+ vLinkProvide.nexusNode,
20772
+ 0,
20773
+ vHorizontalGap,
20774
+ 0,
20775
+ vVerticalGap,
20776
+ 3
20777
+ ),
20778
+ // 触发跟随节点记录进度
20779
+ cmds.condition(cLinkMasterGroup, true).onFlingEnd().then([
20780
+ cmds.state().fireNexusEvent(
20781
+ vLinkProvide.nexusNode,
20782
+ ScrollInnerStyle.UpdatePercentNexusCode
20783
+ )
20784
+ ]),
20785
+ // 触发跟随节点记录进度
20786
+ cmds.condition(cLinkMasterGroup, true).onDragEnd().then([
20787
+ cmds.state().fireNexusEvent(
20788
+ vLinkProvide.nexusNode,
20789
+ ScrollInnerStyle.UpdatePercentNexusCode
20790
+ )
20791
+ ])
20792
+ ];
20793
+ });
20794
+ }
20795
+ }
20283
20796
  function rebuildSliderSet() {
20797
+ vHorizontalGap = rFixedBoxWidth.value - rSliderWidth.value;
20798
+ vVerticalGap = rFixedBoxHeight.value - rSliderHeight.value;
20799
+ rSliderEdgeBox.left = vHorizontalGap > 0 ? 0 : vHorizontalGap;
20800
+ rSliderEdgeBox.top = vVerticalGap > 0 ? 0 : vVerticalGap;
20801
+ rSliderEdgeBox.right = vHorizontalGap < 0 ? 0 : vHorizontalGap;
20802
+ rSliderEdgeBox.bottom = vVerticalGap < 0 ? 0 : vVerticalGap;
20284
20803
  if (vMounted) {
20285
- vHorizontalGap = rFixedBoxWidth.value - rSliderWidth.value;
20286
- vVerticalGap = rFixedBoxHeight.value - rSliderHeight.value;
20287
- cSliderActor.run([
20288
- cSliderActor.state().removeConditionByGroup(cWallConditionGroup),
20289
- cSliderActor.condition(cWallConditionGroup, true).boxPosition(
20290
- vHorizontalGap > 0 ? 0 : vHorizontalGap,
20291
- // left
20292
- vVerticalGap > 0 ? 0 : vVerticalGap,
20293
- // top
20294
- vHorizontalGap < 0 ? 0 : vHorizontalGap,
20295
- // right
20296
- vVerticalGap < 0 ? 0 : vVerticalGap
20297
- // bottom
20298
- ).then([cSliderActor.action().stopMoving(true)])
20804
+ cSliderActor.run((cmds) => [
20805
+ cmds.state().removeConditionByGroup(cWallConditionGroup),
20806
+ cmds.condition(cWallConditionGroup, true).boxPosition(
20807
+ rSliderEdgeBox.left,
20808
+ rSliderEdgeBox.top,
20809
+ rSliderEdgeBox.right,
20810
+ rSliderEdgeBox.bottom
20811
+ ).then([cmds.action().stopMoving(true)]),
20812
+ // 跟进抬起时进度信息
20813
+ cmds.condition(cWallConditionGroup, true).onFlingEnd().then([
20814
+ (pointInfo) => {
20815
+ vCurrentPercent = positionToPercent(pointInfo);
20816
+ }
20817
+ ]),
20818
+ // 跟进fling结束时的进度信息
20819
+ cmds.condition(cWallConditionGroup, true).onDragEnd().then([
20820
+ (pointInfo) => {
20821
+ vCurrentPercent = positionToPercent(pointInfo);
20822
+ }
20823
+ ])
20299
20824
  ]);
20825
+ rebuildSyncMaster();
20826
+ rebuildAckSync();
20300
20827
  }
20301
20828
  }
20302
20829
  function setSensor(callback, sensitivity) {
20303
- cSliderActor.run([
20304
- cSliderActor.state().removeConditionByGroup(cSensorConditionGroup)
20830
+ cSliderActor.run((cmds) => [
20831
+ cmds.state().removeConditionByGroup(cSensorConditionGroup)
20305
20832
  ]);
20306
20833
  if (callback != null) {
20307
- cSliderActor.run([
20308
- cSliderActor.condition(cSensorConditionGroup, true).onMovement(sensitivity).then([
20834
+ cSliderActor.run((cmds) => [
20835
+ cmds.condition(cSensorConditionGroup, true).onMovement(sensitivity).then([
20309
20836
  (pointInfo) => {
20310
- let percent = cDirection == HORIZONTAL ? pointInfo.xPos / vHorizontalGap : pointInfo.yPos / vVerticalGap;
20837
+ let percent = positionToPercent(pointInfo);
20838
+ vCurrentPercent = percent;
20311
20839
  callback(percent, pointInfo.xPos, pointInfo.yPos);
20312
20840
  }
20313
20841
  ])
20314
20842
  ]);
20315
20843
  }
20316
20844
  }
20845
+ function positionToPercent(pointInfo) {
20846
+ let percent = 0;
20847
+ if (cDirection == HORIZONTAL) {
20848
+ percent = vHorizontalGap != 0 ? pointInfo.xPos / vHorizontalGap : 0;
20849
+ } else {
20850
+ percent = vVerticalGap != 0 ? pointInfo.yPos / vVerticalGap : 0;
20851
+ }
20852
+ return percent;
20853
+ }
20317
20854
  function updatePercent(percent) {
20318
20855
  let xPos = 0;
20319
20856
  let yPos = 0;
@@ -20322,7 +20859,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20322
20859
  } else {
20323
20860
  yPos = Math.floor(percent * vVerticalGap);
20324
20861
  }
20325
- cSliderActor.run([cSliderActor.action().teleportTo(xPos, yPos)]);
20862
+ cSliderActor.run((cmds) => [cmds.action().teleportTo(xPos, yPos)]);
20863
+ vCurrentPercent = percent;
20864
+ }
20865
+ function currentPercent() {
20866
+ return vCurrentPercent;
20326
20867
  }
20327
20868
  onMounted(() => {
20328
20869
  vMounted = true;
@@ -20338,15 +20879,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20338
20879
  let fixedBoxView = rFixedViewRef.value.jsvGetProxyView();
20339
20880
  cFixedBoxActor.bindForgeView(fixedBoxView, true);
20340
20881
  fixedBoxView.DragEnables?.(ForgeConst.DragFlags.TOUCH_RECV_FIRST_START);
20341
- cFixedBoxActor.run([
20342
- cFixedBoxActor.state().setTouchAttractChild(cSliderActor)
20882
+ cFixedBoxActor.run((cmds) => [
20883
+ cmds.state().setTouchAttractChild(cSliderActor)
20343
20884
  ]);
20344
20885
  }
20886
+ if (cLinkName != null) {
20887
+ vLinkProvide = new SyncLinkSource(cLinkName, newNexus());
20888
+ rebuildSyncMaster();
20889
+ cSyncLinkManager.SourceOnMounted(vLinkProvide);
20890
+ }
20345
20891
  rebuildSliderSet();
20346
20892
  });
20893
+ onUnmounted(() => {
20894
+ if (vLinkProvide != null) {
20895
+ cSyncLinkManager.SourceOnUnmounted(cLinkName);
20896
+ vLinkProvide = null;
20897
+ }
20898
+ if (vWaitMasterLinkSourceReady != null) {
20899
+ cSyncLinkManager.UnListen(vWaitMasterLinkSourceReady);
20900
+ vWaitMasterLinkSourceReady = null;
20901
+ }
20902
+ });
20347
20903
  expose({
20348
20904
  setSensor,
20349
- updatePercent
20905
+ updatePercent,
20906
+ currentPercent
20350
20907
  });
20351
20908
  return (_ctx, _cache) => {
20352
20909
  return openBlock(), createElementBlock("div", {
@@ -20399,16 +20956,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20399
20956
  * width {number}, 当VERTICAL滑动模式时为选填,HORIZONTAL为必填
20400
20957
  * height {number}, 当HORIZONTAL滑动模式时为选填,VERTICAL为必填
20401
20958
  * }
20402
- * mode {ScrollStyle.DrawerMode/ScrollStyle.PinMode}
20959
+ * mode {ScrollBoxStyle.DrawerMode/ScrollBoxStyle.PinMode}
20403
20960
  * 选填, 非响应式, 默认为 PinMode
20404
20961
  * 运动模式选择, DrawerMode: 抽屉模式,内容尺寸大于固定底座
20405
20962
  * PinMode: 滚动杆模式,内容尺寸小于固定底座
20406
20963
  * direction {import VERTICAL/HORIZONTAL} (必填,非响应式) 滑动方向
20407
20964
  * enableFling {boolean} (选填,非响应式) 是否需要支持fling,默认为false
20408
20965
  * initPercent {Number} (选填,非响应式) 滑块起始位置,等同于mount后进行updatePercent()
20966
+ * linkName {String} (选填,非响应式) 本滑动模块的名字,用于全局进行syncWith处理的关联名
20967
+ * 注意: 如果不需要共享进度,不要声明,可以节省一些构造性能
20968
+ * syncWith {String} (选填,响应式) 进度联动组件来源,内容为联动来源的linkName
20969
+ * syncType {ScrollBoxStyle.SyncForward|ScrollType.SyncReverse}
20970
+ * (选填,响应式) 决定syncWith的联动模式,当syncWith设置后才能生效
20971
+ * SyncForward(默认值): 同进同退, mySelf = sourcePercent
20972
+ * SyncReverse: 进退反向, mySelf = (1 - sourcePercent)
20409
20973
  *
20410
20974
  * template说明:
20411
- * FfixedBox={boxWidth, boxHeight}: 以本组件底座左上角0,0对齐的一个slot
20975
+ * FixedBox={boxWidth, boxHeight}: 以本组件底座左上角0,0对齐的一个slot
20412
20976
  * SliderBox={boxWidth, boxHeight}: 以滑块div的左上角0,0对齐的一个slot,
20413
20977
  *
20414
20978
  * expose函数说明:
@@ -20417,28 +20981,645 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20417
20981
  * updatePercent(percent:number) 设置滚动调位置(百分比),百分比 = (SliderTop - 底座Top) / Slider可滑动总区域
20418
20982
  * Slider可滑动总区域 = 底座Height - SliderHeight
20419
20983
  * 当为横向运动时,Top被Left代换,Height被Width代换
20420
- * syncWith(otherScrollBox: JsvScrollBox, syncMode: ScrollStyle)
20421
- * 本滚动条的进度跟随给定的滚动条的进度移动
20422
- * otherScrollBox: 控制者
20423
- * syncMode: 同步模式,有 SyncParallel, SyncRevert
20424
- * addSubSync(view: div|JsvNinePatch, syncMode: ScrollStyle)
20425
- * 将外部的div或者JsvNinePatch加入到同步尺寸同步改动器中。
20426
- * view只能是div或者JsvNinePatch, 并且不能有style.animation的控制
20427
- * 当SyncParallel模式时, 这个div的初始位置要和本组件的0,0对齐
20428
- * 当SyncRevert模式时, 这个div的初始位置要和本组件尾部位置(0, height/width)对齐
20429
20984
  *
20985
+ -->
20986
+
20987
+
20988
+
20989
+
20990
+
20991
+
20992
+ */
20993
+
20994
+ //
20995
+ // utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue?vue&type=script&setup=true&lang.ts;
20996
+ //
20997
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
20998
+ __name: "JsvScrollFollow",
20999
+ props: {
21000
+ proxyType: null,
21001
+ proxyProps: null,
21002
+ varLeft: { default: 0 },
21003
+ varTop: { default: 0 },
21004
+ varWidth: { default: 0 },
21005
+ varHeight: { default: 0 },
21006
+ syncWith: null,
21007
+ syncType: { default: ScrollBoxStyle.SyncForward }
21008
+ },
21009
+ setup(__props, { expose }) {
21010
+ const rProps = __props;
21011
+ const cProxyType = rProps.proxyType;
21012
+ const cVarMode = ScrollBoxStyle.Size;
21013
+ const cSyncLinkManager = GetSyncLinkManager();
21014
+ const cSliderActor = new ActorControl();
21015
+ const cSensorConditionGroup = 1;
21016
+ const cLinkConditionGroup = 2;
21017
+ let vSyncWithNameCache = null;
21018
+ let vSyncTypeCache = ScrollBoxStyle.SyncForward;
21019
+ let vWaitMasterLinkSourceReady = null;
21020
+ let vSyncLinkNexusNode = null;
21021
+ let vTargetViewReady = false;
21022
+ let vCurrentPercent = 0;
21023
+ let vMainDivTop = {
21024
+ start: NaN,
21025
+ end: NaN
21026
+ };
21027
+ let vMainDivLeft = {
21028
+ start: NaN,
21029
+ end: NaN
21030
+ };
21031
+ let vMainDivWidth = {
21032
+ start: NaN,
21033
+ end: NaN
21034
+ };
21035
+ let vMainDivHeight = {
21036
+ start: NaN,
21037
+ end: NaN
21038
+ };
21039
+ let rSliderViewRef = shallowRef(null);
21040
+ let rSizeClipOutProps = shallowRef(null);
21041
+ let rSizeClipInnerProps = shallowRef(null);
21042
+ let rNinePatchMergedProps = shallowRef(null);
21043
+ let rSizeDivProps = shallowRef(null);
21044
+ function resetPosSizeInfo(source, varRef, allowVar) {
21045
+ let tmpVal = { start: 0, end: 0 };
21046
+ if (typeof source == "number") {
21047
+ tmpVal.start = source;
21048
+ tmpVal.end = source;
21049
+ } else {
21050
+ tmpVal.start = source.start ? source.start : 0;
21051
+ tmpVal.end = source.end ? source.end : 0;
21052
+ }
21053
+ if (tmpVal.start != varRef.start || tmpVal.end != varRef.start) {
21054
+ varRef.start = tmpVal.start;
21055
+ varRef.end = tmpVal.end;
21056
+ if (varRef.start != varRef.end && allowVar) {
21057
+ if (!allowVar) {
21058
+ return false;
21059
+ }
21060
+ }
21061
+ return true;
21062
+ } else {
21063
+ return false;
21064
+ }
21065
+ }
21066
+ watchEffect(() => {
21067
+ let reactChangedMerged = false;
21068
+ {
21069
+ let changed = false;
21070
+ changed = resetPosSizeInfo(
21071
+ rProps.varTop,
21072
+ vMainDivTop,
21073
+ cVarMode == ScrollBoxStyle.Position
21074
+ );
21075
+ reactChangedMerged ||= changed;
21076
+ changed = resetPosSizeInfo(
21077
+ rProps.varLeft,
21078
+ vMainDivLeft,
21079
+ cVarMode == ScrollBoxStyle.Position
21080
+ );
21081
+ reactChangedMerged ||= changed;
21082
+ changed = resetPosSizeInfo(
21083
+ rProps.varWidth,
21084
+ vMainDivWidth,
21085
+ cVarMode == ScrollBoxStyle.Size
21086
+ );
21087
+ reactChangedMerged ||= changed;
21088
+ changed = resetPosSizeInfo(
21089
+ rProps.varHeight,
21090
+ vMainDivHeight,
21091
+ cVarMode == ScrollBoxStyle.Size
21092
+ );
21093
+ reactChangedMerged ||= changed;
21094
+ }
21095
+ if (reactChangedMerged) {
21096
+ rebuildAckSync();
21097
+ }
21098
+ if (vSyncWithNameCache != rProps.syncWith || vSyncTypeCache != rProps.syncType) {
21099
+ vSyncWithNameCache = rProps.syncWith;
21100
+ vSyncTypeCache = rProps.syncType;
21101
+ changeSyncLink(vSyncWithNameCache);
21102
+ }
21103
+ {
21104
+ let divStyle = {
21105
+ // 对应模式的动态变量设置为0(width/height设置为100为了进行测试),否则使用其start作为固定值
21106
+ top: cVarMode == ScrollBoxStyle.Position ? 0 : vMainDivTop.start,
21107
+ left: cVarMode == ScrollBoxStyle.Position ? 0 : vMainDivLeft.start,
21108
+ width: cVarMode == ScrollBoxStyle.Size ? 0 : vMainDivWidth.start,
21109
+ height: cVarMode == ScrollBoxStyle.Size ? 0 : vMainDivHeight.start
21110
+ };
21111
+ switch (cProxyType) {
21112
+ case ScrollBoxStyle.SizeClip:
21113
+ {
21114
+ if (rProps.proxyProps) {
21115
+ console.warn("clipDiv not support proxyProps");
21116
+ }
21117
+ rSizeClipOutProps.value = {
21118
+ style: {
21119
+ top: divStyle.top,
21120
+ left: divStyle.left
21121
+ }
21122
+ };
21123
+ rSizeClipInnerProps.value = {
21124
+ style: {
21125
+ width: divStyle.width,
21126
+ height: divStyle.height,
21127
+ overflow: "hidden"
21128
+ },
21129
+ "data-jsv-vw-mmask-drift": "true"
21130
+ // 将clip视窗做成drift模式
21131
+ };
21132
+ }
21133
+ break;
21134
+ case ScrollBoxStyle.JsvNinePatch:
21135
+ {
21136
+ rNinePatchMergedProps.value = {
21137
+ ...rProps.proxyProps,
21138
+ style: {
21139
+ ...divStyle
21140
+ }
21141
+ };
21142
+ }
21143
+ break;
21144
+ case ScrollBoxStyle.SizeDiv:
21145
+ {
21146
+ let proxyStyle = null;
21147
+ if (rProps.proxyProps?.style) {
21148
+ proxyStyle = rProps.proxyProps?.style;
21149
+ }
21150
+ rProps.proxyProps;
21151
+ rSizeDivProps.value = {
21152
+ style: {
21153
+ ...proxyStyle,
21154
+ ...divStyle
21155
+ }
21156
+ };
21157
+ }
21158
+ break;
21159
+ default:
21160
+ console.error("unknown proxy type=" + cProxyType?.toString());
21161
+ return;
21162
+ }
21163
+ }
21164
+ });
21165
+ function changeSyncLink(newSyncSourceName) {
21166
+ vSyncLinkNexusNode = null;
21167
+ rebuildAckSync();
21168
+ if (newSyncSourceName != null) {
21169
+ vWaitMasterLinkSourceReady = cSyncLinkManager.WaitSourceMounted(newSyncSourceName).then(() => {
21170
+ vSyncLinkNexusNode = cSyncLinkManager.GetSourceNexusNode(newSyncSourceName);
21171
+ rebuildAckSync();
21172
+ });
21173
+ }
21174
+ }
21175
+ function rebuildAckSync() {
21176
+ if (!vTargetViewReady)
21177
+ return;
21178
+ cSliderActor.run((cmds) => [
21179
+ cmds.state().removeConditionByGroup(cLinkConditionGroup)
21180
+ ]);
21181
+ if (vSyncLinkNexusNode != null) {
21182
+ let vertSet, horiSet;
21183
+ if (cVarMode == ScrollBoxStyle.Position) {
21184
+ vertSet = vMainDivTop;
21185
+ horiSet = vMainDivLeft;
21186
+ } else {
21187
+ vertSet = vMainDivHeight;
21188
+ horiSet = vMainDivWidth;
21189
+ }
21190
+ cSliderActor.run((cmds) => [
21191
+ cmds.condition(cLinkConditionGroup, true).movementSync(vSyncLinkNexusNode).then([
21192
+ cmds.action().ackMovementSync(
21193
+ horiSet.start,
21194
+ horiSet.end,
21195
+ vertSet.start,
21196
+ vertSet.end,
21197
+ 3,
21198
+ vSyncTypeCache == ScrollBoxStyle.SyncForward ? 1 : 2
21199
+ )
21200
+ ]),
21201
+ cmds.condition(cLinkConditionGroup, true).onNexusEvent(
21202
+ vSyncLinkNexusNode,
21203
+ ScrollInnerStyle.UpdatePercentNexusCode
21204
+ ).then([
21205
+ (pointInfo) => {
21206
+ vCurrentPercent = positionToPercent(pointInfo);
21207
+ }
21208
+ ])
21209
+ ]);
21210
+ }
21211
+ }
21212
+ function setSensor(callback, sensitivity) {
21213
+ cSliderActor.run((cmds) => [
21214
+ cmds.state().removeConditionByGroup(cSensorConditionGroup)
21215
+ ]);
21216
+ if (callback != null) {
21217
+ cSliderActor.run((cmds) => [
21218
+ cmds.condition(cSensorConditionGroup, true).onMovement(sensitivity).then([
21219
+ (pointInfo) => {
21220
+ let percent = positionToPercent(pointInfo);
21221
+ vCurrentPercent = percent;
21222
+ callback(percent, pointInfo.xPos, pointInfo.yPos);
21223
+ }
21224
+ ])
21225
+ ]);
21226
+ }
21227
+ }
21228
+ function positionToPercent(pointInfo) {
21229
+ let percent = 0;
21230
+ if (cVarMode == ScrollBoxStyle.Position) {
21231
+ if (vMainDivTop.start != vMainDivTop.end) {
21232
+ percent = pointInfo.yPos / (vMainDivTop.end - vMainDivTop.start);
21233
+ } else if (vMainDivLeft.start != vMainDivLeft.end) {
21234
+ percent = pointInfo.xPos / (vMainDivLeft.end - vMainDivLeft.start);
21235
+ }
21236
+ } else {
21237
+ if (vMainDivHeight.start != vMainDivHeight.end) {
21238
+ percent = pointInfo.yPos / (vMainDivHeight.end - vMainDivHeight.start);
21239
+ } else if (vMainDivWidth.start != vMainDivWidth.end) {
21240
+ percent = pointInfo.xPos / (vMainDivWidth.end - vMainDivWidth.start);
21241
+ }
21242
+ }
21243
+ return percent;
21244
+ }
21245
+ function onNinePatchRef(divRef) {
21246
+ rSliderViewRef.value = divRef;
21247
+ initViewControl();
21248
+ }
21249
+ function initViewControl() {
21250
+ if (rSliderViewRef.value == null) {
21251
+ return;
21252
+ }
21253
+ if (vTargetViewReady) {
21254
+ return;
21255
+ }
21256
+ vTargetViewReady = true;
21257
+ let sliderView = rSliderViewRef.value.jsvGetProxyView(
21258
+ cProxyType != ScrollBoxStyle.SizeDiv
21259
+ );
21260
+ if (cVarMode == ScrollBoxStyle.Size) {
21261
+ cSliderActor.asSizeMode();
21262
+ }
21263
+ cSliderActor.bindForgeView(sliderView, true);
21264
+ rebuildAckSync();
21265
+ }
21266
+ function currentPercent() {
21267
+ return vCurrentPercent;
21268
+ }
21269
+ onMounted(() => {
21270
+ initViewControl();
21271
+ });
21272
+ onUnmounted(() => {
21273
+ if (vWaitMasterLinkSourceReady != null) {
21274
+ cSyncLinkManager.UnListen(vWaitMasterLinkSourceReady);
21275
+ vWaitMasterLinkSourceReady = null;
21276
+ }
21277
+ });
21278
+ expose({
21279
+ setSensor,
21280
+ currentPercent
21281
+ });
21282
+ return (_ctx, _cache) => {
21283
+ return unref(cProxyType) == unref(ScrollBoxStyle).SizeClip ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(rSizeClipOutProps))), [
21284
+ createElementVNode("div", mergeProps({
21285
+ ref_key: "rSliderViewRef",
21286
+ ref: rSliderViewRef
21287
+ }, unref(rSizeClipInnerProps)), [
21288
+ createElementVNode("div", { "data-jsv-vw-mask-dock": "true" }, [
21289
+ renderSlot(_ctx.$slots, "default")
21290
+ ])
21291
+ ], 16)
21292
+ ], 16)) : unref(cProxyType) == unref(ScrollBoxStyle).SizeDiv ? (openBlock(), createElementBlock("div", mergeProps({
21293
+ key: 1,
21294
+ ref_key: "rSliderViewRef",
21295
+ ref: rSliderViewRef
21296
+ }, unref(rSizeDivProps)), null, 16)) : unref(cProxyType) == unref(ScrollBoxStyle).JsvNinePatch ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
21297
+ key: 2,
21298
+ onDivRef: onNinePatchRef
21299
+ }, unref(rNinePatchMergedProps)), null, 16)) : createCommentVNode("", true);
21300
+ };
21301
+ }
21302
+ });
21303
+
21304
+ //
21305
+ // utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue;
21306
+ //
21307
+ /* <!--
21308
+ * 【模块 export 内容】
21309
+ * JsvScrollFollow:Vue高阶组件,响应并同步JsvScrollBox的移动的div/ninePatch特殊类型的进度展示组件
21310
+ * props说明:
21311
+ * proxyType {ScorllBoxStyle.*} (必填,非响应式!!) 下面的几个类型中选一种:
21312
+ SizeDiv: 一个普通的div, 进度信息影响div的width/height, proxyProps里面主要设置backgroundColor
21313
+ SizeClip: 对子内容进行剪切的div, 此类型不支持proxyProps的设置, 只有varWidth和varHeight能为变量
21314
+ (本组件会额外赋予overflow:hidden, 以及剪切区域自由移动的data-jsv-vw-mask-separate)
21315
+ JsvNinePatch: JsvNinePatch组件类型
21316
+ * proxyProps {Object} (选填,响应式) 传给代理类型的props,例如JsvNinePatch时,JsvNinePatch的props设置
21317
+ * varLeft/varTop/varWidth/varHeight(number|Object):
21318
+ (选填, 但至少有一个值, 响应式) 当为number时为固定值,
21319
+ TODO: 响应式改动后立即同步进度处理还没完成
21320
+ 为Object时必须是{start:number, end:number}格式
21321
+ 其中start对应 JsvScrollBox 进度起始值时的位置,end对应 JsvScrollBox 进度终点值的位置
21322
+ 特别注意: left/Top, width/height分别是两种变换,不能这两组不能同时都为变值
21323
+ * syncWith {String} (必填,响应式) 进度联动组件来源,内容为联动来源的linkName
21324
+ * syncType {ScrollBoxStyle.*}
21325
+ * (选填,响应式) 决定syncWith的联动模式,当syncWith设置后才能生效, 默认为 SyncForward
21326
+ * SyncForward(默认值): 同进同退, mySelf = sourcePercent
21327
+ * SyncReverse: 进退反向, mySelf = (1 - sourcePercent)
21328
+ *
21329
+ * template说明:
21330
+ 当proxyType为clipDiv可以放置
21331
+
21332
+
21333
+
21334
+
21335
+ */
21336
+
21337
+ //
21338
+ // utils/JsViewVueWidget/JsvScrollBox/index.ts;
21339
+ //
21340
+
21341
+ //
21342
+ // utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue;
21343
+ //
21344
+ /* <!--
21345
+ [模块 export 内容]
21346
+ JsvFragShaderView:自定义Fragment shader的组件
21347
+ props说明:
21348
+ style {Object} (必填)left, top, width, height
21349
+ shaderStr {String} (必填)shader的函数体
21350
+ duration {int} 动画时长
21351
+ autoplay {boolean} 自动播放
21352
+ uniforms {Array} uniform参数, [{ name: string, value: number }]
21353
+ textures {Array} texture参数, [{ name: string, resource: string }]
21354
+ methods:
21355
+ startAnim
21356
+ @description 开始动画
21357
+ @params {int} duration: 动画时长, 默认为props.duration
21358
+ stopAnim
21359
+ @description 停止动画
21360
+ shader函数体说明:
21361
+ 参考网站: https://www.shadertoy.com
21362
+ 主函数:
21363
+ void mainImage( out vec4 fragColor, in vec2 fragCoord )
21364
+ @params {vec4} fragColor: 输出的片元颜色
21365
+ @params {vec2} fragCoord: 片元坐标, 左下角为原点, 往右为x正, 往上为y正
21366
+ 注意事项:
21367
+ * 盒子端使用OpenGL ES 2.0版本, 而网站 https://www.shadertoy.com 上使用WebGL, glsl支持的函数和操作符有区别.
21368
+ * 由于坐标系的差异, texture()采样函数需要替换为jsvTexture2D()
21369
+ * 盒子端的精度有限, 可能会出现精度导致的计算错误
21370
+
21371
+ -->
21372
+
21373
+
21374
+ */
21375
+ const _sfc_main$2 = {
21376
+ __name: "JsvFragShaderView",
21377
+ props: {
21378
+ style: {
21379
+ type: Object,
21380
+ required: true
21381
+ },
21382
+ duration: {
21383
+ type: Number,
21384
+ default: -1
21385
+ },
21386
+ autoplay: {
21387
+ type: Boolean,
21388
+ default: false
21389
+ },
21390
+ shaderStr: {
21391
+ type: String,
21392
+ required: true
21393
+ },
21394
+ // [{ name: string, value: number }]
21395
+ uniforms: {
21396
+ type: Array
21397
+ },
21398
+ // [{ name: string, type: number, resource: string }]
21399
+ textures: {
21400
+ type: Array
21401
+ }
21402
+ },
21403
+ setup(__props, { expose }) {
21404
+ const props = __props;
21405
+ let uniformList = [];
21406
+ if (props.uniforms) {
21407
+ for (let item of props.uniforms) {
21408
+ uniformList.push({
21409
+ name: item.name,
21410
+ type: 1,
21411
+ value: item.value
21412
+ });
21413
+ }
21414
+ }
21415
+ let textureList = [];
21416
+ if (props.textures) {
21417
+ const texture_manager = handles.TextureManager;
21418
+ for (let item of props.textures) {
21419
+ if (typeof item.resource == "string") {
21420
+ let image_url = item.resource;
21421
+ if (item.resource && item.resource.trim().indexOf("url(") === 0) {
21422
+ image_url = new window.JsView.Dom.UrlRef(image_url).href;
21423
+ }
21424
+ const texture = texture_manager.GetImage2(
21425
+ image_url,
21426
+ false,
21427
+ null,
21428
+ "RGB_8888",
21429
+ null
21430
+ );
21431
+ textureList.push({
21432
+ name: item.name,
21433
+ id: texture.TexId
21434
+ });
21435
+ }
21436
+ }
21437
+ }
21438
+ const fragShaderView = new Forge$2.FragShaderView();
21439
+ fragShaderView.SetShaderInfo(
21440
+ props.shaderStr,
21441
+ uniformList,
21442
+ textureList,
21443
+ (state, detail) => {
21444
+ console.log("haha", state, detail);
21445
+ }
21446
+ );
21447
+ let viewId = Forge$2.sViewStore.add(new Forge$2.ViewInfo(fragShaderView, ""));
21448
+ const { left, top, width, height } = props.style;
21449
+ const startAnim = (d) => {
21450
+ let duration = typeof d == "number" ? d : props.duration;
21451
+ if (duration > 0) {
21452
+ let shaderAnimation = new Forge$2.ShaderAnimation(duration, null);
21453
+ fragShaderView.StartAnimation(shaderAnimation);
21454
+ }
21455
+ };
21456
+ const stopAnim = () => {
21457
+ fragShaderView?.StopAnimation();
21458
+ };
21459
+ onMounted(() => {
21460
+ if (props.autoplay) {
21461
+ startAnim(props.duration);
21462
+ }
21463
+ });
21464
+ onBeforeUnmount(() => {
21465
+ if (viewId != -1) {
21466
+ Forge$2.sViewStore.remove(viewId);
21467
+ viewId = -1;
21468
+ }
21469
+ });
21470
+ expose({
21471
+ startAnim,
21472
+ stopAnim
21473
+ });
21474
+ return (_ctx, _cache) => {
21475
+ return openBlock(), createElementBlock("div", {
21476
+ style: normalizeStyle({ left: unref(left), top: unref(top), width: unref(width), height: unref(height) }),
21477
+ "data-jsv-vw-innerview": unref(viewId)
21478
+ }, null, 12, ["data-jsv-vw-innerview"]);
21479
+ };
21480
+ }
21481
+ };
21482
+
21483
+ //
21484
+ // utils/JsViewVueWidget/JsvFragShaderView/index.js;
21485
+ //
21486
+ // 考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
21487
+ let _JsvFragShaderView;
21488
+ if (window.JsView) {
21489
+ _JsvFragShaderView = _sfc_main$2;
21490
+ } else {
21491
+ const BrowserJsvFragShaderView = await import('./browser/BrowserJsvFragShaderView.vue.mjs');
21492
+ _JsvFragShaderView = BrowserJsvFragShaderView.default;
21493
+ }
21494
+ const _JsvFragShaderView$1 = _JsvFragShaderView;
21495
+
21496
+ //
21497
+ // utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue?vue&type=script&setup=true&lang.ts;
21498
+ //
21499
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
21500
+ __name: "JsvClipDiv",
21501
+ props: {
21502
+ style: null
21503
+ },
21504
+ setup(__props) {
21505
+ const rProps = __props;
21506
+ let rMergedDivProps = shallowRef({});
21507
+ watchEffect(() => {
21508
+ let divStyle = {
21509
+ ...rProps.style,
21510
+ overflow: "hidden"
21511
+ };
21512
+ rMergedDivProps.value = {
21513
+ style: divStyle
21514
+ };
21515
+ });
21516
+ return (_ctx, _cache) => {
21517
+ return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(rMergedDivProps))), [
21518
+ renderSlot(_ctx.$slots, "default")
21519
+ ], 16);
21520
+ };
21521
+ }
21522
+ });
21523
+
21524
+ //
21525
+ // utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue;
21526
+ //
21527
+ /* <!--
21528
+ * 【模块 export 内容】
21529
+ * JsvClipDiv: Vue高阶组件,overhidden:true的div,附带有其他clip设定能力
21530
+ * props说明:
21531
+ style: {Object} (必选, 响应式) 同div的style, 提供top, left, width, height, transition, transform信息,
21532
+ 但目前不支持borderRaduis
21533
+ *
21534
+ * expose函数说明:
20430
21535
  *
20431
21536
  -->
20432
21537
 
20433
21538
 
20434
21539
 
20435
21540
 
21541
+ */
21542
+
21543
+ //
21544
+ // utils/JsViewVueWidget/JsvClipDiv/index.ts;
21545
+ //
21546
+
21547
+ //
21548
+ // utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue?vue&type=script&setup=true&lang.ts;
21549
+ //
21550
+ const _sfc_main = /* @__PURE__ */ defineComponent({
21551
+ __name: "JsvDriftScope",
21552
+ props: {
21553
+ top: { default: 0 },
21554
+ left: { default: 0 },
21555
+ frameStyle: null,
21556
+ scopeStyle: null
21557
+ },
21558
+ setup(__props) {
21559
+ const rProps = __props;
21560
+ const rMergedFrameStyle = shallowRef({});
21561
+ watchEffect(() => {
21562
+ rMergedFrameStyle.value = {
21563
+ ...rProps.frameStyle
21564
+ };
21565
+ });
21566
+ return (_ctx, _cache) => {
21567
+ return openBlock(), createElementBlock("div", {
21568
+ style: normalizeStyle({
21569
+ top: rProps.top,
21570
+ left: rProps.left
21571
+ })
21572
+ }, [
21573
+ createElementVNode("div", {
21574
+ style: normalizeStyle(unref(rMergedFrameStyle)),
21575
+ "data-jsv-vw-mask-drift": "true"
21576
+ }, [
21577
+ createVNode(_sfc_main$1, {
21578
+ style: normalizeStyle(rProps.scopeStyle)
21579
+ }, {
21580
+ default: withCtx(() => [
21581
+ createElementVNode("div", { "data-jsv-vw-mask-dock": "true" }, [
21582
+ renderSlot(_ctx.$slots, "Scene")
21583
+ ])
21584
+ ]),
21585
+ _: 3
21586
+ }, 8, ["style"]),
21587
+ renderSlot(_ctx.$slots, "Frame")
21588
+ ], 4)
21589
+ ], 4);
21590
+ };
21591
+ }
21592
+ });
21593
+
21594
+ //
21595
+ // utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue;
21596
+ //
21597
+ /* <!--
21598
+ * 【模块 export 内容】
21599
+ * JsvDriftScope: Vue高阶组件,放大镜或者望远镜效果, 分为 frame 区域和 scene 区域,frame是游离的ClipView, scene是被Clip部分
21600
+ * props说明:
21601
+ top {Number} (可选, 响应式)组件的top, 不填写时默认值为0
21602
+ left {Number} (可选, 响应式)组件的left, 不填写时默认值为0
21603
+ frameStyle: {Object} (可选, 响应式) 透视(裁剪)区域外框的style, 此层次无色透明,但是决定Frame层的变化, 支持以下属性
21604
+ {top, left, width, height, transition, animation, transform, transformOrigin}
21605
+ scopeStyle: {Object} (必选, 响应式) 透视(裁剪)区域的div的尺寸style, 会叠加frameStyle已经做的形变, 支持以下属性
21606
+ {width, height, transition, animation, transform, transformOrigin}
21607
+ 做动画时,frameStyle负责位置变化,scope则主要负责尺寸变化
21608
+ *
21609
+ * template说明:
21610
+ Frame 透视窗(裁剪层)的外框的装饰层
21611
+ Scene 被透视的内容
21612
+ * expose函数说明:
21613
+ *
21614
+ -->
21615
+
21616
+
20436
21617
 
20437
21618
 
20438
21619
  */
20439
21620
 
20440
21621
  //
20441
- // utils/JsViewVueWidget/JsvScrollBox/index.js;
21622
+ // utils/JsViewVueWidget/JsvDriftScope/index.ts;
20442
21623
  //
20443
21624
 
20444
21625
  //
@@ -20449,4 +21630,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20449
21630
  // utils/index.js;
20450
21631
  //
20451
21632
 
20452
- export { BaseDispatcher, DECORATE_BORDER_RADIUS, DECORATE_NINEPATCH_ALPHA_MIX, DebugObjectRefer, DebugTools, DebugWrap81ErrorStack, DebugWrap81WarnStack, DefaultKeyCodeMap, EdgeDirection, FixPositionSlide, FocusMoveType, ForgeConst, FreeMoveDef, FreeMoveFunc, HORIZONTAL, InputType, instance as JSBridge, JsvAccount, _sfc_main$A as JsvActorMove, JsvActorMoveControl, _JsvApic$1 as JsvApic, _JsvApic2$1 as JsvApic2, _sfc_main$D as JsvAudio, _sfc_main$4 as JsvConnectLine, _sfc_main$2 as JsvEnableRenderBreak, _sfc_main$y as JsvEnvBlocker, JsvFederationTools, _sfc_main$j as JsvFilterView, _sfc_main$x as JsvFlexDiv, _sfc_main$F as JsvFocusBlock, _sfc_main$z as JsvFreeMoveActor, _sfc_main$z as JsvFreeMoveDiv, JsvGrid, _sfc_main$g as JsvHole, JsvInput, _sfc_main$B as JsvLatex, JsvLine, _sfc_main$f as JsvMarquee, JsvMaskClipDiv, _sfc_main$1 as JsvMindMap, _sfc_main$g as JsvNativeSharedDiv, _sfc_main$h as JsvNinePatch, JsvPerformance, _sfc_main$5 as JsvPieChart, _sfc_main$d as JsvPosterDiv, _sfc_main$c as JsvPosterImage, exportObj as JsvPreDownloader, JsvPreload, _sfc_main$3 as JsvProgressBar, _JsvQrcode$1 as JsvQrcode, _sfc_main$9 as JsvRadarChart, _sfc_main$8 as JsvRipple, JsvRippleShape, JsvScaleTextBox, _sfc_main as JsvScrollBox, _sfc_main$6 as JsvSector, JsvSoundPool, _JsvSpray$1 as JsvSpray, JsvSpriteAnim, _sfc_main$o as JsvSpriteLoader, JsvSpriteAnim as JsvSpriteStatic, JsvSpriteTools, JsvStyleClass, JsvStyleSheetsDeclarer, JsvSwiper, _sfc_main$l as JsvSwiper3D, _sfc_main$a as JsvTextBox, JsvTextStyleClass, _JsvTextureAnim$1 as JsvTextureAnim, sJsvTextureConst as JsvTextureConst, sTextureStoreApi as JsvTextureStoreApi, _sfc_main$g as JsvTransparentDiv, JsvVisibleSensor, LineType, _sfc_main$G as ListWidget, LoopType, METRO_WIDGET, METRO_WIDGET as METRO_WIDGET_CONST, _sfc_main$H as MetroWidget, PageType, RENDER_ITEM_BREAK_KEY, Dispatcher as SWidgetDispatcher, ScrollStyle, SeamlessSlide, _sfc_main$H as SimpleWidget, SlideSetting, SlideStyle, SpriteController, TexAlignAnchor, TextTools, TextureInstantType, VERTICAL, WholePageSlide, buildDownloadInfo, buildPreloadInfo, combinedStyles, createImpactAutoFroze, createImpactCallback, createImpactTracer, disableNativeViewListener, enableNativeViewListener, getCssStyleGroup, getCurFrameCount, getKeyFramesGroup, getMeasureObj, getPositionRelativeToView, getTextWidth, globalLoadJsvAudioPlugin, globalLoadJsvLatexPlugin, bridge as jJsvRuntimeBridge, jsvCreateFocusManager, jsvCreateHashHistory, numberCheckSet, toHtmlBorderSet, toNinePatchForgeViewSet, updateImpactAutoFroze, urlCheckSet, useFocusHub };
21633
+ export { BaseDispatcher, DECORATE_BORDER_RADIUS, DECORATE_NINEPATCH_ALPHA_MIX, DebugObjectRefer, DebugTools, DebugWrap81ErrorStack, DebugWrap81WarnStack, DefaultKeyCodeMap, EdgeDirection, FixPositionSlide, FocusMoveType, ForgeConst, FreeMoveDef, FreeMoveFunc, HORIZONTAL, InputType, instance as JSBridge, JsvAccount, _sfc_main$E as JsvActorMove, JsvActorMoveControl, _JsvApic$1 as JsvApic, _JsvApic2$1 as JsvApic2, _sfc_main$H as JsvAudio, _sfc_main$1 as JsvClipDiv, _sfc_main$8 as JsvConnectLine, _sfc_main as JsvDriftScope, _sfc_main$6 as JsvEnableRenderBreak, _sfc_main$C as JsvEnvBlocker, JsvFederationTools, _sfc_main$n as JsvFilterView, _sfc_main$B as JsvFlexDiv, _sfc_main$J as JsvFocusBlock, _JsvFragShaderView$1 as JsvFragShaderView, _sfc_main$D as JsvFreeMoveActor, _sfc_main$D as JsvFreeMoveDiv, JsvGrid, _sfc_main$k as JsvHole, JsvInput, _sfc_main$F as JsvLatex, JsvLine, _sfc_main$j as JsvMarquee, JsvMaskClipDiv, _sfc_main$5 as JsvMindMap, _sfc_main$k as JsvNativeSharedDiv, _sfc_main$l as JsvNinePatch, JsvPerformance, _sfc_main$9 as JsvPieChart, _sfc_main$h as JsvPosterDiv, _sfc_main$g as JsvPosterImage, exportObj as JsvPreDownloader, JsvPreload, _sfc_main$7 as JsvProgressBar, _JsvQrcode$1 as JsvQrcode, _sfc_main$d as JsvRadarChart, _sfc_main$c as JsvRipple, JsvRippleShape, JsvScaleTextBox, _sfc_main$4 as JsvScrollBox, _sfc_main$3 as JsvScrollFollow, _sfc_main$a as JsvSector, JsvSoundPool, _JsvSpray$1 as JsvSpray, JsvSpriteAnim, _sfc_main$s as JsvSpriteLoader, JsvSpriteAnim as JsvSpriteStatic, JsvSpriteTools, JsvStyleClass, JsvStyleSheetsDeclarer, JsvSwiper, _sfc_main$p as JsvSwiper3D, _sfc_main$e as JsvTextBox, JsvTextStyleClass, _JsvTextureAnim$1 as JsvTextureAnim, sJsvTextureConst as JsvTextureConst, sTextureStoreApi as JsvTextureStoreApi, _sfc_main$k as JsvTransparentDiv, JsvVisibleSensor, LineType, _sfc_main$K as ListWidget, LoopType, METRO_WIDGET, METRO_WIDGET as METRO_WIDGET_CONST, _sfc_main$L as MetroWidget, PageType, RENDER_ITEM_BREAK_KEY, Dispatcher as SWidgetDispatcher, ScrollBoxStyle, SeamlessSlide, _sfc_main$L as SimpleWidget, SlideSetting, SlideStyle, SpriteController, TexAlignAnchor, TextTools, TextureInstantType, VERTICAL, WholePageSlide, buildDownloadInfo, buildPreloadInfo, combinedStyles, createImpactAutoFroze, createImpactCallback, createImpactTracer, disableNativeViewListener, enableNativeViewListener, getCssStyleGroup, getCurFrameCount, getKeyFramesGroup, getMeasureObj, getPositionRelativeToView, getTextWidth, globalLoadJsvAudioPlugin, globalLoadJsvLatexPlugin, bridge as jJsvRuntimeBridge, jsvCreateFocusManager, jsvCreateHashHistory, numberCheckSet, toHtmlBorderSet, toNinePatchForgeViewSet, updateImpactAutoFroze, urlCheckSet, useFocusHub };