@tarojs/plugin-platform-harmony-ets 4.0.0-beta.19 → 4.0.0-beta.20
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/dist/apis/wxml/IntersectionObserver.ts +5 -3
- package/dist/components-harmony-ets/button.ets +3 -2
- package/dist/components-harmony-ets/checkbox.ets +6 -3
- package/dist/components-harmony-ets/form.ets +5 -4
- package/dist/components-harmony-ets/icon.ets +8 -4
- package/dist/components-harmony-ets/image.ets +2 -0
- package/dist/components-harmony-ets/innerHtml.ets +5 -4
- package/dist/components-harmony-ets/input.ets +6 -4
- package/dist/components-harmony-ets/label.ets +5 -4
- package/dist/components-harmony-ets/movableArea.ets +8 -31
- package/dist/components-harmony-ets/movableView.ets +8 -31
- package/dist/components-harmony-ets/picker.ets +21 -16
- package/dist/components-harmony-ets/progress.ets +2 -0
- package/dist/components-harmony-ets/pseudo.ets +38 -31
- package/dist/components-harmony-ets/radio.ets +6 -3
- package/dist/components-harmony-ets/richText.ets +3 -1
- package/dist/components-harmony-ets/scrollView.ets +15 -36
- package/dist/components-harmony-ets/slider.ets +4 -2
- package/dist/components-harmony-ets/style.ets +62 -27
- package/dist/components-harmony-ets/swiper.ets +3 -2
- package/dist/components-harmony-ets/switch.ets +3 -1
- package/dist/components-harmony-ets/text.ets +10 -8
- package/dist/components-harmony-ets/textArea.ets +6 -4
- package/dist/components-harmony-ets/utils/helper.ets +3 -2
- package/dist/components-harmony-ets/utils/styles.ets +25 -93
- package/dist/components-harmony-ets/video.ets +2 -0
- package/dist/components-harmony-ets/view.ets +11 -32
- package/dist/components-harmony-ets/webView.ets +3 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/runtime-ets/dom/cssNesting.ts +36 -10
- package/dist/runtime-ets/dom/cssStyleDeclaration.ts +15 -40
- package/dist/runtime-ets/dom/document.ts +0 -3
- package/dist/runtime-ets/dom/element/element.ts +6 -5
- package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +152 -217
- package/dist/runtime-ets/dom/stylesheet/index.ts +17 -315
- package/dist/runtime-ets/dom/stylesheet/type.ts +6 -2
- package/dist/runtime-ets/index.ts +1 -1
- package/dist/runtime-ets/utils/index.ts +24 -8
- package/dist/runtime-framework/react/native-page.ts +6 -4
- package/dist/runtime-utils.js +4 -3
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +4 -3
- package/dist/runtime.js.map +1 -1
- package/package.json +8 -8
|
@@ -45,21 +45,37 @@ export function convertNumber2VP (value: number, unit = 'px') {
|
|
|
45
45
|
return pxTransformHelper(value, 'vp')
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
// 合并静态样式,从样式表里面找到对应的样式
|
|
49
|
+
export function calcStaticStyle (styleSheet: Record<string, CSSProperties>, classNames: string, style: CSSProperties): CSSProperties {
|
|
49
50
|
const obj: CSSProperties[] = []
|
|
50
51
|
const classes = typeof classNames === 'string' ? classNames.split(' ') : []
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
if (classes.length === 1) {
|
|
53
|
+
if (style) {
|
|
54
|
+
return Object.assign({}, styleSheet[classNames], style)
|
|
55
|
+
} else {
|
|
56
|
+
// 同一个引用
|
|
57
|
+
return styleSheet[classNames]
|
|
55
58
|
}
|
|
59
|
+
} else {
|
|
60
|
+
for (let i = 0; i < classes.length; i++) {
|
|
61
|
+
const className = classes[i]
|
|
62
|
+
if (styleSheet[className]) {
|
|
63
|
+
obj.push(styleSheet[className])
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (style) {
|
|
67
|
+
obj.push(style)
|
|
68
|
+
}
|
|
69
|
+
return Object.assign.apply(null, [{}].concat(obj))
|
|
56
70
|
}
|
|
71
|
+
}
|
|
57
72
|
|
|
73
|
+
// 动态样式计算,需要经过web2harmony进行反转
|
|
74
|
+
export function calcDynamicStyle (style: CSSProperties): CSSProperties {
|
|
58
75
|
if (style) {
|
|
59
|
-
|
|
76
|
+
return convertWebStyle2HmStyle(style)
|
|
60
77
|
}
|
|
61
|
-
|
|
62
|
-
return Object.assign.apply(null, [{}].concat(obj))
|
|
78
|
+
return {}
|
|
63
79
|
}
|
|
64
80
|
|
|
65
81
|
export function getPageScrollerOrNode (scrollerOrNode: any, page: any) {
|
|
@@ -257,7 +257,7 @@ export function createNativePageConfig (Component, pageName: string, react: type
|
|
|
257
257
|
window.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
|
|
258
258
|
// 触发onUnload生命周期
|
|
259
259
|
safeExecute($taroPath, ONUNLOAD)
|
|
260
|
-
resetCurrent()
|
|
260
|
+
resetCurrent.call(this)
|
|
261
261
|
unmounting = true
|
|
262
262
|
Current.app!.unmount!($taroPath, () => {
|
|
263
263
|
unmounting = false
|
|
@@ -310,9 +310,11 @@ export function createNativePageConfig (Component, pageName: string, react: type
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
function resetCurrent () {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
if (Current.page === this) {
|
|
314
|
+
// 小程序插件页面卸载之后返回到宿主页面时,需重置Current页面和路由。否则引发插件组件二次加载异常 fix:#11991
|
|
315
|
+
Current.page = null
|
|
316
|
+
Current.router = null
|
|
317
|
+
}
|
|
316
318
|
}
|
|
317
319
|
|
|
318
320
|
LIFECYCLES.forEach((lifecycle) => {
|
package/dist/runtime-utils.js
CHANGED
|
@@ -3999,13 +3999,12 @@ class IntersectionObserver {
|
|
|
3999
3999
|
};
|
|
4000
4000
|
const taro = Current.taro;
|
|
4001
4001
|
const page = taro.getCurrentInstance().page;
|
|
4002
|
-
|
|
4003
|
-
this._component = component || currentPage;
|
|
4002
|
+
this._component = component || getPageScrollerOrNode(page === null || page === void 0 ? void 0 : page.node, page);
|
|
4004
4003
|
Object.assign(this._options, options);
|
|
4005
4004
|
}
|
|
4006
4005
|
disconnect() {
|
|
4007
4006
|
var _a;
|
|
4008
|
-
if (this._observerNodes) {
|
|
4007
|
+
if (this._observerNodes && this._component) {
|
|
4009
4008
|
if (this._observerNodes instanceof Array) {
|
|
4010
4009
|
this._observerNodes.forEach((n) => {
|
|
4011
4010
|
var _a;
|
|
@@ -4026,6 +4025,8 @@ class IntersectionObserver {
|
|
|
4026
4025
|
}
|
|
4027
4026
|
observe(targetSelector, callback) {
|
|
4028
4027
|
var _a;
|
|
4028
|
+
if (!this._component)
|
|
4029
|
+
return;
|
|
4029
4030
|
const { observeAll, thresholds } = this._options;
|
|
4030
4031
|
const node = findChildNodeWithDFS(this._component, targetSelector, observeAll);
|
|
4031
4032
|
this._observerNodes = node;
|