@tarojs/plugin-platform-harmony-ets 4.0.0-alpha.22 → 4.0.0-alpha.24

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/components-harmony-ets/button.ets +4 -4
  2. package/dist/components-harmony-ets/checkbox.ets +7 -7
  3. package/dist/components-harmony-ets/form.ets +10 -10
  4. package/dist/components-harmony-ets/icon.ets +3 -3
  5. package/dist/components-harmony-ets/image.ets +3 -3
  6. package/dist/components-harmony-ets/input.ets +16 -3
  7. package/dist/components-harmony-ets/label.ets +10 -10
  8. package/dist/components-harmony-ets/listView.ets +7 -2
  9. package/dist/components-harmony-ets/movableArea.ets +4 -4
  10. package/dist/components-harmony-ets/movableView.ets +4 -4
  11. package/dist/components-harmony-ets/navigationBar.ets +6 -6
  12. package/dist/components-harmony-ets/pageMeta.ets +6 -6
  13. package/dist/components-harmony-ets/picker.ets +4 -4
  14. package/dist/components-harmony-ets/progress.ets +2 -2
  15. package/dist/components-harmony-ets/pseudo.ets +2 -2
  16. package/dist/components-harmony-ets/radio.ets +11 -11
  17. package/dist/components-harmony-ets/richText.ets +2 -2
  18. package/dist/components-harmony-ets/scrollList.ets +13 -4
  19. package/dist/components-harmony-ets/scrollView.ets +5 -5
  20. package/dist/components-harmony-ets/slider.ets +2 -2
  21. package/dist/components-harmony-ets/stickySection.ets +3 -3
  22. package/dist/components-harmony-ets/swiper.ets +3 -3
  23. package/dist/components-harmony-ets/switch.ets +2 -2
  24. package/dist/components-harmony-ets/text.ets +33 -57
  25. package/dist/components-harmony-ets/textArea.ets +3 -3
  26. package/dist/components-harmony-ets/utils/AttributeManager.ets +1 -1
  27. package/dist/components-harmony-ets/utils/helper.ets +3 -4
  28. package/dist/components-harmony-ets/utils/styles.ets +1 -1
  29. package/dist/components-harmony-ets/video.ets +2 -2
  30. package/dist/components-harmony-ets/view.ets +10 -10
  31. package/dist/components-harmony-ets/webView.ets +2 -2
  32. package/dist/index.js +4 -2
  33. package/dist/index.js.map +1 -1
  34. package/dist/runtime-ets/current.ts +2 -1
  35. package/dist/runtime-ets/dom/element/element.ts +10 -10
  36. package/dist/runtime-ets/dom/event.ts +1 -1
  37. package/dist/runtime-ets/dom/node.ts +11 -3
  38. package/dist/runtime-ets/utils/index.ts +1 -0
  39. package/dist/runtime-framework/react/app.ts +6 -6
  40. package/dist/runtime-framework/react/native-page.ts +1 -1
  41. package/dist/runtime-framework/react/page.ts +1 -1
  42. package/dist/runtime-framework/react/utils/index.ts +3 -3
  43. package/dist/runtime-framework/solid/app.ts +7 -3
  44. package/dist/runtime-framework/solid/page.ts +1 -1
  45. package/dist/runtime-framework/solid/utils/index.ts +3 -3
  46. package/package.json +9 -9
@@ -23,7 +23,7 @@ export const ReactMeta: IReactMeta = {
23
23
  PageContext: EMPTY_OBJ
24
24
  }
25
25
 
26
- const pageKeyId = incrementId()
26
+ const pageKeyId = incrementId(1)
27
27
 
28
28
  export function connectReactPage (
29
29
  R: typeof React,
@@ -72,7 +72,7 @@ export function connectReactPage (
72
72
  }))
73
73
 
74
74
  return h(
75
- 'view',
75
+ 'taro-page',
76
76
  { id, className: 'taro_page' },
77
77
  children
78
78
  )
