@netless/app-slide 0.2.3 → 0.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/app-slide",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -247,6 +247,7 @@ export class SlideController {
247
247
  }
248
248
 
249
249
  private createSlide(anchor: HTMLDivElement) {
250
+ const options = this.context.getAppOptions() || {};
250
251
  const slide = new Slide({
251
252
  anchor,
252
253
  interactive: true,
@@ -255,12 +256,13 @@ export class SlideController {
255
256
  controller: logger.enable,
256
257
  enableGlobalClick: true,
257
258
  renderOptions: {
258
- minFPS: this.context.getAppOptions()?.minFPS || 25,
259
- maxFPS: this.context.getAppOptions()?.maxFPS || 30,
260
- autoFPS: this.context.getAppOptions()?.autoFPS ?? true,
261
- autoResolution: this.context.getAppOptions()?.autoResolution ?? true,
262
- resolution: this.context.getAppOptions()?.resolution,
263
- transactionBgColor: this.context.getAppOptions()?.bgColor || cachedGetBgColor(anchor),
259
+ minFPS: options.minFPS || 25,
260
+ maxFPS: options.maxFPS || 30,
261
+ autoFPS: options.autoFPS ?? true,
262
+ autoResolution: options.autoResolution ?? true,
263
+ resolution: options.resolution,
264
+ transactionBgColor: options.bgColor || cachedGetBgColor(anchor),
265
+ maxResolutionLevel: options.maxResolutionLevel,
264
266
  },
265
267
  timestamp: this.timestamp,
266
268
  });
package/src/index.ts CHANGED
@@ -41,6 +41,8 @@ export interface AppOptions {
41
41
  autoFPS?: boolean;
42
42
  /** whether to re-scale automatically @default true */
43
43
  autoResolution?: boolean;
44
+ /** 1~4, default: 3 */
45
+ maxResolutionLevel?: number;
44
46
  }
45
47
 
46
48
  export interface Controller {