@tarojs/plugin-platform-harmony-ets 4.0.0-alpha.16 → 4.0.0-alpha.18
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/components-harmony-ets/button.ets +16 -0
- package/dist/components-harmony-ets/checkbox.ets +3 -0
- package/dist/components-harmony-ets/input.ets +5 -1
- package/dist/components-harmony-ets/movableArea.ets +9 -7
- package/dist/components-harmony-ets/movableView.ets +1 -1
- package/dist/components-harmony-ets/radio.ets +3 -0
- package/dist/components-harmony-ets/slider.ets +3 -0
- package/dist/components-harmony-ets/switch.ets +6 -4
- package/dist/components-harmony-ets/textArea.ets +3 -0
- package/dist/runtime-ets/dom/cssNesting.ts +46 -36
- package/dist/runtime-ets/dom/element/element.ts +18 -14
- package/dist/runtime-ets/dom/element/movableView.ts +2 -0
- package/dist/runtime-framework/react/app.ts +2 -2
- package/package.json +10 -10
|
@@ -6,6 +6,21 @@ import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
|
6
6
|
|
|
7
7
|
import type { TaroAny, TaroEvent, TaroButtonElement, TaroStyleType } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
|
+
interface ButtonAttrs {
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Extend(Button)
|
|
14
|
+
function attrs(attr: ButtonAttrs) {
|
|
15
|
+
.enabled(!attr.disabled)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getAttributes(node: TaroButtonElement): ButtonAttrs {
|
|
19
|
+
return {
|
|
20
|
+
disabled: node._attrs.disabled || false,
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
9
24
|
@Extend(Button)
|
|
10
25
|
function themeStyles(style: TaroStyleType) {
|
|
11
26
|
.fontColor(style.color)
|
|
@@ -121,6 +136,7 @@ export default struct TaroButton {
|
|
|
121
136
|
}
|
|
122
137
|
.themeStyles(getThemeAttributes(this.node))
|
|
123
138
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
139
|
+
.attrs(getAttributes(this.node))
|
|
124
140
|
.constraintSize({
|
|
125
141
|
minWidth: this.node.hmStyle?.minWidth || getButtonMinWidth(this.node),
|
|
126
142
|
minHeight: this.node.hmStyle?.minHeight || getButtonMinHeight(this.node),
|
|
@@ -13,17 +13,20 @@ interface CheckboxOptions {
|
|
|
13
13
|
}
|
|
14
14
|
interface CheckboxAttrs {
|
|
15
15
|
selectedColor?: ResourceColor
|
|
16
|
+
disabled?: boolean
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
@Extend(Checkbox)
|
|
19
20
|
function checkboxAttr(attr: CheckboxAttrs) {
|
|
20
21
|
.selectedColor(attr.selectedColor)
|
|
22
|
+
.enabled(!attr.disabled)
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
function getAttributes (node: TaroCheckboxElement): CheckboxAttrs {
|
|
24
26
|
const _attrs = node._attrs
|
|
25
27
|
const checkboxAttrs: CheckboxAttrs = {}
|
|
26
28
|
checkboxAttrs.selectedColor = _attrs.color || '#1aad19'
|
|
29
|
+
checkboxAttrs.disabled = !!_attrs.disabled
|
|
27
30
|
return checkboxAttrs
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBLE_CHANGE_EVENT_NAME, createTaroEvent } from '@tarojs/runtime'
|
|
2
2
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
|
-
import { parseStyles, shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
4
|
+
import { parseStyles, shouldBindEvent, getNodeThresholds, getStyleAttr } from './utils/helper'
|
|
5
5
|
import { INPUT_TYPE_MAP, INPUT_CONFIRM_MAP } from './utils/constant/style'
|
|
6
6
|
|
|
7
7
|
import type { TaroStyleType, TaroAny, TaroInputElement, TaroEvent } from '@tarojs/runtime'
|
|
@@ -9,6 +9,7 @@ import type { TaroStyleType, TaroAny, TaroInputElement, TaroEvent } from '@taroj
|
|
|
9
9
|
interface InputAttrs {
|
|
10
10
|
textAlign?: TextAlign
|
|
11
11
|
autoFocus?: boolean
|
|
12
|
+
disabled?: boolean
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
@Extend(TextInput)
|
|
@@ -24,12 +25,14 @@ function styles (style: TaroStyleType) {
|
|
|
24
25
|
function attrs(attr: InputAttrs) {
|
|
25
26
|
.textAlign(attr.textAlign)
|
|
26
27
|
.defaultFocus(attr.autoFocus)
|
|
28
|
+
.enabled(!attr.disabled)
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
function getAttributes(node: TaroInputElement): InputAttrs {
|
|
30
32
|
return {
|
|
31
33
|
textAlign: node.hmStyle.textAlign,
|
|
32
34
|
autoFocus: node._attrs.autoFocus || node._attrs.focus || false,
|
|
35
|
+
disabled: node._attrs.disabled || false,
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -75,6 +78,7 @@ export default struct TaroInput {
|
|
|
75
78
|
.placeholderColor(getPlaceholderColor(this.node))
|
|
76
79
|
.enterKeyType(INPUT_CONFIRM_MAP.get(this.node._attrs?.confirmType) || EnterKeyType.Done)
|
|
77
80
|
.padding(0) // Note: 移出 Input 默认 padding 设置
|
|
81
|
+
.backgroundColor(getStyleAttr(this.node, "backgroundColor"))//
|
|
78
82
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
79
83
|
.styles(this.node?.hmStyle)
|
|
80
84
|
.attrs(getAttributes(this.node))
|
|
@@ -32,8 +32,8 @@ export default struct TaroMovableArea {
|
|
|
32
32
|
}
|
|
33
33
|
.attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
34
34
|
.clip(true)
|
|
35
|
-
.
|
|
36
|
-
|
|
35
|
+
.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => {
|
|
36
|
+
sizeChangeHandle(this.node, newValue)
|
|
37
37
|
})
|
|
38
38
|
.gesture(
|
|
39
39
|
PinchGesture({ fingers: 2 }).onActionStart((event: GestureEvent) => {
|
|
@@ -59,8 +59,8 @@ export default struct TaroMovableArea {
|
|
|
59
59
|
}
|
|
60
60
|
.attributeModifier(rowModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
61
61
|
.clip(true)
|
|
62
|
-
.
|
|
63
|
-
|
|
62
|
+
.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => {
|
|
63
|
+
sizeChangeHandle(this.node, newValue)
|
|
64
64
|
})
|
|
65
65
|
.gesture(
|
|
66
66
|
PinchGesture({ fingers: 2 }).onActionStart((event: GestureEvent) => {
|
|
@@ -86,8 +86,8 @@ export default struct TaroMovableArea {
|
|
|
86
86
|
}
|
|
87
87
|
.attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
|
|
88
88
|
.clip(true)
|
|
89
|
-
.
|
|
90
|
-
|
|
89
|
+
.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => {
|
|
90
|
+
sizeChangeHandle(this.node, newValue)
|
|
91
91
|
})
|
|
92
92
|
.gesture(
|
|
93
93
|
PinchGesture({ fingers: 2 }).onActionStart((event: GestureEvent) => {
|
|
@@ -110,7 +110,9 @@ export default struct TaroMovableArea {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
function sizeChangeHandle(node: TaroMovableAreaElement, newValue: Area | SizeOptions) {
|
|
114
116
|
node.childNodes.forEach(item => {
|
|
115
117
|
if (isTaroMovableViewElement(item)) {
|
|
116
118
|
if (item.area?.w !== Number(newValue.width) || item.area?.h !== Number(newValue.height)) {
|
|
@@ -41,7 +41,7 @@ export default struct TaroMovableView {
|
|
|
41
41
|
}
|
|
42
42
|
.translate({ x: this.node.position.x, y: this.node.position.y })
|
|
43
43
|
.scale({ x: this.node.scaleValue, y: this.node.scaleValue })
|
|
44
|
-
.
|
|
44
|
+
.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => {
|
|
45
45
|
if (this.node.selfSize?.w !== Number(newValue.width) || this.node.selfSize?.h !== Number(newValue.height)) {
|
|
46
46
|
this.node.selfSize = { w: Number(newValue.width), h: Number(newValue.height) }
|
|
47
47
|
}
|
|
@@ -11,12 +11,14 @@ import { isUndefined } from '@tarojs/shared'
|
|
|
11
11
|
interface RadioAttrs {
|
|
12
12
|
radioStyle?: HarmonyType.RadioStyle
|
|
13
13
|
themeStyles?: boolean
|
|
14
|
+
disabled?: boolean
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
@Extend(Radio)
|
|
17
18
|
function radioAttr (attr: RadioAttrs) {
|
|
18
19
|
.radioStyle(attr.radioStyle)
|
|
19
20
|
.themeStyles(attr.themeStyles)
|
|
21
|
+
.enabled(!attr.disabled)
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
function getAttributes (node: TaroRadioElement): RadioAttrs {
|
|
@@ -25,6 +27,7 @@ function getAttributes (node: TaroRadioElement): RadioAttrs {
|
|
|
25
27
|
checkedBackgroundColor: node._attrs.color || '#1aad19'
|
|
26
28
|
}
|
|
27
29
|
radioAttrs.themeStyles = !!node._attrs.disabled
|
|
30
|
+
radioAttrs.disabled = !!node._attrs.disabled
|
|
28
31
|
return radioAttrs
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -10,6 +10,7 @@ interface SliderAttrs {
|
|
|
10
10
|
trackColor?: ResourceColor
|
|
11
11
|
trackThickness?: Length
|
|
12
12
|
blockColor?: ResourceColor
|
|
13
|
+
disabled?: boolean
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
@Extend(Slider)
|
|
@@ -18,6 +19,7 @@ function attrs (attr: SliderAttrs) {
|
|
|
18
19
|
.trackColor(attr.trackColor)
|
|
19
20
|
.trackThickness(attr.trackThickness)
|
|
20
21
|
.blockColor(attr.blockColor)
|
|
22
|
+
.enabled(!attr.disabled)
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
function getAttributes (node: TaroSliderElement): SliderAttrs {
|
|
@@ -27,6 +29,7 @@ function getAttributes (node: TaroSliderElement): SliderAttrs {
|
|
|
27
29
|
sliderAttrs.trackColor = _attrs.backgroundColor || _attrs.color || '#e9e9e9'
|
|
28
30
|
sliderAttrs.trackThickness = _attrs.blockSize
|
|
29
31
|
sliderAttrs.blockColor = _attrs.blockColor || '#ffffff'
|
|
32
|
+
sliderAttrs.disabled = !!_attrs.disabled
|
|
30
33
|
return sliderAttrs
|
|
31
34
|
}
|
|
32
35
|
|
|
@@ -7,18 +7,20 @@ import type { TaroAny, TaroSwitchElement, TaroEvent } from '@tarojs/runtime'
|
|
|
7
7
|
|
|
8
8
|
interface SwitchAttrs {
|
|
9
9
|
selectedColor?: ResourceColor
|
|
10
|
+
disabled?: boolean
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
@Extend(Toggle)
|
|
13
14
|
function attrs(attr: SwitchAttrs) {
|
|
14
15
|
.selectedColor(attr.selectedColor)
|
|
16
|
+
.enabled(!attr.disabled)
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
function getAttributes (node: TaroSwitchElement): SwitchAttrs {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
20
|
+
const attr: SwitchAttrs = {}
|
|
21
|
+
attr.selectedColor = node._attrs.color || '#04BE02'
|
|
22
|
+
attr.disabled = !!node._attrs.disabled
|
|
23
|
+
return attr
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
@Extend(Toggle)
|
|
@@ -7,6 +7,7 @@ import type { TaroAny, TaroStyleType, TaroTextStyleType, TaroTextAreaElement, Ta
|
|
|
7
7
|
|
|
8
8
|
interface TextareaAttrs extends TaroTextStyleType {
|
|
9
9
|
autoFocus?: boolean
|
|
10
|
+
disabled?: boolean
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
@Extend(TextArea)
|
|
@@ -23,11 +24,13 @@ function textAttr(attr: TextareaAttrs) {
|
|
|
23
24
|
.textAlign(attr.textAlign)
|
|
24
25
|
.maxLines(attr.WebkitLineClamp)
|
|
25
26
|
.defaultFocus(attr.autoFocus)
|
|
27
|
+
.enabled(!attr.disabled)
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
function getAttributes(node: TaroTextAreaElement): TextareaAttrs {
|
|
29
31
|
const attrs: TaroAny = getFontAttributes(node)
|
|
30
32
|
attrs.autoFocus = node._attrs.autoFocus || node._attrs.focus || false
|
|
33
|
+
attrs.disabled = node._attrs.disabled || false
|
|
31
34
|
return attrs
|
|
32
35
|
}
|
|
33
36
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { parseClasses } from '../utils'
|
|
2
2
|
|
|
3
3
|
import type { CSSProperties, ReactElement } from 'react'
|
|
4
|
-
|
|
5
4
|
// 抽出来的嵌套查询
|
|
6
5
|
// const __nesting_style__ = [
|
|
7
6
|
// {
|
|
@@ -74,7 +73,7 @@ function depthTraversal(root: ReactElement) {
|
|
|
74
73
|
const result: Record<string, TMapping> = {}
|
|
75
74
|
if (tree && tree.props) {
|
|
76
75
|
// 兜底适配:如果Taro组件被原封不动的再别的地方导出使用,导致无法在编译环境添加__hmStyle
|
|
77
|
-
// import { View } from '
|
|
76
|
+
// import { View } from '../../../~/components'
|
|
78
77
|
// hack:如果是taro节点,但是被赋予了__styleSheet,则走一下__styleSheet转__hmStyle
|
|
79
78
|
if (tree.props.__styleSheet && typeof tree.type !== 'function') {
|
|
80
79
|
tree.props.__hmStyle = Object.assign({}, tree.props.__hmStyle, tree.props.__styleSheet.value)
|
|
@@ -128,28 +127,34 @@ function depthTraversal(root: ReactElement) {
|
|
|
128
127
|
const processLeaf = (leaf, descendant_map: TMappingNode) => {
|
|
129
128
|
if (!leaf) return
|
|
130
129
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
const queue = [leaf]
|
|
131
|
+
|
|
132
|
+
while (queue.length > 0) {
|
|
133
|
+
const current = queue.shift()
|
|
134
|
+
|
|
135
|
+
if (current instanceof Array) {
|
|
136
|
+
for (let i = 0; i < current.length; i++) {
|
|
137
|
+
queue.push(current[i])
|
|
138
|
+
}
|
|
139
|
+
continue
|
|
135
140
|
}
|
|
136
|
-
}
|
|
137
141
|
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
const leaf_map = traverse(current)
|
|
143
|
+
if (!leaf_map) continue
|
|
140
144
|
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
// 直接后代
|
|
146
|
+
Object.assign(descendant_map.children, leaf_map)
|
|
143
147
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
// 子孙后代
|
|
149
|
+
const grandchild: (Record<string, TMapping> | TMapping)[] = [leaf_map]
|
|
150
|
+
Object.keys(leaf_map).forEach(key => {
|
|
151
|
+
const leaf_child_map = class_mapping[key]
|
|
152
|
+
if (leaf_child_map?.descendants) {
|
|
153
|
+
grandchild.push(leaf_child_map.descendants)
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
Object.assign(descendant_map.descendants, ...grandchild)
|
|
157
|
+
}
|
|
153
158
|
}
|
|
154
159
|
|
|
155
160
|
traverse(root)
|
|
@@ -239,24 +244,29 @@ function combineStyle(nestingStyle: NestingStyle, class_mapping: TMapping, alias
|
|
|
239
244
|
}
|
|
240
245
|
return selector_nodes
|
|
241
246
|
}
|
|
242
|
-
const findSelector = (selectors, current_mapping, declaration): TSelectorNode[] => {
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
247
|
+
const findSelector = (selectors: string[], current_mapping: any, declaration: any): TSelectorNode[] => {
|
|
248
|
+
const workQueue: { selectors: string[], current_mapping: any }[] = [{ selectors, current_mapping }]
|
|
249
|
+
let resultElements: TSelectorNode[] = []
|
|
250
|
+
while (workQueue.length > 0) {
|
|
251
|
+
const { selectors: currentSelectors, current_mapping: currentMapping } = workQueue.shift()!
|
|
252
|
+
const new_selectors = currentSelectors.slice()
|
|
253
|
+
const selector_string = new_selectors.shift()
|
|
254
|
+
const combinator_type = new_selectors.shift()
|
|
255
|
+
|
|
256
|
+
const _elements = findElement(selector_string, combinator_type, currentMapping, new_selectors, declaration)
|
|
257
|
+
|
|
258
|
+
if (_elements.length) {
|
|
259
|
+
if (new_selectors.length) {
|
|
260
|
+
_elements.forEach(element => {
|
|
261
|
+
workQueue.push({ selectors: new_selectors.slice(), current_mapping: element.mapping })
|
|
262
|
+
})
|
|
263
|
+
} else {
|
|
264
|
+
resultElements = resultElements.concat(_elements)
|
|
265
|
+
}
|
|
256
266
|
}
|
|
257
|
-
} else {
|
|
258
|
-
return []
|
|
259
267
|
}
|
|
268
|
+
|
|
269
|
+
return resultElements
|
|
260
270
|
}
|
|
261
271
|
if (nestingStyle && nestingStyle instanceof Array) {
|
|
262
272
|
// 合并样式
|
|
@@ -53,12 +53,16 @@ export class TaroElement<
|
|
|
53
53
|
public dataset: Record<string, unknown> = EMPTY_OBJ
|
|
54
54
|
public _attrs: T & TaroExtraProps = {} as T & TaroExtraProps
|
|
55
55
|
|
|
56
|
+
private _page: any
|
|
57
|
+
|
|
56
58
|
constructor(tagName: string) {
|
|
57
59
|
super(tagName.replace(new RegExp('(?<=.)([A-Z])', 'g'), '-$1').toUpperCase(), NodeType.ELEMENT_NODE)
|
|
58
60
|
this.tagName = this.nodeName
|
|
59
61
|
this._style = createCSSStyleDeclaration(this)
|
|
60
62
|
initComponentNodeInfo(this)
|
|
61
63
|
bindAnimation(this)
|
|
64
|
+
|
|
65
|
+
this._page = Current.page
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
public set id(value: string) {
|
|
@@ -270,28 +274,28 @@ export class TaroElement<
|
|
|
270
274
|
}
|
|
271
275
|
|
|
272
276
|
get currentLayerNode () {
|
|
273
|
-
if (!
|
|
274
|
-
if (typeof
|
|
275
|
-
|
|
276
|
-
|
|
277
|
+
if (!this._page) return null
|
|
278
|
+
if (typeof this._page.tabBarCurrentIndex !== 'undefined') {
|
|
279
|
+
this._page.layerNode ||= []
|
|
280
|
+
this._page.layerNode[this._page.tabBarCurrentIndex] ||= Current.createHarmonyElement('VIEW')
|
|
277
281
|
// Tabbar
|
|
278
|
-
return
|
|
282
|
+
return this._page.layerNode[this._page.tabBarCurrentIndex]
|
|
279
283
|
} else {
|
|
280
|
-
|
|
281
|
-
return
|
|
284
|
+
this._page.layerNode ||= Current.createHarmonyElement('VIEW')
|
|
285
|
+
return this._page.layerNode
|
|
282
286
|
}
|
|
283
287
|
}
|
|
284
288
|
|
|
285
289
|
get currentLayerParents () {
|
|
286
|
-
if (!
|
|
287
|
-
if (typeof
|
|
288
|
-
|
|
289
|
-
|
|
290
|
+
if (!this._page) return null
|
|
291
|
+
if (typeof this._page.tabBarCurrentIndex !== 'undefined') {
|
|
292
|
+
this._page.layerParents ||= []
|
|
293
|
+
this._page.layerParents[this._page.tabBarCurrentIndex] ||= []
|
|
290
294
|
// Tabbar
|
|
291
|
-
return
|
|
295
|
+
return this._page.layerParents[this._page.tabBarCurrentIndex]
|
|
292
296
|
} else {
|
|
293
|
-
|
|
294
|
-
return
|
|
297
|
+
this._page.layerParents ||= []
|
|
298
|
+
return this._page.layerParents
|
|
295
299
|
}
|
|
296
300
|
}
|
|
297
301
|
|
|
@@ -232,6 +232,8 @@ export class TaroMovableViewElement extends TaroElement<MovableViewProps & { ani
|
|
|
232
232
|
const touchFns = (this?.__listeners?.[eventName] || []) as Function[]
|
|
233
233
|
touchFns.forEach(fn => {
|
|
234
234
|
fn({
|
|
235
|
+
_hmEvent: gestureEvent,
|
|
236
|
+
target: this,
|
|
235
237
|
changedTouches: gestureEvent.fingerList.map(finger => ({
|
|
236
238
|
clientX: finger.globalX,
|
|
237
239
|
clientY: finger.globalY
|
|
@@ -196,7 +196,7 @@ export function createReactApp (
|
|
|
196
196
|
const keys = Object.keys(globalData)
|
|
197
197
|
const descriptors = Object.getOwnPropertyDescriptors(globalData)
|
|
198
198
|
keys.forEach(key => {
|
|
199
|
-
Object.defineProperty(this, key, {
|
|
199
|
+
Object.defineProperty(Current?.app || this, key, {
|
|
200
200
|
configurable: true,
|
|
201
201
|
enumerable: true,
|
|
202
202
|
get () {
|
|
@@ -207,7 +207,7 @@ export function createReactApp (
|
|
|
207
207
|
}
|
|
208
208
|
})
|
|
209
209
|
})
|
|
210
|
-
Object.defineProperties(this, descriptors)
|
|
210
|
+
Object.defineProperties(Current?.app || this, descriptors)
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
app.onCreate?.()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/plugin-platform-harmony-ets",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.18",
|
|
4
4
|
"description": "OpenHarmony & 鸿蒙系统插件",
|
|
5
5
|
"author": "O2Team",
|
|
6
6
|
"homepage": "https://gitee.com/openharmony-sig/taro",
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"webpack-sources": "^3.2.3",
|
|
28
28
|
"webpack": "5.78.0",
|
|
29
|
-
"@tarojs/components": "4.0.0-alpha.
|
|
30
|
-
"@tarojs/
|
|
31
|
-
"@tarojs/
|
|
32
|
-
"@tarojs/
|
|
33
|
-
"@tarojs/
|
|
34
|
-
"@tarojs/taro": "4.0.0-alpha.
|
|
35
|
-
"@tarojs/
|
|
29
|
+
"@tarojs/components": "4.0.0-alpha.18",
|
|
30
|
+
"@tarojs/runner-utils": "4.0.0-alpha.18",
|
|
31
|
+
"@tarojs/runtime": "4.0.0-alpha.18",
|
|
32
|
+
"@tarojs/helper": "4.0.0-alpha.18",
|
|
33
|
+
"@tarojs/shared": "4.0.0-alpha.18",
|
|
34
|
+
"@tarojs/taro": "4.0.0-alpha.18",
|
|
35
|
+
"@tarojs/service": "4.0.0-alpha.18"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"fast-glob": "^3.3.1",
|
|
39
|
-
"rollup": "^3.
|
|
39
|
+
"rollup": "^3.29.4",
|
|
40
40
|
"rollup-plugin-node-externals": "^5.0.0",
|
|
41
41
|
"rollup-plugin-ts": "^3.0.2",
|
|
42
42
|
"solid-js": "^1.8.16",
|
|
43
43
|
"tslib": "^2.4.0",
|
|
44
|
-
"rollup-plugin-copy": "4.0.0-alpha.
|
|
44
|
+
"rollup-plugin-copy": "4.0.0-alpha.18"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"prod": "pnpm run build",
|