@dajiaoai/algeo-sdk 2.13.1 → 2.13.3

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,7 +569,7 @@ interface FileContent {
569
569
  | -------------------------------- | ------------------------------------------------------------------------------------ |
570
570
  | `getCount()` | 获取当前已知画板数量 |
571
571
  | `getCurrentIndex()` | 获取当前已知画板索引 |
572
- | `getCurrentViewBounds()` | 异步获取当前有限画布的导出视野 `{ left, top, right, bottom, scale }`;可直接传给 `exportImage`;无限画布返回 `null` |
572
+ | `getViewBounds(index?)` | 异步获取指定或当前画板的有限画布导出视野 `{ left, top, right, bottom, scale }`;可直接传给 `exportImage`;无限画布返回 `null` |
573
573
  | `switchTo(index)` | 切换画板 |
574
574
  | `add()` | 在末尾新增画板 |
575
575
  | `addAt(index)` | 在指定位置新增画板 |
@@ -590,7 +590,7 @@ const images = await editor.slides.exportImage({
590
590
  mode: 'view',
591
591
  slideIndices: [1],
592
592
  format: 'png',
593
- viewBound: { left: -5, top: -5, right: 5, bottom: 5, scale: 50 },
593
+ viewBound: { left: -5, top: 5, right: 5, bottom: -5, scale: 50 },
594
594
  pixelRatio: 2,
595
595
  });
596
596
  ```
@@ -4011,7 +4011,7 @@ function convertToLatest(content) {
4011
4011
  }
4012
4012
 
4013
4013
  /** SDK 版本号,构建时由 rollup 注入 */
4014
- const VERSION = '2.13.1';
4014
+ const VERSION = '2.13.3';
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,8 +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', {});
4518
+ getViewBounds: async (index) => {
4519
+ const result = await this.post('getViewBounds', {
4520
+ ...(index === undefined ? {} : { index }),
4521
+ });
4520
4522
  return result.viewBounds;
4521
4523
  },
4522
4524
  switchTo: async (index) => {
@@ -4009,7 +4009,7 @@ function convertToLatest(content) {
4009
4009
  }
4010
4010
 
4011
4011
  /** SDK 版本号,构建时由 rollup 注入 */
4012
- const VERSION = '2.13.1';
4012
+ const VERSION = '2.13.3';
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,8 +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', {});
4516
+ getViewBounds: async (index) => {
4517
+ const result = await this.post('getViewBounds', {
4518
+ ...(index === undefined ? {} : { index }),
4519
+ });
4518
4520
  return result.viewBounds;
4519
4521
  },
4520
4522
  switchTo: async (index) => {
@@ -4015,7 +4015,7 @@
4015
4015
  }
4016
4016
 
4017
4017
  /** SDK 版本号,构建时由 rollup 注入 */
4018
- const VERSION = '2.13.1';
4018
+ const VERSION = '2.13.3';
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,8 +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', {});
4522
+ getViewBounds: async (index) => {
4523
+ const result = await this.post('getViewBounds', {
4524
+ ...(index === undefined ? {} : { index }),
4525
+ });
4524
4526
  return result.viewBounds;
4525
4527
  },
4526
4528
  switchTo: async (index) => {
package/dist/shared.d.ts CHANGED
@@ -241,7 +241,7 @@ export interface SwitchSlideResult {
241
241
  export interface GetSlideCountResult {
242
242
  count: number;
243
243
  }
244
- export interface GetCurrentViewBoundsResult {
244
+ export interface GetViewBoundsResult {
245
245
  /** 与 ExportImageViewMode.viewBound 格式一致,可直接传给 exportImage。 */
246
246
  viewBounds: ExportViewBound | null;
247
247
  }
@@ -319,7 +319,7 @@ export interface ExportImageSizeMode extends ExportImageBaseOptions {
319
319
  /**
320
320
  * 场景二(view):viewBound 的四条边界均为世界坐标。
321
321
  * scale 省略时从文件的 camera.scale 读取。
322
- * 输出像素 = (right - left, bottom - top) x viewBound.scale x pixelRatio。
322
+ * 输出像素 = (right - left, top - bottom) x viewBound.scale x pixelRatio。
323
323
  */
324
324
  export interface ExportImageViewMode extends ExportImageBaseOptions {
325
325
  mode: 'view';
@@ -407,7 +407,7 @@ export interface DocumentApi {
407
407
  export interface SlidesApi {
408
408
  getCount(): number;
409
409
  getCurrentIndex(): number;
410
- getCurrentViewBounds(): Promise<ExportViewBound | null>;
410
+ getViewBounds(index?: number): Promise<ExportViewBound | null>;
411
411
  switchTo(index: number): Promise<void>;
412
412
  add(): Promise<SlideIndexResult>;
413
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.1",
3
+ "version": "2.13.3",
4
4
  "description": "大角几何内嵌画板 SDK,支持 iframe 挂载与 postMessage 通信",
5
5
  "main": "dist/algeo-sdk.cjs.js",
6
6
  "module": "dist/algeo-sdk.esm.js",