@shijiu/jsview-vue 2.3.151-test.0 → 2.3.728-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/bin/browser/BrowserJsvLatex.vue.mjs +9 -90
  2. package/bin/jsview-vue.mjs +5964 -1833
  3. package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +18 -2
  4. package/bin/types/utils/JsViewEngineWidget/MetroWidget/Const.d.ts +4 -1
  5. package/bin/types/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +225 -0
  6. package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +225 -0
  7. package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetDebugger.d.ts +5 -0
  8. package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +25 -2
  9. package/bin/types/utils/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +7 -1
  10. package/bin/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +25 -5
  11. package/bin/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +2 -1
  12. package/bin/types/utils/JsViewEngineWidget/MetroWidget/Utils.d.ts +2 -0
  13. package/bin/types/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +1 -1
  14. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue.d.ts +70 -0
  15. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.d.ts +24 -0
  16. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.d.ts +19 -0
  17. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.d.ts +42 -0
  18. package/bin/types/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +3 -3
  19. package/bin/types/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +2 -1
  20. package/bin/types/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +12 -4
  21. package/bin/types/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +9 -7
  22. package/bin/types/utils/JsViewEngineWidget/WidgetCommon.d.ts +17 -7
  23. package/bin/types/utils/JsViewEngineWidget/index.d.ts +3 -1
  24. package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +0 -1
  25. package/bin/types/utils/JsViewPlugin/JsvLatex/GetVersion.d.ts +14 -0
  26. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +3 -0
  27. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +1 -0
  28. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +4 -1
  29. package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.mts +29 -2
  30. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +107 -4
  31. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +62 -0
  32. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +94 -18
  33. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-wasm.vue.d.ts +611 -0
  34. package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue.d.ts → JsvPlayerBrowser.vue.d.ts} +24 -23
  35. package/bin/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +77 -20
  36. package/bin/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +77 -20
  37. package/bin/types/utils/JsViewVueTools/BlobApi.d.ts +38 -0
  38. package/bin/types/utils/JsViewVueTools/FeatureActive.d.ts +1 -0
  39. package/bin/types/utils/JsViewVueTools/JsvInteractionMode.d.ts +6 -0
  40. package/bin/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +10 -3
  41. package/bin/types/utils/JsViewVueTools/JsvTextTools.d.ts +1 -0
  42. package/bin/types/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.d.ts +43 -0
  43. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +1 -0
  44. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.d.ts +54 -0
  45. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +13 -0
  46. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +2 -0
  47. package/bin/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +76 -26
  48. package/bin/types/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.d.ts +49 -0
  49. package/bin/types/utils/JsViewVueTools/JsvTextureStore/index.d.ts +2 -0
  50. package/bin/types/utils/JsViewVueTools/index.d.ts +3 -1
  51. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +12 -22
  52. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +12 -22
  53. package/bin/types/utils/JsViewVueWidget/JsvDomRenderer/JsViewHtmlToVNodesOptions.d.ts +101 -0
  54. package/bin/types/utils/JsViewVueWidget/JsvDomRenderer/JsvDomRenderer.d.ts +61 -0
  55. package/bin/types/utils/JsViewVueWidget/JsvDomRenderer/htmlToVNodes.d.ts +58 -0
  56. package/bin/types/utils/JsViewVueWidget/JsvDomRenderer/index.d.ts +1 -0
  57. package/bin/types/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +1 -0
  58. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +151 -18
  59. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.d.ts +2 -1
  60. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/CmdTypes.d.ts +16 -0
  61. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.d.ts +2 -1
  62. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +3 -1
  63. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +55 -12
  64. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +178 -35
  65. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +119 -17
  66. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +9 -3
  67. package/bin/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +4 -1
  68. package/bin/types/utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +22 -1
  69. package/bin/types/utils/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +1 -1
  70. package/bin/types/utils/JsViewVueWidget/JsvPieChart.vue.d.ts +2 -0
  71. package/bin/types/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +5 -2
  72. package/bin/types/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +1 -1
  73. package/bin/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +39 -1
  74. package/bin/types/utils/JsViewVueWidget/JsvSector.vue.d.ts +1 -0
  75. package/bin/types/utils/JsViewVueWidget/JsvTextBox.vue.d.ts +15 -3
  76. package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +22 -96
  77. package/bin/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +6 -0
  78. package/bin/types/utils/JsViewVueWidget/{JsvPosterDiv.vue.d.ts → TypesDiv/JsvPosterDiv.vue.d.ts} +9 -0
  79. package/bin/types/utils/JsViewVueWidget/{JsvPosterImage.vue.d.ts → TypesDiv/JsvPosterImage.vue.d.ts} +15 -3
  80. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue.d.ts +72 -0
  81. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue.d.ts +90 -0
  82. package/bin/types/utils/JsViewVueWidget/index.d.ts +6 -3
  83. package/dist/types/utils/JsViewEngineWidget/CheckType.d.ts +7 -0
  84. package/dist/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +106 -0
  85. package/dist/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +128 -0
  86. package/dist/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +25 -0
  87. package/dist/types/utils/JsViewEngineWidget/MetroWidget/Const.d.ts +23 -0
  88. package/dist/types/utils/JsViewEngineWidget/MetroWidget/DebugFrame.vue.d.ts +12 -0
  89. package/dist/types/utils/JsViewEngineWidget/MetroWidget/DebugTools.d.ts +9 -0
  90. package/dist/types/utils/JsViewEngineWidget/MetroWidget/Dispatcher.d.ts +16 -0
  91. package/dist/types/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +412 -0
  92. package/dist/types/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +751 -0
  93. package/dist/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetDebugger.d.ts +9 -0
  94. package/dist/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +82 -0
  95. package/dist/types/utils/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +31 -0
  96. package/dist/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +80 -0
  97. package/dist/types/utils/JsViewEngineWidget/MetroWidget/Slide.d.ts +25 -0
  98. package/dist/types/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +52 -0
  99. package/dist/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +69 -0
  100. package/dist/types/utils/JsViewEngineWidget/MetroWidget/TokenGenerator.d.ts +4 -0
  101. package/dist/types/utils/JsViewEngineWidget/MetroWidget/Utils.d.ts +6 -0
  102. package/dist/types/utils/JsViewEngineWidget/MetroWidget/VisibleInfo.d.ts +20 -0
  103. package/dist/types/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +21 -0
  104. package/dist/types/utils/JsViewEngineWidget/RangeModel.d.ts +166 -0
  105. package/dist/types/utils/JsViewEngineWidget/RectUtils.d.ts +61 -0
  106. package/dist/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue.d.ts +74 -0
  107. package/dist/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.d.ts +28 -0
  108. package/dist/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.d.ts +23 -0
  109. package/dist/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.d.ts +46 -0
  110. package/dist/types/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +42 -0
  111. package/dist/types/utils/JsViewEngineWidget/TemplateParser/Fence.d.ts +62 -0
  112. package/dist/types/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +21 -0
  113. package/dist/types/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +103 -0
  114. package/dist/types/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +28 -0
  115. package/dist/types/utils/JsViewEngineWidget/TemplateParser/index.d.ts +8 -0
  116. package/dist/types/utils/JsViewEngineWidget/WidgetCommon.d.ts +160 -0
  117. package/dist/types/utils/JsViewEngineWidget/index.d.ts +21 -0
  118. package/dist/types/utils/JsViewPlugin/JsvAccount/JsvAccount.d.ts +46 -0
  119. package/dist/types/utils/JsViewPlugin/JsvAudio/AudioProxy.d.ts +6 -0
  120. package/dist/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +22 -0
  121. package/dist/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +212 -0
  122. package/dist/types/utils/JsViewPlugin/JsvAudio/CheckType.d.ts +6 -0
  123. package/dist/types/utils/JsViewPlugin/JsvAudio/Events.d.ts +17 -0
  124. package/dist/types/utils/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +22 -0
  125. package/dist/types/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.d.ts +12 -0
  126. package/dist/types/utils/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +6 -0
  127. package/dist/types/utils/JsViewPlugin/JsvAudio/PluginLoader.d.ts +5 -0
  128. package/dist/types/utils/JsViewPlugin/JsvAudio/ScreenLockManager.d.ts +9 -0
  129. package/dist/types/utils/JsViewPlugin/JsvAudio/index.d.ts +7 -0
  130. package/dist/types/utils/JsViewPlugin/JsvAudio/version.d.mts +14 -0
  131. package/{bin/types/utils/JsViewPlugin/JsvLatex → dist/types/utils/JsViewPlugin/JsvAudio}/version.d.ts +5 -0
  132. package/dist/types/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +0 -0
  133. package/dist/types/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +17 -0
  134. package/dist/types/utils/JsViewPlugin/JsvLatex/Color.d.ts +5 -0
  135. package/dist/types/utils/JsViewPlugin/JsvLatex/GetVersion.d.ts +18 -0
  136. package/dist/types/utils/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +46 -0
  137. package/dist/types/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +8 -0
  138. package/dist/types/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +9 -0
  139. package/dist/types/utils/JsViewPlugin/JsvLatex/PluginLoader.d.ts +5 -0
  140. package/dist/types/utils/JsViewPlugin/JsvLatex/index.d.ts +8 -0
  141. package/dist/types/utils/JsViewPlugin/JsvLatex/version.d.mts +40 -0
  142. package/dist/types/utils/JsViewPlugin/JsvPlayer/AckEventDefine.d.ts +10 -0
  143. package/dist/types/utils/JsViewPlugin/JsvPlayer/GetVersion.d.ts +13 -0
  144. package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +523 -0
  145. package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +119 -0
  146. package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +664 -0
  147. package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-0.9.vue.d.ts +45 -0
  148. package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-wasm.vue.d.ts +611 -0
  149. package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue.d.ts +597 -0
  150. package/dist/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +415 -0
  151. package/dist/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +415 -0
  152. package/dist/types/utils/JsViewPlugin/JsvPlayer/version.d.mts +14 -0
  153. package/dist/types/utils/JsViewPlugin/index.d.ts +7 -0
  154. package/dist/types/utils/JsViewVueTools/BlobApi.d.ts +42 -0
  155. package/dist/types/utils/JsViewVueTools/ConstSymbol.d.ts +6 -0
  156. package/dist/types/utils/JsViewVueTools/DebugContentShellJBridge.d.ts +10 -0
  157. package/dist/types/utils/JsViewVueTools/DebugTool.d.ts +12 -0
  158. package/dist/types/utils/JsViewVueTools/DefaultKeyMap.d.ts +14 -0
  159. package/dist/types/utils/JsViewVueTools/FeatureActive.d.ts +15 -0
  160. package/dist/types/utils/JsViewVueTools/ForgeConstDefine.d.ts +15 -0
  161. package/dist/types/utils/JsViewVueTools/ForgeHandles.d.ts +11 -0
  162. package/dist/types/utils/JsViewVueTools/JsvDynamicCssStyle.d.ts +33 -0
  163. package/dist/types/utils/JsViewVueTools/JsvDynamicKeyFrames.d.ts +40 -0
  164. package/dist/types/utils/JsViewVueTools/JsvFederationTools.d.ts +20 -0
  165. package/dist/types/utils/JsViewVueTools/JsvHashHistory.d.ts +20 -0
  166. package/dist/types/utils/JsViewVueTools/JsvImpactTracer.d.ts +44 -0
  167. package/dist/types/utils/JsViewVueTools/JsvInteractionMode.d.ts +10 -0
  168. package/dist/types/utils/JsViewVueTools/JsvPerformance.d.ts +9 -0
  169. package/dist/types/utils/JsViewVueTools/JsvPreDownloader.d.ts +55 -0
  170. package/dist/types/utils/JsViewVueTools/JsvRefTaker.d.ts +52 -0
  171. package/dist/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +378 -0
  172. package/dist/types/utils/JsViewVueTools/JsvStyleClass.d.ts +35 -0
  173. package/dist/types/utils/JsViewVueTools/JsvStyleSheetsDeclarer.d.ts +35 -0
  174. package/dist/types/utils/JsViewVueTools/JsvTextTools.d.ts +66 -0
  175. package/dist/types/utils/JsViewVueTools/JsvTextureDefines.d.ts +10 -0
  176. package/dist/types/utils/JsViewVueTools/JsvTextureLoadTool.d.ts +67 -0
  177. package/dist/types/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.d.ts +47 -0
  178. package/dist/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +99 -0
  179. package/dist/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +20 -0
  180. package/dist/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.d.ts +58 -0
  181. package/dist/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +113 -0
  182. package/dist/types/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +17 -0
  183. package/dist/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +170 -0
  184. package/dist/types/utils/JsViewVueTools/JsvTextureStore/Store.d.ts +16 -0
  185. package/dist/types/utils/JsViewVueTools/JsvTextureStore/Texture.d.ts +31 -0
  186. package/dist/types/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.d.ts +53 -0
  187. package/dist/types/utils/JsViewVueTools/JsvTextureStore/index.d.ts +6 -0
  188. package/dist/types/utils/JsViewVueTools/NinePatchHelper.d.ts +25 -0
  189. package/dist/types/utils/JsViewVueTools/TextureManagerTools.d.ts +11 -0
  190. package/dist/types/utils/JsViewVueTools/TypeCheckAndSet.d.ts +7 -0
  191. package/dist/types/utils/JsViewVueTools/index.d.ts +29 -0
  192. package/dist/types/utils/JsViewVueWidget/Jsv3dDiv.vue.d.ts +124 -0
  193. package/dist/types/utils/JsViewVueWidget/Jsv3dStage.vue.d.ts +148 -0
  194. package/dist/types/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.d.ts +35 -0
  195. package/dist/types/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +102 -0
  196. package/dist/types/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.d.ts +37 -0
  197. package/dist/types/utils/JsViewVueWidget/JsvActorMove/index.d.ts +8 -0
  198. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +15 -0
  199. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +77 -0
  200. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +54 -0
  201. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +13 -0
  202. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +44 -0
  203. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +17 -0
  204. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +13 -0
  205. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +3 -0
  206. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/GifData.d.ts +5 -0
  207. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +7 -0
  208. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +12 -0
  209. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +5 -0
  210. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.d.ts +20 -0
  211. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/WebpData.d.ts +5 -0
  212. package/dist/types/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts +26 -0
  213. package/dist/types/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +74 -0
  214. package/dist/types/utils/JsViewVueWidget/JsvClipDiv/index.d.ts +5 -0
  215. package/dist/types/utils/JsViewVueWidget/JsvConnectLine/ArcLineManager.d.ts +5 -0
  216. package/dist/types/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +34 -0
  217. package/dist/types/utils/JsViewVueWidget/JsvConnectLine/index.d.ts +6 -0
  218. package/dist/types/utils/JsViewVueWidget/JsvDashPath.vue.d.ts +33 -0
  219. package/dist/types/utils/JsViewVueWidget/JsvDomRenderer/JsViewHtmlToVNodesOptions.d.ts +105 -0
  220. package/dist/types/utils/JsViewVueWidget/JsvDomRenderer/JsvDomRenderer.d.ts +65 -0
  221. package/dist/types/utils/JsViewVueWidget/JsvDomRenderer/htmlToVNodes.d.ts +62 -0
  222. package/dist/types/utils/JsViewVueWidget/JsvDomRenderer/index.d.ts +5 -0
  223. package/dist/types/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +109 -0
  224. package/dist/types/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +108 -0
  225. package/dist/types/utils/JsViewVueWidget/JsvDriftScope/index.d.ts +5 -0
  226. package/dist/types/utils/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +61 -0
  227. package/dist/types/utils/JsViewVueWidget/JsvFilterView.vue.d.ts +91 -0
  228. package/dist/types/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +106 -0
  229. package/dist/types/utils/JsViewVueWidget/JsvFlexCell/JsvFullScrAdjust.vue.d.ts +100 -0
  230. package/dist/types/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +108 -0
  231. package/dist/types/utils/JsViewVueWidget/JsvFlexCell/index.d.ts +7 -0
  232. package/dist/types/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +63 -0
  233. package/dist/types/utils/JsViewVueWidget/JsvFragShaderView/index.d.ts +5 -0
  234. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActionRefObject.d.ts +4 -0
  235. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +228 -0
  236. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorState.d.ts +6 -0
  237. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.d.ts +16 -0
  238. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/CmdTypes.d.ts +16 -0
  239. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.d.ts +20 -0
  240. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +106 -0
  241. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvFreeMoveActor.vue.d.ts +107 -0
  242. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/KeepFlags.d.ts +11 -0
  243. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +12 -0
  244. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +118 -0
  245. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +244 -0
  246. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +169 -0
  247. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.d.ts +22 -0
  248. package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +24 -0
  249. package/dist/types/utils/JsViewVueWidget/JsvGrid.vue.d.ts +241 -0
  250. package/dist/types/utils/JsViewVueWidget/JsvHole.d.ts +19 -0
  251. package/dist/types/utils/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +16 -0
  252. package/dist/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +52 -0
  253. package/dist/types/utils/JsViewVueWidget/JsvInput/EditVisibleArea.d.ts +30 -0
  254. package/dist/types/utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +98 -0
  255. package/dist/types/utils/JsViewVueWidget/JsvInput/SharedDefine.d.ts +17 -0
  256. package/dist/types/utils/JsViewVueWidget/JsvInput/SystemTextTools.d.ts +20 -0
  257. package/dist/types/utils/JsViewVueWidget/JsvInput/index.d.ts +8 -0
  258. package/dist/types/utils/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +32 -0
  259. package/dist/types/utils/JsViewVueWidget/JsvLine/LineManager.d.ts +5 -0
  260. package/dist/types/utils/JsViewVueWidget/JsvLine/index.d.ts +6 -0
  261. package/dist/types/utils/JsViewVueWidget/JsvMarquee.vue.d.ts +33 -0
  262. package/dist/types/utils/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +101 -0
  263. package/dist/types/utils/JsViewVueWidget/JsvMindMap/CommonType.d.ts +1 -0
  264. package/dist/types/utils/JsViewVueWidget/JsvMindMap/Constant.d.ts +13 -0
  265. package/dist/types/utils/JsViewVueWidget/JsvMindMap/DataTree.d.ts +75 -0
  266. package/dist/types/utils/JsViewVueWidget/JsvMindMap/Geometry.d.ts +72 -0
  267. package/dist/types/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +235 -0
  268. package/dist/types/utils/JsViewVueWidget/JsvMindMap/index.d.ts +5 -0
  269. package/dist/types/utils/JsViewVueWidget/JsvMindMap/rtree.d.ts +44 -0
  270. package/dist/types/utils/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +93 -0
  271. package/dist/types/utils/JsViewVueWidget/JsvNinePatch.vue.d.ts +55 -0
  272. package/dist/types/utils/JsViewVueWidget/JsvPieChart.vue.d.ts +30 -0
  273. package/dist/types/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +68 -0
  274. package/dist/types/utils/JsViewVueWidget/JsvPreload/index.d.ts +6 -0
  275. package/dist/types/utils/JsViewVueWidget/JsvProgressBar.vue.d.ts +31 -0
  276. package/dist/types/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +85 -0
  277. package/dist/types/utils/JsViewVueWidget/JsvRadarChart.vue.d.ts +37 -0
  278. package/dist/types/utils/JsViewVueWidget/JsvRipple/Constant.d.ts +8 -0
  279. package/dist/types/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +129 -0
  280. package/dist/types/utils/JsViewVueWidget/JsvRipple/index.d.ts +7 -0
  281. package/dist/types/utils/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +28 -0
  282. package/dist/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +278 -0
  283. package/dist/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +157 -0
  284. package/dist/types/utils/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.d.ts +8 -0
  285. package/dist/types/utils/JsViewVueWidget/JsvScrollBox/ScrollSymbol.d.ts +16 -0
  286. package/dist/types/utils/JsViewVueWidget/JsvScrollBox/index.d.ts +7 -0
  287. package/dist/types/utils/JsViewVueWidget/JsvSector.vue.d.ts +30 -0
  288. package/dist/types/utils/JsViewVueWidget/JsvSmoothSlideContainer.vue.d.ts +76 -0
  289. package/dist/types/utils/JsViewVueWidget/JsvSoundPool.d.ts +114 -0
  290. package/dist/types/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +58 -0
  291. package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.d.ts +18 -0
  292. package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +70 -0
  293. package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +85 -0
  294. package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteTools.d.ts +15 -0
  295. package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/SpriteController.d.ts +21 -0
  296. package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/index.d.ts +9 -0
  297. package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/sAnimationToken.d.ts +6 -0
  298. package/dist/types/utils/JsViewVueWidget/JsvSwiper/Indicator.vue.d.ts +16 -0
  299. package/dist/types/utils/JsViewVueWidget/JsvSwiper/JsvSmoothSwiper.vue.d.ts +141 -0
  300. package/dist/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +248 -0
  301. package/dist/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper2.vue.d.ts +181 -0
  302. package/dist/types/utils/JsViewVueWidget/JsvSwiper/index.d.ts +8 -0
  303. package/dist/types/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue.d.ts +16 -0
  304. package/dist/types/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +121 -0
  305. package/dist/types/utils/JsViewVueWidget/JsvSwiper3D/index.d.ts +6 -0
  306. package/dist/types/utils/JsViewVueWidget/JsvTextBox.vue.d.ts +121 -0
  307. package/dist/types/utils/JsViewVueWidget/JsvTextureAnim/CommonType.d.ts +6 -0
  308. package/dist/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +38 -0
  309. package/dist/types/utils/JsViewVueWidget/JsvTextureAnim/index.d.ts +8 -0
  310. package/dist/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +109 -0
  311. package/dist/types/utils/JsViewVueWidget/JsvVideo.vue.d.ts +23 -0
  312. package/dist/types/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +109 -0
  313. package/dist/types/utils/JsViewVueWidget/JsvVisibleSensor/index.d.ts +88 -0
  314. package/dist/types/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue.d.ts +94 -0
  315. package/dist/types/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue.d.ts +115 -0
  316. package/dist/types/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue.d.ts +94 -0
  317. package/dist/types/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue.d.ts +115 -0
  318. package/dist/types/utils/JsViewVueWidget/index.d.ts +53 -0
  319. package/dist/types/utils/index.d.ts +8 -0
  320. package/dist/utils/browser/BrowserAudio.vue.mjs +258 -0
  321. package/dist/utils/browser/BrowserJsvLatex.vue.mjs +64 -0
  322. package/dist/utils/export-sfc.mjs +12 -0
  323. package/dist/utils/index.mjs +29000 -0
  324. package/dist/utils/jsview-vue-common.mjs +39 -0
  325. package/package.json +1 -1
  326. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +32 -16
  327. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.ts +24 -2
  328. package/utils/JsViewEngineWidget/MetroWidget/Const.ts +5 -0
  329. package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +193 -89
  330. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +325 -155
  331. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetDebugger.ts +15 -0
  332. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +1035 -370
  333. package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.ts +41 -23
  334. package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +138 -41
  335. package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +1 -0
  336. package/utils/JsViewEngineWidget/MetroWidget/Utils.ts +6 -0
  337. package/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.ts +2 -1
  338. package/utils/JsViewEngineWidget/RectUtils.js +1 -1
  339. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue +62 -0
  340. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.ts +260 -0
  341. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.ts +32 -0
  342. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.ts +236 -0
  343. package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +329 -230
  344. package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +101 -27
  345. package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +54 -5
  346. package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +109 -41
  347. package/utils/JsViewEngineWidget/WidgetCommon.ts +17 -7
  348. package/utils/JsViewEngineWidget/index.ts +7 -2
  349. package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +46 -46
  350. package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +54 -41
  351. package/utils/JsViewPlugin/JsvLatex/Color.ts +104 -39
  352. package/utils/JsViewPlugin/JsvLatex/GetVersion.js +65 -0
  353. package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +71 -17
  354. package/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.js +10 -0
  355. package/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue +14 -2
  356. package/utils/JsViewPlugin/JsvLatex/PluginLoader.js +63 -31
  357. package/utils/JsViewPlugin/JsvLatex/version.mjs +26 -13
  358. package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +2 -1
  359. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +402 -23
  360. package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +100 -0
  361. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +363 -468
  362. package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue → JsvPlayerBrowser-wasm.vue} +60 -10
  363. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +511 -0
  364. package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +52 -10
  365. package/utils/JsViewPlugin/JsvPlayer/index.js +58 -9
  366. package/utils/JsViewPlugin/JsvPlayer/package.json +8 -0
  367. package/utils/JsViewVueTools/BlobApi.ts +55 -0
  368. package/utils/JsViewVueTools/FeatureActive.ts +3 -0
  369. package/utils/JsViewVueTools/ForgeHandles.ts +3 -0
  370. package/utils/JsViewVueTools/JsvInteractionMode.js +16 -0
  371. package/utils/JsViewVueTools/JsvPreDownloader.ts +2 -2
  372. package/utils/JsViewVueTools/JsvRuntimeBridge.js +40 -19
  373. package/utils/JsViewVueTools/JsvTextTools.ts +9 -1
  374. package/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.ts +180 -0
  375. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +1 -0
  376. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.ts +304 -0
  377. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.ts +38 -0
  378. package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +16 -1
  379. package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +154 -69
  380. package/utils/JsViewVueTools/JsvTextureStore/Store.ts +1 -1
  381. package/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.ts +92 -0
  382. package/utils/JsViewVueTools/JsvTextureStore/index.js +2 -0
  383. package/utils/JsViewVueTools/index.js +3 -1
  384. package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +111 -86
  385. package/utils/JsViewVueWidget/JsvDomRenderer/JsViewHtmlToVNodesOptions.ts +212 -0
  386. package/utils/JsViewVueWidget/JsvDomRenderer/JsvDomRenderer.ts +146 -0
  387. package/utils/JsViewVueWidget/JsvDomRenderer/htmlToVNodes.ts +748 -0
  388. package/utils/JsViewVueWidget/JsvDomRenderer/index.ts +1 -0
  389. package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +10 -1
  390. package/utils/JsViewVueWidget/JsvEnableRenderBreak.vue +6 -0
  391. package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +11 -5
  392. package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +3 -1
  393. package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +23 -11
  394. package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +269 -26
  395. package/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.ts +2 -1
  396. package/utils/JsViewVueWidget/JsvFreeMoveActor/CmdTypes.ts +24 -0
  397. package/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.ts +3 -0
  398. package/utils/JsViewVueWidget/JsvFreeMoveActor/{FreeMoveActor.vue → JsvFreeMoveActor.vue} +5 -1
  399. package/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.ts +10 -2
  400. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +223 -100
  401. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +245 -64
  402. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +95 -29
  403. package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +27 -5
  404. package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +11 -2
  405. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +29 -2
  406. package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +24 -7
  407. package/utils/JsViewVueWidget/JsvMarquee.vue +1 -1
  408. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +12 -10
  409. package/utils/JsViewVueWidget/JsvNinePatch.vue +22 -12
  410. package/utils/JsViewVueWidget/JsvPieChart.vue +93 -70
  411. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +32 -29
  412. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +2 -1
  413. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +56 -25
  414. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +11 -11
  415. package/utils/JsViewVueWidget/JsvSector.vue +66 -28
  416. package/utils/JsViewVueWidget/JsvTextBox.vue +30 -1
  417. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +315 -305
  418. package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +56 -14
  419. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +8 -6
  420. package/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue +54 -0
  421. package/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue +88 -0
  422. package/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue +177 -0
  423. package/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue +267 -0
  424. package/utils/JsViewVueWidget/index.js +7 -2
  425. package/bin/types/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.d.ts +0 -7
  426. package/utils/JsViewPlugin/JsvLatex/version.js +0 -24
  427. package/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.ts +0 -36
  428. package/utils/JsViewVueWidget/JsvPosterDiv.vue +0 -56
  429. package/utils/JsViewVueWidget/JsvPosterImage.vue +0 -105
  430. /package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue.d.ts → JsvPlayerBrowser-0.9.vue.d.ts} +0 -0
  431. /package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/{FreeMoveActor.vue.d.ts → JsvFreeMoveActor.vue.d.ts} +0 -0
  432. /package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue → JsvPlayerBrowser-0.9.vue} +0 -0
