@lynx-js/react 0.120.0 → 0.121.0

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 (307) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/package.json +35 -7
  3. package/runtime/lazy/compat.js +1 -0
  4. package/runtime/lazy/react.js +1 -0
  5. package/runtime/lib/core/hooks/mainThread.d.ts +1 -0
  6. package/runtime/lib/core/hooks/mainThread.js +7 -0
  7. package/runtime/lib/core/hooks/mainThread.js.map +1 -0
  8. package/runtime/lib/{snapshot/hooks/mainThread.d.ts → core/hooks/mainThreadImpl.d.ts} +2 -1
  9. package/runtime/lib/{snapshot/hooks/mainThread.js → core/hooks/mainThreadImpl.js} +45 -34
  10. package/runtime/lib/core/hooks/mainThreadImpl.js.map +1 -0
  11. package/runtime/lib/{snapshot → core}/hooks/react.js +1 -1
  12. package/runtime/lib/core/hooks/react.js.map +1 -0
  13. package/runtime/lib/{snapshot → core}/hooks/useLynxGlobalEventListener.d.ts +1 -1
  14. package/runtime/lib/{snapshot → core}/hooks/useLynxGlobalEventListener.js +1 -1
  15. package/runtime/lib/core/hooks/useLynxGlobalEventListener.js.map +1 -0
  16. package/runtime/lib/element-template/background/attr-slots.d.ts +2 -0
  17. package/runtime/lib/element-template/background/attr-slots.js +34 -0
  18. package/runtime/lib/element-template/background/attr-slots.js.map +1 -0
  19. package/runtime/lib/element-template/background/commit-context.d.ts +13 -0
  20. package/runtime/lib/element-template/background/commit-context.js +25 -0
  21. package/runtime/lib/element-template/background/commit-context.js.map +1 -0
  22. package/runtime/lib/element-template/background/commit-hook.d.ts +7 -0
  23. package/runtime/lib/element-template/background/commit-hook.js +96 -0
  24. package/runtime/lib/element-template/background/commit-hook.js.map +1 -0
  25. package/runtime/lib/element-template/background/destroy.d.ts +1 -0
  26. package/runtime/lib/element-template/background/destroy.js +17 -0
  27. package/runtime/lib/element-template/background/destroy.js.map +1 -0
  28. package/runtime/lib/element-template/background/document.d.ts +7 -0
  29. package/runtime/lib/element-template/background/document.js +27 -0
  30. package/runtime/lib/element-template/background/document.js.map +1 -0
  31. package/runtime/lib/element-template/background/hydrate.d.ts +4 -0
  32. package/runtime/lib/element-template/background/hydrate.js +219 -0
  33. package/runtime/lib/element-template/background/hydrate.js.map +1 -0
  34. package/runtime/lib/element-template/background/hydration-listener.d.ts +2 -0
  35. package/runtime/lib/element-template/background/hydration-listener.js +93 -0
  36. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -0
  37. package/runtime/lib/element-template/background/instance.d.ts +39 -0
  38. package/runtime/lib/element-template/background/instance.js +349 -0
  39. package/runtime/lib/element-template/background/instance.js.map +1 -0
  40. package/runtime/lib/element-template/background/manager.d.ts +10 -0
  41. package/runtime/lib/element-template/background/manager.js +60 -0
  42. package/runtime/lib/element-template/background/manager.js.map +1 -0
  43. package/runtime/lib/element-template/client/root.d.ts +36 -0
  44. package/runtime/lib/element-template/client/root.js +33 -0
  45. package/runtime/lib/element-template/client/root.js.map +1 -0
  46. package/runtime/lib/element-template/debug/alog.d.ts +34 -0
  47. package/runtime/lib/element-template/debug/alog.js +93 -0
  48. package/runtime/lib/element-template/debug/alog.js.map +1 -0
  49. package/runtime/lib/element-template/debug/elementPAPICall.d.ts +1 -0
  50. package/runtime/lib/element-template/debug/elementPAPICall.js +75 -0
  51. package/runtime/lib/element-template/debug/elementPAPICall.js.map +1 -0
  52. package/runtime/lib/element-template/debug/profile.d.ts +3 -0
  53. package/runtime/lib/element-template/debug/profile.js +141 -0
  54. package/runtime/lib/element-template/debug/profile.js.map +1 -0
  55. package/runtime/lib/element-template/hooks/react.d.ts +14 -0
  56. package/runtime/lib/element-template/hooks/react.js +24 -0
  57. package/runtime/lib/element-template/hooks/react.js.map +1 -0
  58. package/runtime/lib/element-template/index.d.ts +7 -0
  59. package/runtime/lib/element-template/index.js +45 -0
  60. package/runtime/lib/element-template/index.js.map +1 -0
  61. package/runtime/lib/element-template/internal.d.ts +6 -0
  62. package/runtime/lib/element-template/internal.js +44 -0
  63. package/runtime/lib/element-template/internal.js.map +1 -0
  64. package/runtime/lib/element-template/jsx-dev-runtime/index.d.ts +1 -0
  65. package/runtime/lib/element-template/jsx-dev-runtime/index.js +5 -0
  66. package/runtime/lib/element-template/jsx-dev-runtime/index.js.map +1 -0
  67. package/runtime/lib/element-template/jsx-runtime/index.d.ts +19 -0
  68. package/runtime/lib/element-template/jsx-runtime/index.js +60 -0
  69. package/runtime/lib/element-template/jsx-runtime/index.js.map +1 -0
  70. package/runtime/lib/element-template/lynx/env.d.ts +1 -0
  71. package/runtime/lib/element-template/lynx/env.js +89 -0
  72. package/runtime/lib/element-template/lynx/env.js.map +1 -0
  73. package/runtime/lib/element-template/lynx/performance.d.ts +23 -0
  74. package/runtime/lib/element-template/lynx/performance.js +135 -0
  75. package/runtime/lib/element-template/lynx/performance.js.map +1 -0
  76. package/runtime/lib/element-template/native/callDestroyLifetimeFun.d.ts +1 -0
  77. package/runtime/lib/element-template/native/callDestroyLifetimeFun.js +8 -0
  78. package/runtime/lib/element-template/native/callDestroyLifetimeFun.js.map +1 -0
  79. package/runtime/lib/element-template/native/index.d.ts +1 -0
  80. package/runtime/lib/element-template/native/index.js +53 -0
  81. package/runtime/lib/element-template/native/index.js.map +1 -0
  82. package/runtime/lib/element-template/native/main-thread-api.d.ts +2 -0
  83. package/runtime/lib/element-template/native/main-thread-api.js +27 -0
  84. package/runtime/lib/element-template/native/main-thread-api.js.map +1 -0
  85. package/runtime/lib/element-template/native/mts-destroy.d.ts +3 -0
  86. package/runtime/lib/element-template/native/mts-destroy.js +37 -0
  87. package/runtime/lib/element-template/native/mts-destroy.js.map +1 -0
  88. package/runtime/lib/element-template/native/patch-listener.d.ts +2 -0
  89. package/runtime/lib/element-template/native/patch-listener.js +66 -0
  90. package/runtime/lib/element-template/native/patch-listener.js.map +1 -0
  91. package/runtime/lib/element-template/prop-adapters/event-value.d.ts +1 -0
  92. package/runtime/lib/element-template/prop-adapters/event-value.js +7 -0
  93. package/runtime/lib/element-template/prop-adapters/event-value.js.map +1 -0
  94. package/runtime/lib/element-template/prop-adapters/event.d.ts +7 -0
  95. package/runtime/lib/element-template/prop-adapters/event.js +61 -0
  96. package/runtime/lib/element-template/prop-adapters/event.js.map +1 -0
  97. package/runtime/lib/element-template/prop-adapters/spread.d.ts +5 -0
  98. package/runtime/lib/element-template/prop-adapters/spread.js +45 -0
  99. package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -0
  100. package/runtime/lib/element-template/protocol/lifecycle-constant.d.ts +4 -0
  101. package/runtime/lib/element-template/protocol/lifecycle-constant.js +9 -0
  102. package/runtime/lib/element-template/protocol/lifecycle-constant.js.map +1 -0
  103. package/runtime/lib/element-template/protocol/opcodes.d.ts +7 -0
  104. package/runtime/lib/element-template/protocol/opcodes.js +10 -0
  105. package/runtime/lib/element-template/protocol/opcodes.js.map +1 -0
  106. package/runtime/lib/element-template/protocol/types.d.ts +50 -0
  107. package/runtime/lib/element-template/protocol/types.js +5 -0
  108. package/runtime/lib/element-template/protocol/types.js.map +1 -0
  109. package/runtime/lib/element-template/runtime/components/slot.d.ts +1 -0
  110. package/runtime/lib/element-template/runtime/components/slot.js +11 -0
  111. package/runtime/lib/element-template/runtime/components/slot.js.map +1 -0
  112. package/runtime/lib/element-template/runtime/page/page.d.ts +2 -0
  113. package/runtime/lib/element-template/runtime/page/page.js +8 -0
  114. package/runtime/lib/element-template/runtime/page/page.js.map +1 -0
  115. package/runtime/lib/element-template/runtime/page/root-instance.d.ts +10 -0
  116. package/runtime/lib/element-template/runtime/page/root-instance.js +17 -0
  117. package/runtime/lib/element-template/runtime/page/root-instance.js.map +1 -0
  118. package/runtime/lib/element-template/runtime/patch.d.ts +3 -0
  119. package/runtime/lib/element-template/runtime/patch.js +145 -0
  120. package/runtime/lib/element-template/runtime/patch.js.map +1 -0
  121. package/runtime/lib/element-template/runtime/render/render-main-thread.d.ts +2 -0
  122. package/runtime/lib/element-template/runtime/render/render-main-thread.js +53 -0
  123. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -0
  124. package/runtime/lib/element-template/runtime/render/render-opcodes.d.ts +4 -0
  125. package/runtime/lib/element-template/runtime/render/render-opcodes.js +134 -0
  126. package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +1 -0
  127. package/runtime/lib/element-template/runtime/render/render-to-opcodes.d.ts +14 -0
  128. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js +272 -0
  129. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js.map +1 -0
  130. package/runtime/lib/element-template/runtime/template/attr-slot-plan.d.ts +11 -0
  131. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +23 -0
  132. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -0
  133. package/runtime/lib/element-template/runtime/template/handle.d.ts +5 -0
  134. package/runtime/lib/element-template/runtime/template/handle.js +23 -0
  135. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -0
  136. package/runtime/lib/element-template/runtime/template/registry.d.ts +13 -0
  137. package/runtime/lib/element-template/runtime/template/registry.js +46 -0
  138. package/runtime/lib/element-template/runtime/template/registry.js.map +1 -0
  139. package/runtime/lib/index.d.ts +5 -3
  140. package/runtime/lib/index.js +7 -4
  141. package/runtime/lib/index.js.map +1 -1
  142. package/runtime/lib/internal.d.ts +2 -3
  143. package/runtime/lib/internal.js +3 -4
  144. package/runtime/lib/internal.js.map +1 -1
  145. package/runtime/lib/lynx-api.d.ts +1 -1
  146. package/runtime/lib/lynx-api.js +3 -3
  147. package/runtime/lib/lynx-api.js.map +1 -1
  148. package/runtime/lib/lynx.d.ts +1 -1
  149. package/runtime/lib/lynx.js +3 -3
  150. package/runtime/lib/lynx.js.map +1 -1
  151. package/runtime/lib/{snapshot/debug → shared}/component-stack.js +1 -1
  152. package/runtime/lib/shared/component-stack.js.map +1 -0
  153. package/runtime/lib/{snapshot/debug → shared}/profile.js +6 -4
  154. package/runtime/lib/shared/profile.js.map +1 -0
  155. package/runtime/lib/{snapshot/renderToOpcodes/constants.js → shared/render-constants.js} +1 -1
  156. package/runtime/lib/shared/render-constants.js.map +1 -0
  157. package/runtime/lib/snapshot/alog/elementPAPICall.js +1 -1
  158. package/runtime/lib/snapshot/alog/elementPAPICall.js.map +1 -1
  159. package/runtime/lib/snapshot/alog/render.js +1 -1
  160. package/runtime/lib/snapshot/alog/render.js.map +1 -1
  161. package/runtime/lib/snapshot/compat/initData.d.ts +2 -2
  162. package/runtime/lib/snapshot/compat/initData.js +1 -1
  163. package/runtime/lib/snapshot/compat/initData.js.map +1 -1
  164. package/runtime/lib/snapshot/debug/profileHooks.js +1 -1
  165. package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -1
  166. package/runtime/lib/snapshot/debug/vnodeSource.js +1 -1
  167. package/runtime/lib/snapshot/debug/vnodeSource.js.map +1 -1
  168. package/runtime/lib/snapshot/gesture/processGesture.d.ts +2 -0
  169. package/runtime/lib/snapshot/gesture/processGesture.js +16 -1
  170. package/runtime/lib/snapshot/gesture/processGesture.js.map +1 -1
  171. package/runtime/lib/snapshot/legacy-react-runtime/index.d.ts +2 -2
  172. package/runtime/lib/snapshot/legacy-react-runtime/index.js +2 -2
  173. package/runtime/lib/snapshot/legacy-react-runtime/index.js.map +1 -1
  174. package/runtime/lib/snapshot/lifecycle/destroy.js +1 -1
  175. package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
  176. package/runtime/lib/snapshot/lifecycle/event/jsReady.js +1 -1
  177. package/runtime/lib/snapshot/lifecycle/event/jsReady.js.map +1 -1
  178. package/runtime/lib/snapshot/lifecycle/isRendering.js +1 -1
  179. package/runtime/lib/snapshot/lifecycle/isRendering.js.map +1 -1
  180. package/runtime/lib/snapshot/lifecycle/patch/commit.js +2 -2
  181. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
  182. package/runtime/lib/snapshot/lifecycle/patch/nodesRefApply.d.ts +15 -0
  183. package/runtime/lib/snapshot/lifecycle/patch/nodesRefApply.js +102 -0
  184. package/runtime/lib/snapshot/lifecycle/patch/nodesRefApply.js.map +1 -0
  185. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.d.ts +2 -0
  186. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js +17 -0
  187. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js.map +1 -1
  188. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js +26 -0
  189. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js.map +1 -1
  190. package/runtime/lib/snapshot/lifecycle/ref/delay.d.ts +1 -0
  191. package/runtime/lib/snapshot/lifecycle/ref/delay.js +5 -3
  192. package/runtime/lib/snapshot/lifecycle/ref/delay.js.map +1 -1
  193. package/runtime/lib/snapshot/lifecycle/reload.js +1 -1
  194. package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
  195. package/runtime/lib/snapshot/lifecycle/render.js +1 -1
  196. package/runtime/lib/snapshot/lifecycle/render.js.map +1 -1
  197. package/runtime/lib/snapshot/list/list.js +4 -1
  198. package/runtime/lib/snapshot/list/list.js.map +1 -1
  199. package/runtime/lib/snapshot/list/listUpdateInfo.js +1 -1
  200. package/runtime/lib/snapshot/list/listUpdateInfo.js.map +1 -1
  201. package/runtime/lib/snapshot/lynx/component.js +1 -1
  202. package/runtime/lib/snapshot/lynx/component.js.map +1 -1
  203. package/runtime/lib/snapshot/lynx/element.d.ts +6 -0
  204. package/runtime/lib/snapshot/lynx/element.js +35 -0
  205. package/runtime/lib/snapshot/lynx/element.js.map +1 -0
  206. package/runtime/lib/snapshot/lynx/env.js +1 -1
  207. package/runtime/lib/snapshot/lynx/env.js.map +1 -1
  208. package/runtime/lib/snapshot/lynx/nodesRef.d.ts +6 -0
  209. package/runtime/lib/snapshot/lynx/nodesRef.js +31 -0
  210. package/runtime/lib/snapshot/lynx/nodesRef.js.map +1 -0
  211. package/runtime/lib/snapshot/lynx/performance.js +1 -1
  212. package/runtime/lib/snapshot/lynx/performance.js.map +1 -1
  213. package/runtime/lib/snapshot/lynx/portals.d.ts +9 -0
  214. package/runtime/lib/snapshot/lynx/portals.js +120 -0
  215. package/runtime/lib/snapshot/lynx/portals.js.map +1 -0
  216. package/runtime/lib/snapshot/lynx/portalsPending.d.ts +10 -0
  217. package/runtime/lib/snapshot/lynx/portalsPending.js +38 -0
  218. package/runtime/lib/snapshot/lynx/portalsPending.js.map +1 -0
  219. package/runtime/lib/snapshot/lynx/runWithForce.js +1 -1
  220. package/runtime/lib/snapshot/lynx/runWithForce.js.map +1 -1
  221. package/runtime/lib/snapshot/lynx/tt.js +2 -2
  222. package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
  223. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js +1 -1
  224. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -1
  225. package/runtime/lib/snapshot/renderToOpcodes/index.js +1 -1
  226. package/runtime/lib/snapshot/renderToOpcodes/index.js.map +1 -1
  227. package/runtime/lib/snapshot/renderToOpcodes/opcodes.js +1 -1
  228. package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -1
  229. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.d.ts +1 -1
  230. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +20 -21
  231. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
  232. package/runtime/lib/snapshot/snapshot/constants.d.ts +4 -0
  233. package/runtime/lib/snapshot/snapshot/constants.js +4 -0
  234. package/runtime/lib/snapshot/snapshot/constants.js.map +1 -1
  235. package/runtime/lib/snapshot/snapshot/definition.d.ts +1 -0
  236. package/runtime/lib/snapshot/snapshot/definition.js +49 -1
  237. package/runtime/lib/snapshot/snapshot/definition.js.map +1 -1
  238. package/runtime/lib/snapshot/snapshot/dynamicPartType.d.ts +12 -0
  239. package/runtime/lib/snapshot/snapshot/dynamicPartType.js +12 -0
  240. package/runtime/lib/snapshot/snapshot/dynamicPartType.js.map +1 -1
  241. package/runtime/lib/snapshot/snapshot/event.d.ts +1 -1
  242. package/runtime/lib/snapshot/snapshot/event.js +0 -4
  243. package/runtime/lib/snapshot/snapshot/event.js.map +1 -1
  244. package/runtime/lib/snapshot/snapshot/gesture.js +9 -3
  245. package/runtime/lib/snapshot/snapshot/gesture.js.map +1 -1
  246. package/runtime/lib/snapshot/snapshot/reconstructInstanceTree.d.ts +14 -0
  247. package/runtime/lib/snapshot/snapshot/reconstructInstanceTree.js +27 -0
  248. package/runtime/lib/snapshot/snapshot/reconstructInstanceTree.js.map +1 -0
  249. package/runtime/lib/snapshot/snapshot/snapshot.js +62 -3
  250. package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -1
  251. package/runtime/lib/snapshot/snapshot/spread.d.ts +1 -1
  252. package/runtime/lib/snapshot/snapshot/spread.js +32 -1
  253. package/runtime/lib/snapshot/snapshot/spread.js.map +1 -1
  254. package/runtime/lib/snapshot/snapshot/utils.d.ts +1 -3
  255. package/runtime/lib/snapshot/snapshot/utils.js +5 -0
  256. package/runtime/lib/snapshot/snapshot/utils.js.map +1 -1
  257. package/runtime/lib/snapshot/snapshot/workletEvent.d.ts +1 -1
  258. package/runtime/lib/snapshot/snapshot/workletEvent.js +10 -5
  259. package/runtime/lib/snapshot/snapshot/workletEvent.js.map +1 -1
  260. package/runtime/lib/snapshot/snapshot/workletRef.d.ts +1 -1
  261. package/runtime/lib/snapshot/snapshot/workletRef.js +6 -3
  262. package/runtime/lib/snapshot/snapshot/workletRef.js.map +1 -1
  263. package/runtime/lib/snapshot/worklet/ref/workletRef.js +1 -1
  264. package/runtime/lib/snapshot/worklet/ref/workletRef.js.map +1 -1
  265. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  266. package/runtime/lib/utils.js +1 -1
  267. package/runtime/lib/utils.js.map +1 -1
  268. package/runtime/lib/worklet-runtime/bindings/observers.d.ts +1 -0
  269. package/runtime/lib/worklet-runtime/bindings/observers.js +5 -3
  270. package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -1
  271. package/runtime/lib/worklet-runtime/bindings/types.d.ts +1 -1
  272. package/runtime/lib/worklet-runtime/bindings/types.js.map +1 -1
  273. package/runtime/lib/worklet-runtime/hydrate.js +1 -1
  274. package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
  275. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.d.ts +1 -0
  276. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js +5 -0
  277. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
  278. package/runtime/lib/worklet-runtime/workletRuntime.js +1 -2
  279. package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
  280. package/runtime/worklet-runtime/dev.js +8 -4
  281. package/runtime/worklet-runtime/main.js +1 -1
  282. package/testing-library/dist/env/index.js +25 -7
  283. package/testing-library/dist/fire-event.d.ts +21 -7
  284. package/testing-library/dist/index.d.ts +2 -0
  285. package/testing-library/dist/pure.js +27 -9
  286. package/testing-library/dist/type-entry/index.js +0 -0
  287. package/transform/dist/wasm.cjs +833 -285
  288. package/transform/index.d.ts +28 -1
  289. package/types/react.docs.d.ts +9 -1
  290. package/refresh/.gitignore +0 -1
  291. package/refresh/.npmignore +0 -3
  292. package/refresh/.turbo/turbo-build.log +0 -12
  293. package/refresh/package.json +0 -20
  294. package/refresh/rslib.config.ts +0 -24
  295. package/refresh/tsconfig.json +0 -4
  296. package/refresh/turbo.json +0 -15
  297. package/runtime/lib/snapshot/debug/component-stack.js.map +0 -1
  298. package/runtime/lib/snapshot/debug/profile.js.map +0 -1
  299. package/runtime/lib/snapshot/hooks/mainThread.js.map +0 -1
  300. package/runtime/lib/snapshot/hooks/react.js.map +0 -1
  301. package/runtime/lib/snapshot/hooks/useLynxGlobalEventListener.js.map +0 -1
  302. package/runtime/lib/snapshot/renderToOpcodes/constants.js.map +0 -1
  303. package/testing-library/README.md +0 -109
  304. /package/runtime/lib/{snapshot → core}/hooks/react.d.ts +0 -0
  305. /package/runtime/lib/{snapshot/debug → shared}/component-stack.d.ts +0 -0
  306. /package/runtime/lib/{snapshot/debug → shared}/profile.d.ts +0 -0
  307. /package/runtime/lib/{snapshot/renderToOpcodes/constants.d.ts → shared/render-constants.d.ts} +0 -0
