@tarojs/plugin-platform-harmony-ets 4.0.0-beta.6 → 4.0.0-beta.61
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/base/system.ts +53 -20
- package/dist/apis/canvas/index.ts +10 -1
- package/dist/apis/device/clipboard.ts +9 -0
- package/dist/apis/framework/index.ts +1 -5
- package/dist/apis/index.ts +27 -17
- package/dist/apis/network/request.ts +5 -5
- package/dist/apis/route/index.ts +15 -0
- package/dist/apis/storage/index.ts +148 -80
- package/dist/apis/ui/animation/animation.ts +71 -28
- package/dist/apis/ui/background.ts +2 -1
- package/dist/apis/ui/interaction/index.ts +42 -59
- package/dist/apis/ui/navigation-bar/index.ts +1 -1
- package/dist/apis/ui/scroll/index.ts +1 -1
- package/dist/apis/utils/index.ts +1 -1
- package/dist/apis/wxml/IntersectionObserver.ts +18 -10
- package/dist/apis/wxml/index.ts +2 -0
- package/dist/apis/wxml/selectorQuery.ts +25 -12
- package/dist/components-harmony-ets/button.ets +48 -34
- package/dist/components-harmony-ets/canvas.ets +51 -0
- package/dist/components-harmony-ets/checkbox.ets +69 -61
- package/dist/components-harmony-ets/form.ets +51 -29
- package/dist/components-harmony-ets/icon.ets +31 -19
- package/dist/components-harmony-ets/image.ets +34 -14
- package/dist/components-harmony-ets/index.ets +92 -0
- package/dist/components-harmony-ets/innerHtml.ets +11 -6
- package/dist/components-harmony-ets/input.ets +42 -40
- package/dist/components-harmony-ets/label.ets +69 -42
- package/dist/components-harmony-ets/listView.ets +26 -0
- package/dist/components-harmony-ets/movableArea.ets +126 -0
- package/dist/components-harmony-ets/movableView.ets +73 -0
- package/dist/components-harmony-ets/navigationBar.ets +65 -0
- package/dist/components-harmony-ets/pageMeta.ets +94 -0
- package/dist/components-harmony-ets/picker.ets +42 -38
- package/dist/components-harmony-ets/progress.ets +52 -0
- package/dist/components-harmony-ets/pseudo.ets +80 -0
- package/dist/components-harmony-ets/radio.ets +71 -64
- package/dist/components-harmony-ets/richText.ets +14 -30
- package/dist/components-harmony-ets/scrollList.ets +94 -0
- package/dist/components-harmony-ets/scrollView.ets +61 -57
- package/dist/components-harmony-ets/slider.ets +15 -14
- package/dist/components-harmony-ets/stickySection.ets +42 -0
- package/dist/components-harmony-ets/style.ets +372 -130
- package/dist/components-harmony-ets/swiper.ets +61 -20
- package/dist/components-harmony-ets/switch.ets +30 -28
- package/dist/components-harmony-ets/{index.ts → tag.ts} +6 -0
- package/dist/components-harmony-ets/text.ets +159 -51
- package/dist/components-harmony-ets/textArea.ets +35 -34
- package/dist/components-harmony-ets/utils/AttributeManager.ets +1 -1
- package/dist/components-harmony-ets/utils/DynamicCenter.ts +1 -1
- package/dist/components-harmony-ets/utils/flexManager.ets +47 -19
- package/dist/components-harmony-ets/utils/helper.ets +18 -5
- package/dist/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.ts +1 -2
- package/dist/components-harmony-ets/utils/htmlParser/index.ts +1 -1
- package/dist/components-harmony-ets/utils/index.ts +54 -50
- package/dist/components-harmony-ets/utils/styles.ets +170 -93
- package/dist/components-harmony-ets/video.ets +34 -20
- package/dist/components-harmony-ets/view.ets +63 -52
- package/dist/components-harmony-ets/webView.ets +40 -34
- package/dist/index.d.ts +152 -0
- package/dist/index.js +82 -39
- package/dist/index.js.map +1 -1
- package/dist/runtime-ets/bom/document.ts +6 -4
- package/dist/runtime-ets/bom/getComputedStyle.ts +2 -2
- package/dist/runtime-ets/bom/window.ts +7 -0
- package/dist/runtime-ets/current.ts +3 -0
- package/dist/runtime-ets/dom/bind.ts +30 -13
- package/dist/runtime-ets/dom/cssNesting.ts +411 -0
- package/dist/runtime-ets/dom/cssStyleDeclaration.ts +27 -41
- package/dist/runtime-ets/dom/document.ts +22 -8
- package/dist/runtime-ets/dom/element/canvas.ts +136 -0
- package/dist/runtime-ets/dom/element/element.ts +334 -58
- package/dist/runtime-ets/dom/element/form.ts +23 -26
- package/dist/runtime-ets/dom/element/index.ts +25 -2
- package/dist/runtime-ets/dom/element/movableArea.ts +12 -0
- package/dist/runtime-ets/dom/element/movableView.ts +193 -0
- package/dist/runtime-ets/dom/element/normal.ts +35 -8
- package/dist/runtime-ets/dom/element/progress.ts +12 -0
- package/dist/runtime-ets/dom/element/scrollView.ts +1 -0
- package/dist/runtime-ets/dom/element/text.ts +1 -8
- package/dist/runtime-ets/dom/element/video.ts +5 -3
- package/dist/runtime-ets/dom/element/webView.ts +11 -3
- package/dist/runtime-ets/dom/event.ts +0 -1
- package/dist/runtime-ets/dom/eventTarget.ts +0 -3
- package/dist/runtime-ets/dom/node.ts +46 -28
- package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +416 -235
- package/dist/runtime-ets/dom/stylesheet/index.ts +28 -308
- package/dist/runtime-ets/dom/stylesheet/type.ts +49 -9
- package/dist/runtime-ets/dom/stylesheet/util.ts +33 -27
- package/dist/runtime-ets/index.ts +2 -2
- package/dist/runtime-ets/interface/event.ts +1 -1
- package/dist/runtime-ets/utils/index.ts +67 -11
- package/dist/runtime-ets/utils/info.ts +1 -1
- package/dist/runtime-framework/react/app.ts +7 -2
- package/dist/runtime-framework/react/index.ts +0 -2
- package/dist/runtime-framework/react/native-page.ts +32 -14
- package/dist/runtime-framework/react/page.ts +3 -8
- package/dist/runtime-framework/solid/app.ts +25 -45
- package/dist/runtime-framework/solid/connect.ts +21 -3
- package/dist/runtime-framework/solid/hooks.ts +16 -11
- package/dist/runtime-framework/solid/index.ts +6 -2
- package/dist/runtime-framework/solid/page.ts +84 -30
- package/dist/runtime-framework/solid/reconciler/props.ts +65 -20
- package/dist/runtime-framework/solid/reconciler/render.ts +16 -6
- package/dist/runtime-framework/solid/reconciler/use.ts +0 -1
- package/dist/runtime-framework/solid/utils/index.ts +0 -2
- package/dist/runtime-utils.d.ts +827 -0
- package/dist/runtime-utils.js +411 -200
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +411 -200
- package/dist/runtime.js.map +1 -1
- package/index.js +3 -1
- package/package.json +13 -13
- package/static/media/cancel.svg +1 -1
- package/static/media/circle.svg +1 -1
- package/static/media/clear.svg +1 -1
- package/static/media/download.svg +1 -1
- package/static/media/info.svg +1 -1
- package/static/media/info_circle.svg +1 -1
- package/static/media/search.svg +1 -1
- package/static/media/success.svg +1 -1
- package/static/media/success_no_circle.svg +1 -1
- package/static/media/warn.svg +1 -1
- package/types/harmony.d.ts +4 -0
- package/types/index.d.ts +4 -0
- /package/dist/runtime-framework/solid/{contant.ts → constant.ts} +0 -0
|
@@ -68,12 +68,10 @@ class TaroEventTarget extends Events {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
72
71
|
if (event._stop) {
|
|
73
72
|
this._stopPropagation(event)
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
|
|
77
75
|
return listeners != null
|
|
78
76
|
}
|
|
79
77
|
|
|
@@ -95,5 +93,4 @@ class TaroEventTarget extends Events {
|
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
|
|
99
96
|
export { TaroEventTarget }
|
|
@@ -59,35 +59,38 @@ export class TaroNode extends TaroDataSourceElement {
|
|
|
59
59
|
return this.childNodes[index] as TaroElement
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
public findIndex (refChild
|
|
63
|
-
return this.childNodes.findIndex(node => node._nid === refChild
|
|
62
|
+
public findIndex (refChild?: TaroNode): number {
|
|
63
|
+
return this.childNodes.findIndex(node => node._nid === refChild?._nid)
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (
|
|
66
|
+
public updateTextNode () {
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
if (this.childNodes.length <= 0 || this.tagName !== 'VIEW') return
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
// TextNode 不具备 props 更新能力,需要由父节点来进行触发
|
|
71
|
+
this.childNodes.forEach(item => {
|
|
72
|
+
if (item.nodeType !== NodeType.TEXT_NODE) return
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
item._updateTrigger++
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 更新对应的 ArkUI 组件
|
|
79
|
+
public updateComponent () {
|
|
80
|
+
// 非半编译模式或者半编译模式下拥有自主更新权力的节点走 @State 的更新模式
|
|
81
|
+
if (this._isDynamicNode || !this._isCompileMode) {
|
|
82
|
+
this._updateTrigger++
|
|
79
83
|
} else {
|
|
80
|
-
|
|
81
|
-
if (idx >= 0) {
|
|
82
|
-
this._updateTrigger++
|
|
83
|
-
this.parentNode.notifyDataChange(idx)
|
|
84
|
-
} else {
|
|
85
|
-
this.parentNode.notifyDataReload()
|
|
86
|
-
}
|
|
84
|
+
this.parentNode?.updateComponent()
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
87
|
|
|
90
|
-
|
|
88
|
+
// 提供唯一标识,方便与小程序一致,能根据uid获取到对应的节点
|
|
89
|
+
public get uid (): string {
|
|
90
|
+
return this._nid
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public get firstChild (): TaroNode | null {
|
|
91
94
|
return this.childNodes[0] || null
|
|
92
95
|
}
|
|
93
96
|
|
|
@@ -128,11 +131,12 @@ export class TaroNode extends TaroDataSourceElement {
|
|
|
128
131
|
public set textContent (value: string) {
|
|
129
132
|
if (this.nodeType === NodeType.TEXT_NODE) {
|
|
130
133
|
this._textContent = value
|
|
131
|
-
this.parentNode?.updateComponent()
|
|
132
134
|
} else if (this.nodeType === NodeType.ELEMENT_NODE) {
|
|
133
135
|
const node = new TaroTextNode(value)
|
|
134
136
|
node._doc = this.ownerDocument
|
|
135
|
-
|
|
137
|
+
node.parentNode = this
|
|
138
|
+
this.childNodes.length = 0
|
|
139
|
+
this.childNodes.push(node)
|
|
136
140
|
}
|
|
137
141
|
}
|
|
138
142
|
|
|
@@ -150,7 +154,6 @@ export class TaroNode extends TaroDataSourceElement {
|
|
|
150
154
|
public set nodeValue (value: string | null) {
|
|
151
155
|
if (this.nodeType === NodeType.TEXT_NODE && value) {
|
|
152
156
|
this.textContent = value
|
|
153
|
-
this.parentNode?.updateComponent()
|
|
154
157
|
}
|
|
155
158
|
}
|
|
156
159
|
|
|
@@ -163,28 +166,37 @@ export class TaroNode extends TaroDataSourceElement {
|
|
|
163
166
|
}
|
|
164
167
|
|
|
165
168
|
// TODO cloneNode()、contains()
|
|
166
|
-
|
|
167
|
-
public appendChild (child: TaroNode): TaroNode {
|
|
169
|
+
public connectParentNode (child: TaroNode) {
|
|
168
170
|
child.parentNode?.removeChild(child)
|
|
169
171
|
child.parentNode = this
|
|
172
|
+
}
|
|
170
173
|
|
|
174
|
+
public appendChild (child: TaroNode): TaroNode {
|
|
175
|
+
this.connectParentNode(child)
|
|
171
176
|
this.childNodes.push(child)
|
|
172
177
|
this.notifyDataAdd(this.childNodes.length - 1)
|
|
173
178
|
|
|
179
|
+
// @ts-ignore
|
|
180
|
+
child.toggleLayer?.(true)
|
|
181
|
+
|
|
174
182
|
checkIsCompileModeAndInstallAfterDOMAction(child, this)
|
|
175
183
|
return child
|
|
176
184
|
}
|
|
177
185
|
|
|
178
|
-
public insertBefore (newNode: TaroNode, referenceNode
|
|
186
|
+
public insertBefore (newNode: TaroNode, referenceNode?: TaroNode): TaroNode {
|
|
179
187
|
newNode.parentNode?.removeChild(newNode)
|
|
180
188
|
|
|
181
|
-
if (referenceNode
|
|
189
|
+
if (!referenceNode) {
|
|
182
190
|
this.appendChild(newNode)
|
|
183
191
|
} else {
|
|
184
192
|
const idxOfRef = this.findIndex(referenceNode)
|
|
185
193
|
this.childNodes.splice(idxOfRef, 0, newNode)
|
|
194
|
+
this.connectParentNode(newNode)
|
|
186
195
|
// TODO: 优化
|
|
187
196
|
this.notifyDataReload()
|
|
197
|
+
|
|
198
|
+
// @ts-ignore
|
|
199
|
+
newNode.toggleLayer?.(true)
|
|
188
200
|
}
|
|
189
201
|
|
|
190
202
|
checkIsCompileModeAndInstallAfterDOMAction(newNode, this)
|
|
@@ -224,11 +236,17 @@ export class TaroNode extends TaroDataSourceElement {
|
|
|
224
236
|
}
|
|
225
237
|
|
|
226
238
|
public dispose () {
|
|
239
|
+
// 渲染,层级大于0的节点需要让其回到正常层级,然后删掉
|
|
240
|
+
// @ts-ignore
|
|
241
|
+
this.toggleLayer?.(false)
|
|
242
|
+
|
|
227
243
|
this.parentNode = null
|
|
228
244
|
this.childNodes = []
|
|
229
245
|
}
|
|
246
|
+
|
|
230
247
|
}
|
|
231
248
|
|
|
249
|
+
@Observed
|
|
232
250
|
export class TaroTextNode extends TaroNode {
|
|
233
251
|
constructor(value = '', nodeName = '#text', nodeType: NodeType = NodeType.TEXT_NODE) {
|
|
234
252
|
super(nodeName, nodeType)
|