@shijiu/jsview-vue 2.3.151-test.0 → 3.0.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 (244) hide show
  1. package/bin/browser/BrowserAudio.mjs +200 -0
  2. package/bin/browser/BrowserJsvLatex.mjs +61 -0
  3. package/bin/export-sfc.mjs +8 -9
  4. package/bin/jsview-vue-common.mjs +9 -35
  5. package/bin/jsview-vue.mjs +22246 -23643
  6. package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +9 -71
  7. package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +18 -2
  8. package/bin/types/utils/JsViewEngineWidget/MetroWidget/Const.d.ts +4 -1
  9. package/bin/types/utils/JsViewEngineWidget/MetroWidget/DebugFrame.vue.d.ts +10 -7
  10. package/bin/types/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +19 -178
  11. package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +19 -178
  12. package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +24 -3
  13. package/bin/types/utils/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +7 -1
  14. package/bin/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +25 -5
  15. package/bin/types/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +9 -47
  16. package/bin/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +2 -1
  17. package/bin/types/utils/JsViewEngineWidget/MetroWidget/Utils.d.ts +2 -0
  18. package/bin/types/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +1 -1
  19. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue.d.ts +40 -0
  20. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.d.ts +24 -0
  21. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.d.ts +19 -0
  22. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.d.ts +42 -0
  23. package/bin/types/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +2 -1
  24. package/bin/types/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +2 -1
  25. package/bin/types/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +6 -4
  26. package/bin/types/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +9 -7
  27. package/bin/types/utils/JsViewEngineWidget/WidgetCommon.d.ts +17 -7
  28. package/bin/types/utils/JsViewEngineWidget/index.d.ts +3 -1
  29. package/bin/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +140 -7
  30. package/bin/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +12 -11
  31. package/bin/types/utils/JsViewPlugin/JsvAudio/Events.d.ts +10 -10
  32. package/bin/types/utils/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +204 -17
  33. package/bin/types/utils/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +2 -1
  34. package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.mts +11 -11
  35. package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.ts +11 -11
  36. package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +0 -1
  37. package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +75 -12
  38. package/bin/types/utils/JsViewPlugin/JsvLatex/GetVersion.d.ts +14 -0
  39. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +88 -13
  40. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +1 -0
  41. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +5 -1
  42. package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.mts +39 -12
  43. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +120 -17
  44. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +62 -0
  45. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +108 -29
  46. package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue.d.ts → JsvPlayerBrowser-0.9.vue.d.ts} +8 -7
  47. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-wasm.vue.d.ts +614 -0
  48. package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue.d.ts → JsvPlayerBrowser.vue.d.ts} +36 -34
  49. package/bin/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +89 -30
  50. package/bin/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +89 -30
  51. package/bin/types/utils/JsViewPlugin/JsvPlayer/version.d.mts +11 -11
  52. package/bin/types/utils/JsViewVueTools/BlobApi.d.ts +38 -0
  53. package/bin/types/utils/JsViewVueTools/DebugTool.d.ts +1 -1
  54. package/bin/types/utils/JsViewVueTools/DefaultKeyMap.d.ts +7 -7
  55. package/bin/types/utils/JsViewVueTools/FeatureActive.d.ts +1 -0
  56. package/bin/types/utils/JsViewVueTools/JsvInteractionMode.d.ts +6 -0
  57. package/bin/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +3 -3
  58. package/bin/types/utils/JsViewVueTools/JsvTextTools.d.ts +1 -0
  59. package/bin/types/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.d.ts +43 -0
  60. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +1 -0
  61. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.d.ts +54 -0
  62. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +13 -0
  63. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +2 -0
  64. package/bin/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +76 -26
  65. package/bin/types/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.d.ts +49 -0
  66. package/bin/types/utils/JsViewVueTools/JsvTextureStore/index.d.ts +2 -0
  67. package/bin/types/utils/JsViewVueTools/index.d.ts +4 -1
  68. package/bin/types/utils/JsViewVueWidget/Jsv3dDiv.vue.d.ts +10 -98
  69. package/bin/types/utils/JsViewVueWidget/Jsv3dStage.vue.d.ts +10 -114
  70. package/bin/types/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +20 -61
  71. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +44 -13
  72. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +12 -11
  73. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +5 -5
  74. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +16 -10
  75. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +21 -17
  76. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +19 -16
  77. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts +7 -7
  78. package/bin/types/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +12 -66
  79. package/bin/types/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +73 -12
  80. package/bin/types/utils/JsViewVueWidget/JsvDashPath.vue.d.ts +59 -10
  81. package/bin/types/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +41 -81
  82. package/bin/types/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +17 -100
  83. package/bin/types/utils/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +13 -50
  84. package/bin/types/utils/JsViewVueWidget/JsvFilterView.vue.d.ts +50 -70
  85. package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +32 -68
  86. package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvFullScrAdjust.vue.d.ts +57 -74
  87. package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +41 -71
  88. package/bin/types/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +83 -14
  89. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +151 -18
  90. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +79 -83
  91. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvFreeMoveActor.vue.d.ts +70 -0
  92. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +20 -0
  93. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +108 -5
  94. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +88 -3
  95. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +6 -1
  96. package/bin/types/utils/JsViewVueWidget/JsvGrid.vue.d.ts +19 -18
  97. package/bin/types/utils/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +34 -11
  98. package/bin/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +4 -1
  99. package/bin/types/utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +193 -6
  100. package/bin/types/utils/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +54 -11
  101. package/bin/types/utils/JsViewVueWidget/JsvMarquee.vue.d.ts +89 -11
  102. package/bin/types/utils/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +9 -8
  103. package/bin/types/utils/JsViewVueWidget/JsvMindMap/Geometry.d.ts +2 -2
  104. package/bin/types/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +170 -138
  105. package/bin/types/utils/JsViewVueWidget/JsvMindMap/rtree.d.ts +5 -5
  106. package/bin/types/utils/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +48 -72
  107. package/bin/types/utils/JsViewVueWidget/JsvNinePatch.vue.d.ts +139 -20
  108. package/bin/types/utils/JsViewVueWidget/JsvPieChart.vue.d.ts +56 -8
  109. package/bin/types/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +20 -11
  110. package/bin/types/utils/JsViewVueWidget/JsvProgressBar.vue.d.ts +63 -11
  111. package/bin/types/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +8 -7
  112. package/bin/types/utils/JsViewVueWidget/JsvRadarChart.vue.d.ts +95 -12
  113. package/bin/types/utils/JsViewVueWidget/JsvRipple/Constant.d.ts +2 -2
  114. package/bin/types/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +51 -78
  115. package/bin/types/utils/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +5 -4
  116. package/bin/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +84 -193
  117. package/bin/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +23 -148
  118. package/bin/types/utils/JsViewVueWidget/JsvSector.vue.d.ts +56 -9
  119. package/bin/types/utils/JsViewVueWidget/JsvSmoothSlideContainer.vue.d.ts +22 -67
  120. package/bin/types/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +44 -10
  121. package/bin/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +47 -14
  122. package/bin/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +26 -67
  123. package/bin/types/utils/JsViewVueWidget/JsvSwiper/Indicator.vue.d.ts +7 -6
  124. package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSmoothSwiper.vue.d.ts +147 -109
  125. package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +173 -16
  126. package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper2.vue.d.ts +216 -139
  127. package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue.d.ts +7 -6
  128. package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +101 -96
  129. package/bin/types/utils/JsViewVueWidget/JsvTextBox.vue.d.ts +89 -74
  130. package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +21 -20
  131. package/bin/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +43 -70
  132. package/bin/types/utils/JsViewVueWidget/JsvVideo.vue.d.ts +6 -5
  133. package/bin/types/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +62 -82
  134. package/bin/types/utils/JsViewVueWidget/JsvVisibleSensor/index.d.ts +95 -74
  135. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue.d.ts +51 -0
  136. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue.d.ts +105 -0
  137. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue.d.ts +51 -0
  138. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue.d.ts +105 -0
  139. package/bin/types/utils/JsViewVueWidget/index.d.ts +5 -3
  140. package/package.json +2 -2
  141. package/tools/jsview-vue-build.mjs +13 -9
  142. package/tsconfig.json +2 -2
  143. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +32 -16
  144. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.ts +24 -2
  145. package/utils/JsViewEngineWidget/MetroWidget/Const.ts +5 -0
  146. package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +183 -89
  147. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +269 -122
  148. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +989 -357
  149. package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.ts +41 -23
  150. package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +138 -41
  151. package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +1 -0
  152. package/utils/JsViewEngineWidget/MetroWidget/Utils.ts +6 -0
  153. package/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.ts +2 -1
  154. package/utils/JsViewEngineWidget/RectUtils.js +1 -1
  155. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue +50 -0
  156. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.ts +260 -0
  157. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.ts +32 -0
  158. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.ts +236 -0
  159. package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +342 -174
  160. package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +101 -27
  161. package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +12 -5
  162. package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +109 -41
  163. package/utils/JsViewEngineWidget/WidgetCommon.ts +17 -7
  164. package/utils/JsViewEngineWidget/index.ts +7 -2
  165. package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +46 -46
  166. package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +54 -41
  167. package/utils/JsViewPlugin/JsvLatex/GetVersion.js +65 -0
  168. package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +54 -12
  169. package/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.js +10 -0
  170. package/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue +15 -2
  171. package/utils/JsViewPlugin/JsvLatex/PluginLoader.js +63 -31
  172. package/utils/JsViewPlugin/JsvLatex/version.mjs +26 -13
  173. package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +2 -1
  174. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +402 -23
  175. package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +100 -0
  176. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +363 -468
  177. package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue → JsvPlayerBrowser-wasm.vue} +60 -10
  178. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +511 -0
  179. package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +52 -10
  180. package/utils/JsViewPlugin/JsvPlayer/index.js +58 -9
  181. package/utils/JsViewPlugin/JsvPlayer/package.json +8 -0
  182. package/utils/JsViewVueTools/BlobApi.ts +55 -0
  183. package/utils/JsViewVueTools/FeatureActive.ts +3 -0
  184. package/utils/JsViewVueTools/ForgeHandles.ts +3 -0
  185. package/utils/JsViewVueTools/JsvInteractionMode.js +16 -0
  186. package/utils/JsViewVueTools/JsvPreDownloader.ts +2 -2
  187. package/utils/JsViewVueTools/JsvRuntimeBridge.js +25 -18
  188. package/utils/JsViewVueTools/JsvTextTools.ts +9 -1
  189. package/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.ts +180 -0
  190. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +1 -0
  191. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.ts +304 -0
  192. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.ts +38 -0
  193. package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +16 -1
  194. package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +154 -69
  195. package/utils/JsViewVueTools/JsvTextureStore/Store.ts +1 -1
  196. package/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.ts +92 -0
  197. package/utils/JsViewVueTools/JsvTextureStore/index.js +2 -0
  198. package/utils/JsViewVueTools/index.js +3 -1
  199. package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +111 -86
  200. package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +1 -1
  201. package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +11 -2
  202. package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +1 -1
  203. package/utils/JsViewVueWidget/JsvEnableRenderBreak.vue +6 -0
  204. package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +11 -5
  205. package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +3 -1
  206. package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +23 -11
  207. package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +242 -25
  208. package/utils/JsViewVueWidget/JsvFreeMoveActor/{FreeMoveActor.vue → JsvFreeMoveActor.vue} +1 -1
  209. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +11 -5
  210. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +118 -6
  211. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +56 -14
  212. package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +2 -1
  213. package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +11 -2
  214. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +30 -2
  215. package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +24 -7
  216. package/utils/JsViewVueWidget/JsvMarquee.vue +1 -1
  217. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +12 -10
  218. package/utils/JsViewVueWidget/JsvNinePatch.vue +13 -8
  219. package/utils/JsViewVueWidget/JsvPieChart.vue +93 -70
  220. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +32 -29
  221. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +2 -1
  222. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +25 -3
  223. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +0 -3
  224. package/utils/JsViewVueWidget/JsvSector.vue +66 -28
  225. package/utils/JsViewVueWidget/JsvTextBox.vue +30 -1
  226. package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +56 -14
  227. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +8 -6
  228. package/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue +54 -0
  229. package/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue +88 -0
  230. package/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue +177 -0
  231. package/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue +267 -0
  232. package/utils/JsViewVueWidget/index.js +6 -2
  233. package/bin/browser/BrowserAudio.vue.mjs +0 -258
  234. package/bin/browser/BrowserJsvLatex.vue.mjs +0 -145
  235. package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.ts +0 -10
  236. package/bin/types/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.d.ts +0 -7
  237. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +0 -78
  238. package/bin/types/utils/JsViewVueWidget/JsvPosterDiv.vue.d.ts +0 -63
  239. package/bin/types/utils/JsViewVueWidget/JsvPosterImage.vue.d.ts +0 -78
  240. package/utils/JsViewPlugin/JsvLatex/version.js +0 -24
  241. package/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.ts +0 -36
  242. package/utils/JsViewVueWidget/JsvPosterDiv.vue +0 -56
  243. package/utils/JsViewVueWidget/JsvPosterImage.vue +0 -105
  244. /package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue → JsvPlayerBrowser-0.9.vue} +0 -0
