@shijiu/jsview-vue 2.2.128 → 2.2.373

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 (325) hide show
  1. package/bin/browser/BrowserApic.vue.mjs +4 -15
  2. package/bin/browser/BrowserApic2.vue.mjs +4 -15
  3. package/bin/browser/BrowserApicLib.mjs +32 -26
  4. package/bin/browser/BrowserAudio.vue.mjs +2 -10
  5. package/bin/browser/BrowserJsvFragShaderView.vue.mjs +79 -0
  6. package/bin/browser/BrowserJsvLatex.vue.mjs +39 -16
  7. package/bin/browser/BrowserPreload.vue.mjs +1 -5
  8. package/bin/browser/BrowserQrcode.vue.mjs +1 -5
  9. package/bin/browser/BrowserSpray.vue.mjs +2 -12
  10. package/bin/browser/BrowserTextureAnim.vue.mjs +2 -12
  11. package/bin/export-sfc.mjs +3 -3
  12. package/bin/jsview-vue-common.mjs +3 -3
  13. package/bin/jsview-vue.mjs +4636 -2325
  14. package/bin/types/JsViewEngineWidget/CheckType.d.ts +4 -0
  15. package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +37 -33
  16. package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +4 -0
  17. package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +21 -6
  18. package/bin/types/JsViewEngineWidget/MetroWidget/Const.d.ts +4 -0
  19. package/bin/types/JsViewEngineWidget/MetroWidget/Dispatcher.d.ts +14 -12
  20. package/bin/types/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +17 -6
  21. package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +283 -6
  22. package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +9 -3
  23. package/bin/types/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +4 -0
  24. package/bin/types/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +7 -0
  25. package/bin/types/JsViewEngineWidget/MetroWidget/Slide.d.ts +4 -0
  26. package/bin/types/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +4 -0
  27. package/bin/types/JsViewEngineWidget/MetroWidget/VisibleInfo.d.ts +4 -0
  28. package/bin/types/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +4 -0
  29. package/bin/types/JsViewEngineWidget/RangeModel.d.ts +4 -0
  30. package/bin/types/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +4 -0
  31. package/bin/types/JsViewEngineWidget/TemplateParser/Fence.d.ts +4 -0
  32. package/bin/types/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +5 -0
  33. package/bin/types/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +4 -0
  34. package/bin/types/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +5 -1
  35. package/bin/types/JsViewEngineWidget/TemplateParser/index.d.ts +4 -0
  36. package/bin/types/JsViewEngineWidget/WidgetCommon.d.ts +4 -0
  37. package/bin/types/JsViewEngineWidget/index.d.ts +14 -1
  38. package/bin/types/JsViewPlugin/JsvAccount/JsvAccount.d.ts +4 -0
  39. package/bin/types/JsViewPlugin/JsvAudio/AudioProxy.d.ts +4 -0
  40. package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +4 -0
  41. package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +4 -0
  42. package/bin/types/JsViewPlugin/JsvAudio/CheckType.d.ts +4 -0
  43. package/bin/types/JsViewPlugin/JsvAudio/Events.d.ts +4 -0
  44. package/bin/types/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +4 -0
  45. package/bin/types/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.d.ts +4 -0
  46. package/bin/types/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +4 -0
  47. package/bin/types/JsViewPlugin/JsvAudio/PluginLoader.d.ts +4 -0
  48. package/bin/types/JsViewPlugin/JsvAudio/ScreenLockManager.d.ts +4 -0
  49. package/bin/types/JsViewPlugin/JsvAudio/index.d.ts +4 -0
  50. package/bin/types/JsViewPlugin/JsvAudio/version.d.ts +5 -0
  51. package/bin/types/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +4 -0
  52. package/bin/types/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +4 -0
  53. package/bin/types/JsViewPlugin/JsvLatex/Color.d.ts +4 -0
  54. package/bin/types/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +24 -0
  55. package/bin/types/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +4 -0
  56. package/bin/types/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +4 -0
  57. package/bin/types/JsViewPlugin/JsvLatex/PluginLoader.d.ts +4 -0
  58. package/bin/types/JsViewPlugin/JsvLatex/index.d.ts +5 -0
  59. package/bin/types/JsViewPlugin/JsvLatex/version.d.ts +4 -0
  60. package/bin/types/JsViewPlugin/index.d.ts +4 -0
  61. package/bin/types/JsViewVueTools/ConstSymbol.d.ts +6 -2
  62. package/bin/types/JsViewVueTools/DebugContentShellJBridge.d.ts +4 -0
  63. package/bin/types/JsViewVueTools/DebugTool.d.ts +4 -0
  64. package/bin/types/JsViewVueTools/DefaultKeyMap.d.ts +4 -0
  65. package/bin/types/JsViewVueTools/FeatureActive.d.ts +14 -0
  66. package/bin/types/JsViewVueTools/ForgeConstDefine.d.ts +4 -0
  67. package/bin/types/JsViewVueTools/ForgeHandles.d.ts +7 -3
  68. package/bin/types/JsViewVueTools/JsvDemoTester.d.ts +4 -0
  69. package/bin/types/JsViewVueTools/JsvDynamicCssStyle.d.ts +20 -1
  70. package/bin/types/JsViewVueTools/JsvDynamicKeyFrames.d.ts +21 -2
  71. package/bin/types/JsViewVueTools/JsvFederationTools.d.ts +20 -0
  72. package/bin/types/JsViewVueTools/JsvHashHistory.d.ts +4 -0
  73. package/bin/types/JsViewVueTools/JsvImpactTracer.d.ts +8 -4
  74. package/bin/types/JsViewVueTools/JsvPerformance.d.ts +9 -0
  75. package/bin/types/JsViewVueTools/JsvPreDownloader.d.ts +55 -0
  76. package/bin/types/JsViewVueTools/JsvRefTaker.d.ts +28 -3
  77. package/bin/types/JsViewVueTools/JsvRuntimeBridge.d.ts +50 -0
  78. package/bin/types/JsViewVueTools/JsvStyleClass.d.ts +4 -0
  79. package/bin/types/JsViewVueTools/JsvStyleSheetsDeclarer.d.ts +21 -1
  80. package/bin/types/JsViewVueTools/JsvTextTools.d.ts +85 -27
  81. package/bin/types/JsViewVueTools/JsvTextureDefines.d.ts +4 -0
  82. package/bin/types/JsViewVueTools/JsvTextureLoadTool.d.ts +67 -0
  83. package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +4 -0
  84. package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +4 -0
  85. package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +4 -0
  86. package/bin/types/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +4 -0
  87. package/bin/types/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +73 -3
  88. package/bin/types/JsViewVueTools/JsvTextureStore/Store.d.ts +4 -0
  89. package/bin/types/JsViewVueTools/JsvTextureStore/Texture.d.ts +4 -0
  90. package/bin/types/JsViewVueTools/NinePatchHelper.d.ts +5 -1
  91. package/bin/types/JsViewVueTools/TextureManagerTools.d.ts +11 -0
  92. package/bin/types/JsViewVueTools/TypeCheckAndSet.d.ts +4 -0
  93. package/bin/types/JsViewVueTools/index.d.ts +26 -11
  94. package/bin/types/JsViewVueWidget/JsvActorMove/ActorControlBase.d.ts +4 -0
  95. package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +38 -0
  96. package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.d.ts +4 -0
  97. package/bin/types/JsViewVueWidget/JsvActorMove/index.d.ts +4 -0
  98. package/bin/types/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +5 -1
  99. package/bin/types/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +28 -1
  100. package/bin/types/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +4 -0
  101. package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +5 -1
  102. package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +29 -1
  103. package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +4 -0
  104. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +4 -0
  105. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +4 -0
  106. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/GifData.d.ts +4 -0
  107. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +4 -0
  108. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +4 -0
  109. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +4 -0
  110. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.d.ts +6 -1
  111. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/WebpData.d.ts +4 -0
  112. package/bin/types/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts +4 -0
  113. package/bin/types/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +74 -0
  114. package/bin/types/JsViewVueWidget/JsvClipDiv/index.d.ts +5 -0
  115. package/bin/types/JsViewVueWidget/JsvConnectLine/ArcLineManager.d.ts +4 -0
  116. package/bin/types/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +21 -0
  117. package/bin/types/JsViewVueWidget/JsvConnectLine/index.d.ts +4 -0
  118. package/bin/types/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +109 -0
  119. package/bin/types/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +108 -0
  120. package/bin/types/JsViewVueWidget/JsvDriftScope/index.d.ts +5 -0
  121. package/bin/types/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +4 -0
  122. package/bin/types/JsViewVueWidget/JsvFilterView.vue.d.ts +19 -0
  123. package/bin/types/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +34 -0
  124. package/bin/types/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +106 -0
  125. package/bin/types/JsViewVueWidget/JsvFlexCell/index.d.ts +6 -2
  126. package/bin/types/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue.d.ts +19 -0
  127. package/bin/types/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +60 -0
  128. package/bin/types/JsViewVueWidget/JsvFragShaderView/index.d.ts +6 -0
  129. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +47 -17
  130. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.d.ts +4 -0
  131. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.d.ts +4 -0
  132. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +25 -0
  133. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +22 -0
  134. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +4 -0
  135. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +9 -5
  136. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +8 -2
  137. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +11 -7
  138. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.d.ts +22 -0
  139. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +6 -0
  140. package/bin/types/JsViewVueWidget/JsvGrid.vue.d.ts +73 -0
  141. package/bin/types/JsViewVueWidget/JsvHole.d.ts +17 -0
  142. package/bin/types/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +14 -34
  143. package/bin/types/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +48 -0
  144. package/bin/types/JsViewVueWidget/JsvInput/EditVisibleArea.d.ts +27 -0
  145. package/bin/types/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +64 -209
  146. package/bin/types/JsViewVueWidget/JsvInput/SharedDefine.d.ts +17 -0
  147. package/bin/types/JsViewVueWidget/JsvInput/SystemTextTools.d.ts +14 -0
  148. package/bin/types/JsViewVueWidget/JsvInput/index.d.ts +4 -0
  149. package/bin/types/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +20 -0
  150. package/bin/types/JsViewVueWidget/JsvLine/LineManager.d.ts +4 -0
  151. package/bin/types/JsViewVueWidget/JsvLine/index.d.ts +4 -0
  152. package/bin/types/JsViewVueWidget/JsvMarquee.vue.d.ts +21 -0
  153. package/bin/types/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +20 -0
  154. package/bin/types/JsViewVueWidget/JsvMindMap/Constant.d.ts +4 -0
  155. package/bin/types/JsViewVueWidget/JsvMindMap/DataTree.d.ts +7 -1
  156. package/bin/types/JsViewVueWidget/JsvMindMap/Geometry.d.ts +4 -0
  157. package/bin/types/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +90 -0
  158. package/bin/types/JsViewVueWidget/JsvMindMap/index.d.ts +4 -0
  159. package/bin/types/JsViewVueWidget/JsvMindMap/rtree.d.ts +4 -0
  160. package/bin/types/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +24 -0
  161. package/bin/types/JsViewVueWidget/JsvNinePatch.vue.d.ts +31 -0
  162. package/bin/types/JsViewVueWidget/JsvPieChart.vue.d.ts +17 -0
  163. package/bin/types/JsViewVueWidget/JsvPosterDiv.vue.d.ts +17 -0
  164. package/bin/types/JsViewVueWidget/JsvPosterImage.vue.d.ts +18 -0
  165. package/bin/types/JsViewVueWidget/JsvPreload/BrowserPreload.vue.d.ts +4 -0
  166. package/bin/types/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +42 -0
  167. package/bin/types/JsViewVueWidget/JsvPreload/index.d.ts +4 -0
  168. package/bin/types/JsViewVueWidget/JsvProgressBar.vue.d.ts +19 -0
  169. package/bin/types/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue.d.ts +4 -0
  170. package/bin/types/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +25 -0
  171. package/bin/types/JsViewVueWidget/JsvQrcode/index.d.ts +4 -0
  172. package/bin/types/JsViewVueWidget/JsvRadarChart.vue.d.ts +24 -0
  173. package/bin/types/JsViewVueWidget/JsvRipple/Constant.d.ts +4 -0
  174. package/bin/types/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +45 -0
  175. package/bin/types/JsViewVueWidget/JsvRipple/index.d.ts +4 -0
  176. package/bin/types/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +18 -0
  177. package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +65 -1
  178. package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +157 -0
  179. package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.d.ts +8 -0
  180. package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollSymbol.d.ts +13 -4
  181. package/bin/types/JsViewVueWidget/JsvScrollBox/index.d.ts +6 -0
  182. package/bin/types/JsViewVueWidget/JsvSector.vue.d.ts +18 -0
  183. package/bin/types/JsViewVueWidget/JsvSoundPool.d.ts +42 -0
  184. package/bin/types/JsViewVueWidget/JsvSpray/BrowserSpray.vue.d.ts +4 -0
  185. package/bin/types/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +40 -0
  186. package/bin/types/JsViewVueWidget/JsvSpray/index.d.ts +4 -0
  187. package/bin/types/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.d.ts +4 -0
  188. package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +52 -0
  189. package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +16 -0
  190. package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteTools.d.ts +4 -0
  191. package/bin/types/JsViewVueWidget/JsvSpriteAnim/SpriteController.d.ts +4 -0
  192. package/bin/types/JsViewVueWidget/JsvSpriteAnim/index.d.ts +4 -0
  193. package/bin/types/JsViewVueWidget/JsvSpriteAnim/sAnimationToken.d.ts +4 -0
  194. package/bin/types/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +39 -0
  195. package/bin/types/JsViewVueWidget/JsvSwiper/index.d.ts +4 -0
  196. package/bin/types/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +24 -0
  197. package/bin/types/JsViewVueWidget/JsvSwiper3D/index.d.ts +4 -0
  198. package/bin/types/JsViewVueWidget/JsvTextBox.vue.d.ts +26 -0
  199. package/bin/types/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue.d.ts +4 -0
  200. package/bin/types/JsViewVueWidget/JsvTextureAnim/CommonType.d.ts +4 -0
  201. package/bin/types/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +7 -2
  202. package/bin/types/JsViewVueWidget/JsvTextureAnim/index.d.ts +4 -0
  203. package/bin/types/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +100 -0
  204. package/bin/types/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +25 -0
  205. package/bin/types/JsViewVueWidget/JsvVisibleSensor/index.d.ts +4 -0
  206. package/bin/types/JsViewVueWidget/index.d.ts +9 -0
  207. package/bin/types/index.d.ts +4 -0
  208. package/index.d.ts +8 -0
  209. package/package.json +1 -1
  210. package/tools/config/rollup.config.mjs +1 -0
  211. package/tools/config/toolkit.mjs +81 -0
  212. package/tools/config/tsconfig.json +1 -0
  213. package/tools/config/vite.config.ts +24 -14
  214. package/tools/jsview-vue-build.mjs +66 -21
  215. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +6 -2
  216. package/utils/JsViewEngineWidget/JsvFocus/{JsvFocusManager.js → JsvFocusManager.ts} +34 -15
  217. package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.ts +20 -0
  218. package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +30 -11
  219. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +54 -15
  220. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +509 -268
  221. package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +11 -0
  222. package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +8 -0
  223. package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +20 -10
  224. package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +33 -9
  225. package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +2 -2
  226. package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +7 -0
  227. package/utils/JsViewEngineWidget/{index.js → index.ts} +1 -1
  228. package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +21 -2
  229. package/utils/JsViewPlugin/JsvAudio/version.js +1 -1
  230. package/utils/JsViewPlugin/JsvAudio/version.mjs +1 -1
  231. package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +13 -3
  232. package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +27 -6
  233. package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +34 -28
  234. package/utils/JsViewPlugin/JsvLatex/index.js +22 -0
  235. package/utils/JsViewVueTools/ConstSymbol.ts +2 -2
  236. package/utils/JsViewVueTools/FeatureActive.ts +84 -0
  237. package/utils/JsViewVueTools/ForgeHandles.ts +7 -3
  238. package/utils/JsViewVueTools/JsvDynamicCssStyle.js +2 -0
  239. package/utils/JsViewVueTools/JsvDynamicKeyFrames.ts +2 -0
  240. package/utils/JsViewVueTools/JsvImpactTracer.js +2 -0
  241. package/utils/JsViewVueTools/JsvPreDownloader.ts +5 -4
  242. package/utils/JsViewVueTools/JsvRefTaker.js +1 -2
  243. package/utils/JsViewVueTools/JsvRuntimeBridge.js +67 -1
  244. package/utils/JsViewVueTools/JsvStyleClass.js +2 -0
  245. package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +2 -0
  246. package/utils/JsViewVueTools/JsvTextTools.ts +223 -0
  247. package/utils/JsViewVueTools/JsvTextureLoadTool.ts +233 -0
  248. package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +4 -1
  249. package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +8 -4
  250. package/utils/JsViewVueTools/JsvTextureStore/Texture.ts +1 -0
  251. package/utils/JsViewVueTools/TextureManagerTools.ts +17 -0
  252. package/utils/JsViewVueTools/index.js +22 -19
  253. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +2 -0
  254. package/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue +2 -2
  255. package/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue +13 -5
  256. package/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue +2 -2
  257. package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +15 -4
  258. package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.js +8 -3
  259. package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +44 -0
  260. package/utils/JsViewVueWidget/JsvClipDiv/index.ts +1 -0
  261. package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +7 -1
  262. package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +219 -0
  263. package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +84 -0
  264. package/utils/JsViewVueWidget/JsvDriftScope/index.ts +1 -0
  265. package/utils/JsViewVueWidget/JsvFilterView.vue +2 -0
  266. package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +5 -2
  267. package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +145 -0
  268. package/utils/JsViewVueWidget/JsvFlexCell/index.js +2 -5
  269. package/utils/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue +75 -0
  270. package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +293 -0
  271. package/utils/JsViewVueWidget/JsvFragShaderView/index.js +18 -0
  272. package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +142 -63
  273. package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +9 -0
  274. package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +2 -0
  275. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +15 -6
  276. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +19 -7
  277. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +15 -11
  278. package/utils/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.ts +120 -0
  279. package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +5 -1
  280. package/utils/JsViewVueWidget/JsvGrid.vue +2 -0
  281. package/utils/JsViewVueWidget/JsvHole.js +2 -0
  282. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +49 -45
  283. package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +320 -0
  284. package/utils/JsViewVueWidget/JsvInput/EditVisibleArea.ts +222 -0
  285. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +281 -681
  286. package/utils/JsViewVueWidget/JsvInput/SharedDefine.ts +17 -0
  287. package/utils/JsViewVueWidget/JsvInput/SystemTextTools.ts +47 -0
  288. package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -0
  289. package/utils/JsViewVueWidget/JsvMarquee.vue +2 -0
  290. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +2 -0
  291. package/utils/JsViewVueWidget/JsvMindMap/DataTree.ts +14 -1
  292. package/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue +277 -117
  293. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +91 -68
  294. package/utils/JsViewVueWidget/JsvNinePatch.vue +18 -1
  295. package/utils/JsViewVueWidget/JsvPieChart.vue +2 -0
  296. package/utils/JsViewVueWidget/JsvPosterDiv.vue +2 -0
  297. package/utils/JsViewVueWidget/JsvPosterImage.vue +2 -0
  298. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -0
  299. package/utils/JsViewVueWidget/JsvProgressBar.vue +2 -0
  300. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +10 -11
  301. package/utils/JsViewVueWidget/JsvRadarChart.vue +2 -0
  302. package/utils/JsViewVueWidget/JsvRipple/Constant.js +2 -2
  303. package/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue +3 -1
  304. package/utils/JsViewVueWidget/JsvScaleTextBox.vue +2 -0
  305. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +266 -48
  306. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +477 -0
  307. package/utils/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.ts +9 -0
  308. package/utils/JsViewVueWidget/JsvScrollBox/ScrollSymbol.ts +13 -4
  309. package/utils/JsViewVueWidget/JsvScrollBox/index.ts +3 -0
  310. package/utils/JsViewVueWidget/JsvSector.vue +2 -0
  311. package/utils/JsViewVueWidget/JsvSoundPool.js +2 -0
  312. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +30 -13
  313. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -0
  314. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue +2 -0
  315. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +2 -0
  316. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +2 -0
  317. package/utils/JsViewVueWidget/JsvTextBox.vue +2 -4
  318. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +44 -41
  319. package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +101 -0
  320. package/utils/JsViewVueWidget/JsvVideo.vue +2 -2
  321. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +2 -0
  322. package/utils/JsViewVueWidget/index.js +5 -0
  323. package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.js +0 -19
  324. package/utils/JsViewVueTools/JsvTextTools.js +0 -89
  325. package/utils/JsViewVueWidget/JsvScrollBox/index.js +0 -2
