@lynx-js/react 0.123.0 → 0.123.2

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 (43) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/components/lib/DeferredListItem.d.ts +8 -2
  3. package/components/lib/DeferredListItem.jsx.map +1 -1
  4. package/components/src/DeferredListItem.tsx +7 -2
  5. package/package.json +4 -4
  6. package/refresh/dist/index.js +4 -2
  7. package/runtime/lib/element-template/background/commit-hook.js +3 -0
  8. package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
  9. package/runtime/lib/element-template/prop-adapters/spread.js +11 -11
  10. package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
  11. package/runtime/lib/element-template/protocol/types.d.ts +1 -0
  12. package/runtime/lib/index.d.ts +1 -0
  13. package/runtime/lib/index.js.map +1 -1
  14. package/runtime/lib/shared/attribute-name.d.ts +3 -0
  15. package/runtime/lib/shared/attribute-name.js +91 -0
  16. package/runtime/lib/shared/attribute-name.js.map +1 -0
  17. package/runtime/lib/snapshot/lifecycle/patch/commit.js +3 -0
  18. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
  19. package/runtime/lib/snapshot/lynx/element.d.ts +28 -5
  20. package/runtime/lib/snapshot/lynx/element.js +9 -5
  21. package/runtime/lib/snapshot/lynx/element.js.map +1 -1
  22. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js +19 -0
  23. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -1
  24. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +97 -65
  25. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
  26. package/runtime/lib/snapshot/snapshot/list.js +8 -1
  27. package/runtime/lib/snapshot/snapshot/list.js.map +1 -1
  28. package/runtime/lib/snapshot/snapshot/platformInfo.js +20 -9
  29. package/runtime/lib/snapshot/snapshot/platformInfo.js.map +1 -1
  30. package/runtime/lib/snapshot/snapshot/spread.js +27 -17
  31. package/runtime/lib/snapshot/snapshot/spread.js.map +1 -1
  32. package/runtime/lib/snapshot/snapshot/utils.js +8 -3
  33. package/runtime/lib/snapshot/snapshot/utils.js.map +1 -1
  34. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  35. package/testing-library/dist/env/index.js +5 -0
  36. package/testing-library/dist/index.d.ts +3 -2
  37. package/testing-library/dist/pure.js +1 -1
  38. package/testing-library/dist/rstest-config.js +1 -1
  39. package/transform/dist/wasm.cjs +5 -5
  40. package/transform/index.d.ts +43 -0
  41. package/types/react.docs.d.ts +22 -2
  42. /package/testing-library/dist/{0~@rstest → 0-@rstest}/adapter-rsbuild.js +0 -0
  43. /package/testing-library/dist/{0~rslib-runtime.js → 0-rslib-runtime.js} +0 -0
@@ -220,6 +220,9 @@ const initElementTree = ()=>{
220
220
  __GetAttributeByName(ele, name) {
221
221
  return ele.getAttribute(name);
222
222
  }
223
+ __GetComputedStyleByKey(ele, key) {
224
+ return lynxTestingEnv.env.window.getComputedStyle(ele).getPropertyValue(key);
225
+ }
223
226
  __ElementAnimate(element, args) {
224
227
  const [operation, name] = args;
225
228
  switch(operation){
@@ -478,6 +481,7 @@ function injectMainThreadGlobals(target, polyfills) {
478
481
  target.__FIRST_SCREEN_SYNC_TIMING__ = 'immediately';
479
482
  target.__TESTING_FORCE_RENDER_TO_OPCODE__ = false;
480
483
  target.__ENABLE_SSR__ = false;
484
+ target.__EXPERIMENTAL_TRANSFORM_BUILTIN_ATTRIBUTE_NAMES__ = false;
481
485
  target.globDynamicComponentEntry = '__Card__';
482
486
  const native = {
483
487
  _listeners: {},
@@ -557,6 +561,7 @@ function injectBackgroundThreadGlobals(target, polyfills) {
557
561
  target.__BACKGROUND__ = true;
558
562
  target.__MAIN_THREAD__ = false;
559
563
  target.__ENABLE_SSR__ = false;
564
+ target.__EXPERIMENTAL_TRANSFORM_BUILTIN_ATTRIBUTE_NAMES__ = false;
560
565
  target.globDynamicComponentEntry = '__Card__';
561
566
  target.lynxCoreInject = {};
562
567
  target.lynxCoreInject.tt = {
@@ -761,7 +761,7 @@ declare const initElementTree: () => {
761
761
  __CreateWrapperElement(parentComponentUniqueId: number): LynxElement;
762
762
  __AddInlineStyle(e: HTMLElement, key: number, value: string): void;
763
763
  __AppendElement(parent: LynxElement, child: LynxElement): void;
764
- __SetCSSId(e: LynxElement[] | LynxElement, id: string, entryName?: string | undefined): void;
764
+ __SetCSSId(e: LynxElement | LynxElement[], id: string, entryName?: string): void;
765
765
  __SetAttribute(e: LynxElement, key: string, value: any): void;
766
766
  __AddEvent(e: LynxElement, eventType: string, eventName: string, eventHandler: string | Record<string, any>): void;
767
767
  __GetEvent(e: LynxElement, eventType: string, eventName: string): {
@@ -777,7 +777,7 @@ declare const initElementTree: () => {
777
777
  __RemoveGestureDetector(e: LynxElement, id: number): void;
778
778
  __GetDataset(e: LynxElement): DOMStringMap;
779
779
  __RemoveElement(parent: LynxElement, child: LynxElement): void;
780
- __InsertElementBefore(parent: LynxElement, child: LynxElement, ref?: LynxElement | undefined): void;
780
+ __InsertElementBefore(parent: LynxElement, child: LynxElement, ref?: LynxElement): void;
781
781
  __ReplaceElement(newElement: LynxElement, oldElement: LynxElement): void;
782
782
  __FlushElementTree(): void;
783
783
  __UpdateListComponents(_list: LynxElement, _components: string[]): void;
@@ -785,6 +785,7 @@ declare const initElementTree: () => {
785
785
  __CreateList(parentComponentUniqueId: number, componentAtIndex: any, enqueueComponent: any): LynxElement;
786
786
  __GetTag(ele: LynxElement): string;
787
787
  __GetAttributeByName(ele: LynxElement, name: string): string | null;
788
+ __GetComputedStyleByKey(ele: LynxElement, key: string): string;
788
789
  /** @internal */
789
790
  animationMap: Map<string, {
790
791
  element: LynxElement;
@@ -6,7 +6,7 @@ import { act } from "preact/test-utils";
6
6
  import { __root } from "@lynx-js/react/internal";
7
7
  import { flushDelayedLifecycleEvents } from "../../runtime/lib/snapshot/lynx/tt.js";
8
8
  import { clearPage } from "../../runtime/lib/snapshot/index.js";
9
- import { __webpack_require__ } from "./0~rslib-runtime.js";
9
+ import { __webpack_require__ } from "./0-rslib-runtime.js";
10
10
  __webpack_require__.add({
11
11
  "../../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js" (module1) {
12
12
  module1.exports = ({ onlyFirst = false } = {})=>{
@@ -29,7 +29,7 @@ function withLynxConfig(options) {
29
29
  cwd: options?.rootPath,
30
30
  configPath: options?.configPath
31
31
  });
32
- const { toRstestConfig } = await import("./0~@rstest/adapter-rsbuild.js");
32
+ const { toRstestConfig } = await import("./0-@rstest/adapter-rsbuild.js");
33
33
  const rstestConfig = toRstestConfig({
34
34
  rsbuildConfig: lynxConfig.content
35
35
  });