@@ -1,47 +1,47 @@
1
- export const getHtmlStr = (libPath, latexStr, fontSize, width, height, color) => {
2
- return (
3
- `<html>
4
- <head>
5
- <style>
6
- mjx-container[display="true"] {
7
- margin: 0 0 !important;
8
- }
9
- body {
10
- margin: 0 !important;
11
- }
12
- </style>
13
- <script type="text/javascript">
14
- MathJax = {
15
- tex: {
16
- inlineMath: [['$', '$'], ['\\\\(', '\\\\)']]
17
- },
18
- svg: {
19
- fontCache: 'global'
20
- }
21
- };
22
- function bodyOnLoad() {
23
- let divElement = document.createElement("div");
24
- divElement.style.display = "inline-block";
25
- divElement.style.fontSize = "${fontSize}px";
26
- divElement.style.color = "${color}";
27
- divElement.innerHTML = String.raw\`${latexStr}\`;
28
- //divElement.style.width = ${width} + "px";
29
- document.body.appendChild(divElement);
1
+ // export const getHtmlStr = (libPath, latexStr, fontSize, width, height, color) => {
2
+ // return (
3
+ // `<html>
4
+ // <head>
5
+ // <style>
6
+ // mjx-container[display="true"] {
7
+ // margin: 0 0 !important;
8
+ // }
9
+ // body {
10
+ // margin: 0 !important;
11
+ // }
12
+ // </style>
13
+ // <script type="text/javascript">
14
+ // MathJax = {
15
+ // tex: {
16
+ // inlineMath: [['$', '$'], ['\\\\(', '\\\\)']]
17
+ // },
18
+ // svg: {
19
+ // fontCache: 'global'
20
+ // }
21
+ // };
22
+ // function bodyOnLoad() {
23
+ // let divElement = document.createElement("div");
24
+ // divElement.style.display = "inline-block";
25
+ // divElement.style.fontSize = "${fontSize}px";
26
+ // divElement.style.color = "${color}";
27
+ // divElement.innerHTML = String.raw\`${latexStr}\`;
28
+ // //divElement.style.width = ${width} + "px";
29
+ // document.body.appendChild(divElement);
30
30
 
31
- MathJax.typesetPromise().then(() => {
32
- // modify the DOM here
33
- let formulaMetrics = MathJax.getMetricsFor(divElement, true);
34
- let w = Math.min(${width}, divElement.clientWidth);
35
- let scale = w / divElement.clientWidth;
36
- divElement.style.fontSize = Math.floor(scale * ${fontSize}) + "px";
37
- MathJax.typeset();
38
- }).catch((err) => console.error(err.message));
39
- }
40
- </script>
41
- <script type="text/javascript" src="${libPath}"></script>
42
- </head>
43
- <body onload="bodyOnLoad()">
44
- </body>
45
- </html>`
46
- )
47
- }
31
+ // MathJax.typesetPromise().then(() => {
32
+ // // modify the DOM here
33
+ // let formulaMetrics = MathJax.getMetricsFor(divElement, true);
34
+ // let w = Math.min(${width}, divElement.clientWidth);
35
+ // let scale = w / divElement.clientWidth;
36
+ // divElement.style.fontSize = Math.floor(scale * ${fontSize}) + "px";
37
+ // MathJax.typeset();
38
+ // }).catch((err) => console.error(err.message));
39
+ // }
40
+ // </script>
41
+ // <script type="text/javascript" src="${libPath}"></script>
42
+ // </head>
43
+ // <body onload="bodyOnLoad()">
44
+ // </body>
45
+ // </html>`
46
+ // )
47
+ // }
@@ -1,8 +1,8 @@
1
1
  <script setup>
2
2
  // import "./mathjax-tex-svg.js";
3
- import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
3
+ // import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
4
4
  import { ref, shallowRef, onBeforeUnmount } from "vue";
5
- import { getHtmlStr } from "./BrowserDomBuilder.js";
5
+ // import { getHtmlStr } from "./BrowserDomBuilder.js";
6
6
 
7
7
  const props = defineProps({
8
8
  latexStr: {
@@ -39,52 +39,52 @@ const props = defineProps({
39
39
  },
40
40
  });
41
41
 
42
- function precessString(original) {
43
- return (
44
- "\\[\\begin{array}{l}" +
45
- original.replaceAll(/\\[\(\)\[\]]/g, "") +
46
- "\\end{array}\\]"
47
- );
48
- }
49
- let innerViewId = shallowRef(-1);
50
- const clientWidth = ref(props.width);
51
- const clientHeight = ref(props.height);
42
+ // function precessString(original) {
43
+ // return (
44
+ // "\\[\\begin{array}{l}" +
45
+ // original.replaceAll(/\\[\(\)\[\]]/g, "") +
46
+ // "\\end{array}\\]"
47
+ // );
48
+ // }
49
+ // let innerViewId = shallowRef(-1);
50
+ // const clientWidth = ref(props.width);
51
+ // const clientHeight = ref(props.height);
52
52
 
53
- let layoutView = new Forge.IFrameView();
54
- layoutView.SetIframeSize(props.width, props.height);
55
- layoutView.SetInnerHtml(
56
- getHtmlStr(
57
- "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewTestResource/DocResource/mathjax-tex-svg.txt",
58
- precessString(props.latexStr),
59
- props.fontSize,
60
- props.width,
61
- props.height,
62
- props.color
63
- )
64
- );
65
- const resizeObserver = new ResizeObserver(entries => {
66
- if (entries.length > 0) {
67
- const e = entries[0];
68
- if (clientHeight.value == 0) {
69
- clientHeight.value = e.contentRect.height
70
- }
71
- }
72
- });
73
- resizeObserver.observe(layoutView.GetIFrame());
53
+ // let layoutView = new Forge.IFrameView();
54
+ // layoutView.SetIframeSize(props.width, props.height);
55
+ // layoutView.SetInnerHtml(
56
+ // getHtmlStr(
57
+ // "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewTestResource/DocResource/mathjax-tex-svg.txt",
58
+ // precessString(props.latexStr),
59
+ // props.fontSize,
60
+ // props.width,
61
+ // props.height,
62
+ // props.color
63
+ // )
64
+ // );
65
+ // const resizeObserver = new ResizeObserver(entries => {
66
+ // if (entries.length > 0) {
67
+ // const e = entries[0];
68
+ // if (clientHeight.value == 0) {
69
+ // clientHeight.value = e.contentRect.height
70
+ // }
71
+ // }
72
+ // });
73
+ // resizeObserver.observe(layoutView.GetIFrame());
74
74
 
75
- innerViewId.value = Forge.sViewStore.add(new Forge.ViewInfo(layoutView));
75
+ // innerViewId.value = Forge.sViewStore.add(new Forge.ViewInfo(layoutView));
76
76
 
77
77
  onBeforeUnmount(() => {
78
- if (innerViewId.value != -1) {
79
- Forge.sViewStore.remove(innerViewId.value);
80
- innerViewId.value = -1;
81
- console.log("success remove innerview");
82
- }
83
- resizeObserver.unobserve(layoutView.GetIFrame())
78
+ // if (innerViewId.value != -1) {
79
+ // Forge.sViewStore.remove(innerViewId.value);
80
+ // innerViewId.value = -1;
81
+ // console.log("success remove innerview");
82
+ // }
83
+ // resizeObserver.unobserve(layoutView.GetIFrame())
84
84
  });
85
85
  </script>
86
86
  <template>
87
- <div
87
+ <!-- <div
88
88
  :style="{
89
89
  left: left,
90
90
  top: top,
@@ -93,5 +93,18 @@ onBeforeUnmount(() => {
93
93
  }"
94
94
  >
95
95
  <div :data-jsv-vw-innerview="innerViewId"></div>
96
+ </div> -->
97
+ <div :style="{
98
+ left: left,
99
+ top: top,
100
+ width: width,
101
+ height: 100,
102
+ fontSize: 15,
103
+ color: '#ffffff',
104
+ textAlign: 'center',
105
+ backgroundColor: '#aa4444',
106
+ overflow: 'hidden',
107
+ }">
108
+ {{"浏览器端不支持latex公式: \n" + latexStr}}
96
109
  </div>
97
110
  </template>
@@ -0,0 +1,65 @@
1
+ import { PluginInfo, PluginInfo64 } from './version.mjs'
2
+
3
+ function reconfigPluginInfo() {
4
+ if(typeof window.jJsvRuntimeBridge!=='undefined' && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined"){
5
+ let plugin_base = window.jJsvRuntimeBridge.getPluginBaseUrl();
6
+ let folder_name = "com.qcode.jsvlatex";
7
+ if(plugin_base){
8
+ let plugin_base_array = plugin_base.split("|split|");
9
+ let suffix = "";
10
+ let plugin_base_url = plugin_base_array[0];
11
+ if(plugin_base_array.length > 1){
12
+ suffix = plugin_base_array[1];
13
+ }
14
+ if(window.JsvCoreApi.ProcessType === "a64"){
15
+ PluginInfo64.downloadUrl = (plugin_base_url[plugin_base_url.length-1]==="/"?plugin_base_url:(plugin_base_url+"/"))+folder_name+"/JsvLatex-"+PluginInfo64.versionCodeMax+".dat"+suffix+"?md5="+PluginInfo64.md5;
16
+ }else{
17
+ PluginInfo.downloadUrl = (plugin_base_url[plugin_base_url.length-1]==="/"?plugin_base_url:(plugin_base_url+"/"))+folder_name+"/JsvLatex-"+PluginInfo.versionCodeMax+".dat"+suffix+"?md5="+PluginInfo.md5;
18
+ }
19
+ }
20
+ }
21
+
22
+ if(typeof window.jJsvRuntimeBridge!=='undefined' && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getBackupPluginBaseUrl !== "undefined"){
23
+ let folder_name = "com.qcode.jsvlatex";
24
+ let back_plugin_base = window.jJsvRuntimeBridge.getBackupPluginBaseUrl();
25
+ console.log("BackupPluginBaseUrl is "+back_plugin_base);
26
+ if(back_plugin_base != null && back_plugin_base != ""){
27
+ let back_plugin_base_array = JSON.parse(back_plugin_base);
28
+ if(back_plugin_base_array.length > 0){
29
+ if(window.JsvCoreApi.ProcessType === "a64"){
30
+ PluginInfo64.backupDownloadUrl = [];
31
+ }else{
32
+ PluginInfo.backupDownloadUrl = [];
33
+ }
34
+
35
+ for(let i=0; i<back_plugin_base_array.length; i++){
36
+ let temp_array = back_plugin_base_array[i].split("|split|");
37
+ let temp_suffix = "";
38
+ let plugin_base_url = temp_array[0];
39
+ if(temp_array.length > 1){
40
+ temp_suffix = temp_array[1];
41
+ }
42
+ if(window.JsvCoreApi.ProcessType === "a64"){
43
+ PluginInfo64.backupDownloadUrl.push((plugin_base_url[plugin_base_url.length-1]==="/"?plugin_base_url:(plugin_base_url+"/"))+folder_name+"/JsvLatex-"+PluginInfo64.versionCodeMax+".dat"+temp_suffix+"?md5="+PluginInfo64.md5);
44
+ }else{
45
+ PluginInfo.backupDownloadUrl.push((plugin_base_url[plugin_base_url.length-1]==="/"?plugin_base_url:(plugin_base_url+"/"))+folder_name+"/JsvLatex-"+PluginInfo.versionCodeMax+".dat"+temp_suffix+"?md5="+PluginInfo.md5);
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ reconfigPluginInfo();
54
+
55
+ function getPluginInfo(){
56
+ if(window.JsvCoreApi.ProcessType === "a64"){
57
+ return PluginInfo64;
58
+ }
59
+
60
+ return PluginInfo;
61
+ }
62
+
63
+ export {
64
+ getPluginInfo
65
+ }
@@ -20,16 +20,18 @@
20
20
  * height: {number} height
21
21
  * lineSpace: {number} 行距
22
22
  * color: {string} 文字颜色
23
+ * instantLoad: {boolean} 是否立即加载
23
24
  * [注意事项]
24
25
  * 1. 盒子端的字符串是直接作为数学公式解析的, 所以需要将\n替换为\\, 需要前端自己处理, 这里提供了一个辅助方法processLatexStr来处理简单的情况
25
26
  -->
26
27
  <script setup>
27
- import { onBeforeUnmount, ref } from "vue";
28
+ import { onBeforeUnmount, ref, watch } from "vue";
28
29
  import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
29
30
  import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
30
31
  import JsvLatexBridgeProxy from "./JsvLatexBridgeProxy";
31
32
  import { cssColor2Android } from "./Color";
32
33
  import { GetPluginLoader } from "./PluginLoader";
34
+ import { JsvFlexDiv } from "../../JsViewVueWidget";
33
35
 
34
36
  let sPluginLoader = GetPluginLoader();
35
37
 
@@ -52,7 +54,7 @@ const props = defineProps({
52
54
  },
53
55
  lineSpace: {
54
56
  type: Number,
55
- default: 10,
57
+ default: 2,
56
58
  },
57
59
  color: {
58
60
  type: String,
@@ -66,12 +68,18 @@ const props = defineProps({
66
68
  type: Number,
67
69
  default: 0,
68
70
  },
71
+ instantLoad: {
72
+ type: Boolean,
73
+ default: false,
74
+ },
69
75
  });
70
76
 
71
77
  const show = ref(false);
72
78
  let innerViewId = -1;
73
79
  let clientWidth = ref(props.width);
74
80
  let clientHeight = ref(props.height);
81
+ let drawingLatex = props.latexStr;
82
+ let pluginTexture = null;
75
83
 
76
84
  const getClientSize = () => {
77
85
  return {
@@ -94,25 +102,24 @@ const showView = () => {
94
102
  * }
95
103
  */
96
104
  const textureManager = ForgeHandles.TextureManager;
97
- const pluginTexture = textureManager.GetPluginTexture(
98
- "latexPlugin",
105
+ pluginTexture = textureManager.GetPluginTexture(
106
+ "JsvLatex",
99
107
  JSON.stringify({
100
108
  libRootPath: JsvLatexBridgeProxy.GetLibPath(),
101
- latexStr: props.latexStr,
109
+ latexStr: drawingLatex,
102
110
  width: props.width,
103
111
  textSize: props.fontSize,
104
112
  lineSpace: props.lineSpace,
105
113
  color: cssColor2Android(props.color),
106
- })
114
+ }),
115
+ props.instantLoad
107
116
  );
108
117
 
109
118
  pluginTexture.RegisterLoadImageCallback(null, (data) => {
110
- console.log("testtest texture load callback", data);
111
119
  tryUpdateClientSize(data.width, data.height);
112
120
  });
113
121
 
114
122
  const tryUpdateClientSize = (textureW, textureH) => {
115
- console.log("testtet latex texture size", textureW, textureH);
116
123
  if (textureW <= 0 || textureH <= 0) {
117
124
  console.warn("JsvLatex get empth texture", textureW, textureH);
118
125
  return;
@@ -129,6 +136,7 @@ const showView = () => {
129
136
  };
130
137
 
131
138
  const loadInfo = sPluginLoader.getLoadInfo();
139
+
132
140
  if (loadInfo.done) {
133
141
  if (loadInfo.succeed) {
134
142
  showView();
@@ -148,20 +156,54 @@ onBeforeUnmount(() => {
148
156
  }
149
157
  });
150
158
 
159
+ function updateLatexStr(latexStr) {
160
+ drawingLatex = latexStr;
161
+ if (show.value) {
162
+ if (pluginTexture) {
163
+ pluginTexture.UpdateValue(
164
+ JSON.stringify({
165
+ libRootPath: JsvLatexBridgeProxy.GetLibPath(),
166
+ latexStr: drawingLatex,
167
+ width: props.width,
168
+ textSize: props.fontSize,
169
+ lineSpace: props.lineSpace,
170
+ color: cssColor2Android(props.color),
171
+ })
172
+ );
173
+ } else {
174
+ console.warn("JsvLatex pluginTexture is null");
175
+ }
176
+ }
177
+ }
178
+
179
+ watch(
180
+ () => props.latexStr,
181
+ (newVal) => {
182
+ updateLatexStr(newVal);
183
+ }
184
+ );
185
+
151
186
  defineExpose({
152
187
  getClientSize,
188
+ updateLatexStr,
153
189
  });
190
+
191
+ const onSized = (width, height) => {
192
+ clientWidth.value = width;
193
+ clientHeight.value = height;
194
+ };
154
195
  </script>
155
196
 
156
197
  <template>
157
- <div
198
+ <jsv-flex-div
158
199
  :style="{
159
200
  left: left,
160
201
  top: top,
161
- width: clientWidth,
162
- height: clientHeight,
202
+ // width: clientWidth,
203
+ // height: clientHeight,
163
204
  }"
205
+ :onSized="onSized"
164
206
  >
165
207
  <div v-if="show" :data-jsv-vw-innerview="innerViewId"></div>
166
- </div>
208
+ </jsv-flex-div>
167
209
  </template>
@@ -13,4 +13,14 @@ export default class {
13
13
  return null;
14
14
  }
15
15
  }
16
+
17
+ static LoadDexWithOuter() {
18
+ if (typeof window.jsvLatexBridge != "undefined"
19
+ && typeof window.jsvLatexBridge.LoadDexWithOuter != "undefined") {
20
+ return window.jsvLatexBridge.LoadDexWithOuter();
21
+ } else {
22
+ console.error("widnow.jsvLatexBridge doesn't exist.")
23
+ return false;
24
+ }
25
+ }
16
26
  }
@@ -1,7 +1,9 @@
1
1
  <script setup>
2
- import { defineAsyncComponent } from "vue";
2
+ import { defineAsyncComponent, ref } from "vue";
3
3
  import JsvLatex from "./JsvLatex.vue";
4
4
 
5
+ const innerRef = ref(null);
6
+
5
7
  const AsyncComp = defineAsyncComponent(() => {
6
8
  return new Promise((resolve, reject) => {
7
9
  if (!window.JsView) {
@@ -13,8 +15,19 @@ const AsyncComp = defineAsyncComponent(() => {
13
15
  }
14
16
  });
15
17
  });
18
+
19
+ // 转发 JsvLatex.vue 的 expose 方法,供父组件通过 ref 调用
20
+ defineExpose({
21
+ getClientSize() {
22
+ return innerRef.value?.getClientSize?.();
23
+ },
24
+ updateLatexStr(latexStr) {
25
+ console.log("myt updateLatexStr")
26
+ innerRef.value?.updateLatexStr?.(latexStr);
27
+ },
28
+ });
16
29
  </script>
17
30
 
18
31
  <template>
19
- <AsyncComp v-bind="$attrs" />
32
+ <AsyncComp ref="innerRef" v-bind="$attrs" />
20
33
  </template>
@@ -3,8 +3,14 @@
3
3
  * @Date: 2023-02-27 20:04:28
4
4
  * @Description: file content
5
5
  */
6
- import PluginInfo from './version';
7
- import jsvLatexBridge from "./JsvLatexBridgeProxy"
6
+
7
+ //现在没有64的版本,现在先只import进来触发download url的更新
8
+ import { getPluginInfo } from "./GetVersion";
9
+ import { PluginInfo } from "./version.mjs";
10
+ import jsvLatexBridge from "./JsvLatexBridgeProxy";
11
+
12
+ //调用一下,没有实际意义,只是为了避免编译时被shaking掉
13
+ getPluginInfo();
8
14
 
9
15
  class PluginLoader {
10
16
  constructor() {
@@ -13,7 +19,7 @@ class PluginLoader {
13
19
  this.pluginInfo = this.getPluginInfo();
14
20
  this.loadDone = false;
15
21
  this.loadSucceed = false;
16
- /**
22
+ /**
17
23
  * 0:未加载;
18
24
  * 1:开始加载;
19
25
  * 2:加载旧插件;
@@ -27,10 +33,22 @@ class PluginLoader {
27
33
  getPluginInfo() {
28
34
  let info = PluginInfo;
29
35
  /** 获取下载链接 */
30
- if (typeof window.jJsvRuntimeBridge !== 'undefined' && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined") {
36
+ if (
37
+ typeof window.jJsvRuntimeBridge !== "undefined" &&
38
+ window.jJsvRuntimeBridge &&
39
+ typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined"
40
+ ) {
31
41
  let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
32
42
  if (plugin_base_url) {
33
- info.downloadUrl = (plugin_base_url[plugin_base_url.length - 1] === "/" ? plugin_base_url : (plugin_base_url + "/")) + info.packageName + "/JsvLatex-" + info.versionCodeMax + ".dat?md5=" + info.md5;
43
+ info.downloadUrl =
44
+ (plugin_base_url[plugin_base_url.length - 1] === "/"
45
+ ? plugin_base_url
46
+ : plugin_base_url + "/") +
47
+ info.packageName +
48
+ "/JsvLatex-" +
49
+ info.versionCodeMax +
50
+ ".dat?md5=" +
51
+ info.md5;
34
52
  }
35
53
  }
36
54
  return info;
@@ -46,7 +64,7 @@ class PluginLoader {
46
64
  return {
47
65
  done: this.loadDone,
48
66
  succeed: this.loadSucceed,
49
- }
67
+ };
50
68
  }
51
69
 
52
70
  /**
@@ -58,13 +76,16 @@ class PluginLoader {
58
76
  * 3:正在加载新插件,此时插件需要经历下载、解压等过程,用时较长,可以考虑给用户相关提示。
59
77
  * 4:插件加载完成。
60
78
  * 5:已加载不同版本的插件,此版本无法加载。
61
- *
79
+ *
62
80
  * 备注:不管插件加载处于什么状态,都可以正常使用播放器组件,播放器对象在插件未加载完成的情况下,会把相关状态保存,等完成加载后再自动下发。
63
81
  */
64
82
  loadPlugin(listener) {
65
83
  console.log("globalLoadJsvLatexPlugin");
66
84
  let plugin_status = 0;
67
- if (typeof window.jPluginManagerBridge === 'undefined' || !window.jPluginManagerBridge) {
85
+ if (
86
+ typeof window.jPluginManagerBridge === "undefined" ||
87
+ !window.jPluginManagerBridge
88
+ ) {
68
89
  plugin_status = 1;
69
90
  } else if (this.status === 2) {
70
91
  plugin_status = 2;
@@ -78,7 +99,9 @@ class PluginLoader {
78
99
 
79
100
  if (plugin_status !== 0) {
80
101
  if (typeof listener !== "undefined" && listener) {
81
- setTimeout(() => { listener(plugin_status) }, 0);
102
+ setTimeout(() => {
103
+ listener(plugin_status);
104
+ }, 0);
82
105
  }
83
106
  return;
84
107
  }
@@ -112,12 +135,10 @@ class PluginLoader {
112
135
  }
113
136
  }
114
137
 
115
-
116
-
117
138
  onLoadDone(result) {
118
139
  console.log("JsvLatexPluginLoadResult: " + result);
119
140
  this.loadDone = true;
120
- let ret_obj = JSON.parse(result)
141
+ let ret_obj = JSON.parse(result);
121
142
  let plugin_status = 1;
122
143
  if (ret_obj && (ret_obj.status === 4 || ret_obj.status === 1)) {
123
144
  this.status = 4;
@@ -131,33 +152,46 @@ class PluginLoader {
131
152
 
132
153
  if (this.status === 5) {
133
154
  this.loadSucceed = false;
134
- console.log("*************************JsvLatex plugin load failed, error code is " + ret_obj.status + "*************************");
155
+ console.log(
156
+ "*************************JsvLatex plugin load failed, error code is " +
157
+ ret_obj.status +
158
+ "*************************"
159
+ );
135
160
  } else {
136
161
  this.loadSucceed = true;
137
162
  }
138
163
 
139
164
  //往forge设置latex库的path
140
165
  if (window.JsView) {
141
- const libPath = jsvLatexBridge.GetLibPath();
142
- console.log("JsvLatex libPath", libPath);
143
- if (libPath) {
144
- window.JsView.loadRenderPlugin?.(
145
- "latexPlugin",
146
- "com.qcode.latexlib.Main",
147
- libPath,
148
- );
149
- } else {
150
- console.error("JsvLatexPlugin error: get libPath failed.")
151
- }
166
+ //先调用outer
167
+ jsvLatexBridge.LoadDexWithOuter().then(() => {
168
+ console.log("JsvLatex outter succeed");
169
+ for (let listener of this.onDoneListener) {
170
+ listener(plugin_status);
171
+ }
172
+ }, (error) => {
173
+ console.log("JsvLatex outter failed", error)
174
+ //触发Inner plugin的加载
175
+ const libPath = jsvLatexBridge.GetLibPath();
176
+ if (libPath) {
177
+ window.JsView.loadRenderPlugin?.(
178
+ "JsvLatex",
179
+ "com.qcode.latexlib.Main",
180
+ libPath
181
+ );
182
+ } else {
183
+ console.error("JsvLatexPlugin error: get libPath failed.");
184
+ }
185
+
186
+ for (let listener of this.onDoneListener) {
187
+ listener(plugin_status);
188
+ }
189
+ });
152
190
  }
153
191
 
154
192
  for (let i = 0; i < this.pluginLoadListener.length; i++) {
155
193
  this.pluginLoadListener[i](plugin_status);
156
194
  }
157
-
158
- for (let listener of this.onDoneListener) {
159
- listener(plugin_status);
160
- }
161
195
  }
162
196
 
163
197
  registerGlobalListener() {
@@ -176,6 +210,4 @@ function GetPluginLoader() {
176
210
  return sPluginLoader;
177
211
  }
178
212
 
179
- export {
180
- GetPluginLoader
181
- }
213
+ export { GetPluginLoader };