@shapediver/viewer.data-engine.html-element-anchor-engine 2.7.10 → 2.8.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.
|
@@ -4,6 +4,8 @@ export declare class HTMLElementAnchorEngine {
|
|
|
4
4
|
private readonly _converter;
|
|
5
5
|
private readonly _inputValidator;
|
|
6
6
|
private readonly _logger;
|
|
7
|
+
private static _instance;
|
|
8
|
+
static get instance(): HTMLElementAnchorEngine;
|
|
7
9
|
/**
|
|
8
10
|
* Load the material content into a scene graph node.
|
|
9
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTMLElementAnchorEngine.d.ts","sourceRoot":"","sources":["../src/HTMLElementAnchorEngine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HTMLElementAnchorEngine.d.ts","sourceRoot":"","sources":["../src/HTMLElementAnchorEngine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAY,MAAM,qCAAqC,CAAA;AAIzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAA;AAGrF,qBAAa,uBAAuB;IAGhC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiC;IAC5D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA2C;IAC3E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IAEnD,OAAO,CAAC,MAAM,CAAC,SAAS,CAA0B;IAMlD,WAAkB,QAAQ,4BAEzB;IAMD;;;;;OAKG;IACU,WAAW,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,SAAS,CAAC;CA8FzF"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -16,20 +10,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
16
10
|
};
|
|
17
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
12
|
exports.HTMLElementAnchorEngine = void 0;
|
|
19
|
-
const tsyringe_1 = require("tsyringe");
|
|
20
13
|
const viewer_shared_types_1 = require("@shapediver/viewer.shared.types");
|
|
21
14
|
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
22
15
|
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
|
|
23
16
|
const viewer_shared_math_1 = require("@shapediver/viewer.shared.math");
|
|
24
|
-
|
|
17
|
+
class HTMLElementAnchorEngine {
|
|
25
18
|
constructor() {
|
|
26
|
-
// #region Properties (
|
|
27
|
-
this._converter =
|
|
28
|
-
this._inputValidator =
|
|
29
|
-
this._logger =
|
|
19
|
+
// #region Properties (4)
|
|
20
|
+
this._converter = viewer_shared_services_1.Converter.instance;
|
|
21
|
+
this._inputValidator = viewer_shared_services_1.InputValidator.instance;
|
|
22
|
+
this._logger = viewer_shared_services_1.Logger.instance;
|
|
30
23
|
// #endregion Public Methods (1)
|
|
31
24
|
}
|
|
32
|
-
// #endregion Properties (
|
|
25
|
+
// #endregion Properties (4)
|
|
26
|
+
// #region Public Static Accessors (1)
|
|
27
|
+
static get instance() {
|
|
28
|
+
return this._instance || (this._instance = new this());
|
|
29
|
+
}
|
|
30
|
+
// #endregion Public Static Accessors (1)
|
|
33
31
|
// #region Public Methods (1)
|
|
34
32
|
/**
|
|
35
33
|
* Load the material content into a scene graph node.
|
|
@@ -46,7 +44,7 @@ let HTMLElementAnchorEngine = class HTMLElementAnchorEngine {
|
|
|
46
44
|
data.forEach((element) => {
|
|
47
45
|
// we need a location and a text, otherwise this doesn't make sense
|
|
48
46
|
if (!element.location || !element.text) {
|
|
49
|
-
this._logger.warn(
|
|
47
|
+
this._logger.warn('HTMLElementAnchorEngine.load: One of the specified Tag2D elements did not have all necessary properties.');
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
52
50
|
const cleanedText = this._inputValidator.sanitize(element.text);
|
|
@@ -60,7 +58,7 @@ let HTMLElementAnchorEngine = class HTMLElementAnchorEngine {
|
|
|
60
58
|
const data = content.data;
|
|
61
59
|
data.forEach((element) => {
|
|
62
60
|
if (!element.location || !element.data) {
|
|
63
|
-
this._logger.warn(
|
|
61
|
+
this._logger.warn('HTMLElementAnchorEngine.load: One of the specified Anchor elements did not have all necessary properties.');
|
|
64
62
|
return;
|
|
65
63
|
}
|
|
66
64
|
let position;
|
|
@@ -80,7 +78,7 @@ let HTMLElementAnchorEngine = class HTMLElementAnchorEngine {
|
|
|
80
78
|
}
|
|
81
79
|
if (!element.format || (element.format === 'text')) {
|
|
82
80
|
if (!element.data.text) {
|
|
83
|
-
this._logger.warn(
|
|
81
|
+
this._logger.warn('HTMLElementAnchorEngine.load: The text property for an Anchor element is missing.');
|
|
84
82
|
return;
|
|
85
83
|
}
|
|
86
84
|
const textData = element.data;
|
|
@@ -101,7 +99,7 @@ let HTMLElementAnchorEngine = class HTMLElementAnchorEngine {
|
|
|
101
99
|
}
|
|
102
100
|
else if (element.format === 'image') {
|
|
103
101
|
if (!element.data.src || !element.data.width || !element.data.height || !element.data.alt) {
|
|
104
|
-
this._logger.warn(
|
|
102
|
+
this._logger.warn('HTMLElementAnchorEngine.load: One of the specified Anchor elements did not have all necessary properties.');
|
|
105
103
|
return;
|
|
106
104
|
}
|
|
107
105
|
const imageData = element.data;
|
|
@@ -120,20 +118,16 @@ let HTMLElementAnchorEngine = class HTMLElementAnchorEngine {
|
|
|
120
118
|
intersectionTarget
|
|
121
119
|
}));
|
|
122
120
|
}
|
|
123
|
-
this._logger.warn(
|
|
121
|
+
this._logger.warn(`HTMLElementAnchorEngine.load: The Anchor does not have a recognized format: ${element.format}`);
|
|
124
122
|
});
|
|
125
123
|
}
|
|
126
124
|
return node;
|
|
127
125
|
}
|
|
128
126
|
catch (e) {
|
|
129
|
-
|
|
130
|
-
throw this._logger.handleError(viewer_shared_services_1.LOGGING_TOPIC.DATA_PROCESSING, `HTMLElementAnchorEngine.load`, error);
|
|
127
|
+
throw new viewer_shared_services_1.ShapeDiverViewerDataProcessingError('HTMLElementAnchorEngine.load: Loading of anchors failed.');
|
|
131
128
|
}
|
|
132
129
|
});
|
|
133
130
|
}
|
|
134
|
-
}
|
|
135
|
-
HTMLElementAnchorEngine = __decorate([
|
|
136
|
-
(0, tsyringe_1.singleton)()
|
|
137
|
-
], HTMLElementAnchorEngine);
|
|
131
|
+
}
|
|
138
132
|
exports.HTMLElementAnchorEngine = HTMLElementAnchorEngine;
|
|
139
133
|
//# sourceMappingURL=HTMLElementAnchorEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTMLElementAnchorEngine.js","sourceRoot":"","sources":["../src/HTMLElementAnchorEngine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HTMLElementAnchorEngine.js","sourceRoot":"","sources":["../src/HTMLElementAnchorEngine.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yEAAiK;AACjK,iFAAyE;AACzE,+EAA2H;AAE3H,uEAAoD;AAIpD,MAAa,uBAAuB;IAApC;QACI,yBAAyB;QAER,eAAU,GAAc,kCAAS,CAAC,QAAQ,CAAC;QAC3C,oBAAe,GAAmB,uCAAc,CAAC,Q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CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM;oCACnF,KAAK,EAAE,OAAO,SAAS,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK;oCAC/E,GAAG,EAAE,SAAS,CAAC,GAAG;oCAClB,MAAM,EAAE,SAAS,CAAC,MAAM;oCACxB,QAAQ;iCACX;gCACD,QAAQ,EAAE,OAAO,CAAC,QAAQ;gCAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;gCAC5B,kBAAkB;6BACrB,CAAC,CAAC,CAAC;yBACP;wBACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+EAA+E,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;oBACvH,CAAC,CAAC,CAAC;iBACN;gBACD,OAAO,IAAI,CAAC;aACf;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,4DAAmC,CAAC,0DAA0D,CAAC,CAAC;aAC7G;QACL,CAAC;KAAA;CAGJ;AAzHD,0DAyHC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.data-engine.html-element-anchor-engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Michael Oppitz <michael@shapediver.com>",
|
|
@@ -40,14 +40,13 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@shapediver/sdk.geometry-api-sdk-v2": "1.3.0",
|
|
43
|
-
"@shapediver/viewer.data-engine.shared-types": "2.
|
|
44
|
-
"@shapediver/viewer.shared.math": "2.
|
|
45
|
-
"@shapediver/viewer.shared.node-tree": "2.
|
|
46
|
-
"@shapediver/viewer.shared.services": "2.
|
|
47
|
-
"@shapediver/viewer.shared.types": "2.
|
|
43
|
+
"@shapediver/viewer.data-engine.shared-types": "2.8.1",
|
|
44
|
+
"@shapediver/viewer.shared.math": "2.8.1",
|
|
45
|
+
"@shapediver/viewer.shared.node-tree": "2.8.1",
|
|
46
|
+
"@shapediver/viewer.shared.services": "2.8.1",
|
|
47
|
+
"@shapediver/viewer.shared.types": "2.8.1",
|
|
48
48
|
"axios": "^1.2.6",
|
|
49
|
-
"gl-matrix": "3.3.0"
|
|
50
|
-
"tsyringe": "^4.5.0"
|
|
49
|
+
"gl-matrix": "3.3.0"
|
|
51
50
|
},
|
|
52
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "0ec5dfbaed9b9fd24067bf1d64f1a8a925473034"
|
|
53
52
|
}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { container, singleton } from 'tsyringe'
|
|
2
1
|
import { HTMLElementAnchorData, HTMLElementAnchorTextData, HTMLElementAnchorImageData, IAnchorDataText, IAnchorDataImage } from '@shapediver/viewer.shared.types'
|
|
3
2
|
import { ITreeNode, TreeNode } from '@shapediver/viewer.shared.node-tree'
|
|
4
|
-
import { Logger,
|
|
3
|
+
import { Logger, Converter, ShapeDiverViewerDataProcessingError, InputValidator } from '@shapediver/viewer.shared.services'
|
|
5
4
|
import { vec3, vec4 } from 'gl-matrix'
|
|
6
5
|
import { Box } from '@shapediver/viewer.shared.math'
|
|
7
6
|
import { ShapeDiverResponseOutputContent } from '@shapediver/sdk.geometry-api-sdk-v2'
|
|
8
7
|
import { IAnchor, ITag2D } from '@shapediver/viewer.data-engine.shared-types'
|
|
9
8
|
|
|
10
|
-
@singleton()
|
|
11
9
|
export class HTMLElementAnchorEngine {
|
|
12
|
-
// #region Properties (
|
|
10
|
+
// #region Properties (4)
|
|
13
11
|
|
|
14
|
-
private readonly _converter: Converter =
|
|
15
|
-
private readonly _inputValidator: InputValidator =
|
|
16
|
-
private readonly _logger: Logger =
|
|
12
|
+
private readonly _converter: Converter = Converter.instance;
|
|
13
|
+
private readonly _inputValidator: InputValidator = InputValidator.instance;
|
|
14
|
+
private readonly _logger: Logger = Logger.instance;
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
private static _instance: HTMLElementAnchorEngine;
|
|
17
|
+
|
|
18
|
+
// #endregion Properties (4)
|
|
19
|
+
|
|
20
|
+
// #region Public Static Accessors (1)
|
|
21
|
+
|
|
22
|
+
public static get instance() {
|
|
23
|
+
return this._instance || (this._instance = new this());
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// #endregion Public Static Accessors (1)
|
|
19
27
|
|
|
20
28
|
// #region Public Methods (1)
|
|
21
29
|
|
|
@@ -33,7 +41,7 @@ export class HTMLElementAnchorEngine {
|
|
|
33
41
|
data.forEach((element: ITag2D) => {
|
|
34
42
|
// we need a location and a text, otherwise this doesn't make sense
|
|
35
43
|
if (!element.location || !element.text) {
|
|
36
|
-
this._logger.warn(
|
|
44
|
+
this._logger.warn('HTMLElementAnchorEngine.load: One of the specified Tag2D elements did not have all necessary properties.');
|
|
37
45
|
return;
|
|
38
46
|
}
|
|
39
47
|
const cleanedText = this._inputValidator.sanitize(element.text);
|
|
@@ -46,7 +54,7 @@ export class HTMLElementAnchorEngine {
|
|
|
46
54
|
const data: IAnchor[] = content.data;
|
|
47
55
|
data.forEach((element: IAnchor) => {
|
|
48
56
|
if (!element.location || !element.data) {
|
|
49
|
-
this._logger.warn(
|
|
57
|
+
this._logger.warn('HTMLElementAnchorEngine.load: One of the specified Anchor elements did not have all necessary properties.');
|
|
50
58
|
return;
|
|
51
59
|
}
|
|
52
60
|
|
|
@@ -68,7 +76,7 @@ export class HTMLElementAnchorEngine {
|
|
|
68
76
|
|
|
69
77
|
if (!element.format || (element.format === 'text')) {
|
|
70
78
|
if (!(<IAnchorDataText>element.data).text) {
|
|
71
|
-
this._logger.warn(
|
|
79
|
+
this._logger.warn('HTMLElementAnchorEngine.load: The text property for an Anchor element is missing.');
|
|
72
80
|
return;
|
|
73
81
|
}
|
|
74
82
|
const textData = <IAnchorDataText>element.data;
|
|
@@ -90,7 +98,7 @@ export class HTMLElementAnchorEngine {
|
|
|
90
98
|
|
|
91
99
|
} else if (element.format === 'image') {
|
|
92
100
|
if (!(<IAnchorDataImage>element.data).src || !(<IAnchorDataImage>element.data).width || !(<IAnchorDataImage>element.data).height || !(<IAnchorDataImage>element.data).alt) {
|
|
93
|
-
this._logger.warn(
|
|
101
|
+
this._logger.warn('HTMLElementAnchorEngine.load: One of the specified Anchor elements did not have all necessary properties.');
|
|
94
102
|
return;
|
|
95
103
|
}
|
|
96
104
|
const imageData = <IAnchorDataImage>element.data;
|
|
@@ -109,13 +117,12 @@ export class HTMLElementAnchorEngine {
|
|
|
109
117
|
intersectionTarget
|
|
110
118
|
}));
|
|
111
119
|
}
|
|
112
|
-
this._logger.warn(
|
|
120
|
+
this._logger.warn(`HTMLElementAnchorEngine.load: The Anchor does not have a recognized format: ${element.format}`);
|
|
113
121
|
});
|
|
114
122
|
}
|
|
115
123
|
return node;
|
|
116
124
|
} catch (e) {
|
|
117
|
-
|
|
118
|
-
throw this._logger.handleError(LOGGING_TOPIC.DATA_PROCESSING, `HTMLElementAnchorEngine.load`, error);
|
|
125
|
+
throw new ShapeDiverViewerDataProcessingError('HTMLElementAnchorEngine.load: Loading of anchors failed.');
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
128
|
|