@tarojs/plugin-platform-harmony-ets 4.0.8-beta.0 → 4.0.8-beta.3
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/apis.d.ts +19 -0
- package/dist/apis/base/crypto.d.ts +1 -0
- package/dist/apis/base/debug.d.ts +3 -0
- package/dist/apis/base/index.d.ts +10 -0
- package/dist/apis/base/performance.d.ts +5 -0
- package/dist/apis/base/system.d.ts +3 -0
- package/dist/apis/base/update.d.ts +2 -0
- package/dist/apis/base/weapp/app-event.d.ts +19 -0
- package/dist/apis/base/weapp/life-cycle.d.ts +3 -0
- package/dist/apis/canvas/index.d.ts +10 -0
- package/dist/apis/data-analysis/index.d.ts +4 -0
- package/dist/apis/device/accelerometer.d.ts +17 -0
- package/dist/apis/device/accessibility.d.ts +1 -0
- package/dist/apis/device/battery.d.ts +3 -0
- package/dist/apis/device/bluetooth-ble.d.ts +16 -0
- package/dist/apis/device/bluetooth-peripheral.d.ts +3 -0
- package/dist/apis/device/bluetooth.d.ts +13 -0
- package/dist/apis/device/calendar.d.ts +2 -0
- package/dist/apis/device/clipboard.d.ts +9 -0
- package/dist/apis/device/compass.d.ts +16 -0
- package/dist/apis/device/contact.d.ts +2 -0
- package/dist/apis/device/crypto.d.ts +1 -0
- package/dist/apis/device/gyroscope.d.ts +4 -0
- package/dist/apis/device/iBeacon.d.ts +7 -0
- package/dist/apis/device/index.d.ts +24 -0
- package/dist/apis/device/keyboard.d.ts +5 -0
- package/dist/apis/device/memory.d.ts +2 -0
- package/dist/apis/device/motion.d.ts +4 -0
- package/dist/apis/device/network.d.ts +14 -0
- package/dist/apis/device/nfc.d.ts +7 -0
- package/dist/apis/device/phone.d.ts +2 -0
- package/dist/apis/device/scan.d.ts +1 -0
- package/dist/apis/device/screen.d.ts +10 -0
- package/dist/apis/device/sms.d.ts +1 -0
- package/dist/apis/device/vibrate.d.ts +3 -0
- package/dist/apis/device/wifi.d.ts +12 -0
- package/dist/apis/ext/index.d.ts +2 -0
- package/dist/apis/files/index.d.ts +32 -0
- package/dist/apis/files/manager.d.ts +28 -0
- package/dist/apis/framework/index.d.ts +18 -0
- package/dist/apis/index.d.ts +22 -0
- package/dist/apis/location/index.d.ts +13 -0
- package/dist/apis/media/EditorContext.d.ts +16 -0
- package/dist/apis/media/audio/index.d.ts +12 -0
- package/dist/apis/media/background-audio/index.d.ts +12 -0
- package/dist/apis/media/camera.d.ts +2 -0
- package/dist/apis/media/common.d.ts +3 -0
- package/dist/apis/media/image/index.d.ts +6 -0
- package/dist/apis/media/index.d.ts +13 -0
- package/dist/apis/media/live.d.ts +2 -0
- package/dist/apis/media/map.d.ts +1 -0
- package/dist/apis/media/media-recorder.d.ts +1 -0
- package/dist/apis/media/recorder.d.ts +3 -0
- package/dist/apis/media/video/index.d.ts +7 -0
- package/dist/apis/media/video-decoder.d.ts +1 -0
- package/dist/apis/media/video-processing.d.ts +1 -0
- package/dist/apis/media/voip.d.ts +16 -0
- package/dist/apis/navigate/index.d.ts +5 -0
- package/dist/apis/network/downloadFile.d.ts +2 -0
- package/dist/apis/network/index.d.ts +7 -0
- package/dist/apis/network/mdns.d.ts +10 -0
- package/dist/apis/network/request.d.ts +2 -0
- package/dist/apis/network/tcp.d.ts +1 -0
- package/dist/apis/network/udp.d.ts +1 -0
- package/dist/apis/network/uploadFile.d.ts +2 -0
- package/dist/apis/network/webSocket.d.ts +2 -0
- package/dist/apis/open-api/account.d.ts +1 -0
- package/dist/apis/open-api/address.d.ts +1 -0
- package/dist/apis/open-api/authorize.d.ts +2 -0
- package/dist/apis/open-api/card.d.ts +2 -0
- package/dist/apis/open-api/channels-live.d.ts +8 -0
- package/dist/apis/open-api/customer-service.d.ts +1 -0
- package/dist/apis/open-api/device-voip.d.ts +2 -0
- package/dist/apis/open-api/facial.d.ts +4 -0
- package/dist/apis/open-api/favorites.d.ts +2 -0
- package/dist/apis/open-api/group.d.ts +1 -0
- package/dist/apis/open-api/index.d.ts +21 -0
- package/dist/apis/open-api/invoice.d.ts +2 -0
- package/dist/apis/open-api/license-plate.d.ts +1 -0
- package/dist/apis/open-api/login.d.ts +3 -0
- package/dist/apis/open-api/my-miniprogram.d.ts +1 -0
- package/dist/apis/open-api/privacy.d.ts +4 -0
- package/dist/apis/open-api/red-package.d.ts +1 -0
- package/dist/apis/open-api/settings.d.ts +2 -0
- package/dist/apis/open-api/soter.d.ts +3 -0
- package/dist/apis/open-api/subscribe-message.d.ts +2 -0
- package/dist/apis/open-api/user-info.d.ts +15 -0
- package/dist/apis/open-api/werun.d.ts +2 -0
- package/dist/apis/payment/index.d.ts +3 -0
- package/dist/apis/route/index.d.ts +10 -0
- package/dist/apis/share/index.d.ts +20 -0
- package/dist/apis/storage/background-fetch.d.ts +4 -0
- package/dist/apis/storage/cache-manager.d.ts +1 -0
- package/dist/apis/storage/index.d.ts +19 -0
- package/dist/apis/ui/animation/animation.d.ts +56 -0
- package/dist/apis/ui/animation/index.d.ts +3 -0
- package/dist/apis/ui/background.d.ts +2 -0
- package/dist/apis/ui/custom-component.d.ts +2 -0
- package/dist/apis/ui/fonts.d.ts +1 -0
- package/dist/apis/ui/index.d.ts +12 -0
- package/dist/apis/ui/interaction/index.d.ts +8 -0
- package/dist/apis/ui/menu.d.ts +1 -0
- package/dist/apis/ui/navigation-bar/index.d.ts +6 -0
- package/dist/apis/ui/pull-down-refresh.d.ts +3 -0
- package/dist/apis/ui/scroll/index.d.ts +5 -0
- package/dist/apis/ui/sticky.d.ts +1 -0
- package/dist/apis/ui/tab-bar.d.ts +9 -0
- package/dist/apis/ui/window.d.ts +14 -0
- package/dist/apis/utils/handler.d.ts +46 -0
- package/dist/apis/utils/index.d.ts +17 -0
- package/dist/apis/utils/permissions.d.ts +5 -0
- package/dist/apis/utils/types.d.ts +11 -0
- package/dist/apis/utils/validate.d.ts +39 -0
- package/dist/apis/worker/index.d.ts +1 -0
- package/dist/apis/wxml/IntersectionObserver.d.ts +12 -0
- package/dist/apis/wxml/index.d.ts +7 -0
- package/dist/apis/wxml/nodesRef.d.ts +14 -0
- package/dist/apis/wxml/selectorQuery.d.ts +39 -0
- package/dist/components/components-harmony-ets/tag.d.ts +53 -0
- package/dist/components/components-harmony-ets/utils/DynamicCenter.d.ts +7 -0
- package/dist/components/components-harmony-ets/utils/events.d.ts +3 -0
- package/dist/components/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.d.ts +11 -0
- package/dist/components/components-harmony-ets/utils/htmlParser/index.d.ts +3 -0
- package/dist/components/components-harmony-ets/utils/index.d.ts +11 -0
- package/dist/components/components-react.d.ts +7 -0
- package/dist/components/components-react.js +2 -41
- package/dist/components/components-react.js.map +1 -1
- package/dist/components/index.d.ts +119 -0
- package/dist/index.d.ts +6 -148
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/dist/program/arkTS.d.ts +40 -0
- package/dist/program/harmony.d.ts +36 -0
- package/dist/program/jsUI.d.ts +60 -0
- package/dist/runtime-ets/bom/URL.d.ts +2 -0
- package/dist/runtime-ets/bom/document.d.ts +2 -0
- package/dist/runtime-ets/bom/getComputedStyle.d.ts +1 -0
- package/dist/runtime-ets/bom/history.d.ts +1 -0
- package/dist/runtime-ets/bom/location.d.ts +1 -0
- package/dist/runtime-ets/bom/navigator.d.ts +1 -0
- package/dist/runtime-ets/bom/raf.d.ts +1 -0
- package/dist/runtime-ets/bom/window.d.ts +20 -0
- package/dist/runtime-ets/constant.d.ts +17 -0
- package/dist/runtime-ets/current.d.ts +4 -0
- package/dist/runtime-ets/dom/bind.d.ts +4 -0
- package/dist/runtime-ets/dom/class-list.d.ts +15 -0
- package/dist/runtime-ets/dom/comment.d.ts +5 -0
- package/dist/runtime-ets/dom/cssNesting.d.ts +7 -0
- package/dist/runtime-ets/dom/cssStyleDeclaration.d.ts +14 -0
- package/dist/runtime-ets/dom/document.d.ts +20 -0
- package/dist/runtime-ets/dom/element/element.ts +49 -42
- package/dist/runtime-ets/dom/element/index.d.ts +14 -0
- package/dist/runtime-ets/dom/element/movableArea.d.ts +5 -0
- package/dist/runtime-ets/dom/element/progress.d.ts +5 -0
- package/dist/runtime-ets/dom/element/text.d.ts +5 -0
- package/dist/runtime-ets/dom/element/webView.d.ts +15 -0
- package/dist/runtime-ets/dom/event-source.d.ts +1 -0
- package/dist/runtime-ets/dom/event.d.ts +24 -0
- package/dist/runtime-ets/dom/eventTarget.d.ts +17 -0
- package/dist/runtime-ets/dom/node.d.ts +62 -0
- package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.d.ts +3 -0
- package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +1 -0
- package/dist/runtime-ets/dom/stylesheet/index.d.ts +83 -0
- package/dist/runtime-ets/emitter/emitter.d.ts +1 -0
- package/dist/runtime-ets/env.d.ts +1 -0
- package/dist/runtime-ets/index.d.ts +22 -0
- package/dist/runtime-ets/interface/event.d.ts +9 -0
- package/dist/runtime-ets/interface/index.d.ts +6 -0
- package/dist/runtime-ets/utils/index.d.ts +26 -0
- package/dist/runtime-ets/utils/info.d.ts +11 -0
- package/dist/runtime-ets/utils/router.d.ts +1 -0
- package/dist/runtime-framework/react/app.d.ts +12 -0
- package/dist/runtime-framework/react/connect.d.ts +1 -0
- package/dist/runtime-framework/react/constant.d.ts +5 -0
- package/dist/runtime-framework/react/hooks.d.ts +31 -0
- package/dist/runtime-framework/react/hooks.ts +1 -0
- package/dist/runtime-framework/react/index.d.ts +5 -0
- package/dist/runtime-framework/react/native-page.d.ts +8 -0
- package/dist/runtime-framework/react/native-page.ts +6 -6
- package/dist/runtime-framework/react/page.d.ts +13 -0
- package/dist/runtime-framework/react/utils/index.d.ts +7 -0
- package/dist/runtime-framework/react/utils/is.d.ts +10 -0
- package/dist/runtime-framework/solid/app.d.ts +10 -0
- package/dist/runtime-framework/solid/connect.d.ts +4 -0
- package/dist/runtime-framework/solid/constant.d.ts +5 -0
- package/dist/runtime-framework/solid/hooks.d.ts +31 -0
- package/dist/runtime-framework/solid/hooks.ts +1 -0
- package/dist/runtime-framework/solid/index.d.ts +4 -0
- package/dist/runtime-framework/solid/page.d.ts +13 -0
- package/dist/runtime-framework/solid/reconciler/h.d.ts +8 -0
- package/dist/runtime-framework/solid/reconciler/index.d.ts +3 -0
- package/dist/runtime-framework/solid/reconciler/props.d.ts +7 -0
- package/dist/runtime-framework/solid/reconciler/props.ts +1 -1
- package/dist/runtime-framework/solid/reconciler/render.d.ts +16 -0
- package/dist/runtime-framework/solid/reconciler/use.d.ts +1 -0
- package/dist/runtime-framework/solid/utils/index.d.ts +16 -0
- package/dist/runtime-framework/solid/utils/is.d.ts +10 -0
- package/dist/runtime-utils.d.ts +4 -818
- package/dist/runtime-utils.js +394 -394
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +394 -394
- package/dist/runtime.js.map +1 -1
- package/dist/template.d.ts +43 -0
- package/dist/utils/api-loader.d.ts +1 -0
- package/dist/utils/constants.d.ts +4 -0
- package/dist/utils/index.d.ts +3 -0
- package/package.json +13 -12
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
export type NestingStyle = {
|
|
3
|
+
node: ReactElement;
|
|
4
|
+
selectors: string[];
|
|
5
|
+
declaration: Record<string, any>;
|
|
6
|
+
}[];
|
|
7
|
+
export declare function __combine_nesting_style__(react_tree: ReactElement, styles?: NestingStyle | null): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TaroElement } from './element/element';
|
|
2
|
+
declare class CSSStyleDeclaration {
|
|
3
|
+
el: TaroElement;
|
|
4
|
+
constructor(el: TaroElement);
|
|
5
|
+
get _st(): import("./stylesheet").default;
|
|
6
|
+
get cssText(): string;
|
|
7
|
+
set cssText(value: string);
|
|
8
|
+
setProperty(prop: string, value: any): void;
|
|
9
|
+
getPropertyValue(prop: string): string | number;
|
|
10
|
+
removeProperty(prop: string): string | number;
|
|
11
|
+
}
|
|
12
|
+
type ICSSStyleDeclaration = CSSStyleDeclaration & Record<string, any>;
|
|
13
|
+
declare function createCSSStyleDeclaration(node: TaroElement): CSSStyleDeclaration;
|
|
14
|
+
export { createCSSStyleDeclaration, CSSStyleDeclaration, ICSSStyleDeclaration };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TaroComment } from './comment';
|
|
2
|
+
import { TaroElement } from './element/element';
|
|
3
|
+
import { TaroNode, TaroTextNode } from './node';
|
|
4
|
+
import type { Window } from '../bom/window';
|
|
5
|
+
declare class TaroDocument extends TaroNode {
|
|
6
|
+
documentElement: TaroElement;
|
|
7
|
+
head: TaroElement;
|
|
8
|
+
body: TaroElement;
|
|
9
|
+
cookie: string;
|
|
10
|
+
private _win;
|
|
11
|
+
constructor(window: Window);
|
|
12
|
+
get defaultView(): Window;
|
|
13
|
+
createElement(tagName: string): TaroElement;
|
|
14
|
+
createTextNode(value: string): TaroTextNode;
|
|
15
|
+
createComment(data: string): TaroComment;
|
|
16
|
+
getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
|
|
17
|
+
querySelector(selectors: string): TaroElement | null;
|
|
18
|
+
querySelectorAll(selectors: string): TaroElement[];
|
|
19
|
+
}
|
|
20
|
+
export { TaroDocument };
|
|
@@ -33,14 +33,13 @@ export class TaroElement<
|
|
|
33
33
|
> extends TaroNode {
|
|
34
34
|
public _innerHTML = ''
|
|
35
35
|
public _nodeInfo: TaroAny = {
|
|
36
|
-
layer: 0 // 渲染层级
|
|
36
|
+
layer: 0, // 渲染层级
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
public _hm_instance: TaroAny
|
|
40
40
|
public weak_hm_instance: WeakRef<TaroAny>
|
|
41
41
|
public use_weak_hm_instance: boolean = true
|
|
42
42
|
|
|
43
|
-
|
|
44
43
|
public get hm_instance(): TaroAny {
|
|
45
44
|
if (this.use_weak_hm_instance && this.weak_hm_instance) {
|
|
46
45
|
return this.weak_hm_instance?.deref()
|
|
@@ -56,17 +55,16 @@ export class TaroElement<
|
|
|
56
55
|
this._hm_instance = instance
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
public get _instance () {
|
|
58
|
+
public get _instance() {
|
|
61
59
|
return this.hm_instance
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
public set _instance
|
|
62
|
+
public set _instance(value) {
|
|
65
63
|
this.hm_instance = value
|
|
66
64
|
if (this._nodeInfo.aboutToAppear) {
|
|
67
65
|
let task
|
|
68
66
|
// eslint-disable-next-line no-cond-assign
|
|
69
|
-
while (task = this._nodeInfo.aboutToAppear.shift()) {
|
|
67
|
+
while ((task = this._nodeInfo.aboutToAppear.shift())) {
|
|
70
68
|
task()
|
|
71
69
|
}
|
|
72
70
|
}
|
|
@@ -159,7 +157,7 @@ export class TaroElement<
|
|
|
159
157
|
id: this._nid,
|
|
160
158
|
tagName: this.tagName,
|
|
161
159
|
attribute: name,
|
|
162
|
-
value
|
|
160
|
+
value,
|
|
163
161
|
})
|
|
164
162
|
} else {
|
|
165
163
|
const attributeTriggerValue: TaroAny = ATTRIBUTES_CALLBACK_TRIGGER_MAP[name]
|
|
@@ -266,7 +264,7 @@ export class TaroElement<
|
|
|
266
264
|
if (!this._pseudo_before) {
|
|
267
265
|
this._pseudo_before = new StyleSheet()
|
|
268
266
|
}
|
|
269
|
-
Object.keys(value).forEach(key => {
|
|
267
|
+
Object.keys(value).forEach((key) => {
|
|
270
268
|
this._pseudo_before!.hmStyle[key] = value[key]
|
|
271
269
|
})
|
|
272
270
|
} else {
|
|
@@ -281,7 +279,7 @@ export class TaroElement<
|
|
|
281
279
|
if (!this._pseudo_after) {
|
|
282
280
|
this._pseudo_after = new StyleSheet()
|
|
283
281
|
}
|
|
284
|
-
Object.keys(value).forEach(key => {
|
|
282
|
+
Object.keys(value).forEach((key) => {
|
|
285
283
|
this._pseudo_after!.hmStyle[key] = value[key]
|
|
286
284
|
})
|
|
287
285
|
} else {
|
|
@@ -299,7 +297,7 @@ export class TaroElement<
|
|
|
299
297
|
if (!this._pseudo_class[name]) {
|
|
300
298
|
this._pseudo_class[name] = new StyleSheet()
|
|
301
299
|
}
|
|
302
|
-
Object.keys(value).forEach(key => {
|
|
300
|
+
Object.keys(value).forEach((key) => {
|
|
303
301
|
this._pseudo_class[name]!.hmStyle[key] = value[key]
|
|
304
302
|
})
|
|
305
303
|
} else {
|
|
@@ -307,7 +305,7 @@ export class TaroElement<
|
|
|
307
305
|
}
|
|
308
306
|
}
|
|
309
307
|
|
|
310
|
-
get currentLayerNode
|
|
308
|
+
get currentLayerNode() {
|
|
311
309
|
if (!this._page) return null
|
|
312
310
|
if (typeof this._page.tabBarCurrentIndex !== 'undefined') {
|
|
313
311
|
this._page.layerNode ||= []
|
|
@@ -320,7 +318,7 @@ export class TaroElement<
|
|
|
320
318
|
}
|
|
321
319
|
}
|
|
322
320
|
|
|
323
|
-
get currentLayerParents
|
|
321
|
+
get currentLayerParents() {
|
|
324
322
|
if (!this._page) return null
|
|
325
323
|
if (typeof this._page.tabBarCurrentIndex !== 'undefined') {
|
|
326
324
|
this._page.layerParents ||= {}
|
|
@@ -337,7 +335,7 @@ export class TaroElement<
|
|
|
337
335
|
// 1、appendChild的时候会判断是否需要设置层级
|
|
338
336
|
// 2、taro-react的setProperty,在处理属性变化的时候,会判断是否需要设置层级
|
|
339
337
|
// 3、removeChild的时候,会判断是否需要移除层级
|
|
340
|
-
public setLayer
|
|
338
|
+
public setLayer(value: number) {
|
|
341
339
|
if (!this.parentNode) return // 没有父节点,不需要设置层级关系
|
|
342
340
|
|
|
343
341
|
const currentPage = getPageById(this.getAttribute('__fixed'))
|
|
@@ -359,7 +357,7 @@ export class TaroElement<
|
|
|
359
357
|
generateLayerParentIds(_parentRecord, this)
|
|
360
358
|
currentLayerParents[this.getStrNid()] = _parentRecord
|
|
361
359
|
} else {
|
|
362
|
-
const idx = currentLayerNode.childNodes.findIndex(n => n.getStrNid() === this.getStrNid())
|
|
360
|
+
const idx = currentLayerNode.childNodes.findIndex((n) => n.getStrNid() === this.getStrNid())
|
|
363
361
|
currentLayerNode.childNodes.splice(idx, 1)
|
|
364
362
|
currentLayerNode.notifyDataDelete(idx)
|
|
365
363
|
|
|
@@ -385,7 +383,7 @@ export class TaroElement<
|
|
|
385
383
|
delete currentLayerParents[this.getStrNid()]
|
|
386
384
|
this.setLayer(0)
|
|
387
385
|
} else {
|
|
388
|
-
Object.keys(currentLayerParents).forEach(fixedId => {
|
|
386
|
+
Object.keys(currentLayerParents).forEach((fixedId) => {
|
|
389
387
|
const parentIds = currentLayerParents[fixedId]
|
|
390
388
|
if (parentIds[this.getStrNid()]) {
|
|
391
389
|
// 需要移除fixedId
|
|
@@ -401,7 +399,7 @@ export class TaroElement<
|
|
|
401
399
|
}
|
|
402
400
|
|
|
403
401
|
// 设置动画
|
|
404
|
-
public setAnimation
|
|
402
|
+
public setAnimation(playing) {
|
|
405
403
|
if (!this._instance) {
|
|
406
404
|
if (!this._nodeInfo.aboutToAppear) {
|
|
407
405
|
this._nodeInfo.aboutToAppear = []
|
|
@@ -436,41 +434,50 @@ export class TaroElement<
|
|
|
436
434
|
this.parentNode.notifyDataDelete(idx)
|
|
437
435
|
|
|
438
436
|
// 下一帧播放,等实例被移除掉,再重新插入
|
|
439
|
-
setTimeout(
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
437
|
+
setTimeout(
|
|
438
|
+
() => {
|
|
439
|
+
// insert
|
|
440
|
+
this.parentNode?.childNodes.splice(idx, 0, this)
|
|
441
|
+
this.parentNode?.notifyDataAdd(idx)
|
|
442
|
+
|
|
443
|
+
// 执行动画
|
|
444
|
+
if (playing) {
|
|
445
|
+
this.playAnimation()
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
playing ? 0 : 100
|
|
449
|
+
)
|
|
449
450
|
}
|
|
450
451
|
}
|
|
451
452
|
|
|
452
|
-
private playAnimation
|
|
453
|
+
private playAnimation() {
|
|
453
454
|
const {
|
|
454
|
-
animationDuration = 0,
|
|
455
|
-
|
|
455
|
+
animationDuration = 0,
|
|
456
|
+
animationDelay = 0,
|
|
457
|
+
animationIterationCount = 1,
|
|
458
|
+
animationName: keyframes,
|
|
459
|
+
animationTimingFunction,
|
|
456
460
|
} = this._st.hmStyle
|
|
457
461
|
|
|
458
462
|
if (keyframes) {
|
|
459
463
|
let cur_percentage = 0
|
|
460
|
-
this._instance.getUIContext()?.keyframeAnimateTo(
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
464
|
+
this._instance.getUIContext()?.keyframeAnimateTo(
|
|
465
|
+
{
|
|
466
|
+
delay: animationDelay,
|
|
467
|
+
iterations: animationIterationCount,
|
|
468
|
+
},
|
|
469
|
+
keyframes.map((item) => {
|
|
470
|
+
const duration = (item.percentage - cur_percentage) * animationDuration
|
|
471
|
+
cur_percentage = item.percentage
|
|
472
|
+
return {
|
|
473
|
+
duration: duration,
|
|
474
|
+
curve: item.event.animationTimingFunction || animationTimingFunction,
|
|
475
|
+
event: () => {
|
|
476
|
+
this._instance.overwriteStyle = item.event
|
|
477
|
+
},
|
|
471
478
|
}
|
|
472
|
-
}
|
|
473
|
-
|
|
479
|
+
})
|
|
480
|
+
)
|
|
474
481
|
}
|
|
475
482
|
}
|
|
476
483
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TaroCanvasElement } from './canvas';
|
|
2
|
+
import { TaroElement } from './element';
|
|
3
|
+
import { FormElement, TaroCheckboxElement, TaroCheckboxGroupElement, TaroFormElement, TaroInputElement, TaroPickerElement, TaroRadioElement, TaroRadioGroupElement, TaroSliderElement, TaroSwitchElement, TaroTextAreaElement } from './form';
|
|
4
|
+
import { TaroMovableAreaElement } from './movableArea';
|
|
5
|
+
import { isTaroMovableViewElement, TaroMovableViewElement } from './movableView';
|
|
6
|
+
import { TaroButtonElement, TaroIconElement, TaroImageElement, TaroLabelElement, TaroNavigationBarElement, TaroOtherElement, TaroPageMetaElement, TaroRichTextElement, TaroSwiperElement, TaroSwiperItemElement, TaroViewElement } from './normal';
|
|
7
|
+
import { TaroProgressElement } from './progress';
|
|
8
|
+
import { TaroScrollViewElement } from './scrollView';
|
|
9
|
+
import { TaroTextElement } from './text';
|
|
10
|
+
import { TaroVideoElement } from './video';
|
|
11
|
+
import { TaroInnerHtmlElement, TaroWebViewElement } from './webView';
|
|
12
|
+
export declare function initHarmonyElement(): void;
|
|
13
|
+
export { FormElement, TaroButtonElement, TaroCanvasElement, TaroCheckboxElement, TaroCheckboxGroupElement, TaroElement, TaroFormElement, TaroIconElement, TaroImageElement, TaroInnerHtmlElement, TaroInputElement, TaroLabelElement, TaroMovableAreaElement, TaroMovableViewElement, TaroNavigationBarElement, TaroOtherElement, TaroPageMetaElement, TaroPickerElement, TaroProgressElement, TaroRadioElement, TaroRadioGroupElement, TaroRichTextElement, TaroScrollViewElement, TaroSliderElement, TaroSwiperElement, TaroSwiperItemElement, TaroSwitchElement, TaroTextAreaElement, TaroTextElement, TaroVideoElement, TaroViewElement, TaroWebViewElement };
|
|
14
|
+
export { isTaroMovableViewElement };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import web_webview from '@ohos.web.webview';
|
|
2
|
+
import { TaroElement } from './element';
|
|
3
|
+
import type { WebViewProps } from '@tarojs/components/types';
|
|
4
|
+
export declare class TaroInnerHtmlElement extends TaroElement {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare class TaroWebViewElement extends TaroElement<WebViewProps> {
|
|
8
|
+
ports: web_webview.WebMessagePort[];
|
|
9
|
+
nativePort: web_webview.WebMessagePort | null;
|
|
10
|
+
message: web_webview.WebMessageExt;
|
|
11
|
+
controller: web_webview.WebviewController;
|
|
12
|
+
constructor();
|
|
13
|
+
postMessage(value: string): void;
|
|
14
|
+
handleMessageFromWeb(result: web_webview.WebMessageExt): any;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { eventSource } from '@tarojs/runtime/dist/runtime.esm';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TaroElement } from './element/element';
|
|
2
|
+
import type { EventOptions } from '../interface';
|
|
3
|
+
export declare class TaroEvent<T = any> {
|
|
4
|
+
type: string;
|
|
5
|
+
bubbles: boolean;
|
|
6
|
+
cancelable: boolean;
|
|
7
|
+
_stop: boolean;
|
|
8
|
+
_end: boolean;
|
|
9
|
+
defaultPrevented: boolean;
|
|
10
|
+
target: TaroElement;
|
|
11
|
+
currentTarget: TaroElement;
|
|
12
|
+
/** 额外的信息 */
|
|
13
|
+
detail: T;
|
|
14
|
+
button: number;
|
|
15
|
+
timeStamp: number;
|
|
16
|
+
mpEvent: TaroEvent | undefined;
|
|
17
|
+
constructor(type: string, opts: EventOptions, event?: TaroEvent);
|
|
18
|
+
stopPropagation(): void;
|
|
19
|
+
stopImmediatePropagation(): void;
|
|
20
|
+
preventDefault(): void;
|
|
21
|
+
}
|
|
22
|
+
export declare function createEvent(event: TaroEvent | string, type?: string, node?: TaroElement): TaroEvent<any> | undefined;
|
|
23
|
+
export declare function eventHandler(event: any, type: string, node: TaroElement): void;
|
|
24
|
+
export declare function createTaroEvent(type: string, opts?: Partial<EventOptions>, node?: TaroElement): TaroEvent<any>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Events } from '../emitter/emitter';
|
|
2
|
+
import { TaroEvent } from './event';
|
|
3
|
+
import type { EventHandler } from '../interface';
|
|
4
|
+
interface IOptions {
|
|
5
|
+
capture?: boolean;
|
|
6
|
+
once?: boolean;
|
|
7
|
+
passive?: boolean;
|
|
8
|
+
}
|
|
9
|
+
type fn = (...args: any[]) => any;
|
|
10
|
+
declare class TaroEventTarget extends Events {
|
|
11
|
+
__listeners: Record<string, EventHandler[]>;
|
|
12
|
+
addEventListener(type: string, listener: fn, options?: IOptions): void;
|
|
13
|
+
removeEventListener(type: string, listener: fn): void;
|
|
14
|
+
dispatchEvent(event: TaroEvent): boolean;
|
|
15
|
+
private _stopPropagation;
|
|
16
|
+
}
|
|
17
|
+
export { TaroEventTarget };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import TaroDataSourceElement from './dataSource';
|
|
2
|
+
import type { StandardProps } from '@tarojs/components/types';
|
|
3
|
+
import type { TaroAny } from '../interface';
|
|
4
|
+
import type { TaroDocument } from './document';
|
|
5
|
+
import type { TaroElement } from './element/element';
|
|
6
|
+
export declare enum NodeType {
|
|
7
|
+
ELEMENT_NODE = 1,
|
|
8
|
+
ATTRIBUTE_NODE = 2,
|
|
9
|
+
TEXT_NODE = 3,
|
|
10
|
+
CDATA_SECTION_NODE = 4,
|
|
11
|
+
ENTITY_REFERENCE_NODE = 5,
|
|
12
|
+
PROCESSING_INSTRUCTION_NODE = 7,
|
|
13
|
+
COMMENT_NODE = 8,
|
|
14
|
+
DOCUMENT_NODE = 9,
|
|
15
|
+
DOCUMENT_TYPE_NODE = 10,
|
|
16
|
+
DOCUMENT_FRAGMENT_NODE = 11
|
|
17
|
+
}
|
|
18
|
+
export declare class TaroNode extends TaroDataSourceElement {
|
|
19
|
+
readonly nodeName: string;
|
|
20
|
+
readonly nodeType: NodeType;
|
|
21
|
+
childNodes: TaroNode[];
|
|
22
|
+
parentNode: TaroNode | null;
|
|
23
|
+
_nid: number;
|
|
24
|
+
_doc: TaroDocument | null;
|
|
25
|
+
_instance?: TaroAny;
|
|
26
|
+
private _textContent;
|
|
27
|
+
_updateTrigger: number;
|
|
28
|
+
_isCompileMode: boolean;
|
|
29
|
+
_isDynamicNode: boolean;
|
|
30
|
+
_nativeUpdateTrigger: number;
|
|
31
|
+
constructor(nodeName: string, nodeType?: NodeType);
|
|
32
|
+
totalCount(): number;
|
|
33
|
+
getData(index: number): TaroElement<StandardProps>;
|
|
34
|
+
getStrNid(): string;
|
|
35
|
+
getNumNid(id: any): number;
|
|
36
|
+
findIndex(refChild?: TaroNode): number;
|
|
37
|
+
updateTextNode(): void;
|
|
38
|
+
updateComponent(): void;
|
|
39
|
+
get uid(): string;
|
|
40
|
+
get firstChild(): TaroNode | null;
|
|
41
|
+
get lastChild(): TaroNode | null;
|
|
42
|
+
get nextSibling(): TaroNode | null;
|
|
43
|
+
get previousSibling(): TaroNode | null;
|
|
44
|
+
get parentElement(): TaroElement | null;
|
|
45
|
+
get textContent(): string;
|
|
46
|
+
set textContent(value: string);
|
|
47
|
+
get nodeValue(): string | null;
|
|
48
|
+
set nodeValue(value: string | null);
|
|
49
|
+
get ownerDocument(): TaroDocument | null;
|
|
50
|
+
hasChildNodes(): boolean;
|
|
51
|
+
connectParentNode(child: TaroNode): void;
|
|
52
|
+
appendChild(child: TaroNode): TaroNode;
|
|
53
|
+
insertBefore(newNode: TaroNode, referenceNode?: TaroNode): TaroNode;
|
|
54
|
+
replaceChild(newChild: TaroNode, oldChild: TaroNode): TaroNode;
|
|
55
|
+
removeChild(child: TaroNode): TaroNode;
|
|
56
|
+
dispose(): void;
|
|
57
|
+
}
|
|
58
|
+
export declare class TaroTextNode extends TaroNode {
|
|
59
|
+
constructor(value?: string, nodeName?: string, nodeType?: NodeType);
|
|
60
|
+
get data(): string;
|
|
61
|
+
set data(value: string);
|
|
62
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { HarmonyStyle, HarmonyType, TaroStyleType, TaroTextStyleType } from './type';
|
|
2
|
+
export { HarmonyStyle, HarmonyType, TaroStyleType, TaroTextStyleType };
|
|
3
|
+
export default class StyleSheet {
|
|
4
|
+
hmStyle: HarmonyStyle;
|
|
5
|
+
get display(): "none" | "block" | "flex" | undefined;
|
|
6
|
+
get position(): "fixed" | "relative" | "absolute" | undefined;
|
|
7
|
+
get padding(): string;
|
|
8
|
+
get paddingTop(): any;
|
|
9
|
+
get paddingBottom(): any;
|
|
10
|
+
get paddingLeft(): any;
|
|
11
|
+
get paddingRight(): any;
|
|
12
|
+
get margin(): string;
|
|
13
|
+
get marginTop(): any;
|
|
14
|
+
get marginBottom(): any;
|
|
15
|
+
get marginLeft(): any;
|
|
16
|
+
get marginRight(): any;
|
|
17
|
+
get top(): any;
|
|
18
|
+
get left(): any;
|
|
19
|
+
get right(): any;
|
|
20
|
+
get bottom(): any;
|
|
21
|
+
get flex(): string;
|
|
22
|
+
get flexBasis(): string | number | undefined;
|
|
23
|
+
get flexGrow(): number;
|
|
24
|
+
get flexShrink(): number;
|
|
25
|
+
get alignSelf(): string;
|
|
26
|
+
get flexDirection(): string;
|
|
27
|
+
get justifyContent(): string;
|
|
28
|
+
get alignItems(): string;
|
|
29
|
+
get alignContent(): string;
|
|
30
|
+
get flexWrap(): string;
|
|
31
|
+
get width(): any;
|
|
32
|
+
get height(): any;
|
|
33
|
+
get minHeight(): any;
|
|
34
|
+
get maxHeight(): any;
|
|
35
|
+
get minWidth(): any;
|
|
36
|
+
get maxWidth(): any;
|
|
37
|
+
get background(): string;
|
|
38
|
+
get backgroundColor(): any;
|
|
39
|
+
get backgroundImage(): any;
|
|
40
|
+
get backgroundRepeat(): "repeat-x" | "repeat-y" | "no-repeat" | "repeat" | undefined;
|
|
41
|
+
get backgroundSize(): string | undefined;
|
|
42
|
+
get backgroundPosition(): string | undefined;
|
|
43
|
+
get border(): string;
|
|
44
|
+
get borderWidth(): any;
|
|
45
|
+
get borderLeftWidth(): any;
|
|
46
|
+
get borderRightWidth(): any;
|
|
47
|
+
get borderTopWidth(): any;
|
|
48
|
+
get borderBottomWidth(): any;
|
|
49
|
+
get borderColor(): any;
|
|
50
|
+
get borderLeftColor(): any;
|
|
51
|
+
get borderRightColor(): any;
|
|
52
|
+
get borderTopColor(): any;
|
|
53
|
+
get borderBottomColor(): any;
|
|
54
|
+
get borderStyle(): string;
|
|
55
|
+
get borderLeftStyle(): string;
|
|
56
|
+
get borderRightStyle(): string;
|
|
57
|
+
get borderTopStyle(): string;
|
|
58
|
+
get borderBottomStyle(): string;
|
|
59
|
+
get borderRadius(): any;
|
|
60
|
+
get borderTopLeftRadius(): any;
|
|
61
|
+
get borderTopRightRadius(): any;
|
|
62
|
+
get borderBottomLeftRadius(): any;
|
|
63
|
+
get borderBottomRightRadius(): any;
|
|
64
|
+
get zIndex(): number | undefined;
|
|
65
|
+
get opacity(): any;
|
|
66
|
+
get overflow(): "visible" | "hidden";
|
|
67
|
+
get focus(): boolean;
|
|
68
|
+
get color(): any;
|
|
69
|
+
get fontSize(): any;
|
|
70
|
+
get fontWeight(): any;
|
|
71
|
+
get fontStyle(): "" | "normal" | "italic";
|
|
72
|
+
get fontFamily(): any;
|
|
73
|
+
get textAlign(): "" | "center" | "left" | "right";
|
|
74
|
+
get verticalAlign(): "" | "bottom" | "middle" | "top";
|
|
75
|
+
get lineHeight(): any;
|
|
76
|
+
get letterSpacing(): string | number | undefined;
|
|
77
|
+
get textDecoration(): "none" | "" | "underline" | "overline" | "line-through";
|
|
78
|
+
get textOverflow(): "none" | "clip" | "ellipsis" | "marquee" | undefined;
|
|
79
|
+
get WebkitLineClamp(): number;
|
|
80
|
+
get transform(): HarmonyType.Transform.Transform | undefined;
|
|
81
|
+
get transformOrigin(): HarmonyType.Transform.Origin | undefined;
|
|
82
|
+
get content(): any;
|
|
83
|
+
}
|
|
@@ -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';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './current';
|
|
2
|
+
export { hooks } from '@tarojs/shared';
|
|
3
|
+
export * from './bom/document';
|
|
4
|
+
export * from './bom/getComputedStyle';
|
|
5
|
+
export * from './bom/history';
|
|
6
|
+
export * from './bom/location';
|
|
7
|
+
export * from './bom/navigator';
|
|
8
|
+
export * from './bom/raf';
|
|
9
|
+
export * from './bom/URL';
|
|
10
|
+
export * from './bom/window';
|
|
11
|
+
export * from './dom/element';
|
|
12
|
+
export * from './dom/event';
|
|
13
|
+
export * from './dom/event-source';
|
|
14
|
+
export * from './dom/node';
|
|
15
|
+
export * from './dom/stylesheet';
|
|
16
|
+
export * from './dom/cssNesting';
|
|
17
|
+
export * from './env';
|
|
18
|
+
export * from './constant';
|
|
19
|
+
export * from './emitter/emitter';
|
|
20
|
+
export * from './utils';
|
|
21
|
+
export * from './interface';
|
|
22
|
+
export { Instance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, } from '@tarojs/runtime/dist/runtime.esm';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './event';
|
|
2
|
+
export { PageConfig, TFunc } from '@tarojs/runtime/dist/runtime.esm';
|
|
3
|
+
export type TaroAny = any;
|
|
4
|
+
export type TaroFunc = (...args: TaroAny[]) => TaroAny;
|
|
5
|
+
export type TaroIndent = string | number | boolean | undefined | null;
|
|
6
|
+
export type TaroObject = Record<string | number | symbol, TaroAny>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { TaroElement } from '../dom/element/element';
|
|
3
|
+
import type { TaroNode } from '../dom/node';
|
|
4
|
+
export declare function isElement(node: TaroNode): node is TaroElement;
|
|
5
|
+
/**
|
|
6
|
+
* 往上寻找组件树直到 root,寻找是否有祖先组件绑定了同类型的事件
|
|
7
|
+
* @param node 当前组件
|
|
8
|
+
* @param type 事件类型
|
|
9
|
+
*/
|
|
10
|
+
export declare function isParentBinded(node: TaroElement | null, type: string): boolean;
|
|
11
|
+
export declare function convertNumber2PX(value: number): string | number;
|
|
12
|
+
export declare function convertNumber2VP(value: number, unit?: string): string | number;
|
|
13
|
+
export declare function parseClasses(classNames?: string): string[];
|
|
14
|
+
export declare function calcStaticStyle(styleSheet: Record<string, CSSProperties>, classNames?: string): CSSProperties;
|
|
15
|
+
export declare function calcDynamicStyle(style: CSSProperties): CSSProperties;
|
|
16
|
+
export declare function __env__(safeAreaType: string, fallback?: string | number): string | number | undefined;
|
|
17
|
+
export declare function getPageScrollerOrNode(scrollerOrNode: any, page: any): any;
|
|
18
|
+
export declare function ObjectKeys(obj: object): string[];
|
|
19
|
+
export declare function ObjectAssign(...objects: any[]): any;
|
|
20
|
+
export declare function callFn(fn: any, ctx: any, ...args: any): any;
|
|
21
|
+
export declare function bindFn(fn: any, ctx: any, ...args: any): any;
|
|
22
|
+
export declare function findChildNodeWithDFS<T extends TaroElement = TaroElement>(node: TaroElement, selector: string | ((ele: T) => boolean), selectAll: true): T[] | null;
|
|
23
|
+
export declare function findChildNodeWithDFS<T extends TaroElement = TaroElement>(node: TaroElement, selector: string | ((ele: T) => boolean), selectAll?: false): T | null;
|
|
24
|
+
export declare function findChildNodeWithDFS<T extends TaroElement = TaroElement>(node: TaroElement, selector: string | ((ele: T) => boolean), selectAll: boolean): T[] | T | null;
|
|
25
|
+
export * from './info';
|
|
26
|
+
export * from './router';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TaroElement } from '../dom/element/element';
|
|
2
|
+
export declare const AREA_CHANGE_EVENT_NAME = "areaChange";
|
|
3
|
+
export declare const VISIBLE_CHANGE_EVENT_NAME = "visibleChange";
|
|
4
|
+
export declare function createEventOnName(eventName: string): string;
|
|
5
|
+
export declare function createEventTapName(eventName: string): string;
|
|
6
|
+
export declare const disconnectEvent: (node: TaroElement, eventName: string) => null | undefined;
|
|
7
|
+
export declare function getComponentEventCallback(node: TaroElement, eventName: string, callback?: (data: any) => void): ((...eventResult: any[]) => void) | null;
|
|
8
|
+
export declare function setNodeEventCallbackAndTriggerComponentUpdate(node: TaroElement, eventName: string, callback: Function, isAsync?: boolean): Promise<void>;
|
|
9
|
+
export declare function bindAttributesCallback(node: TaroElement, _: string, callback: Function): void;
|
|
10
|
+
export declare function triggerAttributesCallback(node: any, attributeName: any): void;
|
|
11
|
+
export declare function initComponentNodeInfo(node: TaroElement): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { addLeadingSlash, getCurrentPage, getHomePage, hasBasename, stripBasename, stripSuffix, stripTrailing } from '@tarojs/runtime/dist/runtime.esm';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="types/runtime" />
|
|
2
|
+
import type { AppInstance } from '@tarojs/runtime';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
interface IReactMeta {
|
|
5
|
+
PageContext: React.Context<string>;
|
|
6
|
+
R: typeof React;
|
|
7
|
+
Container: any;
|
|
8
|
+
}
|
|
9
|
+
export declare const ReactMeta: IReactMeta;
|
|
10
|
+
export declare function connectReactPage(R: typeof React, id: string, getCtx: () => any): (Page: any) => React.ComponentClass<any>;
|
|
11
|
+
export declare function createReactApp(App: any, react: any, dom: any, config?: any): AppInstance;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setReconciler(ReactDOM: any): void;
|