@@ -3,6 +3,8 @@
3
3
  */
4
4
 
5
5
  /*!
6
+ * @file
7
+ *
6
8
  * 【模块 export 内容】
7
9
  * CssStyleSheet:面向对象类,CSS rule的操作器,用于添加和删除CssStyle,服务于JsvStyleClass
8
10
  * 接口:
@@ -3,6 +3,8 @@
3
3
  */
4
4
 
5
5
  /*!
6
+ * @file
7
+ *
6
8
  * 【模块 export 内容】
7
9
  * getKeyFramesGroup: 函数,获取KeyFrame操作类 KeyFrameStyleSheet
8
10
  * KeyFrameStyleSheet:面向对象类,KeyFrames CSS rule的操作类,用于添加和删除KeyFrame
@@ -10,6 +10,8 @@
10
10
  */
11
11
 
12
12
  /*!
13
+ * @file
14
+ *
13
15
  * 【模块 export 内容】
14
16
  * createImpactTracer: 函数,创建碰撞跟踪对象
15
17
  * createImpactCallback: 函数,创建碰撞发生后的回调函数
@@ -1,5 +1,6 @@
1
1
  /*!
2
- * JsvPreDownloader 通用下载器,可以在不同的环境中进行资源下载操作。
2
+ * @file JsvPreDownloader 通用下载器,可以在不同的环境中进行资源下载操作。
3
+ *
3
4
  * JsvPreDownloader.download:实例方法,根据传入参数来下载资源。支持单个url或者url列表,返回Promise对象。
4
5
  * 参数:
5
6
  * url {string | Array}: (必填)图片url
@@ -74,7 +75,7 @@ abstract class JsvPreDownloaderBase {
74
75
  } else {
75
76
  this.downloadInner(url[i].url, url[i].netSetting, !!url[i].isImage)
76
77
  .then(
77
- (info) => {
78
+ (info: any) => {
78
79
  downloadResult[i] = {
79
80
  succeed: true,
80
81
  info: info,
@@ -82,7 +83,7 @@ abstract class JsvPreDownloaderBase {
82
83
  workNumber += 1
83
84
  check();
84
85
  },
85
- (errorInfo) => {
86
+ (errorInfo: any) => {
86
87
  downloadResult[i] = {
87
88
  succeed: false,
88
89
  info: errorInfo,
@@ -119,7 +120,7 @@ class JsvPreDownloaderInJsView extends JsvPreDownloaderBase {
119
120
  netSetting,
120
121
  fileType: isImage ? "image" : "notImage",
121
122
  };
122
- (window as any).jJsvInnerUtils.downloadResource(url, JSON.stringify(setting), (info) => {
123
+ (window as any).jJsvInnerUtils.downloadResource(url, JSON.stringify(setting), (info: any) => {
123
124
  try {
124
125
  const obj: CallbackInfo = JSON.parse(info);
125
126
  const result = JSON.parse(obj.info);
@@ -1,7 +1,6 @@
1
1
 
2
2
  /*!
3
- *******************
4
- * JsvRefTaker模块
3
+ * @file JsvRefTaker模块
5
4
  *
6
5
  * 用于解决 script setup 写法,不容易通过 this.$ref.xxxx 拿到子模块的句柄,
7
6
  * 但使用ref(null)的方式构筑的深度reactive对象又会严重影响element的内部处理性能的问题
@@ -1,3 +1,7 @@
1
+ /*!
2
+ @file JsvRuntimeBridge.js
3
+ */
4
+
1
5
  let feature_supports = null;
