@tarojs/plugin-platform-harmony-ets 4.0.3-alpha.3 → 4.0.3-alpha.5
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/weapp/life-cycle.ts +1 -1
- package/dist/apis/framework/index.ts +1 -1
- package/dist/apis/network/downloadFile.ts +3 -1
- package/dist/apis/network/uploadFile.ts +3 -1
- package/dist/apis/route/index.ts +1 -2
- package/dist/apis/ui/background.ts +1 -1
- package/dist/apis/ui/navigation-bar/index.ts +1 -1
- package/dist/apis/ui/tab-bar.ts +1 -2
- package/dist/apis/utils/handler.ts +2 -1
- package/dist/apis/utils/index.ts +1 -2
- package/dist/components-harmony-ets/button.ets +1 -1
- package/dist/components-harmony-ets/checkbox.ets +1 -2
- package/dist/components-harmony-ets/form.ets +0 -1
- package/dist/components-harmony-ets/index.ets +37 -90
- package/dist/components-harmony-ets/input.ets +11 -7
- package/dist/components-harmony-ets/label.ets +1 -2
- package/dist/components-harmony-ets/listView.ets +3 -2
- package/dist/components-harmony-ets/movableArea.ets +3 -3
- package/dist/components-harmony-ets/navigationBar.ets +1 -1
- package/dist/components-harmony-ets/pageMeta.ets +1 -1
- package/dist/components-harmony-ets/pseudo.ets +1 -1
- package/dist/components-harmony-ets/radio.ets +2 -3
- package/dist/components-harmony-ets/scrollList.ets +2 -2
- package/dist/components-harmony-ets/scrollView.ets +8 -3
- package/dist/components-harmony-ets/slider.ets +1 -1
- package/dist/components-harmony-ets/stickySection.ets +2 -2
- package/dist/components-harmony-ets/style.ets +8 -7
- package/dist/components-harmony-ets/swiper.ets +1 -1
- package/dist/components-harmony-ets/switch.ets +1 -1
- package/dist/components-harmony-ets/text.ets +2 -2
- package/dist/components-harmony-ets/utils/helper.ets +2 -2
- package/dist/components-harmony-ets/utils/styles.ets +5 -6
- package/dist/components-harmony-ets/video.ets +1 -1
- package/dist/components-harmony-ets/view.ets +1 -2
- package/dist/components-harmony-ets/webView.ets +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime-ets/bom/URL.ts +2 -0
- package/dist/runtime-ets/bom/document.ts +1 -2
- package/dist/runtime-ets/bom/getComputedStyle.ts +1 -2
- package/dist/runtime-ets/bom/history.ts +1 -0
- package/dist/runtime-ets/bom/location.ts +1 -0
- package/dist/runtime-ets/bom/navigator.ts +1 -21
- package/dist/runtime-ets/bom/raf.ts +1 -37
- package/dist/runtime-ets/bom/window.ts +4 -5
- package/dist/runtime-ets/constant.ts +17 -10
- package/dist/runtime-ets/current.ts +24 -2
- package/dist/runtime-ets/dom/document.ts +1 -1
- package/dist/runtime-ets/dom/element/canvas.ts +3 -2
- package/dist/runtime-ets/dom/element/element.ts +6 -5
- package/dist/runtime-ets/dom/element/form.ts +6 -0
- package/dist/runtime-ets/dom/event-source.ts +1 -0
- package/dist/runtime-ets/dom/eventTarget.ts +1 -1
- package/dist/runtime-ets/dom/node.ts +3 -4
- package/dist/runtime-ets/emitter/emitter.ts +1 -0
- package/dist/runtime-ets/env.ts +1 -0
- package/dist/runtime-ets/index.ts +22 -7
- package/dist/runtime-ets/interface/index.ts +6 -0
- package/dist/runtime-ets/utils/index.ts +4 -6
- package/dist/runtime-ets/utils/router.ts +9 -0
- package/dist/runtime-framework/react/app.ts +1 -2
- package/dist/runtime-framework/react/hooks.ts +1 -1
- package/dist/runtime-framework/react/native-page.ts +1 -2
- package/dist/runtime-framework/react/page.ts +1 -2
- package/dist/runtime-framework/solid/app.ts +1 -2
- package/dist/runtime-framework/solid/hooks.ts +1 -1
- package/dist/runtime-framework/solid/page.ts +1 -2
- package/dist/runtime-framework/solid/reconciler/props.ts +9 -10
- package/dist/runtime-utils.d.ts +4 -5
- package/dist/runtime-utils.js +1 -2
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +1 -2
- package/dist/runtime.js.map +1 -1
- package/package.json +9 -9
- package/types/runtime.d.ts +7 -0
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { isNumber } from '@tarojs/shared'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export {
|
|
4
|
+
A, APP, BEHAVIORS, BODY,
|
|
5
|
+
CATCH_VIEW, CATCHMOVE, CHANGE,
|
|
6
|
+
CLASS, COMMENT, COMPILE_MODE,
|
|
7
|
+
CONFIRM, CONTAINER, CONTEXT_ACTIONS,
|
|
8
|
+
CURRENT_TARGET, CUSTOM_WRAPPER,
|
|
9
|
+
DATASET, DATE, DOCUMENT_ELEMENT_NAME,
|
|
10
|
+
DOCUMENT_FRAGMENT, EVENT_CALLBACK_RESULT,
|
|
11
|
+
EXTERNAL_CLASSES, FOCUS, HEAD,
|
|
12
|
+
HOOKS_APP_ID, HTML, ID, INPUT,
|
|
13
|
+
KEY_CODE, OBJECT, ON_HIDE, ON_LOAD,
|
|
14
|
+
ON_READY, ON_SHOW, OPTIONS, PAGE_INIT,
|
|
15
|
+
PROPERTY_THRESHOLD, PROPS, PURE_VIEW, ROOT_STR,
|
|
16
|
+
SET_DATA, SET_TIMEOUT, STATIC_VIEW, STYLE,
|
|
17
|
+
TARGET, TARO_RUNTIME, TIME_STAMP,
|
|
18
|
+
TOUCHMOVE, TYPE, UID, VALUE, VIEW
|
|
19
|
+
} from '@tarojs/runtime/dist/runtime.esm'
|
|
13
20
|
|
|
14
21
|
export const ATTRIBUTES_CALLBACK_TRIGGER_MAP = {
|
|
15
22
|
scrollTop: {
|
|
@@ -3,16 +3,38 @@ export const context: any = {
|
|
|
3
3
|
value: null
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export const uiContext: any = {
|
|
7
|
+
resolver: null,
|
|
8
|
+
value: null
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
export const Current: any = {
|
|
8
12
|
app: null,
|
|
9
|
-
uiContext
|
|
13
|
+
get uiContext () {
|
|
14
|
+
return uiContext.value
|
|
15
|
+
},
|
|
16
|
+
set uiContext (e) {
|
|
17
|
+
uiContext.resolver(e)
|
|
18
|
+
},
|
|
10
19
|
router: {},
|
|
11
20
|
taro: {},
|
|
12
21
|
contextPromise: new Promise(resolve => {
|
|
13
22
|
context.resolver = resolve
|
|
14
23
|
|
|
15
24
|
return resolve
|
|
25
|
+
}).then(e => {
|
|
26
|
+
context.value = e
|
|
27
|
+
|
|
28
|
+
return e
|
|
29
|
+
}),
|
|
30
|
+
uiContextPromise: new Promise(resolve => {
|
|
31
|
+
uiContext.resolver = resolve
|
|
32
|
+
|
|
33
|
+
return resolve
|
|
34
|
+
}).then((e) => {
|
|
35
|
+
uiContext.value = e
|
|
36
|
+
|
|
37
|
+
return e
|
|
16
38
|
}),
|
|
17
39
|
createHarmonyElement: null
|
|
18
40
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { eventSource } from '@tarojs/runtime/dist/runtime.esm'
|
|
2
1
|
import { isUndefined } from '@tarojs/shared'
|
|
3
2
|
|
|
4
3
|
import { Current } from '../current'
|
|
5
4
|
import { findChildNodeWithDFS, getPageScrollerOrNode } from '../utils'
|
|
6
5
|
import { TaroComment } from './comment'
|
|
7
6
|
import { TaroElement } from './element/element'
|
|
7
|
+
import { eventSource } from './event-source'
|
|
8
8
|
import { NodeType, TaroNode, TaroTextNode } from './node'
|
|
9
9
|
|
|
10
10
|
import type { Window } from '../bom/window'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { eventSource
|
|
2
|
-
|
|
1
|
+
import { eventSource } from '../event-source'
|
|
2
|
+
import { TaroNode } from '../node'
|
|
3
3
|
import { TaroElement } from './element'
|
|
4
4
|
|
|
5
5
|
import type { CanvasProps, CanvasTouchEvent } from '@tarojs/components/types'
|
|
6
|
+
import type { TaroAny } from '../../interface'
|
|
6
7
|
|
|
7
8
|
export class CanvasRenderingContext2DWXAdapter extends CanvasRenderingContext2D {
|
|
8
9
|
// constructor(settings?: RenderingContextSetting) {
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import { getPageById } from '@tarojs/plugin-framework-react/dist/runtime'
|
|
3
|
-
import { eventCenter, eventSource } from '@tarojs/runtime/dist/runtime.esm'
|
|
4
3
|
import { EMPTY_OBJ, toCamelCase } from '@tarojs/shared'
|
|
5
4
|
|
|
6
5
|
import { ATTRIBUTES_CALLBACK_TRIGGER_MAP, ID } from '../../constant'
|
|
7
6
|
import { Current } from '../../current'
|
|
7
|
+
import { eventCenter } from '../../emitter/emitter'
|
|
8
8
|
import { findChildNodeWithDFS } from '../../utils'
|
|
9
9
|
import { initComponentNodeInfo, triggerAttributesCallback } from '../../utils/info'
|
|
10
10
|
import { bindAnimation } from '../bind'
|
|
11
11
|
import { ClassList } from '../class-list'
|
|
12
|
-
import {
|
|
12
|
+
import { createCSSStyleDeclaration } from '../cssStyleDeclaration'
|
|
13
|
+
import { eventSource } from '../event-source'
|
|
13
14
|
import { NodeType, TaroNode } from '../node'
|
|
14
15
|
import StyleSheet, { HarmonyStyle, TaroStyleType } from '../stylesheet'
|
|
15
16
|
|
|
16
17
|
import type { BaseTouchEvent, ITouchEvent, StandardProps } from '@tarojs/components/types'
|
|
17
|
-
import type { TaroAny } from '../../
|
|
18
|
+
import type { TaroAny } from '../../interface'
|
|
19
|
+
import type { ICSSStyleDeclaration } from '../cssStyleDeclaration'
|
|
18
20
|
|
|
19
21
|
type NamedNodeMap = { name: string, value: string }[]
|
|
20
22
|
|
|
@@ -91,7 +93,7 @@ export class TaroElement<
|
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
public get id(): string {
|
|
94
|
-
return this.getAttribute('id') || this._nid
|
|
96
|
+
return this.getAttribute('id') || `${this._nid}`
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
public set className(value: string) {
|
|
@@ -338,7 +340,6 @@ export class TaroElement<
|
|
|
338
340
|
public setLayer (value: number) {
|
|
339
341
|
if (!this.parentNode) return // 没有父节点,不需要设置层级关系
|
|
340
342
|
|
|
341
|
-
|
|
342
343
|
const currentPage = getPageById(this.getAttribute('__fixed'))
|
|
343
344
|
if (currentPage) {
|
|
344
345
|
this._page = currentPage
|
|
@@ -56,6 +56,12 @@ class TaroFormWidgetElement<T extends FormWidgetProps = FormWidgetProps> extends
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
public removeAttribute(name: string): void {
|
|
60
|
+
if (name === 'value') {
|
|
61
|
+
this.value = ''
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
public get name () {
|
|
60
66
|
return this._attrs.name || ''
|
|
61
67
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { eventSource } from '@tarojs/runtime/dist/runtime.esm'
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { eventSource } from '@tarojs/runtime/dist/runtime.esm'
|
|
2
|
-
|
|
3
1
|
import TaroDataSourceElement from './dataSource'
|
|
2
|
+
import { eventSource } from './event-source'
|
|
4
3
|
|
|
5
4
|
import type { StandardProps } from '@tarojs/components/types'
|
|
6
|
-
import type { TaroAny } from '../
|
|
5
|
+
import type { TaroAny } from '../interface'
|
|
7
6
|
import type { TaroDocument } from './document'
|
|
8
7
|
import type { TaroElement } from './element/element'
|
|
9
8
|
|
|
@@ -99,7 +98,7 @@ export class TaroNode extends TaroDataSourceElement {
|
|
|
99
98
|
|
|
100
99
|
// 提供唯一标识,方便与小程序一致,能根据uid获取到对应的节点
|
|
101
100
|
public get uid (): string {
|
|
102
|
-
return this._nid
|
|
101
|
+
return `${this._nid}`
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
public get firstChild (): TaroNode | null {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { eventCenter, Events, EventsType } from '@tarojs/runtime/dist/runtime.esm'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { env } from '@tarojs/runtime/dist/runtime.esm'
|
|
@@ -1,18 +1,33 @@
|
|
|
1
|
+
/* eslint-disable simple-import-sort/exports */
|
|
1
2
|
// Current必须放在前面初始化
|
|
2
|
-
// eslint-disable-next-line simple-import-sort/exports
|
|
3
3
|
export * from './current'
|
|
4
|
+
export { hooks } from '@tarojs/shared'
|
|
5
|
+
// bom
|
|
4
6
|
export * from './bom/document'
|
|
5
7
|
export * from './bom/getComputedStyle'
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
+
export * from './bom/history'
|
|
9
|
+
export * from './bom/location'
|
|
10
|
+
export * from './bom/navigator'
|
|
11
|
+
export * from './bom/raf'
|
|
12
|
+
export * from './bom/URL'
|
|
8
13
|
export * from './bom/window'
|
|
14
|
+
// dom
|
|
9
15
|
export * from './dom/element'
|
|
10
16
|
export * from './dom/event'
|
|
17
|
+
export * from './dom/event-source'
|
|
11
18
|
export * from './dom/node'
|
|
12
19
|
export * from './dom/stylesheet'
|
|
13
20
|
export * from './dom/cssNesting'
|
|
14
|
-
|
|
21
|
+
// others
|
|
22
|
+
export * from './env'
|
|
23
|
+
export * from './constant'
|
|
24
|
+
export * from './emitter/emitter'
|
|
15
25
|
export * from './utils'
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
export {
|
|
26
|
+
// typings
|
|
27
|
+
export * from './interface'
|
|
28
|
+
export {
|
|
29
|
+
Instance, PageProps,
|
|
30
|
+
ReactPageComponent, ReactPageInstance, ReactAppInstance,
|
|
31
|
+
PageLifeCycle, PageInstance,
|
|
32
|
+
AppInstance,
|
|
33
|
+
} from '@tarojs/runtime/dist/runtime.esm'
|
|
@@ -1 +1,7 @@
|
|
|
1
1
|
export * from './event'
|
|
2
|
+
export { PageConfig, TFunc } from '@tarojs/runtime/dist/runtime.esm'
|
|
3
|
+
|
|
4
|
+
export type TaroAny = any
|
|
5
|
+
export type TaroFunc = (...args: TaroAny[]) => TaroAny
|
|
6
|
+
export type TaroIndent = string | number | boolean | undefined | null
|
|
7
|
+
export type TaroObject = Record<string | number | symbol, TaroAny>
|
|
@@ -161,9 +161,9 @@ export function findChildNodeWithDFS<T extends TaroElement = TaroElement> (node:
|
|
|
161
161
|
export function findChildNodeWithDFS<T extends TaroElement = TaroElement> (node: TaroElement, selector: string | ((ele: T) => boolean), selectAll): T[] | T | null {
|
|
162
162
|
const queue = [node]
|
|
163
163
|
|
|
164
|
-
const nodeList:
|
|
164
|
+
const nodeList: T[] = []
|
|
165
165
|
while (queue.length) {
|
|
166
|
-
const currentNode = queue.shift()
|
|
166
|
+
const currentNode = queue.shift() as T
|
|
167
167
|
if (currentNode) {
|
|
168
168
|
if (typeof selector === 'string') {
|
|
169
169
|
if (selector.startsWith('#')) {
|
|
@@ -200,7 +200,5 @@ export function findChildNodeWithDFS<T extends TaroElement = TaroElement> (node:
|
|
|
200
200
|
return null
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
export
|
|
204
|
-
export
|
|
205
|
-
export type TaroIndent = string | number | boolean | undefined | null
|
|
206
|
-
export type TaroObject = Record<string | number | symbol, TaroAny>
|
|
203
|
+
export * from './info'
|
|
204
|
+
export * from './router'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Current, document } from '@tarojs/runtime'
|
|
2
|
-
import { eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
1
|
+
import { Current, document, eventCenter } from '@tarojs/runtime'
|
|
3
2
|
|
|
4
3
|
import { setReconciler } from './connect'
|
|
5
4
|
import { injectPageInstance } from './page'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Current, document, requestAnimationFrame, TaroElement, window } from '@tarojs/runtime'
|
|
2
|
-
import { addLeadingSlash, CONTEXT_ACTIONS, env, eventCenter, TFunc } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
1
|
+
import { addLeadingSlash, CONTEXT_ACTIONS, Current, document, env, eventCenter, requestAnimationFrame, TaroElement, TFunc, window } from '@tarojs/runtime'
|
|
3
2
|
import { ensure, hooks, isUndefined } from '@tarojs/shared'
|
|
4
3
|
|
|
5
4
|
import { ReactMeta as reactMeta } from './app'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Current, document, requestAnimationFrame, window } from '@tarojs/runtime'
|
|
2
|
-
import { addLeadingSlash, CONTEXT_ACTIONS, env, eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
1
|
+
import { addLeadingSlash, CONTEXT_ACTIONS, Current, document, env, eventCenter, requestAnimationFrame, window } from '@tarojs/runtime'
|
|
3
2
|
import { hooks, isArray, isFunction, isUndefined } from '@tarojs/shared'
|
|
4
3
|
|
|
5
4
|
import { ON_HIDE, ON_LOAD, ON_READY, ON_SHOW, ON_UNLOAD } from './constant'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createComponent, h, render } from '@tarojs/plugin-framework-solid/dist/reconciler'
|
|
2
|
-
import { Current, document } from '@tarojs/runtime'
|
|
3
|
-
import { eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
2
|
+
import { Current, document, eventCenter } from '@tarojs/runtime'
|
|
4
3
|
import { hooks } from '@tarojs/shared'
|
|
5
4
|
import { batch, createContext, createRoot, createSignal, For } from 'solid-js'
|
|
6
5
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Current, document, requestAnimationFrame, window } from '@tarojs/runtime'
|
|
2
|
-
import { addLeadingSlash, CONTEXT_ACTIONS, env, eventCenter } from '@tarojs/runtime/dist/runtime.esm' // eslint-disable-line import/no-duplicates
|
|
1
|
+
import { addLeadingSlash, CONTEXT_ACTIONS, Current, document, env, eventCenter, requestAnimationFrame, window } from '@tarojs/runtime'
|
|
3
2
|
import { hooks, isArray, isFunction, isUndefined } from '@tarojs/shared'
|
|
4
3
|
|
|
5
4
|
import { ON_HIDE, ON_LOAD, ON_READY, ON_SHOW, ON_UNLOAD } from './constant'
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { convertNumber2PX, FormElement } from '@tarojs/runtime'
|
|
2
|
-
import { capitalize, internalComponents, isFunction, isNumber, isObject, isString, toCamelCase } from '@tarojs/shared'
|
|
2
|
+
import { capitalize, internalComponents, isFunction, isNumber, isObject, isString, PLATFORM_TYPE, toCamelCase } from '@tarojs/shared'
|
|
3
3
|
|
|
4
4
|
import type { Style, TaroElement } from '@tarojs/runtime'
|
|
5
5
|
|
|
6
6
|
export type Props = Record<string, unknown>
|
|
7
7
|
|
|
8
|
-
const isHarmony = process.env.TARO_PLATFORM === 'harmony'
|
|
9
8
|
const IS_NON_DIMENSIONAL = /max|aspect|acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i
|
|
10
9
|
|
|
11
10
|
function isEventName (s: string) {
|
|
@@ -64,16 +63,16 @@ function setEvent (dom: TaroElement, name: string, value: unknown, oldValue?: un
|
|
|
64
63
|
|
|
65
64
|
const compName = capitalize(toCamelCase(dom.tagName.toLowerCase()))
|
|
66
65
|
|
|
67
|
-
if (eventName === 'click' &&
|
|
66
|
+
if (eventName === 'click' && process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY && compName in internalComponents) {
|
|
68
67
|
eventName = 'tap'
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
if (isFunction(value)) {
|
|
72
71
|
if (oldValue) {
|
|
73
|
-
dom.removeEventListener(eventName, oldValue as any,
|
|
74
|
-
dom.addEventListener(eventName, value,
|
|
72
|
+
dom.removeEventListener(eventName, oldValue as any, process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY ? false : undefined)
|
|
73
|
+
dom.addEventListener(eventName, value, process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY ? { isCapture, sideEffect: false } : undefined)
|
|
75
74
|
} else {
|
|
76
|
-
dom.addEventListener(eventName, value,
|
|
75
|
+
dom.addEventListener(eventName, value, process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY ? isCapture : undefined)
|
|
77
76
|
}
|
|
78
77
|
} else {
|
|
79
78
|
dom.removeEventListener(eventName, oldValue as any)
|
|
@@ -81,13 +80,13 @@ function setEvent (dom: TaroElement, name: string, value: unknown, oldValue?: un
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
function setStyle (style: Style, key: string, value: unknown) {
|
|
84
|
-
if (key[0] === '-' &&
|
|
83
|
+
if (key[0] === '-' && process.env.TARO_PLATFORM !== PLATFORM_TYPE.HARMONY) {
|
|
85
84
|
// css variables need not further judgment
|
|
86
85
|
style.setProperty(key, (value as string).toString())
|
|
87
86
|
return
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
if (
|
|
89
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY && key.startsWith('_')) {
|
|
91
90
|
// harmony样式已处理
|
|
92
91
|
style[key] = value == null ? '' : value
|
|
93
92
|
} else {
|
|
@@ -145,7 +144,7 @@ export function setProperty (dom: TaroElement, name: string, value: unknown, old
|
|
|
145
144
|
for (const i in oldValue) {
|
|
146
145
|
if (!(value && i in (value as StyleValue))) {
|
|
147
146
|
// 鸿蒙伪类特殊处理
|
|
148
|
-
if (
|
|
147
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY && (i === '::after' || i === '::before')) {
|
|
149
148
|
setPseudo(dom, i, null)
|
|
150
149
|
} else {
|
|
151
150
|
style[i] = ''
|
|
@@ -157,7 +156,7 @@ export function setProperty (dom: TaroElement, name: string, value: unknown, old
|
|
|
157
156
|
for (const i in value) {
|
|
158
157
|
if (!oldValue || !isEqual(value[i], (oldValue as StyleValue)[i])) {
|
|
159
158
|
// 鸿蒙伪类特殊处理
|
|
160
|
-
if (
|
|
159
|
+
if (process.env.TARO_PLATFORM === PLATFORM_TYPE.HARMONY && (i === '::after' || i === '::before')) {
|
|
161
160
|
setPseudo(dom, i, value[i] as unknown as StyleValue)
|
|
162
161
|
} else {
|
|
163
162
|
style[i] = value[i]
|
package/dist/runtime-utils.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { TFunc } from "@tarojs/runtime";
|
|
1
2
|
import Taro from "@tarojs/taro/types";
|
|
2
|
-
import Taro$0 from "@tarojs/taro";
|
|
3
3
|
declare namespace apis {
|
|
4
4
|
interface ICallbackResult {
|
|
5
5
|
/** 错误信息 */
|
|
6
6
|
errMsg: string;
|
|
7
7
|
}
|
|
8
|
-
type TFunc = (...args: any[]) => any;
|
|
9
8
|
type TCallback<T = Partial<ICallbackResult>> = (res: T) => Promise<void> | void;
|
|
10
9
|
interface IMethodParam<T = Partial<ICallbackResult>> {
|
|
11
10
|
name: string;
|
|
@@ -380,7 +379,7 @@ declare namespace apis {
|
|
|
380
379
|
const navigateBackMiniProgram: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
381
380
|
const exitMiniProgram: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
382
381
|
const openBusinessView: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
383
|
-
const downloadFile: typeof Taro
|
|
382
|
+
const downloadFile: typeof Taro.downloadFile;
|
|
384
383
|
const stopLocalServiceDiscovery: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
385
384
|
const startLocalServiceDiscovery: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
386
385
|
const onLocalServiceResolveFail: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
@@ -397,7 +396,7 @@ declare namespace apis {
|
|
|
397
396
|
const createUDPSocket: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
398
397
|
// wx 只支持 HTTP POST 请求,OHOS 支持 POST 和 PUT 请求
|
|
399
398
|
// OHOS 不支持 wx 的 timeout,但是支持 file 文件列表上传,wx 是单文件上传
|
|
400
|
-
const uploadFile: typeof Taro
|
|
399
|
+
const uploadFile: typeof Taro.uploadFile;
|
|
401
400
|
const connectSocket: typeof Taro.connectSocket;
|
|
402
401
|
const getAccountInfoSync: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
403
402
|
const chooseAddress: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
@@ -581,7 +580,7 @@ declare namespace apis {
|
|
|
581
580
|
}
|
|
582
581
|
const createAnimation: (option: Taro.createAnimation.Option) => Animation;
|
|
583
582
|
const setBackgroundTextStyle: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
|
584
|
-
function setBackgroundColor(options: Taro
|
|
583
|
+
function setBackgroundColor(options: Taro.setBackgroundColor.Option): Promise<unknown>;
|
|
585
584
|
// 自定义组件
|
|
586
585
|
const nextTick: typeof Taro.nextTick;
|
|
587
586
|
const loadFontFace: (option?: {}, ...args: any[]) => Promise<Partial<ICallbackResult> & Record<string, unknown> & ICallbackResult>;
|
package/dist/runtime-utils.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { isFunction, isString, isArray, isObject, isNull, isNumber, isUndefined, queryToJson, PLATFORM_TYPE, singleQuote, internalComponents } from '@tarojs/shared';
|
|
2
2
|
import _display from '@ohos.display';
|
|
3
|
-
import { Current, window, eventSource, hooks, document as document$1, getPageScrollerOrNode, findChildNodeWithDFS, setNodeEventCallbackAndTriggerComponentUpdate, AREA_CHANGE_EVENT_NAME, disconnectEvent, VISIBLE_CHANGE_EVENT_NAME, getCurrentInstance } from '@tarojs/runtime';
|
|
3
|
+
import { eventCenter, Current, window, eventSource, hooks, document as document$1, getPageScrollerOrNode, findChildNodeWithDFS, setNodeEventCallbackAndTriggerComponentUpdate, AREA_CHANGE_EVENT_NAME, disconnectEvent, VISIBLE_CHANGE_EVENT_NAME, Events, History, getCurrentInstance } from '@tarojs/runtime';
|
|
4
4
|
import '@ohos.abilityAccessCtrl';
|
|
5
|
-
import { eventCenter, Events, History } from '@tarojs/runtime/dist/runtime.esm';
|
|
6
5
|
import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant';
|
|
7
6
|
import deviceInfo from '@ohos.deviceInfo';
|
|
8
7
|
import i18n from '@ohos.i18n';
|