@shijiu/jsview-vue 2.3.151-test.0 → 2.3.728-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/browser/BrowserJsvLatex.vue.mjs +9 -90
- package/bin/jsview-vue.mjs +5964 -1833
- package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +18 -2
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/Const.d.ts +4 -1
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +225 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +225 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetDebugger.d.ts +5 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +25 -2
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +7 -1
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +25 -5
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +2 -1
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/Utils.d.ts +2 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +1 -1
- package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue.d.ts +70 -0
- package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.d.ts +24 -0
- package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.d.ts +19 -0
- package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.d.ts +42 -0
- package/bin/types/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +3 -3
- package/bin/types/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +2 -1
- package/bin/types/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +12 -4
- package/bin/types/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +9 -7
- package/bin/types/utils/JsViewEngineWidget/WidgetCommon.d.ts +17 -7
- package/bin/types/utils/JsViewEngineWidget/index.d.ts +3 -1
- package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +0 -1
- package/bin/types/utils/JsViewPlugin/JsvLatex/GetVersion.d.ts +14 -0
- package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +3 -0
- package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +1 -0
- package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +4 -1
- package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.mts +29 -2
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +107 -4
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +62 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +94 -18
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-wasm.vue.d.ts +611 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue.d.ts → JsvPlayerBrowser.vue.d.ts} +24 -23
- package/bin/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +77 -20
- package/bin/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +77 -20
- package/bin/types/utils/JsViewVueTools/BlobApi.d.ts +38 -0
- package/bin/types/utils/JsViewVueTools/FeatureActive.d.ts +1 -0
- package/bin/types/utils/JsViewVueTools/JsvInteractionMode.d.ts +6 -0
- package/bin/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +10 -3
- package/bin/types/utils/JsViewVueTools/JsvTextTools.d.ts +1 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.d.ts +43 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +1 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.d.ts +54 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +13 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +2 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +76 -26
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.d.ts +49 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/index.d.ts +2 -0
- package/bin/types/utils/JsViewVueTools/index.d.ts +3 -1
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +12 -22
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +12 -22
- package/bin/types/utils/JsViewVueWidget/JsvDomRenderer/JsViewHtmlToVNodesOptions.d.ts +101 -0
- package/bin/types/utils/JsViewVueWidget/JsvDomRenderer/JsvDomRenderer.d.ts +61 -0
- package/bin/types/utils/JsViewVueWidget/JsvDomRenderer/htmlToVNodes.d.ts +58 -0
- package/bin/types/utils/JsViewVueWidget/JsvDomRenderer/index.d.ts +1 -0
- package/bin/types/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +1 -0
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +151 -18
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.d.ts +2 -1
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/CmdTypes.d.ts +16 -0
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.d.ts +2 -1
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +3 -1
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +55 -12
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +178 -35
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +119 -17
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +9 -3
- package/bin/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +4 -1
- package/bin/types/utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +22 -1
- package/bin/types/utils/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +1 -1
- package/bin/types/utils/JsViewVueWidget/JsvPieChart.vue.d.ts +2 -0
- package/bin/types/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +5 -2
- package/bin/types/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +1 -1
- package/bin/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +39 -1
- package/bin/types/utils/JsViewVueWidget/JsvSector.vue.d.ts +1 -0
- package/bin/types/utils/JsViewVueWidget/JsvTextBox.vue.d.ts +15 -3
- package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +22 -96
- package/bin/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +6 -0
- package/bin/types/utils/JsViewVueWidget/{JsvPosterDiv.vue.d.ts → TypesDiv/JsvPosterDiv.vue.d.ts} +9 -0
- package/bin/types/utils/JsViewVueWidget/{JsvPosterImage.vue.d.ts → TypesDiv/JsvPosterImage.vue.d.ts} +15 -3
- package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue.d.ts +72 -0
- package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue.d.ts +90 -0
- package/bin/types/utils/JsViewVueWidget/index.d.ts +6 -3
- package/dist/types/utils/JsViewEngineWidget/CheckType.d.ts +7 -0
- package/dist/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +106 -0
- package/dist/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +128 -0
- package/dist/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +25 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/Const.d.ts +23 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/DebugFrame.vue.d.ts +12 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/DebugTools.d.ts +9 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/Dispatcher.d.ts +16 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +412 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +751 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetDebugger.d.ts +9 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +82 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +31 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +80 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/Slide.d.ts +25 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +52 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +69 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/TokenGenerator.d.ts +4 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/Utils.d.ts +6 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/VisibleInfo.d.ts +20 -0
- package/dist/types/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +21 -0
- package/dist/types/utils/JsViewEngineWidget/RangeModel.d.ts +166 -0
- package/dist/types/utils/JsViewEngineWidget/RectUtils.d.ts +61 -0
- package/dist/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue.d.ts +74 -0
- package/dist/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.d.ts +28 -0
- package/dist/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.d.ts +23 -0
- package/dist/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.d.ts +46 -0
- package/dist/types/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +42 -0
- package/dist/types/utils/JsViewEngineWidget/TemplateParser/Fence.d.ts +62 -0
- package/dist/types/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +21 -0
- package/dist/types/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +103 -0
- package/dist/types/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +28 -0
- package/dist/types/utils/JsViewEngineWidget/TemplateParser/index.d.ts +8 -0
- package/dist/types/utils/JsViewEngineWidget/WidgetCommon.d.ts +160 -0
- package/dist/types/utils/JsViewEngineWidget/index.d.ts +21 -0
- package/dist/types/utils/JsViewPlugin/JsvAccount/JsvAccount.d.ts +46 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/AudioProxy.d.ts +6 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +22 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +212 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/CheckType.d.ts +6 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/Events.d.ts +17 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +22 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.d.ts +12 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +6 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/PluginLoader.d.ts +5 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/ScreenLockManager.d.ts +9 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/index.d.ts +7 -0
- package/dist/types/utils/JsViewPlugin/JsvAudio/version.d.mts +14 -0
- package/{bin/types/utils/JsViewPlugin/JsvLatex → dist/types/utils/JsViewPlugin/JsvAudio}/version.d.ts +5 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +0 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +17 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/Color.d.ts +5 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/GetVersion.d.ts +18 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +46 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +8 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +9 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/PluginLoader.d.ts +5 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/index.d.ts +8 -0
- package/dist/types/utils/JsViewPlugin/JsvLatex/version.d.mts +40 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/AckEventDefine.d.ts +10 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/GetVersion.d.ts +13 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +523 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +119 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +664 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-0.9.vue.d.ts +45 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-wasm.vue.d.ts +611 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue.d.ts +597 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +415 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +415 -0
- package/dist/types/utils/JsViewPlugin/JsvPlayer/version.d.mts +14 -0
- package/dist/types/utils/JsViewPlugin/index.d.ts +7 -0
- package/dist/types/utils/JsViewVueTools/BlobApi.d.ts +42 -0
- package/dist/types/utils/JsViewVueTools/ConstSymbol.d.ts +6 -0
- package/dist/types/utils/JsViewVueTools/DebugContentShellJBridge.d.ts +10 -0
- package/dist/types/utils/JsViewVueTools/DebugTool.d.ts +12 -0
- package/dist/types/utils/JsViewVueTools/DefaultKeyMap.d.ts +14 -0
- package/dist/types/utils/JsViewVueTools/FeatureActive.d.ts +15 -0
- package/dist/types/utils/JsViewVueTools/ForgeConstDefine.d.ts +15 -0
- package/dist/types/utils/JsViewVueTools/ForgeHandles.d.ts +11 -0
- package/dist/types/utils/JsViewVueTools/JsvDynamicCssStyle.d.ts +33 -0
- package/dist/types/utils/JsViewVueTools/JsvDynamicKeyFrames.d.ts +40 -0
- package/dist/types/utils/JsViewVueTools/JsvFederationTools.d.ts +20 -0
- package/dist/types/utils/JsViewVueTools/JsvHashHistory.d.ts +20 -0
- package/dist/types/utils/JsViewVueTools/JsvImpactTracer.d.ts +44 -0
- package/dist/types/utils/JsViewVueTools/JsvInteractionMode.d.ts +10 -0
- package/dist/types/utils/JsViewVueTools/JsvPerformance.d.ts +9 -0
- package/dist/types/utils/JsViewVueTools/JsvPreDownloader.d.ts +55 -0
- package/dist/types/utils/JsViewVueTools/JsvRefTaker.d.ts +52 -0
- package/dist/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +378 -0
- package/dist/types/utils/JsViewVueTools/JsvStyleClass.d.ts +35 -0
- package/dist/types/utils/JsViewVueTools/JsvStyleSheetsDeclarer.d.ts +35 -0
- package/dist/types/utils/JsViewVueTools/JsvTextTools.d.ts +66 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureDefines.d.ts +10 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureLoadTool.d.ts +67 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.d.ts +47 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +99 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +20 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.d.ts +58 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +113 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +17 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +170 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/Store.d.ts +16 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/Texture.d.ts +31 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.d.ts +53 -0
- package/dist/types/utils/JsViewVueTools/JsvTextureStore/index.d.ts +6 -0
- package/dist/types/utils/JsViewVueTools/NinePatchHelper.d.ts +25 -0
- package/dist/types/utils/JsViewVueTools/TextureManagerTools.d.ts +11 -0
- package/dist/types/utils/JsViewVueTools/TypeCheckAndSet.d.ts +7 -0
- package/dist/types/utils/JsViewVueTools/index.d.ts +29 -0
- package/dist/types/utils/JsViewVueWidget/Jsv3dDiv.vue.d.ts +124 -0
- package/dist/types/utils/JsViewVueWidget/Jsv3dStage.vue.d.ts +148 -0
- package/dist/types/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.d.ts +35 -0
- package/dist/types/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +102 -0
- package/dist/types/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.d.ts +37 -0
- package/dist/types/utils/JsViewVueWidget/JsvActorMove/index.d.ts +8 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +15 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +77 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +54 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +13 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +44 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +17 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +13 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +3 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/GifData.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +7 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +12 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.d.ts +20 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/WebpData.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts +26 -0
- package/dist/types/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +74 -0
- package/dist/types/utils/JsViewVueWidget/JsvClipDiv/index.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvConnectLine/ArcLineManager.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +34 -0
- package/dist/types/utils/JsViewVueWidget/JsvConnectLine/index.d.ts +6 -0
- package/dist/types/utils/JsViewVueWidget/JsvDashPath.vue.d.ts +33 -0
- package/dist/types/utils/JsViewVueWidget/JsvDomRenderer/JsViewHtmlToVNodesOptions.d.ts +105 -0
- package/dist/types/utils/JsViewVueWidget/JsvDomRenderer/JsvDomRenderer.d.ts +65 -0
- package/dist/types/utils/JsViewVueWidget/JsvDomRenderer/htmlToVNodes.d.ts +62 -0
- package/dist/types/utils/JsViewVueWidget/JsvDomRenderer/index.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +109 -0
- package/dist/types/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +108 -0
- package/dist/types/utils/JsViewVueWidget/JsvDriftScope/index.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +61 -0
- package/dist/types/utils/JsViewVueWidget/JsvFilterView.vue.d.ts +91 -0
- package/dist/types/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +106 -0
- package/dist/types/utils/JsViewVueWidget/JsvFlexCell/JsvFullScrAdjust.vue.d.ts +100 -0
- package/dist/types/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +108 -0
- package/dist/types/utils/JsViewVueWidget/JsvFlexCell/index.d.ts +7 -0
- package/dist/types/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +63 -0
- package/dist/types/utils/JsViewVueWidget/JsvFragShaderView/index.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActionRefObject.d.ts +4 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +228 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorState.d.ts +6 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.d.ts +16 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/CmdTypes.d.ts +16 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.d.ts +20 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +106 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvFreeMoveActor.vue.d.ts +107 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/KeepFlags.d.ts +11 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +12 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +118 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +244 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +169 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.d.ts +22 -0
- package/dist/types/utils/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +24 -0
- package/dist/types/utils/JsViewVueWidget/JsvGrid.vue.d.ts +241 -0
- package/dist/types/utils/JsViewVueWidget/JsvHole.d.ts +19 -0
- package/dist/types/utils/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +16 -0
- package/dist/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +52 -0
- package/dist/types/utils/JsViewVueWidget/JsvInput/EditVisibleArea.d.ts +30 -0
- package/dist/types/utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +98 -0
- package/dist/types/utils/JsViewVueWidget/JsvInput/SharedDefine.d.ts +17 -0
- package/dist/types/utils/JsViewVueWidget/JsvInput/SystemTextTools.d.ts +20 -0
- package/dist/types/utils/JsViewVueWidget/JsvInput/index.d.ts +8 -0
- package/dist/types/utils/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +32 -0
- package/dist/types/utils/JsViewVueWidget/JsvLine/LineManager.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvLine/index.d.ts +6 -0
- package/dist/types/utils/JsViewVueWidget/JsvMarquee.vue.d.ts +33 -0
- package/dist/types/utils/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +101 -0
- package/dist/types/utils/JsViewVueWidget/JsvMindMap/CommonType.d.ts +1 -0
- package/dist/types/utils/JsViewVueWidget/JsvMindMap/Constant.d.ts +13 -0
- package/dist/types/utils/JsViewVueWidget/JsvMindMap/DataTree.d.ts +75 -0
- package/dist/types/utils/JsViewVueWidget/JsvMindMap/Geometry.d.ts +72 -0
- package/dist/types/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +235 -0
- package/dist/types/utils/JsViewVueWidget/JsvMindMap/index.d.ts +5 -0
- package/dist/types/utils/JsViewVueWidget/JsvMindMap/rtree.d.ts +44 -0
- package/dist/types/utils/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +93 -0
- package/dist/types/utils/JsViewVueWidget/JsvNinePatch.vue.d.ts +55 -0
- package/dist/types/utils/JsViewVueWidget/JsvPieChart.vue.d.ts +30 -0
- package/dist/types/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +68 -0
- package/dist/types/utils/JsViewVueWidget/JsvPreload/index.d.ts +6 -0
- package/dist/types/utils/JsViewVueWidget/JsvProgressBar.vue.d.ts +31 -0
- package/dist/types/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +85 -0
- package/dist/types/utils/JsViewVueWidget/JsvRadarChart.vue.d.ts +37 -0
- package/dist/types/utils/JsViewVueWidget/JsvRipple/Constant.d.ts +8 -0
- package/dist/types/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +129 -0
- package/dist/types/utils/JsViewVueWidget/JsvRipple/index.d.ts +7 -0
- package/dist/types/utils/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +28 -0
- package/dist/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +278 -0
- package/dist/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +157 -0
- package/dist/types/utils/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.d.ts +8 -0
- package/dist/types/utils/JsViewVueWidget/JsvScrollBox/ScrollSymbol.d.ts +16 -0
- package/dist/types/utils/JsViewVueWidget/JsvScrollBox/index.d.ts +7 -0
- package/dist/types/utils/JsViewVueWidget/JsvSector.vue.d.ts +30 -0
- package/dist/types/utils/JsViewVueWidget/JsvSmoothSlideContainer.vue.d.ts +76 -0
- package/dist/types/utils/JsViewVueWidget/JsvSoundPool.d.ts +114 -0
- package/dist/types/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +58 -0
- package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.d.ts +18 -0
- package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +70 -0
- package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +85 -0
- package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteTools.d.ts +15 -0
- package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/SpriteController.d.ts +21 -0
- package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/index.d.ts +9 -0
- package/dist/types/utils/JsViewVueWidget/JsvSpriteAnim/sAnimationToken.d.ts +6 -0
- package/dist/types/utils/JsViewVueWidget/JsvSwiper/Indicator.vue.d.ts +16 -0
- package/dist/types/utils/JsViewVueWidget/JsvSwiper/JsvSmoothSwiper.vue.d.ts +141 -0
- package/dist/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +248 -0
- package/dist/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper2.vue.d.ts +181 -0
- package/dist/types/utils/JsViewVueWidget/JsvSwiper/index.d.ts +8 -0
- package/dist/types/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue.d.ts +16 -0
- package/dist/types/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +121 -0
- package/dist/types/utils/JsViewVueWidget/JsvSwiper3D/index.d.ts +6 -0
- package/dist/types/utils/JsViewVueWidget/JsvTextBox.vue.d.ts +121 -0
- package/dist/types/utils/JsViewVueWidget/JsvTextureAnim/CommonType.d.ts +6 -0
- package/dist/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +38 -0
- package/dist/types/utils/JsViewVueWidget/JsvTextureAnim/index.d.ts +8 -0
- package/dist/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +109 -0
- package/dist/types/utils/JsViewVueWidget/JsvVideo.vue.d.ts +23 -0
- package/dist/types/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +109 -0
- package/dist/types/utils/JsViewVueWidget/JsvVisibleSensor/index.d.ts +88 -0
- package/dist/types/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue.d.ts +94 -0
- package/dist/types/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue.d.ts +115 -0
- package/dist/types/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue.d.ts +94 -0
- package/dist/types/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue.d.ts +115 -0
- package/dist/types/utils/JsViewVueWidget/index.d.ts +53 -0
- package/dist/types/utils/index.d.ts +8 -0
- package/dist/utils/browser/BrowserAudio.vue.mjs +258 -0
- package/dist/utils/browser/BrowserJsvLatex.vue.mjs +64 -0
- package/dist/utils/export-sfc.mjs +12 -0
- package/dist/utils/index.mjs +29000 -0
- package/dist/utils/jsview-vue-common.mjs +39 -0
- package/package.json +1 -1
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +32 -16
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.ts +24 -2
- package/utils/JsViewEngineWidget/MetroWidget/Const.ts +5 -0
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +193 -89
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +325 -155
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetDebugger.ts +15 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +1035 -370
- package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.ts +41 -23
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +138 -41
- package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +1 -0
- package/utils/JsViewEngineWidget/MetroWidget/Utils.ts +6 -0
- package/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.ts +2 -1
- package/utils/JsViewEngineWidget/RectUtils.js +1 -1
- package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue +62 -0
- package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.ts +260 -0
- package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.ts +32 -0
- package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.ts +236 -0
- package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +329 -230
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +101 -27
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +54 -5
- package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +109 -41
- package/utils/JsViewEngineWidget/WidgetCommon.ts +17 -7
- package/utils/JsViewEngineWidget/index.ts +7 -2
- package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +46 -46
- package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +54 -41
- package/utils/JsViewPlugin/JsvLatex/Color.ts +104 -39
- package/utils/JsViewPlugin/JsvLatex/GetVersion.js +65 -0
- package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +71 -17
- package/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.js +10 -0
- package/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue +14 -2
- package/utils/JsViewPlugin/JsvLatex/PluginLoader.js +63 -31
- package/utils/JsViewPlugin/JsvLatex/version.mjs +26 -13
- package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +2 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +402 -23
- package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +100 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +363 -468
- package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue → JsvPlayerBrowser-wasm.vue} +60 -10
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +511 -0
- package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +52 -10
- package/utils/JsViewPlugin/JsvPlayer/index.js +58 -9
- package/utils/JsViewPlugin/JsvPlayer/package.json +8 -0
- package/utils/JsViewVueTools/BlobApi.ts +55 -0
- package/utils/JsViewVueTools/FeatureActive.ts +3 -0
- package/utils/JsViewVueTools/ForgeHandles.ts +3 -0
- package/utils/JsViewVueTools/JsvInteractionMode.js +16 -0
- package/utils/JsViewVueTools/JsvPreDownloader.ts +2 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +40 -19
- package/utils/JsViewVueTools/JsvTextTools.ts +9 -1
- package/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.ts +180 -0
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +1 -0
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.ts +304 -0
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.ts +38 -0
- package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +16 -1
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +154 -69
- package/utils/JsViewVueTools/JsvTextureStore/Store.ts +1 -1
- package/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.ts +92 -0
- package/utils/JsViewVueTools/JsvTextureStore/index.js +2 -0
- package/utils/JsViewVueTools/index.js +3 -1
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +111 -86
- package/utils/JsViewVueWidget/JsvDomRenderer/JsViewHtmlToVNodesOptions.ts +212 -0
- package/utils/JsViewVueWidget/JsvDomRenderer/JsvDomRenderer.ts +146 -0
- package/utils/JsViewVueWidget/JsvDomRenderer/htmlToVNodes.ts +748 -0
- package/utils/JsViewVueWidget/JsvDomRenderer/index.ts +1 -0
- package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +10 -1
- package/utils/JsViewVueWidget/JsvEnableRenderBreak.vue +6 -0
- package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +11 -5
- package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +3 -1
- package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +23 -11
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +269 -26
- package/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.ts +2 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/CmdTypes.ts +24 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.ts +3 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/{FreeMoveActor.vue → JsvFreeMoveActor.vue} +5 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.ts +10 -2
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +223 -100
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +245 -64
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +95 -29
- package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +27 -5
- package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +11 -2
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +29 -2
- package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +24 -7
- package/utils/JsViewVueWidget/JsvMarquee.vue +1 -1
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +12 -10
- package/utils/JsViewVueWidget/JsvNinePatch.vue +22 -12
- package/utils/JsViewVueWidget/JsvPieChart.vue +93 -70
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +32 -29
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +2 -1
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +56 -25
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +11 -11
- package/utils/JsViewVueWidget/JsvSector.vue +66 -28
- package/utils/JsViewVueWidget/JsvTextBox.vue +30 -1
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +315 -305
- package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +56 -14
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +8 -6
- package/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue +54 -0
- package/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue +88 -0
- package/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue +177 -0
- package/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue +267 -0
- package/utils/JsViewVueWidget/index.js +7 -2
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.d.ts +0 -7
- package/utils/JsViewPlugin/JsvLatex/version.js +0 -24
- package/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.ts +0 -36
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +0 -56
- package/utils/JsViewVueWidget/JsvPosterImage.vue +0 -105
- /package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue.d.ts → JsvPlayerBrowser-0.9.vue.d.ts} +0 -0
- /package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/{FreeMoveActor.vue.d.ts → JsvFreeMoveActor.vue.d.ts} +0 -0
- /package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue → JsvPlayerBrowser-0.9.vue} +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { JsvTextureStoreApi } from "./JsvTextureStore";
|
|
2
|
+
import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CircleNinePatchTextureOptions
|
|
6
|
+
* 生成圆角九宫格纹理时的输入参数
|
|
7
|
+
*
|
|
8
|
+
* @property {number} targetCornerRadius 目标圆角半径
|
|
9
|
+
* @property {number} circleLineWidth 圆环描边宽度
|
|
10
|
+
* @property {string} [bgColor] 画布背景色,默认值: rgba(255,255,255,0)
|
|
11
|
+
* @property {string} [circleColor] 圆环描边颜色,默认值: #000000FF
|
|
12
|
+
* @property {number} [displayScale] 显示缩放比例,提高此值一提高清晰度,
|
|
13
|
+
* 默认值: jsview.config.js的designMap.displayScale
|
|
14
|
+
*/
|
|
15
|
+
type CircleNinePatchTextureOptions = {
|
|
16
|
+
cornerRadius: number;
|
|
17
|
+
circleLineWidth: number;
|
|
18
|
+
bgColor?: string;
|
|
19
|
+
circleColor?: string;
|
|
20
|
+
displayScale?: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* NinePatchTextureResult
|
|
25
|
+
* 圆角九宫格纹理构建结果
|
|
26
|
+
*
|
|
27
|
+
* @property {number} BorderOutset 九宫格外边距(像素)
|
|
28
|
+
* @property {number} ImageWidth 纹理图片宽度(像素)
|
|
29
|
+
* @property {number} CenterWidth 九宫格中心区域宽度(像素)
|
|
30
|
+
* @property {string} textureUrl 可用于背景图/图片src的纹理访问地址
|
|
31
|
+
*/
|
|
32
|
+
type NinePatchTextureResult = {
|
|
33
|
+
BorderOutset: number;
|
|
34
|
+
ImageWidth: number;
|
|
35
|
+
ImageDspWidth: number;
|
|
36
|
+
CenterWidth: number;
|
|
37
|
+
texAccessName: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* buildCircleNinePatchTexture
|
|
42
|
+
* 生成用于 JsvNinePatch 的圆角九宫格纹理,
|
|
43
|
+
* 并返回可用于样式访问的texture URL与JsvNinePatch的参数
|
|
44
|
+
*
|
|
45
|
+
* 特别注意!!: texAccessName 需要在不使用时使用 JsvTextureStoreApi.deleteTexture 释放资源
|
|
46
|
+
*
|
|
47
|
+
* @param {CircleNinePatchTextureOptions} options 生成圆角九宫格纹理的参数
|
|
48
|
+
* @return {NinePatchTextureResult}
|
|
49
|
+
*/
|
|
50
|
+
function buildCircleNinePatchTexture(
|
|
51
|
+
options: CircleNinePatchTextureOptions
|
|
52
|
+
): NinePatchTextureResult {
|
|
53
|
+
const {
|
|
54
|
+
cornerRadius,
|
|
55
|
+
circleLineWidth,
|
|
56
|
+
bgColor = "rgba(255,255,255,0)", // 默认为透明白色底色
|
|
57
|
+
circleColor = "#000000FF", // 默认为黑色
|
|
58
|
+
displayScale = ForgeHandles.sRenderBridge.GetScreenInfo().scaleRatio,
|
|
59
|
+
} = options;
|
|
60
|
+
const innerRadius2 = Math.floor(cornerRadius * 2 * displayScale);
|
|
61
|
+
const innerLineWidth = Math.floor(circleLineWidth * displayScale);
|
|
62
|
+
const borderOutset = innerLineWidth + 4; // 外延4像素, 因为Canvas绘制外边缘有至少2px的过渡色以提升抗锯齿效果
|
|
63
|
+
const imageWidth = innerRadius2 + borderOutset * 2;
|
|
64
|
+
const centerWidth = 1;
|
|
65
|
+
|
|
66
|
+
const canvasRef = JsvTextureStoreApi.canvasTexture(imageWidth, imageWidth);
|
|
67
|
+
const circleRadius =
|
|
68
|
+
Math.floor(innerRadius2 / 2) + Math.floor(innerLineWidth / 2);
|
|
69
|
+
const circlePath = canvasRef.circlePath(
|
|
70
|
+
Math.floor(imageWidth / 2),
|
|
71
|
+
Math.floor(imageWidth / 2),
|
|
72
|
+
circleRadius
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
canvasRef.drawColor(bgColor);
|
|
76
|
+
circlePath?.stroke(innerLineWidth, circleColor);
|
|
77
|
+
|
|
78
|
+
const sourceId = String(canvasRef.commit());
|
|
79
|
+
return {
|
|
80
|
+
BorderOutset: borderOutset,
|
|
81
|
+
ImageWidth: imageWidth,
|
|
82
|
+
ImageDspWidth: Math.floor(imageWidth / displayScale),
|
|
83
|
+
CenterWidth: centerWidth,
|
|
84
|
+
texAccessName: sourceId,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const TextureBuilder = {
|
|
89
|
+
buildCircleNinePatchTexture,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export default TextureBuilder;
|
|
@@ -20,7 +20,7 @@ export * from "./JsvTextTools";
|
|
|
20
20
|
export * from "./JsvPreDownloader"
|
|
21
21
|
export { default as DefaultKeyCodeMap } from "./DefaultKeyMap";
|
|
22
22
|
export * from "./JsvPerformance"
|
|
23
|
-
export * from "./JsvTextureStore
|
|
23
|
+
export * from "./JsvTextureStore"
|
|
24
24
|
export * from "./JsvTextureDefines"
|
|
25
25
|
export * from "./JsvFederationTools"
|
|
26
26
|
export * from "./ConstSymbol"
|
|
@@ -28,3 +28,5 @@ export * from "./ForgeConstDefine"
|
|
|
28
28
|
export * from "./TextureManagerTools"
|
|
29
29
|
export * from "./FeatureActive"
|
|
30
30
|
export * from "./JsvTextureLoadTool"
|
|
31
|
+
export * from "./JsvInteractionMode"
|
|
32
|
+
export {default as BlobApi} from "./BlobApi"
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* prop说明:
|
|
15
15
|
* src {string} 对应img标签的src, 传url时需要注意使用url([链接])
|
|
16
16
|
* style {object} 对应img标签的style
|
|
17
|
+
* onStart 开始播放回调
|
|
18
|
+
* onEnd 结束播放回调
|
|
19
|
+
* onLoad 加载完成回调
|
|
17
20
|
* 通过ref=拿到句柄后,可调用的方法:
|
|
18
21
|
* stop(): 停止播放
|
|
19
22
|
* show(): 显示某一帧
|
|
@@ -29,9 +32,10 @@
|
|
|
29
32
|
* 播放结束后的状态: ApicEndState.HIDE 隐藏
|
|
30
33
|
* ApicEndState.LAST_FRAME 保持最后一帧
|
|
31
34
|
-->
|
|
32
|
-
<script>
|
|
35
|
+
<script setup>
|
|
36
|
+
import { ref, onMounted, onBeforeUnmount } from "vue";
|
|
33
37
|
import ForgeHandles from "../../../JsViewVueTools/ForgeHandles";
|
|
34
|
-
|
|
38
|
+
import { ApicEndState } from "../JsvCommonLoopToolBase";
|
|
35
39
|
|
|
36
40
|
//为了打包后少加载一个文件这里单独定义
|
|
37
41
|
const LoopType = {
|
|
@@ -42,99 +46,120 @@ const LoopType = {
|
|
|
42
46
|
LOOP_SINGLE: 4,
|
|
43
47
|
};
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onEnd: Function,
|
|
51
|
-
onLoad: Function,
|
|
49
|
+
const props = defineProps({
|
|
50
|
+
src: String,
|
|
51
|
+
style: Object,
|
|
52
|
+
onStart: {
|
|
53
|
+
type: Function,
|
|
52
54
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
element: {},
|
|
56
|
-
};
|
|
55
|
+
onEnd: {
|
|
56
|
+
type: Function,
|
|
57
57
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onStartId: -1,
|
|
61
|
-
onEndId: -1,
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
methods: {
|
|
65
|
-
show(frameIndex = 0) {
|
|
66
|
-
if (!isNaN(frameIndex)) {
|
|
67
|
-
this.play(LoopType.LOOP_SINGLE, [[0, frameIndex, 0]]);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
play(loopType, loopInfo, endState) {
|
|
71
|
-
let params = {
|
|
72
|
-
LT: loopType,
|
|
73
|
-
ES: endState,
|
|
74
|
-
};
|
|
75
|
-
if (loopInfo instanceof Array) {
|
|
76
|
-
//[[循环次数1,循环开始帧1,循环结束帧1], [循环次数2,循环开始帧2,循环结束帧2], ...]
|
|
77
|
-
params.LI = loopInfo;
|
|
78
|
-
} else if (!isNaN(loopInfo)) {
|
|
79
|
-
params.LI = [[loopInfo, 0, 0]];
|
|
80
|
-
} else {
|
|
81
|
-
params.LI = [[0, 0, 0]];
|
|
82
|
-
}
|
|
83
|
-
if (this.$refs.element) {
|
|
84
|
-
let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
|
|
85
|
-
ForgeHandles.TextureManager
|
|
86
|
-
);
|
|
58
|
+
onLoad: Function,
|
|
59
|
+
});
|
|
87
60
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
61
|
+
const element = ref(null);
|
|
62
|
+
const onStartId = ref(-1);
|
|
63
|
+
const onEndId = ref(-1);
|
|
64
|
+
|
|
65
|
+
const show = (frameIndex = 0) => {
|
|
66
|
+
if (element.value) {
|
|
67
|
+
let mainViewTexture = element.value.jsvGetProxyTexture(
|
|
68
|
+
ForgeHandles.TextureManager
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
mainViewTexture.DispatchCommand(
|
|
72
|
+
Forge.NativeConstant.APIC_SHOW_FRAME,
|
|
73
|
+
JSON.stringify({
|
|
74
|
+
index: frameIndex,
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const play = (loopType, loopInfo, endState, onstart = null, onend = null) => {
|
|
81
|
+
let params = {
|
|
82
|
+
LT: loopType,
|
|
83
|
+
ES: endState,
|
|
84
|
+
};
|
|
85
|
+
if (loopInfo instanceof Array) {
|
|
86
|
+
//[[循环次数1,循环开始帧1,循环结束帧1], [循环次数2,循环开始帧2,循环结束帧2], ...]
|
|
87
|
+
params.LI = loopInfo;
|
|
88
|
+
} else if (!isNaN(loopInfo)) {
|
|
89
|
+
params.LI = [[loopInfo, 0, 0]];
|
|
90
|
+
} else {
|
|
91
|
+
params.LI = [[0, 0, 0]];
|
|
92
|
+
}
|
|
93
|
+
if (element.value) {
|
|
94
|
+
let mainViewTexture = element.value.jsvGetProxyTexture(
|
|
95
|
+
ForgeHandles.TextureManager
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
mainViewTexture.DispatchCommand(
|
|
99
|
+
Forge.NativeConstant.APIC_PLAY,
|
|
100
|
+
JSON.stringify(params)
|
|
101
|
+
);
|
|
102
|
+
mainViewTexture.unregisterOnStart(onStartId.value);
|
|
103
|
+
onStartId.value = -1;
|
|
104
|
+
let onStart = onstart || props.onStart;
|
|
105
|
+
if (onStart) {
|
|
106
|
+
onStartId.value = mainViewTexture.registerOnStart(onStart);
|
|
119
107
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (
|
|
124
|
-
|
|
108
|
+
mainViewTexture.unregisterOnEnd(onEndId.value);
|
|
109
|
+
onEndId.value = -1;
|
|
110
|
+
let onEnd = onend || props.onEnd;
|
|
111
|
+
if (onEnd) {
|
|
112
|
+
onEndId.value = mainViewTexture.registerOnEnd(onEnd);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const stop = (frameCount = -1) => {
|
|
118
|
+
if (element.value) {
|
|
119
|
+
let mainViewTexture = element.value.jsvGetProxyTexture(
|
|
120
|
+
ForgeHandles.TextureManager
|
|
121
|
+
);
|
|
122
|
+
mainViewTexture.DispatchCommand(
|
|
123
|
+
Forge.NativeConstant.APIC_STOP,
|
|
124
|
+
`{"TF":${frameCount}}`
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
onMounted(() => {
|
|
130
|
+
if (props.onLoad) {
|
|
131
|
+
if (element.value) {
|
|
132
|
+
let mainViewTexture = element.value.jsvGetProxyTexture(
|
|
125
133
|
ForgeHandles.TextureManager
|
|
126
134
|
);
|
|
135
|
+
mainViewTexture.RegisterLoadImageCallback(null, props.onLoad, null);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
127
139
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
140
|
+
onBeforeUnmount(() => {
|
|
141
|
+
stop(0);
|
|
142
|
+
if (element.value) {
|
|
143
|
+
let mainViewTexture = element.value.jsvGetProxyTexture(
|
|
144
|
+
ForgeHandles.TextureManager
|
|
145
|
+
);
|
|
131
146
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
147
|
+
if (onStartId.value >= 0) {
|
|
148
|
+
mainViewTexture.unregisterOnStart(onStartId.value);
|
|
135
149
|
}
|
|
136
|
-
|
|
137
|
-
|
|
150
|
+
|
|
151
|
+
if (onEndId.value >= 0) {
|
|
152
|
+
mainViewTexture.unregisterOnEnd(onEndId.value);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// 暴露方法给外部使用
|
|
158
|
+
defineExpose({
|
|
159
|
+
show,
|
|
160
|
+
play,
|
|
161
|
+
stop,
|
|
162
|
+
});
|
|
138
163
|
</script>
|
|
139
164
|
|
|
140
165
|
<template>
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { h } from "vue";
|
|
2
|
+
import { JsvLatex, processLatexStr } from "../../JsViewPlugin/JsvLatex";
|
|
3
|
+
import { JsvFlexDiv } from "../JsvFlexCell";
|
|
4
|
+
import type {
|
|
5
|
+
HtmlToVNodesOptions,
|
|
6
|
+
TagHookContext,
|
|
7
|
+
StyleHookContext,
|
|
8
|
+
TextHookContext,
|
|
9
|
+
} from "./htmlToVNodes";
|
|
10
|
+
|
|
11
|
+
const FALLBACK_TAG = "div";
|
|
12
|
+
function sanitizeTableAttrs(attrs: Record<string, string>): Record<string, string> {
|
|
13
|
+
const next = { ...attrs };
|
|
14
|
+
delete next.style;
|
|
15
|
+
delete next.width;
|
|
16
|
+
return next;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function parseNumericOrRaw(value?: string): number | string | undefined {
|
|
20
|
+
const raw = value?.trim();
|
|
21
|
+
if (!raw) return undefined;
|
|
22
|
+
const n = Number(raw);
|
|
23
|
+
return Number.isFinite(n) ? n : raw;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function asVerticalFlexTag(extraStyle?: Record<string, unknown>) {
|
|
27
|
+
return {
|
|
28
|
+
component: JsvFlexDiv,
|
|
29
|
+
props: {
|
|
30
|
+
style: {
|
|
31
|
+
flexDirection: "column",
|
|
32
|
+
alignItems: "flex-start",
|
|
33
|
+
...(extraStyle ?? {}),
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function asHorizontalFlexTag(withDot = false) {
|
|
40
|
+
return {
|
|
41
|
+
component: JsvFlexDiv,
|
|
42
|
+
prependBullet: withDot,
|
|
43
|
+
props: {
|
|
44
|
+
style: {
|
|
45
|
+
flexDirection: "row",
|
|
46
|
+
alignItems: "flex-start",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function tableTagHandler(
|
|
53
|
+
ctx: TagHookContext,
|
|
54
|
+
columnWidthRef: { values: Array<number | string | undefined> }
|
|
55
|
+
) {
|
|
56
|
+
const tag = ctx.tag.toLowerCase();
|
|
57
|
+
if (tag === "table" || tag === "tbody" || tag === "thead" || tag === "tfoot") {
|
|
58
|
+
if (tag === "table") {
|
|
59
|
+
columnWidthRef.values = [];
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
component: JsvFlexDiv,
|
|
63
|
+
attrs: sanitizeTableAttrs(ctx.attrs),
|
|
64
|
+
props: {
|
|
65
|
+
style: {
|
|
66
|
+
flexDirection: "column",
|
|
67
|
+
alignItems: "stretch",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (tag === "tr") {
|
|
73
|
+
return {
|
|
74
|
+
component: JsvFlexDiv,
|
|
75
|
+
attrs: sanitizeTableAttrs(ctx.attrs),
|
|
76
|
+
props: {
|
|
77
|
+
style: {
|
|
78
|
+
flexDirection: "row",
|
|
79
|
+
alignItems: "flex-start",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (tag === "td" || tag === "th") {
|
|
85
|
+
const colIndex = ctx.parentTag === "tr" ? ctx.indexInParent : undefined;
|
|
86
|
+
const ownWidth = parseNumericOrRaw(ctx.attrs.width);
|
|
87
|
+
if (colIndex !== undefined && ownWidth !== undefined) {
|
|
88
|
+
columnWidthRef.values[colIndex] = ownWidth;
|
|
89
|
+
}
|
|
90
|
+
const width =
|
|
91
|
+
ownWidth ??
|
|
92
|
+
(colIndex !== undefined ? columnWidthRef.values[colIndex] : undefined);
|
|
93
|
+
return {
|
|
94
|
+
component: JsvFlexDiv,
|
|
95
|
+
attrs: sanitizeTableAttrs(ctx.attrs),
|
|
96
|
+
props: {
|
|
97
|
+
style: {
|
|
98
|
+
...(width !== undefined ? { width } : {}),
|
|
99
|
+
flexDirection: "column",
|
|
100
|
+
alignItems: "flex-start",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const TAG_HOOK_HANDLERS: Record<
|
|
108
|
+
string,
|
|
109
|
+
(ctx: TagHookContext) => {
|
|
110
|
+
text?: string;
|
|
111
|
+
tag?: string;
|
|
112
|
+
component?: any;
|
|
113
|
+
props?: Record<string, unknown>;
|
|
114
|
+
prependBullet?: boolean;
|
|
115
|
+
attrs?: Record<string, string>;
|
|
116
|
+
childrenText?: string;
|
|
117
|
+
drop?: boolean;
|
|
118
|
+
}
|
|
119
|
+
> = {
|
|
120
|
+
span: (ctx) => ({ text: ctx.childrenText }),
|
|
121
|
+
div: () => asVerticalFlexTag(),
|
|
122
|
+
p: () => asVerticalFlexTag(),
|
|
123
|
+
ul: () => asVerticalFlexTag(),
|
|
124
|
+
li: () => asHorizontalFlexTag(true),
|
|
125
|
+
button: () => asVerticalFlexTag(),
|
|
126
|
+
br: () => ({ tag: "br" }),
|
|
127
|
+
img: () => ({ tag: "img" }),
|
|
128
|
+
sup: (ctx) => ({ text: `^{${ctx.childrenText}}` }),
|
|
129
|
+
sub: (ctx) => ({ text: `_{${ctx.childrenText}}` }),
|
|
130
|
+
a: (ctx) => ({ text: ctx.childrenText }),
|
|
131
|
+
strong: (ctx) => ({ text: ctx.childrenText }),
|
|
132
|
+
ol: () => asVerticalFlexTag(),
|
|
133
|
+
em: (ctx) => ({ text: ctx.childrenText }),
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
function defaultUnsupportedStyle(property: string, value: string): boolean {
|
|
137
|
+
const p = property.trim().toLowerCase();
|
|
138
|
+
const v = value.trim().toLowerCase();
|
|
139
|
+
|
|
140
|
+
if (p === "display" && v === "flex") return true;
|
|
141
|
+
if (p === "justify-content") return true;
|
|
142
|
+
if (p === "align-items") return true;
|
|
143
|
+
if (p === "flex-wrap") return true;
|
|
144
|
+
if (p === "padding" || p.startsWith("padding-")) return true;
|
|
145
|
+
if (p === "transition" && v.includes("all")) return true;
|
|
146
|
+
if (p === "transform" && v.includes("scale(")) return true;
|
|
147
|
+
if (p === "font-weight" && /^[0-9]+$/.test(v)) return true;
|
|
148
|
+
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export class JsViewHtmlToVNodesOptions implements HtmlToVNodesOptions {
|
|
153
|
+
private columnWidthRef: { values: Array<number | string | undefined> } = { values: [] };
|
|
154
|
+
|
|
155
|
+
latex: NonNullable<HtmlToVNodesOptions["latex"]> = {
|
|
156
|
+
enabled: true,
|
|
157
|
+
width: 1000,
|
|
158
|
+
fontSize: 16,
|
|
159
|
+
lineSpace: 2,
|
|
160
|
+
color: "#000000",
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
onTag = (ctx: TagHookContext) => {
|
|
164
|
+
const before = { tag: ctx.tag, attrs: ctx.attrs };
|
|
165
|
+
console.log("[JsViewHtmlToVNodesOptions][onTag][before]", before);
|
|
166
|
+
|
|
167
|
+
const tag = ctx.tag.toLowerCase();
|
|
168
|
+
if (["table", "thead", "tbody", "tfoot", "tr", "td", "th"].includes(tag)) {
|
|
169
|
+
const after = tableTagHandler(ctx, this.columnWidthRef);
|
|
170
|
+
console.log("[JsViewHtmlToVNodesOptions][onTag][after]", after);
|
|
171
|
+
return after;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const tagHandler = TAG_HOOK_HANDLERS[tag];
|
|
175
|
+
if (tagHandler) {
|
|
176
|
+
const after = tagHandler(ctx);
|
|
177
|
+
console.log("[JsViewHtmlToVNodesOptions][onTag][after]", after);
|
|
178
|
+
return after;
|
|
179
|
+
} else {
|
|
180
|
+
const after = { drop: true };
|
|
181
|
+
console.log("[JsViewHtmlToVNodesOptions][onTag][unsupported-tag][drop]", {
|
|
182
|
+
tag: ctx.tag,
|
|
183
|
+
...after,
|
|
184
|
+
});
|
|
185
|
+
return after;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
onStyle = (ctx: StyleHookContext) => {
|
|
191
|
+
const before = { property: ctx.property, value: ctx.value, tag: ctx.tag };
|
|
192
|
+
console.log("[JsViewHtmlToVNodesOptions][onStyle][before]", before);
|
|
193
|
+
|
|
194
|
+
if (defaultUnsupportedStyle(ctx.property, ctx.value)) {
|
|
195
|
+
const after = { drop: true };
|
|
196
|
+
console.log("[JsViewHtmlToVNodesOptions][onStyle][after]", after);
|
|
197
|
+
return after;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
onText = (ctx: TextHookContext) => {
|
|
203
|
+
if (this.latex.enabled === false) {
|
|
204
|
+
return ctx.text;
|
|
205
|
+
}
|
|
206
|
+
return ctx.text
|
|
207
|
+
.replace(/ /g, "\\ ")
|
|
208
|
+
.replace(/\u00A0/g, "\\ ")
|
|
209
|
+
.replace(/ /g, "\\ ");
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @file
|
|
3
|
+
*
|
|
4
|
+
* 【界面概述】
|
|
5
|
+
* JsvDomRenderer 用于接收一段 HTML 字符串并直接渲染为 JsView 可显示的内容区域。
|
|
6
|
+
* 适合题目正文、解析文本、图文混排等场景。
|
|
7
|
+
*
|
|
8
|
+
* 【组件介绍】
|
|
9
|
+
* JsvDomRenderer:
|
|
10
|
+
* props:
|
|
11
|
+
* html {string} (必选)
|
|
12
|
+
* - 要渲染的 HTML 文本。
|
|
13
|
+
* - 示例: "<p>如图,抛物线 y=-x<sup>2</sup>+bx+c</p>"
|
|
14
|
+
*
|
|
15
|
+
* config {object} (可选)
|
|
16
|
+
* - 组件配置对象,当前仅支持如下字段:
|
|
17
|
+
* latexEnabled {boolean}
|
|
18
|
+
* - 是否启用 latex 渲染。
|
|
19
|
+
* - true: 公式/文本按 JsvLatex 渲染
|
|
20
|
+
* - false: 公式/文本按普通 div 渲染
|
|
21
|
+
* - 示例: { latexEnabled: true }
|
|
22
|
+
*
|
|
23
|
+
* style {object} (可选)
|
|
24
|
+
* - 渲染容器样式,会作用在组件根容器上。
|
|
25
|
+
* - 常用字段:
|
|
26
|
+
* width {number|string} 容器宽度
|
|
27
|
+
* height {number|string} 容器高度
|
|
28
|
+
* backgroundColor {string} 背景色
|
|
29
|
+
* fontSize {number|string} 字体大小
|
|
30
|
+
* color {string} 字体颜色
|
|
31
|
+
* - 示例:
|
|
32
|
+
* {
|
|
33
|
+
* width: 1280,
|
|
34
|
+
* height: 2000,
|
|
35
|
+
* backgroundColor: "#FFFFFF",
|
|
36
|
+
* fontSize: 18,
|
|
37
|
+
* color: "#000000"
|
|
38
|
+
* }
|
|
39
|
+
*/
|
|
40
|
+
import { defineComponent, h, type PropType } from "vue";
|
|
41
|
+
import { JsvFlexDiv } from "../JsvFlexCell";
|
|
42
|
+
import { htmlToVNodes } from "./htmlToVNodes";
|
|
43
|
+
import type { HtmlToVNodesOptions } from "./htmlToVNodes";
|
|
44
|
+
import { JsViewHtmlToVNodesOptions } from "./JsViewHtmlToVNodesOptions";
|
|
45
|
+
|
|
46
|
+
function normalizeLatexWidthFromStyle(
|
|
47
|
+
value: unknown
|
|
48
|
+
): NonNullable<HtmlToVNodesOptions["latex"]>["width"] | undefined {
|
|
49
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
if (typeof value === "string") {
|
|
53
|
+
const parsed = Number(value.replace(/px$/i, "").trim());
|
|
54
|
+
if (Number.isFinite(parsed)) {
|
|
55
|
+
return parsed;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function normalizeLatexFontSizeFromStyle(
|
|
62
|
+
value: unknown
|
|
63
|
+
): NonNullable<HtmlToVNodesOptions["latex"]>["fontSize"] | undefined {
|
|
64
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
if (typeof value === "string") {
|
|
68
|
+
const parsed = Number(value.replace(/px$/i, "").trim());
|
|
69
|
+
if (Number.isFinite(parsed)) {
|
|
70
|
+
return parsed;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default defineComponent({
|
|
77
|
+
name: "JsvDomRenderer",
|
|
78
|
+
props: {
|
|
79
|
+
html: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: true,
|
|
82
|
+
},
|
|
83
|
+
config: {
|
|
84
|
+
type: Object as PropType<
|
|
85
|
+
Partial<NonNullable<HtmlToVNodesOptions["latex"]>> & { latexEnabled?: boolean }
|
|
86
|
+
>,
|
|
87
|
+
default: undefined,
|
|
88
|
+
},
|
|
89
|
+
style: {
|
|
90
|
+
type: Object as PropType<Record<string, unknown>>,
|
|
91
|
+
default: undefined,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
setup(props) {
|
|
95
|
+
// JsView 下用 JsvFlexDiv 做纵向布局,避免文本节点和图片出现重叠。
|
|
96
|
+
const render = () => {
|
|
97
|
+
const setupStartAt = Date.now();
|
|
98
|
+
console.log("[JsvDomRenderer][setup][start]");
|
|
99
|
+
const jsViewHtmlOptions = new JsViewHtmlToVNodesOptions();
|
|
100
|
+
const styleWidth = normalizeLatexWidthFromStyle(props.style?.width);
|
|
101
|
+
const styleFontSize = normalizeLatexFontSizeFromStyle(props.style?.fontSize);
|
|
102
|
+
const styleColor = typeof props.style?.color === "string" ? props.style.color : undefined;
|
|
103
|
+
if (props.config) {
|
|
104
|
+
const { latexEnabled, ...restConfig } = props.config;
|
|
105
|
+
jsViewHtmlOptions.latex = {
|
|
106
|
+
...jsViewHtmlOptions.latex,
|
|
107
|
+
...restConfig,
|
|
108
|
+
...(latexEnabled !== undefined ? { enabled: latexEnabled } : {}),
|
|
109
|
+
...(restConfig.width === undefined && styleWidth !== undefined ? { width: styleWidth } : {}),
|
|
110
|
+
...(restConfig.fontSize === undefined && styleFontSize !== undefined
|
|
111
|
+
? { fontSize: styleFontSize }
|
|
112
|
+
: {}),
|
|
113
|
+
...(restConfig.color === undefined && styleColor !== undefined ? { color: styleColor } : {}),
|
|
114
|
+
};
|
|
115
|
+
} else if (styleWidth !== undefined || styleFontSize !== undefined || styleColor !== undefined) {
|
|
116
|
+
jsViewHtmlOptions.latex = {
|
|
117
|
+
...jsViewHtmlOptions.latex,
|
|
118
|
+
...(styleWidth !== undefined ? { width: styleWidth } : {}),
|
|
119
|
+
...(styleFontSize !== undefined ? { fontSize: styleFontSize } : {}),
|
|
120
|
+
...(styleColor !== undefined ? { color: styleColor } : {}),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const rawNodes = htmlToVNodes(props.html, jsViewHtmlOptions);
|
|
124
|
+
const normalizedNodes = rawNodes.map((node, idx) =>
|
|
125
|
+
typeof node === "string" ? h("div", { key: `txt-${idx}` }, node) : node
|
|
126
|
+
);
|
|
127
|
+
console.log("[JsvDomRenderer][setup][end][elapsedMs]", Date.now() - setupStartAt);
|
|
128
|
+
return h(
|
|
129
|
+
JsvFlexDiv,
|
|
130
|
+
{
|
|
131
|
+
class: "dom-json-renderer",
|
|
132
|
+
style: {
|
|
133
|
+
flexDirection: "column",
|
|
134
|
+
alignItems: "flex-start",
|
|
135
|
+
...(props.style ?? {}),
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
default: () => normalizedNodes,
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
return render;
|
|
145
|
+
},
|
|
146
|
+
});
|