@dajiaoai/algeo-sdk 2.13.0 → 2.13.1

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/README.md CHANGED
@@ -569,6 +569,7 @@ interface FileContent {
569
569
  | -------------------------------- | ------------------------------------------------------------------------------------ |
570
570
  | `getCount()` | 获取当前已知画板数量 |
571
571
  | `getCurrentIndex()` | 获取当前已知画板索引 |
572
+ | `getCurrentViewBounds()` | 异步获取当前有限画布的导出视野 `{ left, top, right, bottom, scale }`;可直接传给 `exportImage`;无限画布返回 `null` |
572
573
  | `switchTo(index)` | 切换画板 |
573
574
  | `add()` | 在末尾新增画板 |
574
575
  | `addAt(index)` | 在指定位置新增画板 |
@@ -4011,7 +4011,7 @@ function convertToLatest(content) {
4011
4011
  }
4012
4012
 
4013
4013
  /** SDK 版本号,构建时由 rollup 注入 */
4014
- const VERSION = '2.13.0';
4014
+ const VERSION = '2.13.1';
4015
4015
  const DEFAULT_EMBED_BASE = 'https://dajiaoai.com';
4016
4016
  const DEFAULT_PRESENTATION_PATH = '/embed/present';
4017
4017
  const DEFAULT_EDITOR_PATH = '/embed/edit';
@@ -4515,6 +4515,10 @@ class EmbeddedEditor extends EmbeddedTarget {
4515
4515
  this.slides = {
4516
4516
  getCount: () => this.slideCount,
4517
4517
  getCurrentIndex: () => this.currentSlideIndex,
4518
+ getCurrentViewBounds: async () => {
4519
+ const result = await this.post('getCurrentViewBounds', {});
4520
+ return result.viewBounds;
4521
+ },
4518
4522
  switchTo: async (index) => {
4519
4523
  await this.switchTo(index);
4520
4524
  },
@@ -4009,7 +4009,7 @@ function convertToLatest(content) {
4009
4009
  }
4010
4010
 
4011
4011
  /** SDK 版本号,构建时由 rollup 注入 */
4012
- const VERSION = '2.13.0';
4012
+ const VERSION = '2.13.1';
4013
4013
  const DEFAULT_EMBED_BASE = 'https://dajiaoai.com';
4014
4014
  const DEFAULT_PRESENTATION_PATH = '/embed/present';
4015
4015
  const DEFAULT_EDITOR_PATH = '/embed/edit';
@@ -4513,6 +4513,10 @@ class EmbeddedEditor extends EmbeddedTarget {
4513
4513
  this.slides = {
4514
4514
  getCount: () => this.slideCount,
4515
4515
  getCurrentIndex: () => this.currentSlideIndex,
4516
+ getCurrentViewBounds: async () => {
4517
+ const result = await this.post('getCurrentViewBounds', {});
4518
+ return result.viewBounds;
4519
+ },
4516
4520
  switchTo: async (index) => {
4517
4521
  await this.switchTo(index);
4518
4522
  },
@@ -4015,7 +4015,7 @@
4015
4015
  }
4016
4016
 
4017
4017
  /** SDK 版本号,构建时由 rollup 注入 */
4018
- const VERSION = '2.13.0';
4018
+ const VERSION = '2.13.1';
4019
4019
  const DEFAULT_EMBED_BASE = 'https://dajiaoai.com';
4020
4020
  const DEFAULT_PRESENTATION_PATH = '/embed/present';
4021
4021
  const DEFAULT_EDITOR_PATH = '/embed/edit';
@@ -4519,6 +4519,10 @@
4519
4519
  this.slides = {
4520
4520
  getCount: () => this.slideCount,
4521
4521
  getCurrentIndex: () => this.currentSlideIndex,
4522
+ getCurrentViewBounds: async () => {
4523
+ const result = await this.post('getCurrentViewBounds', {});
4524
+ return result.viewBounds;
4525
+ },
4522
4526
  switchTo: async (index) => {
4523
4527
  await this.switchTo(index);
4524
4528
  },
package/dist/shared.d.ts CHANGED
@@ -241,6 +241,10 @@ export interface SwitchSlideResult {
241
241
  export interface GetSlideCountResult {
242
242
  count: number;
243
243
  }
244
+ export interface GetCurrentViewBoundsResult {
245
+ /** 与 ExportImageViewMode.viewBound 格式一致,可直接传给 exportImage。 */
246
+ viewBounds: ExportViewBound | null;
247
+ }
244
248
  export interface ReplResult {
245
249
  output: string;
246
250
  }
@@ -403,6 +407,7 @@ export interface DocumentApi {
403
407
  export interface SlidesApi {
404
408
  getCount(): number;
405
409
  getCurrentIndex(): number;
410
+ getCurrentViewBounds(): Promise<ExportViewBound | null>;
406
411
  switchTo(index: number): Promise<void>;
407
412
  add(): Promise<SlideIndexResult>;
408
413
  addAt(index: number): Promise<SlideIndexResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dajiaoai/algeo-sdk",
3
- "version": "2.13.0",
3
+ "version": "2.13.1",
4
4
  "description": "大角几何内嵌画板 SDK,支持 iframe 挂载与 postMessage 通信",
5
5
  "main": "dist/algeo-sdk.cjs.js",
6
6
  "module": "dist/algeo-sdk.esm.js",