@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
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { calculateCursorPosition, calculateCursorPositionCached, recycleCursorMeasureCache } from "./SystemTextTools";
|
|
2
|
+
import { FontStyleDefine, MAX_WIDTH } from "./SharedDefine";
|
|
3
|
+
|
|
4
|
+
export class EditVisibleArea {
|
|
5
|
+
private _AreaWidth: number;
|
|
6
|
+
private _AreaHeight: number;
|
|
7
|
+
private _IsRightAlign: boolean;
|
|
8
|
+
private _TextLeft: number = 0;
|
|
9
|
+
private _CursorWidth: number = 0;
|
|
10
|
+
private _FontStyle: FontStyleDefine;
|
|
11
|
+
|
|
12
|
+
private _TextVisibleStartPos: number = 0; // 显示区域的起点是整段文字第几个像素上
|
|
13
|
+
private _TextVisibleEndPos: number = 0; // 显示区域的末尾是整段文字第几个像素上
|
|
14
|
+
private _VisibleAreaCurPos: number = 0; // 光标在整段文字的第几个像素上
|
|
15
|
+
|
|
16
|
+
// 管理Cursor measure的cache
|
|
17
|
+
private _CursorMeasureCachedId: number = 0;
|
|
18
|
+
private _CursorMeasuredToken: number = 0;
|
|
19
|
+
|
|
20
|
+
constructor(area_width: number, area_height: number,
|
|
21
|
+
cursor_width: number,
|
|
22
|
+
font_style: FontStyleDefine,
|
|
23
|
+
is_right_align: boolean) {
|
|
24
|
+
|
|
25
|
+
this._CursorWidth = cursor_width;
|
|
26
|
+
this._FontStyle = font_style;
|
|
27
|
+
this._AreaWidth = area_width;
|
|
28
|
+
this._AreaHeight = area_height;
|
|
29
|
+
this._IsRightAlign = is_right_align;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getTextLeft(): number {
|
|
33
|
+
return this._TextLeft;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getCursorPosition(): number {
|
|
37
|
+
return this._VisibleAreaCurPos;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
releaseResource() {
|
|
41
|
+
if (this._CursorMeasureCachedId > 0) {
|
|
42
|
+
recycleCursorMeasureCache(this._CursorMeasureCachedId);
|
|
43
|
+
this._CursorMeasureCachedId = 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
calculateSlide(
|
|
48
|
+
pre_str: string, target_str: string,
|
|
49
|
+
pre_str_dsp_width: number, target_str_dsp_width: number, // 使用外部缓存,减少本地计算
|
|
50
|
+
cur_index: number, moved: boolean, text_info_token: number): number {
|
|
51
|
+
if (target_str.length === 0) {
|
|
52
|
+
// 当字符内容清空的场景
|
|
53
|
+
this._VisibleAreaCurPos = 0;
|
|
54
|
+
this._updateVisibleAreaPos(0, target_str_dsp_width);
|
|
55
|
+
return this._caculateTextLeft(target_str_dsp_width);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
let new_left = this._TextLeft;
|
|
59
|
+
let current_cursor_position = 0;
|
|
60
|
+
if (cur_index == target_str.length) {
|
|
61
|
+
// calculateCursorPosition 无法计算最后一个字的位置,所以在此支持返回文字的边缘
|
|
62
|
+
current_cursor_position = target_str_dsp_width;
|
|
63
|
+
} else {
|
|
64
|
+
// 使用 calculateCursorPosition 获得光标显示位置
|
|
65
|
+
if (this._CursorMeasuredToken == text_info_token && this._CursorMeasureCachedId > 0) {
|
|
66
|
+
current_cursor_position = calculateCursorPositionCached(
|
|
67
|
+
cur_index,
|
|
68
|
+
this._CursorMeasureCachedId
|
|
69
|
+
)
|
|
70
|
+
} else {
|
|
71
|
+
if (this._CursorMeasureCachedId > 0) {
|
|
72
|
+
recycleCursorMeasureCache(this._CursorMeasureCachedId);
|
|
73
|
+
this._CursorMeasureCachedId = 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let measure_result = calculateCursorPosition(
|
|
77
|
+
target_str,
|
|
78
|
+
cur_index,
|
|
79
|
+
target_str_dsp_width,
|
|
80
|
+
this._AreaHeight,
|
|
81
|
+
this._AreaHeight,
|
|
82
|
+
this._FontStyle
|
|
83
|
+
);
|
|
84
|
+
current_cursor_position = measure_result.x;
|
|
85
|
+
this._CursorMeasureCachedId = measure_result.cachedId; // 注意cached资源需要手动释放
|
|
86
|
+
this._CursorMeasuredToken = text_info_token; // 记录此token的数据已经有measure cache
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
let option_mode = "op_vis_normal"; // 可视区域内移动
|
|
90
|
+
// 计算模式
|
|
91
|
+
if (pre_str.length > target_str.length) {
|
|
92
|
+
option_mode = "op_del"; // 字符删除
|
|
93
|
+
} else if (pre_str.length < target_str.length) {
|
|
94
|
+
option_mode = "op_add"; // 字符追加
|
|
95
|
+
} else {
|
|
96
|
+
if (current_cursor_position < this._VisibleAreaCurPos) {
|
|
97
|
+
option_mode = "op_move_left"; // 边界左移动
|
|
98
|
+
} else if (current_cursor_position > this._VisibleAreaCurPos) {
|
|
99
|
+
option_mode = "op_move_right"; // 边界右移动
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// 根据用户动作,区分计算方法
|
|
104
|
+
switch (option_mode) {
|
|
105
|
+
case "op_del":
|
|
106
|
+
new_left = this._getLeftWithDelChar(
|
|
107
|
+
current_cursor_position,
|
|
108
|
+
target_str_dsp_width
|
|
109
|
+
);
|
|
110
|
+
break;
|
|
111
|
+
case "op_add":
|
|
112
|
+
new_left = this._getLeftWithAddChar(
|
|
113
|
+
current_cursor_position,
|
|
114
|
+
target_str_dsp_width
|
|
115
|
+
);
|
|
116
|
+
break;
|
|
117
|
+
case "op_move_left":
|
|
118
|
+
new_left = this._getLeftWithMoveLeft(
|
|
119
|
+
current_cursor_position,
|
|
120
|
+
target_str_dsp_width);
|
|
121
|
+
break;
|
|
122
|
+
case "op_move_right":
|
|
123
|
+
new_left = this._getLeftWithMoveRight(
|
|
124
|
+
current_cursor_position,
|
|
125
|
+
target_str_dsp_width);
|
|
126
|
+
break;
|
|
127
|
+
case "op_vis_normal":
|
|
128
|
+
default:
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// 更新可视区域光标位置
|
|
133
|
+
this._VisibleAreaCurPos = current_cursor_position;
|
|
134
|
+
if (this._VisibleAreaCurPos == 2000) {
|
|
135
|
+
debugger;
|
|
136
|
+
}
|
|
137
|
+
this._TextLeft = new_left;
|
|
138
|
+
|
|
139
|
+
return new_left;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private _updateVisibleAreaPos(area_start_pos: number, target_str_dsp_width: number) {
|
|
143
|
+
if (target_str_dsp_width <= this._AreaWidth) {
|
|
144
|
+
this._TextVisibleStartPos = 0;
|
|
145
|
+
this._TextVisibleEndPos = target_str_dsp_width;
|
|
146
|
+
} else {
|
|
147
|
+
if (area_start_pos < 0) {
|
|
148
|
+
area_start_pos = 0;
|
|
149
|
+
}
|
|
150
|
+
this._TextVisibleStartPos = area_start_pos;
|
|
151
|
+
this._TextVisibleEndPos = this._TextVisibleStartPos + this._AreaWidth;
|
|
152
|
+
if (this._TextVisibleEndPos > target_str_dsp_width) {
|
|
153
|
+
// 到底,反推start
|
|
154
|
+
this._TextVisibleEndPos = target_str_dsp_width;
|
|
155
|
+
this._TextVisibleStartPos = this._TextVisibleEndPos - this._AreaWidth;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
console.log("_updateVisibleAreaPos new start=" + this._TextVisibleStartPos + " end=" + this._TextVisibleEndPos);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
private _caculateTextLeft(target_str_dsp_width: number): number {
|
|
163
|
+
// 根据左右对齐原则,推到textLeft
|
|
164
|
+
if (target_str_dsp_width > this._AreaWidth) {
|
|
165
|
+
// 整体区域可填充,则以VisibleStartPos和0点对齐的left即可
|
|
166
|
+
return -this._TextVisibleStartPos;
|
|
167
|
+
} else {
|
|
168
|
+
if (this._IsRightAlign) {
|
|
169
|
+
return (this._AreaWidth - target_str_dsp_width);
|
|
170
|
+
} else {
|
|
171
|
+
return 0;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
private _getLeftWithAddChar(
|
|
177
|
+
current_cursor_position: number,
|
|
178
|
+
target_str_dsp_width: number) {
|
|
179
|
+
let new_start: number;
|
|
180
|
+
|
|
181
|
+
if (this._IsRightAlign) {
|
|
182
|
+
// 右对齐场景,向左边移动光标(保持后端)
|
|
183
|
+
let end_range = this._TextVisibleEndPos - this._VisibleAreaCurPos;
|
|
184
|
+
new_start = current_cursor_position + end_range - this._AreaWidth;
|
|
185
|
+
} else {
|
|
186
|
+
// 左对齐场景,向右边移动光标(保持前端)
|
|
187
|
+
let start_range = this._VisibleAreaCurPos - this._TextVisibleStartPos;
|
|
188
|
+
new_start = current_cursor_position - start_range;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
this._updateVisibleAreaPos(new_start, target_str_dsp_width);
|
|
192
|
+
return this._caculateTextLeft(target_str_dsp_width);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
private _getLeftWithDelChar(current_cursor_position: number, target_str_dsp_width: number) {
|
|
196
|
+
let new_start: number;
|
|
197
|
+
|
|
198
|
+
if (target_str_dsp_width >= this._AreaWidth) {
|
|
199
|
+
// 删除动作一般为backSpace驱动,带动右边的东西向左边移动更形象
|
|
200
|
+
// 除非前端可视区域不足时,才进行前端保持
|
|
201
|
+
let front_range = Math.floor((this._TextVisibleEndPos - this._TextVisibleStartPos) / 3);
|
|
202
|
+
if (this._VisibleAreaCurPos - front_range > this._TextVisibleStartPos) {
|
|
203
|
+
// 前端充足,向右移动,start不动
|
|
204
|
+
new_start = this._TextVisibleStartPos;
|
|
205
|
+
} else {
|
|
206
|
+
// 前端(左)不足,保持左边
|
|
207
|
+
let start_range = this._VisibleAreaCurPos - this._TextVisibleStartPos;
|
|
208
|
+
new_start = current_cursor_position - start_range;
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
new_start = 0; // 长度不够,归0处理
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
// 刷新可视区域段
|
|
216
|
+
this._updateVisibleAreaPos(new_start, target_str_dsp_width);
|
|
217
|
+
return this._caculateTextLeft(target_str_dsp_width);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
private _getLeftWithMoveRight(current_cursor_position: number, target_str_dsp_width: number) {
|
|
221
|
+
let new_start: number;
|
|
222
|
+
|
|
223
|
+
let end_range = Math.floor(this._AreaWidth / 3);
|
|
224
|
+
if (this._VisibleAreaCurPos + end_range < this._TextVisibleEndPos) {
|
|
225
|
+
// 不到最后的1/3区域时,移动光标,保持Start位置
|
|
226
|
+
new_start = this._TextVisibleStartPos;
|
|
227
|
+
} else {
|
|
228
|
+
// 最后的1/3区域时,保持光标
|
|
229
|
+
let cursor_offset = current_cursor_position - this._VisibleAreaCurPos;
|
|
230
|
+
new_start = this._TextVisibleStartPos + cursor_offset;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// 刷新可视区域段
|
|
234
|
+
this._updateVisibleAreaPos(new_start, target_str_dsp_width);
|
|
235
|
+
return this._caculateTextLeft(target_str_dsp_width);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
private _getLeftWithMoveLeft(current_cursor_position: number, target_str_dsp_width: number) {
|
|
239
|
+
let new_start: number;
|
|
240
|
+
|
|
241
|
+
let start_range = Math.floor(this._AreaWidth / 3);
|
|
242
|
+
if (this._VisibleAreaCurPos - start_range > this._TextVisibleStartPos) {
|
|
243
|
+
// 不到最后的1/3区域时,移动光标,保持Start位置
|
|
244
|
+
new_start = this._TextVisibleStartPos;
|
|
245
|
+
} else {
|
|
246
|
+
// 最后的1/3区域时,保持光标
|
|
247
|
+
let cursor_offset = current_cursor_position - this._VisibleAreaCurPos;
|
|
248
|
+
new_start = this._TextVisibleStartPos + cursor_offset;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// 刷新可视区域段
|
|
252
|
+
this._updateVisibleAreaPos(new_start, target_str_dsp_width);
|
|
253
|
+
return this._caculateTextLeft(target_str_dsp_width);
|
|
254
|
+
}
|
|
255
|
+
}
|