@we-debug/miniprogram 0.50.0 → 0.51.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.
@@ -66,16 +66,32 @@
66
66
  left: 0;
67
67
  right: 0;
68
68
  bottom: 0;
69
+ max-width: 669px;
70
+ margin: 0 auto;
69
71
  z-index: 999992;
70
- padding-bottom: constant(safe-area-inset-bottom);
72
+ padding-bottom: 16px;
73
+ padding-bottom: max(16px, constant(safe-area-inset-bottom));
71
74
  /* iOS < 11.2 */
72
- padding-bottom: env(safe-area-inset-bottom);
75
+ padding-bottom: max(16px, env(safe-area-inset-bottom));
73
76
  /* iOS >= 11.2 */
77
+ box-sizing: border-box;
78
+ max-height: calc(100% - 56px);
79
+ display: flex;
80
+ flex-direction: column;
81
+ overflow: hidden;
82
+ -webkit-text-size-adjust: 100%;
83
+ -moz-text-size-adjust: 100%;
84
+ text-size-adjust: 100%;
74
85
  }
75
86
  .w-mask__modal-title {
76
87
  color: rgba(0, 0, 0, 0.8);
77
88
  font-size: 16px;
78
- line-height: 66rpx;
79
- height: 66rpx;
89
+ line-height: 33px;
90
+ height: 33px;
80
91
  text-align: center;
81
92
  }
93
+ @media (max-height: 500px) {
94
+ .w-mask__modal {
95
+ max-height: calc(100% - 16px);
96
+ }
97
+ }
@@ -1,8 +1,8 @@
1
1
  .w-btn {
2
- width: 100rpx;
3
- height: 52rpx;
2
+ width: 50px;
3
+ height: 26px;
4
4
  text-align: center;
5
- line-height: 52rpx;
5
+ line-height: 26px;
6
6
  font-weight: 500;
7
7
  border-radius: 4px;
8
8
  color: #fff;
@@ -43,7 +43,7 @@
43
43
  opacity: 0.5;
44
44
  }
45
45
  .w-switch {
46
- margin: 15rpx -8rpx 0 0;
46
+ margin: 8px -4px 0 0;
47
47
  }
48
48
  .w-switch[disabled] {
49
49
  opacity: 0.4;
@@ -71,18 +71,18 @@
71
71
  }
72
72
  .cell-body-major__meta {
73
73
  display: inline-block;
74
- padding: 0 8rpx;
75
- margin-left: 16rpx;
76
- min-width: 32rpx;
77
- height: 32rpx;
74
+ padding: 0 4px;
75
+ margin-left: 8px;
76
+ min-width: 16px;
77
+ height: 16px;
78
78
  text-align: center;
79
- line-height: 32rpx;
79
+ line-height: 16px;
80
80
  color: #fff;
81
81
  background-color: #e05d44;
82
- border-radius: 32rpx;
82
+ border-radius: 16px;
83
83
  }
84
84
  .cell-body-minor {
85
85
  color: #9d9d9d;
86
86
  font-size: 12px;
87
- margin-top: 6rpx;
87
+ margin-top: 3px;
88
88
  }
@@ -0,0 +1 @@
1
+ module.exports=Behavior({properties:{props:{type:Object,value:{}}},methods:{close(e){this.triggerEvent("close",{result:e})}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@we-debug/miniprogram",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "we-debug miniprogram component",
5
5
  "author": {
6
6
  "name": "dlhandsome"
@@ -26,10 +26,10 @@
26
26
  },
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@we-debug/core": "0.50.0"
29
+ "@we-debug/core": "0.51.0"
30
30
  },
31
31
  "readme": "ERROR: No README data found!",
32
32
  "_id": "@we-debug/core@0.3.5",
33
33
  "_commitid": "6c3f04b",
34
- "gitHead": "2304486ada029231f6e93b89f7491fe0e5d298c6"
34
+ "gitHead": "22641ac4972a154619c6dc8f44b1bfdcbb92c8eb"
35
35
  }
@@ -0,0 +1,27 @@
1
+ /* eslint-env jest */
2
+ const mockDebug = {
3
+ event: {
4
+ on: jest.fn(),
5
+ off: jest.fn()
6
+ },
7
+ releasePageOverlays: jest.fn(),
8
+ getPageOverlays: jest.fn(() => [])
9
+ };
10
+
11
+ jest.mock('@we-debug/core', () => ({ default: mockDebug }));
12
+
13
+ test('缺少 getPageId 时警告且不注册或释放浮层监听', () => {
14
+ const warn = jest.spyOn(console, 'warn').mockImplementation(() => {});
15
+ global.Behavior = jest.fn(options => options);
16
+ const behavior = require('../src/host-behavior');
17
+ const host = { data: { mode: 'overlay' } };
18
+
19
+ behavior.lifetimes.attached.call(host);
20
+ behavior.lifetimes.detached.call(host);
21
+
22
+ expect(warn).toHaveBeenCalledWith('[we-debug] 当前基础库不支持 getPageId,插件浮层不可用');
23
+ expect(mockDebug.event.on).not.toHaveBeenCalled();
24
+ expect(mockDebug.event.off).not.toHaveBeenCalled();
25
+ expect(mockDebug.releasePageOverlays).not.toHaveBeenCalled();
26
+ warn.mockRestore();
27
+ });