3dviewer-sdk 1.0.12 → 1.0.13

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/dist/index.d.mts CHANGED
@@ -20,13 +20,19 @@ declare enum ViewerMessageType {
20
20
  ZOOM_WINDOW = "viewer-zoom-window",
21
21
  ZOOM_FIT = "viewer-zoom-fit",
22
22
  TOOLBAR_CONFIG = "viewer-toolbar-config",
23
- TOOLBAR_VISIBILITY = "viewer-toolbar-visibility",
23
+ TOOLBAR_USE = "viewer-toolbar-use",
24
24
  PANEL_OPEN = "viewer-panel-open",
25
25
  PANEL_CLOSE = "viewer-panel-close",
26
26
  CUTTING_PLANE_ACTION = "viewer-cutting-plane-action",
27
27
  SHEETS_GET_LIST = "viewer-sheets-get-list",
28
28
  SHEETS_LIST = "viewer-sheets-list",
29
29
  SHEETS_APPLY = "viewer-sheets-apply",
30
+ OBJECT_PROPERTIES_GET_LIST = "viewer-object-properties-get-list",
31
+ OBJECT_PROPERTIES_LIST = "viewer-object-properties-list",
32
+ LINKED_OBJECTS_GET_LIST = "viewer-linked-objects-get-list",
33
+ LINKED_OBJECTS_LIST = "viewer-linked-objects-list",
34
+ STATES_OBJECTS_GET_LIST = "viewer-states-objects-get-list",
35
+ STATES_OBJECTS_LIST = "viewer-states-objects-list",
30
36
  TREE_SELECT_NODE = "viewer-tree-select-node",
31
37
  TREE_GET_NODE_IDS = "viewer-tree-get-node-ids",
32
38
  TREE_NODE_IDS = "viewer-tree-node-ids",
@@ -42,7 +48,7 @@ declare enum ViewerMessageType {
42
48
  PAN_CHANGE = "viewer-pan-change"
43
49
  }
44
50
  type LanguageCode = "en" | "vn";
45
- type ToolbarVisibilityTarget = "all" | "left" | "center" | "right";
51
+ type ToolbarUseTarget = "all" | "left" | "center" | "right";
46
52
  type MarkupAction = "line" | "arrow" | "circle" | "ellipse" | "rectangle" | "polygon" | "polyline" | "textbox" | "note" | "callout" | "cloud" | "freehand";
47
53
  type MarkupOperationResultPayload = {
48
54
  requestId: string;
@@ -62,12 +68,29 @@ type MarkupListItem = {
62
68
  createdBy?: string;
63
69
  lastModifiedBy?: string;
64
70
  };
71
+ type PanelTarget = "clipping-commands" | "setting" | "statesObjects" | "linkedObjects" | "model-tree" | "sheets" | "object-properties";
65
72
  type SheetListItem = {
66
73
  id: string | number;
67
74
  name: string;
68
75
  is3D?: boolean;
69
76
  viewId?: string;
70
77
  };
78
+ type ObjectPropertyItem = Record<string, unknown>;
79
+ type LinkedObjectItem = Record<string, unknown>;
80
+ type StateObjectRefItem = {
81
+ name: string;
82
+ id: number;
83
+ };
84
+ type StateObjectItem = {
85
+ id: string;
86
+ name: string;
87
+ char: string;
88
+ object: StateObjectRefItem[];
89
+ states: {
90
+ color: string;
91
+ type: string;
92
+ };
93
+ };
71
94
  type PdfModeEventPayload = {
72
95
  mode: "plan" | "document";
73
96
  timestamp: number;
@@ -115,6 +138,21 @@ type ViewerEventMap = {
115
138
  activeSheetId?: string | number | null;
116
139
  timestamp: number;
117
140
  };
141
+ "object-properties:list": {
142
+ requestId: string;
143
+ properties: ObjectPropertyItem[];
144
+ timestamp: number;
145
+ };
146
+ "linked-objects:list": {
147
+ requestId: string;
148
+ linkedObjects: LinkedObjectItem[];
149
+ timestamp: number;
150
+ };
151
+ "states-objects:list": {
152
+ requestId: string;
153
+ statesObjects: StateObjectItem[];
154
+ timestamp: number;
155
+ };
118
156
  "markup:list": {
119
157
  requestId: string;
120
158
  markups: MarkupListItem[];
@@ -232,7 +270,6 @@ declare class NodeModule {
232
270
 
233
271
  type FilesConfig = {
234
272
  baseUrl?: string;
235
- conversionBaseUrl?: string;
236
273
  viewerPath?: string;
237
274
  uploadPath?: string;
238
275
  };
@@ -320,8 +357,8 @@ declare class FilesModule {
320
357
  private resolveFile;
321
358
  private normalizeBaseUrl;
322
359
  private resolveBaseUrl;
323
- private resolveConversionBaseUrl;
324
360
  private resolveViewerPath;
361
+ private normalizeSdkViewerPath;
325
362
  private resolveViewerOrigin;
326
363
  private resolveHostConversion;
327
364
  private getUploadPath;
@@ -342,6 +379,7 @@ declare class FilesModule {
342
379
  private toErrorMessage;
343
380
  }
344
381
 
382
+ type ToolbarFormat = "3d" | "pdf";
345
383
  type GetSheetsOptions = {
346
384
  timeoutMs?: number;
347
385
  };
@@ -383,15 +421,11 @@ declare class ToolbarModule {
383
421
  disableAllPdf(): void;
384
422
  enableAll3D(): void;
385
423
  enableAllPdf(): void;
386
- hideToolbar(): void;
387
- showToolbar(): void;
388
- setToolbarVisible(visible: boolean, target?: ToolbarVisibilityTarget): void;
389
- hideLeftToolbar(): void;
390
- showLeftToolbar(): void;
391
- hideCenterToolbar(): void;
392
- showCenterToolbar(): void;
393
- hideRightToolbar(): void;
394
- showRightToolbar(): void;
424
+ useToolbar(target?: ToolbarUseTarget): void;
425
+ useLeftToolbar(): void;
426
+ useCenterToolbar(): void;
427
+ useRightToolbar(): void;
428
+ usePanel(panel: PanelTarget, format?: ToolbarFormat): void;
395
429
  openClippingPlanes(): void;
396
430
  closeClippingPlanes(): void;
397
431
  openSetting(): void;
@@ -411,6 +445,9 @@ declare class ToolbarModule {
411
445
  openSheets(): void;
412
446
  closeSheets(): void;
413
447
  getSheets(options?: GetSheetsOptions): Promise<SheetListItem[]>;
448
+ getObjectProperties(options?: GetSheetsOptions): Promise<ObjectPropertyItem[]>;
449
+ getLinkedObjects(options?: GetSheetsOptions): Promise<LinkedObjectItem[]>;
450
+ getStatesObjects(options?: GetSheetsOptions): Promise<StateObjectItem[]>;
414
451
  applySheet(sheetId: string | number): void;
415
452
  cuttingCloseSections(): void;
416
453
  cuttingMultipleSides(): void;
@@ -425,12 +462,15 @@ declare class ToolbarModule {
425
462
  cuttingReversePlaneY(): void;
426
463
  cuttingReversePlaneZ(): void;
427
464
  private postConfig;
428
- private postToolbarVisibility;
465
+ private postToolbarUse;
429
466
  private postPanelOpen;
430
467
  private postPanelClose;
431
468
  private postCuttingAction;
432
469
  private postSheetsGetList;
433
470
  private postSheetsApply;
471
+ private postObjectPropertiesGetList;
472
+ private postLinkedObjectsGetList;
473
+ private postStatesObjectsGetList;
434
474
  }
435
475
 
436
476
  type GetNodeIdsOptions = {
@@ -477,16 +517,15 @@ declare class LanguageModule {
477
517
  set(language: LanguageCode): void;
478
518
  }
479
519
 
480
- type InitialToolbarVisibility = Partial<Record<ToolbarVisibilityTarget, boolean>>;
520
+ type InitialToolbarUse = ToolbarUseTarget | ToolbarUseTarget[] | Partial<Record<ToolbarUseTarget, boolean>>;
481
521
  type Viewer3DOptions = {
482
522
  container: HTMLElement | string;
483
523
  url?: string;
484
524
  baseUrl?: string;
485
- conversionBaseUrl?: string;
486
525
  viewerPath?: string;
487
526
  uploadPath?: string;
488
527
  file?: File;
489
- initialToolbarVisibility?: InitialToolbarVisibility;
528
+ initialToolbar?: InitialToolbarUse;
490
529
  width?: string;
491
530
  height?: string;
492
531
  sandbox?: string;
@@ -516,6 +555,7 @@ declare class Viewer3D {
516
555
  destroy(): void;
517
556
  private ensureInit;
518
557
  private withInitialOptions;
558
+ private normalizeInitialToolbar;
519
559
  _on<K extends SdkEventKey>(event: K, cb: (payload: SdkEventPayload<K>) => void): () => void;
520
560
  _off<K extends SdkEventKey>(event: K, cb: (payload: SdkEventPayload<K>) => void): void;
521
561
  _emit<K extends SdkEventKey>(event: K, payload: SdkEventPayload<K>): void;
@@ -523,4 +563,4 @@ declare class Viewer3D {
523
563
  private handleMessage;
524
564
  }
525
565
 
526
- export { type ConvertOptions, type ConvertV2Options, type FileInfoCheckInput, type FileInfoCheckPayloadItem, type FilesConfig, type InitialToolbarVisibility, type LanguageCode, type LoadStage, type LoadStatePayload, type MarkupAction, type MarkupListItem, type MarkupOperationResultPayload, type PreparedViewerData, Viewer3D, type Viewer3DOptions };
566
+ export { type ConvertOptions, type ConvertV2Options, type FileInfoCheckInput, type FileInfoCheckPayloadItem, type FilesConfig, type InitialToolbarUse, type LanguageCode, type LoadStage, type LoadStatePayload, type MarkupAction, type MarkupListItem, type MarkupOperationResultPayload, type PreparedViewerData, Viewer3D };
package/dist/index.d.ts CHANGED
@@ -20,13 +20,19 @@ declare enum ViewerMessageType {
20
20
  ZOOM_WINDOW = "viewer-zoom-window",
21
21
  ZOOM_FIT = "viewer-zoom-fit",
22
22
  TOOLBAR_CONFIG = "viewer-toolbar-config",
23
- TOOLBAR_VISIBILITY = "viewer-toolbar-visibility",
23
+ TOOLBAR_USE = "viewer-toolbar-use",
24
24
  PANEL_OPEN = "viewer-panel-open",
25
25
  PANEL_CLOSE = "viewer-panel-close",
26
26
  CUTTING_PLANE_ACTION = "viewer-cutting-plane-action",
27
27
  SHEETS_GET_LIST = "viewer-sheets-get-list",
28
28
  SHEETS_LIST = "viewer-sheets-list",
29
29
  SHEETS_APPLY = "viewer-sheets-apply",
30
+ OBJECT_PROPERTIES_GET_LIST = "viewer-object-properties-get-list",
31
+ OBJECT_PROPERTIES_LIST = "viewer-object-properties-list",
32
+ LINKED_OBJECTS_GET_LIST = "viewer-linked-objects-get-list",
33
+ LINKED_OBJECTS_LIST = "viewer-linked-objects-list",
34
+ STATES_OBJECTS_GET_LIST = "viewer-states-objects-get-list",
35
+ STATES_OBJECTS_LIST = "viewer-states-objects-list",
30
36
  TREE_SELECT_NODE = "viewer-tree-select-node",
31
37
  TREE_GET_NODE_IDS = "viewer-tree-get-node-ids",
32
38
  TREE_NODE_IDS = "viewer-tree-node-ids",
@@ -42,7 +48,7 @@ declare enum ViewerMessageType {
42
48
  PAN_CHANGE = "viewer-pan-change"
43
49
  }
44
50
  type LanguageCode = "en" | "vn";
45
- type ToolbarVisibilityTarget = "all" | "left" | "center" | "right";
51
+ type ToolbarUseTarget = "all" | "left" | "center" | "right";
46
52
  type MarkupAction = "line" | "arrow" | "circle" | "ellipse" | "rectangle" | "polygon" | "polyline" | "textbox" | "note" | "callout" | "cloud" | "freehand";
47
53
  type MarkupOperationResultPayload = {
48
54
  requestId: string;
@@ -62,12 +68,29 @@ type MarkupListItem = {
62
68
  createdBy?: string;
63
69
  lastModifiedBy?: string;
64
70
  };
71
+ type PanelTarget = "clipping-commands" | "setting" | "statesObjects" | "linkedObjects" | "model-tree" | "sheets" | "object-properties";
65
72
  type SheetListItem = {
66
73
  id: string | number;
67
74
  name: string;
68
75
  is3D?: boolean;
69
76
  viewId?: string;
70
77
  };
78
+ type ObjectPropertyItem = Record<string, unknown>;
79
+ type LinkedObjectItem = Record<string, unknown>;
80
+ type StateObjectRefItem = {
81
+ name: string;
82
+ id: number;
83
+ };
84
+ type StateObjectItem = {
85
+ id: string;
86
+ name: string;
87
+ char: string;
88
+ object: StateObjectRefItem[];
89
+ states: {
90
+ color: string;
91
+ type: string;
92
+ };
93
+ };
71
94
  type PdfModeEventPayload = {
72
95
  mode: "plan" | "document";
73
96
  timestamp: number;
@@ -115,6 +138,21 @@ type ViewerEventMap = {
115
138
  activeSheetId?: string | number | null;
116
139
  timestamp: number;
117
140
  };
141
+ "object-properties:list": {
142
+ requestId: string;
143
+ properties: ObjectPropertyItem[];
144
+ timestamp: number;
145
+ };
146
+ "linked-objects:list": {
147
+ requestId: string;
148
+ linkedObjects: LinkedObjectItem[];
149
+ timestamp: number;
150
+ };
151
+ "states-objects:list": {
152
+ requestId: string;
153
+ statesObjects: StateObjectItem[];
154
+ timestamp: number;
155
+ };
118
156
  "markup:list": {
119
157
  requestId: string;
120
158
  markups: MarkupListItem[];
@@ -232,7 +270,6 @@ declare class NodeModule {
232
270
 
233
271
  type FilesConfig = {
234
272
  baseUrl?: string;
235
- conversionBaseUrl?: string;
236
273
  viewerPath?: string;
237
274
  uploadPath?: string;
238
275
  };
@@ -320,8 +357,8 @@ declare class FilesModule {
320
357
  private resolveFile;
321
358
  private normalizeBaseUrl;
322
359
  private resolveBaseUrl;
323
- private resolveConversionBaseUrl;
324
360
  private resolveViewerPath;
361
+ private normalizeSdkViewerPath;
325
362
  private resolveViewerOrigin;
326
363
  private resolveHostConversion;
327
364
  private getUploadPath;
@@ -342,6 +379,7 @@ declare class FilesModule {
342
379
  private toErrorMessage;
343
380
  }
344
381
 
382
+ type ToolbarFormat = "3d" | "pdf";
345
383
  type GetSheetsOptions = {
346
384
  timeoutMs?: number;
347
385
  };
@@ -383,15 +421,11 @@ declare class ToolbarModule {
383
421
  disableAllPdf(): void;
384
422
  enableAll3D(): void;
385
423
  enableAllPdf(): void;
386
- hideToolbar(): void;
387
- showToolbar(): void;
388
- setToolbarVisible(visible: boolean, target?: ToolbarVisibilityTarget): void;
389
- hideLeftToolbar(): void;
390
- showLeftToolbar(): void;
391
- hideCenterToolbar(): void;
392
- showCenterToolbar(): void;
393
- hideRightToolbar(): void;
394
- showRightToolbar(): void;
424
+ useToolbar(target?: ToolbarUseTarget): void;
425
+ useLeftToolbar(): void;
426
+ useCenterToolbar(): void;
427
+ useRightToolbar(): void;
428
+ usePanel(panel: PanelTarget, format?: ToolbarFormat): void;
395
429
  openClippingPlanes(): void;
396
430
  closeClippingPlanes(): void;
397
431
  openSetting(): void;
@@ -411,6 +445,9 @@ declare class ToolbarModule {
411
445
  openSheets(): void;
412
446
  closeSheets(): void;
413
447
  getSheets(options?: GetSheetsOptions): Promise<SheetListItem[]>;
448
+ getObjectProperties(options?: GetSheetsOptions): Promise<ObjectPropertyItem[]>;
449
+ getLinkedObjects(options?: GetSheetsOptions): Promise<LinkedObjectItem[]>;
450
+ getStatesObjects(options?: GetSheetsOptions): Promise<StateObjectItem[]>;
414
451
  applySheet(sheetId: string | number): void;
415
452
  cuttingCloseSections(): void;
416
453
  cuttingMultipleSides(): void;
@@ -425,12 +462,15 @@ declare class ToolbarModule {
425
462
  cuttingReversePlaneY(): void;
426
463
  cuttingReversePlaneZ(): void;
427
464
  private postConfig;
428
- private postToolbarVisibility;
465
+ private postToolbarUse;
429
466
  private postPanelOpen;
430
467
  private postPanelClose;
431
468
  private postCuttingAction;
432
469
  private postSheetsGetList;
433
470
  private postSheetsApply;
471
+ private postObjectPropertiesGetList;
472
+ private postLinkedObjectsGetList;
473
+ private postStatesObjectsGetList;
434
474
  }
435
475
 
436
476
  type GetNodeIdsOptions = {
@@ -477,16 +517,15 @@ declare class LanguageModule {
477
517
  set(language: LanguageCode): void;
478
518
  }
479
519
 
480
- type InitialToolbarVisibility = Partial<Record<ToolbarVisibilityTarget, boolean>>;
520
+ type InitialToolbarUse = ToolbarUseTarget | ToolbarUseTarget[] | Partial<Record<ToolbarUseTarget, boolean>>;
481
521
  type Viewer3DOptions = {
482
522
  container: HTMLElement | string;
483
523
  url?: string;
484
524
  baseUrl?: string;
485
- conversionBaseUrl?: string;
486
525
  viewerPath?: string;
487
526
  uploadPath?: string;
488
527
  file?: File;
489
- initialToolbarVisibility?: InitialToolbarVisibility;
528
+ initialToolbar?: InitialToolbarUse;
490
529
  width?: string;
491
530
  height?: string;
492
531
  sandbox?: string;
@@ -516,6 +555,7 @@ declare class Viewer3D {
516
555
  destroy(): void;
517
556
  private ensureInit;
518
557
  private withInitialOptions;
558
+ private normalizeInitialToolbar;
519
559
  _on<K extends SdkEventKey>(event: K, cb: (payload: SdkEventPayload<K>) => void): () => void;
520
560
  _off<K extends SdkEventKey>(event: K, cb: (payload: SdkEventPayload<K>) => void): void;
521
561
  _emit<K extends SdkEventKey>(event: K, payload: SdkEventPayload<K>): void;
@@ -523,4 +563,4 @@ declare class Viewer3D {
523
563
  private handleMessage;
524
564
  }
525
565
 
526
- export { type ConvertOptions, type ConvertV2Options, type FileInfoCheckInput, type FileInfoCheckPayloadItem, type FilesConfig, type InitialToolbarVisibility, type LanguageCode, type LoadStage, type LoadStatePayload, type MarkupAction, type MarkupListItem, type MarkupOperationResultPayload, type PreparedViewerData, Viewer3D, type Viewer3DOptions };
566
+ export { type ConvertOptions, type ConvertV2Options, type FileInfoCheckInput, type FileInfoCheckPayloadItem, type FilesConfig, type InitialToolbarUse, type LanguageCode, type LoadStage, type LoadStatePayload, type MarkupAction, type MarkupListItem, type MarkupOperationResultPayload, type PreparedViewerData, Viewer3D };