2
6
 
3
7
  let direct_call_map = {};
@@ -540,6 +544,62 @@ function unRegisterNetStateListener(callback){
540
544
  return direct_call("unRegisterNetStateListener", callback);
541
545
  }
542
546
 
547
+ function getSnId(){
548
+ return direct_call("getSnId");
549
+ }
550
+
551
+ function getEmmcCid(){
552
+ return direct_call("getEmmcCid");
553
+ }
554
+
555
+ /**
556
+ * android ContentProvider 查询接口,参数与返回值与官方接口相同。详情查看官方的 android.content.ContentProvider.query 接口
557
+ * @param {string} uri
558
+ * @param {string} projection
559
+ * @param {string} selection
560
+ * @param {string[]} selectionArgs
561
+ * @param {string} sortOrder
562
+ * @returns
563
+ */
564
+ function providerQuery(uri,projection,selection,selectionArgs,sortOrder){
565
+ let jsonProjection = projection?JSON.stringify(projection):null
566
+ let jsonSelectionArgs = selectionArgs?JSON.stringify(selectionArgs):null
567
+ return direct_call("providerQuery",uri,jsonProjection,selection,jsonSelectionArgs,sortOrder);
568
+ }
569
+
570
+ /**
571
+ * android ContentProvider 插入接口,参数与返回值与官方接口相同。详情查看官方的 android.content.ContentProvider.insert 接口
572
+ * @param {string} uri
573
+ * @param {object} contentValue
574
+ * @returns
575
+ */
576
+ function providerInsert(uri,contentValue){
577
+ return direct_call("providerInsert",uri,contentValue?JSON.stringify(contentValue):null)
578
+ }
579
+
580
+ /**
581
+ * android ContentProvider 删除接口,参数与返回值与官方接口相同。详情查看官方的 android.content.ContentProvider.delete 接口
582
+ * @param {string} uri
583
+ * @param {string} selection
584
+ * @param {string[]} selectionArgs
585
+ * @returns
586
+ */
587
+ function providerDelete(uri,selection,selectionArgs){
588
+ return direct_call("providerDelete",uri,selection,selectionArgs?JSON.stringify(selectionArgs):null)
589
+ }
590
+
591
+ /**
592
+ * android ContentProvider 更新接口,参数与返回值与官方接口相同。详情查看官方的 android.content.ContentProvider.update 接口
593
+ * @param {string} uri
594
+ * @param {object} contentValue
595
+ * @param {string} selection
596
+ * @param {string[]} selectionArgs
597
+ * @returns
598
+ */
599
+ function providerUpdate(uri,contentValue,selection,selectionArgs){
600
+ return direct_call("providerUpdate",uri,contentValue?JSON.stringify(contentValue):null,selection,selectionArgs?JSON.stringify(selectionArgs):null)
601
+ }
602
+
543
603
 
