@lynx-js/web-core-canary 0.19.6-canary-20260123-444f83bb → 0.19.7-canary-20260126-5e7e43c5

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,6 +1,26 @@
1
1
  # @lynx-js/web-core
2
2
 
3
- ## 0.19.6-canary-20260123091955-444f83bb390520f0c669bc522a70fb6d5709d63a
3
+ ## 0.19.7-canary-20260126074925-5e7e43c59237f98a93aefbd6749ad39c33acdc4d
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: add browser config of lynx-view, now you can customize the browser config of lynx-view: ([#2140](https://github.com/lynx-family/lynx-stack/pull/2140))
8
+
9
+ ```
10
+ lynxView.browserConfig = {
11
+ pixelRatio: 1,
12
+ pixelWidth: 1234,
13
+ pixelHeight: 5678,
14
+ }
15
+ ```
16
+
17
+ - Updated dependencies []:
18
+ - @lynx-js/web-constants@0.19.7-canary-20260126074925-5e7e43c59237f98a93aefbd6749ad39c33acdc4d
19
+ - @lynx-js/web-mainthread-apis@0.19.7-canary-20260126074925-5e7e43c59237f98a93aefbd6749ad39c33acdc4d
20
+ - @lynx-js/web-worker-rpc@0.19.7-canary-20260126074925-5e7e43c59237f98a93aefbd6749ad39c33acdc4d
21
+ - @lynx-js/web-worker-runtime@0.19.7-canary-20260126074925-5e7e43c59237f98a93aefbd6749ad39c33acdc4d
22
+
23
+ ## 0.19.6
4
24
 
5
25
  ### Patch Changes
6
26
 
@@ -9,10 +29,10 @@
9
29
  - feat: support lynx.reload() ([#2127](https://github.com/lynx-family/lynx-stack/pull/2127))
10
30
 
11
31
  - Updated dependencies [[`179f984`](https://github.com/lynx-family/lynx-stack/commit/179f9844adf00ff4b2cd450ffb943649441c87d3), [`f7133c1`](https://github.com/lynx-family/lynx-stack/commit/f7133c137f094063e991dfa0e993ea92177aa173), [`6c2b51a`](https://github.com/lynx-family/lynx-stack/commit/6c2b51a661ae244eb40671f63f29ee971e084ed4), [`556fe9f`](https://github.com/lynx-family/lynx-stack/commit/556fe9fded90945a7926093897288d5302c314d3), [`5b589ab`](https://github.com/lynx-family/lynx-stack/commit/5b589ab53b01a8e2357d3ccbb159edab004086d3)]:
12
- - @lynx-js/web-constants@0.19.6-canary-20260123091955-444f83bb390520f0c669bc522a70fb6d5709d63a
13
- - @lynx-js/web-mainthread-apis@0.19.6-canary-20260123091955-444f83bb390520f0c669bc522a70fb6d5709d63a
14
- - @lynx-js/web-worker-rpc@0.19.6-canary-20260123091955-444f83bb390520f0c669bc522a70fb6d5709d63a
15
- - @lynx-js/web-worker-runtime@0.19.6-canary-20260123091955-444f83bb390520f0c669bc522a70fb6d5709d63a
32
+ - @lynx-js/web-constants@0.19.6
33
+ - @lynx-js/web-mainthread-apis@0.19.6
34
+ - @lynx-js/web-worker-rpc@0.19.6
35
+ - @lynx-js/web-worker-runtime@0.19.6
16
36
 
17
37
  ## 0.19.5
18
38
 
@@ -181,6 +181,15 @@ export declare class LynxView extends HTMLElement {
181
181
  * @param url the url of the template
182
182
  */
183
183
  customTemplateLoader?: (url: string) => Promise<LynxTemplate>;
184
+ /**
185
+ * @public
186
+ * allow user to customize the browser config
187
+ */
188
+ browserConfig?: {
189
+ pixelRatio?: number;
190
+ pixelWidth?: number;
191
+ pixelHeight?: number;
192
+ };
184
193
  /**
185
194
  * @private
186
195
  */
@@ -329,6 +329,11 @@ export class LynxView extends HTMLElement {
329
329
  * @param url the url of the template
330
330
  */
331
331
  customTemplateLoader;
332
+ /**
333
+ * @public
334
+ * allow user to customize the browser config
335
+ */
336
+ browserConfig;
332
337
  /**
333
338
  * @private the flag to group all changes into one render operation
334
339
  */
@@ -376,6 +381,7 @@ export class LynxView extends HTMLElement {
376
381
  napiModulesMap: this.#napiModulesMap,
377
382
  lynxGroupId,
378
383
  initI18nResources: this.#initI18nResources,
384
+ browserConfig: this.browserConfig,
379
385
  callbacks: {
380
386
  nativeModulesCall: (...args) => {
381
387
  if (this.onNativeModulesCall) {
@@ -14,6 +14,11 @@ export interface LynxViewConfigs {
14
14
  threadStrategy: 'all-on-ui' | 'multi-thread';
15
15
  initI18nResources: InitI18nResources;
16
16
  ssr?: SSRDumpInfo;
17
+ browserConfig?: {
18
+ pixelRatio?: number;
19
+ pixelWidth?: number;
20
+ pixelHeight?: number;
21
+ };
17
22
  }
18
23
  export interface LynxView {
19
24
  updateData(data: Cloneable, processorName?: string, callback?: () => void): void;
@@ -6,7 +6,7 @@ const pixelRatio = window.devicePixelRatio;
6
6
  const screenWidth = document.documentElement.clientWidth * pixelRatio;
7
7
  const screenHeight = document.documentElement.clientHeight * pixelRatio;
8
8
  export function createLynxView(configs) {
9
- const { shadowRoot, callbacks, templateUrl, globalProps, initData, nativeModulesMap, napiModulesMap, tagMap, lynxGroupId, threadStrategy = 'multi-thread', initI18nResources, ssr, } = configs;
9
+ const { shadowRoot, callbacks, templateUrl, globalProps, initData, nativeModulesMap, napiModulesMap, tagMap, lynxGroupId, threadStrategy = 'multi-thread', initI18nResources, ssr, browserConfig, } = configs;
10
10
  return startUIThread(templateUrl, {
11
11
  tagMap,
12
12
  initData,
@@ -14,9 +14,9 @@ export function createLynxView(configs) {
14
14
  nativeModulesMap,
15
15
  napiModulesMap,
16
16
  browserConfig: {
17
- pixelRatio: window.devicePixelRatio,
18
- pixelWidth: screenWidth,
19
- pixelHeight: screenHeight,
17
+ pixelRatio: browserConfig?.pixelRatio ?? window.devicePixelRatio,
18
+ pixelWidth: browserConfig?.pixelWidth ?? screenWidth,
19
+ pixelHeight: browserConfig?.pixelHeight ?? screenHeight,
20
20
  },
21
21
  initI18nResources,
22
22
  }, shadowRoot, lynxGroupId, threadStrategy, callbacks, ssr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-core-canary",
3
- "version": "0.19.6-canary-20260123-444f83bb",
3
+ "version": "0.19.7-canary-20260126-5e7e43c5",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -25,10 +25,10 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4",
28
- "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.6-canary-20260123-444f83bb",
29
- "@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.6-canary-20260123-444f83bb",
30
- "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.6-canary-20260123-444f83bb",
31
- "@lynx-js/web-worker-runtime": "npm:@lynx-js/web-worker-runtime-canary@0.19.6-canary-20260123-444f83bb"
28
+ "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.7-canary-20260126-5e7e43c5",
29
+ "@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.7-canary-20260126-5e7e43c5",
30
+ "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.7-canary-20260126-5e7e43c5",
31
+ "@lynx-js/web-worker-runtime": "npm:@lynx-js/web-worker-runtime-canary@0.19.7-canary-20260126-5e7e43c5"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@lynx-js/lynx-core": "0.1.3",