@mpxjs/api-proxy 2.8.46 → 2.8.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/api-proxy",
3
- "version": "2.8.46",
3
+ "version": "2.8.49",
4
4
  "description": "convert miniprogram API at each end",
5
5
  "module": "src/index.js",
6
6
  "types": "@types/index.d.ts",
@@ -39,5 +39,5 @@
39
39
  "dependencies": {
40
40
  "axios": "^0.21.1"
41
41
  },
42
- "gitHead": "dcf6f000660d56207ff414cb776e8bc6d5ce651f"
42
+ "gitHead": "b399e81951df7094fb0a494ae877bcf4e6a2985b"
43
43
  }
@@ -97,16 +97,8 @@ class WebIntersectionObserver {
97
97
  nextTick(() => {
98
98
  const marginsTemp = margins || {}
99
99
  const { left = 0, right = 0, top = 0, bottom = 0 } = marginsTemp
100
- this._root = document.querySelector('html')
101
- const viewportWidth = window.innerWidth || document.documentElement.clientWidth
102
- const viewportHeight = window.innerHeight || document.documentElement.clientHeight
103
- const rootWidth = this._root.offsetWidth || 0
104
- const rootHeight = this._root.offsetHeight || 0
105
- if (rootHeight >= viewportHeight) {
106
- this._rootMargin = `${top}px ${viewportWidth - rootWidth + right}px ${viewportHeight - rootHeight + bottom}px ${left}px`
107
- } else {
108
- this._rootMargin = `${top}px ${right}px ${bottom}px ${left}px`
109
- }
100
+ this._root = null
101
+ this._rootMargin = `${top}px ${right}px ${bottom}px ${left}px`
110
102
  this._relativeInfo.push({ selector: null, margins })
111
103
  })
112
104
  return this
@@ -75,7 +75,7 @@ class SelectQuery {
75
75
  }
76
76
 
77
77
  _handleFields (fields, el, selector) {
78
- if (!el) return null
78
+ if (!el || (el && !el.getBoundingClientRect)) return null
79
79
  const { id, dataset, rect, size, scrollOffset, properties = [], computedStyle = [], node } = fields
80
80
  const { left, right, top, bottom, width, height } = el.getBoundingClientRect()
81
81