@tarojs/plugin-platform-harmony-ets 4.0.0-alpha.34 → 4.0.0-alpha.36
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/media/image/index.ts +124 -135
- 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/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 +2 -2
- package/dist/components-harmony-ets/label.ets +1 -2
- package/dist/components-harmony-ets/listView.ets +1 -1
- 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 +1 -1
- package/dist/components-harmony-ets/slider.ets +1 -1
- package/dist/components-harmony-ets/style.ets +7 -6
- 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.js +1 -1
- 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 +0 -1
- 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/movableView.ts +12 -8
- 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 +2 -3
- package/dist/runtime-ets/emitter/emitter.ts +1 -0
- package/dist/runtime-ets/env.ts +1 -0
- package/dist/runtime-ets/index.ts +21 -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 +44 -15
- 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-utils.js +134 -166
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +134 -166
- package/dist/runtime.js.map +1 -1
- package/package.json +9 -9
|
@@ -3,7 +3,7 @@ import { eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBL
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
4
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
5
5
|
|
|
6
|
-
import type { TaroAny,
|
|
6
|
+
import type { TaroAny, TaroEvent, TaroSliderElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
interface SliderAttrs {
|
|
9
9
|
selectedColor?: ResourceColor
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { TaroAny, HarmonyStyle, TaroElement, TaroStyleType, TaroTextElement } from '@tarojs/runtime'
|
|
2
1
|
import { ObjectAssign } from '@tarojs/runtime'
|
|
3
2
|
import { isUndefined } from '@tarojs/shared'
|
|
4
3
|
import { computeBackgroundPosition, convertVp2Px } from './utils'
|
|
@@ -6,6 +5,8 @@ import { getNormalAttributes } from './utils/helper'
|
|
|
6
5
|
import { isMaxWidthView } from './utils/styles'
|
|
7
6
|
import { FlexManager } from './utils/flexManager'
|
|
8
7
|
|
|
8
|
+
import type { HarmonyStyle, TaroAny, TaroElement, TaroStyleType, TaroTextElement } from '@tarojs/runtime'
|
|
9
|
+
|
|
9
10
|
class TextStyleModify implements AttributeModifier<TextAttribute> {
|
|
10
11
|
initStyle?: TaroStyleType
|
|
11
12
|
node: TaroTextElement | null = null
|
|
@@ -81,7 +82,7 @@ class CommonStyleModify implements AttributeModifier<CommonAttribute> {
|
|
|
81
82
|
}
|
|
82
83
|
return this
|
|
83
84
|
}
|
|
84
|
-
|
|
85
|
+
|
|
85
86
|
setAnimationStyle (overwriteStyle: Record<string, TaroAny>) {
|
|
86
87
|
this.overwriteStyle = overwriteStyle
|
|
87
88
|
if (this.style && this.overwriteStyle && Object.keys(this.overwriteStyle).length) {
|
|
@@ -248,9 +249,9 @@ export function setNormalAttributeIntoInstance(instance: CommonAttribute, style:
|
|
|
248
249
|
instance.key(style.id)
|
|
249
250
|
}
|
|
250
251
|
if (!isUndefined(style.display) || !isUndefined(style.visibility)) {
|
|
251
|
-
instance.visibility(style.display === 'none'
|
|
252
|
-
? Visibility.None :
|
|
253
|
-
!isUndefined(style.visibility)
|
|
252
|
+
instance.visibility(style.display === 'none'
|
|
253
|
+
? Visibility.None :
|
|
254
|
+
!isUndefined(style.visibility)
|
|
254
255
|
? (style.visibility === 'hidden' ? Visibility.Hidden : Visibility.Visible)
|
|
255
256
|
: Visibility.Visible
|
|
256
257
|
)
|
|
@@ -407,4 +408,4 @@ export const rowModify = new RowStyleModify()
|
|
|
407
408
|
export const columnModify = new ColumnStyleModify()
|
|
408
409
|
export const textModify = new TextStyleModify()
|
|
409
410
|
|
|
410
|
-
export default new CommonStyleModify()
|
|
411
|
+
export default new CommonStyleModify()
|
|
@@ -3,7 +3,7 @@ import { eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBL
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
4
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { TaroAny, TaroEvent, TaroSwiperElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
interface SwiperAttrs {
|
|
9
9
|
index?: number
|
|
@@ -3,7 +3,7 @@ import { eventHandler, getComponentEventCallback, AREA_CHANGE_EVENT_NAME, VISIBL
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
4
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
5
5
|
|
|
6
|
-
import type { TaroAny,
|
|
6
|
+
import type { TaroAny, TaroEvent, TaroSwitchElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
interface SwitchAttrs {
|
|
9
9
|
selectedColor?: ResourceColor
|
|
@@ -7,7 +7,7 @@ import { getImageMode } from './image'
|
|
|
7
7
|
import { BUTTON_THEME_COLOR } from './utils/constant/style'
|
|
8
8
|
import { getNodeThresholds, getStyleAttr, shouldBindEvent, getNormalAttributes } from './utils/helper'
|
|
9
9
|
|
|
10
|
-
import type {
|
|
10
|
+
import type { HarmonyStyle, TaroAny, TaroButtonElement, TaroElement, TaroTextElement } from '@tarojs/runtime'
|
|
11
11
|
|
|
12
12
|
function getButtonFontSize (node: TaroButtonElement): string | number {
|
|
13
13
|
const isMini = node._attrs.size === 'mini'
|
|
@@ -125,4 +125,4 @@ class SpanStyleModify implements AttributeModifier<SpanAttribute> {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
const spanModify = new SpanStyleModify()
|
|
128
|
+
const spanModify = new SpanStyleModify()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { VIEW } from '@tarojs/runtime
|
|
1
|
+
import { VIEW } from '@tarojs/runtime'
|
|
2
2
|
|
|
3
3
|
import { getNormalAttributes, getFontAttributes, getStyleAttr } from './styles'
|
|
4
4
|
|
|
5
|
-
import type { TaroElement, TaroNode
|
|
5
|
+
import type { TaroAny, TaroElement, TaroNode } from '@tarojs/runtime'
|
|
6
6
|
|
|
7
7
|
export const parseStyles = (styles = ''): Record<string, string> => {
|
|
8
8
|
const styleObj: Record<string, string> = {}
|
|
@@ -4,7 +4,7 @@ import { ObjectAssign } from '@tarojs/runtime'
|
|
|
4
4
|
import { FlexManager } from './flexManager'
|
|
5
5
|
|
|
6
6
|
import type { StandardProps, TextProps } from '@tarojs/components/types'
|
|
7
|
-
import type { TaroAny, TaroElement,
|
|
7
|
+
import type { TaroAny, TaroElement, TaroTextStyleType, HarmonyStyle } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
export function getFontAttributes (node: TaroElement): TaroTextStyleType {
|
|
10
10
|
let hmStyle = getNormalAttributes(node)
|
|
@@ -20,7 +20,7 @@ export function getFontAttributes (node: TaroElement): TaroTextStyleType {
|
|
|
20
20
|
let WebkitLineClamp = attrs.maxLines || hmStyle.WebkitLineClamp || Infinity
|
|
21
21
|
if (hmStyle.textOverflow && !isUndefined(hmStyle.textOverflow.overflow)) {
|
|
22
22
|
switch (hmStyle.textOverflow.overflow) {
|
|
23
|
-
case TextOverflow.Clip:
|
|
23
|
+
case TextOverflow.Clip:
|
|
24
24
|
case TextOverflow.Ellipsis:
|
|
25
25
|
case TextOverflow.None: WebkitLineClamp = WebkitLineClamp || 1; break
|
|
26
26
|
default: break
|
|
@@ -90,9 +90,8 @@ export function isMaxWidthView (node: TaroElement) {
|
|
|
90
90
|
|
|
91
91
|
export function getNormalAttributes (node: TaroElement, initStyle?: HarmonyStyle): HarmonyStyle {
|
|
92
92
|
if (!node) return {}
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
const hmStyle = node.hmStyle
|
|
95
|
-
|
|
96
95
|
if (!hmStyle) return {}
|
|
97
96
|
|
|
98
97
|
const _nid = node._nid
|
|
@@ -182,7 +181,7 @@ function getPseudoClass (node: TaroElement): HarmonyStyle | null {
|
|
|
182
181
|
function parseNthChild(selector: string): [number, number] | null {
|
|
183
182
|
const regex = /nth-child\((?:(-?\d*)n\s*)?([+-]?\s*\d+)?\)/;
|
|
184
183
|
const match = selector.match(regex);
|
|
185
|
-
|
|
184
|
+
|
|
186
185
|
if (match) {
|
|
187
186
|
const a = match[1] ? parseInt(match[1]) : 0;
|
|
188
187
|
const b = match[2] ? parseInt(match[2]) : 0;
|
|
@@ -202,4 +201,4 @@ export function getStyleAttr(node: TaroElement | null, key: string): TaroAny {
|
|
|
202
201
|
return isMaxWidthView(node) && isUndefined(hmStyle.width) ? '100%' : hmStyle.width
|
|
203
202
|
}
|
|
204
203
|
return hmStyle[key]
|
|
205
|
-
}
|
|
204
|
+
}
|
|
@@ -4,7 +4,7 @@ import commonStyleModify from './style'
|
|
|
4
4
|
import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
5
5
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
6
6
|
|
|
7
|
-
import type { TaroAny,
|
|
7
|
+
import type { TaroAny, TaroEvent, TaroVideoElement } from '@tarojs/runtime'
|
|
8
8
|
|
|
9
9
|
export interface VideoOptions {
|
|
10
10
|
src?: string | Resource
|
|
@@ -6,8 +6,7 @@ import { TOUCH_EVENT_MAP } from './utils/constant/event'
|
|
|
6
6
|
import { FlexManager } from './utils/flexManager'
|
|
7
7
|
import { getNodeThresholds, shouldBindEvent } from './utils/helper'
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
import { isUndefined } from '@tarojs/shared'
|
|
9
|
+
import type { TaroAny, TaroViewElement } from '@tarojs/runtime'
|
|
11
10
|
|
|
12
11
|
@Component
|
|
13
12
|
export default struct TaroView {
|
|
@@ -3,7 +3,7 @@ import { AREA_CHANGE_EVENT_NAME, eventHandler, getComponentEventCallback, VISIBL
|
|
|
3
3
|
import commonStyleModify from './style'
|
|
4
4
|
import { shouldBindEvent, getNodeThresholds } from './utils/helper'
|
|
5
5
|
|
|
6
|
-
import type { TaroAny,
|
|
6
|
+
import type { TaroAny, TaroEvent, TaroWebViewElement } from '@tarojs/runtime'
|
|
7
7
|
|
|
8
8
|
interface IPageLoad {
|
|
9
9
|
url: string
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var path = require('node:path');
|
|
6
5
|
var helper = require('@tarojs/helper');
|
|
6
|
+
var path = require('node:path');
|
|
7
7
|
var service = require('@tarojs/service');
|
|
8
8
|
var _package = require('@tarojs/service/dist/utils/package');
|
|
9
9
|
var shared = require('@tarojs/shared');
|