@avs/go 0.14.72000 → 0.14.72008

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/README.md +1 -1
  2. package/dist/avs-element-mixin.d.ts +28 -0
  3. package/dist/avs-element-mixin.d.ts.map +1 -0
  4. package/dist/avs-element-mixin.js +108 -0
  5. package/dist/avs-go-dataviz.d.ts +457 -0
  6. package/dist/avs-go-dataviz.d.ts.map +1 -0
  7. package/dist/avs-go-dataviz.js +2090 -0
  8. package/dist/avs-go-dynamic-html.d.ts +52 -0
  9. package/dist/avs-go-dynamic-html.d.ts.map +1 -0
  10. package/dist/avs-go-dynamic-html.js +124 -0
  11. package/dist/avs-go-info.d.ts +57 -0
  12. package/dist/avs-go-info.d.ts.map +1 -0
  13. package/dist/avs-go-info.js +127 -0
  14. package/dist/avs-go.min.js +211 -160
  15. package/dist/avs-renderer.d.ts +37 -0
  16. package/dist/avs-renderer.d.ts.map +1 -0
  17. package/dist/avs-renderer.js +33 -0
  18. package/dist/constants.d.ts +21 -0
  19. package/dist/constants.d.ts.map +1 -0
  20. package/dist/constants.js +20 -0
  21. package/dist/icons.d.ts +28 -0
  22. package/dist/icons.d.ts.map +1 -0
  23. package/dist/icons.js +27 -0
  24. package/dist/index.d.ts +23 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +22 -0
  27. package/dist/types.d.ts +142 -0
  28. package/dist/types.d.ts.map +1 -0
  29. package/dist/types.js +36 -0
  30. package/package.json +4 -3
  31. package/rollup.config.js +17 -7
  32. package/src/avs-element-mixin.ts +126 -0
  33. package/src/{avs-go-dataviz.js → avs-go-dataviz.ts} +518 -654
  34. package/src/{avs-go-dynamic-html.js → avs-go-dynamic-html.ts} +37 -50
  35. package/src/{avs-go-info.js → avs-go-info.ts} +36 -47
  36. package/src/{avs-renderer.js → avs-renderer.ts} +10 -2
  37. package/src/{constants.js → constants.ts} +1 -1
  38. package/src/icons.ts +29 -0
  39. package/src/{avs-go.js → index.ts} +3 -3
  40. package/src/types.ts +160 -0
  41. package/tsconfig.json +16 -0
  42. package/src/avs-element-base.js +0 -119
  43. package/src/logo.js +0 -29
