@tarojs/plugin-platform-harmony-ets 4.0.0-alpha.36 → 4.0.0-alpha.37

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.
Files changed (68) hide show
  1. package/dist/apis/base/weapp/life-cycle.ts +1 -1
  2. package/dist/apis/framework/index.ts +1 -1
  3. package/dist/apis/media/image/index.ts +135 -124
  4. package/dist/apis/route/index.ts +2 -1
  5. package/dist/apis/ui/background.ts +1 -1
  6. package/dist/apis/ui/navigation-bar/index.ts +1 -1
  7. package/dist/apis/ui/tab-bar.ts +2 -1
  8. package/dist/components-harmony-ets/button.ets +1 -1
  9. package/dist/components-harmony-ets/checkbox.ets +2 -1
  10. package/dist/components-harmony-ets/form.ets +1 -0
  11. package/dist/components-harmony-ets/index.ets +90 -37
  12. package/dist/components-harmony-ets/input.ets +2 -2
  13. package/dist/components-harmony-ets/label.ets +2 -1
  14. package/dist/components-harmony-ets/listView.ets +1 -1
  15. package/dist/components-harmony-ets/movableArea.ets +3 -3
  16. package/dist/components-harmony-ets/navigationBar.ets +1 -1
  17. package/dist/components-harmony-ets/pageMeta.ets +1 -1
  18. package/dist/components-harmony-ets/pseudo.ets +1 -1
  19. package/dist/components-harmony-ets/radio.ets +3 -2
  20. package/dist/components-harmony-ets/scrollList.ets +2 -2
  21. package/dist/components-harmony-ets/scrollView.ets +1 -1
  22. package/dist/components-harmony-ets/slider.ets +1 -1
  23. package/dist/components-harmony-ets/style.ets +6 -7
  24. package/dist/components-harmony-ets/swiper.ets +1 -1
  25. package/dist/components-harmony-ets/switch.ets +1 -1
  26. package/dist/components-harmony-ets/text.ets +2 -2
  27. package/dist/components-harmony-ets/utils/helper.ets +2 -2
  28. package/dist/components-harmony-ets/utils/styles.ets +6 -5
  29. package/dist/components-harmony-ets/video.ets +1 -1
  30. package/dist/components-harmony-ets/view.ets +2 -1
  31. package/dist/components-harmony-ets/webView.ets +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/index.js.map +1 -1
  34. package/dist/runtime-ets/bom/document.ts +2 -1
  35. package/dist/runtime-ets/bom/getComputedStyle.ts +2 -1
  36. package/dist/runtime-ets/bom/navigator.ts +21 -1
  37. package/dist/runtime-ets/bom/raf.ts +37 -1
  38. package/dist/runtime-ets/bom/window.ts +5 -4
  39. package/dist/runtime-ets/constant.ts +10 -17
  40. package/dist/runtime-ets/current.ts +1 -0
  41. package/dist/runtime-ets/dom/document.ts +1 -1
  42. package/dist/runtime-ets/dom/element/canvas.ts +2 -3
  43. package/dist/runtime-ets/dom/element/element.ts +5 -6
  44. package/dist/runtime-ets/dom/element/movableView.ts +8 -12
  45. package/dist/runtime-ets/dom/eventTarget.ts +1 -1
  46. package/dist/runtime-ets/dom/node.ts +3 -2
  47. package/dist/runtime-ets/index.ts +7 -21
  48. package/dist/runtime-ets/interface/index.ts +0 -6
  49. package/dist/runtime-ets/utils/index.ts +6 -4
  50. package/dist/runtime-framework/react/app.ts +2 -1
  51. package/dist/runtime-framework/react/hooks.ts +1 -1
  52. package/dist/runtime-framework/react/native-page.ts +15 -44
  53. package/dist/runtime-framework/react/page.ts +2 -1
  54. package/dist/runtime-framework/solid/app.ts +2 -1
  55. package/dist/runtime-framework/solid/hooks.ts +1 -1
  56. package/dist/runtime-framework/solid/page.ts +2 -1
  57. package/dist/runtime-utils.js +166 -134
  58. package/dist/runtime-utils.js.map +1 -1
  59. package/dist/runtime.js +166 -134
  60. package/dist/runtime.js.map +1 -1
  61. package/package.json +9 -9
  62. package/dist/runtime-ets/bom/URL.ts +0 -2
  63. package/dist/runtime-ets/bom/history.ts +0 -1
  64. package/dist/runtime-ets/bom/location.ts +0 -1
  65. package/dist/runtime-ets/dom/event-source.ts +0 -1
  66. package/dist/runtime-ets/emitter/emitter.ts +0 -1
  67. package/dist/runtime-ets/env.ts +0 -1
  68. package/dist/runtime-ets/utils/router.ts +0 -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, TaroEvent, TaroSliderElement } from '@tarojs/runtime'
6
+ import type { TaroAny, TaroSliderElement, TaroEvent } from '@tarojs/runtime'
7
7
 
