@tarojs/plugin-platform-harmony-ets 4.0.0-beta.19 → 4.0.0-beta.20

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 (46) hide show
  1. package/dist/apis/wxml/IntersectionObserver.ts +5 -3
  2. package/dist/components-harmony-ets/button.ets +3 -2
  3. package/dist/components-harmony-ets/checkbox.ets +6 -3
  4. package/dist/components-harmony-ets/form.ets +5 -4
  5. package/dist/components-harmony-ets/icon.ets +8 -4
  6. package/dist/components-harmony-ets/image.ets +2 -0
  7. package/dist/components-harmony-ets/innerHtml.ets +5 -4
  8. package/dist/components-harmony-ets/input.ets +6 -4
  9. package/dist/components-harmony-ets/label.ets +5 -4
  10. package/dist/components-harmony-ets/movableArea.ets +8 -31
  11. package/dist/components-harmony-ets/movableView.ets +8 -31
  12. package/dist/components-harmony-ets/picker.ets +21 -16
  13. package/dist/components-harmony-ets/progress.ets +2 -0
  14. package/dist/components-harmony-ets/pseudo.ets +38 -31
  15. package/dist/components-harmony-ets/radio.ets +6 -3
  16. package/dist/components-harmony-ets/richText.ets +3 -1
  17. package/dist/components-harmony-ets/scrollView.ets +15 -36
  18. package/dist/components-harmony-ets/slider.ets +4 -2
  19. package/dist/components-harmony-ets/style.ets +62 -27
  20. package/dist/components-harmony-ets/swiper.ets +3 -2
  21. package/dist/components-harmony-ets/switch.ets +3 -1
  22. package/dist/components-harmony-ets/text.ets +10 -8
  23. package/dist/components-harmony-ets/textArea.ets +6 -4
  24. package/dist/components-harmony-ets/utils/helper.ets +3 -2
  25. package/dist/components-harmony-ets/utils/styles.ets +25 -93
  26. package/dist/components-harmony-ets/video.ets +2 -0
  27. package/dist/components-harmony-ets/view.ets +11 -32
  28. package/dist/components-harmony-ets/webView.ets +3 -1
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.js +10 -10
  31. package/dist/index.js.map +1 -1
  32. package/dist/runtime-ets/dom/cssNesting.ts +36 -10
  33. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +15 -40
  34. package/dist/runtime-ets/dom/document.ts +0 -3
  35. package/dist/runtime-ets/dom/element/element.ts +6 -5
  36. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +152 -217
  37. package/dist/runtime-ets/dom/stylesheet/index.ts +17 -315
  38. package/dist/runtime-ets/dom/stylesheet/type.ts +6 -2
  39. package/dist/runtime-ets/index.ts +1 -1
  40. package/dist/runtime-ets/utils/index.ts +24 -8
  41. package/dist/runtime-framework/react/native-page.ts +6 -4
  42. package/dist/runtime-utils.js +4 -3
  43. package/dist/runtime-utils.js.map +1 -1
  44. package/dist/runtime.js +4 -3
  45. package/dist/runtime.js.map +1 -1
  46. package/package.json +8 -8
@@ -4,7 +4,6 @@ import { isUndefined } from '@tarojs/shared'
4
4
  import { Current } from '../current'
5
5
  import { findChildNodeWithDFS, getPageScrollerOrNode } from '../utils'
6
6
  import { TaroComment } from './comment'
7
- import { createCSSStyleDeclaration } from './cssStyleDeclaration'
8
7
  import { TaroElement } from './element/element'
9
8
  import { NodeType, TaroNode, TaroTextNode } from './node'
10
9
 
@@ -45,8 +44,6 @@ class TaroDocument extends TaroNode {
45
44
  node = new TaroElement(tagName)
46
45
  }
47
46
  node._doc = this
48
- // Hack: 此 Proxy 不能放在 Element 类内定义,否则响应式更新会失效
49
- node._style = createCSSStyleDeclaration(node)
50
47
  return node
51
48
  }
52
49
 
@@ -11,7 +11,7 @@ import StyleSheet, { HarmonyStyle } from '../stylesheet'
11
11
 
12
12
  import type { StandardProps } from '@tarojs/components/types'
13
13
  import type { TaroAny } from '../../utils'
14
- import type { ICSSStyleDeclaration } from '../cssStyleDeclaration'
14
+ import { createCSSStyleDeclaration, type ICSSStyleDeclaration } from '../cssStyleDeclaration'
15
15
 
16
16
  type NamedNodeMap = ({ name: string, value: string })[]
17
17
 
@@ -31,7 +31,7 @@ export class TaroElement<T extends StandardProps = StandardProps> extends TaroNo
31
31
  constructor(tagName: string) {
32
32
  super(tagName.replace(new RegExp('(?<=.)([A-Z])', 'g'), '-$1').toUpperCase(), NodeType.ELEMENT_NODE)
33
33
  this.tagName = this.nodeName
34
-
34
+ this._style = createCSSStyleDeclaration(this)
35
35
  initComponentNodeInfo(this)
36
36
  bindAnimation(this)
37
37
  }
@@ -159,6 +159,7 @@ export class TaroElement<T extends StandardProps = StandardProps> extends TaroNo
159
159
  return this._innerHTML
160
160
  }
161
161
 
162
+ // 存放的样式,获取其实跟获取style是一样的,只不过这里取的更快捷,不需要走style的get方法进到cssStyleDeclaration
162
163
  public _st = new StyleSheet()
163
164
 
164
165
  // 经转换后的鸿蒙样式
@@ -173,7 +174,7 @@ export class TaroElement<T extends StandardProps = StandardProps> extends TaroNo
173
174
  }
174
175
 
175
176
  // 伪类,不存在style动态设置,均已被转换为鸿蒙样式
176
- // TODO:可根据实际情况,迁移到具体的组件中,如View、ScrollView中,Text\Image其实是不需要的
177
+ // 可根据实际情况,迁移到具体的组件中,如View、ScrollView中,Text\Image其实是不需要的
177
178
  public _pseudo_before: StyleSheet | null = null
178
179
 
179
180
  public set_pseudo_before (value: HarmonyStyle | null) {
@@ -182,7 +183,7 @@ export class TaroElement<T extends StandardProps = StandardProps> extends TaroNo
182
183
  this._pseudo_before = new StyleSheet()
183
184
  }
184
185
  Object.keys(value).forEach(key => {
185
- this._pseudo_before![key] = value[key]
186
+ this._pseudo_before!.hmStyle[key] = value[key]
186
187
  })
187
188
  } else {
188
189
  this._pseudo_before = null
@@ -197,7 +198,7 @@ export class TaroElement<T extends StandardProps = StandardProps> extends TaroNo
197
198
  this._pseudo_after = new StyleSheet()
198
199
  }
199
200
  Object.keys(value).forEach(key => {
200
- this._pseudo_after![key] = value[key]
201
+ this._pseudo_after!.hmStyle[key] = value[key]
201
202
  })
202
203
  } else {
203
204
  this._pseudo_after = null