@@ -7,6 +7,11 @@ import {
7
7
  toRaw,
8
8
  nextTick,
9
9
  computed,
10
+ inject,
11
+ watch,
12
+ onActivated,
13
+ onDeactivated,
14
+ provide,
10
15
  } from "vue";
11
16
  import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
12
17
  import {
@@ -16,7 +21,7 @@ import {
16
21
  } from "../TemplateParser/index";
17
22
  import { PageUpdater } from "./PageUpdater";
18
23
  import { SingleRangeModel } from "../RangeModel";
19
- import { METRO_WIDGET_CONST } from "./Const";
24
+ import { METRO_WIDGET_CONST, ONEDGE_TYPE } from "./Const";
20
25
  import {
21
26
  EdgeDirection,
22
27
  VERTICAL,
@@ -39,19 +44,28 @@ import {
39
44
  JsvUseFeature,
40
45
  } from "../../JsViewVueTools/FeatureActive.ts";
41
46
  import { randomColor } from "./DebugTools.ts";
47
+ import {
48
+ KEY_MODE,
49
+ TOUCH_MODE,
50
+ JsvInteractionMode,
51
+ hasJsvTouchModeSwitcher,
52
+ } from "../../JsViewVueTools/JsvInteractionMode";
53
+ import { getId } from "./Utils";
54
+ import { MW_CONTEXT_NAME } from "./Utils";
55
+ import { SPATIAL_NAV_PROVIDER_NAME } from "../SpatialNavigator/SpatialNavigator";
56
+ import { getDebugSetting } from "./MetroWidgetDebugger";
42
57
 
43
58
  const TAG = "MetroWidget";
44
59
  const LONGPRESS_TIMEOUT = 600;
45
60
  const DATA_ID_KEY = "jsvKey";
46
61
 
47
- let metroWidgetTokenGen = 1;
48
-
49
62
  const _getMetroTemplate = function (
50
63
  widgetRectInfo,
51
64
  direction,
52
65
  support_history_path,
53
66
  layout_type,
54
- mode
67
+ type,
68
+ errorLogger
55
69
  ) {
56
70
  let page_size;
57
71
  let line_max;
@@ -63,14 +77,15 @@ const _getMetroTemplate = function (
63
77
  page_size = widgetRectInfo.contentWidth;
64
78
  }
65
79
  let metroWidget;
66
- switch (mode) {
80
+ switch (type) {
67
81
  case "list":
68
82
  metroWidget = new ListMetroTemplate(
69
83
  direction,
70
84
  line_max,
71
85
  page_size,
72
86
  layout_type,
73
- support_history_path
87
+ support_history_path,
88
+ errorLogger
74
89
  );
75
90
  break;
76
91
  default:
@@ -79,15 +94,72 @@ const _getMetroTemplate = function (
79
94
  line_max,
80
95
  page_size,
81
96
  layout_type,
82
- support_history_path
97
+ support_history_path,
98
+ errorLogger
83
99
  );
84
100
  break;
85
101
  }
102
+ if (getDebugSetting().enableOverlapCheck) {
103
+ metroWidget.enableDebug(true);
104
+ }
86
105
  return metroWidget;
87
106
  };
88
107
 
89
- const TOUCH_MODE = 1; //触控模式
90
- const FOCUS_MODE = 2; //按键模式
108
+ const TouchState = {
109
+ IDLE: 0,
110
+ TAP: 1,
111
+ DRAG: 2,
112
+ FLING: 3,
113
+ };
114
+
115
+ class TouchStateMgr {
116
+ constructor(name) {
117
+ this._name = name;
118
+ this._touchState = TouchState.IDLE;
119
+ this._touchCount = 0;
120
+ }
121
+ touchStart(touchCount) {
122
+ this._touchState = TouchState.TAP;
123
+ this._touchCount = touchCount;
124
+ }
125
+ touchEnd(touchCount) {
126
+ if (touchCount == this._touchCount) {
127
+ this._touchState = TouchState.IDLE;
128
+ }
129
+ }
130
+ flingStart(touchCount) {
131
+ if (touchCount == this._touchCount) {
132
+ this._touchState = TouchState.FLING;
133
+ }
134
+ }
135
+ flingEnd(touchCount) {
136
+ if (touchCount == this._touchCount) {
137
+ this._touchState = TouchState.IDLE;
138
+ }
139
+ }
140
+ dragStart(touchCount) {
141
+ if (touchCount == this._touchCount) {
142
+ this._touchState = TouchState.DRAG;
143
+ }
144
+ }
145
+ dragEnd(touchCount) {
146
+ if (touchCount == this._touchCount) {
147
+ this._touchState = TouchState.IDLE;
148
+ }
149
+ }
150
+ duringFling() {
151
+ return this._touchState == TouchState.FLING;
152
+ }
153
+ duringTouch() {
154
+ return this._touchState != TouchState.IDLE;
155
+ }
156
+ getTouchState() {
157
+ return this._touchState;
158
+ }
159
+ getTouchCount() {
160
+ return this._touchCount;
161
+ }
162
+ }
91
163
 
92
164
  export const setup = (
93
165
  props,
@@ -101,40 +173,56 @@ export const setup = (
101
173
  pageUpdateToken,
102
174
  touchDiv,
103
175
  touchDivSize,
176
+ rootDiv,
104
177
  templateMode
105
178
  ) => {
179
+ const errorLogger = (...args) => {
180
+ console.error(...args, `name=${props.name}`);
181
+ };
106
182
  if (props.itemConfig) {
107
- console.error(TAG, "prop: itemCofig will be deprecated soon.");
183
+ errorLogger(TAG, "prop: itemCofig will be deprecated soon.");
184
+ }
185
+
186
+ function debugLog(...args) {
187
+ console.debug(
188
+ `%cccht name:${props.name} %c`,
189
+ "background-color: #e6ffe6",
190
+ "",
191
+ ...args
192
+ );
108
193
  }
109
194
 
195
+ const metroWidgetId = getId();
196
+ const spatialNavigator = inject(SPATIAL_NAV_PROVIDER_NAME, undefined);
197
+ const parentMetroWidget = inject(MW_CONTEXT_NAME, undefined);
198
+
110
199
  let widgetRectInfo = new WidgetRectInfo(
111
200
  props.width,
112
201
  props.height,
113
- props.padding
202
+ props.padding,
203
+ errorLogger
114
204
  );
115
205
  let metroTemplate = _getMetroTemplate(
116
206
  widgetRectInfo,
117
207
  props.direction,
118
208
  props.supportHistoryPath,
119
209
  props.layoutType,
120
- templateMode
210
+ templateMode,
211
+ errorLogger
121
212
  );
122
213
 
123
- const TouchState = {
124
- IDLE: 0,
125
- TAP: 1,
126
- DRAG: 2,
127
- FLING: 3,
128
- };
214
+ let innerEnableRenderBreak = props.enableItemRenderBreak;
215
+ const touchEnable = computed(() => {
216
+ return props.touchFlag > 0 && hasJsvTouchModeSwitcher();
217
+ });
129
218
 
130
219
  let innerKeepTraceRange = 0;
131
220
  if (typeof props.keepTraceRange == "number" && props.keepTraceRange > 0) {
132
221
  innerKeepTraceRange = props.keepTraceRange;
133
222
  } else {
134
- if (props.touchFlag > 0) {
223
+ if (touchEnable.value) {
135
224
  // 激活引擎功能的支持
136
225
  JsvUseFeature("MetroWidget", FeatureNames.TouchReceiver);
137
-
138
226
  //触控默认3屏
139
227
  innerKeepTraceRange = 3;
140
228
  } else {
@@ -143,63 +231,49 @@ export const setup = (
143
231
  }
144
232
  }
145
233
 
146
- const modeForExport = ref(FOCUS_MODE);
147
- const mode = {
148
- _mode: FOCUS_MODE,
149
- _touchState: TouchState.IDLE,
150
- _touchCount: 0, // 触控流流程ID,解决fling等事件晚于新的touchDown时引起的混乱问题
151
-
152
- _duringTouch: false,
153
- _duringFling: false,
154
- touchStart(touchCount) {
155
- this._mode = TOUCH_MODE;
156
- modeForExport.value = TOUCH_MODE;
157
- this._touchState = TouchState.TAP;
158
- this._touchCount = touchCount;
159
- },
160
- touchEnd(touchCount) {
161
- if (touchCount == this._touchCount) {
162
- this._touchState = TouchState.IDLE;
234
+ const onInteractionModeChange = (newMode, oldMode) => {
235
+ if (newMode === KEY_MODE) {
236
+ if (touchStateMgr.duringFling()) {
237
+ return;
163
238
  }
164
- },
165
- flingStart(touchCount) {
166
- if (touchCount == this._touchCount) {
167
- this._touchState = TouchState.FLING;
239
+ if (focusWhenInTouch) {
240
+ isFocus.value = true;
168
241
  }
169
- },
170
- flingEnd(touchCount) {
171
- if (touchCount == this._touchCount) {
172
- this._touchState = TouchState.IDLE;
173
- }
174
- },
175
- dragStart(touchCount) {
176
- if (touchCount == this._touchCount) {
177
- this._touchState = TouchState.DRAG;
242
+ const focusItem = _getVisibleFocusableItem();
243
+ if (focusItem) {
244
+ const preFocusItem = getItemById(focusId);
245
+ _changeFocusId(focusItem.id, false);
246
+ if (preFocusItem && preFocusItem.id !== focusItem.id) {
247
+ onItemBlur(preFocusItem);
248
+ }
249
+ onItemFocus(focusItem);
178
250
  }
179
- },
180
- dragEnd(touchCount) {},
181
- keyDown() {
182
- this._mode = FOCUS_MODE;
183
- modeForExport.value = FOCUS_MODE;
184
- this._touchState = TouchState.IDLE;
185
- },
186
- duringFling() {
187
- return this._touchState == TouchState.FLING;
188
- },
189
- duringTouch() {
190
- return this._touchState != TouchState.IDLE;
191
- },
192
- getMode() {
193
- return this._mode;
194
- },
195
- getTouchState() {
196
- return this._touchState;
197
- },
198
- getTouchCount() {
199
- return this._touchCount;
200
- },
251
+ } else if (newMode === TOUCH_MODE) {
252
+ //进入触控模式, 触发onBlur (onBlur中会有各种副作用, 先不触发)
253
+ // onItemBlur(getItemById(focusId));
254
+ } else {
255
+ console.error("unknown interaction mode", newMode);
256
+ }
201
257
  };
258
+ let unwatchInteractionMode = watch(
259
+ JsvInteractionMode,
260
+ onInteractionModeChange
261
+ );
262
+
263
+ onActivated(() => {
264
+ if (unwatchInteractionMode) {
265
+ unwatchInteractionMode();
266
+ }
267
+ unwatchInteractionMode = watch(JsvInteractionMode, onInteractionModeChange);
268
+ });
202
269
 
270
+ onDeactivated(() => {
271
+ unwatchInteractionMode?.();
272
+ unwatchInteractionMode = null;
273
+ isFocus.value = false;
274
+ });
275
+
276
+ const touchStateMgr = new TouchStateMgr(props.name);
203
277
  let innerData = [];
204
278
  let dataList = [];
205
279
  let dataKeyList = [];
@@ -209,7 +283,8 @@ export const setup = (
209
283
  let focusId = 0;
210
284
  let preFocusId = -1;
211
285
  let preEdgeRect = null;
212
- let isFocus = false;
286
+ let isFocus = ref(false);
287
+ let focusWhenInTouch = false;
213
288
  let vertical = props.direction == VERTICAL;
214
289
  let templateItemAdder = null;
215
290
  let permanentItemList = [];
@@ -227,23 +302,39 @@ export const setup = (
227
302
  let freeMoveSlideGapTop = 0;
228
303
  let freeMoveSlideGapLeft = 0;
229
304
 
305
+ //使用fbo加速
306
+ let rootNativeViewId = -1;
307
+ if (props.renderAcc) {
308
+ const metroWidgetBox = new Forge.MetroWidgetBoxView();
309
+ metroWidgetBox.SetEnable(true);
310
+ rootNativeViewId = Forge.sViewStore.add(
311
+ new Forge.ViewInfo(metroWidgetBox, null)
312
+ );
313
+ }
314
+
230
315
  const DEFAULT_ANIMATION_DURATION = 200;
231
316
 
232
317
  //rect {left: number, top: number, width: number, height: number }
233
- const rectVisibleState = (rect) => {
318
+ const rectVisibleState = (rect, rectStart, rectEnd) => {
234
319
  if (!rect) {
235
320
  return 0;
236
321
  }
322
+ if (typeof rectStart == "undefined") {
323
+ rectStart = visibleInfo.startWithPadding;
324
+ }
325
+ if (typeof rectEnd == "undefined") {
326
+ rectEnd = visibleInfo.endWithPadding;
327
+ }
237
328
  let pos_key = vertical ? "top" : "left";
238
329
  let size_key = vertical ? "height" : "width";
239
330
  if (
240
- rect[pos_key] + rect[size_key] - 1 < visibleInfo.start ||
241
- rect[pos_key] > visibleInfo.end
331
+ rect[pos_key] + rect[size_key] - 1 < rectStart ||
332
+ rect[pos_key] > rectEnd
242
333
  ) {
243
334
  return 0; // 完全不可见
244
335
  } else if (
245
- rect[pos_key] < visibleInfo.start ||
246
- rect[pos_key] + rect[size_key] - 1 > visibleInfo.end
336
+ rect[pos_key] < rectStart ||
337
+ rect[pos_key] + rect[size_key] - 1 > rectEnd
247
338
  ) {
248
339
  return 1; // 部分可见
249
340
  } else {
@@ -251,6 +342,15 @@ export const setup = (
251
342
  }
252
343
  };
253
344
 
345
+ //判断是否是大于widget尺寸的item
346
+ const isLargeItem = (itemRect) => {
347
+ if (vertical) {
348
+ return itemRect.height > widgetRectInfo.contentHeight;
349
+ } else {
350
+ return itemRect.width > widgetRectInfo.contentWidth;
351
+ }
352
+ };
353
+
254
354
  //tools
255
355
  const lastOfArray = (array) => {
256
356
  if (array instanceof Array && array.length > 0) {
@@ -304,6 +404,11 @@ export const setup = (
304
404
  });
305
405
  });
306
406
 
407
+ if (props.fullDisplayMode) {
408
+ const totalSize = metroTemplate.getBoundingBoxSize();
409
+ visibleInfo.range = totalSize[size_key];
410
+ }
411
+
307
412
  //更新touch的size
308
413
  updateTouchDivSize();
309
414
 
@@ -315,12 +420,11 @@ export const setup = (
315
420
  const preRect =
316
421
  getItemById(focusId)?.templateInfo?.layoutCache.getPreRect();
317
422
  if (preRect) {
423
+ //anchorPosition记录之前anchor的布局位置,而不是视口位置
318
424
  anchorInfo = {
319
425
  anchorPosition:
320
426
  preRect[pos_key] +
321
- preRect[size_key] * animInfo.anchor -
322
- 1 -
323
- visibleInfo.start,
427
+ preRect[size_key] * animInfo.anchor - 1,
324
428
  anchor: animInfo.anchor,
325
429
  };
326
430
  }
@@ -335,6 +439,7 @@ export const setup = (
335
439
 
336
440
  /* 两种改变方式: 直接指定Position; 通过targetRect计算 */
337
441
  let targetRect = null;
442
+ let cachePreWhenCal = true;
338
443
  let direction = undefined;
339
444
 
340
445
  let validSlideTask = false;
@@ -386,6 +491,9 @@ export const setup = (
386
491
  const index = slideTask.params.index;
387
492
  templateItemAdder.tryAddItemByIndex(index);
388
493
  const targetItem = getItemByIndex(index);
494
+ if (targetItem.itemConfig.itemSlide != METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS) {
495
+ cachePreWhenCal = false;
496
+ }
389
497
  if (targetItem) {
390
498
  if (typeof slideTask.params.direction != "undefined") {
391
499
  direction = slideTask.params.direction;
@@ -405,6 +513,11 @@ export const setup = (
405
513
  targetRect = slideTask.params.rect;
406
514
  }
407
515
  break;
516
+ case SlideTaskType.SLIDE_BY_POS_NORMALIZE:
517
+ const position = slideTask.params.position;
518
+ templateItemAdder.tryAddItemByPosition(position);
519
+ targetVisibleStart = normalizeVisibleStart(position, visibleInfo);
520
+ break;
408
521
  default:
409
522
  break;
410
523
  }
@@ -416,45 +529,48 @@ export const setup = (
416
529
  if (anchorInfo) {
417
530
  //保持anchor
418
531
  const focusItem = getItemById(focusId);
419
- let start =
420
- focusItem.templateInfo[pos_key] +
421
- focusItem.templateInfo[size_key] * anchorInfo.anchor -
422
- 1 -
423
- anchorInfo.anchorPosition;
532
+ //新旧item anchor之间的差值
533
+ let delta = focusItem.templateInfo[pos_key] +
534
+ focusItem.templateInfo[size_key] * anchorInfo.anchor -
535
+ 1 -
536
+ anchorInfo.anchorPosition;
537
+
538
+ //delta是新旧item anchor之间的差值,需要转换为视口位置
539
+ let start = visibleInfo.start + delta;
424
540
  let totalSize = metroTemplate.getBoundingBoxSize();
425
541
  start = Math.min(
426
542
  Math.max(0, start),
427
543
  totalSize[size_key] - visibleInfo.range
428
544
  );
429
545
  //resize的情况下, 需要保证第一个和最后一个尺寸变化后, 能完整展示
430
- if (focusItem.index == 0) {
431
- if (start > focusItem.templateInfo[pos_key]) {
432
- start = 0;
433
- }
434
- } else if (
435
- focusItem.templateInfo.index == metroTemplate.getTailItemIndex()
436
- ) {
437
- if (start + visibleInfo.range > focusItem.templateInfo[pos_key]) {
438
- start = Math.max(
439
- focusItem.templateInfo[size_key] +
440
- focusItem.templateInfo[pos_key] -
441
- visibleInfo.range,
442
- 0
443
- );
546
+ if (JsvInteractionMode.value != TOUCH_MODE) {
547
+ if (focusItem.index == 0) {
548
+ if (start > focusItem.templateInfo[pos_key]) {
549
+ start = 0;
550
+ }
551
+ } else if (
552
+ focusItem.templateInfo.index == metroTemplate.getTailItemIndex()
553
+ ) {
554
+ if (start + visibleInfo.range > focusItem.templateInfo[pos_key]) {
555
+ start = Math.max(
556
+ focusItem.templateInfo[size_key] +
557
+ focusItem.templateInfo[pos_key] -
558
+ visibleInfo.range,
559
+ 0
560
+ );
561
+ }
444
562
  }
445
563
  }
446
- targetVisibleStart = normalizeVisibleStart(
447
- start,
448
- focusItem.templateInfo,
449
- focusItem.templateInfo.index,
450
- visibleInfo
451
- );
564
+ targetVisibleStart = normalizeVisibleStart(start, visibleInfo);
565
+ slideDoAnim = resizeAnimInfo.doAnim;
452
566
  } else {
453
- targetRect = getItemById(focusId).templateInfo;
567
+ //260410fix: 触控的时候不需要做把item移动到可见位置的逻辑
568
+ if (JsvInteractionMode.value != TOUCH_MODE) {
569
+ targetRect = getItemById(focusId)?.templateInfo;
570
+ slideDoAnim = resizeAnimInfo.doAnim;
571
+ }
454
572
  }
455
- slideDoAnim = resizeAnimInfo.doAnim;
456
573
  }
457
-
458
574
  if (targetRect) {
459
575
  const v = visibleInfo.copy();
460
576
  let preInfo = null;
@@ -464,7 +580,7 @@ export const setup = (
464
580
  if (preInfo) {
465
581
  let totalSize = metroTemplate.getBoundingBoxSize();
466
582
  v.start = Math.min(
467
- Math.max(0, targetRect[pos_key] - preInfo[pos_key] + v.start),
583
+ v.start,
468
584
  Math.max(0, totalSize[size_key] - v.range)
469
585
  );
470
586
  preInfo[pos_key] += v.start - visibleInfo.start;
@@ -475,7 +591,8 @@ export const setup = (
475
591
  direction,
476
592
  targetRect,
477
593
  v,
478
- preInfo
594
+ preInfo,
595
+ cachePreWhenCal
479
596
  );
480
597
  } else {
481
598
  //resize通过anchor直接设置了visibleStart
@@ -507,14 +624,19 @@ export const setup = (
507
624
 
508
625
  //updatePage
509
626
  let updateHandler;
627
+ let updatePageRange = {
628
+ start: visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
629
+ end: visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
630
+ };
510
631
  taskManager.run(() => {
511
632
  updateHandler = pageUpdater.update(
512
633
  metroTemplate,
513
- visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
514
- visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
634
+ updatePageRange.start,
635
+ updatePageRange.end,
515
636
  focusId,
516
637
  mergeTmp,
517
- permanentItemList
638
+ permanentItemList,
639
+ props.fullDisplayMode
518
640
  );
519
641
  return () => {
520
642
  updateHandler.recover();
@@ -553,7 +675,7 @@ export const setup = (
553
675
  });
554
676
  };
555
677
 
556
- if (renderItem.mounted.value) {
678
+ if (toRaw(renderItem.mounted).value) {
557
679
  doItemSlide(renderItem.rootDiv);
558
680
  } else {
559
681
  taskManager.run(() => {
@@ -586,6 +708,15 @@ export const setup = (
586
708
  };
587
709
  }
588
710
  executeSlide(visibleInfo.start, animInfo, updateHandler);
711
+ } else {
712
+ //不滚动的时候检查是否已经更新可视的item
713
+ const applyedRange = pageUpdater.getApplyedRange();
714
+ if (
715
+ applyedRange.start != updatePageRange.start ||
716
+ applyedRange.end != updatePageRange.end
717
+ ) {
718
+ updateHandler.apply();
719
+ }
589
720
  }
590
721
 
591
722
  //回调
@@ -609,6 +740,16 @@ export const setup = (
609
740
  };
610
741
  });
611
742
  }
743
+ if (resizeList.length > 0 && props.onSizeChange) {
744
+ taskManager.run(() => {
745
+ const handler = setTimeout(() => {
746
+ _onSizeChange();
747
+ }, 0);
748
+ return () => {
749
+ clearTimeout(handler);
750
+ };
751
+ });
752
+ }
612
753
  };
613
754
  const taskManager = new TaskManager(onAddTask);
614
755
  const animationManager = new AnimationManager();
@@ -648,6 +789,7 @@ export const setup = (
648
789
  } else {
649
790
  updateHandler.apply();
650
791
  }
792
+ _syncOnScroll();
651
793
  taskManager.run(() => {
652
794
  const handler = setTimeout(() => {
653
795
  _onScroll();
@@ -695,6 +837,18 @@ export const setup = (
695
837
  };
696
838
  };
697
839
 
840
+ const _getPostionRelativeToRoot = (index) => {
841
+ let templateInfo = getItemByIndex(index).templateInfo;
842
+ let x_offset = vertical ? 0 : -visibleInfo.start;
843
+ let y_offset = vertical ? -visibleInfo.start : 0;
844
+ return {
845
+ left: templateInfo.left + x_offset + widgetRectInfo.padding.left,
846
+ top: templateInfo.top + y_offset + widgetRectInfo.padding.top,
847
+ width: templateInfo.width,
848
+ height: templateInfo.height,
849
+ };
850
+ };
851
+
698
852
  const _getPosition = (index) => {
699
853
  let templateInfo = getItemByIndex(index).templateInfo;
700
854
  let x_offset = vertical ? 0 : -visibleInfo.start;
@@ -767,38 +921,57 @@ export const setup = (
767
921
  if (!item) {
768
922
  return;
769
923
  }
770
- if (isFocus) {
924
+ if (isFocus.value) {
771
925
  item.onClick();
772
926
  }
773
927
  };
774
928
 
775
929
  const onItemBlur = (blurItem) => {
776
930
  if (!blurItem) return;
777
- setItemZIndex(blurItem, 0, false);
778
- if (isFocus) {
931
+ if (isFocus.value) {
779
932
  blurItem.onBlur();
780
933
  }
781
934
  };
782
935
 
936
+ const onItemIgnore = (item) => {
937
+ if (!item) return;
938
+ setItemZIndex(item, 0, false);
939
+ item.onIgnore();
940
+ }
941
+
783
942
  let gazeIndex = -1;
943
+ let preGazeIndex = -1;
944
+ let callGazeAfterUpdate = false;
945
+ const onItemGaze = (item, rect) => {
946
+ if (!item || item.index == gazeIndex) { return; }
947
+ setItemZIndex(item, innerData.length, true);
948
+ preGazeIndex = gazeIndex;
949
+ gazeIndex = item.index;
950
+ if (toRaw(item.mounted).value) {
951
+ item.onGaze(rect);
952
+ } else {
953
+ callGazeAfterUpdate = true;
954
+ }
955
+ }
956
+
957
+ let topZItemIndex = -1;
784
958
  const onItemFocus = (focusItem, rect) => {
785
959
  //触控模式不触发item的onFocus
786
- if (!focusItem) return;
960
+ if (!focusItem) return false;
961
+ if (topZItemIndex != focusItem.index) {
962
+ setItemZIndex(getItemByIndex(topZItemIndex), 0, false);
963
+ }
787
964
  setItemZIndex(focusItem, innerData.length, true);
788
- if (isFocus) {
965
+ topZItemIndex = focusItem.index;
966
+ if (JsvInteractionMode.value == KEY_MODE && isFocus.value) {
789
967
  _itemOnFocusSideEffect(focusItem, rect);
968
+ if (spatialNavigator) {
969
+ spatialNavigator.setFocus(focusItem.getSpatialNavNode());
970
+ }
790
971
  }
791
972
 
792
- if (focusItem.mounted.value) {
793
- if (gazeIndex != focusItem.templateInfo.index) {
794
- let preGazeItem = getItemByIndex(gazeIndex);
795
- if (preGazeItem) {
796
- preGazeItem.onIgnore();
797
- }
798
- gazeIndex = focusItem.templateInfo.index;
799
- focusItem.onGaze(rect);
800
- }
801
- if (isFocus) {
973
+ if (toRaw(focusItem.mounted).value) {
974
+ if (JsvInteractionMode.value == KEY_MODE && isFocus.value) {
802
975
  focusItem.onFocus(rect);
803
976
  }
804
977
  return true;
@@ -812,7 +985,7 @@ export const setup = (
812
985
  if (!item) {
813
986
  return;
814
987
  }
815
- if (isFocus) {
988
+ if (isFocus.value) {
816
989
  item.onLongPress();
817
990
  }
818
991
  };
@@ -822,7 +995,7 @@ export const setup = (
822
995
  if (gazeIndex != gazeItem.templateInfo.index) {
823
996
  let preGazeItem = getItemByIndex(gazeIndex);
824
997
  if (preGazeItem) {
825
- preGazeItem.onIgnore();
998
+ onItemIgnore(preGazeItem);
826
999
  }
827
1000
  gazeIndex = gazeItem.templateInfo.index;
828
1001
  gazeItem.onGaze(null);
@@ -853,6 +1026,7 @@ export const setup = (
853
1026
  if (id == focusId || innerData.length <= 0) {
854
1027
  return;
855
1028
  }
1029
+ mRectCache.clean();
856
1030
  //有外部触发的滚动时, 取消load
857
1031
  tryCancelDelayLoad();
858
1032
  templateItemAdder.tryAddItemById(id);
@@ -861,7 +1035,9 @@ export const setup = (
861
1035
  const nextTemplateInfo = next_focus_item.templateInfo;
862
1036
  _changeFocusId(nextTemplateInfo.id);
863
1037
  const preFocusItem = getItemById(preFocusId);
1038
+ onItemIgnore(preFocusItem)
864
1039
  onItemBlur(preFocusItem);
1040
+ onItemGaze(next_focus_item, preEdgeRect);
865
1041
  onItemFocus(next_focus_item, preEdgeRect);
866
1042
  if (needSlide) {
867
1043
  slideToItem(id2Index(id), doAnim);
@@ -873,19 +1049,20 @@ export const setup = (
873
1049
  }
874
1050
  }
875
1051
 
876
- const curTemplateInfo = getItemById(focusId).templateInfo;
877
-
878
- let x_off_set = curTemplateInfo.left - nextTemplateInfo.left;
879
- let y_off_set = curTemplateInfo.top - nextTemplateInfo.top;
880
- preEdgeRect = {
881
- direction: null,
882
- rect: {
883
- x: x_off_set,
884
- y: y_off_set,
885
- width: curTemplateInfo.width,
886
- height: curTemplateInfo.height,
887
- },
888
- };
1052
+ const curTemplateInfo = getItemById(focusId)?.templateInfo;
1053
+ if (curTemplateInfo) {
1054
+ let x_off_set = curTemplateInfo.left - nextTemplateInfo.left;
1055
+ let y_off_set = curTemplateInfo.top - nextTemplateInfo.top;
1056
+ preEdgeRect = {
1057
+ direction: null,
1058
+ rect: {
1059
+ x: x_off_set,
1060
+ y: y_off_set,
1061
+ width: curTemplateInfo.width,
1062
+ height: curTemplateInfo.height,
1063
+ },
1064
+ };
1065
+ }
889
1066
  unlock?.();
890
1067
  }
891
1068
  };
@@ -950,7 +1127,7 @@ export const setup = (
950
1127
 
951
1128
  targetItem.itemConfig.focusZIndex = f;
952
1129
  targetItem.itemConfig.normalZIndex = n;
953
- const focused = isFocus && focusId == index2Id(index);
1130
+ const focused = isFocus.value && focusId == index2Id(index);
954
1131
  setItemZIndex(targetItem, focused ? f : n, focused);
955
1132
  }
956
1133
  };
@@ -960,6 +1137,9 @@ export const setup = (
960
1137
  doAnim,
961
1138
  updateParam = { mergeTmp: false }
962
1139
  ) => {
1140
+ if (props.fullDisplayMode) {
1141
+ return;
1142
+ }
963
1143
  if (
964
1144
  slideLock ||
965
1145
  position == (vertical ? slideDivTop.value : slideDivLeft.value)
@@ -986,6 +1166,9 @@ export const setup = (
986
1166
  preItem = undefined,
987
1167
  force = false
988
1168
  ) => {
1169
+ if (props.fullDisplayMode) {
1170
+ return;
1171
+ }
989
1172
  taskManager.addTask(
990
1173
  TaskType.SLIDE,
991
1174
  {
@@ -1006,6 +1189,9 @@ export const setup = (
1006
1189
  slideToDivInner(div, doAnim);
1007
1190
  };
1008
1191
  const slideToDivInner = (div, doAnim, direction = undefined) => {
1192
+ if (props.fullDisplayMode) {
1193
+ return;
1194
+ }
1009
1195
  if (div) {
1010
1196
  taskManager.addTask(
1011
1197
  TaskType.SLIDE,
@@ -1019,6 +1205,9 @@ export const setup = (
1019
1205
  }
1020
1206
  };
1021
1207
  const slideToRectInner = (rect, doAnim, direction, force) => {
1208
+ if (props.fullDisplayMode) {
1209
+ return;
1210
+ }
1022
1211
  if (
1023
1212
  rect &&
1024
1213
  typeof rect.left == "number" &&
@@ -1038,6 +1227,18 @@ export const setup = (
1038
1227
  );
1039
1228
  }
1040
1229
  };
1230
+
1231
+ const slideToNormalize = (position, doAnim) => {
1232
+ if (props.fullDisplayMode) {
1233
+ return;
1234
+ }
1235
+ taskManager.addTask(
1236
+ TaskType.SLIDE,
1237
+ { position, doAnim },
1238
+ SlideTaskType.SLIDE_BY_POS_NORMALIZE
1239
+ );
1240
+ };
1241
+
1041
1242
  const slideToRect = (rect, doAnim, direction = undefined) => {
1042
1243
  slideToRectInner(rect, doAnim, direction, false);
1043
1244
  };
@@ -1066,26 +1267,23 @@ export const setup = (
1066
1267
  const refreshData = (forceUpdate, slideToFocus = "auto") => {
1067
1268
  //由于data不支持reactive, 因此数据的更新只通过provideData
1068
1269
  if (!props.provideData) {
1069
- console.error("refreshData: provideData is null.");
1270
+ errorLogger("refreshData: provideData is null.");
1070
1271
  return;
1071
1272
  }
1072
1273
  try {
1073
1274
  let newData = toRaw(safeProvideData()).concat();
1074
1275
  if (newData instanceof Array) {
1075
1276
  let maxSameIndex = -1;
1076
- let layoutChange = false;
1277
+ let layoutChange = 0; //0: 不需要更新布局, 1: 需要更新布局, 2: 仅删除数据
1077
1278
  let onlyDataChangeList = [];
1279
+ let preGazeId = index2Id(gazeIndex);
1078
1280
  let targetFocusId = focusId;
1281
+ let targetGazeIndex = gazeIndex;
1079
1282
  let curFocusItemChanged = true;
1080
1283
  if (newData.length == 0) {
1081
- layoutChange = true;
1082
- targetFocusId = -1;
1284
+ layoutChange = 1;
1285
+ cleanFocusStatus();
1083
1286
  } else {
1084
- if (focusId < 0) {
1085
- targetFocusId = 0;
1086
- } else if (focusId >= newData.length) {
1087
- targetFocusId = newData.length - 1;
1088
- }
1089
1287
  if (!forceUpdate) {
1090
1288
  const curFocusIndex = id2Index(focusId);
1091
1289
  for (let i = 0; i < dataList.length; ++i) {
@@ -1108,12 +1306,13 @@ export const setup = (
1108
1306
  } else {
1109
1307
  const newMeasureItem = props.measures(newItem);
1110
1308
  const oldMeasureItem = props.measures(oldItem);
1111
- layoutChange = ifLayoutChange(
1309
+ const changed = ifLayoutChange(
1112
1310
  props.layoutType,
1113
1311
  oldMeasureItem,
1114
1312
  newMeasureItem
1115
1313
  );
1116
- if (layoutChange) {
1314
+ if (changed) {
1315
+ layoutChange = 1;
1117
1316
  break;
1118
1317
  } else {
1119
1318
  if (i < innerData.length) {
@@ -1129,10 +1328,11 @@ export const setup = (
1129
1328
  } else {
1130
1329
  if (i >= newData.length) {
1131
1330
  //item减少需要布局改变
1132
- layoutChange = true;
1331
+ layoutChange = 2;
1133
1332
  break;
1134
1333
  } else {
1135
1334
  //数据中存在undefined item
1335
+ errorLogger("undefined item in data list.");
1136
1336
  throw new Error("undefined item in data list.", i, newData);
1137
1337
  }
1138
1338
  }
@@ -1140,14 +1340,13 @@ export const setup = (
1140
1340
  }
1141
1341
  }
1142
1342
 
1143
- // 刷新数据时, 重置gazeIndex
1144
- if (forceUpdate || curFocusItemChanged || targetFocusId != focusId) {
1145
- gazeIndex = -1;
1146
- }
1343
+ //判断是否需要重新onGaze
1344
+ let needReOnGaze = false;
1147
1345
  //更新template
1346
+ const oldDataCount = dataList.length;
1148
1347
  dataList = newData;
1149
1348
  dataKeyList = dataList.map((i) => i[DATA_ID_KEY]);
1150
- if (forceUpdate || layoutChange) {
1349
+ if (forceUpdate || layoutChange == 1) {
1151
1350
  //需要更新布局
1152
1351
  pageUpdateToken.value++;
1153
1352
  //数据更改
@@ -1157,7 +1356,8 @@ export const setup = (
1157
1356
  props.direction,
1158
1357
  props.supportHistoryPath,
1159
1358
  props.layoutType,
1160
- templateMode
1359
+ templateMode,
1360
+ errorLogger
1161
1361
  );
1162
1362
  innerData = [];
1163
1363
  templateItemAdder = new TemplateItemAdder(
@@ -1167,116 +1367,179 @@ export const setup = (
1167
1367
  pageRange,
1168
1368
  _onTemplateItemAdd,
1169
1369
  props.name,
1170
- _onTemplateAddDone
1370
+ getOnTemplateAddDone(true),
1371
+ errorLogger
1171
1372
  );
1172
- if (props.onScroll || props.touchFlag > 0) {
1173
- templateItemAdder.tryAddItemByIndex(dataList.length - 1);
1373
+ if (props.onScroll || touchEnable.value || props.fullDisplayMode) {
1374
+ templateItemAdder.tryAddItemByIndex(dataList.length - 1, getOnTemplateAddDone(false));
1174
1375
  } else {
1175
- templateItemAdder.tryAddItemById(targetFocusId);
1376
+ //加到旧数据的个数,保险一点
1377
+ templateItemAdder.tryAddItemByIndex(Math.min(dataList.length, oldDataCount), getOnTemplateAddDone(false));
1176
1378
  }
1379
+ needReOnGaze = true;
1380
+ } else if (layoutChange == 2) {
1381
+ //仅删除
1382
+ templateItemAdder.removeItemTo(dataList.length);
1383
+ innerData.splice(dataList.length);
1177
1384
  } else {
1178
1385
  templateItemAdder.updateData(newData);
1179
1386
  if (maxSameIndex < newData.length - 1) {
1180
1387
  //追加数据
1181
- if (props.onScroll || props.touchFlag > 0) {
1182
- templateItemAdder.tryAddItemByIndex(dataList.length - 1);
1388
+ if (props.onScroll || touchEnable.value || props.fullDisplayMode) {
1389
+ templateItemAdder.tryAddItemByIndex(dataList.length - 1, getOnTemplateAddDone(false));
1183
1390
  } else {
1184
- templateItemAdder.tryAddItemById(targetFocusId);
1391
+ templateItemAdder.tryAddItemByIndex(Math.min(dataList.length, oldDataCount), getOnTemplateAddDone(false));
1185
1392
  }
1186
1393
  }
1394
+ }
1395
+ //更新focudId 和 gazeIndex
1396
+ let lastFocusableItemId = metroTemplate.idsMap.length - 1;
1187
1397
 
1188
- //仅用户数据变更
1189
- if (onlyDataChangeList.length > 0) {
1190
- for (let i of onlyDataChangeList) {
1191
- if (i.index < innerData.length) {
1192
- innerData[i.index].updateCustomData(
1193
- i.data,
1194
- _getItemConfigFromMeasursObj(i.measureObj)
1195
- );
1196
- innerData[i.index].enableTap = i.measureObj.enableTap ?? false;
1197
- } else {
1198
- //之后的数据未布局, 尚未添加到innerData中
1199
- break;
1398
+ if (lastFocusableItemId < 0) {
1399
+ targetFocusId = -1;
1400
+ targetGazeIndex = -1;
1401
+ } else {
1402
+ targetFocusId = Math.max(0, Math.min(lastFocusableItemId, focusId));
1403
+ targetGazeIndex = id2Index(Math.max(0, Math.min(lastFocusableItemId, preGazeId)));
1404
+ }
1405
+
1406
+ //仅用户数据变更
1407
+ if (onlyDataChangeList.length > 0) {
1408
+ for (let i of onlyDataChangeList) {
1409
+ if (i.index < innerData.length) {
1410
+ if (i.index == gazeIndex) {
1411
+ needReOnGaze = true;
1200
1412
  }
1413
+ innerData[i.index].updateCustomData(
1414
+ i.data,
1415
+ _getItemConfigFromMeasursObj(i.measureObj)
1416
+ );
1417
+ innerData[i.index].enableTap = i.measureObj.enableTap ?? false;
1418
+ } else {
1419
+ //之后的数据未布局, 尚未添加到innerData中
1420
+ break;
1201
1421
  }
1202
1422
  }
1203
1423
  }
1424
+
1425
+ //数据更新,清理缓存的范围信息,避免旧的范围与新的有冲突
1426
+ pageUpdater.cleanCache();
1204
1427
  //更新可视
1205
1428
  const updater = pageUpdater.update(
1206
1429
  metroTemplate,
1207
1430
  visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
1208
1431
  visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
1209
- focusId,
1432
+ index2Id(targetGazeIndex),
1210
1433
  false,
1211
- permanentItemList
1434
+ permanentItemList,
1435
+ props.fullDisplayMode
1212
1436
  );
1213
1437
  updater.apply();
1438
+ if (!renderData.value.some((i) => i.templateInfo.index == gazeIndex)) {
1439
+ needReOnGaze = false;
1440
+ }
1214
1441
 
1215
- //其他处理
1216
- if (mode.getMode() == TOUCH_MODE) {
1217
- //TODO touch模式的refresh还是有问题,
1218
- // 1. 点击删除item, 会触发onDragStart, 这里onDragStart正好更新了visibleInfo.start导致可以运行, 但这里还是要正确更新visibleInfo.start
1219
- // let divPos = vertical ? slideDivTop.value + freeMoveSlideGapTop : slideDivLeft.value + freeMoveSlideGapLeft;
1220
- // visibleInfo.start = getVisibleStart(data);
1442
+ let preVisibleStart = visibleInfo.start;
1443
+
1444
+ if (targetGazeIndex != gazeIndex || layoutChange == 2) {
1445
+ //仅在删除数据的时候更新, 其他情况都保留之前的滚动信息
1446
+ //由于template add done 回调里会更新box, 需要在template重新创建前, 重置所有的滚动信息
1447
+ visibleInfo = visibleInfo.copy();
1448
+ visibleInfo.start = 0;
1449
+ visibleInfo._startMax = 0;
1450
+ slideDivLeft.value = 0;
1451
+ slideDivTop.value = 0;
1452
+ }
1453
+
1454
+ let needSlide = false;
1455
+ let targetRect = mRectCache.getCurRect() ?? mRectCache.getPreRect();
1456
+ if (targetGazeIndex != gazeIndex) {
1457
+ needSlide = true;
1458
+ } else if (slideToFocus == "enable") {
1459
+ needSlide = true;
1460
+ } else if (slideToFocus == "disable") {
1461
+ needSlide = false;
1462
+ } else if (layoutChange == 2) {
1463
+ needSlide = true;
1221
1464
  } else {
1222
- //非触控模式的更新处理
1223
- //记录刷新前焦点的可视状态, 若焦点可视, 则刷新后也需要保证焦点的可视
1224
- let needSlide = false;
1225
- let targetRect = mRectCache.getCurRect() ?? mRectCache.getPreRect();
1226
- if (targetFocusId != focusId) {
1227
- needSlide = true;
1228
- } else if (slideToFocus == "enable") {
1229
- needSlide = true;
1230
- } else if (slideToFocus == "disable") {
1231
- needSlide = false;
1232
- } else {
1465
+ //保持原有焦点的位置
1466
+ if (JsvInteractionMode.value == KEY_MODE) {
1233
1467
  if (targetRect) {
1234
- needSlide = rectVisibleState(targetRect) !== 0;
1468
+ needSlide = rectVisibleState(targetRect) !== 2;
1235
1469
  } else {
1236
1470
  needSlide =
1237
- rectVisibleState(getItemById(focusId)?.templateInfo) !== 0;
1471
+ rectVisibleState(getItemByIndex(targetGazeIndex)?.templateInfo) !==
1472
+ 2;
1238
1473
  }
1474
+ } else {
1475
+ //touch模式下,不需要滑动
1239
1476
  }
1240
- if (targetFocusId != focusId) {
1241
- //由于template add done 回调里会更新box, 需要在template重新创建前, 重置所有的滚动信息
1242
- visibleInfo = visibleInfo.copy();
1243
- visibleInfo.start = 0;
1244
- visibleInfo._startMax = 0;
1245
- slideDivLeft.value = 0;
1246
- slideDivTop.value = 0;
1247
- }
1477
+ }
1478
+ if (targetFocusId != focusId) {
1479
+ //重置所有的滚动信息
1480
+ _changeFocusId(targetFocusId, false);
1481
+ }
1248
1482
 
1249
- if (targetFocusId != focusId) {
1250
- //重置所有的滚动信息
1251
- _changeFocusId(targetFocusId, false);
1483
+ const gazeItem = getItemByIndex(targetGazeIndex);
1484
+ const focusItem = getItemById(focusId);
1485
+ if (gazeItem) {
1486
+ //数据刷新时, 重置preEdgeRect, 否则再嵌套模式下, 会使用上一次的preEdgeRect, 导致子又findNearestByRect
1487
+ preEdgeRect = null;
1488
+ if (needSlide) {
1489
+ if (layoutChange == 2) {
1490
+ slideToNormalize(preVisibleStart, false);
1491
+ } else if (targetRect) {
1492
+ slideToRectInner(targetRect, false, 0, true);
1493
+ } else if (
1494
+ focusItem && focusItem.itemConfig.itemSlide ==
1495
+ METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS
1496
+ ) {
1497
+ //只有这个item是控制滚动的才slide, 其他如嵌套时不需要slide
1498
+ slideToItemInner(targetGazeIndex, false, 0, 0, true);
1499
+ }
1252
1500
  }
1501
+ } else {
1502
+ slideToInner(0, false);
1503
+ preEdgeRect = null;
1504
+ mRectCache.clean();
1505
+ }
1253
1506
 
1254
- const focusItem = getItemById(focusId);
1507
+ //与交互模式相关的处理
1508
+ if (JsvInteractionMode.value == TOUCH_MODE) {
1509
+ //TODO touch模式的refresh还是有问题,
1510
+ // 1. 点击删除item, 会触发onDragStart, 这里onDragStart正好更新了visibleInfo.start导致可以运行, 但这里还是要正确更新visibleInfo.start
1511
+ // let divPos = vertical ? slideDivTop.value + freeMoveSlideGapTop : slideDivLeft.value + freeMoveSlideGapLeft;
1512
+ // visibleInfo.start = getVisibleStart(data);
1513
+
1514
+ updateTouchBoxCondition();
1515
+ if (gazeIndex != targetGazeIndex) {
1516
+ gazeIndex = targetGazeIndex;
1517
+ }
1518
+ if (needReOnGaze) {
1519
+ getItemByIndex(gazeIndex)?.onGaze(null);
1520
+ }
1521
+ } else {
1522
+ if (gazeItem) {
1523
+ onItemGaze(gazeItem, null);
1524
+ }
1255
1525
  if (focusItem) {
1256
- //数据刷新时, 重置preEdgeRect, 否则再嵌套模式下, 会使用上一次的preEdgeRect, 导致子又findNearestByRect
1257
- preEdgeRect = null;
1258
1526
  onItemFocus(focusItem, null);
1259
- if (needSlide) {
1260
- if (targetRect) {
1261
- slideToRectInner(targetRect, false, 0, true);
1262
- } else if (
1263
- focusItem.itemConfig.itemSlide ==
1264
- METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS
1265
- ) {
1266
- //只有这个item是控制滚动的才slide, 其他如嵌套时不需要slide
1267
- slideToItemInner(id2Index(focusId), false, 0, 0, true);
1268
- }
1269
- }
1270
- } else {
1271
- slideToInner(0, false);
1272
- preEdgeRect = null;
1273
- mRectCache.clean();
1274
1527
  }
1275
1528
  }
1276
1529
  }
1277
1530
  } catch (e) {
1278
1531
  console.log(TAG, "refresh error", e);
1279
1532
  }
1533
+
1534
+ //refresh完成后, 重置renderBreak
1535
+ if (props.enableItemRenderBreak !== innerEnableRenderBreak) {
1536
+ nextTick(() => {
1537
+ innerEnableRenderBreak = props.enableItemRenderBreak;
1538
+ window.JsView?.setRenderBreakEnable?.(true);
1539
+ vRenderBreakChanged = false;
1540
+ });
1541
+ }
1542
+ _onSizeChange();
1280
1543
  };
1281
1544
 
1282
1545
  const getVisibleItems = () => {
@@ -1323,7 +1586,7 @@ export const setup = (
1323
1586
  ) {
1324
1587
  _moveToNext(0, 1);
1325
1588
  } else {
1326
- console.error(TAG, "moveFocus direction is invalid.", direction);
1589
+ errorLogger(TAG, "moveFocus direction is invalid.", direction);
1327
1590
  }
1328
1591
  };
1329
1592
 
@@ -1362,6 +1625,104 @@ export const setup = (
1362
1625
  }
1363
1626
  };
1364
1627
 
1628
+ let vRenderBreakChanged = false;
1629
+ const tmpDisableRenderBreak = () => {
1630
+ if (props.enableItemRenderBreak) {
1631
+ innerEnableRenderBreak = false;
1632
+ window.JsView?.setRenderBreakEnable?.(false);
1633
+ vRenderBreakChanged = true;
1634
+ }
1635
+ };
1636
+
1637
+ const getCurrentVisibleRange = () => {
1638
+ return {
1639
+ leftTop: {
1640
+ x: props.direction == VERTICAL ? 0 : visibleInfo.startWithPadding,
1641
+ y: props.direction == VERTICAL ? visibleInfo.startWithPadding : 0,
1642
+ },
1643
+ rightBottom: {
1644
+ x:
1645
+ props.direction == VERTICAL
1646
+ ? props.width
1647
+ : visibleInfo.endWithPadding,
1648
+ y:
1649
+ props.direction == VERTICAL
1650
+ ? visibleInfo.endWithPadding
1651
+ : props.height,
1652
+ },
1653
+ };
1654
+ };
1655
+
1656
+ //获取指定区间内可视item的树(MetroWidget嵌套时)
1657
+ const getItemVisibleState = (leftTop, rightBottom) => {
1658
+ //传过来的区域已经是真实区域了,不需要再减去padding
1659
+ const rangeStart =
1660
+ props.direction == VERTICAL
1661
+ ? leftTop.y
1662
+ : leftTop.x;
1663
+ const rangeEnd =
1664
+ props.direction == VERTICAL
1665
+ ? rightBottom.y
1666
+ : rightBottom.x;
1667
+ const [startIndex, endIndex] = metroTemplate.getVisibleItemList(
1668
+ rangeStart,
1669
+ rangeEnd,
1670
+ gazeIndex
1671
+ );
1672
+ const result = [];
1673
+ for (let index = startIndex; index <= endIndex; index++) {
1674
+ const item = getItemByIndex(index);
1675
+ if (item) {
1676
+ const s = rectVisibleState(item.templateInfo, rangeStart, rangeEnd);
1677
+ if (s == 0) {
1678
+ //getVisibleItemList返回的区间内可能还有不可见的item
1679
+ continue;
1680
+ }
1681
+ //rangeStart和rangeEnd转化为相对与item的相对位置
1682
+ const itemLeftTop = {
1683
+ x: item.templateInfo.left + widgetRectInfo.padding.left,
1684
+ y: item.templateInfo.top + widgetRectInfo.padding.top,
1685
+ };
1686
+ const newLeftTop = {
1687
+ x: leftTop.x - itemLeftTop.x,
1688
+ y: leftTop.y - itemLeftTop.y,
1689
+ };
1690
+ const newRightBottom = {
1691
+ x: rightBottom.x - itemLeftTop.x,
1692
+ y: rightBottom.y - itemLeftTop.y,
1693
+ };
1694
+ const itemVisibleState = item.onGetItemVisibleState(
1695
+ newLeftTop,
1696
+ newRightBottom
1697
+ );
1698
+ let info = {
1699
+ name: props.name,
1700
+ index: index,
1701
+ visibleState: s == 1 ? "partial" : "full",
1702
+ children: itemVisibleState ? itemVisibleState : [],
1703
+ widgetHandler: exportObject,
1704
+ focusable: item.templateInfo.focusable ?? true,
1705
+ };
1706
+ if (index == gazeIndex) {
1707
+ result.unshift(info);
1708
+ } else {
1709
+ result.push(info);
1710
+ }
1711
+ }
1712
+ }
1713
+ return result;
1714
+ };
1715
+
1716
+ const cleanFocusStatus = () => {
1717
+ preFocusId = -1;
1718
+ focusId = -1;
1719
+ gazeIndex = -1;
1720
+ };
1721
+
1722
+ const getParentWidgetHandler = () => {
1723
+ return parentMetroWidget?.at(-1)?.handler
1724
+ };
1725
+
1365
1726
  const exportObject = {
1366
1727
  lockSlide,
1367
1728
  unlockSlide,
@@ -1386,6 +1747,12 @@ export const setup = (
1386
1747
  cancelDelayLoad: tryCancelDelayLoad,
1387
1748
  setSensorSensitivity,
1388
1749
  getItemLayoutInfo: _getTemplatePosition,
1750
+ tmpDisableRenderBreak,
1751
+ getItemVisibleState,
1752
+ getCurrentVisibleRange,
1753
+ cleanFocusStatus,
1754
+ getParentWidgetHandler,
1755
+ getName: () => props.name,
1389
1756
  };
1390
1757
 
1391
1758
  const _calculateNearestItemByRect = (visibleSet, enter_rect_info) => {
@@ -1582,25 +1949,20 @@ export const setup = (
1582
1949
  };
1583
1950
 
1584
1951
  const onDispatchKeyDown = (ev) => {
1585
- if (mode.getMode() == TOUCH_MODE && !mode.duringTouch()) {
1586
- if (
1587
- ev.keyCode == 37 ||
1588
- ev.keyCode == 38 ||
1589
- ev.keyCode == 39 ||
1590
- ev.keyCode == 40
1591
- ) {
1592
- //只有在上下左右键切换为focus_mode
1593
- mode.keyDown();
1594
- //touch切换为focus的首次按键只显示焦点
1595
- const focusItem = _getVisibleFocusableItem();
1596
- if (focusItem) {
1597
- const preFocusItem = getItemById(focusId);
1598
- _changeFocusId(focusItem.id, false);
1599
- if (preFocusItem.id !== focusItem.id) {
1600
- onItemBlur(preFocusItem);
1601
- }
1602
- onItemFocus(focusItem);
1603
- }
1952
+ if (
1953
+ ev.keyCode == 37 ||
1954
+ ev.keyCode == 38 ||
1955
+ ev.keyCode == 39 ||
1956
+ ev.keyCode == 40
1957
+ ) {
1958
+ //fling过程中不处理按键
1959
+ if (touchStateMgr.duringFling()) {
1960
+ window.JsView?.changeInteractionMode?.("touch", "key");
1961
+ }
1962
+
1963
+ if (JsvInteractionMode.value == TOUCH_MODE) {
1964
+ JsvInteractionMode.value = KEY_MODE;
1965
+ touchStateMgr.touchEnd(touchStateMgr.getTouchCount());
1604
1966
  return true;
1605
1967
  }
1606
1968
  }
@@ -1659,11 +2021,9 @@ export const setup = (
1659
2021
  preStartKeyDownTime = ev.timeStamp;
1660
2022
  }
1661
2023
  tryCancelDelayLoad();
1662
- if (mode.getMode() == TOUCH_MODE) {
1663
- if (mode.duringTouch()) {
1664
- //touch过程中的按键不处理
1665
- return true;
1666
- }
2024
+ if (JsvInteractionMode.value == TOUCH_MODE && touchStateMgr.duringTouch()) {
2025
+ //touch过程中的按键不处理
2026
+ return true;
1667
2027
  }
1668
2028
 
1669
2029
  if (_moveByKey(ev.keyCode)) {
@@ -1672,7 +2032,7 @@ export const setup = (
1672
2032
  if (ev.keyCode == 13) {
1673
2033
  const curFocusItem = getItemById(focusId);
1674
2034
  clickDownReceived = true;
1675
- if (curFocusItem.itemConfig.enableLongPress) {
2035
+ if (curFocusItem?.itemConfig.enableLongPress) {
1676
2036
  if (
1677
2037
  ev.repeat &&
1678
2038
  ev.timeStamp - preStartKeyDownTime > LONGPRESS_TIMEOUT &&
@@ -1707,13 +2067,21 @@ export const setup = (
1707
2067
  }
1708
2068
  }
1709
2069
 
1710
- const _onTemplateAddDone = () => {
1711
- //update slideDiv size
1712
- let preTouchW = touchDivSize.width;
1713
- let preTouchH = touchDivSize.height;
1714
- updateTouchDivSize();
1715
- if (preTouchW !== touchDivSize.width || preTouchH !== touchDivSize.height) {
1716
- updateTouchBoxCondition();
2070
+ const getOnTemplateAddDone = (needUpdateBox) => {
2071
+ return () => {
2072
+ //update slideDiv size
2073
+ let preTouchW = touchDivSize.width;
2074
+ let preTouchH = touchDivSize.height;
2075
+ updateTouchDivSize();
2076
+ if (needUpdateBox) {
2077
+ if (preTouchW !== touchDivSize.width || preTouchH !== touchDivSize.height) {
2078
+ updateTouchBoxCondition();
2079
+ }
2080
+ }
2081
+ if (props.fullDisplayMode) {
2082
+ let size_key = vertical ? "height" : "width";
2083
+ visibleInfo.range = metroTemplate.getBoundingBoxSize()[size_key];
2084
+ }
1717
2085
  }
1718
2086
  };
1719
2087
 
@@ -1744,9 +2112,39 @@ export const setup = (
1744
2112
  measuresObj.itemSlide ?? METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS,
1745
2113
  showSkeleton: measuresObj.showSkeleton ?? true,
1746
2114
  enableLongPress: measuresObj.enableLongPress ?? props.enableLongPress,
2115
+ bindSpatialNav: measuresObj.bindSpatialNav ?? false,
1747
2116
  };
1748
2117
  };
1749
2118
 
2119
+ const rootPositionCache = {
2120
+ cacheToken: -1,
2121
+ cacheTargetDiv: undefined,
2122
+ cacheRect: undefined,
2123
+ }
2124
+ const getItemPositionWithCache = (token, target, itemIndex) => {
2125
+ if (!target || !rootDiv.value) {
2126
+ return undefined;
2127
+ }
2128
+ let rootRect;
2129
+ if (rootPositionCache.cacheToken === token
2130
+ && rootPositionCache.cacheTargetDiv === target
2131
+ && rootPositionCache.cacheRect) {
2132
+ rootRect = rootPositionCache.cacheRect;
2133
+ } else {
2134
+ rootRect = rootDiv.value.jsvGetRelativePosition(target);
2135
+ rootPositionCache.cacheToken = token;
2136
+ rootPositionCache.cacheTargetDiv = target;
2137
+ rootPositionCache.cacheRect = rootRect;
2138
+ }
2139
+ const itemRect = _getPostionRelativeToRoot(itemIndex);
2140
+ return {
2141
+ left: rootRect.left + itemRect.left,
2142
+ top: rootRect.top + itemRect.top,
2143
+ width: itemRect.width,
2144
+ height: itemRect.height,
2145
+ };
2146
+ }
2147
+
1750
2148
  const _onTemplateItemAdd = (customerData, templateItem, measuresObj) => {
1751
2149
  let itemConfig = _getItemConfigFromMeasursObj(measuresObj);
1752
2150
 
@@ -1764,6 +2162,12 @@ export const setup = (
1764
2162
  renderStyle,
1765
2163
  itemConfig,
1766
2164
  () => {
2165
+ if (callGazeAfterUpdate && item.index == gazeIndex) {
2166
+ nextTick(() => {
2167
+ item.onGaze(preEdgeRect);
2168
+ });
2169
+ callGazeAfterUpdate = false;
2170
+ }
1767
2171
  if (callFocusAfterUpdate && item.id === focusId) {
1768
2172
  nextTick(() => {
1769
2173
  onItemFocus(item, preEdgeRect);
@@ -1784,28 +2188,53 @@ export const setup = (
1784
2188
  },
1785
2189
  {
1786
2190
  onTap: onItemTap,
1787
- }
2191
+ getMwChain: () => {
2192
+ return metroWidgetChain;
2193
+ },
2194
+ name: props.name,
2195
+ getItemPositionWithCache,
2196
+ },
2197
+ props.renderAcc,
2198
+ innerEnableRenderBreak
1788
2199
  );
1789
2200
  item.enableTap = measuresObj.enableTap ?? false;
1790
2201
  // 占位图布局
1791
2202
  if (props.enableItemRenderBreak) {
1792
- if (measuresObj.placeHolderLayout
1793
- && typeof measuresObj.placeHolderLayout.left == "number"
1794
- && typeof measuresObj.placeHolderLayout.top == "number"
1795
- && typeof measuresObj.placeHolderLayout.width == "number"
1796
- && typeof measuresObj.placeHolderLayout.height == "number"
1797
- ) {
1798
- item.placeHolderLayout = Object.assign({}, measuresObj.placeHolderLayout);
1799
- } else {
1800
- item.placeHolderLayout = {
1801
- left: 0,
1802
- top: 0,
1803
- width: item.renderStyle.width - (props.placeHolderSetting.gap ?? 0),
1804
- height: item.renderStyle.height - (props.placeHolderSetting.gap ?? 0)
1805
- }
1806
- }
2203
+ let l, t, w, h, logoW, logoH;
2204
+ l =
2205
+ typeof measuresObj.placeHolderLayout?.left == "number"
2206
+ ? measuresObj.placeHolderLayout.left
2207
+ : 0;
2208
+ t =
2209
+ typeof measuresObj.placeHolderLayout?.top == "number"
2210
+ ? measuresObj.placeHolderLayout.top
2211
+ : 0;
2212
+ w =
2213
+ typeof measuresObj.placeHolderLayout?.width == "number"
2214
+ ? measuresObj.placeHolderLayout.width
2215
+ : item.renderStyle.width - (props.placeHolderSetting.gap ?? 0);
2216
+ h =
2217
+ typeof measuresObj.placeHolderLayout?.height == "number"
2218
+ ? measuresObj.placeHolderLayout.height
2219
+ : item.renderStyle.height - (props.placeHolderSetting.gap ?? 0);
2220
+ logoW =
2221
+ typeof measuresObj.placeHolderLayout?.logoWidth == "number"
2222
+ ? measuresObj.placeHolderLayout.logoWidth
2223
+ : props.placeHolderSetting.logoWidth ?? 0;
2224
+ logoH =
2225
+ typeof measuresObj.placeHolderLayout?.logoHeight == "number"
2226
+ ? measuresObj.placeHolderLayout.logoHeight
2227
+ : props.placeHolderSetting.logoHeight ?? 0;
2228
+ item.placeHolderLayout = {
2229
+ left: l,
2230
+ top: t,
2231
+ width: w,
2232
+ height: h,
2233
+ logoWidth: logoW,
2234
+ logoHeight: logoH,
2235
+ };
1807
2236
  }
1808
-
2237
+
1809
2238
  innerData.push(item);
1810
2239
  if (item.itemConfig.permanent) {
1811
2240
  permanentItemList.push({
@@ -1877,7 +2306,9 @@ export const setup = (
1877
2306
  fakeItem.templateInfo,
1878
2307
  direction,
1879
2308
  fakeItem.templateInfo,
1880
- visibleInfo
2309
+ visibleInfo,
2310
+ null,
2311
+ true,
1881
2312
  );
1882
2313
  if (cur_slide != visibleInfo.start) {
1883
2314
  slideToInner(cur_slide, true, {
@@ -1909,6 +2340,26 @@ export const setup = (
1909
2340
  }
1910
2341
  };
1911
2342
 
2343
+ const _innerOnEdge = (rect) => {
2344
+ if (props.onEdge) {
2345
+ if (typeof props.onEdge === "string") {
2346
+ if (props.onEdge === ONEDGE_TYPE.SPATIAL_NAV) {
2347
+ if (spatialNavigator) {
2348
+ spatialNavigator.moveTo(rect.direction);
2349
+ } else {
2350
+ console.warn("MetroWidget: onEdge is spatialNav, but spatialNavigator is not set", props.name);
2351
+ }
2352
+ } else {
2353
+ console.warn("MetroWidget: onEdge string is not valid", props.name, props.onEdge);
2354
+ }
2355
+ } else if (typeof props.onEdge === "function") {
2356
+ props.onEdge(rect);
2357
+ } else {
2358
+ console.warn("MetroWidget: onEdge is not a function nor a string", props.name);
2359
+ }
2360
+ }
2361
+ }
2362
+
1912
2363
  const _moveToNext = (
1913
2364
  horizontal_direction,
1914
2365
  vertical_direction,
@@ -1929,7 +2380,7 @@ export const setup = (
1929
2380
  console.warn(TAG, "moveToNext error");
1930
2381
  }
1931
2382
  if (direction) {
1932
- props.onEdge?.({
2383
+ _innerOnEdge({
1933
2384
  direction: direction,
1934
2385
  rect: {
1935
2386
  x: 0,
@@ -1983,7 +2434,9 @@ export const setup = (
1983
2434
  },
1984
2435
  };
1985
2436
  }
2437
+ onItemIgnore(preFocusItem)
1986
2438
  onItemBlur(preFocusItem);
2439
+ onItemGaze(next_focus_item, preEdgeRect);
1987
2440
  onItemFocus(next_focus_item, preEdgeRect);
1988
2441
 
1989
2442
  if (
@@ -2003,7 +2456,8 @@ export const setup = (
2003
2456
  visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
2004
2457
  next_focus_item.id,
2005
2458
  false,
2006
- permanentItemList
2459
+ permanentItemList,
2460
+ props.fullDisplayMode
2007
2461
  );
2008
2462
  //不做滚动时,保证获焦的item创建. 为了避免提前隐藏, 使用applyTmp
2009
2463
  updater.applyTmp();
@@ -2043,7 +2497,7 @@ export const setup = (
2043
2497
  };
2044
2498
  }
2045
2499
 
2046
- props.onEdge?.({
2500
+ _innerOnEdge({
2047
2501
  direction: edge,
2048
2502
  rect: rect,
2049
2503
  childEdgeInfo: item_edge_rect,
@@ -2054,7 +2508,7 @@ export const setup = (
2054
2508
  }
2055
2509
  };
2056
2510
 
2057
- const normalizeVisibleStart = (origin, targetRect, index, _visibleInfo) => {
2511
+ const normalizeVisibleStart = (origin, _visibleInfo) => {
2058
2512
  let pos_key = vertical ? "top" : "left";
2059
2513
  let size_key = vertical ? "height" : "width";
2060
2514
  let visibleStart = origin;
@@ -2094,10 +2548,11 @@ export const setup = (
2094
2548
  _direction,
2095
2549
  templateInfo,
2096
2550
  vInfo,
2097
- preInfo = null
2551
+ preInfo = null,
2552
+ cachePreRect = true
2098
2553
  ) => {
2099
2554
  if (!targetRect) {
2100
- console.error("MetroWidget: _calculateVisibleStart target item is null");
2555
+ errorLogger("MetroWidget: _calculateVisibleStart target item is null");
2101
2556
  return 0;
2102
2557
  }
2103
2558
  const curRect = {
@@ -2107,7 +2562,11 @@ export const setup = (
2107
2562
  height: targetRect.height,
2108
2563
  frameCount: Forge.sFrameCount.count,
2109
2564
  };
2110
- mRectCache.cache(curRect);
2565
+ if (cachePreRect) {
2566
+ mRectCache.cache(curRect);
2567
+ } else {
2568
+ mRectCache.clean();
2569
+ }
2111
2570
  let preRect = mRectCache.getPreRect();
2112
2571
  if (preInfo) {
2113
2572
  preRect = preInfo;
@@ -2154,7 +2613,7 @@ export const setup = (
2154
2613
  case SlideSetting.Type.WHOLE_PAGE:
2155
2614
  if (!templateInfo || typeof templateInfo.pageHeadIndex == "undefined") {
2156
2615
  //TODO 子控制滚动时whole page滚动
2157
- console.error(
2616
+ errorLogger(
2158
2617
  "child controlled whole page slide type is not supported."
2159
2618
  );
2160
2619
  } else {
@@ -2262,18 +2721,13 @@ export const setup = (
2262
2721
  }
2263
2722
  break;
2264
2723
  default:
2265
- console.error(
2724
+ errorLogger(
2266
2725
  "MetroWidget: undefined slide type",
2267
2726
  innerSlideSetting.Type
2268
2727
  );
2269
2728
  }
2270
2729
 
2271
- new_visible_start = normalizeVisibleStart(
2272
- new_visible_start,
2273
- targetRect,
2274
- templateInfo?.index,
2275
- vInfo
2276
- );
2730
+ new_visible_start = normalizeVisibleStart(new_visible_start, vInfo);
2277
2731
  return Math.round(new_visible_start);
2278
2732
  };
2279
2733
 
@@ -2304,38 +2758,43 @@ export const setup = (
2304
2758
  };
2305
2759
 
2306
2760
  const focusBlockOnFocus = (params) => {
2307
- isFocus = true;
2308
- if (innerData.length === 0) {
2309
- console.log(`MetroWidget: ${props.name} get focus while data is empty.`);
2761
+ if (JsvInteractionMode.value == TOUCH_MODE) {
2762
+ focusWhenInTouch = true;
2310
2763
  return;
2311
2764
  }
2312
-
2313
- let focus_id = index2Id(gazeIndex);
2314
- focus_id =
2315
- typeof enterFocusId !== "undefined" &&
2316
- enterFocusId >= 0 &&
2317
- enterFocusId < metroTemplate.size
2318
- ? enterFocusId
2765
+ isFocus.value = true;
2766
+
2767
+ if (innerData.length !== 0) {
2768
+ let focus_id = focusId;
2769
+ focus_id =
2770
+ typeof enterFocusId !== "undefined" &&
2771
+ enterFocusId >= 0 &&
2772
+ enterFocusId < metroTemplate.size
2773
+ ? enterFocusId
2774
+ : focus_id;
2775
+ focus_id = _ifValidEnterRect(enterFocusRect)
2776
+ ? _calculateNearestItemByRect(pageUpdater.getRange(), enterFocusRect)
2319
2777
  : focus_id;
2320
- focus_id = _ifValidEnterRect(enterFocusRect)
2321
- ? _calculateNearestItemByRect(pageUpdater.getRange(), enterFocusRect)
2322
- : focus_id;
2323
- preEdgeRect = enterFocusRect;
2324
- _changeFocusId(focus_id, false);
2325
- enterFocusId = -1;
2326
- enterFocusRect = null;
2327
- firstOnItemFocusCalled = onItemFocus(getItemById(focusId), preEdgeRect);
2778
+ preEdgeRect = enterFocusRect;
2779
+ _changeFocusId(focus_id, false);
2780
+ enterFocusId = -1;
2781
+ enterFocusRect = null;
2782
+ firstOnItemFocusCalled = onItemFocus(getItemById(focusId), preEdgeRect);
2783
+ } else {
2784
+ console.log(`MetroWidget: ${props.name} get focus while data is empty.`);
2785
+ }
2328
2786
  props.onFocus?.();
2329
2787
  };
2330
2788
 
2331
2789
  const focusBlockOnBlur = () => {
2790
+ focusWhenInTouch = false;
2332
2791
  enterFocusId = -1;
2333
2792
  enterFocusRect = null;
2334
2793
  preEdgeRect = null;
2335
2794
  preFocusId = focusId;
2336
2795
  onItemBlur(getItemById(preFocusId));
2337
2796
  props.onBlur?.();
2338
- isFocus = false;
2797
+ isFocus.value = false;
2339
2798
  mRectCache.clean();
2340
2799
  };
2341
2800
 
@@ -2348,11 +2807,44 @@ export const setup = (
2348
2807
  let newArray = tmpArray.map((item) => {
2349
2808
  return getItemByIndex(item);
2350
2809
  });
2351
- const newItemList = newArray.filter((i) => {
2352
- return !renderData.value?.includes(i);
2353
- });
2810
+ //新进的item
2811
+ newArray
2812
+ .filter((i) => {
2813
+ return !renderData.value?.includes(i);
2814
+ })
2815
+ .forEach((i) => {
2816
+ i.onInRenderRange();
2817
+ i.renderBreak = innerEnableRenderBreak;
2818
+ });
2819
+ //退出的item
2820
+ renderData.value
2821
+ .filter((i) => {
2822
+ return !newArray.includes(i);
2823
+ })
2824
+ .forEach((i) => {
2825
+ i.onOutOfRenderRange();
2826
+ if (spatialNavigator) {
2827
+ spatialNavigator.unregisterNode(i.getSpatialNavNode());
2828
+ }
2829
+ });
2830
+
2831
+ //注册spatial navigator
2832
+ if (spatialNavigator) {
2833
+ for (let item of newArray) {
2834
+ const visibleState = rectVisibleState(item.templateInfo);
2835
+ const n = item.getSpatialNavNode();
2836
+ if (visibleState == 2 || visibleState == 1) {
2837
+ if (n) {
2838
+ spatialNavigator.registerNode(n);
2839
+ }
2840
+ } else {
2841
+ spatialNavigator.unregisterNode(n);
2842
+ }
2843
+ }
2844
+ }
2845
+
2354
2846
  renderData.value = newArray;
2355
- if (props.enableItemRenderBreak) {
2847
+ if (innerEnableRenderBreak) {
2356
2848
  itemRender.value = false;
2357
2849
  const f = () => {
2358
2850
  // 关闭强制TriggerManualBlock,改为vue内部通过dom的任务数来确定是否执行打断
@@ -2367,25 +2859,67 @@ export const setup = (
2367
2859
 
2368
2860
  const _getVisibleFocusableItem = () => {
2369
2861
  let item = getItemByIndex(gazeIndex);
2370
- if (rectVisibleState(item.templateInfo) == 2) {
2371
- return item;
2862
+ if (item) {
2863
+ let itemVisibility = rectVisibleState(item.templateInfo);
2864
+ let isLarge = isLargeItem(item.templateInfo);
2865
+ if (itemVisibility == 2) {
2866
+ return item;
2867
+ }
2372
2868
  }
2869
+
2373
2870
  item = getItemById(focusId);
2374
- if (rectVisibleState(focusItem.templateInfo) == 2) {
2375
- return focusItem;
2871
+ if (item) {
2872
+ let itemVisibility = rectVisibleState(item.templateInfo);
2873
+ let isLarge = isLargeItem(item.templateInfo);
2874
+ if (itemVisibility == 2) {
2875
+ return item;
2876
+ }
2376
2877
  }
2878
+
2377
2879
  //遍历renderList, 找到第一个可见的 focusable item
2880
+ let resultItem = null;
2378
2881
  for (let item of renderData.value) {
2882
+ let itemVisibility = rectVisibleState(item.templateInfo);
2883
+ let isLarge = isLargeItem(item.templateInfo);
2379
2884
  if (
2380
2885
  item.templateInfo.focusable &&
2381
- rectVisibleState(item.templateInfo) == 2
2886
+ (itemVisibility == 2 || (itemVisibility == 1 && isLarge))
2382
2887
  ) {
2383
- return item;
2888
+ resultItem = item;
2889
+ break;
2384
2890
  }
2385
2891
  }
2892
+ if (resultItem == null) {
2893
+ //找到占空间最大的部分可视item;
2894
+ }
2386
2895
  return null;
2387
2896
  };
2388
2897
 
2898
+ let preSize = 0;
2899
+ const _onSizeChange = () => {
2900
+ if (props.fullDisplayMode) {
2901
+ nextTick(() => {
2902
+ let size = 0;
2903
+ if (innerData.length > 0) {
2904
+ const lastTemplateInfo =
2905
+ innerData[innerData.length - 1]?.templateInfo;
2906
+ if (vertical) {
2907
+ size = lastTemplateInfo.top + lastTemplateInfo.height - 1;
2908
+ } else {
2909
+ size = lastTemplateInfo.left + lastTemplateInfo.width - 1;
2910
+ }
2911
+ }
2912
+ if (size != preSize) {
2913
+ preSize = size;
2914
+ props.onSizeChange?.({
2915
+ width: vertical ? props.width : size,
2916
+ height: vertical ? size : props.height,
2917
+ });
2918
+ }
2919
+ });
2920
+ }
2921
+ };
2922
+
2389
2923
  const _onScroll = () => {
2390
2924
  if (props.onScroll) {
2391
2925
  const lastTemplateInfo = getItemByIndex(
@@ -2402,6 +2936,22 @@ export const setup = (
2402
2936
  props.onScroll(visibleInfo.start, visibleInfo.range, totalWidth);
2403
2937
  }
2404
2938
  };
2939
+ const _syncOnScroll = () => {
2940
+ if (props.syncOnScroll) {
2941
+ const lastTemplateInfo = getItemByIndex(
2942
+ metroTemplate.getTailItemIndex()
2943
+ )?.templateInfo;
2944
+ let totalWidth = 0;
2945
+ if (lastTemplateInfo) {
2946
+ if (vertical) {
2947
+ totalWidth = lastTemplateInfo.top + lastTemplateInfo.height - 1;
2948
+ } else {
2949
+ totalWidth = lastTemplateInfo.left + lastTemplateInfo.width - 1;
2950
+ }
2951
+ }
2952
+ props.syncOnScroll(visibleInfo.start, visibleInfo.range, totalWidth);
2953
+ }
2954
+ }
2405
2955
 
2406
2956
  //touch setting
2407
2957
  let actorController = null;
@@ -2523,17 +3073,23 @@ export const setup = (
2523
3073
  mergeTouchSlideToSlideDiv(touchCount);
2524
3074
  //由于movement的监听是有帧数间隔的, 所以结束时需要再调用一次onScroll
2525
3075
  _onScroll();
3076
+ _syncOnScroll();
2526
3077
  }
2527
3078
 
2528
3079
  const onTouchDown = (data, customData, nexusCustomData) => {
3080
+ const curPos = vertical ? slideDivTop.value : slideDivLeft.value;
3081
+ let needMerge = -visibleInfo.start != curPos;
3082
+ if (needMerge) {
3083
+ mergeTouchSlideToSlideDiv(touchRecorder.touchCount);
3084
+ }
3085
+
2529
3086
  touchRecorder.reset();
2530
3087
  let touchCount = getTouchCount(nexusCustomData);
2531
3088
  touchRecorder.setTouchCount(touchCount);
2532
3089
  updateTouchBoxCondition();
2533
3090
 
2534
- mode.touchStart(touchCount);
2535
- // console.log("touchtest", `${props.name} animId:${debugAnimId} viewId:${debugViewId}`,
2536
- // "onTouchDown", data, customData, nexusCustomData)
3091
+ JsvInteractionMode.value = TOUCH_MODE;
3092
+ touchStateMgr.touchStart(touchCount);
2537
3093
 
2538
3094
  // 运动方向锁定机制
2539
3095
  // 当MetroWidget在某一方向拖动后,讲另一方向的移动进行锁定
@@ -2569,9 +3125,6 @@ export const setup = (
2569
3125
  ]),
2570
3126
  ]);
2571
3127
 
2572
- //blur item
2573
- // onItemBlur(getItemById(focusId));
2574
-
2575
3128
  templateItemAdder.tryAddItemByPosition(visibleInfo.end + visibleInfo.range);
2576
3129
 
2577
3130
  const updater = pageUpdater.update(
@@ -2580,7 +3133,8 @@ export const setup = (
2580
3133
  visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
2581
3134
  0,
2582
3135
  false,
2583
- permanentItemList
3136
+ permanentItemList,
3137
+ props.fullDisplayMode
2584
3138
  );
2585
3139
  updater.apply();
2586
3140
 
@@ -2612,18 +3166,20 @@ export const setup = (
2612
3166
  );
2613
3167
  return reachConditionList;
2614
3168
  });
3169
+
3170
+ props.onTouchFocus?.();
2615
3171
  };
2616
3172
 
2617
3173
  const onTouchRelease = (touchCount) => {
2618
- if (mode.getTouchState() == TouchState.TAP) {
3174
+ if (touchStateMgr.getTouchState() == TouchState.TAP) {
2619
3175
  //只点击, 没有移动或者fling
2620
3176
  updateRenderItems(false, false);
2621
- mode.touchEnd(touchCount);
3177
+ touchStateMgr.touchEnd(touchCount);
2622
3178
  } else {
2623
- if (touchRecorder.moved && !mode.duringFling()) {
3179
+ if (touchRecorder.moved && !touchStateMgr.duringFling()) {
2624
3180
  onTouchActionDone(touchRecorder.touchCount);
2625
3181
  updateRenderItems(false, false);
2626
- mode.touchEnd(touchCount);
3182
+ touchStateMgr.touchEnd(touchCount);
2627
3183
  }
2628
3184
  }
2629
3185
  actorController.run((cmds) => [
@@ -2632,21 +3188,26 @@ export const setup = (
2632
3188
  ]);
2633
3189
  };
2634
3190
 
2635
- const exportOnTouchRelease = props.touchFlag > 0 ? onTouchRelease : undefined;
3191
+ const exportOnTouchRelease = touchEnable.value ? onTouchRelease : undefined;
2636
3192
 
2637
3193
  const onDragStart = (data, customData, nexusCustomData) => {
2638
3194
  let touchCount = getTouchCount(nexusCustomData);
2639
3195
  touchRecorder.move();
2640
- if (!(mode.getTouchCount() == touchCount && mode.duringFling())) {
3196
+ if (
3197
+ !(
3198
+ touchStateMgr.getTouchCount() == touchCount &&
3199
+ touchStateMgr.duringFling()
3200
+ )
3201
+ ) {
2641
3202
  //dragStart event may be triggered after fling event because of sending it when startMove condition is satisfied
2642
- mode.dragStart(touchCount);
3203
+ touchStateMgr.dragStart(touchCount);
2643
3204
  }
2644
3205
  visibleInfo.start = getVisibleStart(data);
2645
3206
  };
2646
3207
 
2647
3208
  const onDragEnd = (data, customData, nexusCustomData) => {
2648
3209
  let touchCount = getTouchCount(nexusCustomData);
2649
- mode.dragEnd(touchCount);
3210
+ touchStateMgr.dragEnd(touchCount);
2650
3211
  visibleInfo.start = getVisibleStart(data);
2651
3212
  actorController.run((cmds) => [
2652
3213
  cmds.state().removeConditionByGroup(reachAnchorGroup),
@@ -2656,7 +3217,7 @@ export const setup = (
2656
3217
  const onFlingStart = (data, customData, nexusCustomData) => {
2657
3218
  let touchCount = getTouchCount(nexusCustomData);
2658
3219
  touchRecorder.move();
2659
- mode.flingStart(touchCount);
3220
+ touchStateMgr.flingStart(touchCount);
2660
3221
  visibleInfo.start = getVisibleStart(data);
2661
3222
  updateRenderItems(true, true);
2662
3223
  };
@@ -2670,12 +3231,12 @@ export const setup = (
2670
3231
  const onFlingEnd = (data, customData, nexusCustomData) => {
2671
3232
  visibleInfo.start = getVisibleStart(data);
2672
3233
  //记录拖拽的距离
2673
- if (mode.duringFling()) {
3234
+ if (touchStateMgr.duringFling()) {
2674
3235
  let touchCount = getTouchCount(nexusCustomData);
2675
3236
  onTouchActionDone(touchCount);
2676
3237
  updateRenderItems(false, false);
2677
- mode.flingEnd(touchCount);
2678
- mode.touchEnd(touchCount);
3238
+ touchStateMgr.flingEnd(touchCount);
3239
+ touchStateMgr.touchEnd(touchCount);
2679
3240
  }
2680
3241
  };
2681
3242
 
@@ -2684,6 +3245,16 @@ export const setup = (
2684
3245
  visibleInfo.start = getVisibleStart(data);
2685
3246
  };
2686
3247
 
3248
+ const onFlingCancel = (data, customData, nexusCustomData) => {
3249
+ visibleInfo.start = getVisibleStart(data);
3250
+ if (touchStateMgr.duringFling()) {
3251
+ let touchCount = getTouchCount(nexusCustomData);
3252
+ onTouchActionDone(touchCount);
3253
+ updateRenderItems(false, false);
3254
+ touchStateMgr.flingEnd(touchCount);
3255
+ }
3256
+ };
3257
+
2687
3258
  const getTouchWall = () => {
2688
3259
  const boxSize = metroTemplate.getBoundingBoxSize();
2689
3260
  let wall = {
@@ -2692,6 +3263,9 @@ export const setup = (
2692
3263
  right: 0,
2693
3264
  bottom: 0,
2694
3265
  };
3266
+ if (props.fullDisplayMode) {
3267
+ return wall;
3268
+ }
2695
3269
  if (vertical) {
2696
3270
  wall.top =
2697
3271
  -boxSize.height +
@@ -2727,16 +3301,16 @@ export const setup = (
2727
3301
  visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
2728
3302
  0,
2729
3303
  true,
2730
- permanentItemList
3304
+ permanentItemList,
3305
+ props.fullDisplayMode
2731
3306
  );
2732
3307
  applyTmp ? updater.applyTmp() : updater.apply();
2733
3308
  };
2734
3309
 
2735
3310
  const updateTouchBoxCondition = () => {
2736
- if (mode.getMode() != TOUCH_MODE) return;
3311
+ if (JsvInteractionMode.value != TOUCH_MODE) return;
2737
3312
  if (actorController != null) {
2738
3313
  const walls = getTouchWall();
2739
-
2740
3314
  //更新wall设置
2741
3315
  actorController.run((cmds) => [
2742
3316
  cmds.state().removeConditionByGroup(wallConditionGroup),
@@ -2763,8 +3337,6 @@ export const setup = (
2763
3337
  },
2764
3338
  };
2765
3339
 
2766
- const metroWidgetToken = metroWidgetTokenGen++;
2767
-
2768
3340
  let orderTouchSlideCallbacks;
2769
3341
  const SliderEditFuncReOrderWrap = (callback, addHeader = false) => {
2770
3342
  return (...args) => {
@@ -2777,16 +3349,13 @@ export const setup = (
2777
3349
  };
2778
3350
  };
2779
3351
 
2780
- //TODO debug
2781
- // let debugAnimId = -1;
2782
- // let debugViewId = -1
2783
- let touchInited = false;
2784
- const initTouch = () => {
2785
- touchInited = true;
3352
+ let freeMoveInited = false
3353
+ function initFreeMove() {
3354
+ if (freeMoveInited) { return; }
3355
+ freeMoveInited = true;
2786
3356
  actorController = new ActorControl();
2787
3357
  const divView = touchDiv.value.jsvGetProxyView();
2788
3358
  actorController.bindForgeView(divView, true);
2789
-
2790
3359
  // 对触控回调进行顺序管理
2791
3360
  orderTouchSlideCallbacks = new Array();
2792
3361
  actorController.addCondCycleListener(
@@ -2804,6 +3373,16 @@ export const setup = (
2804
3373
  orderTouchSlideCallbacks.length = 0;
2805
3374
  }
2806
3375
  );
3376
+ }
3377
+
3378
+ //TODO debug
3379
+ // let debugAnimId = -1;
3380
+ // let debugViewId = -1
3381
+ let touchInited = false;
3382
+ const initTouch = () => {
3383
+ if (touchInited) { return; }
3384
+ touchInited = true;
3385
+ initFreeMove();
2807
3386
 
2808
3387
  // debugAnimId = actorController.debugGetAnimId();
2809
3388
  // debugViewId = divView.ViewId;
@@ -2839,6 +3418,10 @@ export const setup = (
2839
3418
  .condition(undefined, true)
2840
3419
  .onFlingDrop()
2841
3420
  .then([SliderEditFuncReOrderWrap(onFlingDrop)]),
3421
+ cmds
3422
+ .condition(undefined, true)
3423
+ .onFlingCancel()
3424
+ .then([SliderEditFuncReOrderWrap(onFlingCancel)]),
2842
3425
  cmds
2843
3426
  .condition(undefined, true)
2844
3427
  .onTouchRelease()
@@ -2854,7 +3437,37 @@ export const setup = (
2854
3437
  }
2855
3438
  };
2856
3439
 
2857
- function cleanTouch() {
3440
+ const onMouseWheelScrollProgress = (data) => {
3441
+ visibleInfo.start = getVisibleStart(data);
3442
+ updateRenderItems(true, true);
3443
+ mergeTouchSlideToSlideDiv();
3444
+ };
3445
+
3446
+ const DEFAULT_MOUSE_CONFIG = {
3447
+ wheelRate: 10,
3448
+ }
3449
+ let mouseInited = false;
3450
+ const initMouse = () => {
3451
+ if (mouseInited) { return; }
3452
+ mouseInited = true;
3453
+ initFreeMove();
3454
+ const divView = touchDiv.value.jsvGetProxyView();
3455
+ if (!actorController) {
3456
+ actorController = new ActorControl();
3457
+ actorController.bindForgeView(divView, true);
3458
+ }
3459
+ // 1: hover, 2: scroll, 目前只打开scroll
3460
+ divView.HoverEnables(2);
3461
+ divView.SetMouseWheelRate(props.mouseConfig?.wheelRate ?? DEFAULT_MOUSE_CONFIG.wheelRate);
3462
+ actorController.run((cmds) => [
3463
+ cmds
3464
+ .condition(undefined, true)
3465
+ .onMouseWheelScrollProgress()
3466
+ .then([SliderEditFuncReOrderWrap(onMouseWheelScrollProgress)]),
3467
+ ]);
3468
+ };
3469
+
3470
+ function cleanFreeMoveConditions() {
2858
3471
  actorController.run((cmds) => [
2859
3472
  cmds.state().clearAllConditions(),
2860
3473
  cmds.state().touchLockSwitch(false, vertical ? 1 : 2),
@@ -2895,9 +3508,10 @@ export const setup = (
2895
3508
  pageRange,
2896
3509
  _onTemplateItemAdd,
2897
3510
  props.name,
2898
- _onTemplateAddDone
3511
+ getOnTemplateAddDone(true),
3512
+ errorLogger
2899
3513
  );
2900
- if (props.onScroll) {
3514
+ if (props.onScroll || props.fullDisplayMode) {
2901
3515
  templateItemAdder.tryAddItemByIndex(dataList.length - 1);
2902
3516
  } else {
2903
3517
  templateItemAdder.tryAddItem(null, 2);
@@ -2919,7 +3533,9 @@ export const setup = (
2919
3533
  item.templateInfo,
2920
3534
  0,
2921
3535
  item.templateInfo,
2922
- visibleInfo
3536
+ visibleInfo,
3537
+ null,
3538
+ false
2923
3539
  );
2924
3540
  }
2925
3541
  }
@@ -2935,12 +3551,13 @@ export const setup = (
2935
3551
  initVisibleInfo.endWithPadding,
2936
3552
  0,
2937
3553
  false,
2938
- permanentItemList
3554
+ permanentItemList,
3555
+ props.fullDisplayMode
2939
3556
  );
2940
3557
  initUpdater.apply();
2941
3558
  //触控时, 延时加载剩余屏
2942
3559
  let delayLoadHandler = -1;
2943
- if (props.touchFlag > 0) {
3560
+ if (touchEnable.value) {
2944
3561
  delayLoadHandler = setTimeout(() => {
2945
3562
  const updateHandler = pageUpdater.update(
2946
3563
  metroTemplate,
@@ -2948,7 +3565,8 @@ export const setup = (
2948
3565
  initVisibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
2949
3566
  focusId,
2950
3567
  false,
2951
- permanentItemList
3568
+ permanentItemList,
3569
+ props.fullDisplayMode
2952
3570
  );
2953
3571
  updateHandler.apply();
2954
3572
  }, 200);
@@ -2963,28 +3581,74 @@ export const setup = (
2963
3581
  if (!firstOnItemFocusCalled) {
2964
3582
  firstOnItemFocusCalled = onItemFocus(getItemById(focusId), preEdgeRect);
2965
3583
  }
3584
+ //第一次ongaze
3585
+ onItemGaze(getItemById(focusId), preEdgeRect);
2966
3586
 
2967
3587
  if (props.enableItemRenderBreak) {
2968
3588
  nextTick(() => {
2969
3589
  itemRender.value = true;
2970
3590
  });
2971
3591
  }
2972
- if (props.touchFlag === 1) {
3592
+ if (touchEnable.value) {
2973
3593
  initTouch();
2974
3594
  }
3595
+ if (props.mouseFlag > 0) {
3596
+ initMouse();
3597
+ }
3598
+ _onSizeChange();
2975
3599
  });
2976
3600
 
2977
3601
  onUpdated(() => {});
2978
3602
 
2979
3603
  onBeforeUnmount(() => {
3604
+ if (vRenderBreakChanged) {
3605
+ window.JsView?.setRenderBreakEnable?.(true);
3606
+ }
2980
3607
  taskManager.cancelAllTask();
2981
3608
  tryCancelDelayLoad();
2982
3609
  mounted = false;
2983
- if (touchInited) {
2984
- cleanTouch();
3610
+ if (touchInited || mouseInited) {
3611
+ cleanFreeMoveConditions();
3612
+ }
3613
+ if (rootNativeViewId != -1) {
3614
+ Forge.sViewStore.remove(rootNativeViewId);
3615
+ }
3616
+ if (spatialNavigator) {
3617
+ renderData.value.forEach((item) => {
3618
+ spatialNavigator.unregisterNode(item.getSpatialNavNode());
3619
+ });
2985
3620
  }
2986
3621
  });
2987
3622
 
3623
+ //spatial navigator相关
3624
+ //作为子MetroWidget时的index
3625
+ let selfChildIndex = undefined;
3626
+ function getSelfChildIndex () {
3627
+ if (!parentMetroWidget) { return undefined; }
3628
+ if (!rootDiv.value) {
3629
+ console.warn("getSelfChildIndex before mounted.")
3630
+ return undefined;
3631
+ }
3632
+ if (selfChildIndex !== undefined) { return selfChildIndex; }
3633
+ let n = rootDiv.value;
3634
+ while(n) {
3635
+ if (n.getAttribute("__metrowidget-index") !== undefined) {
3636
+ selfChildIndex = parseInt(n.getAttribute("__metrowidget-index"));
3637
+ break;
3638
+ }
3639
+ n = n.parentNode;
3640
+ }
3641
+ return selfChildIndex;
3642
+ };
3643
+ const provideObj = {
3644
+ id: metroWidgetId,
3645
+ divRef: rootDiv,
3646
+ handler: exportObject,
3647
+ getSelfChildIndex,
3648
+ }
3649
+ const metroWidgetChain = parentMetroWidget ? [...parentMetroWidget, provideObj] : [provideObj];
3650
+ provide(MW_CONTEXT_NAME, metroWidgetChain);
3651
+
2988
3652
  return {
2989
3653
  widgetRectInfo,
2990
3654
  focusBlockOnFocus,
@@ -2998,7 +3662,8 @@ export const setup = (
2998
3662
  onTouchDown,
2999
3663
  onTouchRelease: exportOnTouchRelease,
3000
3664
  currentFocusIndex,
3001
- modeForExport,
3002
3665
  onDispatchKeyDown,
3666
+ isFocus,
3667
+ rootNativeViewId,
3003
3668
  };
3004
3669
  };