@@ -85,7 +85,7 @@ export function createReactApp (
85
85
  App,
86
86
  react,
87
87
  dom,
88
- _config?: any
88
+ config?: any
89
89
  ) {
90
90
  ReactMeta.R = react
91
91
  h = react.createElement
@@ -107,10 +107,10 @@ export function createReactApp (
107
107
  }
108
108
 
109
109
  function renderReactRoot () {
110
- const appId = 'app'
110
+ const appId = config?.appId || 'app'
111
111
 
112
112
  if (ReactMeta.Container === EMPTY_OBJ) {
113
- const Container = document.createElement('view')
113
+ const Container = document.getElementById(appId)
114
114
 
115
115
  Container.id = appId
116
116
  ReactMeta.Container = Container
@@ -132,7 +132,7 @@ export function createReactApp (
132
132
 
133
133
  public mount (pageComponent: any, id: string, getCtx: () => any, cb: () => void) {
134
134
  const pageWrapper = connectReactPage(react, id, getCtx)(pageComponent)
135
- const key = id + pageKeyId()
135
+ const key = `${id}_${pageKeyId()}`
136
136
  const page = () => h(pageWrapper, { key, tid: id })
137
137
  this.pages.push(page)
138
138
  this.forceUpdate(cb)
@@ -19,7 +19,7 @@ import { EMPTY_OBJ, incrementId, isClassComponent } from './utils'
19
19
  import type { AppInstance } from '@tarojs/taro'
20
20
  import type * as React from 'react'
21
21
 
22
- const getNativeCompId = incrementId()
22
+ const getNativeCompId = incrementId(1)
23
23
  let h: typeof React.createElement
24
24
  let ReactDOM
25
25
  let nativeComponentApp: AppInstance
@@ -8,7 +8,7 @@ import { incrementId } from './utils'
8
8
  import type { PageConfig } from '@tarojs/taro'
9
9
 
10
10
  const instances = new Map<string, any>()
11
- const pageId = incrementId()
11
+ const pageId = incrementId(1)
12
12
 
13
13
  export function injectPageInstance (inst: any, id: string) {
14
14
  hooks.call('mergePageInstance', instances.get(id), inst)
@@ -7,9 +7,9 @@ export function capitalize (s: string) {
7
7
  return s.charAt(0).toUpperCase() + s.slice(1)
8
8
  }
9
9
 
10
- export const incrementId = () => {
11
- let n = 0
12
- return () => (n++).toString()
10
+ export const incrementId = (init = 0) => {
11
+ let n = init
12
+ return () => n++
13
13
  }
14
14
 
15
15
  export function ensureIsArray<T> (item: T | T[]): T[] {
@@ -31,10 +31,10 @@ export function createSolidApp(App: SolidComponent, config: AppConfig) {
31
31
  }
32
32
 
33
33
  function renderReactRoot() {
34
- const appId = 'app'
34
+ const appId = config?.appId || 'app'
35
35
 
36
36
  if (ReactMeta.Container === EMPTY_OBJ) {
37
- const Container = document.createElement('view')
37
+ const Container = document.getElementById(appId)
38
38
 
39
39
  Container.id = appId
40
40
  ReactMeta.Container = Container
@@ -68,7 +68,11 @@ export function createSolidApp(App: SolidComponent, config: AppConfig) {
68
68
  },
69
69
  })
70
70
 
71
- return h('root', { id }, children)
71
+ return h(
72
+ 'taro-page',
73
+ { id, className: 'taro_page' },
74
+ children
75
+ )
72
76
  },
73
77
  }),
74
78
  })
@@ -8,7 +8,7 @@ import { incrementId } from './utils'
8
8
  import type { PageConfig } from '@tarojs/taro'
9
9
 
10
10
  const instances = new Map<string, any>()
11
- const pageId = incrementId()
11
+ const pageId = incrementId(1)
12
12
 
13
13
  export function injectPageInstance (inst: any, id: string) {
14
14
  hooks.call('mergePageInstance', instances.get(id), inst)
@@ -9,9 +9,9 @@ export function capitalize (s: string) {
9
9
  return s.charAt(0).toUpperCase() + s.slice(1)
10
10
  }
11
11
 
12
- export const incrementId = () => {
13
- let n = 0
14
- return () => (n++).toString()
12
+ export const incrementId = (init = 0) => {
13
+ let n = init
14
+ return () => n++
15
15
  }
16
16
 
17
17
  export const EMPTY_OBJ: any = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-platform-harmony-ets",
3
- "version": "4.0.0-alpha.22",
3
+ "version": "4.0.0-alpha.24",
4
4
  "description": "OpenHarmony & 鸿蒙系统插件",
5
5
  "author": "O2Team",
6
6
  "homepage": "https://gitee.com/openharmony-sig/taro",
@@ -27,13 +27,13 @@
27
27
  "webpack-sources": "^3.2.3",
28
28
  "@babel/preset-react": "^7.24.1",
29
29
  "webpack": "5.91.0",
30
- "@tarojs/components": "4.0.0-alpha.22",
31
- "@tarojs/helper": "4.0.0-alpha.22",
32
- "@tarojs/runner-utils": "4.0.0-alpha.22",
33
- "@tarojs/runtime": "4.0.0-alpha.22",
34
- "@tarojs/service": "4.0.0-alpha.22",
35
- "@tarojs/taro": "4.0.0-alpha.22",
36
- "@tarojs/shared": "4.0.0-alpha.22"
30
+ "@tarojs/components": "4.0.0-alpha.24",
31
+ "@tarojs/runner-utils": "4.0.0-alpha.24",
32
+ "@tarojs/helper": "4.0.0-alpha.24",
33
+ "@tarojs/runtime": "4.0.0-alpha.24",
34
+ "@tarojs/service": "4.0.0-alpha.24",
35
+ "@tarojs/shared": "4.0.0-alpha.24",
36
+ "@tarojs/taro": "4.0.0-alpha.24"
37
37
  },
38
38
  "devDependencies": {
39
39
  "fast-glob": "^3.3.1",
@@ -42,7 +42,7 @@
42
42
  "rollup-plugin-ts": "^3.0.2",
43
43
  "solid-js": "^1.8.16",
44
44
  "tslib": "^2.4.0",
45
- "rollup-plugin-copy": "4.0.0-alpha.22"
45
+ "rollup-plugin-copy": "4.0.0-alpha.24"
46
46
  },
47
47
  "scripts": {
48
48
  "prod": "pnpm run build",