544
604
  // 显示声明,可以提高执行速度和利用上编辑器的成员名提示功能
545
605
  const bridge = {
@@ -579,7 +639,13 @@ const bridge = {
579
639
  preDownloadSdk,
580
640
  getNetworkTypeStatusImmediate,
581
641
  registerNetStateListener,
582
- unRegisterNetStateListener
642
+ unRegisterNetStateListener,
643
+ getSnId,
644
+ getEmmcCid,
645
+ providerQuery,
646
+ providerInsert,
647
+ providerDelete,
648
+ providerUpdate
583
649
  };
584
650
 
585
651
  export {
@@ -3,6 +3,8 @@
3
3
  */
4
4
 
5
5
  /*!
6
+ * @file
7
+ *
6
8
  * 【模块 export 内容】
7
9
  * JsvStyleClass:面向对象类,定义一组可以复用的Style,模拟css中的.class的概念
8
10
  * 功能函数:(参数说明见函数本体)
@@ -1,5 +1,7 @@
1
1
 
2
2
  /*!
3
+ * @file
4
+ *
3
5
  * 【模块 export 内容】
4
6
  * JsvStyleSheetsDeclarer: 动态和删除全局的 CssStyle
5
7
  * 接口:
@@ -0,0 +1,223 @@
1
+ import { Forge } from "@shijiu/jsview/dom/jsv-forge-define.mjs";
2
+
3
+ declare interface FontStyleDefine {
4
+ fontFamily: string,
5
+ fontSize: number,
6
+ fontStyle: string,
7
+ fontWeight: string
8
+ }
9
+
10
+ /*
11
+ * @Author: ChenChanghua
12
+ * @Date: 2022-11-29 14:26:20
13
+ * @LastEditors: Please set LastEditors
14
+ * @LastEditTime: 2023-02-02 10:20:45
15
+ * @Description: file content
16
+ */
17
+
18
+ /*!
19
+ * 获取文字宽度, 一般用于测量文字宽度
20
+ *
21
+ * @param {string} text 文字
22
+ * @param {object} style 文字的css style
23
+ * @return {int} 文字宽度
24
+ **/
25
+ const getTextWidth = (text: string, style: FontStyleDefine) => {
26
+ const textParams = {
27
+ str: text ? text : "",
28
+ font: style.fontFamily ? style.fontFamily : Forge.TextUtils.sDefaultFont,
29
+ size: style.fontSize ? style.fontSize : Forge.TextUtils.sDefaultFontSize,
30
+ italic: style.fontStyle === "italic" ? "italic" : "",
31
+ bold: style.fontWeight === "bold" ? "bold" : "",
32
+ };
33
+ return (window as any).PlatformUtils.GetTextWidth(textParams);
34
+ };
35
+
36
+ /*!
37
+ * @typedef {object} SliceInfo
38
+ * @property {int} start - 文字起始index
39
+ * @property {int} end - 文字结束index
40
+ * @property {int} width - 文字宽度
41
+ */
42
+
43
+ /*!
44
+ * @typedef {object} TextInfo
45
+ * @property {int} totalWidth - 文字整体宽度
46
+ * @property {Array<SliceInfo>} sliceInfo - 每段文字的信息
47
+ */
48
+
49
+ /*!
50
+ * 单行超长文字会切成多个div拼接, 由于jsview坐标的取整机制, 拼接出的width和文字width会产生误差, 此接口会返回拼接后的width
51
+ *
52
+ * @param {string} text 文字
53
+ * @param {object} style 文字的css style
54
+ * @return {TextInfo} 文字信息
55
+ **/
56
+ const getOneLineTextDrawWidth = (text: string, style: FontStyleDefine) => {
57
+ if (text && typeof text != "string") {
58
+ text = "" + text; // 规避text为非字符串导致接口调用错误的问题
59
+ }
60
+ const info: Array<any> = (window as any).PlatformUtils.GetOneLineTextDrawWidth(
61
+ text ?? "",
62
+ style.fontFamily ?? Forge.TextUtils.sDefaultFont,
63
+ style.fontSize ?? Forge.TextUtils.sDefaultFontSize,
64
+ style.fontStyle === "italic" ? "italic" : "",
65
+ style.fontWeight === "bold" ? "bold" : "");
66
+ const result: {
67
+ totalWidth: number,
68
+ sliceInfo: Array<any>
69
+ } = {
70
+ totalWidth: info[0],
71
+ sliceInfo: [],
72
+ }
73
+ for (let i = 1; i < info.length; i += 3) {
74
+ result.sliceInfo.push({
75
+ start: info[i],
76
+ end: info[i + 1],
77
+ width: info[2 + 2],
78
+ })
79
+ }
80
+ return result;
81
+ }
82
+
83
+ const isRtl = (str: string) => {
84
+ //arabic
85
+ for (let i = 0; i < str.length; i++) {
86
+ let c = str.charCodeAt(i);
87
+ if (c != 32) {
88
+ if (c >= 0x0600 && c <= 0x06ff) {
89
+ return true;
90
+ } else {
91
+ return false;
92
+ }
93
+ }
94
+ }
95
+ return false;
96
+ }
97
+
98
+
99
+
100
+ declare interface RectSize {
101
+ width: number,
102
+ height: number,
103
+ }
104
+
105
+ declare interface PostionDefine {
106
+ x: number,
107
+ y: number
108
+ }
109
+
110
+ /**
111
+ * 获取光标的位置
112
+ *
113
+ * @public
114
+ * @func GetCursorPosition
115
+ * @memberof Forge.TextUtils
116
+ * @params {string} str 文字字符串
117
+ * @params {Forge.RectArea} max_rect
118
+ * @param {PackedFontParams} font_params 文本描述符(来源自 PackFontParams 函数)
119
+ * @param {PackedTextAttrs} text_attr (来源自 PackTextAttrs 函数)
120
+ * @param {int} line_height
121
+ * @param {int} pos_x 光标的偏移
122
+ * @return {Object} 光标的所在位置{x:0,y:0}
123
+ **/
124
+ function GetCursorPosition(
125
+ str: string,
126
+ max_rect: RectSize,
127
+ font_params: PackedFontParams,
128
+ text_attr: PackedTextAttrs,
129
+ line_height: number,
130
+ cursor_offset: number
131
+ ): PostionDefine {
132
+ let api = (window as any).PlatformUtils?.GetCursorPosition.bind((window as any).PlatformUtils);
133
+
134
+ if (api) {
135
+ return api(str, max_rect, font_params, text_attr, line_height, cursor_offset);
136
+ } else {
137
+ return { x: 0, y: 0 }
138
+ }
139
+ }
140
+
141
+ class PackedFontParams {
142
+ public font?: string; // font family name
143
+ public size?: number; // font size
144
+ public bold?: string; // ""/"bold"
145
+ public italic?: string; // ""/"italic"
146
+ public alignment?: string; // left / right /center
147
+ public textColour?: string;
148
+ }
149
+
150
+ /**k
151
+ * 创建文本描述符
152
+ *
153
+ * @public
154
+ * @func PackFontParam
155
+ * @param {string} font_family CSS字体名字,如“黑体 欧文”(支持多字体设置)
156
+ * @param {int} font_size
157
+ * @param {boolean} italic 是否为斜体
158
+ * @param {boolean} bold 是否加粗
159
+ * @param {string} alignment 水平对齐方式,支持("left", "middle", "right", "justify")
160
+ * @param {string} text_color 文字颜色(format "#FFFFFF")
161
+ **/
162
+ function PackFontParams(
163
+ font_family: string | null,
164
+ font_size: number,
165
+ bold: boolean,
166
+ italic: boolean,
167
+ alignment: string,
168
+ text_color: string | null): PackedFontParams {
169
+
170
+ let packed = new PackedFontParams();
171
+
172
+ if (!font_size) font_size = Forge.TextUtils.sDefaultFontSize;
173
+ if (!font_family) font_family = Forge.TextUtils.sDefaultFont;
174
+
175
+ packed.size = font_size;
176
+ packed.font = font_family!;
177
+ packed.italic = italic ? "italic" : "";
178
+ packed.bold = bold ? "bold" : "";
179
+
180
+ packed.alignment = (alignment && alignment.length > 0) ? alignment : "left";
181
+ packed.textColour = text_color ? text_color : Forge.TextUtils.sDefaultFontColor;
182
+
183
+ return packed;
184
+ }
185
+
186
+ declare interface PackedTextAttrs {
187
+ text_overflow: string;
188
+ word_wrap: string;
189
+ }
190
+
191
+ /**
192
+ * 创建文本区域描述符
193
+ *
194
+ * @public
195
+ * @func PackTextAttrs
196
+ * @param {String} text_overflow 超过描画边界时的处理方式:<br>
197
+ * "none" 按照文字宽度描画<br>
198
+ * "clip" 超出本分不显示(默认)<br>
199
+ * "ellipsis" 如果超出,则末尾显示“...”
200
+ * 其余字符 当文字超出时,用此字符替换“...”的位置
201
+ * @param {String} word_wrap 设置自然换行规则<br>
202
+ * "none":“不折行”<br>
203
+ * "normal":折行时,尽量不切断单词(仅支持英文单词)<br>
204
+ * "break_word":不去识别单词,到达边缘就折行(执行效率高)
205
+ * @return {PackedTextAttrs} 文本区域描述符
206
+ **/
207
+ function PackTextAttrs(text_overflow: string, word_wrap: string): PackedTextAttrs {
208
+ if (!text_overflow) text_overflow = "none";
209
+ if (!word_wrap) word_wrap = "none";
210
+
211
+ return { text_overflow: text_overflow, word_wrap: word_wrap };
212
+ }
213
+
214
+ const TextTools = {
215
+ getOneLineTextDrawWidth,
216
+ getTextWidth,
217
+ isRtl,
218
+ PackFontParams,
219
+ PackTextAttrs,
220
+ GetCursorPosition
221
+ }
222
+
223
+ export { getTextWidth, TextTools };
@@ -0,0 +1,233 @@
1
+ /**
2
+ * @file
3
+ *
4
+ * 内部组件
5
+ *
6
+ * JsvTextureLoadTool: 对给定列表的图片资源进行后台预加载
7
+ * 特别注意: 在vue组件进行关联时,要在unmounted中进行对preload返回的句柄进行主动的release动作
8
+ *
9
+ * @method
10
+ * preload
11
+ * @param {Array(ItemSet)} preloadList
12
+ * @param {Function} finishCallback
13
+ */
14
+
15
+ import ForgeHandles from "./ForgeHandles";
16
+
17
+ const CONST_FORMAT_TOKEN = 3349;
18
+ class ItemSet {
19
+ public url: String | null;
20
+ public width: number;
21
+ public height: number;
22
+ public colorType: String;
23
+ public netSetting: any;
24
+ public isPosterImg: boolean;
25
+ public magicToken: number = CONST_FORMAT_TOKEN; // 用于规避非规定的输入值
26
+
27
+ /**
28
+ * @constructor
29
+ * @param {String} url 必填,图片的url,目前只支持 http:// 和 ./ 两个格式
30
+ * @param {number} width 选填,是否为了省内存而按照给定尺寸压缩图片
31
+ * @param {number} height 选填,是否为了省内存而按照给定尺寸压缩图片
32
+ * @param {String} color_type 选填,是否为了省内存而做成其他的图片解码格式
33
+ * @param {String} net_setting 选填,是否有特殊的网络header设置
34
+ * @param {boolean} is_poster_img 选填, 是否为统计为海报,海报有一套解码优先级处理
35
+ */
36
+ constructor(
37
+ url: String,
38
+ width: number = 0,
39
+ height: number = 0,
40
+ color_type: String = "RGBA_8888",
41
+ net_setting: any = null,
42
+ is_poster_img: boolean = false
43
+ ) {
44
+ if (!url || url.length == 0) {
45
+ console.warn("Error: url should not empty(null, \"\")");
46
+ }
47
+ this.url = url;
48
+ this.width = width;
49
+ this.height = height;
50
+ this.colorType = color_type;
51
+ this.netSetting = net_setting;
52
+ this.isPosterImg = is_poster_img;
53
+ }
54
+ }
55
+
56
+ class ItemStatus {
57
+ public loadStatus: boolean = false;
58
+ public listenerToken: number = -1;
59
+ public textureRef: any;
60
+
61
+ releaseResource() {
62
+ if (this.listenerToken != -1 && this.textureRef) {
63
+ this.textureRef.DisableBackgroundLoad();
64
+ this.textureRef.UnregisterLoadImageCallback(
65
+ this.listenerToken
66
+ );
67
+
68
+ this.listenerToken = -1;
69
+ this.textureRef = null;
70
+ }
71
+ }
72
+ }
73
+
74
+ class ListStatus {
75
+ public loadStatusList: Array<ItemStatus>;
76
+ public loadedInfoList: Array<any>;
77
+ public originDataList: Array<ItemSet>;
78
+ public loadingItemCount: number = 0;
79
+ public finishCallback: Function;
80
+
81
+ constructor(origin_data: Array<ItemSet>, finish_callback: Function) {
82
+ this.loadStatusList = new Array(origin_data.length).fill(null);
83
+ this.loadedInfoList = new Array(origin_data.length).fill(null);
84
+ this.originDataList = origin_data;
85
+ this.finishCallback = finish_callback;
86
+ }
87
+
88
+ onLoaded(index: number, loaded_info: any) {
89
+ let item_status = this.loadStatusList[index];
90
+ if (item_status && !item_status.loadStatus) {
91
+ item_status.loadStatus = true;
92
+ this.loadedInfoList[index] = loaded_info;
93
+ this.loadingItemCount--;
94
+ if (this.loadingItemCount == 0) {
95
+ this.finishCallback?.(this.loadedInfoList);
96
+ }
97
+ } else {
98
+ console.warn(`warn: url=${this.originDataList[index].url} already true`)
99
+ }
100
+ }
101
+
102
+ recycleResource() {
103
+ for (let item of this.loadStatusList) {
104
+ item?.releaseResource();
105
+ }
106
+ }
107
+ }
108
+
109
+ const _buildTextureRequest = (index: number, item_set: ItemSet, list_recorder: ListStatus): boolean => {
110
+ if (item_set.magicToken !== CONST_FORMAT_TOKEN) {
111
+ console.error(
112
+ "Error:format mismatch, data should comes from function buildPreloadInfo()"
113
+ );
114
+ return false;
115
+ }
116
+
117
+ const base_url = item_set.url;
118
+ let image_url = base_url;
119
+ if (base_url) {
120
+ if (base_url.startsWith("jsvtexturestore://")) {
121
+ // 直接加载,不需要跟踪
122
+ return false;
123
+ } else if (base_url.startsWith(".") || base_url?.startsWith("/")) {
124
+ // 相对路径,要根据jsview的api进行改造
125
+ if ((window as any).JsView) {
126
+ image_url = (((window as any).JsView as any).Dom as any).UrlRef(base_url).herf;
127
+ } else {
128
+ // Browser端不需要调整url
129
+ }
130
+ }
131
+
132
+ // 是否为指定size节省内存的texture
133
+ let target_size: { width: number, height: number } | null = null;
134
+ if (item_set.width !== 0 && item_set.height !== 0) {
135
+ target_size = { width: item_set.width, height: item_set.height };
136
+ }
137
+
138
+ let texture: any = ForgeHandles.TextureManager.GetImage2(
139
+ image_url,
140
+ false,
141
+ target_size,
142
+ item_set.colorType,
143
+ item_set.netSetting ?? "",
144
+ item_set.isPosterImg
145
+ );
146
+
147
+ if (!texture) {
148
+ console.error(
149
+ "Error: Preload view build texture failed for " + image_url
150
+ );
151
+ return false;
152
+ }
153
+
154
+ let item_status: ItemStatus = new ItemStatus();
155
+ list_recorder.loadStatusList[index] = item_status;
156
+
157
+ // 追加回调处理
158
+ item_status.listenerToken = texture.RegisterLoadImageCallback(null, (params: any) => {
159
+ console.log(`preload succeed ${item_set.url}, params:${JSON.stringify(params)}`);
160
+ list_recorder.loadStatusList[index].releaseResource();
161
+ list_recorder.onLoaded(index, params);
162
+ });
163
+ // 脱离view进行加载,
164
+ // 如果没有真实的view进行挂载很可能就会被快速地清理掉
165
+ // 但理论上,使用此组件的外部vue会对图片进行捆绑
166
+ texture.EnableBackgroundLoad();
167
+
168
+ // 记录textureRef,为了进行release时的释放动作
169
+ item_status.textureRef = texture;
170
+
171
+ return true;
172
+ } else {
173
+ return false;
174
+ }
175
+ }
176
+
177
+ const _readPreloadViewIdList = (
178
+ preload_list_data: Array<ItemSet> | null,
179
+ finish_callback: Function): ListStatus | null => {
180
+
181
+ if (!preload_list_data || preload_list_data?.length == 0) {
182
+ console.warn("empty list");
183
+ return null;
184
+ }
185
+
186
+ let ret_list_status: ListStatus = new ListStatus(preload_list_data, finish_callback);
187
+
188
+ // 直接在map前将为null的值删除掉
189
+ for (let i = 0; i < preload_list_data.length; i++) {
190
+ if (!preload_list_data[i] || !preload_list_data[i].url) {
191
+ continue;
192
+ }
193
+
194
+ if (_buildTextureRequest(i, preload_list_data[i], ret_list_status)) {
195
+ // 记录已经发送的texture请求
196
+ ret_list_status.loadingItemCount++;
197
+ } else {
198
+ // jsvtexturestore or build texture failed
199
+ }
200
+ }
201
+
202
+ if (ret_list_status.loadingItemCount == 0) {
203
+ // 无需要preload的内容
204
+ return null;
205
+ } else {
206
+ return ret_list_status;
207
+ }
208
+ };
209
+
210
+ /**
211
+ * 对给定的ItemSet进行preload加载,返回 ListStatus,
212
+ * 注意: 在vue的unmount处理中要调用ListStatus.recycleResource()进行资源回收
213
+ *
214
+ * @function
215
+ * @param {ItemSet} preload_list_data 要加载资源的ItemSet列表
216
+ * @param {Function} finish_callback 全加载完成后的回调函数
217
+ * @returns {ListStatus}
218
+ */
219
+ function preload(
220
+ preload_list_data: Array<ItemSet> | null,
221
+ finish_callback: Function): ListStatus | null {
222
+
223
+ return _readPreloadViewIdList(preload_list_data, finish_callback);
224
+ }
225
+
226
+ const JsvTextureLoadTool = {
227
+ preload,
228
+ ItemSet
229
+ }
230
+
231
+ export {
232
+ JsvTextureLoadTool
233
+ }
@@ -1,5 +1,6 @@
1
1
  import ForgeHandles from "../../../JsViewVueTools/ForgeHandles";
2
2
  import { TextureBase } from "../Texture"
3
+ import { FeatureNames, JsvUseFeature } from "../../FeatureActive";
3
4
 
4
5
  export type CapturedCallback = (
5
6
  textureAccessName: string,
@@ -19,6 +20,9 @@ export class CapturedTexture extends TextureBase {
19
20
  autoRecycle: boolean) {
20
21
  super(null);
21
22
 
23
+ // 激活引擎的功能支持
24
+ JsvUseFeature('JsvTextureStoreApi', FeatureNames.Capture2Texture);
25
+
22
26
  this._CaptureDiv = captureDiv;
23
27
  this._Callback = callback;
24
28
  this._AutoRecycle = autoRecycle;
@@ -45,7 +49,6 @@ export class CapturedTexture extends TextureBase {
45
49
 
46
50
  // 处理自动回收
47
51
  if (!this._AutoRecycle) {
48
- this.textureRef.DisableAutoRecycle(); // 取消自动清理
49
52
  this.addToStore(); // 用TextureStore来跟进引用状态
50
53
  }
51
54
 
@@ -1,5 +1,6 @@
1
1
  /*!
2
- * JsvTextureStoreApi
2
+ * @file JsvTextureStoreApi
3
+ *
3
4
  * canvasTexture:
4
5
  * 创建texture(图片纹理)句柄, 通过 CanvasTexture 的API进行绘制, 使用注意以下几点
5
6
  * a. commit() 接口调用之前可以任意绘制, commit之后就无法更改, commit之后才能使用, commit后绘制内容会被全局保存
@@ -26,7 +27,7 @@ let sJsvTextureConst = {
26
27
  BOTTOM: 4,
27
28
  }
28
29
 
29
- let sTextureStoreApi: Object = {
30
+ let sTextureStoreApi = {
30
31
  /**
31
32
  * canvasTexture
32
33
  * 创建CanvasTexture句柄,执行commit()后, 获取访问名(访问名规则: 输入参数 baseName + 分配id)
@@ -59,8 +60,11 @@ let sTextureStoreApi: Object = {
59
60
  * width: number, // 截取div的宽
60
61
  * height: number) => void // 截取div的高
61
62
  * @param {boolean} autoRecycle 可选, 是否当无div/img引用时会自动释放
62
- * true的场景在callback收到资源名后, 需要使用完毕后调用 deleteTexture 手动释放
63
- * 在手动释放之前,可以赋给其他div/img来复用
63
+ * true默认值: 此场景在回调时要立刻赋值给响应式变量控制template的节点立刻使用(并且不是v-if=false的节点),
64
+ 否则会自动释放掉, 此时, texture当使用它的template节点从dom树中去掉的时候(v-if=false也算)会自动释放,
65
+ 不需要主动调用deleteTexture释放.
66
+ false: 此场景在callback收到资源名后, 需要使用完毕后调用 deleteTexture 手动释放
67
+ 在手动释放之前,可以赋给其他div/img来复用
64
68
  * @return {CapturedTexture} 用于cancel的句柄,当cancel时,会清理对div和Callback的引用
65
69
  */
66
70
  capture2Texture: (