@@ -1 +1 @@
1
- (()=>{"use strict";var e,t,n;let r,l,i;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class a{cancel(){return __ElementAnimate(this.effect.target.element,[3,this.id])}pause(){return __ElementAnimate(this.effect.target.element,[2,this.id])}play(){return __ElementAnimate(this.effect.target.element,[1,this.id])}start(){return __ElementAnimate(this.effect.target.element,[0,this.id,this.effect.keyframes,this.effect.options])}constructor(e){o(this,"effect",void 0),o(this,"id",void 0),this.effect=e,this.id="__lynx-inner-js-animation-"+a.count++,this.start()}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}o(a,"count",0);class s{constructor(e,t,n){u(this,"target",void 0),u(this,"keyframes",void 0),u(this,"options",void 0),this.target=e,this.keyframes=t,this.options=n}}function c(e,t){var n;let r=(null!=(n=SystemInfo.lynxSdkVersion)?n:"1.0").split(".");return Number(r[0])>e||Number(r[0])==e&&Number(r[1])>t}let d=!1,f=!0;class y{setAttribute(e,t){__SetAttribute(this.element,e,t),this.flushElementTree()}setStyleProperty(e,t){__AddInlineStyle(this.element,e,t),this.flushElementTree()}setStyleProperties(e){for(let t in e)__AddInlineStyle(this.element,t,e[t]);this.flushElementTree()}getAttribute(e){return __GetAttributeByName(this.element,e)}getAttributeNames(){return __GetAttributeNames(this.element)}querySelector(e){let t=__QuerySelector(this.element,e,{});return t?new y(t):null}querySelectorAll(e){return __QuerySelectorAll(this.element,e,{}).map(e=>new y(e))}getComputedStyleProperty(e){if(!c(3,4))throw Error("getComputedStyleProperty requires Lynx sdk version 3.5");if(!e)throw Error("getComputedStyleProperty: key is required");return __GetComputedStyleByKey(this.element,e)}animate(e,t){return new a(new s(this,e,"number"==typeof t?{duration:t}:null!=t?t:{}))}invoke(e,t){return new Promise((n,r)=>{__InvokeUIMethod(this.element,e,null!=t?t:{},e=>{0===e.code?n(e.data):r(Error("UI method invoke: "+JSON.stringify(e)))}),this.flushElementTree()})}flushElementTree(){!d&&f&&(d=!0,Promise.resolve().then(()=>{d=!1,__FlushElementTree()}))}constructor(e){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"element",void 0),Object.defineProperty(this,"element",{get:()=>e})}}class m{static get(){return null!=m.pageElement||(m.pageElement=__GetPageElement()),m.pageElement}}function h(e,t,n){let r;try{r=runWorklet(e,t)}finally{lynx.getJSContext().dispatchEvent({type:"Lynx.Worklet.FunctionCallRet",data:JSON.stringify({resolveId:n,returnValue:r})})}}t=void 0,(e="pageElement")in m?Object.defineProperty(m,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):m[e]=t;let _=(e,t)=>({current:t,_wvid:e}),p=e=>{let t,n=e._wvid;return n<0?(t=r._firstScreenWorkletRefMap[n])||(t=r._firstScreenWorkletRefMap[n]=_(n,e._initValue)):t=r._workletRefMap[n],t};function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t,n){lynxWorkletImpl._workletMap[t]=n}let v=new WeakMap;function I(e,t){if("object"!=typeof e||null===e)return e;if(t){let t=v.get(e);if(t)return t}let n={main:e};return x(n,0,e),t&&v.set(e,n.main),n.main}let x=(e,t,n)=>{if(++t>=1e3)throw Error("Depth of value exceeds limit of 1000.");if("object"==typeof e&&null!==e)for(let l in e){let i=e[l];if("object"==typeof i&&null!==i){if("elementRefptr"in i){e[l]=new y(i.elementRefptr);continue}if(!(i instanceof y)){if(x(i,t,n),"_wvid"in i){e[l]=p(i);continue}if("_wkltId"in i){e[l]=lynxWorkletImpl._workletMap[i._wkltId].bind({...i}),e[l].ctx=i;continue}if("_jsFnId"in i){var r;i._execId=n._execId,null==(r=lynxWorkletImpl._jsFunctionLifecycleManager)||r.addRef(n._execId,i);continue}}}}};if(void 0===globalThis.lynxWorkletImpl){let e,t;globalThis.lynxWorkletImpl={_workletMap:{},_refImpl:r={_workletRefMap:{},_firstScreenWorkletRefMap:{},updateWorkletRef:function(e,t){p(e).current=t?new y(t):null},updateWorkletRefInitValueChanges:function(e){e.forEach(([e,t])=>{r._workletRefMap[e]||(r._workletRefMap[e]=_(e,t))})},clearFirstScreenWorkletRefMap:function(){r._firstScreenWorkletRefMap={}}},_runOnBackgroundDelayImpl:l={delayedBackgroundFunctionArray:[],delayRunOnBackground:function(e,t){var n;l.delayedBackgroundFunctionArray.push({task:t}),(null!=(n=e._delayIndices)?n:e._delayIndices=[]).push(l.delayedBackgroundFunctionArray.length-1)},runDelayedBackgroundFunctions:function(){for(let e of l.delayedBackgroundFunctionArray)e.jsFnHandle&&e.task(e.jsFnHandle._jsFnId,e.jsFnHandle._execId);l.delayedBackgroundFunctionArray.length=0}},_hydrateCtx:function(e,t){!function e(t,n,r){if(t&&"object"==typeof t&&n&&"object"==typeof n&&(!t._wkltId||t._wkltId===n._wkltId))for(let o in t)if("_wvid"===o){var l,i;l=t[o],"_initValue"in(i=n)||(lynxWorkletImpl._refImpl._workletRefMap[l]=i)}else if("_jsFn"===o)!function(e,t,n){for(let r in e){let l=e[r],i=t[r];if(!(null==i?void 0:i._delayIndices)){i&&(i._isFirstScreen=!1,i._execId=n,Object.assign(i,l));continue}for(let e of i._delayIndices){let t=lynxWorkletImpl._runOnBackgroundDelayImpl.delayedBackgroundFunctionArray[e];l._execId=n,t.jsFnHandle=l}}}(t[o],n[o],r);else{let l="function"==typeof n[o]?n[o].ctx:n[o];e(t[o],l,r)}}(e,t,e._execId)},_eventDelayImpl:i={_delayedWorkletParamsMap:new Map,runDelayedWorklet:function(e,t){(()=>{let n=i._delayedWorkletParamsMap.get(e._wkltId);if(void 0===n)return;let r=[];n.forEach(n=>{var l;let i=n[0];(null==i||null==(l=i.currentTarget)?void 0:l.elementRefptr)===t?setTimeout(()=>{runWorklet(e,n)},0):r.push(n)}),i._delayedWorkletParamsMap.set(e._wkltId,r)})()},clearDelayedWorklets:function(){i._delayedWorkletParamsMap.clear()}},_eomImpl:{setShouldFlush:function(e){f=e}},_runRunOnMainThreadTask:h},c(2,15)&&(globalThis.lynxWorkletImpl._jsFunctionLifecycleManager=new class e{addRef(e,t){var n;this.execIdRefCount.set(e,(null!=(n=this.execIdRefCount.get(e))?n:0)+1),this.registry.register(t,e)}removeRef(e){let t=this.execIdRefCount.get(e);t>1?this.execIdRefCount.set(e,t-1):(this.execIdRefCount.delete(e),this.execIdSetToFire.add(e),this.willFire||(this.willFire=!0,Promise.resolve().then(()=>{this.fire()})))}fire(){lynx.getJSContext().dispatchEvent({type:"Lynx.Worklet.releaseBackgroundWorkletCtx",data:Array.from(this.execIdSetToFire)}),this.execIdSetToFire.clear(),this.willFire=!1}constructor(){k(this,"execIdRefCount",new Map),k(this,"execIdSetToFire",new Set),k(this,"willFire",!1),k(this,"registry",void 0),this.registry=new FinalizationRegistry(this.removeRef.bind(this))}}),globalThis.registerWorklet=g,globalThis.registerWorkletInternal=g,globalThis.runWorklet=function(e,t,n){var r,l,o;let a,u;return"object"==typeof(r=e)&&null!==r&&("_wkltId"in r||"_lepusWorkletHash"in r)?"_lepusWorkletHash"in e?void(l=e._lepusWorkletHash,o=t,(u=(a=i._delayedWorkletParamsMap).get(l))?u.push(o):a.set(l,[o])):function(e,t,n){let r=(e._wkltId,I(e,!0)),l=I(t||[],!1),[i,o]=function(e,t){if(!Array.isArray(e)||"object"!=typeof e[0]||null===e[0]||(!t||1!==t.source)&&1)return[!1,{}];let n={},r=e[0];return r.stopPropagation=function(){var e;n._eventReturnResult=(null!=(e=n._eventReturnResult)?e:0)|1},r.stopImmediatePropagation=function(){var e;n._eventReturnResult=(null!=(e=n._eventReturnResult)?e:0)|2},[!0,n]}(l,n),a=r(...l);return i?{returnValue:a,eventReturnResult:o._eventReturnResult}:a}(e,t,n):void console.warn("MainThreadFunction: Invalid function object: "+JSON.stringify(e))},lynx.querySelector=function(e){let t=m.get();if(!t)return null;let n=__QuerySelector(t,e,{});return n?new y(n):null},lynx.querySelectorAll=function(e){let t=m.get();return t?__QuerySelectorAll(t,e,{}).map(e=>new y(e)):[]},globalThis.setTimeout=lynx.setTimeout,globalThis.setInterval=lynx.setInterval,globalThis.clearTimeout=lynx.clearTimeout,globalThis.clearInterval=null!=(n=lynx.clearInterval)?n:lynx.clearTimeInterval,e=lynx.requestAnimationFrame,lynx.requestAnimationFrame=globalThis.requestAnimationFrame=t=>{if(!c(2,15))throw Error("requestAnimationFrame in main thread script requires Lynx sdk version 2.16");return e(t)},globalThis.cancelAnimationFrame=lynx.cancelAnimationFrame,(t=lynx.getJSContext()).addEventListener("Lynx.Worklet.runWorkletCtx",e=>{let t=JSON.parse(e.data);h(t.worklet,t.params,t.resolveId)}),t.addEventListener("Lynx.Worklet.releaseWorkletRef",e=>{var t;t=e.data.id,delete r._workletRefMap[t]})}})();
1
+ (()=>{"use strict";var e,t,n;let r,l,i;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class a{cancel(){return __ElementAnimate(this.effect.target.element,[3,this.id])}pause(){return __ElementAnimate(this.effect.target.element,[2,this.id])}play(){return __ElementAnimate(this.effect.target.element,[1,this.id])}start(){return __ElementAnimate(this.effect.target.element,[0,this.id,this.effect.keyframes,this.effect.options])}constructor(e){o(this,"effect",void 0),o(this,"id",void 0),this.effect=e,this.id="__lynx-inner-js-animation-"+a.count++,this.start()}}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}o(a,"count",0);class u{constructor(e,t,n){s(this,"target",void 0),s(this,"keyframes",void 0),s(this,"options",void 0),this.target=e,this.keyframes=t,this.options=n}}function c(e,t){var n;let r=(null!=(n=SystemInfo.lynxSdkVersion)?n:"1.0").split(".");return Number(r[0])>e||Number(r[0])==e&&Number(r[1])>t}let d=!1,f=!0;class y{setAttribute(e,t){__SetAttribute(this.element,e,t),this.flushElementTree()}setStyleProperty(e,t){__AddInlineStyle(this.element,e,t),this.flushElementTree()}setStyleProperties(e){for(let t in e)__AddInlineStyle(this.element,t,e[t]);this.flushElementTree()}getAttribute(e){return __GetAttributeByName(this.element,e)}getAttributeNames(){return __GetAttributeNames(this.element)}querySelector(e){let t=__QuerySelector(this.element,e,{});return t?new y(t):null}querySelectorAll(e){return __QuerySelectorAll(this.element,e,{}).map(e=>new y(e))}getComputedStyleProperty(e){if(!c(3,4))throw Error("getComputedStyleProperty requires Lynx sdk version 3.5");if(!e)throw Error("getComputedStyleProperty: key is required");return __GetComputedStyleByKey(this.element,e)}animate(e,t){return new a(new u(this,e,"number"==typeof t?{duration:t}:null!=t?t:{}))}invoke(e,t){return new Promise((n,r)=>{__InvokeUIMethod(this.element,e,null!=t?t:{},e=>{0===e.code?n(e.data):r(Error("UI method invoke: "+JSON.stringify(e)))}),this.flushElementTree()})}flushElementTree(){!d&&f&&(d=!0,Promise.resolve().then(()=>{d=!1,__FlushElementTree()}))}constructor(e){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"element",void 0),Object.defineProperty(this,"element",{get:()=>e})}}class m{static get(){return null!=m.pageElement||(m.pageElement=__GetPageElement()),m.pageElement}}function h(e,t,n){let r;try{r=runWorklet(e,t)}finally{lynx.getJSContext().dispatchEvent({type:"Lynx.Worklet.FunctionCallRet",data:JSON.stringify({resolveId:n,returnValue:r})})}}t=void 0,(e="pageElement")in m?Object.defineProperty(m,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):m[e]=t;let _=(e,t)=>({current:t,_wvid:e}),p=e=>{let t,n=e._wvid;return n<0?(t=r._firstScreenWorkletRefMap[n])||(t=r._firstScreenWorkletRefMap[n]=_(n,e._initValue)):t=r._workletRefMap[n],t};function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t,n){lynxWorkletImpl._workletMap[t]=n}let v=new WeakMap;function I(e,t){if("object"!=typeof e||null===e)return e;if(t){let t=v.get(e);if(t)return t}let n={main:e};return b(n,0,e),t&&v.set(e,n.main),n.main}let b=(e,t,n)=>{if(++t>=1e3)throw Error("Depth of value exceeds limit of 1000.");if("object"==typeof e&&null!==e)for(let l in e){let i=e[l];if("object"==typeof i&&null!==i){if("elementRefptr"in i){e[l]=new y(i.elementRefptr);continue}if(!(i instanceof y)){if(b(i,t,n),"_wvid"in i){e[l]=p(i);continue}if("_wkltId"in i){e[l]=lynxWorkletImpl._workletMap[i._wkltId].bind({...i}),e[l].ctxRef=new WeakRef(i);continue}if("_jsFnId"in i){var r;i._execId=n._execId,null==(r=lynxWorkletImpl._jsFunctionLifecycleManager)||r.addRef(n._execId,i);continue}}}}};if(void 0===globalThis.lynxWorkletImpl){let e,t;globalThis.lynxWorkletImpl={_workletMap:{},_refImpl:r={_workletRefMap:{},_firstScreenWorkletRefMap:{},updateWorkletRef:function(e,t){p(e).current=t?new y(t):null},updateWorkletRefInitValueChanges:function(e){e.forEach(([e,t])=>{r._workletRefMap[e]||(r._workletRefMap[e]=_(e,t))})},clearFirstScreenWorkletRefMap:function(){r._firstScreenWorkletRefMap={}}},_runOnBackgroundDelayImpl:l={delayedBackgroundFunctionArray:[],delayRunOnBackground:function(e,t){var n;l.delayedBackgroundFunctionArray.push({task:t}),(null!=(n=e._delayIndices)?n:e._delayIndices=[]).push(l.delayedBackgroundFunctionArray.length-1)},runDelayedBackgroundFunctions:function(){for(let e of l.delayedBackgroundFunctionArray)e.jsFnHandle&&e.task(e.jsFnHandle._jsFnId,e.jsFnHandle._execId);l.delayedBackgroundFunctionArray.length=0}},_hydrateCtx:function(e,t){!function e(t,n,r){var l,i,o;if(t&&"object"==typeof t&&n&&"object"==typeof n&&(!t._wkltId||t._wkltId===n._wkltId))for(let a in t)if("_wvid"===a){l=t[a],"_initValue"in(i=n)||(lynxWorkletImpl._refImpl._workletRefMap[l]=i)}else if("_jsFn"===a)!function(e,t,n){for(let r in e){let l=e[r],i=t[r];if(!(null==i?void 0:i._delayIndices)){i&&(i._isFirstScreen=!1,i._execId=n,Object.assign(i,l));continue}for(let e of i._delayIndices){let t=lynxWorkletImpl._runOnBackgroundDelayImpl.delayedBackgroundFunctionArray[e];l._execId=n,t.jsFnHandle=l}}}(t[a],n[a],r);else{let l="function"==typeof n[a]?null==(o=n[a].ctxRef)?void 0:o.deref():n[a];e(t[a],l,r)}}(e,t,e._execId)},_eventDelayImpl:i={_delayedWorkletParamsMap:new Map,runDelayedWorklet:function(e,t){(()=>{let n=i._delayedWorkletParamsMap.get(e._wkltId);if(void 0===n)return;let r=[];n.forEach(n=>{var l;let i=n[0];(null==i||null==(l=i.currentTarget)?void 0:l.elementRefptr)===t?setTimeout(()=>{runWorklet(e,n)},0):r.push(n)}),i._delayedWorkletParamsMap.set(e._wkltId,r)})()},clearDelayedWorklets:function(){i._delayedWorkletParamsMap.clear()}},_eomImpl:{setShouldFlush:function(e){f=e}},_runRunOnMainThreadTask:h},c(2,15)&&(globalThis.lynxWorkletImpl._jsFunctionLifecycleManager=new class e{addRef(e,t){var n;this.retainedObjects.has(t)||(this.retainedObjects.add(t),this.execIdRefCount.set(e,(null!=(n=this.execIdRefCount.get(e))?n:0)+1),this.registry.register(t,e))}removeRef(e){let t=this.execIdRefCount.get(e);t>1?this.execIdRefCount.set(e,t-1):(this.execIdRefCount.delete(e),this.execIdSetToFire.add(e),this.willFire||(this.willFire=!0,Promise.resolve().then(()=>{this.fire()})))}fire(){lynx.getJSContext().dispatchEvent({type:"Lynx.Worklet.releaseBackgroundWorkletCtx",data:Array.from(this.execIdSetToFire)}),this.execIdSetToFire.clear(),this.willFire=!1}constructor(){k(this,"execIdRefCount",new Map),k(this,"execIdSetToFire",new Set),k(this,"retainedObjects",new WeakSet),k(this,"willFire",!1),k(this,"registry",void 0),this.registry=new FinalizationRegistry(this.removeRef.bind(this))}}),globalThis.registerWorklet=g,globalThis.registerWorkletInternal=g,globalThis.runWorklet=function(e,t,n){var r,l,o;if("object"==typeof(r=e)&&null!==r&&("_wkltId"in r||"_lepusWorkletHash"in r)){let r,a;return"_lepusWorkletHash"in e?void(l=e._lepusWorkletHash,o=t,(a=(r=i._delayedWorkletParamsMap).get(l))?a.push(o):r.set(l,[o])):function(e,t,n){let r=(e._wkltId,I(e,!0)),l=I(t||[],!1),[i,o]=function(e,t){if(!Array.isArray(e)||"object"!=typeof e[0]||null===e[0]||(!t||1!==t.source)&&1)return[!1,{}];let n={},r=e[0];return r.stopPropagation=function(){var e;n._eventReturnResult=(null!=(e=n._eventReturnResult)?e:0)|1},r.stopImmediatePropagation=function(){var e;n._eventReturnResult=(null!=(e=n._eventReturnResult)?e:0)|2},[!0,n]}(l,n),a=r(...l);return i?{returnValue:a,eventReturnResult:o._eventReturnResult}:a}(e,t,n)}},lynx.querySelector=function(e){let t=m.get();if(!t)return null;let n=__QuerySelector(t,e,{});return n?new y(n):null},lynx.querySelectorAll=function(e){let t=m.get();return t?__QuerySelectorAll(t,e,{}).map(e=>new y(e)):[]},globalThis.setTimeout=lynx.setTimeout,globalThis.setInterval=lynx.setInterval,globalThis.clearTimeout=lynx.clearTimeout,globalThis.clearInterval=null!=(n=lynx.clearInterval)?n:lynx.clearTimeInterval,e=lynx.requestAnimationFrame,lynx.requestAnimationFrame=globalThis.requestAnimationFrame=t=>{if(!c(2,15))throw Error("requestAnimationFrame in main thread script requires Lynx sdk version 2.16");return e(t)},globalThis.cancelAnimationFrame=lynx.cancelAnimationFrame,(t=lynx.getJSContext()).addEventListener("Lynx.Worklet.runWorkletCtx",e=>{let t=JSON.parse(e.data);h(t.worklet,t.params,t.resolveId)}),t.addEventListener("Lynx.Worklet.releaseWorkletRef",e=>{var t;t=e.data.id,delete r._workletRefMap[t]})}})();
@@ -271,12 +271,24 @@ const initElementTree = ()=>{
271
271
  return this.root;
272
272
  }
