@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.
@@ -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 dxf file.
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: click event
6
- * 2:show popup
7
- * 3:show submenu
8
- * 4:turn on/off
5
+ * 1: button
6
+ * 2: dropdown menu
7
+ * 3: toggle button
9
8
  */
10
- export declare enum MenuTypeEnums {
11
- ClickEvent = 1,
12
- Popup = 2,
13
- SubMenu = 3,
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?: MenuTypeEnums;
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
- "name": "@x-viewer/plugins",
3
- "version": "0.9.0",
4
- "description": "The first typescript example for the Monorepo example",
5
- "author": "x-viewer",
6
- "license": "MIT",
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
- "dependencies": {
34
- "clipper-lib": "^6.4.2",
35
- "dat.gui": "^0.7.7",
36
- "mitt": "^3.0.0",
37
- "pdfjs-dist": "3.8.162",
38
- "screenfull": "^6.0.0",
39
- "stats.js": "^0.17.0",
40
- "@x-viewer/core": "^0.9.0",
41
- "@x-viewer/ui": "^0.9.0"
42
- },
43
- "devDependencies": {
44
- "@types/dat.gui": "^0.7.6",
45
- "@types/stats.js": "^0.17.3"
46
- },
47
- "scripts": {
48
- "build": "pnpm run clean:build && pnpm run data-type && rollup -c --environment BUILD:production",
49
- "clean:build": "rimraf ./dist",
50
- "data-type": "tsc --project tsconfig.bundle.json && tsc-alias -p tsconfig.bundle.json",
51
- "dev": "pnpm run data-type && rollup -c -w",
52
- "lint": "eslint . --ext .js,.ts",
53
- "lint:fix": "pnpm lint --fix",
54
- "format": "prettier --check .",
55
- "format:fix": "prettier --write .",
56
- "lint-staged": "lint-staged"
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
+ }