8
8
  interface SliderAttrs {
9
9
  selectedColor?: ResourceColor
@@ -1,3 +1,4 @@
1
+ import type { TaroAny, HarmonyStyle, TaroElement, TaroStyleType, TaroTextElement } from '@tarojs/runtime'
1
2
  import { ObjectAssign } from '@tarojs/runtime'
2
3
  import { isUndefined } from '@tarojs/shared'
3
4
  import { computeBackgroundPosition, convertVp2Px } from './utils'
@@ -5,8 +6,6 @@ import { getNormalAttributes } from './utils/helper'
5
6
  import { isMaxWidthView } from './utils/styles'
6
7
  import { FlexManager } from './utils/flexManager'
7
8
 
8
- import type { HarmonyStyle, TaroAny, TaroElement, TaroStyleType, TaroTextElement } from '@tarojs/runtime'
9
-
10
9
  class TextStyleModify implements AttributeModifier<TextAttribute> {
11
10
  initStyle?: TaroStyleType
12
11
  node: TaroTextElement | null = null
@@ -82,7 +81,7 @@ class CommonStyleModify implements AttributeModifier<CommonAttribute> {
82
81
  }
83
82
  return this
84
83
  }
85
-
84
+
86
85
  setAnimationStyle (overwriteStyle: Record<string, TaroAny>) {
87
86
  this.overwriteStyle = overwriteStyle
88
87
  if (this.style && this.overwriteStyle && Object.keys(this.overwriteStyle).length) {
@@ -249,9 +248,9 @@ export function setNormalAttributeIntoInstance(instance: CommonAttribute, style:
249
248
  instance.key(style.id)
250
249
  }
251
250
  if (!isUndefined(style.display) || !isUndefined(style.visibility)) {
252
- instance.visibility(style.display === 'none'
253
- ? Visibility.None :
254
- !isUndefined(style.visibility)
251
+ instance.visibility(style.display === 'none'
252
+ ? Visibility.None :
253
+ !isUndefined(style.visibility)
255
254
  ? (style.visibility === 'hidden' ? Visibility.Hidden : Visibility.Visible)
256
255
  : Visibility.Visible
257
256
  )
@@ -408,4 +407,4 @@ export const rowModify = new RowStyleModify()
408
407
  export const columnModify = new ColumnStyleModify()
409
408
  export const textModify = new TextStyleModify()
410
409
 
411
- export default new CommonStyleModify()
410
+ 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 { TaroAny, TaroEvent, TaroSwiperElement } from '@tarojs/runtime'
6
+ import type { TaroSwiperElement, TaroEvent, TaroAny } 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, TaroEvent, TaroSwitchElement } from '@tarojs/runtime'
6
+ import type { TaroAny, TaroSwitchElement, TaroEvent } 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 { HarmonyStyle, TaroAny, TaroButtonElement, TaroElement, TaroTextElement } from '@tarojs/runtime'
10
+ import type { TaroButtonElement, TaroElement, TaroTextElement, TaroAny, HarmonyStyle } 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/dist/runtime.esm'
2
2
 
3
3
  import { getNormalAttributes, getFontAttributes, getStyleAttr } from './styles'
4
4
 
5
- import type { TaroAny, TaroElement, TaroNode } from '@tarojs/runtime'
5
+ import type { TaroElement, TaroNode, TaroAny } 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, TaroTextStyleType, HarmonyStyle } from '@tarojs/runtime'
7
+ import type { TaroAny, TaroElement, TaroStyleType, 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,8 +90,9 @@ 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
+
95
96
  if (!hmStyle) return {}
96
97
 
97
98
  const _nid = node._nid
@@ -181,7 +182,7 @@ function getPseudoClass (node: TaroElement): HarmonyStyle | null {
181
182
  function parseNthChild(selector: string): [number, number] | null {
182
183
  const regex = /nth-child\((?:(-?\d*)n\s*)?([+-]?\s*\d+)?\)/;
183
184
  const match = selector.match(regex);
184
-
185
+
185
186
  if (match) {
186
187
  const a = match[1] ? parseInt(match[1]) : 0;
187
188
  const b = match[2] ? parseInt(match[2]) : 0;
@@ -201,4 +202,4 @@ export function getStyleAttr(node: TaroElement | null, key: string): TaroAny {
201
202
  return isMaxWidthView(node) && isUndefined(hmStyle.width) ? '100%' : hmStyle.width
202
203
  }
203
204
  return hmStyle[key]
204
- }
205
+ }
@@ -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, TaroEvent, TaroVideoElement } from '@tarojs/runtime'
7
+ import type { TaroAny, TaroVideoElement, TaroEvent } from '@tarojs/runtime'
8
8
 
9
9
  export interface VideoOptions {
10
10
  src?: string | Resource
@@ -6,7 +6,8 @@ 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 { TaroAny, TaroViewElement } from '@tarojs/runtime'
9
+ import type { TaroViewElement, TaroAny } from '@tarojs/runtime'
10
+ import { isUndefined } from '@tarojs/shared'
10
11
 
11
12
  @Component
12
13
  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, TaroEvent, TaroWebViewElement } from '@tarojs/runtime'
6
+ import type { TaroAny, TaroWebViewElement, TaroEvent } 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 helper = require('@tarojs/helper');
6
5
  var path = require('node:path');
6
+ var helper = require('@tarojs/helper');
7
7
  var service = require('@tarojs/service');
8
8
  var _package = require('@tarojs/service/dist/utils/package');
9
9
  var shared = require('@tarojs/shared');