@bimdata/viewer 1.10.3 → 2.0.0-alpha-zone-editor.1

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/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@bimdata/viewer",
3
- "version": "1.10.3",
3
+ "type": "module",
4
+ "version": "2.0.0-alpha-zone-editor.1",
4
5
  "description": "A customizable BIM viewer.",
5
6
  "keywords": [
6
7
  "bim",
@@ -19,11 +20,10 @@
19
20
  "last 2 chrome version",
20
21
  "last 2 firefox version"
21
22
  ],
22
- "main": "dist/bimdata-viewer.min.js",
23
+ "main": "dist/bimdata-viewer.esm.min.js",
23
24
  "module": "dist/bimdata-viewer.esm.min.js",
24
- "unpkg": "dist/bimdata-viewer.min.js",
25
25
  "scripts": {
26
- "build": "rollup -c --environment BUILD:production",
26
+ "build": "vite build && npm exec terser -- -c -m --module dist/bimdata-viewer.js > dist/bimdata-viewer.esm.min.js && rm dist/bimdata-viewer.js",
27
27
  "cy:run": "cypress run",
28
28
  "cy:open": "cypress open",
29
29
  "dev": "vite",
@@ -33,8 +33,8 @@
33
33
  "serve": "http-server -c-1 --silent",
34
34
  "test": "npm run test:unit & npm run build & npm run test:e2e",
35
35
  "test:unit": "jest",
36
- "test:e2e": "start-server-and-test 'npm run serve -- -p 8080' 8080 cy:run",
37
- "test:e2e-dev": "start-server-and-test 'npm run serve -- -p 8080' 8080 cy:open",
36
+ "test:e2e": "start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:run",
37
+ "test:e2e-dev": "start-server-and-test 'npm run serve -- -p 8080' http://localhost:8080 cy:open",
38
38
  "version": "echo $npm_package_version",
39
39
  "ts": "tsc"
40
40
  },
@@ -48,64 +48,61 @@
48
48
  "index.d.ts"
49
49
  ],
