@x-viewer/plugins 0.12.2 → 0.12.4
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.esm.js +91 -91
- package/dist/types/dat-gui/Viewer3dDatGui.d.ts +5 -0
- package/dist/types/local-model-uploader/IUploader.d.ts +24 -5
- package/dist/types/local-model-uploader/LocalDxfUploader.d.ts +3 -2
- package/dist/types/local-model-uploader/LocalModelUploader.d.ts +3 -2
- package/dist/types/stats/StatsPlugin.d.ts +2 -6
- package/dist/types/toolbars/Toolbar.d.ts +2 -2
- package/dist/types/toolbars/Viewer2dToolbarPlugin.d.ts +2 -0
- package/dist/types/toolbars/Viewer3dToolbarPlugin.d.ts +2 -0
- package/package.json +21 -6
|
@@ -55,6 +55,11 @@ export declare class Viewer3dDatGuiPlugin extends Plugin {
|
|
|
55
55
|
fogFarDistance: number;
|
|
56
56
|
distanceCullingFactor: number;
|
|
57
57
|
errorTarget: number;
|
|
58
|
+
ssao_output: string;
|
|
59
|
+
ssao_kernelRadius: number;
|
|
60
|
+
ssao_minDistance: number;
|
|
61
|
+
ssao_maxDistance: number;
|
|
62
|
+
ssao_enable: boolean;
|
|
58
63
|
};
|
|
59
64
|
/**
|
|
60
65
|
* Init dat.GUI
|
|
@@ -1,14 +1,33 @@
|
|
|
1
|
-
import { BaseViewer } from "@x-viewer/core";
|
|
1
|
+
import { BaseViewer, Plugin, PluginConfig } from "@x-viewer/core";
|
|
2
|
+
/**
|
|
3
|
+
* Uploader plugin config.
|
|
4
|
+
*/
|
|
5
|
+
export interface UploaderConfig extends Partial<PluginConfig> {
|
|
6
|
+
formats?: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Enable to drag and drop files.
|
|
9
|
+
* Default to be true.
|
|
10
|
+
*/
|
|
11
|
+
enableDragDropFile?: boolean;
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* @hidden
|
|
4
15
|
*/
|
|
5
|
-
export declare class IUploader {
|
|
6
|
-
protected
|
|
16
|
+
export declare class IUploader extends Plugin {
|
|
17
|
+
protected cfg: UploaderConfig;
|
|
7
18
|
protected input: HTMLInputElement;
|
|
8
19
|
protected dropZone: HTMLDivElement;
|
|
9
20
|
protected _formats: string[];
|
|
10
21
|
/**
|
|
11
|
-
* Callback function called when file
|
|
22
|
+
* Callback function called when file loading starts.
|
|
23
|
+
* @param event - Event object containing file information
|
|
24
|
+
*/
|
|
25
|
+
onStart?: (event: {
|
|
26
|
+
file: File;
|
|
27
|
+
fileName: string;
|
|
28
|
+
}) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Callback function called when file upload and loaded to scene successfully.
|
|
12
31
|
* @param event - Event object containing file information
|
|
13
32
|
*/
|
|
14
33
|
onSuccess?: (event: {
|
|
@@ -24,7 +43,7 @@ export declare class IUploader {
|
|
|
24
43
|
fileName: string;
|
|
25
44
|
error: Error | unknown;
|
|
26
45
|
}) => void;
|
|
27
|
-
constructor(viewer: BaseViewer,
|
|
46
|
+
constructor(viewer: BaseViewer, cfg: UploaderConfig);
|
|
28
47
|
protected formats(): string[];
|
|
29
48
|
protected uploadFiles(files: FileList): void;
|
|
30
49
|
openFileBrowserToUpload(): void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Viewer2d, ModelConfig } from "@x-viewer/core";
|
|
2
|
-
import { IUploader } from "./IUploader";
|
|
2
|
+
import { IUploader, UploaderConfig } from "./IUploader";
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
5
5
|
*/
|
|
6
6
|
export declare class LocalDxfUploader extends IUploader {
|
|
7
|
+
static readonly DEFAULT_ID = "LocalDxfUploader";
|
|
7
8
|
readonly defaultModelConfig: ModelConfig;
|
|
8
|
-
constructor(viewer: Viewer2d,
|
|
9
|
+
constructor(viewer: Viewer2d, cfg?: UploaderConfig);
|
|
9
10
|
setPdfWorker(pdfWorker: string): void;
|
|
10
11
|
protected formats(): string[];
|
|
11
12
|
protected uploadFiles(files: FileList): void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ModelConfig, Viewer3d } from "@x-viewer/core";
|
|
2
|
-
import { IUploader } from "./IUploader";
|
|
2
|
+
import { IUploader, UploaderConfig } from "./IUploader";
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
5
5
|
*/
|
|
6
6
|
export declare class LocalModelUploader extends IUploader {
|
|
7
|
+
static readonly DEFAULT_ID = "LocalModelUploader";
|
|
7
8
|
readonly defaultModelConfig: ModelConfig;
|
|
8
|
-
constructor(viewer: Viewer3d,
|
|
9
|
+
constructor(viewer: Viewer3d, cfg?: UploaderConfig);
|
|
9
10
|
protected formats(): string[];
|
|
10
11
|
/**
|
|
11
12
|
* Uploads model files. There are several cases:
|
|
@@ -7,12 +7,8 @@ export declare class StatsPlugin extends Plugin {
|
|
|
7
7
|
protected stats?: Stats;
|
|
8
8
|
constructor(viewer: BaseViewer);
|
|
9
9
|
/**
|
|
10
|
-
* Shows the stats panel, which indicates current FPS, MS, MB, etc.
|
|
10
|
+
* Shows or hide the stats panel, which indicates current FPS, MS, MB, etc.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Shows the stats panel, which indicates current FPS, MS, MB, etc.
|
|
15
|
-
*/
|
|
16
|
-
hide(): void;
|
|
12
|
+
setVisible(visible: boolean): void;
|
|
17
13
|
destroy(): void;
|
|
18
14
|
}
|
|
@@ -30,6 +30,8 @@ export declare class Viewer2dToolbarPlugin extends Plugin {
|
|
|
30
30
|
* Gets if a menu item is active.
|
|
31
31
|
*/
|
|
32
32
|
isActive(menuId: string): boolean;
|
|
33
|
+
setVisible(visible: boolean): void;
|
|
34
|
+
isVisible(): boolean;
|
|
33
35
|
protected onMarkupActivated: () => void;
|
|
34
36
|
protected onMarkupDeactivated: () => void;
|
|
35
37
|
destroy(): void;
|
|
@@ -25,6 +25,8 @@ export declare class Viewer3dToolbarPlugin extends Plugin {
|
|
|
25
25
|
* Gets if a menu item is active.
|
|
26
26
|
*/
|
|
27
27
|
isActive(menuId: string): boolean;
|
|
28
|
+
setVisible(visible: boolean): void;
|
|
29
|
+
isVisible(): boolean;
|
|
28
30
|
/**
|
|
29
31
|
* When taking a screenshot, user may want to set a custom filename.
|
|
30
32
|
* If not set, it will be "download", so the file is "download.png" or "download.jpg".
|
package/package.json
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-viewer/plugins",
|
|
3
|
-
"version": "0.12.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.12.4",
|
|
4
|
+
"homepage": "https://dwg.thingraph.site/",
|
|
5
|
+
"description": "Plugin modules for @x-viewer/core: measurement tools, markup annotations, layer management, toolbar, screenshot and more. Works with DWG/DXF/3D viewers.",
|
|
6
|
+
"author": "thingraph",
|
|
6
7
|
"license": "UNLICENSED",
|
|
7
8
|
"keywords": [
|
|
9
|
+
"dwg",
|
|
10
|
+
"dxf",
|
|
11
|
+
"dwg-viewer",
|
|
12
|
+
"dxf-viewer",
|
|
13
|
+
"cad-viewer",
|
|
14
|
+
"markup",
|
|
15
|
+
"annotation",
|
|
16
|
+
"measurement",
|
|
17
|
+
"layer",
|
|
8
18
|
"ifc",
|
|
9
19
|
"bim",
|
|
10
|
-
"gis",
|
|
11
20
|
"cad",
|
|
12
21
|
"viewer",
|
|
13
22
|
"three.js",
|
|
14
|
-
"typescript"
|
|
23
|
+
"typescript",
|
|
24
|
+
"webgl"
|
|
15
25
|
],
|
|
16
26
|
"repository": {
|
|
17
|
-
"type": "git"
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/thingraph/dwg-viewer-example"
|
|
29
|
+
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/thingraph/dwg-viewer-example/issues",
|
|
32
|
+
"email": "thingraph@outlook.com"
|
|
18
33
|
},
|
|
19
34
|
"publishConfig": {
|
|
20
35
|
"access": "public",
|