3dviewer-sdk 1.0.6 → 1.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/dist/contracts/messages.d.ts +6 -0
- package/dist/contracts/messages.js +1 -0
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +51 -7
- package/dist/index.mjs +51 -7
- package/dist/modules/files.module.d.ts +0 -1
- package/dist/modules/files.module.js +26 -7
- package/dist/modules/toolbar.module.d.ts +11 -1
- package/dist/modules/toolbar.module.js +30 -0
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ export 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
24
|
PANEL_OPEN = "viewer-panel-open",
|
|
24
25
|
PANEL_CLOSE = "viewer-panel-close",
|
|
25
26
|
CUTTING_PLANE_ACTION = "viewer-cutting-plane-action",
|
|
@@ -63,6 +64,11 @@ export declare type DrawModeValue = "shaded" | "wireframe" | "hidden-line" | "sh
|
|
|
63
64
|
export declare type DrawModePayload = {
|
|
64
65
|
mode: DrawModeValue;
|
|
65
66
|
};
|
|
67
|
+
export declare type ToolbarVisibilityTarget = "all" | "left" | "center" | "right";
|
|
68
|
+
export declare type ToolbarVisibilityPayload = {
|
|
69
|
+
visible: boolean;
|
|
70
|
+
target?: ToolbarVisibilityTarget;
|
|
71
|
+
};
|
|
66
72
|
export declare type ExplodePayload = {
|
|
67
73
|
magnitude: number;
|
|
68
74
|
};
|
|
@@ -22,6 +22,7 @@ export var ViewerMessageType;
|
|
|
22
22
|
ViewerMessageType["ZOOM_WINDOW"] = "viewer-zoom-window";
|
|
23
23
|
ViewerMessageType["ZOOM_FIT"] = "viewer-zoom-fit";
|
|
24
24
|
ViewerMessageType["TOOLBAR_CONFIG"] = "viewer-toolbar-config";
|
|
25
|
+
ViewerMessageType["TOOLBAR_VISIBILITY"] = "viewer-toolbar-visibility";
|
|
25
26
|
ViewerMessageType["PANEL_OPEN"] = "viewer-panel-open";
|
|
26
27
|
ViewerMessageType["PANEL_CLOSE"] = "viewer-panel-close";
|
|
27
28
|
ViewerMessageType["CUTTING_PLANE_ACTION"] = "viewer-cutting-plane-action";
|
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,7 @@ 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
24
|
PANEL_OPEN = "viewer-panel-open",
|
|
24
25
|
PANEL_CLOSE = "viewer-panel-close",
|
|
25
26
|
CUTTING_PLANE_ACTION = "viewer-cutting-plane-action",
|
|
@@ -41,6 +42,7 @@ declare enum ViewerMessageType {
|
|
|
41
42
|
PAN_CHANGE = "viewer-pan-change"
|
|
42
43
|
}
|
|
43
44
|
type LanguageCode = "en" | "vn";
|
|
45
|
+
type ToolbarVisibilityTarget = "all" | "left" | "center" | "right";
|
|
44
46
|
type MarkupAction = "line" | "arrow" | "circle" | "ellipse" | "rectangle" | "polygon" | "polyline" | "textbox" | "note" | "callout" | "cloud" | "freehand";
|
|
45
47
|
type MarkupOperationResultPayload = {
|
|
46
48
|
requestId: string;
|
|
@@ -315,7 +317,6 @@ declare class FilesModule {
|
|
|
315
317
|
private resolveViewerPath;
|
|
316
318
|
private resolveViewerOrigin;
|
|
317
319
|
private resolveHostConversion;
|
|
318
|
-
private resolveApiRoot;
|
|
319
320
|
private getUploadPath;
|
|
320
321
|
private fileSignature;
|
|
321
322
|
private createBaseFileId;
|
|
@@ -374,6 +375,15 @@ declare class ToolbarModule {
|
|
|
374
375
|
disableAllPdf(): void;
|
|
375
376
|
enableAll3D(): void;
|
|
376
377
|
enableAllPdf(): void;
|
|
378
|
+
hideToolbar(): void;
|
|
379
|
+
showToolbar(): void;
|
|
380
|
+
setToolbarVisible(visible: boolean, target?: ToolbarVisibilityTarget): void;
|
|
381
|
+
hideLeftToolbar(): void;
|
|
382
|
+
showLeftToolbar(): void;
|
|
383
|
+
hideCenterToolbar(): void;
|
|
384
|
+
showCenterToolbar(): void;
|
|
385
|
+
hideRightToolbar(): void;
|
|
386
|
+
showRightToolbar(): void;
|
|
377
387
|
openClippingPlanes(): void;
|
|
378
388
|
closeClippingPlanes(): void;
|
|
379
389
|
openSetting(): void;
|
|
@@ -407,6 +417,7 @@ declare class ToolbarModule {
|
|
|
407
417
|
cuttingReversePlaneY(): void;
|
|
408
418
|
cuttingReversePlaneZ(): void;
|
|
409
419
|
private postConfig;
|
|
420
|
+
private postToolbarVisibility;
|
|
410
421
|
private postPanelOpen;
|
|
411
422
|
private postPanelClose;
|
|
412
423
|
private postCuttingAction;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ 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
24
|
PANEL_OPEN = "viewer-panel-open",
|
|
24
25
|
PANEL_CLOSE = "viewer-panel-close",
|
|
25
26
|
CUTTING_PLANE_ACTION = "viewer-cutting-plane-action",
|
|
@@ -41,6 +42,7 @@ declare enum ViewerMessageType {
|
|
|
41
42
|
PAN_CHANGE = "viewer-pan-change"
|
|
42
43
|
}
|
|
43
44
|
type LanguageCode = "en" | "vn";
|
|
45
|
+
type ToolbarVisibilityTarget = "all" | "left" | "center" | "right";
|
|
44
46
|
type MarkupAction = "line" | "arrow" | "circle" | "ellipse" | "rectangle" | "polygon" | "polyline" | "textbox" | "note" | "callout" | "cloud" | "freehand";
|
|
45
47
|
type MarkupOperationResultPayload = {
|
|
46
48
|
requestId: string;
|
|
@@ -315,7 +317,6 @@ declare class FilesModule {
|
|
|
315
317
|
private resolveViewerPath;
|
|
316
318
|
private resolveViewerOrigin;
|
|
317
319
|
private resolveHostConversion;
|
|
318
|
-
private resolveApiRoot;
|
|
319
320
|
private getUploadPath;
|
|
320
321
|
private fileSignature;
|
|
321
322
|
private createBaseFileId;
|
|
@@ -374,6 +375,15 @@ declare class ToolbarModule {
|
|
|
374
375
|
disableAllPdf(): void;
|
|
375
376
|
enableAll3D(): void;
|
|
376
377
|
enableAllPdf(): void;
|
|
378
|
+
hideToolbar(): void;
|
|
379
|
+
showToolbar(): void;
|
|
380
|
+
setToolbarVisible(visible: boolean, target?: ToolbarVisibilityTarget): void;
|
|
381
|
+
hideLeftToolbar(): void;
|
|
382
|
+
showLeftToolbar(): void;
|
|
383
|
+
hideCenterToolbar(): void;
|
|
384
|
+
showCenterToolbar(): void;
|
|
385
|
+
hideRightToolbar(): void;
|
|
386
|
+
showRightToolbar(): void;
|
|
377
387
|
openClippingPlanes(): void;
|
|
378
388
|
closeClippingPlanes(): void;
|
|
379
389
|
openSetting(): void;
|
|
@@ -407,6 +417,7 @@ declare class ToolbarModule {
|
|
|
407
417
|
cuttingReversePlaneY(): void;
|
|
408
418
|
cuttingReversePlaneZ(): void;
|
|
409
419
|
private postConfig;
|
|
420
|
+
private postToolbarVisibility;
|
|
410
421
|
private postPanelOpen;
|
|
411
422
|
private postPanelClose;
|
|
412
423
|
private postCuttingAction;
|
package/dist/index.js
CHANGED
|
@@ -274,12 +274,30 @@ var FilesModule = class {
|
|
|
274
274
|
}
|
|
275
275
|
// Resolve viewer route path (e.g. /mainviewer).
|
|
276
276
|
resolveViewerPath() {
|
|
277
|
-
const
|
|
277
|
+
const configuredPath = this.config.viewerPath || this.viewer.getOptions().viewerPath;
|
|
278
|
+
if (!configuredPath) {
|
|
279
|
+
const viewerUrl = this.viewer.getOptions().url;
|
|
280
|
+
if (viewerUrl) {
|
|
281
|
+
try {
|
|
282
|
+
const pathname = new URL(viewerUrl, window.location.href).pathname;
|
|
283
|
+
if (pathname && pathname !== "/") return pathname;
|
|
284
|
+
} catch {
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const p = (configuredPath || "/mainviewer").trim();
|
|
278
289
|
if (!p) return "/mainviewer";
|
|
279
290
|
return p.startsWith("/") ? p : `/${p}`;
|
|
280
291
|
}
|
|
281
292
|
// Viewer host used to open iframe after conversion completes.
|
|
282
293
|
resolveViewerOrigin() {
|
|
294
|
+
const viewerUrl = this.viewer.getOptions().url;
|
|
295
|
+
if (viewerUrl) {
|
|
296
|
+
try {
|
|
297
|
+
return this.normalizeBaseUrl(new URL(viewerUrl, window.location.href).origin);
|
|
298
|
+
} catch {
|
|
299
|
+
}
|
|
300
|
+
}
|
|
283
301
|
return this.normalizeBaseUrl(DEFAULT_VIEWER_ORIGIN);
|
|
284
302
|
}
|
|
285
303
|
// Build conversion service root from API base URL.
|
|
@@ -287,10 +305,6 @@ var FilesModule = class {
|
|
|
287
305
|
const baseUrl = this.resolveBaseUrl();
|
|
288
306
|
return baseUrl.endsWith("/service/conversion") ? baseUrl : `${baseUrl}/service/conversion`;
|
|
289
307
|
}
|
|
290
|
-
// Newer convert endpoint is served from the API root, not /service/conversion.
|
|
291
|
-
resolveApiRoot() {
|
|
292
|
-
return this.resolveBaseUrl();
|
|
293
|
-
}
|
|
294
308
|
// Resolve upload path sent to conversion APIs.
|
|
295
309
|
getUploadPath() {
|
|
296
310
|
return this.config.uploadPath || this.viewer.getOptions().uploadPath || ".";
|
|
@@ -434,7 +448,7 @@ var FilesModule = class {
|
|
|
434
448
|
}
|
|
435
449
|
// Submit conversion request to the newer downloadUrl-based endpoint.
|
|
436
450
|
async cacheFileV2(options) {
|
|
437
|
-
const
|
|
451
|
+
const hostConversion = await this.resolveHostConversion();
|
|
438
452
|
const params = new URLSearchParams();
|
|
439
453
|
if (typeof options.overwrite === "boolean") {
|
|
440
454
|
params.set("overwrite", String(options.overwrite));
|
|
@@ -443,7 +457,7 @@ var FilesModule = class {
|
|
|
443
457
|
params.set("project", options.project);
|
|
444
458
|
}
|
|
445
459
|
const query = params.toString();
|
|
446
|
-
const url = `${
|
|
460
|
+
const url = `${hostConversion}/api/StreamFile/convert${query ? `?${query}` : ""}`;
|
|
447
461
|
const payload = this.buildConvertV2Payload(options);
|
|
448
462
|
const response = await fetch(url, {
|
|
449
463
|
method: "POST",
|
|
@@ -618,6 +632,33 @@ var ToolbarModule = class {
|
|
|
618
632
|
enableAllPdf() {
|
|
619
633
|
this.clearDisabledPdf();
|
|
620
634
|
}
|
|
635
|
+
hideToolbar() {
|
|
636
|
+
this.setToolbarVisible(false);
|
|
637
|
+
}
|
|
638
|
+
showToolbar() {
|
|
639
|
+
this.setToolbarVisible(true);
|
|
640
|
+
}
|
|
641
|
+
setToolbarVisible(visible, target = "all") {
|
|
642
|
+
this.postToolbarVisibility({ visible, target });
|
|
643
|
+
}
|
|
644
|
+
hideLeftToolbar() {
|
|
645
|
+
this.setToolbarVisible(false, "left");
|
|
646
|
+
}
|
|
647
|
+
showLeftToolbar() {
|
|
648
|
+
this.setToolbarVisible(true, "left");
|
|
649
|
+
}
|
|
650
|
+
hideCenterToolbar() {
|
|
651
|
+
this.setToolbarVisible(false, "center");
|
|
652
|
+
}
|
|
653
|
+
showCenterToolbar() {
|
|
654
|
+
this.setToolbarVisible(true, "center");
|
|
655
|
+
}
|
|
656
|
+
hideRightToolbar() {
|
|
657
|
+
this.setToolbarVisible(false, "right");
|
|
658
|
+
}
|
|
659
|
+
showRightToolbar() {
|
|
660
|
+
this.setToolbarVisible(true, "right");
|
|
661
|
+
}
|
|
621
662
|
openClippingPlanes() {
|
|
622
663
|
this.postPanelOpen({ panel: "clipping-commands", format: "3d" });
|
|
623
664
|
}
|
|
@@ -732,6 +773,9 @@ var ToolbarModule = class {
|
|
|
732
773
|
postConfig(payload) {
|
|
733
774
|
this.viewer.postToViewer("viewer-toolbar-config" /* TOOLBAR_CONFIG */, payload);
|
|
734
775
|
}
|
|
776
|
+
postToolbarVisibility(payload) {
|
|
777
|
+
this.viewer.postToViewer("viewer-toolbar-visibility" /* TOOLBAR_VISIBILITY */, payload);
|
|
778
|
+
}
|
|
735
779
|
postPanelOpen(payload) {
|
|
736
780
|
this.viewer.postToViewer("viewer-panel-open" /* PANEL_OPEN */, payload);
|
|
737
781
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -248,12 +248,30 @@ var FilesModule = class {
|
|
|
248
248
|
}
|
|
249
249
|
// Resolve viewer route path (e.g. /mainviewer).
|
|
250
250
|
resolveViewerPath() {
|
|
251
|
-
const
|
|
251
|
+
const configuredPath = this.config.viewerPath || this.viewer.getOptions().viewerPath;
|
|
252
|
+
if (!configuredPath) {
|
|
253
|
+
const viewerUrl = this.viewer.getOptions().url;
|
|
254
|
+
if (viewerUrl) {
|
|
255
|
+
try {
|
|
256
|
+
const pathname = new URL(viewerUrl, window.location.href).pathname;
|
|
257
|
+
if (pathname && pathname !== "/") return pathname;
|
|
258
|
+
} catch {
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const p = (configuredPath || "/mainviewer").trim();
|
|
252
263
|
if (!p) return "/mainviewer";
|
|
253
264
|
return p.startsWith("/") ? p : `/${p}`;
|
|
254
265
|
}
|
|
255
266
|
// Viewer host used to open iframe after conversion completes.
|
|
256
267
|
resolveViewerOrigin() {
|
|
268
|
+
const viewerUrl = this.viewer.getOptions().url;
|
|
269
|
+
if (viewerUrl) {
|
|
270
|
+
try {
|
|
271
|
+
return this.normalizeBaseUrl(new URL(viewerUrl, window.location.href).origin);
|
|
272
|
+
} catch {
|
|
273
|
+
}
|
|
274
|
+
}
|
|
257
275
|
return this.normalizeBaseUrl(DEFAULT_VIEWER_ORIGIN);
|
|
258
276
|
}
|
|
259
277
|
// Build conversion service root from API base URL.
|
|
@@ -261,10 +279,6 @@ var FilesModule = class {
|
|
|
261
279
|
const baseUrl = this.resolveBaseUrl();
|
|
262
280
|
return baseUrl.endsWith("/service/conversion") ? baseUrl : `${baseUrl}/service/conversion`;
|
|
263
281
|
}
|
|
264
|
-
// Newer convert endpoint is served from the API root, not /service/conversion.
|
|
265
|
-
resolveApiRoot() {
|
|
266
|
-
return this.resolveBaseUrl();
|
|
267
|
-
}
|
|
268
282
|
// Resolve upload path sent to conversion APIs.
|
|
269
283
|
getUploadPath() {
|
|
270
284
|
return this.config.uploadPath || this.viewer.getOptions().uploadPath || ".";
|
|
@@ -408,7 +422,7 @@ var FilesModule = class {
|
|
|
408
422
|
}
|
|
409
423
|
// Submit conversion request to the newer downloadUrl-based endpoint.
|
|
410
424
|
async cacheFileV2(options) {
|
|
411
|
-
const
|
|
425
|
+
const hostConversion = await this.resolveHostConversion();
|
|
412
426
|
const params = new URLSearchParams();
|
|
413
427
|
if (typeof options.overwrite === "boolean") {
|
|
414
428
|
params.set("overwrite", String(options.overwrite));
|
|
@@ -417,7 +431,7 @@ var FilesModule = class {
|
|
|
417
431
|
params.set("project", options.project);
|
|
418
432
|
}
|
|
419
433
|
const query = params.toString();
|
|
420
|
-
const url = `${
|
|
434
|
+
const url = `${hostConversion}/api/StreamFile/convert${query ? `?${query}` : ""}`;
|
|
421
435
|
const payload = this.buildConvertV2Payload(options);
|
|
422
436
|
const response = await fetch(url, {
|
|
423
437
|
method: "POST",
|
|
@@ -592,6 +606,33 @@ var ToolbarModule = class {
|
|
|
592
606
|
enableAllPdf() {
|
|
593
607
|
this.clearDisabledPdf();
|
|
594
608
|
}
|
|
609
|
+
hideToolbar() {
|
|
610
|
+
this.setToolbarVisible(false);
|
|
611
|
+
}
|
|
612
|
+
showToolbar() {
|
|
613
|
+
this.setToolbarVisible(true);
|
|
614
|
+
}
|
|
615
|
+
setToolbarVisible(visible, target = "all") {
|
|
616
|
+
this.postToolbarVisibility({ visible, target });
|
|
617
|
+
}
|
|
618
|
+
hideLeftToolbar() {
|
|
619
|
+
this.setToolbarVisible(false, "left");
|
|
620
|
+
}
|
|
621
|
+
showLeftToolbar() {
|
|
622
|
+
this.setToolbarVisible(true, "left");
|
|
623
|
+
}
|
|
624
|
+
hideCenterToolbar() {
|
|
625
|
+
this.setToolbarVisible(false, "center");
|
|
626
|
+
}
|
|
627
|
+
showCenterToolbar() {
|
|
628
|
+
this.setToolbarVisible(true, "center");
|
|
629
|
+
}
|
|
630
|
+
hideRightToolbar() {
|
|
631
|
+
this.setToolbarVisible(false, "right");
|
|
632
|
+
}
|
|
633
|
+
showRightToolbar() {
|
|
634
|
+
this.setToolbarVisible(true, "right");
|
|
635
|
+
}
|
|
595
636
|
openClippingPlanes() {
|
|
596
637
|
this.postPanelOpen({ panel: "clipping-commands", format: "3d" });
|
|
597
638
|
}
|
|
@@ -706,6 +747,9 @@ var ToolbarModule = class {
|
|
|
706
747
|
postConfig(payload) {
|
|
707
748
|
this.viewer.postToViewer("viewer-toolbar-config" /* TOOLBAR_CONFIG */, payload);
|
|
708
749
|
}
|
|
750
|
+
postToolbarVisibility(payload) {
|
|
751
|
+
this.viewer.postToViewer("viewer-toolbar-visibility" /* TOOLBAR_VISIBILITY */, payload);
|
|
752
|
+
}
|
|
709
753
|
postPanelOpen(payload) {
|
|
710
754
|
this.viewer.postToViewer("viewer-panel-open" /* PANEL_OPEN */, payload);
|
|
711
755
|
}
|
|
@@ -134,13 +134,36 @@ export class FilesModule {
|
|
|
134
134
|
}
|
|
135
135
|
// Resolve viewer route path (e.g. /mainviewer).
|
|
136
136
|
resolveViewerPath() {
|
|
137
|
-
const
|
|
137
|
+
const configuredPath = this.config.viewerPath || this.viewer.getOptions().viewerPath;
|
|
138
|
+
if (!configuredPath) {
|
|
139
|
+
const viewerUrl = this.viewer.getOptions().url;
|
|
140
|
+
if (viewerUrl) {
|
|
141
|
+
try {
|
|
142
|
+
const pathname = new URL(viewerUrl, window.location.href).pathname;
|
|
143
|
+
if (pathname && pathname !== "/")
|
|
144
|
+
return pathname;
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// Fallback to default path below.
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const p = (configuredPath || "/mainviewer").trim();
|
|
138
152
|
if (!p)
|
|
139
153
|
return "/mainviewer";
|
|
140
154
|
return p.startsWith("/") ? p : `/${p}`;
|
|
141
155
|
}
|
|
142
156
|
// Viewer host used to open iframe after conversion completes.
|
|
143
157
|
resolveViewerOrigin() {
|
|
158
|
+
const viewerUrl = this.viewer.getOptions().url;
|
|
159
|
+
if (viewerUrl) {
|
|
160
|
+
try {
|
|
161
|
+
return this.normalizeBaseUrl(new URL(viewerUrl, window.location.href).origin);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// Fallback to default origin below.
|
|
165
|
+
}
|
|
166
|
+
}
|
|
144
167
|
return this.normalizeBaseUrl(DEFAULT_VIEWER_ORIGIN);
|
|
145
168
|
}
|
|
146
169
|
// Build conversion service root from API base URL.
|
|
@@ -148,10 +171,6 @@ export class FilesModule {
|
|
|
148
171
|
const baseUrl = this.resolveBaseUrl();
|
|
149
172
|
return baseUrl.endsWith("/service/conversion") ? baseUrl : `${baseUrl}/service/conversion`;
|
|
150
173
|
}
|
|
151
|
-
// Newer convert endpoint is served from the API root, not /service/conversion.
|
|
152
|
-
resolveApiRoot() {
|
|
153
|
-
return this.resolveBaseUrl();
|
|
154
|
-
}
|
|
155
174
|
// Resolve upload path sent to conversion APIs.
|
|
156
175
|
getUploadPath() {
|
|
157
176
|
return this.config.uploadPath || this.viewer.getOptions().uploadPath || ".";
|
|
@@ -298,7 +317,7 @@ export class FilesModule {
|
|
|
298
317
|
}
|
|
299
318
|
// Submit conversion request to the newer downloadUrl-based endpoint.
|
|
300
319
|
async cacheFileV2(options) {
|
|
301
|
-
const
|
|
320
|
+
const hostConversion = await this.resolveHostConversion();
|
|
302
321
|
const params = new URLSearchParams();
|
|
303
322
|
if (typeof options.overwrite === "boolean") {
|
|
304
323
|
params.set("overwrite", String(options.overwrite));
|
|
@@ -307,7 +326,7 @@ export class FilesModule {
|
|
|
307
326
|
params.set("project", options.project);
|
|
308
327
|
}
|
|
309
328
|
const query = params.toString();
|
|
310
|
-
const url = `${
|
|
329
|
+
const url = `${hostConversion}/api/StreamFile/convert${query ? `?${query}` : ""}`;
|
|
311
330
|
const payload = this.buildConvertV2Payload(options);
|
|
312
331
|
const response = await fetch(url, {
|
|
313
332
|
method: "POST",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Viewer3D } from "../viewer";
|
|
2
|
-
import { type SheetListItem } from "../contracts/messages";
|
|
2
|
+
import { type SheetListItem, type ToolbarVisibilityTarget } from "../contracts/messages";
|
|
3
3
|
export declare type ToolbarFormat = "3d" | "pdf";
|
|
4
4
|
export declare type GetSheetsOptions = {
|
|
5
5
|
timeoutMs?: number;
|
|
@@ -42,6 +42,15 @@ export declare class ToolbarModule {
|
|
|
42
42
|
disableAllPdf(): void;
|
|
43
43
|
enableAll3D(): void;
|
|
44
44
|
enableAllPdf(): void;
|
|
45
|
+
hideToolbar(): void;
|
|
46
|
+
showToolbar(): void;
|
|
47
|
+
setToolbarVisible(visible: boolean, target?: ToolbarVisibilityTarget): void;
|
|
48
|
+
hideLeftToolbar(): void;
|
|
49
|
+
showLeftToolbar(): void;
|
|
50
|
+
hideCenterToolbar(): void;
|
|
51
|
+
showCenterToolbar(): void;
|
|
52
|
+
hideRightToolbar(): void;
|
|
53
|
+
showRightToolbar(): void;
|
|
45
54
|
openClippingPlanes(): void;
|
|
46
55
|
closeClippingPlanes(): void;
|
|
47
56
|
openSetting(): void;
|
|
@@ -75,6 +84,7 @@ export declare class ToolbarModule {
|
|
|
75
84
|
cuttingReversePlaneY(): void;
|
|
76
85
|
cuttingReversePlaneZ(): void;
|
|
77
86
|
private postConfig;
|
|
87
|
+
private postToolbarVisibility;
|
|
78
88
|
private postPanelOpen;
|
|
79
89
|
private postPanelClose;
|
|
80
90
|
private postCuttingAction;
|
|
@@ -86,6 +86,33 @@ export class ToolbarModule {
|
|
|
86
86
|
enableAllPdf() {
|
|
87
87
|
this.clearDisabledPdf();
|
|
88
88
|
}
|
|
89
|
+
hideToolbar() {
|
|
90
|
+
this.setToolbarVisible(false);
|
|
91
|
+
}
|
|
92
|
+
showToolbar() {
|
|
93
|
+
this.setToolbarVisible(true);
|
|
94
|
+
}
|
|
95
|
+
setToolbarVisible(visible, target = "all") {
|
|
96
|
+
this.postToolbarVisibility({ visible, target });
|
|
97
|
+
}
|
|
98
|
+
hideLeftToolbar() {
|
|
99
|
+
this.setToolbarVisible(false, "left");
|
|
100
|
+
}
|
|
101
|
+
showLeftToolbar() {
|
|
102
|
+
this.setToolbarVisible(true, "left");
|
|
103
|
+
}
|
|
104
|
+
hideCenterToolbar() {
|
|
105
|
+
this.setToolbarVisible(false, "center");
|
|
106
|
+
}
|
|
107
|
+
showCenterToolbar() {
|
|
108
|
+
this.setToolbarVisible(true, "center");
|
|
109
|
+
}
|
|
110
|
+
hideRightToolbar() {
|
|
111
|
+
this.setToolbarVisible(false, "right");
|
|
112
|
+
}
|
|
113
|
+
showRightToolbar() {
|
|
114
|
+
this.setToolbarVisible(true, "right");
|
|
115
|
+
}
|
|
89
116
|
openClippingPlanes() {
|
|
90
117
|
this.postPanelOpen({ panel: "clipping-commands", format: "3d" });
|
|
91
118
|
}
|
|
@@ -201,6 +228,9 @@ export class ToolbarModule {
|
|
|
201
228
|
postConfig(payload) {
|
|
202
229
|
this.viewer.postToViewer(ViewerMessageType.TOOLBAR_CONFIG, payload);
|
|
203
230
|
}
|
|
231
|
+
postToolbarVisibility(payload) {
|
|
232
|
+
this.viewer.postToViewer(ViewerMessageType.TOOLBAR_VISIBILITY, payload);
|
|
233
|
+
}
|
|
204
234
|
postPanelOpen(payload) {
|
|
205
235
|
this.viewer.postToViewer(ViewerMessageType.PANEL_OPEN, payload);
|
|
206
236
|
}
|