@tarojs/plugin-platform-harmony-ets 4.0.0-alpha.25 → 4.0.0-alpha.26

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.
@@ -116,6 +116,7 @@ export default struct TaroInput {
116
116
 
117
117
  eventHandler(event, 'focus', this.node)
118
118
  })
119
+ .enableKeyboardOnFocus(typeof (this.node._attrs as TaroAny)?.enableKeyboardOnFocus === 'undefined' ? true : (this.node._attrs as TaroAny).enableKeyboardOnFocus)
119
120
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
120
121
  if (this.node) {
121
122
  this.node._nodeInfo.areaInfo = res[1]
@@ -1,3 +1,5 @@
1
+ // @ts-ignore
2
+ import { getPageById } from '@tarojs/plugin-framework-react/dist/runtime'
1
3
  import { eventCenter, eventSource } from '@tarojs/runtime/dist/runtime.esm'
2
4
  import { EMPTY_OBJ, toCamelCase } from '@tarojs/shared'
3
5
 
@@ -316,6 +318,13 @@ export class TaroElement<
316
318
  // 3、removeChild的时候,会判断是否需要移除层级
317
319
  public setLayer (value: number) {
318
320
  if (!this.parentNode) return // 没有父节点,不需要设置层级关系
321
+
322
+
323
+ const currentPage = getPageById(this.getAttribute('__fixed'))
324
+ if (currentPage) {
325
+ this._page = currentPage
326
+ }
327
+
319
328
  this._nodeInfo.layer = value
320
329
 
321
330
  const currentLayerNode = this.currentLayerNode
@@ -391,7 +400,7 @@ export class TaroElement<
391
400
  }
392
401
 
393
402
  // 首次设置,不用实例替换
394
- if (!this._nodeInfo.hasAnimation) {
403
+ if (!this._nodeInfo.hasAnimation && playing) {
395
404
  this._nodeInfo.hasAnimation = true
396
405
  // 下一帧播放,等节点样式首次设置上去在进行覆盖
397
406
  setTimeout(() => {
@@ -416,7 +425,7 @@ export class TaroElement<
416
425
  if (playing) {
417
426
  this.playAnimation()
418
427
  }
419
- }, 0)
428
+ }, playing ? 0 : 100)
420
429
  }
421
430
  }
422
431
 
@@ -66,7 +66,7 @@ function initNativeComponentEntry (params: InitNativeComponentEntryParams) {
66
66
 
67
67
  render () {
68
68
  return h(
69
- 'view',
69
+ 'taro-page',
70
70
  {
71
71
  ref: this.root,
72
72
  id: this.props.compId,
@@ -175,6 +175,22 @@ function initNativeComponentEntry (params: InitNativeComponentEntryParams) {
175
175
  }
176
176
  // eslint-disable-next-line react/no-deprecated
177
177
  ReactDOM.render(h(Entry, {}), app)
178
+ // const root = ReactDOM.createRoot(app)
179
+ // root.render?.(h(Entry))
180
+ }
181
+
182
+
183
+ const pages = new Map<string, any>()
184
+ export function setPageById (inst: any, id: string) {
185
+ pages.set(id, inst)
186
+ }
187
+
188
+ export function getPageById (id: string): any {
189
+ return pages.get(id)
190
+ }
191
+
192
+ export function removePageById (id: string) {
193
+ pages.delete(id)
178
194
  }
179
195
 
180
196
  export function createNativePageConfig (
@@ -223,6 +239,8 @@ export function createNativePageConfig (
223
239
  const uniqueOptions = Object.assign({}, options, { $taroTimestamp: Date.now() })
224
240
  const $taroPath = (this.$taroPath = getPath(id, uniqueOptions))
225
241
 
242
+ setPageById(this, $taroPath)
243
+
226
244
  // this.$taroParams 作为暴露给开发者的页面参数对象,可以被随意修改
227
245
  if (this.$taroParams == null) {
228
246
  this.$taroParams = uniqueOptions
@@ -268,6 +286,10 @@ export function createNativePageConfig (
268
286
  window.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
269
287
  // 触发onUnload生命周期
270
288
  safeExecute($taroPath, ONUNLOAD)
289
+
290
+
291
+ removePageById($taroPath)
292
+
271
293
  resetCurrent.call(this)
272
294
  unmounting = true
273
295
  Current.app!.unmount!($taroPath, () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-platform-harmony-ets",
3
- "version": "4.0.0-alpha.25",
3
+ "version": "4.0.0-alpha.26",
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.25",
31
- "@tarojs/helper": "4.0.0-alpha.25",
32
- "@tarojs/runtime": "4.0.0-alpha.25",
33
- "@tarojs/service": "4.0.0-alpha.25",
34
- "@tarojs/runner-utils": "4.0.0-alpha.25",
35
- "@tarojs/shared": "4.0.0-alpha.25",
36
- "@tarojs/taro": "4.0.0-alpha.25"
30
+ "@tarojs/components": "4.0.0-alpha.26",
31
+ "@tarojs/runtime": "4.0.0-alpha.26",
32
+ "@tarojs/helper": "4.0.0-alpha.26",
33
+ "@tarojs/runner-utils": "4.0.0-alpha.26",
34
+ "@tarojs/service": "4.0.0-alpha.26",
35
+ "@tarojs/shared": "4.0.0-alpha.26",
36
+ "@tarojs/taro": "4.0.0-alpha.26"
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.25"
45
+ "rollup-plugin-copy": "4.0.0-alpha.26"
46
46
  },
47
47
  "scripts": {
48
48
  "prod": "pnpm run build",