From df405604176c9bec125ea1456f2dc457279e8357 Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Fri, 2 Oct 2020 11:28:31 +0200 Subject: [PATCH 01/10] feat: add remote-control component --- .../remote-control/remote-control.js | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/client/web-components/remote-control/remote-control.js diff --git a/src/client/web-components/remote-control/remote-control.js b/src/client/web-components/remote-control/remote-control.js new file mode 100644 index 0000000..0d35518 --- /dev/null +++ b/src/client/web-components/remote-control/remote-control.js @@ -0,0 +1,59 @@ +import '@webcomponents/webcomponentsjs/webcomponents-loader'; +import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter'; +import { bulmaStyles } from '@granite-elements/granite-lit-bulma/granite-lit-bulma'; +import { LitElement, html } from 'lit-element'; +import Fontawesome from 'lit-fontawesome'; +import config from '@config/config.json'; +const QRCode = require('qrcode'); + +class RemoteControl extends LitElement { + static get properties() { + return {}; + } + + static get styles() { + return [ + bulmaStyles, + Fontawesome + ]; + } + + constructor() { + super(); + } + + firstUpdated() { + super.firstUpdated(); + + if (config.tcController.urls.external) { + QRCode.toCanvas(this.shadowRoot.getElementById('qrCode'), config.tcController.urls.external); + this.shadowRoot.getElementById( + 'textCode' + ).innerHTML = `${config.tcController.urls.external}`; + } else { + this.shadowRoot.getElementById('qrCodeSection').classList.add('is-hidden'); + } + } + + render() { + return html` +
+

+ Or take control from another device +

+
+
+
+
+
+ +
+
+
+
+
+ `; + } +} + +customElements.define('tc-remote-control', RemoteControl); From 34df3fc41c5e0d37be431a8ed80c8ed191540b52 Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Fri, 2 Oct 2020 11:28:57 +0200 Subject: [PATCH 02/10] feat: add view-selector component --- .../view-selector/view-selector.js | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/client/web-components/view-selector/view-selector.js diff --git a/src/client/web-components/view-selector/view-selector.js b/src/client/web-components/view-selector/view-selector.js new file mode 100644 index 0000000..71a2ca2 --- /dev/null +++ b/src/client/web-components/view-selector/view-selector.js @@ -0,0 +1,79 @@ +import '@webcomponents/webcomponentsjs/webcomponents-loader'; +import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter'; +import { bulmaStyles } from '@granite-elements/granite-lit-bulma/granite-lit-bulma'; +import { LitElement, html } from 'lit-element'; +import Fontawesome from 'lit-fontawesome'; + +class ViewSelector extends LitElement { + static get properties() { + return {}; + } + + static get styles() { + return [ + bulmaStyles, + Fontawesome + ]; + } + + constructor() { + super(); + } + + firstUpdated() { + super.firstUpdated(); + } + + render() { + return html` + + `; + } +} + +customElements.define('tc-view-selector', ViewSelector); From 1e2d152e21c01d92dd65a84c2cd55a01b1966bac Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Fri, 2 Oct 2020 11:29:39 +0200 Subject: [PATCH 03/10] feat: use new components --- src/client/tc-controller/index.html | 63 +---------------------------- src/client/tc-controller/index.js | 9 ----- 2 files changed, 2 insertions(+), 70 deletions(-) diff --git a/src/client/tc-controller/index.html b/src/client/tc-controller/index.html index 8ca0a5a..08ae494 100644 --- a/src/client/tc-controller/index.html +++ b/src/client/tc-controller/index.html @@ -20,68 +20,9 @@

Choose a view

- +

-
-

- Or take control from another device -

-
-
-
-
-
- -
-
-
-
-
+ diff --git a/src/client/tc-controller/index.js b/src/client/tc-controller/index.js index 2ac2735..6f24e55 100644 --- a/src/client/tc-controller/index.js +++ b/src/client/tc-controller/index.js @@ -9,15 +9,6 @@ import config from '@config/config.json'; const QRCode = require('qrcode'); window.addEventListener('DOMContentLoaded', function() { - if (config.tcController.urls.external) { - QRCode.toCanvas(document.getElementById('qrCode'), config.tcController.urls.external); - document.getElementById( - 'textCode' - ).innerHTML = `${config.tcController.urls.external}`; - } else { - document.getElementById('qrCodeSection').classList.add('is-hidden'); - } - document.querySelector('tc-url-form').classList.remove('is-hidden'); addEventListener('url-form-editing', () => { From 2016a1f48da30bd09cf6bf01a3f4b6f057e2d324 Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Fri, 2 Oct 2020 11:30:26 +0200 Subject: [PATCH 04/10] chore: remove fontawesome from package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index f8929c5..e74fbb6 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,6 @@ } }, "dependencies": { - "@fortawesome/fontawesome-free": "^5.13.1", "@webcomponents/webcomponentsjs": "^2.4.3", "bulma": "^0.9.0", "colors": "^1.4.0", From b9616dff3dee27efcba506c9b688d8bb1e758764 Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Thu, 8 Oct 2020 11:40:37 +0200 Subject: [PATCH 05/10] fix: page url links --- .../web-components/view-selector/view-selector.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/web-components/view-selector/view-selector.js b/src/client/web-components/view-selector/view-selector.js index 71a2ca2..20ac240 100644 --- a/src/client/web-components/view-selector/view-selector.js +++ b/src/client/web-components/view-selector/view-selector.js @@ -28,7 +28,7 @@ class ViewSelector extends LitElement { return html`
- +

