@shijiu/jsview-vue 2.2.201 → 2.2.426-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/browser/BrowserApic.vue.mjs +2 -13
- package/bin/browser/BrowserApic2.vue.mjs +2 -13
- package/bin/browser/BrowserApicLib.mjs +24 -24
- package/bin/browser/BrowserAudio.vue.mjs +2 -10
- package/bin/browser/BrowserJsvLatex.vue.mjs +39 -16
- package/bin/export-sfc.mjs +3 -3
- package/bin/jsview-vue-common.mjs +3 -3
- package/bin/jsview-vue.mjs +3288 -2312
- package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +72 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/ListWidget.vue.d.ts +6 -3
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/MetroWidget.vue.d.ts +6 -3
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/MetroWidgetSetup.d.ts +3 -1
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +64 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/TokenGenerator.d.ts +4 -0
- package/bin/types/utils/JsViewEngineWidget/RectUtils.d.ts +61 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/Fence.d.ts +2 -2
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/MetroTemplate.d.ts +3 -3
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/index.d.ts +1 -1
- package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.mts +13 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/index.d.ts +1 -0
- package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.mts +13 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/BrowserJsvPlayer-0.9.vue.d.ts +45 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/BrowserJsvPlayer.vue.d.ts +597 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/GetVersion.d.ts +13 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +420 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +57 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +588 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +358 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +358 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/version.d.mts +14 -0
- package/bin/types/utils/JsViewVueTools/FeatureActive.d.ts +10 -0
- package/bin/types/utils/JsViewVueTools/ForgeHandles.d.ts +6 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvDynamicCssStyle.d.ts +3 -1
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvDynamicKeyFrames.d.ts +4 -2
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvImpactTracer.d.ts +4 -4
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvPreDownloader.d.ts +3 -2
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvRefTaker.d.ts +2 -3
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvRuntimeBridge.d.ts +42 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvStyleSheetsDeclarer.d.ts +3 -1
- package/bin/types/utils/JsViewVueTools/JsvTextTools.d.ts +61 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureLoadTool.d.ts +63 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/JsvTextureStore.d.ts +8 -4
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/NinePatchHelper.d.ts +1 -1
- package/bin/types/utils/JsViewVueTools/TextureManagerTools.d.ts +7 -0
- package/bin/types/utils/JsViewVueTools/TypeCheckAndSet.d.ts +3 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/index.d.ts +3 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic/JsvApic.vue.d.ts +7 -0
- package/bin/types/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +84 -0
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +75 -0
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/index.d.ts +2 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFragShaderView/JsvFragShaderView.vue.d.ts +3 -1
- package/bin/types/utils/JsViewVueWidget/JsvFragShaderView/index.d.ts +1 -0
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/KeepFlags.d.ts +7 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +12 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +45 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/EditVisibleArea.d.ts +26 -0
- package/bin/types/{JsViewVueWidget/JsvPreload/BrowserPreload.vue.d.ts → utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts} +7 -5
- package/bin/types/utils/JsViewVueWidget/JsvInput/SharedDefine.d.ts +13 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/SystemTextTools.d.ts +16 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMaskClipDiv.vue.d.ts +0 -2
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/DataTree.d.ts +3 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/Geometry.d.ts +2 -2
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/JsvMindMap.vue.d.ts +16 -9
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvNativeSharedDiv.vue.d.ts +6 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvNinePatch.vue.d.ts +2 -1
- package/bin/types/utils/JsViewVueWidget/JsvPreload/index.d.ts +2 -0
- package/bin/types/utils/JsViewVueWidget/JsvSwiper/Indicator.vue.d.ts +16 -0
- package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue.d.ts +16 -0
- package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/index.d.ts +4 -0
- package/bin/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +75 -0
- package/bin/types/utils/JsViewVueWidget/JsvVideo.vue.d.ts +23 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/index.d.ts +4 -2
- package/index.d.ts +9 -1
- package/package.json +1 -1
- package/tools/config/toolkit.mjs +81 -0
- package/tools/config/vite.config.ts +24 -14
- package/tools/jsview-vue-build.mjs +67 -21
- package/tsconfig.json +27 -0
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +6 -2
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +3 -1
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +12 -5
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +175 -65
- package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/Fence.ts +2 -2
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +15 -9
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +4 -6
- package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +13 -3
- package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +27 -6
- package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +34 -28
- package/utils/JsViewPlugin/JsvLatex/index.js +22 -0
- package/utils/JsViewVueTools/FeatureActive.ts +84 -0
- package/utils/JsViewVueTools/ForgeHandles.ts +7 -3
- package/utils/JsViewVueTools/JsvDynamicCssStyle.js +2 -0
- package/utils/JsViewVueTools/JsvDynamicKeyFrames.ts +2 -0
- package/utils/JsViewVueTools/JsvHashHistory.js +26 -29
- package/utils/JsViewVueTools/JsvImpactTracer.js +2 -0
- package/utils/JsViewVueTools/JsvPreDownloader.ts +2 -1
- package/utils/JsViewVueTools/JsvRefTaker.js +1 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +125 -59
- package/utils/JsViewVueTools/JsvStyleClass.js +2 -0
- package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +2 -0
- package/utils/JsViewVueTools/JsvTextTools.ts +156 -0
- package/utils/JsViewVueTools/JsvTextureLoadTool.ts +233 -0
- package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +4 -1
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +7 -3
- package/utils/JsViewVueTools/JsvTextureStore/Texture.ts +1 -0
- package/utils/JsViewVueTools/TextureManagerTools.ts +17 -0
- package/utils/JsViewVueTools/TypeCheckAndSet.ts +66 -0
- package/utils/JsViewVueTools/index.js +4 -1
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +2 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue +10 -2
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +12 -1
- package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +4 -2
- package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +2 -0
- package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +219 -0
- package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +11 -9
- package/utils/JsViewVueWidget/JsvFilterView.vue +2 -0
- package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +5 -2
- package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +140 -0
- package/utils/JsViewVueWidget/JsvFlexCell/index.js +2 -5
- package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +214 -63
- package/utils/JsViewVueWidget/JsvFragShaderView/index.js +2 -9
- package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +9 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +2 -0
- package/utils/JsViewVueWidget/JsvGrid.vue +2 -0
- package/utils/JsViewVueWidget/JsvHole.js +2 -0
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +49 -45
- package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +353 -0
- package/utils/JsViewVueWidget/JsvInput/EditVisibleArea.ts +255 -0
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +294 -681
- package/utils/JsViewVueWidget/JsvInput/SharedDefine.ts +17 -0
- package/utils/JsViewVueWidget/JsvInput/SystemTextTools.ts +61 -0
- package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -0
- package/utils/JsViewVueWidget/JsvMarquee.vue +2 -0
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +5 -48
- package/utils/JsViewVueWidget/JsvMindMap/DataTree.ts +14 -1
- package/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue +277 -117
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +91 -68
- package/utils/JsViewVueWidget/JsvNinePatch.vue +5 -0
- package/utils/JsViewVueWidget/JsvPieChart.vue +2 -0
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +2 -0
- package/utils/JsViewVueWidget/JsvPosterImage.vue +3 -2
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +23 -44
- package/utils/JsViewVueWidget/JsvPreload/index.js +2 -13
- package/utils/JsViewVueWidget/JsvProgressBar.vue +2 -0
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +12 -12
- package/utils/JsViewVueWidget/JsvRadarChart.vue +2 -0
- package/utils/JsViewVueWidget/JsvRipple/Constant.js +2 -2
- package/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue +3 -1
- package/utils/JsViewVueWidget/JsvScaleTextBox.vue +2 -0
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +9 -0
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +9 -0
- package/utils/JsViewVueWidget/JsvSector.vue +2 -0
- package/utils/JsViewVueWidget/JsvSoundPool.js +5 -7
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +43 -23
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -5
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue +2 -0
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +2 -0
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +2 -0
- package/utils/JsViewVueWidget/JsvTextBox.vue +2 -4
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +48 -50
- package/utils/JsViewVueWidget/JsvTextureAnim/index.js +2 -9
- package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +101 -0
- package/utils/JsViewVueWidget/JsvVideo.vue +2 -2
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +2 -0
- package/utils/JsViewVueWidget/index.js +4 -2
- package/bin/browser/BrowserJsvFragShaderView.vue.mjs +0 -63
- package/bin/browser/BrowserPreload.vue.mjs +0 -143
- package/bin/browser/BrowserQrcode.vue.mjs +0 -180
- package/bin/browser/BrowserSpray.vue.mjs +0 -66
- package/bin/browser/BrowserTextureAnim.vue.mjs +0 -332
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +0 -102
- package/bin/types/JsViewVueTools/ForgeHandles.d.ts +0 -6
- package/bin/types/JsViewVueTools/JsvTextTools.d.ts +0 -37
- package/bin/types/JsViewVueTools/TypeCheckAndSet.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvFlexCell/index.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue.d.ts +0 -13
- package/bin/types/JsViewVueWidget/JsvFragShaderView/index.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +0 -36
- package/bin/types/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +0 -210
- package/bin/types/JsViewVueWidget/JsvPreload/index.d.ts +0 -17
- package/bin/types/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue.d.ts +0 -11
- package/bin/types/JsViewVueWidget/JsvQrcode/index.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvSpray/BrowserSpray.vue.d.ts +0 -25
- package/bin/types/JsViewVueWidget/JsvSpray/index.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue.d.ts +0 -151
- package/bin/types/JsViewVueWidget/JsvTextureAnim/index.d.ts +0 -14
- package/tools/config/tsconfig.json +0 -15
- package/utils/JsViewVueTools/JsvTextTools.js +0 -89
- package/utils/JsViewVueTools/TypeCheckAndSet.js +0 -27
- package/utils/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue +0 -48
- package/utils/JsViewVueWidget/JsvPreload/BrowserPreload.vue +0 -144
- package/utils/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue +0 -189
- package/utils/JsViewVueWidget/JsvQrcode/index.js +0 -18
- package/utils/JsViewVueWidget/JsvSpray/BrowserSpray.vue +0 -55
- package/utils/JsViewVueWidget/JsvSpray/index.js +0 -17
- package/utils/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue +0 -359
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/CheckType.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/JsvFocus/JsvFocusHub.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/JsvFocus/JsvFocusManager.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/Const.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/Dispatcher.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/PageUpdater.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/RenderItem.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/Slide.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/SlotComponent.vue.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/VisibleInfo.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/WidgetRectInfo.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/RangeModel.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/CommonMetroTemplate.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/ListMetroTemplate.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/TemplateItemAdder.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/index.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/WidgetCommon.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAccount/JsvAccount.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/AudioProxy.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +4 -4
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/CheckType.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/Events.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/JsvAudio.vue.d.ts +4 -4
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/JsvAudioBridgeProxy.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/JsvAudioProxy.vue.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/PluginLoader.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/ScreenLockManager.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/index.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/version.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/BrowserDomBuilder.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/BrowserJsvLatex.vue.d.ts +4 -4
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/Color.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/JsvLatex.vue.d.ts +4 -4
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/JsvLatexBridgeProxy.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/JsvLatexProxy.vue.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/PluginLoader.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/version.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/index.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/ConstSymbol.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/DebugContentShellJBridge.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/DebugTool.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/DefaultKeyMap.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/ForgeConstDefine.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvDemoTester.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvFederationTools.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvHashHistory.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvPerformance.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvStyleClass.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureDefines.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/CanvasTexture/CommandList.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/CanvasTexture/Path.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/Store.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/Texture.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvActorMove/ActorControlBase.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvActorMove/JsvActorMove.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvActorMove/JsvActorMoveControl.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvActorMove/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic/BrowserApic.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic2/JsvApic2.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic2/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/GifData.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/Viewer.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/WebpData.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvCommonLoopToolBase.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvClipDiv/JsvClipDiv.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvClipDiv/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvConnectLine/ArcLineManager.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvConnectLine/JsvConnectLine.vue.d.ts +2 -2
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvConnectLine/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvDriftScope/JsvDriftScope.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvDriftScope/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvEnableRenderBreak.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFilterView.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFlexCell/JsvFlexDiv.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/ActionRefObject.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/ActorControl.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/ActorState.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/CallbackManager.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/ForgeTypeDefine.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +9 -9
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/NexusNode.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/SetAction.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/SetCondition.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/SetState.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/SyncLinkManager.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvGrid.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvHole.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvInput/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvLine/JsvLine.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvLine/LineManager.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvLine/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMarquee.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/CommonType.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/Constant.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/rtree.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvPieChart.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvPosterDiv.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvPosterImage.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvPreload/JsvPreload.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvProgressBar.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvQrcode/JsvQrcode.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvRadarChart.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvRipple/Constant.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvRipple/JsvRipple.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvRipple/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScaleTextBox.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/JsvScrollBox.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/JsvScrollFollow.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/ScrollInnerSymbol.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/ScrollSymbol.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSector.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSoundPool.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpray/JsvSpray.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/FrameBuidler.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/JsvSpriteTools.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/SpriteController.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/sAnimationToken.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSwiper/JsvSwiper.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSwiper/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSwiper3D/JsvSwiper.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSwiper3D/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvTextBox.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvTextureAnim/CommonType.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvTextureAnim/JsvTextureAnim.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +6 -6
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvVisibleSensor/index.d.ts +6 -6
- /package/bin/types/{index.d.ts → utils/index.d.ts} +0 -0
|
@@ -27,9 +27,10 @@ import { RenderItem } from "./RenderItem";
|
|
|
27
27
|
import { VisibleInfo } from "./VisibleInfo";
|
|
28
28
|
import { WidgetRectInfo } from "./WidgetRectInfo";
|
|
29
29
|
import ActorControl from "../../JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts";
|
|
30
|
-
import { TaskType,
|
|
30
|
+
import { TaskType, TaskManager, AnimationManager, SlideTaskType } from "./TaskManager.ts";
|
|
31
31
|
import { getDirectionByRect, RectCache } from "./Slide.ts";
|
|
32
32
|
import { ForgeConst } from "../../JsViewVueTools/ForgeConstDefine.ts";
|
|
33
|
+
import { FeatureNames, JsvUseFeature } from "../../JsViewVueTools/FeatureActive.ts";
|
|
33
34
|
|
|
34
35
|
const TAG = "MetroWidget";
|
|
35
36
|
|
|
@@ -117,6 +118,9 @@ export const setup = (
|
|
|
117
118
|
innerKeepTraceRange = props.keepTraceRange;
|
|
118
119
|
} else {
|
|
119
120
|
if (props.touchFlag > 0) {
|
|
121
|
+
// 激活引擎功能的支持
|
|
122
|
+
JsvUseFeature('MetroWidget', FeatureNames.TouchReceiver);
|
|
123
|
+
|
|
120
124
|
//触控默认3屏
|
|
121
125
|
innerKeepTraceRange = 3;
|
|
122
126
|
} else {
|
|
@@ -177,6 +181,9 @@ export const setup = (
|
|
|
177
181
|
},
|
|
178
182
|
getTouchState() {
|
|
179
183
|
return this._touchState;
|
|
184
|
+
},
|
|
185
|
+
getTouchCount() {
|
|
186
|
+
return this._touchCount;
|
|
180
187
|
}
|
|
181
188
|
}
|
|
182
189
|
|
|
@@ -238,7 +245,6 @@ export const setup = (
|
|
|
238
245
|
let slideDoAnim = false;
|
|
239
246
|
|
|
240
247
|
mRectCache.cacheManually();
|
|
241
|
-
|
|
242
248
|
/**
|
|
243
249
|
* 处理resize
|
|
244
250
|
*/
|
|
@@ -266,6 +272,9 @@ export const setup = (
|
|
|
266
272
|
})
|
|
267
273
|
});
|
|
268
274
|
|
|
275
|
+
//更新touch的size
|
|
276
|
+
updateTouchDivSize();
|
|
277
|
+
|
|
269
278
|
//使用上一帧的状态计算anchorPosition
|
|
270
279
|
if (resizeTaskMap[id2Index(focusId)]) {
|
|
271
280
|
const task = resizeTaskMap[id2Index(focusId)];
|
|
@@ -370,7 +379,7 @@ export const setup = (
|
|
|
370
379
|
preInfo = mRectCache.getPreRect();
|
|
371
380
|
if (preInfo) {
|
|
372
381
|
let totalSize = metroTemplate.getBoundingBoxSize();
|
|
373
|
-
v.start = Math.min(Math.max(0, targetRect[pos_key] - preInfo[pos_key] + v.start), totalSize[size_key] - v.range);
|
|
382
|
+
v.start = Math.min(Math.max(0, targetRect[pos_key] - preInfo[pos_key] + v.start), Math.max(0, totalSize[size_key] - v.range));
|
|
374
383
|
preInfo[pos_key] += (v.start - visibleInfo.start);
|
|
375
384
|
}
|
|
376
385
|
}
|
|
@@ -661,7 +670,7 @@ export const setup = (
|
|
|
661
670
|
|
|
662
671
|
const onItemFocus = (focusItem, rect) => {
|
|
663
672
|
//触控模式不触发item的onFocus
|
|
664
|
-
if (!focusItem
|
|
673
|
+
if (!focusItem) return;
|
|
665
674
|
setItemZIndex(focusItem, innerData.length, true);
|
|
666
675
|
if (isFocus) {
|
|
667
676
|
_itemOnFocusSideEffect(focusItem, rect);
|
|
@@ -852,6 +861,20 @@ export const setup = (
|
|
|
852
861
|
}
|
|
853
862
|
}
|
|
854
863
|
|
|
864
|
+
function ifLayoutChange(type, oldMeasureItem, newMeasureItem) {
|
|
865
|
+
let changed = newMeasureItem.width !== oldMeasureItem.width
|
|
866
|
+
|| newMeasureItem.height !== oldMeasureItem.height
|
|
867
|
+
|| newMeasureItem.focusable !== oldMeasureItem.focusable
|
|
868
|
+
|| newMeasureItem.marginRight !== oldMeasureItem.marginRight
|
|
869
|
+
|| newMeasureItem.marginBottom !== oldMeasureItem.marginBottom;
|
|
870
|
+
if (type !== "relative") {
|
|
871
|
+
changed = changed
|
|
872
|
+
|| newMeasureItem.left !== oldMeasureItem.left
|
|
873
|
+
|| newMeasureItem.top !== oldMeasureItem.top
|
|
874
|
+
}
|
|
875
|
+
return changed;
|
|
876
|
+
}
|
|
877
|
+
|
|
855
878
|
const DATA_ID_KEY = "jsvKey";
|
|
856
879
|
const refreshData = (forceUpdate) => {
|
|
857
880
|
//由于data不支持reactive, 因此数据的更新只通过provideData
|
|
@@ -881,11 +904,7 @@ export const setup = (
|
|
|
881
904
|
} else {
|
|
882
905
|
const newMeasureItem = props.measures(newItem);
|
|
883
906
|
const oldMeasureItem = props.measures(oldItem);
|
|
884
|
-
|
|
885
|
-
layoutChange = newMeasureItem.width !== oldMeasureItem.width || newMeasureItem.height !== oldMeasureItem.height;
|
|
886
|
-
} else {
|
|
887
|
-
layoutChange = newMeasureItem.width !== oldMeasureItem.width || newMeasureItem.height !== oldMeasureItem.height || newMeasureItem.left !== oldMeasureItem.left || newMeasureItem.top !== oldMeasureItem.top;
|
|
888
|
-
}
|
|
907
|
+
layoutChange = ifLayoutChange(props.layoutType, oldMeasureItem, newMeasureItem);
|
|
889
908
|
if (layoutChange) {
|
|
890
909
|
break;
|
|
891
910
|
} else {
|
|
@@ -956,6 +975,7 @@ export const setup = (
|
|
|
956
975
|
for (let i of onlyDataChangeList) {
|
|
957
976
|
if (i.index < innerData.length) {
|
|
958
977
|
innerData[i.index].updateCustomData(i.data, _getItemConfigFromMeasursObj(i.measureObj));
|
|
978
|
+
innerData[i.index].enableTap = i.measureObj.enableTap ?? false;
|
|
959
979
|
} else {
|
|
960
980
|
//之后的数据未布局, 尚未添加到innerData中
|
|
961
981
|
break;
|
|
@@ -1026,10 +1046,6 @@ export const setup = (
|
|
|
1026
1046
|
return id2Index(focusId);
|
|
1027
1047
|
}
|
|
1028
1048
|
|
|
1029
|
-
const getCurMode = () => {
|
|
1030
|
-
return mode.getMode();
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
1049
|
const getTemplatePosition = (index) => {
|
|
1034
1050
|
return _getTemplatePosition(index);
|
|
1035
1051
|
}
|
|
@@ -1050,6 +1066,13 @@ export const setup = (
|
|
|
1050
1066
|
}
|
|
1051
1067
|
}
|
|
1052
1068
|
|
|
1069
|
+
const tryCancelDelayLoad = () => {
|
|
1070
|
+
if (delayLoadHandler > 0) {
|
|
1071
|
+
clearTimeout(delayLoadHandler);
|
|
1072
|
+
delayLoadHandler = -1;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1053
1076
|
const exportObject = {
|
|
1054
1077
|
lockSlide,
|
|
1055
1078
|
unlockSlide,
|
|
@@ -1069,9 +1092,10 @@ export const setup = (
|
|
|
1069
1092
|
getVisibleItems,
|
|
1070
1093
|
getCustomerDataSize,
|
|
1071
1094
|
getCurrentFocusIndex,
|
|
1072
|
-
getCurMode,
|
|
1073
1095
|
getTemplatePosition,
|
|
1074
|
-
setSlideSetting
|
|
1096
|
+
setSlideSetting,
|
|
1097
|
+
cancelDelayLoad: tryCancelDelayLoad,
|
|
1098
|
+
setSensorSensitivity,
|
|
1075
1099
|
};
|
|
1076
1100
|
|
|
1077
1101
|
const _calculateNearestItemByRect = (visibleSet, enter_rect_info) => {
|
|
@@ -1269,6 +1293,24 @@ export const setup = (
|
|
|
1269
1293
|
}
|
|
1270
1294
|
};
|
|
1271
1295
|
|
|
1296
|
+
const onDispatchKeyDown = (ev) => {
|
|
1297
|
+
if (mode.getMode() == TOUCH_MODE && !mode.duringTouch()) {
|
|
1298
|
+
if (ev.keyCode == 37 || ev.keyCode == 38 || ev.keyCode == 39 || ev.keyCode == 40) {
|
|
1299
|
+
//只有在上下左右键切换为focus_mode
|
|
1300
|
+
mode.keyDown();
|
|
1301
|
+
//touch切换为focus的首次按键只显示焦点
|
|
1302
|
+
const focusItem = _getVisibleFocusableItem();
|
|
1303
|
+
const preFocusItem = getItemById(focusId);
|
|
1304
|
+
_changeFocusId(focusItem.id, false);
|
|
1305
|
+
if (preFocusItem.id !== focusItem.id) {
|
|
1306
|
+
onItemBlur(preFocusItem);
|
|
1307
|
+
}
|
|
1308
|
+
onItemFocus(focusItem);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
return false;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1272
1314
|
const focusBlockOnKeyDown = (ev) => {
|
|
1273
1315
|
if (onKeyDownLock) {
|
|
1274
1316
|
return true;
|
|
@@ -1278,14 +1320,6 @@ export const setup = (
|
|
|
1278
1320
|
if (mode.duringTouch()) {
|
|
1279
1321
|
//touch过程中的按键不处理
|
|
1280
1322
|
return true;
|
|
1281
|
-
} else {
|
|
1282
|
-
//切换为focus_mode
|
|
1283
|
-
mode.keyDown();
|
|
1284
|
-
//touch切换为focus的首次按键只显示焦点
|
|
1285
|
-
const focusItem = _getVisibleFocusableItem();
|
|
1286
|
-
_changeFocusId(focusItem.id, false);
|
|
1287
|
-
onItemFocus(focusItem);
|
|
1288
|
-
return true;
|
|
1289
1323
|
}
|
|
1290
1324
|
}
|
|
1291
1325
|
|
|
@@ -1319,14 +1353,11 @@ export const setup = (
|
|
|
1319
1353
|
);
|
|
1320
1354
|
};
|
|
1321
1355
|
|
|
1322
|
-
|
|
1323
|
-
//update slideDiv size
|
|
1356
|
+
function updateTouchDivSize() {
|
|
1324
1357
|
const lastTemplateInfo = getItemByIndex(
|
|
1325
1358
|
metroTemplate.getTailItemIndex()
|
|
1326
1359
|
)?.templateInfo;
|
|
1327
1360
|
if (lastTemplateInfo) {
|
|
1328
|
-
let preTouchW = touchDivSize.width;
|
|
1329
|
-
let preTouchH = touchDivSize.height;
|
|
1330
1361
|
if (vertical) {
|
|
1331
1362
|
touchDivSize.width = props.width;
|
|
1332
1363
|
touchDivSize.height = lastTemplateInfo.top + lastTemplateInfo.height - 1;
|
|
@@ -1334,9 +1365,16 @@ export const setup = (
|
|
|
1334
1365
|
touchDivSize.width = lastTemplateInfo.left + lastTemplateInfo.width - 1;
|
|
1335
1366
|
touchDivSize.height = props.height;
|
|
1336
1367
|
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
const _onTemplateAddDone = () => {
|
|
1372
|
+
//update slideDiv size
|
|
1373
|
+
let preTouchW = touchDivSize.width;
|
|
1374
|
+
let preTouchH = touchDivSize.height;
|
|
1375
|
+
updateTouchDivSize();
|
|
1376
|
+
if (preTouchW !== touchDivSize.width || preTouchH !== touchDivSize.height) {
|
|
1377
|
+
updateTouchBoxCondition();
|
|
1340
1378
|
}
|
|
1341
1379
|
}
|
|
1342
1380
|
|
|
@@ -1644,11 +1682,10 @@ export const setup = (
|
|
|
1644
1682
|
if ((innerSlideSetting.BoundaryProtect & SlideSetting.START_PROTECT) > 0) {
|
|
1645
1683
|
if (vInfo.start >= 0) {
|
|
1646
1684
|
let boundary = 0;
|
|
1647
|
-
//首个元素是占位符时, 在保证获焦区域完全展示的前提下要保证首个不可获焦元素的完全展示
|
|
1648
1685
|
const headTemplateInfo = getItemByIndex(0).templateInfo;
|
|
1649
1686
|
if (
|
|
1650
1687
|
targetRect
|
|
1651
|
-
&& (
|
|
1688
|
+
&& (index == headTemplateInfo.index)
|
|
1652
1689
|
&& targetRect[pos_key] + targetRect[size_key] <=
|
|
1653
1690
|
vInfo.range
|
|
1654
1691
|
) {
|
|
@@ -1669,7 +1706,7 @@ export const setup = (
|
|
|
1669
1706
|
let boundary = lastVisibleStart;
|
|
1670
1707
|
if (
|
|
1671
1708
|
targetRect
|
|
1672
|
-
&& (
|
|
1709
|
+
&& (index == lastTemplateInfo.index)
|
|
1673
1710
|
&& targetRect[pos_key] - lastVisibleStart >= 0
|
|
1674
1711
|
) {
|
|
1675
1712
|
boundary = lastTemplateInfo[pos_key] - vInfo.range;
|
|
@@ -1961,13 +1998,16 @@ export const setup = (
|
|
|
1961
1998
|
|
|
1962
1999
|
//touch setting
|
|
1963
2000
|
let actorController = null;
|
|
1964
|
-
const touchLoadItemRect = visibleInfo.range;
|
|
1965
2001
|
const reachAnchorGroup = 2;
|
|
1966
2002
|
const wallConditionGroup = 1;
|
|
1967
|
-
const
|
|
2003
|
+
const ScensorCondigionGroup = 3;
|
|
2004
|
+
const TouchDownConditionGroup = 4;
|
|
1968
2005
|
|
|
1969
2006
|
let divPos = -1;
|
|
1970
2007
|
let frameCount = -1;
|
|
2008
|
+
const DEFAULT_SENSITIVITY = 10;
|
|
2009
|
+
let onMoveSensitivity = -1;
|
|
2010
|
+
|
|
1971
2011
|
const getVisibleStart = (moveInfo) => {
|
|
1972
2012
|
divPos = vertical ? slideDivTop.value + freeMoveSlideGapTop : slideDivLeft.value + freeMoveSlideGapLeft;
|
|
1973
2013
|
if (vertical) {
|
|
@@ -1977,6 +2017,51 @@ export const setup = (
|
|
|
1977
2017
|
}
|
|
1978
2018
|
}
|
|
1979
2019
|
|
|
2020
|
+
function onSensor(pos) {
|
|
2021
|
+
const lastTemplateInfo = getItemByIndex(
|
|
2022
|
+
metroTemplate.getTailItemIndex()
|
|
2023
|
+
)?.templateInfo;
|
|
2024
|
+
let totalWidth = 0;
|
|
2025
|
+
if (lastTemplateInfo) {
|
|
2026
|
+
if (vertical) {
|
|
2027
|
+
totalWidth = lastTemplateInfo.top + lastTemplateInfo.height - 1;
|
|
2028
|
+
} else {
|
|
2029
|
+
totalWidth = lastTemplateInfo.left + lastTemplateInfo.width - 1;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
props.onScroll?.(
|
|
2033
|
+
vertical ? -(pos.yPos + slideDivTop.value + freeMoveSlideGapTop) : -(pos.xPos + slideDivLeft.value + freeMoveSlideGapLeft),
|
|
2034
|
+
visibleInfo.range,
|
|
2035
|
+
totalWidth
|
|
2036
|
+
);
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
function setOnMovement(sensitivity) {
|
|
2040
|
+
onMoveSensitivity = sensitivity;
|
|
2041
|
+
actorController.run((cmds) => [
|
|
2042
|
+
cmds.state().removeConditionByGroup(ScensorCondigionGroup),
|
|
2043
|
+
cmds
|
|
2044
|
+
.condition(ScensorCondigionGroup, true)
|
|
2045
|
+
.onMovement(sensitivity) // 设置x或y移动超过10时才触发回调,以此减少回调的频次,规避js的性能影响
|
|
2046
|
+
.then([onSensor]),
|
|
2047
|
+
]);
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
function setSensorSensitivity(sensitivity = DEFAULT_SENSITIVITY) {
|
|
2051
|
+
if (!actorController) { return }
|
|
2052
|
+
if (sensitivity <= 0) {
|
|
2053
|
+
actorController.run((cmds) => [
|
|
2054
|
+
cmds.state().removeConditionByGroup(ScensorCondigionGroup),
|
|
2055
|
+
]);
|
|
2056
|
+
return;
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
if (sensitivity != onMoveSensitivity) {
|
|
2060
|
+
setOnMovement(sensitivity)
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
|
|
1980
2065
|
const getTouchCount = (nexusCustomData) => {
|
|
1981
2066
|
let touchCount = -1;
|
|
1982
2067
|
if (nexusCustomData) {
|
|
@@ -2017,15 +2102,19 @@ export const setup = (
|
|
|
2017
2102
|
])
|
|
2018
2103
|
]);
|
|
2019
2104
|
}
|
|
2105
|
+
function onTouchActionDone(touchCount) {
|
|
2106
|
+
//一次触控动作结束
|
|
2107
|
+
mergeTouchSlideToSlideDiv(touchCount);
|
|
2108
|
+
//由于movement的监听是有帧数间隔的, 所以结束时需要再调用一次onScroll
|
|
2109
|
+
_onScroll();
|
|
2110
|
+
}
|
|
2020
2111
|
|
|
2021
2112
|
const onTouchDown = (data, customData, nexusCustomData) => {
|
|
2022
2113
|
touchRecorder.reset();
|
|
2023
2114
|
let touchCount = getTouchCount(nexusCustomData);
|
|
2024
2115
|
touchRecorder.setTouchCount(touchCount);
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
updateTouchBoxCondition();
|
|
2028
|
-
}
|
|
2116
|
+
updateTouchBoxCondition();
|
|
2117
|
+
|
|
2029
2118
|
mode.touchStart(touchCount);
|
|
2030
2119
|
// console.log("touchtest", `${props.name} animId:${debugAnimId} viewId:${debugViewId}`,
|
|
2031
2120
|
// "onTouchDown", data, customData, nexusCustomData)
|
|
@@ -2044,18 +2133,18 @@ export const setup = (
|
|
|
2044
2133
|
let passDownTouchInfo = nexusCustomData;
|
|
2045
2134
|
actorController.run((cmds) => [
|
|
2046
2135
|
cmds
|
|
2047
|
-
.condition(
|
|
2136
|
+
.condition(TouchDownConditionGroup, false)
|
|
2048
2137
|
.offsetPosition(offsetThreshold.left, offsetThreshold.top, offsetThreshold.right, offsetThreshold.bottom)
|
|
2049
2138
|
.then([
|
|
2050
2139
|
cmds.state().touchLockSwitch(true, vertical ? 1 : 2, unlockThreshold)]),
|
|
2051
2140
|
cmds
|
|
2052
|
-
.condition(
|
|
2141
|
+
.condition(TouchDownConditionGroup, false)
|
|
2053
2142
|
.startMove(true, true)
|
|
2054
2143
|
.then([SliderEditFuncReOrderWrap((d) => { onDragStart(d, null, passDownTouchInfo) })]),
|
|
2055
2144
|
])
|
|
2056
2145
|
|
|
2057
2146
|
//blur item
|
|
2058
|
-
onItemBlur(getItemById(focusId));
|
|
2147
|
+
// onItemBlur(getItemById(focusId));
|
|
2059
2148
|
|
|
2060
2149
|
templateItemAdder.tryAddItemByPosition(visibleInfo.end + visibleInfo.range);
|
|
2061
2150
|
|
|
@@ -2100,19 +2189,26 @@ export const setup = (
|
|
|
2100
2189
|
mode.touchEnd(touchCount);
|
|
2101
2190
|
} else {
|
|
2102
2191
|
if (touchRecorder.moved && !mode.duringFling()) {
|
|
2103
|
-
|
|
2192
|
+
onTouchActionDone(touchRecorder.touchCount);
|
|
2104
2193
|
updateRenderItems(false, false);
|
|
2105
2194
|
mode.touchEnd(touchCount)
|
|
2106
2195
|
}
|
|
2107
2196
|
}
|
|
2197
|
+
actorController.run((cmds) => [
|
|
2198
|
+
cmds.state().removeConditionByGroup(TouchDownConditionGroup),
|
|
2199
|
+
cmds.state().touchLockSwitch(false, vertical ? 1 : 2)
|
|
2200
|
+
])
|
|
2108
2201
|
}
|
|
2109
2202
|
|
|
2110
2203
|
const exportOnTouchRelease = props.touchFlag > 0 ? onTouchRelease : undefined;
|
|
2111
2204
|
|
|
2112
2205
|
const onDragStart = (data, customData, nexusCustomData) => {
|
|
2113
|
-
let touchCount = getTouchCount(nexusCustomData);
|
|
2206
|
+
let touchCount = getTouchCount(nexusCustomData);
|
|
2114
2207
|
touchRecorder.move();
|
|
2115
|
-
mode.
|
|
2208
|
+
if (!(mode.getTouchCount() == touchCount && mode.duringFling())) {
|
|
2209
|
+
//dragStart event may be triggered after fling event because of sending it when startMove condition is satisfied
|
|
2210
|
+
mode.dragStart(touchCount)
|
|
2211
|
+
}
|
|
2116
2212
|
visibleInfo.start = getVisibleStart(data);
|
|
2117
2213
|
}
|
|
2118
2214
|
|
|
@@ -2140,12 +2236,11 @@ export const setup = (
|
|
|
2140
2236
|
}
|
|
2141
2237
|
|
|
2142
2238
|
const onFlingEnd = (data, customData, nexusCustomData) => {
|
|
2143
|
-
let touchCount = getTouchCount(nexusCustomData);
|
|
2144
2239
|
visibleInfo.start = getVisibleStart(data);
|
|
2145
2240
|
//记录拖拽的距离
|
|
2146
2241
|
if (mode.duringFling()) {
|
|
2147
2242
|
let touchCount = getTouchCount(nexusCustomData);
|
|
2148
|
-
|
|
2243
|
+
onTouchActionDone(touchCount);
|
|
2149
2244
|
updateRenderItems(false, false);
|
|
2150
2245
|
mode.flingEnd(touchCount);
|
|
2151
2246
|
mode.touchEnd(touchCount);
|
|
@@ -2166,13 +2261,13 @@ export const setup = (
|
|
|
2166
2261
|
bottom: 0,
|
|
2167
2262
|
}
|
|
2168
2263
|
if (vertical) {
|
|
2169
|
-
wall.top = -boxSize.height + props.height - slideDivTop.value;
|
|
2264
|
+
wall.top = -boxSize.height + props.height - slideDivTop.value - (widgetRectInfo.padding.top + widgetRectInfo.padding.bottom);
|
|
2170
2265
|
wall.bottom = -slideDivTop.value;
|
|
2171
2266
|
if (wall.top > wall.bottom) {
|
|
2172
2267
|
wall.top = wall.bottom;
|
|
2173
2268
|
}
|
|
2174
2269
|
} else {
|
|
2175
|
-
wall.left = -boxSize.width + props.width - slideDivLeft.value;
|
|
2270
|
+
wall.left = -boxSize.width + props.width - slideDivLeft.value - (widgetRectInfo.padding.left + widgetRectInfo.padding.right);
|
|
2176
2271
|
wall.right = -slideDivLeft.value;
|
|
2177
2272
|
if (wall.left > wall.right) {
|
|
2178
2273
|
wall.left = wall.right;
|
|
@@ -2239,11 +2334,12 @@ export const setup = (
|
|
|
2239
2334
|
}
|
|
2240
2335
|
}
|
|
2241
2336
|
|
|
2242
|
-
|
|
2243
2337
|
//TODO debug
|
|
2244
2338
|
// let debugAnimId = -1;
|
|
2245
2339
|
// let debugViewId = -1
|
|
2340
|
+
let touchInited = false;
|
|
2246
2341
|
const initTouch = () => {
|
|
2342
|
+
touchInited = true;
|
|
2247
2343
|
actorController = new ActorControl();
|
|
2248
2344
|
const divView = touchDiv.value.jsvGetProxyView();
|
|
2249
2345
|
actorController.bindForgeView(divView, true);
|
|
@@ -2266,7 +2362,6 @@ export const setup = (
|
|
|
2266
2362
|
}
|
|
2267
2363
|
)
|
|
2268
2364
|
|
|
2269
|
-
|
|
2270
2365
|
// debugAnimId = actorController.debugGetAnimId();
|
|
2271
2366
|
// debugViewId = divView.ViewId;
|
|
2272
2367
|
// console.log("testtest", props.name, `animId:${debugAnimId} viewId:${debugViewId}`);
|
|
@@ -2310,6 +2405,17 @@ export const setup = (
|
|
|
2310
2405
|
.boxPosition(walls.left, walls.top, walls.right, walls.bottom)
|
|
2311
2406
|
.then([cmds.state().setHitWallOverflow()]), //TODO 通过prop设置哪个方向overflow
|
|
2312
2407
|
]);
|
|
2408
|
+
|
|
2409
|
+
if (props.onScroll) {
|
|
2410
|
+
setOnMovement(DEFAULT_SENSITIVITY);
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
function cleanTouch() {
|
|
2415
|
+
actorController.run((cmds) => [
|
|
2416
|
+
cmds.state().clearAllConditions(),
|
|
2417
|
+
cmds.state().touchLockSwitch(false, vertical ? 1 : 2)
|
|
2418
|
+
])
|
|
2313
2419
|
}
|
|
2314
2420
|
|
|
2315
2421
|
//init
|
|
@@ -2369,20 +2475,20 @@ export const setup = (
|
|
|
2369
2475
|
permanentItemList
|
|
2370
2476
|
);
|
|
2371
2477
|
initUpdater.apply();
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2478
|
+
//触控时, 延时加载剩余屏
|
|
2479
|
+
let delayLoadHandler = -1;
|
|
2480
|
+
if (props.touchFlag > 0) {
|
|
2481
|
+
delayLoadHandler = setTimeout(() => {
|
|
2482
|
+
const updateHandler = pageUpdater.update(
|
|
2483
|
+
metroTemplate,
|
|
2484
|
+
initVisibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
2485
|
+
initVisibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
2486
|
+
focusId,
|
|
2487
|
+
false,
|
|
2488
|
+
permanentItemList
|
|
2489
|
+
);
|
|
2490
|
+
updateHandler.apply();
|
|
2491
|
+
}, 200);
|
|
2386
2492
|
}
|
|
2387
2493
|
|
|
2388
2494
|
onMounted(() => {
|
|
@@ -2411,6 +2517,9 @@ export const setup = (
|
|
|
2411
2517
|
taskManager.cancelAllTask();
|
|
2412
2518
|
tryCancelDelayLoad();
|
|
2413
2519
|
mounted = false;
|
|
2520
|
+
if (touchInited) {
|
|
2521
|
+
cleanTouch();
|
|
2522
|
+
}
|
|
2414
2523
|
});
|
|
2415
2524
|
|
|
2416
2525
|
return {
|
|
@@ -2426,5 +2535,6 @@ export const setup = (
|
|
|
2426
2535
|
onTouchRelease: exportOnTouchRelease,
|
|
2427
2536
|
currentFocusIndex,
|
|
2428
2537
|
modeForExport,
|
|
2538
|
+
onDispatchKeyDown
|
|
2429
2539
|
}
|
|
2430
2540
|
}
|
|
@@ -83,7 +83,7 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
83
83
|
hOffset: number, moveType: number): TemplateItem | null {
|
|
84
84
|
const item = this.getItemById(baseId) as any;
|
|
85
85
|
if (item) {
|
|
86
|
-
let neighborDirection:
|
|
86
|
+
let neighborDirection: "left" | "right" | "bottom" | "top" | null = null;
|
|
87
87
|
if (this.direction == VERTICAL) {
|
|
88
88
|
if (vOffset > 0) {
|
|
89
89
|
neighborDirection = "bottom";
|
|
@@ -97,16 +97,22 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
97
97
|
neighborDirection = "left";
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
if (neighborDirection !== null) {
|
|
101
|
+
if (item.neighborIndexList[neighborDirection].length === 0) return null;
|
|
102
|
+
let target = this.getItemByIndex(item.neighborIndexList[neighborDirection][0]);
|
|
103
|
+
while (target) {
|
|
104
|
+
if (target.focusable) {
|
|
105
|
+
break;
|
|
106
|
+
} else {
|
|
107
|
+
if (target.neighborIndexList[neighborDirection].length > 0) {
|
|
108
|
+
target = this.getItemByIndex(target.neighborIndexList[neighborDirection][0]);
|
|
109
|
+
} else {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
107
113
|
}
|
|
114
|
+
return target;
|
|
108
115
|
}
|
|
109
|
-
return target;
|
|
110
116
|
}
|
|
111
117
|
return null;
|
|
112
118
|
}
|
|
@@ -137,7 +137,7 @@ interface FindNextAnchor {
|
|
|
137
137
|
bottom: number,
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
interface TemplateItem {
|
|
140
|
+
export interface TemplateItem {
|
|
141
141
|
id: number,
|
|
142
142
|
index: number,
|
|
143
143
|
left: number,
|
|
@@ -165,7 +165,7 @@ interface TemplateItem {
|
|
|
165
165
|
uid?: string,
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
interface MeasureInfo {
|
|
168
|
+
export interface MeasureInfo {
|
|
169
169
|
left?: number,
|
|
170
170
|
top?: number,
|
|
171
171
|
width: number,
|
|
@@ -291,12 +291,12 @@ abstract class MetroTemplate {
|
|
|
291
291
|
if (this.direction == VERTICAL) {
|
|
292
292
|
return {
|
|
293
293
|
width: this.lineMax,
|
|
294
|
-
height: lastItem.height + lastItem.top - 1,
|
|
294
|
+
height: lastItem.height + lastItem.top - 1 + 1,
|
|
295
295
|
}
|
|
296
296
|
} else {
|
|
297
297
|
return {
|
|
298
298
|
height: this.lineMax,
|
|
299
|
-
width: lastItem.width + lastItem.left - 1,
|
|
299
|
+
width: lastItem.width + lastItem.left - 1 + 1,
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
} else {
|
|
@@ -386,7 +386,5 @@ abstract class MetroTemplate {
|
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
export {
|
|
389
|
-
MeasureInfo,
|
|
390
389
|
MetroTemplate,
|
|
391
|
-
TemplateItem,
|
|
392
390
|
}
|
|
@@ -2,10 +2,18 @@ export const getHtmlStr = (libPath, latexStr, fontSize, width, height, color) =>
|
|
|
2
2
|
return (
|
|
3
3
|
`<html>
|
|
4
4
|
<head>
|
|
5
|
+
<style>
|
|
6
|
+
mjx-container[display="true"] {
|
|
7
|
+
margin: 0 0 !important;
|
|
8
|
+
}
|
|
9
|
+
body {
|
|
10
|
+
margin: 0 !important;
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
5
13
|
<script type="text/javascript">
|
|
6
14
|
MathJax = {
|
|
7
15
|
tex: {
|
|
8
|
-
inlineMath: [['$', '$'], ['
|
|
16
|
+
inlineMath: [['$', '$'], ['\\\\(', '\\\\)']]
|
|
9
17
|
},
|
|
10
18
|
svg: {
|
|
11
19
|
fontCache: 'global'
|
|
@@ -16,13 +24,15 @@ export const getHtmlStr = (libPath, latexStr, fontSize, width, height, color) =>
|
|
|
16
24
|
divElement.style.display = "inline-block";
|
|
17
25
|
divElement.style.fontSize = "${fontSize}px";
|
|
18
26
|
divElement.style.color = "${color}";
|
|
19
|
-
divElement.innerHTML = String.raw
|
|
27
|
+
divElement.innerHTML = String.raw\`${latexStr}\`;
|
|
28
|
+
//divElement.style.width = ${width} + "px";
|
|
20
29
|
document.body.appendChild(divElement);
|
|
21
30
|
|
|
22
31
|
MathJax.typesetPromise().then(() => {
|
|
23
32
|
// modify the DOM here
|
|
24
33
|
let formulaMetrics = MathJax.getMetricsFor(divElement, true);
|
|
25
|
-
let
|
|
34
|
+
let w = Math.min(${width}, divElement.clientWidth);
|
|
35
|
+
let scale = w / divElement.clientWidth;
|
|
26
36
|
divElement.style.fontSize = Math.floor(scale * ${fontSize}) + "px";
|
|
27
37
|
MathJax.typeset();
|
|
28
38
|
}).catch((err) => console.error(err.message));
|