viral-viewer-2 5.3.0 → 5.3.2
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/dist/components/context-menu/viral-context-menu.js +1 -1
- package/dist/components/context-menu/viral-context-menu.js.map +1 -1
- package/dist/components/custom-objects/index.d.ts +2 -0
- package/dist/components/custom-objects/index.js +6 -0
- package/dist/components/custom-objects/index.js.map +1 -0
- package/dist/components/custom-objects/viral-instanced-mesh.d.ts +18 -0
- package/dist/components/custom-objects/viral-instanced-mesh.js +121 -0
- package/dist/components/custom-objects/viral-instanced-mesh.js.map +1 -0
- package/dist/components/loader/viral-revit.loader.js +3 -3
- package/dist/components/loader/viral-revit.loader.js.map +1 -1
- package/dist/components/material/viral-material-manager.js +3 -3
- package/dist/components/material/viral-material-manager.js.map +1 -1
- package/dist/components/post-processing/post-processing-renderer.d.ts +3 -0
- package/dist/components/post-processing/post-processing-renderer.js +7 -0
- package/dist/components/post-processing/post-processing-renderer.js.map +1 -1
- package/dist/components/scene/viral-scene.js +2 -2
- package/dist/components/scene/viral-scene.js.map +1 -1
- package/dist/components/spinner/viral-spinner.js +1 -1
- package/dist/components/spinner/viral-spinner.js.map +1 -1
- package/dist/components/tools/tools/viral-tool-measure.js +7 -7
- package/dist/components/tools/tools/viral-tool-measure.js.map +1 -1
- package/dist/components/tools/viral-tools.js +1 -2
- package/dist/components/tools/viral-tools.js.map +1 -1
- package/dist/components/visibility-manager/viral-visibility-manager.d.ts +5 -0
- package/dist/components/visibility-manager/viral-visibility-manager.js +10 -0
- package/dist/components/visibility-manager/viral-visibility-manager.js.map +1 -0
- package/dist/components/worker/viral-viewer-2.worker.js +2 -2
- package/dist/components/worker/viral-viewer-2.worker.js.map +1 -1
- package/dist/components/worker/viral-viewer-3.worker.js +2 -2
- package/dist/components/worker/viral-viewer-3.worker.js.map +1 -1
- package/dist/components/worker/viral-viewer-4.worker.js +17 -7
- package/dist/components/worker/viral-viewer-4.worker.js.map +1 -1
- package/dist/components/worker-script/load-model-worker-3.script.js +2 -0
- package/dist/components/worker-script/load-model-worker-3.script.js.map +1 -1
- package/dist/const/colors.d.ts +1 -0
- package/dist/const/colors.js +3 -2
- package/dist/const/colors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/html.d.ts +3 -1
- package/dist/utils/html.js +9 -7
- package/dist/utils/html.js.map +1 -1
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/log.d.ts +1 -0
- package/dist/utils/log.js +3 -0
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/threejs.d.ts +7 -5
- package/dist/utils/threejs.js +37 -36
- package/dist/utils/threejs.js.map +1 -1
- package/package.json +1 -1
package/dist/const/colors.d.ts
CHANGED
package/dist/const/colors.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DarkTheme = exports.LightTheme = void 0;
|
|
4
2
|
// export const Colors = {
|
|
5
3
|
// primary: '#56674d',
|
|
6
4
|
// primaryNormal: '#86957d',
|
|
@@ -8,6 +6,8 @@ exports.DarkTheme = exports.LightTheme = void 0;
|
|
|
8
6
|
// onHover: 'rgba(134,149,125,0.3)',
|
|
9
7
|
// lightNeutral:'#e2e6dc',
|
|
10
8
|
// }
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DarkTheme = exports.LightTheme = void 0;
|
|
11
11
|
const LightTheme1 = {
|
|
12
12
|
background: "#e2e6dc",
|
|
13
13
|
primary: "#2F4858",
|
|
@@ -25,6 +25,7 @@ const LightTheme2 = {
|
|
|
25
25
|
primary: "#17312c",
|
|
26
26
|
secondary: "#56b77e",
|
|
27
27
|
accent: "#f2735b",
|
|
28
|
+
accent2: "#D7EF41",
|
|
28
29
|
};
|
|
29
30
|
const DarkTheme2 = {
|
|
30
31
|
background: "#17312c",
|
package/dist/const/colors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/const/colors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/const/colors.ts"],"names":[],"mappings":";AAAA,0BAA0B;AAC1B,0BAA0B;AAC1B,gCAAgC;AAChC,+BAA+B;AAC/B,wCAAwC;AACxC,8BAA8B;AAC9B,IAAI;;;AAEJ,MAAM,WAAW,GAAG;IAClB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,SAAS,EAAE,IAAI;CACxB,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,SAAS;CAClB,CAAC;AAEF,MAAM,WAAW,GAAG;IAClB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,SAAS;CAClB,CAAC;AAEW,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,SAAS,GAAG,UAAU,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,6 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./types"), exports);
|
|
18
18
|
__exportStar(require("./viral-viewer-api"), exports);
|
|
19
|
-
__exportStar(require("./utils
|
|
20
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./utils"), exports);
|
|
20
|
+
__exportStar(require("./components/custom-objects"), exports);
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,qDAAmC;AACnC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,qDAAmC;AACnC,0CAAuB;AACvB,8DAA4C"}
|
package/dist/utils/html.d.ts
CHANGED
package/dist/utils/html.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
exports.HTMLUtil = void 0;
|
|
4
|
+
class HTMLUtil {
|
|
5
|
+
static createElementFromHTML(htmlString) {
|
|
6
|
+
const tempContainer = document.createElement("div");
|
|
7
|
+
tempContainer.innerHTML = htmlString.trim();
|
|
8
|
+
return tempContainer.firstChild;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.HTMLUtil = HTMLUtil;
|
|
10
12
|
//# sourceMappingURL=html.js.map
|
package/dist/utils/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/utils/html.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/utils/html.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAQ;IACZ,MAAM,CAAC,qBAAqB,CAAC,UAAkB;QACpD,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACpD,aAAa,CAAC,SAAS,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;QAC5C,OAAO,aAAa,CAAC,UAAyB,CAAC;IACjD,CAAC;CACF;AAND,4BAMC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.THREEUtil = exports.LogUtil = exports.HTMLUtil = void 0;
|
|
4
|
+
const html_1 = require("./html");
|
|
5
|
+
Object.defineProperty(exports, "HTMLUtil", { enumerable: true, get: function () { return html_1.HTMLUtil; } });
|
|
6
|
+
const log_1 = require("./log");
|
|
7
|
+
Object.defineProperty(exports, "LogUtil", { enumerable: true, get: function () { return log_1.LogUtil; } });
|
|
8
|
+
const threejs_1 = require("./threejs");
|
|
9
|
+
Object.defineProperty(exports, "THREEUtil", { enumerable: true, get: function () { return threejs_1.THREEUtil; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAIzB,yFAJA,eAAQ,OAIA;AAHjB,+BAAgC;AAGb,wFAHV,aAAO,OAGU;AAF1B,uCAAsC;AAEV,0FAFnB,mBAAS,OAEmB"}
|
package/dist/utils/log.d.ts
CHANGED
package/dist/utils/log.js
CHANGED
|
@@ -6,6 +6,9 @@ class LogUtil {
|
|
|
6
6
|
static information(content) {
|
|
7
7
|
console.log(`%c ${content}`, `color: ${colors_1.LightTheme.primary}; background: ${colors_1.LightTheme.background}; font-size: 16px;`);
|
|
8
8
|
}
|
|
9
|
+
static error(content) {
|
|
10
|
+
console.log(`%c ${content}`, `color: ${colors_1.LightTheme.accent}; background: ${colors_1.LightTheme.background}; font-size: 16px;`);
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
exports.LogUtil = LogUtil;
|
|
11
14
|
//# sourceMappingURL=log.js.map
|
package/dist/utils/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":";;;AAAA,4CAA6C;AAE7C,MAAa,OAAO;IACX,MAAM,CAAC,WAAW,CAAC,OAAe;QACvC,OAAO,CAAC,GAAG,CACT,MAAM,OAAO,EAAE,EACf,UAAU,mBAAU,CAAC,OAAO,iBAAiB,mBAAU,CAAC,UAAU,oBAAoB,CACvF,CAAC;IACJ,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":";;;AAAA,4CAA6C;AAE7C,MAAa,OAAO;IACX,MAAM,CAAC,WAAW,CAAC,OAAe;QACvC,OAAO,CAAC,GAAG,CACT,MAAM,OAAO,EAAE,EACf,UAAU,mBAAU,CAAC,OAAO,iBAAiB,mBAAU,CAAC,UAAU,oBAAoB,CACvF,CAAC;IACJ,CAAC;IACM,MAAM,CAAC,KAAK,CAAC,OAAe;QACjC,OAAO,CAAC,GAAG,CACT,MAAM,OAAO,EAAE,EACf,UAAU,mBAAU,CAAC,MAAM,iBAAiB,mBAAU,CAAC,UAAU,oBAAoB,CACtF,CAAC;IACJ,CAAC;CACF;AAbD,0BAaC"}
|
package/dist/utils/threejs.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Mesh, Vector3 } from "three";
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export declare class THREEUtil {
|
|
3
|
+
static middlePoint(point1: Vector3, point2: Vector3): Vector3;
|
|
4
|
+
static clearChildren(mesh: Mesh): void;
|
|
5
|
+
static hexToThreejsColor(hexColor: string): string;
|
|
6
|
+
static rgbToThreejsColor(r: number, g: number, b: number): string;
|
|
7
|
+
private static componentToHex;
|
|
8
|
+
}
|
package/dist/utils/threejs.js
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.THREEUtil = void 0;
|
|
4
4
|
const three_1 = require("three");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.middlePoint = middlePoint;
|
|
10
|
-
const clearChildren = (mesh) => {
|
|
11
|
-
while (mesh.children.length > 0) {
|
|
12
|
-
const child = mesh.children[0];
|
|
13
|
-
mesh.remove(child);
|
|
5
|
+
class THREEUtil {
|
|
6
|
+
static middlePoint(point1, point2) {
|
|
7
|
+
let middlePoint = new three_1.Vector3((point1.x + point2.x) / 2, (point1.y + point2.y) / 2, (point1.z + point2.z) / 2);
|
|
8
|
+
return middlePoint;
|
|
14
9
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// Parse the hexadecimal value to integers
|
|
21
|
-
const r = parseInt(hexColor.substring(0, 2), 16);
|
|
22
|
-
const g = parseInt(hexColor.substring(2, 4), 16);
|
|
23
|
-
const b = parseInt(hexColor.substring(4, 6), 16);
|
|
24
|
-
// Check if the hexadecimal value includes alpha component
|
|
25
|
-
if (hexColor.length === 8) {
|
|
26
|
-
const a = parseInt(hexColor.substring(6, 8), 16);
|
|
27
|
-
return `rgba(${r}, ${g}, ${b}, ${a / 255})`;
|
|
10
|
+
static clearChildren(mesh) {
|
|
11
|
+
while (mesh.children.length > 0) {
|
|
12
|
+
const child = mesh.children[0];
|
|
13
|
+
mesh.remove(child);
|
|
14
|
+
}
|
|
28
15
|
}
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
static hexToThreejsColor(hexColor) {
|
|
17
|
+
// Remove the "#" symbol if present
|
|
18
|
+
hexColor = hexColor.replace("#", "");
|
|
19
|
+
// Parse the hexadecimal value to integers
|
|
20
|
+
const r = parseInt(hexColor.substring(0, 2), 16);
|
|
21
|
+
const g = parseInt(hexColor.substring(2, 4), 16);
|
|
22
|
+
const b = parseInt(hexColor.substring(4, 6), 16);
|
|
23
|
+
// Check if the hexadecimal value includes alpha component
|
|
24
|
+
if (hexColor.length === 8) {
|
|
25
|
+
const a = parseInt(hexColor.substring(6, 8), 16);
|
|
26
|
+
return `rgba(${r}, ${g}, ${b}, ${a / 255})`;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return `rgb(${r}, ${g}, ${b})`;
|
|
30
|
+
}
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
32
|
+
static rgbToThreejsColor(r, g, b) {
|
|
33
|
+
return ("#" +
|
|
34
|
+
this.componentToHex(r) +
|
|
35
|
+
this.componentToHex(g) +
|
|
36
|
+
this.componentToHex(b));
|
|
37
|
+
}
|
|
38
|
+
static componentToHex(c) {
|
|
39
|
+
var hex = c.toString(16);
|
|
40
|
+
return hex.length == 1 ? "0" + hex : hex;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.THREEUtil = THREEUtil;
|
|
43
44
|
//# sourceMappingURL=threejs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threejs.js","sourceRoot":"","sources":["../../src/utils/threejs.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;
|
|
1
|
+
{"version":3,"file":"threejs.js","sourceRoot":"","sources":["../../src/utils/threejs.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC,MAAa,SAAS;IACb,MAAM,CAAC,WAAW,CAAC,MAAe,EAAE,MAAe;QACxD,IAAI,WAAW,GAAG,IAAI,eAAO,CAC3B,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EACzB,CAAC,MAAM,CAAC,CA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