@avs/go 0.14.72000 → 0.14.72017

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.
Files changed (43) hide show
  1. package/LICENSE +195 -0
  2. package/NOTICE +5 -0
  3. package/README.md +3 -3
  4. package/dist/avs-element-mixin.d.ts +28 -0
  5. package/dist/avs-element-mixin.d.ts.map +1 -0
  6. package/dist/avs-element-mixin.js +108 -0
  7. package/dist/avs-go-dataviz.d.ts +458 -0
  8. package/dist/avs-go-dataviz.d.ts.map +1 -0
  9. package/dist/avs-go-dataviz.js +2089 -0
  10. package/dist/avs-go-dynamic-html.d.ts +52 -0
  11. package/dist/avs-go-dynamic-html.d.ts.map +1 -0
  12. package/dist/avs-go-dynamic-html.js +124 -0
  13. package/dist/avs-go-info.d.ts +57 -0
  14. package/dist/avs-go-info.d.ts.map +1 -0
  15. package/dist/avs-go-info.js +127 -0
  16. package/dist/avs-go.min.js +192 -162
  17. package/dist/avs-renderer.d.ts +37 -0
  18. package/dist/avs-renderer.d.ts.map +1 -0
  19. package/{src → dist}/avs-renderer.js +33 -36
  20. package/{src/avs-go.js → dist/constants.d.ts} +21 -23
  21. package/dist/constants.d.ts.map +1 -0
  22. package/{src → dist}/constants.js +20 -21
  23. package/dist/icons.d.ts +28 -0
  24. package/dist/icons.d.ts.map +1 -0
  25. package/dist/icons.js +27 -0
  26. package/dist/index.d.ts +23 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +22 -0
  29. package/dist/types.d.ts +131 -0
  30. package/dist/types.d.ts.map +1 -0
  31. package/dist/types.js +20 -0
  32. package/licenses/lit.BSD-3 +28 -0
  33. package/{lib/LICENSE-avsthreejs → licenses/three.MIT} +1 -21
  34. package/package.json +15 -4
  35. package/demo/data/scene.json +0 -1
  36. package/demo/img/avs.png +0 -0
  37. package/demo/jsonView.html +0 -36
  38. package/rollup.config.js +0 -16
  39. package/src/avs-element-base.js +0 -119
  40. package/src/avs-go-dataviz.js +0 -2536
  41. package/src/avs-go-dynamic-html.js +0 -151
  42. package/src/avs-go-info.js +0 -152
  43. package/src/logo.js +0 -29