273
273
  enterListItemAtIndex(e, index, ...args) {
274
- const { componentAtIndex, $$uiSign } = e;
275
- return componentAtIndex(e, $$uiSign, index, ...args);
274
+ const isBackground = !__MAIN_THREAD__;
275
+ globalThis.lynxTestingEnv.switchToMainThread();
276
+ try {
277
+ const { componentAtIndex, $$uiSign } = e;
278
+ return componentAtIndex(e, $$uiSign, index, ...args);
279
+ } finally{
280
+ if (isBackground) globalThis.lynxTestingEnv.switchToBackgroundThread();
281
+ }
276
282
  }
277
283
  leaveListItem(e, uiSign) {
278
- const { enqueueComponent, $$uiSign } = e;
279
- enqueueComponent(e, $$uiSign, uiSign);
284
+ const isBackground = !__MAIN_THREAD__;
285
+ globalThis.lynxTestingEnv.switchToMainThread();
286
+ try {
287
+ const { enqueueComponent, $$uiSign } = e;
288
+ enqueueComponent(e, $$uiSign, uiSign);
289
+ } finally{
290
+ if (isBackground) globalThis.lynxTestingEnv.switchToBackgroundThread();
291
+ }
280
292
  }
281
293
  toJSON() {
282
294
  return this.toTree();
@@ -284,6 +296,12 @@ const initElementTree = ()=>{
284
296
  __GetElementByUniqueId(uniqueId) {
285
297
  return this.uniqueId2Element.get(uniqueId);
286
298
  }
299
+ __GetPageElement() {
300
+ return this.root;
301
+ }
302
+ __QuerySelector(e, cssSelector, _params) {
303
+ return e.querySelector(cssSelector) ?? void 0;
304
+ }
287
305
  constructor(){
288
306
  _define_property(this, "uniqueId2Element", new Map());
289
307
  _define_property(this, "root", void 0);
@@ -520,9 +538,9 @@ class NodesRef {
520
538
  setNativeProps(props) {
521
539
  return {
522
540
  exec: ()=>{
523
- const element = elementTree.uniqueId2Element.get(Number(this._nodeSelectToken.identifier));
541
+ const element = 0 === this._nodeSelectToken.type ? lynxTestingEnv.env.window.document.querySelector(this._nodeSelectToken.identifier) : elementTree.uniqueId2Element.get(Number(this._nodeSelectToken.identifier));
524
542
  if (!element) throw new Error(`[NodesRef.setNativeProps] Element not found for identifier=${this._nodeSelectToken.identifier}`);
525
- if (element) for(const key in props)element.setAttributeNS(null, key, props[key]);
543
+ for(const key in props)element.setAttributeNS(null, key, props[key]);
526
544
  }
527
545
  };
528
546
  }
@@ -569,7 +587,7 @@ function injectBackgroundThreadGlobals(target, polyfills) {
569
587
  if (!el) throw new Error(`[createSelectorQuery.select] No element matches selector: ${selector}`);
570
588
  return new NodesRef({}, {
571
589
  type: 0,
572
- identifier: el.$$uiSign.toString()
590
+ identifier: selector
573
591
  });
574
592
  }
575
593
  }),
@@ -1,10 +1,14 @@
1
1
  export declare const fireEvent: any;
2
2
  export declare const eventMap: {
3
3
  tap: {
4
- defaultInit: {};
4
+ defaultInit: {
5
+ bubbles: boolean;
6
+ };
5
7
  };
6
8
  longtap: {
7
- defaultInit: {};
9
+ defaultInit: {
10
+ bubbles: boolean;
11
+ };
8
12
  };
9
13
  bgload: {
10
14
  defaultInit: {};
@@ -13,19 +17,29 @@ export declare const eventMap: {
13
17
  defaultInit: {};
14
18
  };
15
19
  touchstart: {
16
- defaultInit: {};
20
+ defaultInit: {
21
+ bubbles: boolean;
22
+ };
17
23
  };
18
24
  touchmove: {
19
- defaultInit: {};
25
+ defaultInit: {
26
+ bubbles: boolean;
27
+ };
20
28
  };
21
29
  touchcancel: {
22
- defaultInit: {};
30
+ defaultInit: {
31
+ bubbles: boolean;
32
+ };
23
33
  };
24
34
  touchend: {
25
- defaultInit: {};
35
+ defaultInit: {
36
+ bubbles: boolean;
37
+ };
26
38
  };
27
39
  longpress: {
28
- defaultInit: {};
40
+ defaultInit: {
41
+ bubbles: boolean;
42
+ };
29
43
  };
30
44
  transitionstart: {
31
45
  defaultInit: {};
@@ -817,6 +817,8 @@ declare const initElementTree: () => {
817
817
  leaveListItem(e: LynxElement, uiSign: number): void;
818
818
  toJSON(): LynxElement | undefined;
819
819
  __GetElementByUniqueId(uniqueId: number): LynxElement | undefined;
820
+ __GetPageElement(): LynxElement | undefined;
821
+ __QuerySelector(e: LynxElement, cssSelector: string, _params: object): LynxElement | undefined;
820
822
  };
821
823
 
822
824
  /**
@@ -14279,7 +14279,10 @@ const screen = "u" > typeof document && document.body ? getQueriesForElement(doc
14279
14279
  }, dom_esm_initialValue);
14280
14280
  const NodesRef = lynx.createSelectorQuery().selectUniqueID(-1).constructor;
14281
14281
  function getElement(elemOrNodesRef) {
14282
- if (elemOrNodesRef instanceof NodesRef) return __GetElementByUniqueId(Number(elemOrNodesRef._nodeSelectToken.identifier));
14282
+ if (elemOrNodesRef instanceof NodesRef) {
14283
+ const { type, identifier } = elemOrNodesRef._nodeSelectToken;
14284
+ return 0 === type ? document.querySelector(identifier) : __GetElementByUniqueId(Number(identifier));
14285
+ }
14283
14286
  if ('refAttr' in elemOrNodesRef) return document.querySelector(`[react-ref-${elemOrNodesRef.refAttr[0]}-${elemOrNodesRef.refAttr[1]}]`);
14284
14287
  if (elemOrNodesRef?.constructor?.name === 'HTMLUnknownElement') return elemOrNodesRef;
14285
14288
  throw new Error('Invalid element, got: ' + elemOrNodesRef.constructor?.name);
@@ -14294,10 +14297,14 @@ const fire_event_fireEvent = (elemOrNodesRef, ...args)=>{
14294
14297
  };
14295
14298
  const fire_event_eventMap = {
14296
14299
  tap: {
14297
- defaultInit: {}
14300
+ defaultInit: {
14301
+ bubbles: true
14302
+ }
14298
14303
  },
14299
14304
  longtap: {
14300
- defaultInit: {}
14305
+ defaultInit: {
14306
+ bubbles: true
14307
+ }
14301
14308
  },
14302
14309
  bgload: {
14303
14310
  defaultInit: {}
@@ -14306,19 +14313,29 @@ const fire_event_eventMap = {
14306
14313
  defaultInit: {}
14307
14314
  },
14308
14315
  touchstart: {
14309
- defaultInit: {}
14316
+ defaultInit: {
14317
+ bubbles: true
14318
+ }
14310
14319
  },
14311
14320
  touchmove: {
14312
- defaultInit: {}
14321
+ defaultInit: {
14322
+ bubbles: true
14323
+ }
14313
14324
  },
14314
14325
  touchcancel: {
14315
- defaultInit: {}
14326
+ defaultInit: {
14327
+ bubbles: true
14328
+ }
14316
14329
  },
14317
14330
  touchend: {
14318
- defaultInit: {}
14331
+ defaultInit: {
14332
+ bubbles: true
14333
+ }
14319
14334
  },
14320
14335
  longpress: {
14321
- defaultInit: {}
14336
+ defaultInit: {
14337
+ bubbles: true
14338
+ }
14322
14339
  },
14323
14340
  transitionstart: {
14324
14341
  defaultInit: {}
@@ -14415,7 +14432,8 @@ Object.keys(fire_event_eventMap).forEach((key)=>{
14415
14432
  ...init
14416
14433
  };
14417
14434
  const event = createEvent(`${eventType}:${key}`, elem, init);
14418
- Object.assign(event, init);
14435
+ const { bubbles, cancelable, composed, ...assignableInit } = init;
14436
+ Object.assign(event, assignableInit);
14419
14437
  const ans = fireEvent(elem, event);
14420
14438
  if (isMainThread) lynxTestingEnv.switchToMainThread();
14421
14439
  return ans;
File without changes