@@ -43,9 +43,9 @@ class ViewSelector extends LitElement {

- +
-
+

@@ -58,9 +58,9 @@ class ViewSelector extends LitElement {
- +
-
+

From a784aab848812e603d781ae279d51562592d2aed Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Thu, 8 Oct 2020 11:40:56 +0200 Subject: [PATCH 06/10] fix: tc-controller index requires --- src/client/tc-controller/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client/tc-controller/index.js b/src/client/tc-controller/index.js index 6f24e55..f5fd435 100644 --- a/src/client/tc-controller/index.js +++ b/src/client/tc-controller/index.js @@ -2,11 +2,10 @@ require('./index.css'); require('bulma/css/bulma.min.css'); -require('@fortawesome/fontawesome-free/js/all.min.js'); +require('lit-fontawesome/css/font.css'); require('../web-components/url-form/url-form.js'); - -import config from '@config/config.json'; -const QRCode = require('qrcode'); +require('../web-components/view-selector/view-selector'); +require('../web-components/remote-control/remote-control'); window.addEventListener('DOMContentLoaded', function() { document.querySelector('tc-url-form').classList.remove('is-hidden'); From 526d006cb54c276f3239ab760f0975b5e5991873 Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Thu, 8 Oct 2020 11:41:07 +0200 Subject: [PATCH 07/10] fix: typo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e74fbb6..a620484 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "clean": "rm -rf .cache dist", "create-tunnels": "node src/environment/create-tunnels", "get-started": "node src/environment/get-started", - "start": "npx npm-run-all --parallel create-tunnels tc-server tc-showcase start-controller-after-server when-controller-is-started", + "start": "npx npm-run-all --parallel create-tunnels tc-server tc-showcase start-controller-after-server when-controller-is-started", "start-controller-after-server": "wait-on tcp:3001 && wait-on tcp:3002 && npm run tc-controller-and-component", "when-controller-is-started": "wait-on tcp:3000 && npm run get-started", "build": "npx npm-run-all --parallel build-*", From 9466ba67ae71d25a9b727beab6c3e873c9f5c8ed Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Thu, 8 Oct 2020 11:41:56 +0200 Subject: [PATCH 08/10] chore: update package-lock.json --- package-lock.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e14da22..0e7344e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1621,11 +1621,6 @@ "integrity": "sha512-r3fwVbVH+M8W0qYlBBZFsUwKe6NT5qvz+EmU7sr8VeN1cQ63z+3cfXyTo7WGGEMEgKiT0jboNAK3b1FZp8k9LQ==", "dev": true }, - "@fortawesome/fontawesome-free": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.0.tgz", - "integrity": "sha512-wXetjQBNMTP59MAYNR1tdahMDOLx3FYj3PKdso7PLFLDpTvmAIqhSSEqnSTmWKahRjD+Sh5I5635+5qaoib5lw==" - }, "@granite-elements/granite-lit-bulma": { "version": "0.9.0-4", "resolved": "https://registry.npmjs.org/@granite-elements/granite-lit-bulma/-/granite-lit-bulma-0.9.0-4.tgz", From 21b5fc375f99bcd66530a36d6839b6b988248d83 Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Thu, 8 Oct 2020 15:22:04 +0200 Subject: [PATCH 09/10] fix: requires path --- .babelrc | 1 - jsconfig.json | 1 - package.json | 1 - src/client/layouts/on-stage/index.js | 8 ++++---- src/client/layouts/presenter/index.js | 18 +++++++++--------- src/client/tc-controller/index.js | 6 +++--- webpack.config.js | 6 +++--- 7 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.babelrc b/.babelrc index 9aca200..cbd1213 100644 --- a/.babelrc +++ b/.babelrc @@ -5,7 +5,6 @@ "module-resolver", { "alias": { - "@src": "./src", "@event-bus": "./src/common/event-bus", "@services": "./src/common/services", "@client": "./src/client", diff --git a/jsconfig.json b/jsconfig.json index c33aa7f..bd7b74e 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -4,7 +4,6 @@ "target": "es2020", "baseUrl": ".", "paths": { - "@src/*": ["src/*"], "@event-bus/*": ["src/common/event-bus/*"], "@services/*": ["src/common/services/*"], "@client/*": ["src/client/*"], diff --git a/package.json b/package.json index a620484..7d51197 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,6 @@ "wait-on": "^4.0.2" }, "_moduleAliases": { - "@src": "src", "@event-bus": "src/common/event-bus", "@services": "src/common/services", "@client": "src/client", diff --git a/src/client/layouts/on-stage/index.js b/src/client/layouts/on-stage/index.js index 92b4195..6851a26 100644 --- a/src/client/layouts/on-stage/index.js +++ b/src/client/layouts/on-stage/index.js @@ -3,10 +3,10 @@ require('./index.css'); require('bulma/css/bulma.min.css'); require('lit-fontawesome/css/font.css'); -require('../../web-components/slide-view/slide-view.js'); -require('../../web-components/clock/clock.js'); -require('../../web-components/menu-navigation/menu-navigation.js'); -require('../../web-components/menu-plugins/menu-plugins.js'); +require('@client/web-components/slide-view/slide-view.js'); +require('@client/web-components/clock/clock.js'); +require('@client/web-components/menu-navigation/menu-navigation.js'); +require('@client/web-components/menu-plugins/menu-plugins.js'); import { TCController } from '@client/tc-controller/tc-controller.js'; import config from '@config/config.json'; diff --git a/src/client/layouts/presenter/index.js b/src/client/layouts/presenter/index.js index 25b5582..95930ed 100644 --- a/src/client/layouts/presenter/index.js +++ b/src/client/layouts/presenter/index.js @@ -3,15 +3,15 @@ require('./index.css'); require('bulma/css/bulma.min.css'); require('lit-fontawesome/css/font.css'); -require('../../web-components/slide-view/slide-view.js'); -require('../../web-components/url-form/url-form.js'); -require('../../web-components/clock/clock.js'); -require('../../web-components/timer/timer.js'); -require('../../web-components/notes/notes.js'); -require('../../web-components/menu-navigation/menu-navigation.js'); -require('../../web-components/menu-plugins/menu-plugins.js'); -require('../../../plugins/input/touch-pointer/components/touch-pointer-settings.js'); -require('../../../plugins/input/touch-pointer/components/touch-pointer-mask.js'); +require('@client/web-components/slide-view/slide-view.js'); +require('@client/web-components/url-form/url-form.js'); +require('@client/web-components/clock/clock.js'); +require('@client/web-components/timer/timer.js'); +require('@client/web-components/notes/notes.js'); +require('@client/web-components/menu-navigation/menu-navigation.js'); +require('@client/web-components/menu-plugins/menu-plugins.js'); +require('@plugins/input/touch-pointer/components/touch-pointer-settings.js'); +require('@plugins/input/touch-pointer/components/touch-pointer-mask.js'); import { TCController } from '@client/tc-controller/tc-controller.js'; import config from '@config/config.json'; diff --git a/src/client/tc-controller/index.js b/src/client/tc-controller/index.js index f5fd435..1a09532 100644 --- a/src/client/tc-controller/index.js +++ b/src/client/tc-controller/index.js @@ -3,9 +3,9 @@ require('./index.css'); require('bulma/css/bulma.min.css'); require('lit-fontawesome/css/font.css'); -require('../web-components/url-form/url-form.js'); -require('../web-components/view-selector/view-selector'); -require('../web-components/remote-control/remote-control'); +require('@client/web-components/url-form/url-form.js'); +require('@client/web-components/view-selector/view-selector'); +require('@client/web-components/remote-control/remote-control'); window.addEventListener('DOMContentLoaded', function() { document.querySelector('tc-url-form').classList.remove('is-hidden'); diff --git a/webpack.config.js b/webpack.config.js index 55ae6ae..720e7f2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -55,11 +55,11 @@ module.exports = { }, resolve: { alias: { - '@config': path.resolve(__dirname, './config/'), - '@client': path.resolve(__dirname, './src/client/'), '@event-bus': path.resolve(__dirname, './src/common/event-bus/'), '@services': path.resolve(__dirname, './src/common/services/'), - '@plugins': path.resolve(__dirname, './src/plugins/') + '@client': path.resolve(__dirname, './src/client/'), + '@plugins': path.resolve(__dirname, './src/plugins/'), + '@config': path.resolve(__dirname, './config/') }, extensions: ['.js', '.json'] }, From cdfcc1697cdbcf3b52c1933d701124ac66cc8167 Mon Sep 17 00:00:00 2001 From: Gildas Morel des Vallons Date: Thu, 8 Oct 2020 15:23:36 +0200 Subject: [PATCH 10/10] build: remove build command (useless for now) --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 7d51197..f547943 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "start": "npx npm-run-all --parallel create-tunnels tc-server tc-showcase start-controller-after-server when-controller-is-started", "start-controller-after-server": "wait-on tcp:3001 && wait-on tcp:3002 && npm run tc-controller-and-component", "when-controller-is-started": "wait-on tcp:3000 && npm run get-started", - "build": "npx npm-run-all --parallel build-*", "test": "npx mocha", "coverage": "npx nyc npm test", "lint": "eslint --fix . --cache",