@lynx-js/web-constants 0.12.0 → 0.13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @lynx-js/web-constants
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Patch Changes
6
+
7
+ - refactor: isolate SystemInfo ([#628](https://github.com/lynx-family/lynx-stack/pull/628))
8
+
9
+ Never assign `SystemInfo` on worker's self object.
10
+
11
+ - refactor: move mainthread impl into mainthread-api packages ([#622](https://github.com/lynx-family/lynx-stack/pull/622))
12
+
13
+ - fix(web): css selector not work for selectors with combinator and pseudo-class on WEB ([#608](https://github.com/lynx-family/lynx-stack/pull/608))
14
+
15
+ like `.parent > :not([hidden]) ~ :not([hidden])`
16
+
17
+ you will need to upgrade your `react-rsbuild-plugin` to fix this issue
18
+
19
+ - Updated dependencies []:
20
+ - @lynx-js/web-worker-rpc@0.13.0
21
+
3
22
  ## 0.12.0
4
23
 
5
24
  ### Patch Changes
@@ -6,3 +6,4 @@ export declare const lynxDefaultDisplayLinearAttribute: "lynx-default-display-li
6
6
  export declare const lynxDefaultOverflowVisibleAttribute: "lynx-default-overflow-visible";
7
7
  export declare const __lynx_timing_flag: "__lynx_timing_flag";
8
8
  export declare const globalMuteableVars: readonly ["registerDataProcessor", "registerWorkletInternal", "lynxWorkletImpl", "runWorklet"];
9
+ export declare const systemInfo: Record<string, string | number>;
package/dist/constants.js CHANGED
@@ -14,4 +14,8 @@ export const globalMuteableVars = [
14
14
  'lynxWorkletImpl',
15
15
  'runWorklet',
16
16
  ];
17
+ export const systemInfo = {
18
+ platform: 'web',
19
+ lynxSdkVersion: '3.0',
20
+ };
17
21
  //# sourceMappingURL=constants.js.map
@@ -6,6 +6,7 @@ import type { LynxTemplate } from './types/LynxModule.js';
6
6
  import type { NapiModulesMap } from './types/NapiModules.js';
7
7
  import type { NativeModulesMap } from './types/NativeModules.js';
8
8
  import type { ElementOperation } from '@lynx-js/offscreen-document';
9
+ import type { BrowserConfig } from './types/PageConfig.js';
9
10
  export declare const postExposureEndpoint: import("@lynx-js/web-worker-rpc/dist/RpcEndpoint.js").RpcEndpointAsyncVoid<[{
10
11
  exposures: ExposureWorkerEvent[];
11
12
  disExposures: ExposureWorkerEvent[];
@@ -30,6 +31,7 @@ export declare const BackgroundThreadStartEndpoint: import("@lynx-js/web-worker-
30
31
  customSections: Record<string, Cloneable>;
31
32
  nativeModulesMap: NativeModulesMap;
32
33
  napiModulesMap: NapiModulesMap;
34
+ browserConfig: BrowserConfig;
33
35
  }], void>;
34
36
  /**
35
37
  * Error message, info
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './constants.js';
2
2
  export * from './eventName.js';
3
3
  export * from './endpoints.js';
4
4
  export * from './types/index.js';
5
+ export * from './utils/index.js';
5
6
  export type * from '@lynx-js/web-worker-rpc';
package/dist/index.js CHANGED
@@ -5,4 +5,5 @@ export * from './constants.js';
5
5
  export * from './eventName.js';
6
6
  export * from './endpoints.js';
7
7
  export * from './types/index.js';
8
+ export * from './utils/index.js';
8
9
  //# sourceMappingURL=index.js.map
@@ -5,4 +5,5 @@ export interface PageConfig {
5
5
  defaultOverflowVisible: boolean;
6
6
  }
7
7
  export interface BrowserConfig {
8
+ pixelRatio: number;
8
9
  }
@@ -2,7 +2,9 @@ export interface CSSRule {
2
2
  sel: [
3
3
  plainSelectors: string[],
4
4
  pseudoClassSelectors: string[],
5
- pseudoElementSelectors: string[]
5
+ pseudoElementSelectors: string[],
6
+ combinator: string[],
7
+ ...string[][]
6
8
  ][];
7
9
  decl: [string, string][];
8
10
  }
@@ -0,0 +1,13 @@
1
+ import type { dispatchCoreContextOnBackgroundEndpoint, Rpc } from '../index.js';
2
+ import { type LynxContextEventTarget } from '../types/LynxContextEventTarget.js';
3
+ export declare class LynxCrossThreadContext extends EventTarget implements LynxContextEventTarget {
4
+ private _config;
5
+ constructor(_config: {
6
+ rpc: Rpc;
7
+ receiveEventEndpoint: typeof dispatchCoreContextOnBackgroundEndpoint;
8
+ sendEventEndpoint: typeof dispatchCoreContextOnBackgroundEndpoint;
9
+ });
10
+ postMessage(...args: any[]): void;
11
+ dispatchEvent(event: ContextCrossThreadEvent): 3;
12
+ __start(): void;
13
+ }
@@ -0,0 +1,24 @@
1
+ import { DispatchEventResult, } from '../types/LynxContextEventTarget.js';
2
+ export class LynxCrossThreadContext extends EventTarget {
3
+ _config;
4
+ constructor(_config) {
5
+ super();
6
+ this._config = _config;
7
+ }
8
+ postMessage(...args) {
9
+ console.error('[lynx-web] postMessage not implemented, args:', ...args);
10
+ }
11
+ // @ts-expect-error
12
+ dispatchEvent(event) {
13
+ const { rpc, sendEventEndpoint } = this._config;
14
+ rpc.invoke(sendEventEndpoint, [event]);
15
+ return DispatchEventResult.CanceledBeforeDispatch;
16
+ }
17
+ __start() {
18
+ const { rpc, receiveEventEndpoint } = this._config;
19
+ rpc.registerHandler(receiveEventEndpoint, ({ type, data }) => {
20
+ super.dispatchEvent(new MessageEvent(type, { data: data ?? {} }));
21
+ });
22
+ }
23
+ }
24
+ //# sourceMappingURL=LynxCrossThreadContext.js.map
@@ -0,0 +1 @@
1
+ export { LynxCrossThreadContext } from './LynxCrossThreadContext.js';
@@ -0,0 +1,2 @@
1
+ export { LynxCrossThreadContext } from './LynxCrossThreadContext.js';
2
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-constants",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -23,9 +23,9 @@
23
23
  "**/*.css"
24
24
  ],
25
25
  "dependencies": {
26
- "@lynx-js/web-worker-rpc": "0.12.0"
26
+ "@lynx-js/web-worker-rpc": "0.13.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@lynx-js/offscreen-document": "0.0.0"
29
+ "@lynx-js/offscreen-document": "0.0.1"
30
30
  }
31
31
  }