@netless/fastboard 0.0.7 → 0.0.8

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/fastboard",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "An open sourced sdk based on white-web-sdk.",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -1,11 +1,12 @@
1
1
  import type {
2
2
  InsertDocsParams,
3
3
  Language,
4
+ Layout,
4
5
  WhiteboardAppConfig,
5
6
  } from "./internal";
6
7
  import { Instance } from "./internal";
7
8
 
8
- export type { WhiteboardAppConfig, InsertDocsParams };
9
+ export type { Language, Layout, WhiteboardAppConfig, InsertDocsParams };
9
10
 
10
11
  export class WhiteboardApp {
11
12
  private readonly _instance: Instance;
@@ -30,23 +31,27 @@ export class WhiteboardApp {
30
31
  return this._instance.i18n;
31
32
  }
32
33
 
33
- private _target: HTMLElement | null = null;
34
34
  public get target(): HTMLElement | null {
35
- return this._target;
35
+ return this._instance.target;
36
36
  }
37
37
 
38
- private _collector: HTMLElement | null = null;
39
38
  public get collector(): HTMLElement | null {
40
- return this._collector;
39
+ return this._instance.collector;
41
40
  }
42
41
 
43
42
  public bindElement(
44
43
  target?: HTMLElement | null,
45
44
  collector?: HTMLElement | null
46
45
  ) {
47
- this._target = target || null;
48
- this._collector = collector || null;
49
- this._instance.bindElement(this._target, this._collector);
46
+ this._instance.bindElement(target || null, collector || null);
47
+ }
48
+
49
+ public get layout() {
50
+ return this._instance.config.layout;
51
+ }
52
+
53
+ public updateLayout(layout?: Layout | undefined) {
54
+ this._instance.updateLayout(layout);
50
55
  }
51
56
 
52
57
  public insertDocs(params: InsertDocsParams) {
@@ -119,7 +119,7 @@ export class Instance {
119
119
  this.forceUpdate();
120
120
  }
121
121
 
122
- updateLayout(layout: Layout) {
122
+ updateLayout(layout: Layout | undefined) {
123
123
  this.config.layout = layout;
124
124
  this.forceUpdate();
125
125
  }