@mpxjs/webpack-plugin 2.8.35 → 2.8.37
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/lib/index.js +4 -3
- package/lib/runtime/components/web/getInnerListeners.js +16 -2
- package/lib/runtime/components/web/mpx-checkbox-group.vue +1 -1
- package/lib/runtime/components/web/mpx-form.vue +2 -2
- package/lib/runtime/components/web/mpx-image.vue +11 -15
- package/lib/runtime/components/web/mpx-movable-view.vue +3 -3
- package/lib/runtime/components/web/mpx-picker-view.vue +5 -5
- package/lib/runtime/components/web/mpx-picker.vue +3 -3
- package/lib/runtime/components/web/mpx-progress.vue +3 -1
- package/lib/runtime/components/web/mpx-radio-group.vue +1 -1
- package/lib/runtime/components/web/mpx-scroll-view.vue +9 -9
- package/lib/runtime/components/web/mpx-slider.vue +4 -4
- package/lib/runtime/components/web/mpx-swiper.vue +3 -3
- package/lib/runtime/components/web/mpx-switch.vue +1 -1
- package/lib/runtime/components/web/mpx-text.vue +17 -17
- package/lib/runtime/components/web/mpx-video.vue +14 -28
- package/lib/runtime/components/web/mpx-web-view.vue +6 -8
- package/lib/style-compiler/index.js +3 -1
- package/lib/wxss/runtime/api.js +8 -8
- package/lib/wxss/runtime/noSourceMaps.js +3 -1
- package/lib/wxss/runtime/sourceMaps.js +7 -7
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -432,9 +432,9 @@ class MpxWebpackPlugin {
|
|
|
432
432
|
mpx.staticResourcesMap[packageRoot] = mpx.staticResourcesMap[packageRoot] || {}
|
|
433
433
|
mpx.subpackageModulesMap[packageRoot] = mpx.subpackageModulesMap[packageRoot] || {}
|
|
434
434
|
async.each(deps, (dep, callback) => {
|
|
435
|
-
dep.addEntry(compilation, (err,
|
|
435
|
+
dep.addEntry(compilation, (err, result) => {
|
|
436
436
|
if (err) return callback(err)
|
|
437
|
-
dep.resultPath = mpx.replacePathMap[dep.key] = resultPath
|
|
437
|
+
dep.resultPath = mpx.replacePathMap[dep.key] = result.resultPath
|
|
438
438
|
callback()
|
|
439
439
|
})
|
|
440
440
|
}, callback)
|
|
@@ -453,7 +453,8 @@ class MpxWebpackPlugin {
|
|
|
453
453
|
name: 'MpxWebpackPlugin',
|
|
454
454
|
stage: -1000
|
|
455
455
|
}, (compilation, callback) => {
|
|
456
|
-
processSubpackagesEntriesMap(compilation, () => {
|
|
456
|
+
processSubpackagesEntriesMap(compilation, (err) => {
|
|
457
|
+
if (err) return callback(err)
|
|
457
458
|
const checkRegisterPack = () => {
|
|
458
459
|
for (const packRoot in mpx.dynamicEntryInfo) {
|
|
459
460
|
const entryMap = mpx.dynamicEntryInfo[packRoot]
|
|
@@ -144,11 +144,25 @@ export function inheritEvent (type, oe, detail = {}) {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
export function getCustomEvent (type, detail = {}, target = null) {
|
|
147
|
+
const targetInfo = {}
|
|
148
|
+
if (target) {
|
|
149
|
+
const targetEl = target.$el || {}
|
|
150
|
+
const info = {
|
|
151
|
+
id: targetEl.id || '',
|
|
152
|
+
dataset: targetEl.dataset || {},
|
|
153
|
+
offsetTop: targetEl.offsetTop || 0,
|
|
154
|
+
offsetLeft: targetEl.offsetLeft || 0
|
|
155
|
+
}
|
|
156
|
+
Object.assign(targetInfo, {
|
|
157
|
+
target: info,
|
|
158
|
+
currentTarget: info
|
|
159
|
+
})
|
|
160
|
+
}
|
|
147
161
|
return {
|
|
148
162
|
type,
|
|
149
163
|
detail,
|
|
150
|
-
|
|
151
|
-
|
|
164
|
+
timeStamp: new Date().valueOf(),
|
|
165
|
+
...targetInfo
|
|
152
166
|
}
|
|
153
167
|
}
|
|
154
168
|
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
methods: {
|
|
77
77
|
submit () {
|
|
78
78
|
const value = getFormValue(this.$slots.default)
|
|
79
|
-
this.$emit('submit', getCustomEvent('submit', { value }))
|
|
79
|
+
this.$emit('submit', getCustomEvent('submit', { value }, this))
|
|
80
80
|
},
|
|
81
81
|
reset () {
|
|
82
82
|
setFormValue(this.$slots.default, this.initialValue)
|
|
83
|
-
this.$emit('reset', getCustomEvent('reset', { value: this.initialValue }))
|
|
83
|
+
this.$emit('reset', getCustomEvent('reset', { value: this.initialValue }, this))
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import getInnerListeners, {
|
|
2
|
+
import getInnerListeners, { getCustomEvent } from './getInnerListeners'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
name: 'mpx-image',
|
|
@@ -22,18 +22,14 @@
|
|
|
22
22
|
},
|
|
23
23
|
beforeCreate () {
|
|
24
24
|
this.image = new Image()
|
|
25
|
-
this.image.onload = (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
this.$emit('load', e)
|
|
25
|
+
this.image.onload = () => {
|
|
26
|
+
this.$emit('load', getCustomEvent('load', {
|
|
27
|
+
width: this.image.width,
|
|
28
|
+
height: this.image.height
|
|
29
|
+
}, this))
|
|
34
30
|
}
|
|
35
|
-
this.image.onerror = (
|
|
36
|
-
this.$emit('error',
|
|
31
|
+
this.image.onerror = () => {
|
|
32
|
+
this.$emit('error', getCustomEvent('error', {}, this))
|
|
37
33
|
}
|
|
38
34
|
},
|
|
39
35
|
watch: {
|
|
@@ -48,9 +44,9 @@
|
|
|
48
44
|
if (this.mode === 'widthFix' || this.mode === 'heightFix') {
|
|
49
45
|
let style
|
|
50
46
|
if (this.mode === 'widthFix') {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
style = {
|
|
48
|
+
height: 'auto'
|
|
49
|
+
}
|
|
54
50
|
} else {
|
|
55
51
|
style = {
|
|
56
52
|
width: 'auto'
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
x: this.roundFun(position.x) ? this.roundFun(position.x) : 0,
|
|
180
180
|
y: this.roundFun(position.y) ? this.roundFun(position.y) : 0,
|
|
181
181
|
source: this.source
|
|
182
|
-
}))
|
|
182
|
+
}, this))
|
|
183
183
|
}
|
|
184
184
|
this.lastestX = this.roundFun(position.x)
|
|
185
185
|
this.lastestY = this.roundFun(position.y)
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
this.touchEvent = 'vtouchmove'
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
this.$emit(this.touchEvent)
|
|
218
|
+
this.$emit(this.touchEvent, getCustomEvent(this.touchEvent, {}, this))
|
|
219
219
|
this.isFirstTouch = false
|
|
220
220
|
})
|
|
221
221
|
if (this.inertia) { // movable-view是否带有惯性
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
x: this.roundFun(this.bs.x),
|
|
234
234
|
y: this.roundFun(this.bs.y),
|
|
235
235
|
scale: this.roundFun(scale)
|
|
236
|
-
}))
|
|
236
|
+
}, this))
|
|
237
237
|
this.lastestScale = this.roundFun(scale)
|
|
238
238
|
})
|
|
239
239
|
this.bs.on('zoomEnd', ({ scale }) => {
|
|
@@ -97,13 +97,13 @@
|
|
|
97
97
|
},
|
|
98
98
|
notifyChange() {
|
|
99
99
|
const value = this.getValue()
|
|
100
|
-
this.$emit('change', getCustomEvent('change', {value}))
|
|
100
|
+
this.$emit('change', getCustomEvent('change', { value }, this))
|
|
101
101
|
},
|
|
102
|
-
notifyPickstart(
|
|
103
|
-
this.$emit('pickstart', getCustomEvent('pickstart', {
|
|
102
|
+
notifyPickstart() {
|
|
103
|
+
this.$emit('pickstart', getCustomEvent('pickstart', {}, this))
|
|
104
104
|
},
|
|
105
|
-
notifyPickend(
|
|
106
|
-
this.$emit('pickend', getCustomEvent('pickend', {
|
|
105
|
+
notifyPickend() {
|
|
106
|
+
this.$emit('pickend', getCustomEvent('pickend', {}, this))
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -266,11 +266,11 @@
|
|
|
266
266
|
default:
|
|
267
267
|
value = this.selectedIndex[0]
|
|
268
268
|
}
|
|
269
|
-
this.$emit('change', getCustomEvent('change', {value}))
|
|
269
|
+
this.$emit('change', getCustomEvent('change', {value}, this))
|
|
270
270
|
},
|
|
271
271
|
_cancel () {
|
|
272
272
|
this.hide()
|
|
273
|
-
this.$emit('cancel', getCustomEvent('cancel'))
|
|
273
|
+
this.$emit('cancel', getCustomEvent('cancel', {}, this))
|
|
274
274
|
},
|
|
275
275
|
_isMoving () {
|
|
276
276
|
return this.wheels.some((wheel) => {
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
this.$emit('columnchange', getCustomEvent('columnchange', {
|
|
328
328
|
column: i,
|
|
329
329
|
value: currentIndex
|
|
330
|
-
}))
|
|
330
|
+
}, this))
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
if (this.mode === 'time' || this.mode === 'date') {
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
refresherTriggered: {
|
|
125
125
|
handler (val) {
|
|
126
126
|
if (!val) {
|
|
127
|
-
this.$emit('refresherrestore')
|
|
127
|
+
this.$emit('refresherrestore', getCustomEvent('refresherrestore', {}, this))
|
|
128
128
|
this.isLoading = false
|
|
129
129
|
this.isAutoPullDown = true
|
|
130
130
|
this.bs && this.bs.finishPullDown()
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
scrollHeight: this.bs.scrollerHeight,
|
|
183
183
|
deltaX,
|
|
184
184
|
deltaY
|
|
185
|
-
}))
|
|
185
|
+
}, this))
|
|
186
186
|
if (this.bs.minScrollX - x < this._upperThreshold && deltaX > 0) {
|
|
187
187
|
this.dispatchScrollTo('left')
|
|
188
188
|
}
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
this.$emit('dragstart', getCustomEvent('dragstart', {
|
|
213
213
|
scrollLeft: this.bs.x ? this.bs.x * -1 : 0,
|
|
214
214
|
scrollTop: this.bs.y ? this.bs.y * -1 : 0
|
|
215
|
-
}))
|
|
215
|
+
}, this))
|
|
216
216
|
}
|
|
217
217
|
if (this.refresherEnabled) {
|
|
218
218
|
this.isAutoPullDown = false
|
|
@@ -223,13 +223,13 @@
|
|
|
223
223
|
this.$emit('dragging', getCustomEvent('dragging', {
|
|
224
224
|
scrollLeft: this.bs.x ? this.bs.x * -1 : 0,
|
|
225
225
|
scrollTop: this.bs.y ? this.bs.y * -1 : 0
|
|
226
|
-
}))
|
|
226
|
+
}, this))
|
|
227
227
|
}
|
|
228
228
|
if (this.refresherEnabled) {
|
|
229
229
|
if (this.bs.y > 0 && this.bs.y < this.refresherThreshold && this.bs.movingDirectionY !== 1) {
|
|
230
230
|
this.isAutoPullDown = false
|
|
231
231
|
this.isLoading = false
|
|
232
|
-
this.$emit('refresherpulling')
|
|
232
|
+
this.$emit('refresherpulling', getCustomEvent('refresherpulling', {}, this))
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
})
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
this.$emit('dragend', getCustomEvent('dragend', {
|
|
239
239
|
scrollLeft: this.bs.x ? this.bs.x * -1 : 0,
|
|
240
240
|
scrollTop: this.bs.y ? this.bs.y * -1 : 0
|
|
241
|
-
}))
|
|
241
|
+
}, this))
|
|
242
242
|
}
|
|
243
243
|
})
|
|
244
244
|
if (this.refresherEnabled) {
|
|
@@ -248,12 +248,12 @@
|
|
|
248
248
|
this.isLoading = true
|
|
249
249
|
if (this.bs.y < this.refresherThreshold) {
|
|
250
250
|
this.isAutoPullDown = true
|
|
251
|
-
this.$emit('refresherabort')
|
|
251
|
+
this.$emit('refresherabort', getCustomEvent('refresherabort', {}, this))
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
})
|
|
255
255
|
this.bs.on('pullingDown', () => {
|
|
256
|
-
this.$emit('refresherrefresh')
|
|
256
|
+
this.$emit('refresherrefresh', getCustomEvent('refresherrefresh', {}, this))
|
|
257
257
|
})
|
|
258
258
|
}
|
|
259
259
|
}
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
dispatchScrollTo: throttle(function (direction) {
|
|
313
313
|
let eventName = 'scrolltoupper'
|
|
314
314
|
if (direction === 'bottom' || direction === 'right') eventName = 'scrolltolower'
|
|
315
|
-
this.$emit(eventName, getCustomEvent(eventName, { direction }))
|
|
315
|
+
this.$emit(eventName, getCustomEvent(eventName, { direction }, this))
|
|
316
316
|
}, 200, {
|
|
317
317
|
leading: true,
|
|
318
318
|
trailing: false
|
|
@@ -156,12 +156,12 @@
|
|
|
156
156
|
let eventName = 'changing'
|
|
157
157
|
let moveStartX = event.targetTouches[0] && event.targetTouches[0].pageX
|
|
158
158
|
this.setLineValue(moveStartX)
|
|
159
|
-
this.$emit(eventName, getCustomEvent(eventName, { value: this.sliderValue }, this
|
|
159
|
+
this.$emit(eventName, getCustomEvent(eventName, { value: this.sliderValue }, this))
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
162
|
sliderTouchEnd (event) {
|
|
163
163
|
let eventName = 'change'
|
|
164
|
-
this.$emit(eventName, getCustomEvent(eventName, { value: this.sliderValue }, this
|
|
164
|
+
this.$emit(eventName, getCustomEvent(eventName, { value: this.sliderValue }, this))
|
|
165
165
|
this.isDrag = false
|
|
166
166
|
},
|
|
167
167
|
sliderClick (event) {
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
}
|
|
171
171
|
this.setLineValue(event.pageX)
|
|
172
172
|
let eventName = 'change'
|
|
173
|
-
this.$emit(eventName, getCustomEvent(eventName, { value: this.sliderValue }, this
|
|
173
|
+
this.$emit(eventName, getCustomEvent(eventName, { value: this.sliderValue }, this))
|
|
174
174
|
},
|
|
175
175
|
setLineValue (moveStartX) {
|
|
176
176
|
moveStartX = moveStartX - this.startX
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
} else {
|
|
201
201
|
value = this.getValue()
|
|
202
202
|
}
|
|
203
|
-
this.$emit('change', getCustomEvent('change', { value: value }, this
|
|
203
|
+
this.$emit('change', getCustomEvent('change', { value: value }, this))
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
}
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
current: this.currentIndex,
|
|
146
146
|
currentItemId: this.itemIds[this.currentIndex] || '',
|
|
147
147
|
source: this.changeSource
|
|
148
|
-
}))
|
|
148
|
+
}, this))
|
|
149
149
|
})
|
|
150
150
|
|
|
151
151
|
this.bs.on('scrollEnd', () => {
|
|
@@ -153,13 +153,13 @@
|
|
|
153
153
|
current: this.currentIndex,
|
|
154
154
|
currentItemId: this.itemIds[this.currentIndex] || '',
|
|
155
155
|
source: this.changeSource
|
|
156
|
-
}))
|
|
156
|
+
}, this))
|
|
157
157
|
})
|
|
158
158
|
this.bs.on('scroll', throttle(({ x, y }) => {
|
|
159
159
|
this.$emit('transition', getCustomEvent('transition', {
|
|
160
160
|
dx: this.lastX - x,
|
|
161
161
|
dy: this.lastY - y
|
|
162
|
-
}))
|
|
162
|
+
}, this))
|
|
163
163
|
}, 30, {
|
|
164
164
|
leading: true,
|
|
165
165
|
trailing: false
|
|
@@ -34,27 +34,32 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
render (createElement) {
|
|
37
|
-
let text = ''
|
|
38
37
|
let classNames = ['mpx-text']
|
|
39
38
|
let decode = false
|
|
40
39
|
const slots = this.$slots.default || []
|
|
40
|
+
const newSlots = []
|
|
41
41
|
slots.forEach((item) => {
|
|
42
42
|
if (item.text) {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
switch (this.space) {
|
|
44
|
+
case 'ensp':
|
|
45
|
+
case 'emsp':
|
|
46
|
+
case 'nbsp':
|
|
47
|
+
decode = true
|
|
48
|
+
item.text = item.text.replace(/ /g, `&${this.space};`)
|
|
49
|
+
break
|
|
50
|
+
}
|
|
51
|
+
newSlots.push(createElement('span', {
|
|
52
|
+
domProps: {
|
|
53
|
+
innerHTML: item.text
|
|
54
|
+
}
|
|
55
|
+
}))
|
|
56
|
+
} else {
|
|
57
|
+
newSlots.push(item)
|
|
45
58
|
}
|
|
46
59
|
})
|
|
47
60
|
if (this.selectable) {
|
|
48
61
|
classNames.push('selectable')
|
|
49
62
|
}
|
|
50
|
-
switch (this.space) {
|
|
51
|
-
case 'ensp':
|
|
52
|
-
case 'emsp':
|
|
53
|
-
case 'nbsp':
|
|
54
|
-
decode = true
|
|
55
|
-
text = text.replace(/ /g, `&${this.space};`)
|
|
56
|
-
break
|
|
57
|
-
}
|
|
58
63
|
if (this.decode) {
|
|
59
64
|
decode = true
|
|
60
65
|
}
|
|
@@ -62,12 +67,7 @@
|
|
|
62
67
|
class: classNames,
|
|
63
68
|
on: getInnerListeners(this)
|
|
64
69
|
}
|
|
65
|
-
|
|
66
|
-
data.domProps = {
|
|
67
|
-
innerHTML: text
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return createElement('span', data, slots)
|
|
70
|
+
return createElement('span', data, decode ? newSlots : slots)
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
</script>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script>
|
|
17
|
-
import { inheritEvent
|
|
17
|
+
import { inheritEvent } from './getInnerListeners'
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
20
|
name: 'mpx-video',
|
|
@@ -169,75 +169,61 @@
|
|
|
169
169
|
const videoNode = this.$refs['_mpx_video_ref']
|
|
170
170
|
|
|
171
171
|
videoNode.addEventListener('play', (e) => {
|
|
172
|
-
|
|
173
|
-
this.$emit('play', e)
|
|
172
|
+
this.$emit('play', inheritEvent('play', e, {}))
|
|
174
173
|
})
|
|
175
174
|
|
|
176
175
|
videoNode.addEventListener('pause', (e) => {
|
|
177
|
-
|
|
178
|
-
this.$emit('pause', e)
|
|
176
|
+
this.$emit('pause', inheritEvent('pause', e, {}))
|
|
179
177
|
})
|
|
180
178
|
|
|
181
179
|
videoNode.addEventListener('ended', (e) => {
|
|
182
|
-
|
|
183
|
-
this.$emit('ended', e)
|
|
180
|
+
this.$emit('ended', inheritEvent('ended', e, {}))
|
|
184
181
|
})
|
|
185
182
|
|
|
186
183
|
videoNode.addEventListener('timeupdate', (e) => {
|
|
187
184
|
const eNode = e.target
|
|
188
|
-
|
|
189
|
-
this.$emit('timeupdate', e)
|
|
185
|
+
this.$emit('timeupdate', inheritEvent('timeupdate', e, { currentTime: eNode.currentTime, duration: eNode.duration }))
|
|
190
186
|
})
|
|
191
187
|
|
|
192
188
|
videoNode.addEventListener('error', (e) => {
|
|
193
|
-
|
|
194
|
-
this.$emit('error', e)
|
|
189
|
+
this.$emit('error', inheritEvent('error', e, {}))
|
|
195
190
|
})
|
|
196
191
|
|
|
197
192
|
videoNode.addEventListener('waiting', (e) => {
|
|
198
|
-
|
|
199
|
-
this.$emit('waiting', e)
|
|
193
|
+
this.$emit('waiting', inheritEvent('waiting', e, {}))
|
|
200
194
|
})
|
|
201
195
|
|
|
202
196
|
videoNode.addEventListener('loadedmetadata', (e) => {
|
|
203
197
|
const eNode = e.target
|
|
204
|
-
|
|
205
|
-
this.$emit('loadedmetadata', e)
|
|
198
|
+
this.$emit('loadedmetadata', inheritEvent('loadedmetadata', e, { width: eNode.videoWidth, height: eNode.videoHeight, duration: eNode.duration }))
|
|
206
199
|
})
|
|
207
200
|
|
|
208
201
|
videoNode.addEventListener('progress', (e) => {
|
|
209
202
|
const eNode = e.target
|
|
210
203
|
const buffered = (eNode?.buffered?.end(0)) / (eNode?.duration)
|
|
211
|
-
|
|
212
|
-
this.$emit('progress', e)
|
|
204
|
+
this.$emit('progress', inheritEvent('progress', e, { buffered: buffered * 100 }))
|
|
213
205
|
})
|
|
214
206
|
|
|
215
207
|
videoNode.addEventListener('seeked', (e) => {
|
|
216
208
|
const eNode = e.target
|
|
217
|
-
|
|
218
|
-
this.$emit('seekcomplete', ne)
|
|
209
|
+
this.$emit('seekcomplete', inheritEvent('seekcomplete', e, { position: eNode.currentTime }))
|
|
219
210
|
})
|
|
220
211
|
|
|
221
212
|
videoNode.addEventListener('fullscreenchange', (e) => {
|
|
222
213
|
// TODO direction
|
|
223
|
-
extendEvent(e, { detail: { fullScreen: false } })
|
|
224
214
|
if (document.isFullScreen) {
|
|
225
|
-
e
|
|
226
|
-
this.$emit('fullscreenchange', e)
|
|
215
|
+
this.$emit('fullscreenchange', inheritEvent('fullscreenchange', e, { fullScreen: true }))
|
|
227
216
|
} else {
|
|
228
|
-
e
|
|
229
|
-
this.$emit('fullscreenchange', e)
|
|
217
|
+
this.$emit('fullscreenchange', inheritEvent('fullscreenchange', e, { fullScreen: false }))
|
|
230
218
|
}
|
|
231
219
|
})
|
|
232
220
|
|
|
233
221
|
videoNode.addEventListener('enterpictureinpicture', (e) => {
|
|
234
|
-
|
|
235
|
-
this.$emit('enterpictureinpicture', e)
|
|
222
|
+
this.$emit('enterpictureinpicture', inheritEvent('enterpictureinpicture', e, {}))
|
|
236
223
|
})
|
|
237
224
|
|
|
238
225
|
videoNode.addEventListener('leavepictureinpicture', (e) => {
|
|
239
|
-
|
|
240
|
-
this.$emit('leavepictureinpicture', e)
|
|
226
|
+
this.$emit('leavepictureinpicture', inheritEvent('leavepictureinpicture', e, {}))
|
|
241
227
|
})
|
|
242
228
|
}
|
|
243
229
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import
|
|
6
|
+
import { getCustomEvent } from './getInnerListeners'
|
|
7
7
|
import { redirectTo, navigateTo, navigateBack, reLaunch, switchTab} from '@mpxjs/api-proxy/src/web/api/index'
|
|
8
8
|
|
|
9
9
|
const eventLoad = 'load'
|
|
@@ -43,17 +43,15 @@
|
|
|
43
43
|
return domain
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
mounted () {
|
|
47
47
|
setTimeout(() => {
|
|
48
48
|
if (!this.Loaded) {
|
|
49
49
|
const loadData = {
|
|
50
50
|
src: this.src
|
|
51
51
|
}
|
|
52
|
-
this.$emit(eventError, getCustomEvent(eventError, loadData))
|
|
52
|
+
this.$emit(eventError, getCustomEvent(eventError, loadData, this))
|
|
53
53
|
}
|
|
54
54
|
}, 1000)
|
|
55
|
-
},
|
|
56
|
-
mounted () {
|
|
57
55
|
this.mpxIframe = this.$refs.mpxIframe
|
|
58
56
|
this.mpxIframe.addEventListener('load', (event) => {
|
|
59
57
|
event.currentTarget.contentWindow.postMessage(this.mainDomain, '*')
|
|
@@ -94,7 +92,7 @@
|
|
|
94
92
|
const loadData = {
|
|
95
93
|
src: this.src
|
|
96
94
|
}
|
|
97
|
-
this.$emit(eventLoad, getCustomEvent(eventLoad, loadData))
|
|
95
|
+
this.$emit(eventLoad, getCustomEvent(eventLoad, loadData, this))
|
|
98
96
|
}
|
|
99
97
|
})
|
|
100
98
|
},
|
|
@@ -110,7 +108,7 @@
|
|
|
110
108
|
type: 'message',
|
|
111
109
|
data: this.messageList
|
|
112
110
|
}
|
|
113
|
-
this.$emit(eventMessage, getCustomEvent(eventMessage, data))
|
|
111
|
+
this.$emit(eventMessage, getCustomEvent(eventMessage, data, this))
|
|
114
112
|
},
|
|
115
113
|
destroyed () {
|
|
116
114
|
if (!this.isPostMessage) {
|
|
@@ -120,7 +118,7 @@
|
|
|
120
118
|
type: 'message',
|
|
121
119
|
data: this.messageList
|
|
122
120
|
}
|
|
123
|
-
this.$emit(eventMessage, getCustomEvent(eventMessage, data))
|
|
121
|
+
this.$emit(eventMessage, getCustomEvent(eventMessage, data, this))
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
124
|
</script>
|
|
@@ -30,7 +30,7 @@ module.exports = function (css, map) {
|
|
|
30
30
|
|
|
31
31
|
const inlineConfig = Object.assign({}, mpx.postcssInlineConfig, { defs })
|
|
32
32
|
loadPostcssConfig(this, inlineConfig).then(config => {
|
|
33
|
-
const plugins =
|
|
33
|
+
const plugins = [trim] // init with trim plugin
|
|
34
34
|
const options = Object.assign(
|
|
35
35
|
{
|
|
36
36
|
to: this.resourcePath,
|
|
@@ -79,6 +79,8 @@ module.exports = function (css, map) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
plugins.push(...config.plugins) // push user config plugins
|
|
83
|
+
|
|
82
84
|
return postcss(plugins)
|
|
83
85
|
.process(css, options)
|
|
84
86
|
.then(result => {
|
package/lib/wxss/runtime/api.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
3
|
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
|
-
module.exports = (cssWithMappingToString)
|
|
5
|
+
module.exports = function (cssWithMappingToString) {
|
|
6
6
|
const list = []
|
|
7
7
|
|
|
8
8
|
// return the list of modules as css string
|
|
9
9
|
list.toString = function toString () {
|
|
10
|
-
return this.map((item)
|
|
11
|
-
|
|
10
|
+
return this.map(function (item) {
|
|
11
|
+
var content = ''
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var needLayer = typeof item[5] !== 'undefined'
|
|
14
14
|
|
|
15
15
|
if (item[4]) {
|
|
16
16
|
content += `@supports (${item[4]}) {`
|
|
@@ -48,11 +48,11 @@ module.exports = (cssWithMappingToString) => {
|
|
|
48
48
|
modules = [[null, modules, undefined]]
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
var alreadyImportedModules = {}
|
|
52
52
|
|
|
53
53
|
if (dedupe) {
|
|
54
54
|
for (let k = 0; k < this.length; k++) {
|
|
55
|
-
|
|
55
|
+
var id = this[k][0]
|
|
56
56
|
|
|
57
57
|
if (id != null) {
|
|
58
58
|
alreadyImportedModules[id] = true
|
|
@@ -60,8 +60,8 @@ module.exports = (cssWithMappingToString) => {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
for (
|
|
64
|
-
|
|
63
|
+
for (var k = 0; k < modules.length; k++) {
|
|
64
|
+
var item = [].concat(modules[k])
|
|
65
65
|
|
|
66
66
|
if (dedupe && alreadyImportedModules[item[0]]) {
|
|
67
67
|
continue
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
module.exports = (item)
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
module.exports = function (item) {
|
|
2
|
+
var content = item[1]
|
|
3
|
+
var cssMapping = item[3]
|
|
4
4
|
|
|
5
5
|
if (!cssMapping) {
|
|
6
6
|
return content
|
|
@@ -8,13 +8,13 @@ module.exports = (item) => {
|
|
|
8
8
|
|
|
9
9
|
if (typeof btoa === 'function') {
|
|
10
10
|
// eslint-disable-next-line no-undef
|
|
11
|
-
|
|
11
|
+
var base64 = btoa(
|
|
12
12
|
unescape(encodeURIComponent(JSON.stringify(cssMapping)))
|
|
13
13
|
)
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
var data = `sourceMappingURL=data:application/json;charset=utf-8;base64,${base64}`
|
|
15
|
+
var sourceMapping = `/*# ${data} */`
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
var sourceURLs = cssMapping.sources.map(
|
|
18
18
|
(source) => `/*# sourceURL=${cssMapping.sourceRoot || ''}${source} */`
|
|
19
19
|
)
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.37",
|
|
4
4
|
"description": "mpx compile core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mpx"
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"engines": {
|
|
83
83
|
"node": ">=14.14.0"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "87ec3c789ed2a427e73b839a9d3548fb6e42d922"
|
|
86
86
|
}
|