@x-viewer/plugins 0.12.2 → 0.12.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.
|
@@ -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:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-viewer/plugins",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "Plugin package providing extensible functionality modules for x-viewer. Includes measurement tools, markup annotations, section planes, toolbars, layer management, export/screenshot capabilities, and various UI enhancements.",
|
|
5
5
|
"author": "x-viewer",
|
|
6
6
|
"license": "UNLICENSED",
|