@x-viewer/plugins 0.9.0 → 0.11.0
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 +36 -1
- package/dist/index.esm.js +92 -92
- package/dist/types/local-model-uploader/IUploader.d.ts +17 -0
- package/dist/types/local-model-uploader/LocalDxfUploader.d.ts +1 -2
- package/dist/types/toolbars/Locale.d.ts +2 -0
- package/dist/types/toolbars/Toolbar.constants.d.ts +9 -10
- package/package.json +58 -58
|
@@ -7,6 +7,23 @@ export declare class IUploader {
|
|
|
7
7
|
protected input: HTMLInputElement;
|
|
8
8
|
protected dropZone: HTMLDivElement;
|
|
9
9
|
protected _formats: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Callback function called when file upload succeeds.
|
|
12
|
+
* @param event - Event object containing file information
|
|
13
|
+
*/
|
|
14
|
+
onSuccess?: (event: {
|
|
15
|
+
file: File;
|
|
16
|
+
fileName: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Callback function called when file upload fails.
|
|
20
|
+
* @param event - Event object containing file information and error
|
|
21
|
+
*/
|
|
22
|
+
onError?: (event: {
|
|
23
|
+
file: File;
|
|
24
|
+
fileName: string;
|
|
25
|
+
error: Error | unknown;
|
|
26
|
+
}) => void;
|
|
10
27
|
constructor(viewer: BaseViewer, elementId?: string, formats?: string[]);
|
|
11
28
|
protected formats(): string[];
|
|
12
29
|
protected uploadFiles(files: FileList): void;
|
|
@@ -5,7 +5,6 @@ import { IUploader } from "./IUploader";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class LocalDxfUploader extends IUploader {
|
|
7
7
|
private pdfWorker;
|
|
8
|
-
onSuccess?: (event: any) => void;
|
|
9
8
|
readonly defaultModelConfig: ModelConfig;
|
|
10
9
|
constructor(viewer: Viewer2d, elementId?: string, formats?: string[]);
|
|
11
10
|
setPdfWorker(pdfWorker: string): void;
|
|
@@ -16,7 +15,7 @@ export declare class LocalDxfUploader extends IUploader {
|
|
|
16
15
|
*/
|
|
17
16
|
private uploadSingleDxf;
|
|
18
17
|
/**
|
|
19
|
-
* Upload single
|
|
18
|
+
* Upload single pdf file.
|
|
20
19
|
*/
|
|
21
20
|
private uploadSinglePdf;
|
|
22
21
|
}
|
|
@@ -45,6 +45,7 @@ export declare const en: {
|
|
|
45
45
|
fullscreen: string;
|
|
46
46
|
layers: string;
|
|
47
47
|
zoomToRectangle: string;
|
|
48
|
+
zoomToExtent: string;
|
|
48
49
|
screenshot: string;
|
|
49
50
|
};
|
|
50
51
|
export declare const cn: {
|
|
@@ -93,6 +94,7 @@ export declare const cn: {
|
|
|
93
94
|
fullscreen: string;
|
|
94
95
|
layers: string;
|
|
95
96
|
zoomToRectangle: string;
|
|
97
|
+
zoomToExtent: string;
|
|
96
98
|
screenshot: string;
|
|
97
99
|
};
|
|
98
100
|
export declare const i18n: i18next.i18n;
|
|
@@ -2,16 +2,14 @@ import { type BaseViewer, IconClass } from "@x-viewer/core";
|
|
|
2
2
|
import type { Toolbar } from "./Toolbar";
|
|
3
3
|
/**
|
|
4
4
|
* @type
|
|
5
|
-
* 1:
|
|
6
|
-
* 2
|
|
7
|
-
* 3
|
|
8
|
-
* 4:turn on/off
|
|
5
|
+
* 1: button
|
|
6
|
+
* 2: dropdown menu
|
|
7
|
+
* 3: toggle button
|
|
9
8
|
*/
|
|
10
|
-
export declare enum
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Switch = 4
|
|
9
|
+
export declare enum ToolbarMenuType {
|
|
10
|
+
Button = 1,
|
|
11
|
+
DropdownMenu = 2,
|
|
12
|
+
ToggleButton = 3
|
|
15
13
|
}
|
|
16
14
|
/**
|
|
17
15
|
* Buildin toolbar ids
|
|
@@ -63,6 +61,7 @@ export declare enum ToolbarMenuId {
|
|
|
63
61
|
SceneClear = "SceneClear",
|
|
64
62
|
Layers = "Layers",
|
|
65
63
|
ZoomToRectangle = "ZoomToRectangle",
|
|
64
|
+
ZoomToExtent = "ZoomToExtent",
|
|
66
65
|
Screenshot = "GetScreenshot"
|
|
67
66
|
}
|
|
68
67
|
/**
|
|
@@ -76,7 +75,7 @@ export interface ToolbarMenuConfig {
|
|
|
76
75
|
visible?: boolean;
|
|
77
76
|
mutexIds?: ToolbarMenuId[];
|
|
78
77
|
defaultActive?: boolean;
|
|
79
|
-
type?:
|
|
78
|
+
type?: ToolbarMenuType;
|
|
80
79
|
customElement?: (viewer: BaseViewer, menuId: string, cfg: ToolbarMenuConfig) => HTMLDivElement;
|
|
81
80
|
onActive?: (viewer: BaseViewer, toolbar: Toolbar) => void;
|
|
82
81
|
onDeactive?: (viewer: BaseViewer) => void;
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@x-viewer/plugins",
|
|
3
|
+
"version": "0.11.0",
|
|
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
|
+
"author": "x-viewer",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"ifc",
|
|
9
|
+
"bim",
|
|
10
|
+
"gis",
|
|
11
|
+
"cad",
|
|
12
|
+
"viewer",
|
|
13
|
+
"three.js",
|
|
14
|
+
"typescript"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"registry": "https://registry.npmjs.org/"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"package.json",
|
|
25
|
+
"dist",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"main": "dist/index.esm.js",
|
|
31
|
+
"module": "dist/index.esm.js",
|
|
32
|
+
"types": "dist/types/index.d.ts",
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "pnpm run clean:build && pnpm run data-type && rollup -c --environment BUILD:production",
|
|
35
|
+
"clean:build": "rimraf ./dist",
|
|
36
|
+
"data-type": "tsc --project tsconfig.bundle.json && tsc-alias -p tsconfig.bundle.json",
|
|
37
|
+
"dev": "pnpm run data-type && rollup -c -w",
|
|
38
|
+
"lint": "eslint . --ext .js,.ts",
|
|
39
|
+
"lint:fix": "pnpm lint --fix",
|
|
40
|
+
"format": "prettier --check .",
|
|
41
|
+
"format:fix": "prettier --write .",
|
|
42
|
+
"lint-staged": "lint-staged"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@x-viewer/core": "workspace:^",
|
|
46
|
+
"@x-viewer/ui": "workspace:^",
|
|
47
|
+
"clipper-lib": "^6.4.2",
|
|
48
|
+
"dat.gui": "^0.7.7",
|
|
49
|
+
"mitt": "^3.0.0",
|
|
50
|
+
"pdfjs-dist": "3.8.162",
|
|
51
|
+
"screenfull": "^6.0.0",
|
|
52
|
+
"stats.js": "^0.17.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/dat.gui": "^0.7.6",
|
|
56
|
+
"@types/stats.js": "^0.17.3"
|
|
57
|
+
}
|
|
58
|
+
}
|