@bimdata/viewer 1.8.2 → 1.9.0-alpha.buildingmaker

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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable*/
1
2
  declare module "@bimdata/viewer" {
2
3
  export default function makeBIMDataViewer(cfg: BDV.ViewerCfg): BDV.Viewer;
3
4
  }
@@ -9,7 +10,7 @@ declare namespace BDV {
9
10
  layout: Object
10
11
  ): Object;
11
12
  setLocale(lang: AvailableLangs): void;
12
- registerPlugin(plugin: Plugin, cfg: Object): void;
13
+ registerPlugin(plugin: PluginCfg, cfg?: Object): void;
13
14
  registerWindow(window: Object): void;
14
15
  unregisterWindow(windowName: string): void;
15
16
  setAccessToken(accessToken: string): void;
@@ -25,10 +26,10 @@ declare namespace BDV {
25
26
  interface ViewerCfg {
26
27
  plugins: PluginsConfig;
27
28
  api: APIConfig;
28
- offlineOptions: OfflineData;
29
+ offlineOptions?: OfflineData;
29
30
  ui: UIConfig;
30
- logger: { level: LogLevel };
31
- locale: string;
31
+ logger?: { level: LogLevel };
32
+ locale?: string;
32
33
  }
33
34
 
34
35
  interface PluginsConfig {
@@ -99,7 +100,7 @@ declare namespace BDV {
99
100
  cloudId: number;
100
101
  projectId: number;
101
102
  accessToken: string;
102
- apiUrl: string;
103
+ apiUrl?: string;
103
104
  }
104
105
 
105
106
  interface UIConfig {
@@ -192,6 +193,10 @@ declare namespace BDV {
192
193
  }
193
194
 
194
195
  type ContextEvents = {
196
+ "3d-model-loaded": { ifc: StateIfc; model: Object; plugin: Object };
197
+ "3d-model-unloaded": { ifc: StateIfc; plugin: Object };
198
+ "2d-model-loaded": { ifc: StateIfc; plugin: Object };
199
+ "2d-model-unloaded": { ifc: StateIfc; plugin: Object };
195
200
  "plugin-created": { pluginName: string; plugin: Plugin };
196
201
  "plugin-destroyed": { pluginName: string; plugin: Plugin };
197
202
  "plugin-menu-open": Plugin;
@@ -203,7 +208,7 @@ declare namespace BDV {
203
208
  "window-close": Window;
204
209
  };
205
210
 
206
- interface Context<T> {
211
+ interface Context<T extends Events> {
207
212
  loading: boolean;
208
213
  incrementSpinnerProcesses: Function;
209
214
  decrementSpinnerProcesses: Function;
@@ -262,6 +267,7 @@ declare namespace BDV {
262
267
  getObject(id: string): StateObject;
263
268
  getIfc(id): StateIfc;
264
269
  selectedObjects: StateObject[];
270
+ colorizedObjects: StateObject[];
265
271
  deselectedObjects: StateObject[];
266
272
  highlightedObjects: StateObject[];
267
273
  unhighlightedObjects: StateObject[];
@@ -280,6 +286,7 @@ declare namespace BDV {
280
286
  objects: StateObject[];
281
287
  objectsMap: Map<number, StateObject>;
282
288
  selectObjects(ids: number[]): void;
289
+ colorizeObjects(ids: number[], color?: string): void;
283
290
  deselectObjects(ids: number[]): void;
284
291
  highlightObjects(ids: number[]): void;
285
292
  unhighlightObjects(ids: number[]): void;
@@ -287,6 +294,8 @@ declare namespace BDV {
287
294
  hideObjects(ids: number[]): void;
288
295
  xrayObjects(ids: number[]): void;
289
296
  unxrayObjects(ids: number[]): void;
297
+ isolateObjects(ids: number[]): void;
298
+ reintegrateObjects(): void;
290
299
  }
291
300
 
292
301
  interface APIObject {
@@ -312,6 +321,7 @@ declare namespace BDV {
312
321
  selected: boolean;
313
322
  highlighted: boolean;
314
323
  xrayed: boolean;
324
+ color: string;
315
325
  // advanced getters
316
326
  descendants;
317
327
  ancestors: StateObject[];
@@ -326,6 +336,17 @@ declare namespace BDV {
326
336
  uuids: Map<string, StateObject>;
327
337
  }
328
338
 
339
+ interface ProjectModel {
340
+ id: number;
341
+ name: string;
342
+ status: ProjectModelStatus;
343
+ preview: string;
344
+ loading: boolean;
345
+ loaded: boolean;
346
+ }
347
+
348
+ type ProjectModelStatus = "C" | "E" | "P" | "I";
349
+
329
350
  interface VueInstance {
330
351
  $t(message: string): string;
331
352
  }
@@ -352,13 +373,29 @@ declare namespace BDV {
352
373
  plugins: string[];
353
374
  }
354
375
 
376
+ interface PluginCfg {
377
+ name: string;
378
+ component?: Object;
379
+ button?: Object;
380
+ addToWindows?: string[];
381
+ startupScript?: ($viewer: $viewer) => void;
382
+ }
383
+
355
384
  interface Plugin {
356
- $viewer: $viewer;
357
- methods: {
385
+ $viewer?: $viewer;
386
+ methods?: {
358
387
  $viewer: $viewer;
359
388
  };
360
- computed: {
389
+ computed?: {
361
390
  $viewer: $viewer;
362
391
  };
363
392
  }
393
+
394
+ interface Viewer3dPlugin extends Plugin {
395
+ fitViewObjects(uuids: string[]): void;
396
+ getCameraPosition(): Object;
397
+ getProjection(): string;
398
+ getViewpoint(snapshot?: boolean): Object;
399
+ setCameraPosition(cameraPosition?: Object): void;
400
+ }
364
401
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bimdata/viewer",
3
- "version": "1.8.2",
3
+ "version": "1.9.0-alpha.buildingmaker",
4
4
  "description": "A customizable BIM viewer.",
5
5
  "keywords": [
6
6
  "bim",
@@ -24,11 +24,9 @@
24
24
  "unpkg": "dist/bimdata-viewer.min.js",
25
25
  "scripts": {
26
26
  "test": "jest",
27
- "build": "rollup -c --environment BUILD:production",
28
- "build:dev": "rollup -c --environment BUILD:development",
27
+ "build": "rollup -c",
29
28
  "prebuild": "rm -rf dist",
30
- "prebuild:dev": "rm -rf dist",
31
- "dev": "npm run build:dev -- --watch",
29
+ "dev": "vite",
32
30
  "prepublishOnly": "npm run build",
33
31
  "semantic-release": "semantic-release",
34
32
  "version": "echo $npm_package_version"
@@ -43,15 +41,19 @@
43
41
  ],
44
42
  "devDependencies": {
45
43
  "@babel/preset-env": "^7.15.6",
46
- "@bimdata/2d-engine": "1.6.0-beta.1",
47
- "@bimdata/areas": "0.4.11",
48
- "@bimdata/bimdata-api-client": "^6.17.1",
44
+ "@bimdata/2d-engine": "1.7.0",
45
+ "@bimdata/areas": "0.5.0",
46
+ "@bimdata/bimdata-api-client": "7.0.0",
49
47
  "@bimdata/color-picker": "0.0.3",
50
- "@bimdata/design-system": "0.3.18",
48
+ "@bimdata/design-system": "1.2.0-rc.22",
51
49
  "@johmun/vue-tags-input": "^2.1.0",
52
50
  "@rollup/plugin-alias": "3.1.5",
53
51
  "@rollup/plugin-babel": "^5.3.0",
52
+ "@rollup/plugin-commonjs": "^21.0.1",
54
53
  "@rollup/plugin-image": "^2.1.1",
54
+ "@rollup/plugin-json": "^4.1.0",
55
+ "@rollup/plugin-node-resolve": "^13.1.3",
56
+ "@rollup/plugin-replace": "^3.0.1",
55
57
  "@semantic-release/changelog": "^6.0.0",
56
58
  "@semantic-release/commit-analyzer": "^9.0.1",
57
59
  "@semantic-release/git": "^10.0.0",
@@ -59,7 +61,8 @@
59
61
  "@semantic-release/npm": "^8.0.0",
60
62
  "@semantic-release/release-notes-generator": "^10.0.2",
61
63
  "@vue/test-utils": "1.2.2",
62
- "@xeokit/xeokit-sdk": "git+https://git@github.com/Amoki/xeokit-sdk.git#9a012280f6253a2a719f93dba6f90de53fee8413",
64
+ "@xeokit/xeokit-sdk": "git+https://git@github.com/Amoki/xeokit-sdk.git#b0e7759c68625da822ff81d8ca859f17998071b4",
65
+ "autoprefixer": "^10.4.2",
63
66
  "babel-core": "^7.0.0-bridge.0",
64
67
  "babel-jest": "^27.2.4",
65
68
  "conventional-changelog-eslint": "^3.0.9",
@@ -68,25 +71,24 @@
68
71
  "eslint-plugin-jest": "^24.5.0",
69
72
  "eslint-plugin-prettier": "^4.0.0",
70
73
  "eslint-plugin-vue": "^7.18.0",
74
+ "form-data": "^4.0.0",
71
75
  "html2canvas": "1.3.2",
72
76
  "jest": "^27.2.4",
73
77
  "jest-extended": "^0.11.5",
78
+ "node-fetch": "^2.6.6",
74
79
  "pdfjs-dist": "^2.9.359",
80
+ "postcss": "^8.4.5",
75
81
  "prettier": "^2.4.1",
76
82
  "querystring": "^0.2.0",
77
83
  "rollup": "2.57.0",
78
- "rollup-plugin-commonjs": "^10.0.1",
79
- "rollup-plugin-json": "^4.0.0",
80
- "rollup-plugin-livereload": "^2.0.5",
81
- "rollup-plugin-node-resolve": "^5.2.0",
84
+ "rollup-plugin-postcss": "^4.0.2",
82
85
  "rollup-plugin-replace": "^2.2.0",
83
- "rollup-plugin-serve": "^1.1.0",
84
- "rollup-plugin-svg": "^2.0.0",
85
86
  "rollup-plugin-terser": "7.0.2",
86
87
  "rollup-plugin-vue": "^5.0.1",
87
88
  "rollup-plugin-web-worker-loader": "^1.6.1",
88
89
  "semantic-release": "^18.0.0",
89
90
  "sinon": "^11.1.2",
91
+ "vite": "2.7.13",
90
92
  "vue": "^2.6.14",
91
93
  "vue-i18n": "^8.26.2",
92
94
  "vue-jest": "^3.0.7",