@@ -0,0 +1,52 @@
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
+ import { LitElement, PropertyValues } from 'lit';
21
+ declare const AvsGoDynamicHtml_base: (new (...args: any[]) => import("./avs-element-mixin.js").AvsElementMixinInterface) & typeof LitElement;
22
+ /**
23
+ * `avs-go-dynamic-html` is a Lit element which requests HTML by instancing
24
+ * the `dynamicHtmlName` class on the AVS/Go server application running at `url`.
25
+ * The HTML response is inserted into this element's shadow DOM.
26
+ *
27
+ * @customElement
28
+ * @lit
29
+ * @applysMixin AvsElementMixin
30
+ */
31
+ export declare class AvsGoDynamicHtml extends AvsGoDynamicHtml_base {
32
+ /** The URL to an instance of AVS/Go server application. */
33
+ url: string;
34
+ /** Name of the data source registered in the library map on the server. */
35
+ dataSourceName?: string;
36
+ /** User properties as JSON passed directly to the data source on the server. */
37
+ dataSourceUserProperties?: string;
38
+ /** The name of the dynamic html registered in the library map on the server. */
39
+ dynamicHtmlName?: string;
40
+ /** User properties as JSON passed directly to the dynamic html on the server. */
41
+ dynamicHtmlUserProperties?: string;
42
+ _html?: string;
43
+ render(): import("lit-html").TemplateResult<1>;
44
+ willUpdate(changedProperties: PropertyValues<this>): void;
45
+ }
46
+ declare global {
47
+ interface HTMLElementTagNameMap {
48
+ 'avs-go-dynamic-html': AvsGoDynamicHtml;
49
+ }
50
+ }
51
+ export {};
52
+ //# sourceMappingURL=avs-go-dynamic-html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avs-go-dynamic-html.d.ts","sourceRoot":"","sources":["../src/avs-go-dynamic-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;;AAOvD;;;;;;;;GAQG;AACH,qBACa,gBAAiB,SAAQ,qBAA2B;IAE/D,2DAA2D;IAE3D,GAAG,EAAE,MAAM,CAAC;IAEZ,2EAA2E;IAE3E,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gFAAgF;IAEhF,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,gFAAgF;IAEhF,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,iFAAiF;IAEjF,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAGnC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM;IAIN,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;CAiEnD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,gBAAgB,CAAC;KACzC;CACF"}
@@ -0,0 +1,124 @@
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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
21
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
+ 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;
24
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ };
26
+ import { LitElement, html } from 'lit';
27
+ import { customElement, property, state } from 'lit/decorators.js';
28
+ import { AvsElementMixin } from './avs-element-mixin.js';
29
+ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
30
+ import DOMPurify from 'dompurify';
31
+ /**
32
+ * `avs-go-dynamic-html` is a Lit element which requests HTML by instancing
33
+ * the `dynamicHtmlName` class on the AVS/Go server application running at `url`.
34
+ * The HTML response is inserted into this element's shadow DOM.
35
+ *
36
+ * @customElement
37
+ * @lit
38
+ * @applysMixin AvsElementMixin
39
+ */
40
+ let AvsGoDynamicHtml = class AvsGoDynamicHtml extends AvsElementMixin(LitElement) {
41
+ render() {
42
+ return html `${unsafeHTML(this._html)}`;
43
+ }
44
+ willUpdate(changedProperties) {
45
+ if (!this.url) {
46
+ if (changedProperties.has('url')) {
47
+ this._dispatchErrorEvent("'url' property must be set to an instance of AVS/Go server.");
48
+ }
49
+ return;
50
+ }
51
+ if (!this.dynamicHtmlName) {
52
+ if (changedProperties.has('dynamicHtmlName')) {
53
+ 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.");
54
+ }
55
+ return;
56
+ }
57
+ // Assemble the model
58
+ const model = {
59
+ dynamicHtmlProperties: {
60
+ name: this.dynamicHtmlName
61
+ }
62
+ };
63
+ if (this.dynamicHtmlUserProperties) {
64
+ let dynamicHtmlUserProperties;
65
+ try {
66
+ dynamicHtmlUserProperties = JSON.parse(this.dynamicHtmlUserProperties);
67
+ }
68
+ catch (error) {
69
+ this._dispatchErrorEvent("Can't parse 'dynamic-html-user-properties'. " + error);
70
+ return;
71
+ }
72
+ model.dynamicHtmlProperties.userProperties = dynamicHtmlUserProperties;
73
+ }
74
+ // Data source properties
75
+ if (this.dataSourceName) {
76
+ model.dataSourceProperties = {
77
+ name: this.dataSourceName
78
+ };
79
+ if (this.dataSourceUserProperties) {
80
+ let dataSourceUserProperties;
81
+ try {
82
+ dataSourceUserProperties = JSON.parse(this.dataSourceUserProperties);
83
+ }
84
+ catch (error) {
85
+ this._dispatchErrorEvent("Can't parse 'data-source-user-properties'. " + error);
86
+ return;
87
+ }
88
+ model.dataSourceProperties.userProperties = dataSourceUserProperties;
89
+ }
90
+ }
91
+ // Send the request
92
+ this._httpRequest(this.url, (response) => {
93
+ if (response.html) {
94
+ const html = decodeURIComponent(response.html.replace(/\+/g, '%20'));
95
+ this._html = DOMPurify.sanitize(html);
96
+ }
97
+ else {
98
+ this._dispatchErrorEvent("Empty response from AVS/Go server.");
99
+ }
100
+ }, null, model);
101
+ }
102
+ };
103
+ __decorate([
104
+ property()
105
+ ], AvsGoDynamicHtml.prototype, "url", void 0);
106
+ __decorate([
107
+ property({ attribute: 'data-source-name' })
108
+ ], AvsGoDynamicHtml.prototype, "dataSourceName", void 0);
109
+ __decorate([
110
+ property({ attribute: 'data-source-user-properties' })
111
+ ], AvsGoDynamicHtml.prototype, "dataSourceUserProperties", void 0);
112
+ __decorate([
113
+ property({ attribute: 'dynamic-html-name' })
114
+ ], AvsGoDynamicHtml.prototype, "dynamicHtmlName", void 0);
115
+ __decorate([
116
+ property({ attribute: 'dynamic-html-user-properties' })
117
+ ], AvsGoDynamicHtml.prototype, "dynamicHtmlUserProperties", void 0);
118
+ __decorate([
119
+ state()
120
+ ], AvsGoDynamicHtml.prototype, "_html", void 0);
121
+ AvsGoDynamicHtml = __decorate([
122
+ customElement('avs-go-dynamic-html')
123
+ ], AvsGoDynamicHtml);
124
+ export { AvsGoDynamicHtml };
@@ -0,0 +1,57 @@
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
+ import { LitElement } from 'lit';
21
+ declare const AvsGoInfo_base: (new (...args: any[]) => import("./avs-element-mixin.js").AvsElementMixinInterface) & typeof LitElement;
22
+ /**
23
+ * `avs-go-info` is a Lit element which requests data by instancing
24
+ * the `infoName` class on the AVS/Go server application running at `url`.
25
+ * After setting both these properties call the `updateInfo()` method to send the request.
26
+ * Attach a listener for the `avs-go-info-response` event to receive the response.
27
+ *
28
+ * Special case: use an `infoName` of `GetServerInfo` to request a listing of
29
+ * data sources, themes, scenes, info and dynamic HTML available at `url`.
30
+ *
31
+ * @customElement
32
+ * @lit
33
+ * @applysMixin AvsElementMixin
34
+ */
35
+ export declare class AvsGoInfo extends AvsGoInfo_base {
36
+ /** The URL to an instance of AVS/Go server application. */
37
+ url: string;
38
+ /** Name of the data source registered in the library map on the server. */
39
+ dataSourceName?: string;
40
+ /** User properties as JSON passed directly to the data source on the server. */
41
+ dataSourceUserProperties?: string;
42
+ /** The name of the info registered in the library map on the server. */
43
+ infoName?: string;
44
+ /** User properties as JSON passed directly to the info on the server. */
45
+ infoUserProperties?: string;
46
+ /**
47
+ * Send the request to the server.
48
+ */
49
+ updateInfo(): void;
50
+ }
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ 'avs-go-info': AvsGoInfo;
54
+ }
55
+ }
56
+ export {};
57
+ //# sourceMappingURL=avs-go-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avs-go-info.d.ts","sourceRoot":"","sources":["../src/avs-go-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;;AAKjC;;;;;;;;;;;;GAYG;AACH,qBACa,SAAU,SAAQ,cAA2B;IAExD,2DAA2D;IAE3D,GAAG,EAAE,MAAM,CAAC;IAEZ,2EAA2E;IAE3E,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gFAAgF;IAEhF,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,wEAAwE;IAExE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yEAAyE;IAEzE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,UAAU;CAsEX;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,SAAS,CAAC;KAC1B;CACF"}
@@ -0,0 +1,127 @@
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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
21
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
+ 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;
24
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ };
26
+ import { LitElement } from 'lit';
27
+ import { customElement, property } from 'lit/decorators.js';
28
+ import { AvsElementMixin } from './avs-element-mixin.js';
29
+ /**
30
+ * `avs-go-info` is a Lit element which requests data by instancing
31
+ * the `infoName` class on the AVS/Go server application running at `url`.
32
+ * After setting both these properties call the `updateInfo()` method to send the request.
33
+ * Attach a listener for the `avs-go-info-response` event to receive the response.
34
+ *
35
+ * Special case: use an `infoName` of `GetServerInfo` to request a listing of
36
+ * data sources, themes, scenes, info and dynamic HTML available at `url`.
37
+ *
38
+ * @customElement
39
+ * @lit
40
+ * @applysMixin AvsElementMixin
41
+ */
42
+ let AvsGoInfo = class AvsGoInfo extends AvsElementMixin(LitElement) {
43
+ /**
44
+ * Send the request to the server.
45
+ */
46
+ updateInfo() {
47
+ if (!this.url) {
48
+ this._dispatchErrorEvent("'url' property must be set to an instance of AVS/Go server.");
49
+ return;
50
+ }
51
+ if (!this.infoName) {
52
+ this._dispatchErrorEvent("'info-name' property must be set to the name of the info registered in the library map on the AVS/Go server.");
53
+ return;
54
+ }
55
+ // Assemble the model
56
+ const model = {
57
+ infoProperties: {
58
+ name: this.infoName
59
+ }
60
+ };
61
+ if (this.infoUserProperties) {
62
+ let infoUserProperties;
63
+ try {
64
+ infoUserProperties = JSON.parse(this.infoUserProperties);
65
+ }
66
+ catch (error) {
67
+ this._dispatchErrorEvent("Can't parse 'info-user-properties'. " + error);
68
+ return;
69
+ }
70
+ model.infoProperties.userProperties = infoUserProperties;
71
+ }
72
+ // Data source properties
73
+ if (this.dataSourceName) {
74
+ model.dataSourceProperties = {
75
+ name: this.dataSourceName
76
+ };
77
+ if (this.dataSourceUserProperties) {
78
+ let dataSourceUserProperties;
79
+ try {
80
+ dataSourceUserProperties = JSON.parse(this.dataSourceUserProperties);
81
+ }
82
+ catch (error) {
83
+ this._dispatchErrorEvent("Can't parse 'data-source-user-properties'. " + error);
84
+ return;
85
+ }
86
+ model.dataSourceProperties.userProperties = dataSourceUserProperties;
87
+ }
88
+ }
89
+ // Send the request
90
+ this._httpRequest(this.url, (response) => {
91
+ if (response.info) {
92
+ const info = JSON.parse(decodeURIComponent(response.info.replace(/\+/g, '%20')));
93
+ /**
94
+ * Info response from server.
95
+ * @event avs-go-info-response
96
+ */
97
+ this.dispatchEvent(new CustomEvent('avs-go-info-response', {
98
+ bubbles: true,
99
+ composed: true,
100
+ detail: info
101
+ }));
102
+ }
103
+ else {
104
+ this._dispatchErrorEvent("Empty response from AVS/Go server.");
105
+ }
106
+ }, undefined, model);
107
+ }
108
+ };
109
+ __decorate([
110
+ property()
111
+ ], AvsGoInfo.prototype, "url", void 0);
112
+ __decorate([
113
+ property({ attribute: 'data-source-name' })
114
+ ], AvsGoInfo.prototype, "dataSourceName", void 0);
115
+ __decorate([
116
+ property({ attribute: 'data-source-user-properties' })
117
+ ], AvsGoInfo.prototype, "dataSourceUserProperties", void 0);
118
+ __decorate([
119
+ property({ attribute: 'info-name' })
120
+ ], AvsGoInfo.prototype, "infoName", void 0);
121
+ __decorate([
122
+ property({ attribute: 'info-user-properties' })
123
+ ], AvsGoInfo.prototype, "infoUserProperties", void 0);
124
+ AvsGoInfo = __decorate([
125
+ customElement('avs-go-info')
126
+ ], AvsGoInfo);
127
+ export { AvsGoInfo };