@@ -1,151 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2018 Advanced Visual Systems Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * This product includes software developed at
18
- * Advanced Visual Systems Inc. (http://www.avs.com)
19
- */
20
-
21
- import { AvsElementBase } from './avs-element-base.js';
22
- import { html } from 'lit';
23
- import { unsafeHTML } from 'lit/directives/unsafe-html.js';
24
- import DOMPurify from 'dompurify';
25
-
26
- /**
27
- * `avs-go-dynamic-html` is a Lit element which requests HTML by instancing
28
- * the `dynamicHtmlName` class on the AVS/Go server application running at `url`.
29
- * The HTML response is inserted into this element's shadow DOM.
30
- *
31
- * @customElement
32
- * @lit
33
- */
34
- export class AvsGoDynamicHtml extends AvsElementBase {
35
- static properties = {
36
- /**
37
- * The URL to an instance of AVS/Go server application.
38
- */
39
- url: {
40
- type: String
41
- },
42
-
43
- /**
44
- * Name of the data source registered in the library map on the server.
45
- */
46
- dataSourceName: {
47
- type: String,
48
- attribute: 'data-source-name'
49
- },
50
-
51
- /**
52
- * User properties as JSON passed directly to the data source on the server.
53
- */
54
- dataSourceUserProperties: {
55
- type: String,
56
- attribute: 'data-source-user-properties'
57
- },
58
-
59
- /**
60
- * The name of the dynamic html registered in the library map on the server.
61
- */
62
- dynamicHtmlName: {
63
- type: String,
64
- attribute: 'dynamic-html-name'
65
- },
66
-
67
- /**
68
- * User properties as JSON passed directly to the dynamic html on the server.
69
- */
70
- dynamicHtmlUserProperties: {
71
- type: String,
72
- attribute: 'dynamic-html-user-properties'
73
- },
74
-
75
- _html: {
76
- state: true
77
- }
78
- }
79
-
80
- render() {
81
- return html`${unsafeHTML(this._html)}`;
82
- }
83
-
84
- willUpdate(changedProperties) {
85
- if (!this.url) {
86
- if (changedProperties.has('url')) {
87
- this._dispatchErrorEvent("'url' property must be set to an instance of AVS/Go server.");
88
- }
89
- return;
90
- }
91
- if (!this.dynamicHtmlName) {
92
- if (changedProperties.has('dynamicHtmlName')) {
93
- this._dispatchErrorEvent("'dynamic-html-name' property must be set to the name of the dynamicHtml registered in the library map on the AVS/Go server.");
94
- }
95
- return;
96
- }
97
-
98
- // Assemble the model
99
- const model = {
100
- dynamicHtmlProperties: {
101
- name: this.dynamicHtmlName
102
- }
103
- };
104
- if (this.dynamicHtmlUserProperties) {
105
- let dynamicHtmlUserProperties;
106
- try {
107
- dynamicHtmlUserProperties = JSON.parse(this.dynamicHtmlUserProperties);
108
- }
109
- catch (error) {
110
- this._dispatchErrorEvent("Can't parse 'dynamic-html-user-properties'. " + error.message);
111
- return;
112
- }
113
- model.dynamicHtmlProperties.userProperties = dynamicHtmlUserProperties;
114
- }
115
-
116
- // Data source properties
117
- if (this.dataSourceName) {
118
- model.dataSourceProperties = {
119
- name: this.dataSourceName
120
- }
121
- if (this.dataSourceUserProperties) {
122
- let dataSourceUserProperties;
123
- try {
124
- dataSourceUserProperties = JSON.parse(this.dataSourceUserProperties);
125
- }
126
- catch (error) {
127
- this._dispatchErrorEvent("Can't parse 'data-source-user-properties'. " + error.message);
128
- return;
129
- }
130
- model.dataSourceProperties.userProperties = dataSourceUserProperties;
131
- }
132
- }
133
-
134
- // Send the request
135
- this._httpRequest(this.url,
136
- (response) => {
137
- if (response.html) {
138
- const html = decodeURIComponent(response.html.replace(/\+/g, '%20'));
139
- this._html = DOMPurify.sanitize(html);
140
- }
141
- else {
142
- this._dispatchErrorEvent("Empty response from AVS/Go server.");
143
- }
144
- },
145
- null,
146
- model
147
- );
148
- }
149
- }
150
-
151
- customElements.define('avs-go-dynamic-html', AvsGoDynamicHtml);
@@ -1,152 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2018 Advanced Visual Systems Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * This product includes software developed at
18
- * Advanced Visual Systems Inc. (http://www.avs.com)
19
- */
20
-
21
- import { AvsElementBase } from './avs-element-base.js';
22
-
23
- /**
24
- * `avs-go-info` is a Lit element which requests data by instancing
25
- * the `infoName` class on the AVS/Go server application running at `url`.
26
- * After setting both these properties call the `updateInfo()` method to send the request.
27
- * Attach a listener for the `avs-go-info-response` event to receive the response.
28
- *
29
- * Special case: use an `infoName` of `GetServerInfo` to request a listing of
30
- * data sources, themes, scenes, info and dynamic HTML available at `url`.
31
- *
32
- * @customElement
33
- * @lit
34
- */
35
- export class AvsGoInfo extends AvsElementBase {
36
- static properties = {
37
- /**
38
- * The URL to an instance of AVS/Go server application.
39
- */
40
- url: {
41
- type: String
42
- },
43
-
44
- /**
45
- * Name of the data source registered in the library map on the server.
46
- */
47
- dataSourceName: {
48
- type: String,
49
- attribute: 'data-source-name'
50
- },
51
-
52
- /**
53
- * User properties as JSON passed directly to the data source on the server.
54
- */
55
- dataSourceUserProperties: {
56
- type: String,
57
- attribute: 'data-source-user-properties'
58
- },
59
-
60
- /**
61
- * The name of the info registered in the library map on the server.
62
- */
63
- infoName: {
64
- type: String,
65
- attribute: 'info-name'
66
- },
67
-
68
- /**
69
- * User properties as JSON passed directly to the info on the server.
70
- */
71
- infoUserProperties: {
72
- type: String,
73
- attribute: 'info-user-properties'
74
- }
75
- }
76
-
77
- /**
78
- * Send the request to the server.
79
- */
80
- updateInfo() {
81
- if (!this.url) {
82
- this._dispatchErrorEvent("'url' property must be set to an instance of AVS/Go server.");
83
- return;
84
- }
85
- if (!this.infoName) {
86
- this._dispatchErrorEvent("'info-name' property must be set to the name of the info registered in the library map on the AVS/Go server.");
87
- return;
88
- }
89
-
90
- // Assemble the model
91
- const model = {
92
- infoProperties: {
93
- name: this.infoName
94
- }
95
- };
96
- if (this.infoUserProperties) {
97
- let infoUserProperties;
98
- try {
99
- infoUserProperties = JSON.parse(this.infoUserProperties);
100
- }
101
- catch (error) {
102
- this._dispatchErrorEvent("Can't parse 'info-user-properties'. " + error.message);
103
- return;
104
- }
105
- model.infoProperties.userProperties = infoUserProperties;
106
- }
107
-
108
- // Data source properties
109
- if (this.dataSourceName) {
110
- model.dataSourceProperties = {
111
- name: this.dataSourceName
112
- }
113
- if (this.dataSourceUserProperties) {
114
- let dataSourceUserProperties;
115
- try {
116
- dataSourceUserProperties = JSON.parse(this.dataSourceUserProperties);
117
- }
118
- catch (error) {
119
- this._dispatchErrorEvent("Can't parse 'data-source-user-properties'. " + error.message);
120
- return;
121
- }
122
- model.dataSourceProperties.userProperties = dataSourceUserProperties;
123
- }
124
- }
125
-
126
- // Send the request
127
- this._httpRequest(this.url,
128
- (response) => {
129
- if (response.info) {
130
- const info = JSON.parse(decodeURIComponent(response.info.replace(/\+/g, '%20')));
131
-
132
- /**
133
- * Info response from server.
134
- * @event avs-go-info-response
135
- */
136
- this.dispatchEvent(new CustomEvent('avs-go-info-response', {
137
- bubbles: true,
138
- composed: true,
139
- detail: info
140
- }));
141
- }
142
- else {
143
- this._dispatchErrorEvent("Empty response from AVS/Go server.");
144
- }
145
- },
146
- null,
147
- model
148
- );
149
- }
150
- }
151
-
152
- customElements.define('avs-go-info', AvsGoInfo);
package/src/logo.js DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2018 Advanced Visual Systems Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * This product includes software developed at
18
- * Advanced Visual Systems Inc. (http://www.avs.com)
19
- */
20
-
21
- export var LOGO = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"46px\" viewBox=\"0 0 12.170833 12.170834\" width=\"46px\"><path d=\"M 7.2486073,9.9076469 H 5.2849946 L 8.4704866,6.123394 6.2360101,3.4130208 7.1885217,2.271515 10.424524,6.122616 Z M 6.0677825,8.6164059 3.9785527,6.1181874 6.0843599,3.5947138 8.1676051,6.1217782 Z M 1.7215741,6.1177086 6.5503222,0.33124232 H 8.5047186 L 3.6754319,6.1184268 5.9155339,8.7972611 4.958833,9.9337997 Z M 7.3399924,2.0900614 9.0019205,0.09856041 H 6.441462 L 1.4175556,6.1188457 4.7994028,10.140329 H 7.3569887 L 10.728423,6.122616 Z\" style=\"display:inline;fill:#2e8cbd;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0598462\" id=\"path22\" /><path d=\"M 7.2486073,9.9076469 H 5.2849946 L 8.4704866,6.123394 6.2360101,3.4130208 7.1885217,2.271515 10.424524,6.122616 Z M 6.0677825,8.6164059 3.9785527,6.1181874 6.0843599,3.5947138 8.1676051,6.1217782 Z M 1.7215741,6.1177086 6.5503222,0.33124232 H 8.5047186 L 3.6754319,6.1184268 5.9155339,8.7972611 4.958833,9.9337997 Z M 7.3399924,2.0900614 9.0019205,0.09856041 H 6.441462 L 1.4175556,6.1188457 4.7994028,10.140329 H 7.3569887 L 10.728423,6.122616 Z\" style=\"fill:none;stroke:#2e8cbd;stroke-width:0.179539;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1\" id=\"path26\" /><g id=\"g78\" class=\"spinnerBackground\"><path d=\"M 5.0916012,7.2951741 C 4.5581951,6.6568 4.1217726,6.1273448 4.1217726,6.1186069 c 0,-0.022412 1.9511841,-2.3603376 1.9654853,-2.3550616 0.00645,0.00237 0.4481639,0.5337638 0.981573,1.1808488 L 8.0386633,6.1209126 7.7794202,6.4289493 C 7.6368389,6.5983701 7.1955674,7.1235887 6.7988191,7.5961017 6.4020707,8.0686158 6.0738528,8.4553619 6.0694438,8.4555369 6.0650388,8.4557059 5.6250056,7.9335497 5.0916012,7.2951741 Z\" id=\"path39\" /><path d=\"M 5.5264617,9.7764122 C 5.5385577,9.7616559 6.2319291,8.9374956 7.0672769,7.9449584 7.9026265,6.9524246 8.5861155,6.1329723 8.5861409,6.1239554 8.5861681,6.1149485 8.0879549,5.5032753 7.4789997,4.7647 6.8700453,4.0261248 6.3741103,3.4156149 6.3769213,3.4080117 6.3797713,3.4004117 6.562373,3.1774787 6.7827896,2.9126121 7.164399,2.4540426 7.1848936,2.4323657 7.2117806,2.4588741 7.2273026,2.4741751 7.9274525,3.3048587 8.767655,4.3048177 L 10.295296,6.1229243 9.4136171,7.1736012 C 8.9286921,7.751474 8.2336861,8.5795488 7.8691565,9.0137659 L 7.2063776,9.8032561 H 6.3554188 c -0.7939025,0 -0.8494825,-0.00179 -0.8289571,-0.026839 z\" id=\"path41\" /><path d=\"M 3.4382986,7.9881037 C 2.6063322,7.0074024 1.9089456,6.1852746 1.8885531,6.1611518 L 1.8514763,6.1172937 4.2262773,3.2714352 6.6010789,0.42557499 H 7.4490822 8.2970851 L 7.0763447,1.8883334 c -3.0218884,3.6209928 -3.5158893,4.2139972 -3.519859,4.2252855 -0.00231,0.00662 0.4954141,0.6094855 1.1060858,1.3397178 0.6106728,0.7302338 1.1103133,1.3348316 1.1103133,1.3435515 0,0.017734 -0.7956667,0.9718373 -0.8117152,0.9733472 -0.00562,5.108e-4 -0.6909038,-0.80143 -1.522871,-1.7821306 z\" id=\"path43\" /></g></svg>";
22
-
23
- export var TIMELAPSE = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"currentColor\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M16.24 7.75c-1.17-1.17-2.7-1.76-4.24-1.76v6l-4.24 4.24c2.34 2.34 6.14 2.34 8.49 0 2.34-2.34 2.34-6.14-.01-8.48zM12 1.99c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"/></svg>";
24
- export var CAMERA = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"currentColor\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V6h4.05l1.83-2h4.24l1.83 2H20v12zM12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0 8c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z\"/></svg>";
25
- export var PLAY = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"currentColor\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M10 8.64L15.27 12 10 15.36V8.64M8 5v14l11-7L8 5z\"/></svg>";
26
- export var HOME = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"currentColor\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3L2 12h3v8h6v-6h2v6h6v-8h3L12 3z\"/></svg>";
27
- export var DELETE = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"currentColor\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z\"/></svg>";
28
- export var COPY = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"currentColor\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"/></svg>";
29
- export var LINK = "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"currentColor\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z\"/></svg>";