50
50
  "devDependencies": {
51
- "@babel/preset-env": "^7.18.6",
52
- "@bimdata/2d-engine": "2.3.0",
53
- "@bimdata/areas": "0.5.1",
51
+ "@babel/preset-env": "^7.21.5",
52
+ "@bimdata/2d-engine": "2.4.0",
53
+ "@bimdata/areas-next": "0.1.13",
54
54
  "@bimdata/bcf-components": "4.1.1",
55
- "@bimdata/building-maker": "1.5.2",
56
- "@bimdata/color-picker": "0.0.3",
57
- "@bimdata/design-system": "2.0.0-rc.16",
55
+ "@bimdata/building-maker": "3.0.0",
56
+ "@bimdata/components": "1.0.6",
57
+ "@bimdata/design-system": "2.0.0-rc.29",
58
58
  "@bimdata/typescript-fetch-api-client": "9.8.0",
59
- "@rollup/plugin-alias": "3.1.9",
60
- "@rollup/plugin-babel": "^5.3.1",
61
- "@rollup/plugin-commonjs": "^21.1.0",
62
- "@rollup/plugin-image": "^2.1.1",
63
- "@rollup/plugin-json": "^4.1.0",
64
- "@rollup/plugin-node-resolve": "^13.3.0",
65
- "@rollup/plugin-replace": "^3.1.0",
66
- "@semantic-release/changelog": "^6.0.1",
59
+ "@rollup/plugin-alias": "5.0.0",
60
+ "@rollup/plugin-babel": "^6.0.3",
61
+ "@rollup/plugin-commonjs": "^25.0.0",
62
+ "@rollup/plugin-image": "^3.0.2",
63
+ "@semantic-release/changelog": "^6.0.3",
67
64
  "@semantic-release/commit-analyzer": "^9.0.2",
68
65
  "@semantic-release/git": "^10.0.1",
69
- "@semantic-release/github": "^8.0.4",
70
- "@semantic-release/npm": "^8.0.3",
71
- "@semantic-release/release-notes-generator": "^10.0.3",
72
- "@vue/test-utils": "1.3.0",
73
- "@xeokit/xeokit-sdk": "git+https://git@github.com/Amoki/xeokit-sdk.git#b9b7d4c485e430302cb71d2095cc7daa4b23234a",
66
+ "@semantic-release/github": "^8.0.7",
67
+ "@semantic-release/npm": "^10.0.3",
68
+ "@semantic-release/release-notes-generator": "^11.0.1",
69
+ "@vitejs/plugin-vue": "4.2.3",
70
+ "@vue/vue3-jest": "29.2.4",
71
+ "@xeokit/xeokit-sdk": "git+https://git@github.com/Amoki/xeokit-sdk.git#5b4200d43f0b9380ae2428f0ac6600ef114b8de0",
74
72
  "async": "^3.2.4",
75
- "autoprefixer": "^10.4.7",
73
+ "autoprefixer": "^10.4.14",
76
74
  "babel-core": "^7.0.0-bridge.0",
77
- "babel-jest": "^27.5.1",
75
+ "babel-jest": "^29.5.0",
78
76
  "conventional-changelog-eslint": "^3.0.9",
79
- "cypress": "10.4.0",
80
- "eslint": "^7.32.0",
81
- "eslint-config-prettier": "^8.5.0",
82
- "eslint-plugin-jest": "^24.7.0",
77
+ "cypress": "12.12.0",
78
+ "eslint": "^8.41.0",
79
+ "eslint-config-prettier": "^8.8.0",
80
+ "eslint-plugin-cypress": "^2.13.3",
81
+ "eslint-plugin-jest": "^27.2.1",
83
82
  "eslint-plugin-prettier": "^4.2.1",
84
- "eslint-plugin-vue": "^7.20.0",
83
+ "eslint-plugin-vue": "^9.14.0",
85
84
  "form-data": "^4.0.0",
86
85
  "html2canvas": "1.4.1",
87
86
  "http-server": "^14.1.1",
88
- "jest": "^27.5.1",
89
- "jest-extended": "^0.11.5",
87
+ "jest": "^29.5.0",
88
+ "jest-environment-jsdom": "^29.5.0",
89
+ "jest-extended": "^3.2.4",
90
90
  "jspdf": "^2.5.1",
91
91
  "lodash": "^4.17.21",
92
- "node-fetch": "^2.6.7",
93
- "postcss": "^8.4.14",
94
- "prettier": "^2.7.1",
92
+ "node-fetch": "^3.3.1",
93
+ "postcss": "^8.4.23",
94
+ "prettier": "^2.8.8",
95
95
  "querystring": "^0.2.0",
96
- "rollup": "2.75.7",
97
- "rollup-plugin-postcss": "^4.0.2",
98
96
  "rollup-plugin-replace": "^2.2.0",
99
- "rollup-plugin-terser": "7.0.2",
100
- "rollup-plugin-vue": "^5.1.9",
101
- "rollup-plugin-web-worker-loader": "^1.6.1",
102
- "semantic-release": "^18.0.1",
103
- "sinon": "^11.1.2",
104
- "start-server-and-test": "^1.14.0",
105
- "vite": "^2.9.13",
106
- "vue": "^2.7.7",
107
- "vue-i18n": "^8.27.2",
108
- "vue-jest": "^3.0.7",
109
- "vue-template-compiler": "^2.7.7"
97
+ "sass": "^1.62.1",
98
+ "semantic-release": "^21.0.2",
99
+ "sinon": "^15.1.0",
100
+ "start-server-and-test": "2.0.0",
101
+ "terser": "^5.17.5",
102
+ "vite": "4.3.8",
103
+ "vite-plugin-css-injected-by-js": "3.1.1",
104
+ "vue": "3.3.4",
105
+ "vue-eslint-parser": "^9.3.0",
106
+ "vue-i18n": "^9.2.2"
110
107
  }
111
108
  }
