@we-debug/plugin-ui-check 0.32.0 → 0.34.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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.34.0](https://github.com/dlhandsome/we-debug/compare/v0.33.1...v0.34.0) (2024-10-12)
7
+
8
+ **Note:** Version bump only for package @we-debug/plugin-ui-check
9
+
10
+
11
+
12
+
13
+
14
+ # [0.33.0](https://github.com/dlhandsome/we-debug/compare/v0.32.3...v0.33.0) (2024-08-08)
15
+
16
+ **Note:** Version bump only for package @we-debug/plugin-ui-check
17
+
18
+
19
+
20
+
21
+
6
22
  # [0.32.0](https://github.com/dlhandsome/we-debug/compare/v0.31.18...v0.32.0) (2024-06-24)
7
23
 
8
24
  **Note:** Version bump only for package @we-debug/plugin-ui-check
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var _plugin=require("./plugin"),_utils=require("./utils");let _timer,_pixelTimer,_y=0,_maHelper,reservedDistance=150;Component({properties:{},data:{safeArea:null,url:"",moveArea:{reservedDistance:reservedDistance,top:0,left:0,width:0,height:0},moveView:{y:_y,width:0,height:0,opacity:.3,direction:"vertical"},operationBar:{visible:!1,slider:{min:0,max:100,blockColor:"rgba(255,255,255,0.09)",activeColor:"#ffffff",backgroundColor:"rgba(255,255,255,0.25)"}}},methods:{badges({show:i=!1}={}){_plugin.Debug.getBadge().filter(e=>e!==_plugin.closeBadge).forEach(e=>{e.emit({show:i})})},closeBadge({show:e=!1}={}){_plugin.closeBadge.emit({show:e})},getMaHelper(){return _maHelper=_maHelper||new _utils.MoveAreaHelper(_plugin.Debug)},initSafeArea(){var e=this.getMaHelper().systemInfo["safeArea"];this.setData({safeArea:e})},initMoveArea(){var e=this.getMaHelper();this.setData({reservedDistance:reservedDistance,top:e.getTop(reservedDistance),left:e.getLeft(),width:e.getWidth(),height:e.getHeight(reservedDistance)})},imgLoad(e){var i=this.getMaHelper(),{width:e,height:t}=e.detail,a=this.data.safeArea.width,t=t*(a/e),e=t-i.systemInfo.windowHeight,e=e>reservedDistance?e:reservedDistance;this.setData({"moveView.width":a,"moveView.height":t,"moveArea.top":i.getTop(e),"moveArea.height":i.getHeight(e)})},removeImg(){this.setData({url:""})},addImg(e){this.setData({url:e})},slideChanging(e){e=e.detail.value;this.setData({"moveView.opacity":e/100}),this.toggleOperationBar({immediate:!1})},showOperationBar(){this.setData({"operationBar.visible":!0})},hideOperationBar(){this.setData({"operationBar.visible":!1})},moveViewChange(e){_y=e.detail.y},toggleOperationBar({immediate:e=!0}={}){this.data.operationBar.visible?e&&this.hideOperationBar():this.showOperationBar(),clearTimeout(_timer),_timer=setTimeout(()=>{this.hideOperationBar()},5e3)},moveViewRising(){clearTimeout(_pixelTimer),this.setData({"moveView.y":--_y}),this.toggleOperationBar({immediate:!1}),_pixelTimer=setTimeout(()=>{this.moveViewRising()},16)},moveViewFalling(){clearTimeout(_pixelTimer),this.setData({"moveView.y":++_y}),this.toggleOperationBar({immediate:!1}),_pixelTimer=setTimeout(()=>{this.moveViewFalling()},16)},increaseTouchstart(){this.moveViewRising()},increaseTouchend(){clearTimeout(_pixelTimer)},decreaseTouchstart(){this.moveViewFalling()},decreaseTouchend(){clearTimeout(_pixelTimer)},init(e){this.initSafeArea(),this.initMoveArea(),this.addImg(e),this.badges({show:!1}),this.closeBadge({show:!0}),_plugin.Debug.store.event.emit("debug:mask:hide-modal")},destory(){this.removeImg(),this.badges({show:!0}),this.closeBadge({show:!1})},addListeners(){_plugin.Debug?(_plugin.Debug.store.event.on(_plugin.prefix+"init",this.init.bind(this)),_plugin.Debug.store.event.on(_plugin.prefix+"destory",this.destory.bind(this))):console.warn("[we-debug]: please init before component attached")},removeListeners(){_plugin.Debug&&(_plugin.Debug.store.event.off(_plugin.prefix+"init",this.init.bind(this)),_plugin.Debug.store.event.off(_plugin.prefix+"destory",this.destory.bind(this)))}},attached(){this.addListeners()},detached(){this.removeListeners()}});
1
+ var _plugin=require("./plugin"),_utils=require("./utils");let _timer,_pixelTimer,_y=0,_maHelper,reservedDistance=150;Component({properties:{},data:{safeArea:null,url:"",moveArea:{reservedDistance:reservedDistance,top:0,left:0,width:0,height:0},moveView:{y:_y,width:0,height:0,opacity:.3,direction:"vertical"},operationBar:{visible:!1,slider:{min:0,max:100,blockColor:"rgba(255,255,255,0.09)",activeColor:"#ffffff",backgroundColor:"rgba(255,255,255,0.25)"}}},methods:{badges({show:i=!1}={}){_plugin.Debug.getBadge().filter(e=>e!==_plugin.closeBadge).forEach(e=>{e.emit({show:i})})},closeBadge({show:e=!1}={}){_plugin.closeBadge.emit({show:e})},getMaHelper(){return _maHelper=_maHelper||new _utils.MoveAreaHelper(_plugin.Debug)},initSafeArea(){var e=this.getMaHelper().systemInfo.safeArea;this.setData({safeArea:e})},initMoveArea(){var e=this.getMaHelper();this.setData({reservedDistance:reservedDistance,top:e.getTop(reservedDistance),left:e.getLeft(),width:e.getWidth(),height:e.getHeight(reservedDistance)})},imgLoad(e){var i=this.getMaHelper(),{width:e,height:t}=e.detail,a=this.data.safeArea.width,t=t*(a/e),e=t-i.systemInfo.windowHeight,e=e>reservedDistance?e:reservedDistance;this.setData({"moveView.width":a,"moveView.height":t,"moveArea.top":i.getTop(e),"moveArea.height":i.getHeight(e)})},removeImg(){this.setData({url:""})},addImg(e){this.setData({url:e})},slideChanging(e){e=e.detail.value;this.setData({"moveView.opacity":e/100}),this.toggleOperationBar({immediate:!1})},showOperationBar(){this.setData({"operationBar.visible":!0})},hideOperationBar(){this.setData({"operationBar.visible":!1})},moveViewChange(e){_y=e.detail.y},toggleOperationBar({immediate:e=!0}={}){this.data.operationBar.visible?e&&this.hideOperationBar():this.showOperationBar(),clearTimeout(_timer),_timer=setTimeout(()=>{this.hideOperationBar()},5e3)},moveViewRising(){clearTimeout(_pixelTimer),this.setData({"moveView.y":--_y}),this.toggleOperationBar({immediate:!1}),_pixelTimer=setTimeout(()=>{this.moveViewRising()},16)},moveViewFalling(){clearTimeout(_pixelTimer),this.setData({"moveView.y":++_y}),this.toggleOperationBar({immediate:!1}),_pixelTimer=setTimeout(()=>{this.moveViewFalling()},16)},increaseTouchstart(){this.moveViewRising()},increaseTouchend(){clearTimeout(_pixelTimer)},decreaseTouchstart(){this.moveViewFalling()},decreaseTouchend(){clearTimeout(_pixelTimer)},init(e){this.initSafeArea(),this.initMoveArea(),this.addImg(e),this.badges({show:!1}),this.closeBadge({show:!0}),_plugin.Debug.store.event.emit("debug:mask:hide-modal")},destory(){this.removeImg(),this.badges({show:!0}),this.closeBadge({show:!1})},addListeners(){_plugin.Debug?(_plugin.Debug.store.event.on(_plugin.prefix+"init",this.init.bind(this)),_plugin.Debug.store.event.on(_plugin.prefix+"destory",this.destory.bind(this))):console.warn("[we-debug]: please init before component attached")},removeListeners(){_plugin.Debug&&(_plugin.Debug.store.event.off(_plugin.prefix+"init",this.init.bind(this)),_plugin.Debug.store.event.off(_plugin.prefix+"destory",this.destory.bind(this)))}},attached(){this.addListeners()},detached(){this.removeListeners()}});
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.MoveAreaHelper=void 0;class MoveAreaHelper{constructor(e){this.systemInfo=e.store.sys.get();var{screenWidth:t,statusBarHeight:s,screenHeight:r}=this.systemInfo;e.getEnv()===e.ENV_TYPE.QQ&&(this.systemInfo.safeArea={left:0,right:t,top:s,bottom:r,width:t,height:s-s})}getLeft(){return this.systemInfo.safeArea.left}getWidth(){return this.systemInfo.safeArea.width}getTop(e){var{windowHeight:t,screenHeight:s}=this.systemInfo;return t-s-e}getHeight(e){var t=this.systemInfo["screenHeight"];return t+2*e}}exports.MoveAreaHelper=MoveAreaHelper;
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.MoveAreaHelper=void 0;class MoveAreaHelper{constructor(e){this.systemInfo=e.store.sys.get();var{screenWidth:t,statusBarHeight:s,screenHeight:r}=this.systemInfo;e.getEnv()===e.ENV_TYPE.QQ&&(this.systemInfo.safeArea={left:0,right:t,top:s,bottom:r,width:t,height:s-s})}getLeft(){return this.systemInfo.safeArea.left}getWidth(){return this.systemInfo.safeArea.width}getTop(e){var{windowHeight:t,screenHeight:s}=this.systemInfo;return t-s-e}getHeight(e){var t=this.systemInfo.screenHeight;return t+2*e}}exports.MoveAreaHelper=MoveAreaHelper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@we-debug/plugin-ui-check",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "we-debug ui-check plugin",
5
5
  "miniprogram": "dist",
6
6
  "main": "dist/plugin.js",
@@ -20,5 +20,5 @@
20
20
  "url": "https://github.com/dlhandsome/we-debug/issues"
21
21
  },
22
22
  "homepage": "https://github.com/dlhandsome/we-debug#readme",
23
- "gitHead": "f5cb28acb9cecc2463c6f1a9307646274f3aafee"
23
+ "gitHead": "80fdb51b56b1691acc1bb24a736bb8d077cd9e2b"
24
24
  }