package/types/api.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  declare namespace BDV {
2
2
  interface Api {
3
+ readonly permissions: Permissions;
3
4
  readonly apiClient: any;
4
5
  readonly apiUrl: string;
5
6
  readonly archiveUrl: string;
@@ -56,7 +57,7 @@ declare namespace BDV {
56
57
  model: StateModel;
57
58
  parent: StateObject;
58
59
  children: ApiObject[];
59
-
60
+
60
61
  /** @deprecated use `model` instead */
61
62
  ifc: StateModel;
62
63
  }
@@ -74,4 +75,27 @@ declare namespace BDV {
74
75
  scale: number;
75
76
  opacity: number;
76
77
  }
78
+
79
+ interface Permissions {
80
+ hasAdminPermission: boolean;
81
+ hasBcfReadPermission: boolean;
82
+ hasBcfWritePermission: boolean;
83
+ hasDocReadPermission: boolean;
84
+ hasDocWritePermission: boolean;
85
+ hasModelReadPermission: boolean;
86
+ hasModelWritePermission: boolean;
87
+ hasReadPermission: boolean;
88
+ hasWritePermission: boolean;
89
+ userRole: string;
90
+ tokenScopes: {
91
+ bcf?: string[];
92
+ model?: string[];
93
+ document?: string[];
94
+ };
95
+ usableScopes: {
96
+ bcf?: string[];
97
+ model?: string[];
98
+ document?: string[];
99
+ };
100
+ }
77
101
  }
@@ -9,13 +9,15 @@ declare namespace BDV {
9
9
  bcfManagerDisplayed: boolean;
10
10
  mouseover: boolean;
11
11
 
12
+ /** @deprecated */
12
13
  getPlugins(name: string): Plugin[];
14
+ plugins: Map<string, Plugin>;
13
15
 
14
16
  // ---
15
17
 
16
18
  loading: boolean;
17
- incrementSpinnerProcesses(): void;
18
- decrementSpinnerProcesses(): void;
19
+ loadingProcessStart(): void;
20
+ loadingProcessEnd(): void;
19
21
 
20
22
  registerShortcut(shortcut: Shortcut, context: GlobalContext): boolean;
21
23
  unregisterShortcut(name: string, context: GlobalContext): boolean;
@@ -2,24 +2,34 @@ declare namespace BDV {
2
2
  interface LocalContext {
3
3
  hub: EventHandler<LocalContextEvents>;
4
4
 
5
- area: any;
5
+ id: number;
6
6
  el: Element;
7
7
  width: number;
8
8
  height: number;
9
- plugins: Map<string, any>;
10
- pluginsUnit: PluginsUnit;
9
+ resolution: number;
11
10
 
12
- getPlugin(name: string): Plugin;
13
- addPlugin(name: string): void;
14
- removePlugin(name: string): boolean;
15
- pluginActivated(name: string, instance: any): void;
16
- pluginDeactivated(name: string): void;
11
+ // Local state
12
+ loadedModels: StateModel[];
13
+ loadedModelIds: number[];
14
+ loadingModelIds: number[];
15
+ modelTypes: string[];
16
+ multiModel: boolean;
17
+ loadModels(ids: number[]): Promise<boolean>;
18
+ unloadModels(ids: number[]): boolean;
19
+ toggleModel(id: number): Promise<boolean>;
20
+
21
+ // Window
22
+ loadWindow(windowName: string): void;
23
+ window: Window;
17
24
 
18
- // ---
25
+ // Plugin
26
+ /** @deprecated */
27
+ getPlugin(name: string): Plugin;
28
+ plugins: Map<string, Plugin>;
19
29
 
20
30
  loading: boolean;
21
- incrementSpinnerProcesses(): void;
22
- decrementSpinnerProcesses(): void;
31
+ loadingProcessStart(): void;
32
+ loadingProcessEnd(): void;
23
33
 
24
34
  registerShortcut(shortcut: Shortcut, context: LocalContext): boolean;
25
35
  unregisterShortcut(name: string, context: LocalContext): boolean;
@@ -31,6 +41,9 @@ declare namespace BDV {
31
41
  }
32
42
 
33
43
  type LocalContextEvents = {
44
+ "models-loaded": { models: StateModel[] };
45
+ "models-unloaded": { models: StateModel[] };
46
+ "models-loading": { ids: number[] };
34
47
  "3d-model-loaded": {
35
48
  model: StateModel;
36
49
  plugin: ViewerIfc3D.Plugin;
@@ -89,7 +102,7 @@ declare namespace BDV {
89
102
  };
90
103
  "plugin-menu-open": Plugin;
91
104
  "plugin-menu-close": Plugin;
92
- "context-resize": { width: number; height: number; };
93
- "alert": { type: string; message: string; }
105
+ "context-resize": { width: number; height: number };
106
+ alert: { type: string; message: string };
94
107
  };
95
108
  }
@@ -1,23 +1,5 @@
1
1
  declare namespace BDV {
2
2
  interface PluginsUnit {
3
- $area: any;
4
- $el: Element;
5
- width: number;
6
- height: number;
7
- window: Window;
8
- plugins: Plugin[];
9
3
  localContext: LocalContext;
10
-
11
- setWindow(window: Window): void;
12
- setPlugins(plugins: string[]): void;
13
- getPlugin(name: string): Plugin;
14
- addPlugin(name: string): void;
15
- removePlugin(name: string): boolean;
16
-
17
- // ---
18
-
19
- loading: boolean;
20
- incrementSpinnerProcesses(): void;
21
- decrementSpinnerProcesses(): void;
22
4
  }
23
5
  }