Typescript and lit version change + fix form submit.

This commit is contained in:
John Livingston 2024-05-23 18:35:23 +02:00 committed by Mehdi Benadel
parent afec3d90ed
commit 0672dc24a0
5 changed files with 97 additions and 48 deletions

View File

@ -47,7 +47,8 @@ export class ChannelConfigurationElement extends LivechatElement {
}); });
private _saveConfig = () => { private _saveConfig = (ev?: Event) => {
ev?.preventDefault()
if (this._channelDetailsService && this._channelConfiguration) { if (this._channelDetailsService && this._channelConfiguration) {
this._channelDetailsService.saveOptions(this._channelConfiguration.channel.id, this._channelConfiguration.configuration) this._channelDetailsService.saveOptions(this._channelConfiguration.channel.id, this._channelConfiguration.configuration)
.then((value) => { .then((value) => {
@ -183,7 +184,7 @@ export class ChannelConfigurationElement extends LivechatElement {
</livechat-help-button> </livechat-help-button>
</h1> </h1>
<p>${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_DESC)}</p> <p>${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_DESC)}</p>
<form livechat-configuration-channel-options role="form"> <form livechat-configuration-channel-options role="form" @submit=${this._saveConfig}>
<div class="row mt-3"> <div class="row mt-3">
<div class="row mt-5"> <div class="row mt-5">
<div class="col-12 col-lg-4 col-xl-3"> <div class="col-12 col-lg-4 col-xl-3">
@ -339,7 +340,7 @@ export class ChannelConfigurationElement extends LivechatElement {
: '' : ''
} }
<div class="form-group mt-5"> <div class="form-group mt-5">
<button type="button" class="peertube-button-link orange-button" @click=${this._saveConfig}>${ptTr(LOC_SAVE)}</button> <input type="submit" class="peertube-button-link orange-button" value=${ptTr(LOC_SAVE)} />
</div> </div>
${(this._formStatus && this._formStatus.success === undefined) ? ${(this._formStatus && this._formStatus.success === undefined) ?
html`<div class="alert alert-warning" role="alert"> html`<div class="alert alert-warning" role="alert">

View File

@ -115,7 +115,7 @@ export class DynamicTableFormElement extends LitElement {
} }
`; `;
protected createRenderRoot = (): HTMLElement | DocumentFragment => { protected createRenderRoot = () => {
if (document.head.querySelector(`style[data-tagname="${this.tagName}"]`)) { if (document.head.querySelector(`style[data-tagname="${this.tagName}"]`)) {
return this; return this;
} }

View File

@ -8,7 +8,7 @@ import { LitElement } from 'lit'
* Base class for all Custom Elements. * Base class for all Custom Elements.
*/ */
export class LivechatElement extends LitElement { export class LivechatElement extends LitElement {
protected createRenderRoot = (): HTMLElement | DocumentFragment => { protected createRenderRoot = () => {
return this return this
} }
} }

130
package-lock.json generated
View File

@ -17,7 +17,6 @@
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
"got": "^11.8.2", "got": "^11.8.2",
"http-proxy": "^1.18.1", "http-proxy": "^1.18.1",
"lit": "^3.1.3",
"log-rotate": "^0.2.8", "log-rotate": "^0.2.8",
"openid-client": "^5.6.5", "openid-client": "^5.6.5",
"validate-color": "^2.2.1", "validate-color": "^2.2.1",
@ -46,6 +45,7 @@
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.1", "eslint-plugin-promise": "^5.1.1",
"eslint-plugin-standard": "^5.0.0", "eslint-plugin-standard": "^5.0.0",
"lit": "^2.4.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"sass": "^1.43.4", "sass": "^1.43.4",
"sharp": "^0.33.2", "sharp": "^0.33.2",
@ -53,7 +53,7 @@
"stylelint-config-recommended-scss": "^5.0.1", "stylelint-config-recommended-scss": "^5.0.1",
"stylelint-config-standard-scss": "^2.0.1", "stylelint-config-standard-scss": "^2.0.1",
"svgo": "^2.8.0", "svgo": "^2.8.0",
"typescript": "^5.0.0", "typescript": "^4.3.5",
"yaml": "^2.2.1" "yaml": "^2.2.1"
}, },
"engines": { "engines": {
@ -4122,7 +4122,8 @@
"node_modules/@types/trusted-types": { "node_modules/@types/trusted-types": {
"version": "2.0.7", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
"dev": true
}, },
"node_modules/@types/validator": { "node_modules/@types/validator": {
"version": "13.7.1", "version": "13.7.1",
@ -8674,33 +8675,54 @@
"dev": true "dev": true
}, },
"node_modules/lit": { "node_modules/lit": {
"version": "3.1.3", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/lit/-/lit-3.1.3.tgz", "resolved": "https://registry.npmjs.org/lit/-/lit-2.4.0.tgz",
"integrity": "sha512-l4slfspEsnCcHVRTvaP7YnkTZEZggNFywLEIhQaGhYDczG+tu/vlgm/KaWIEjIp+ZyV20r2JnZctMb8LeLCG7Q==", "integrity": "sha512-fdgzxEtLrZFQU/BqTtxFQCLwlZd9bdat+ltzSFjvWkZrs7eBmeX0L5MHUMb3kYIkuS8Xlfnii/iI5klirF8/Xg==",
"dev": true,
"dependencies": { "dependencies": {
"@lit/reactive-element": "^2.0.4", "@lit/reactive-element": "^1.4.0",
"lit-element": "^4.0.4", "lit-element": "^3.2.0",
"lit-html": "^3.1.2" "lit-html": "^2.4.0"
} }
}, },
"node_modules/lit-element": { "node_modules/lit-element": {
"version": "4.0.5", "version": "3.3.3",
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.0.5.tgz", "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.3.3.tgz",
"integrity": "sha512-iTWskWZEtn9SyEf4aBG6rKT8GABZMrTWop1+jopsEOgEcugcXJGKuX5bEbkq9qfzY+XB4MAgCaSPwnNpdsNQ3Q==", "integrity": "sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==",
"dev": true,
"dependencies": { "dependencies": {
"@lit-labs/ssr-dom-shim": "^1.2.0", "@lit-labs/ssr-dom-shim": "^1.1.0",
"@lit/reactive-element": "^2.0.4", "@lit/reactive-element": "^1.3.0",
"lit-html": "^3.1.2" "lit-html": "^2.8.0"
}
},
"node_modules/lit-element/node_modules/@lit/reactive-element": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.3.tgz",
"integrity": "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==",
"dev": true,
"dependencies": {
"@lit-labs/ssr-dom-shim": "^1.0.0"
} }
}, },
"node_modules/lit-html": { "node_modules/lit-html": {
"version": "3.1.3", "version": "2.8.0",
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.3.tgz", "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.8.0.tgz",
"integrity": "sha512-FwIbqDD8O/8lM4vUZ4KvQZjPPNx7V1VhT7vmRB8RBAO0AU6wuTVdoXiu2CivVjEGdugvcbPNBLtPE1y0ifplHA==", "integrity": "sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==",
"dev": true,
"dependencies": { "dependencies": {
"@types/trusted-types": "^2.0.2" "@types/trusted-types": "^2.0.2"
} }
}, },
"node_modules/lit/node_modules/@lit/reactive-element": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.3.tgz",
"integrity": "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==",
"dev": true,
"dependencies": {
"@lit-labs/ssr-dom-shim": "^1.0.0"
}
},
"node_modules/locate-path": { "node_modules/locate-path": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
@ -12008,16 +12030,16 @@
"dev": true "dev": true
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.4.5", "version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
}, },
"engines": { "engines": {
"node": ">=14.17" "node": ">=4.2.0"
} }
}, },
"node_modules/uid-safe": { "node_modules/uid-safe": {
@ -15620,7 +15642,8 @@
"@types/trusted-types": { "@types/trusted-types": {
"version": "2.0.7", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
"dev": true
}, },
"@types/validator": { "@types/validator": {
"version": "13.7.1", "version": "13.7.1",
@ -18968,29 +18991,54 @@
"dev": true "dev": true
}, },
"lit": { "lit": {
"version": "3.1.3", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/lit/-/lit-3.1.3.tgz", "resolved": "https://registry.npmjs.org/lit/-/lit-2.4.0.tgz",
"integrity": "sha512-l4slfspEsnCcHVRTvaP7YnkTZEZggNFywLEIhQaGhYDczG+tu/vlgm/KaWIEjIp+ZyV20r2JnZctMb8LeLCG7Q==", "integrity": "sha512-fdgzxEtLrZFQU/BqTtxFQCLwlZd9bdat+ltzSFjvWkZrs7eBmeX0L5MHUMb3kYIkuS8Xlfnii/iI5klirF8/Xg==",
"dev": true,
"requires": { "requires": {
"@lit/reactive-element": "^2.0.4", "@lit/reactive-element": "^1.4.0",
"lit-element": "^4.0.4", "lit-element": "^3.2.0",
"lit-html": "^3.1.2" "lit-html": "^2.4.0"
},
"dependencies": {
"@lit/reactive-element": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.3.tgz",
"integrity": "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==",
"dev": true,
"requires": {
"@lit-labs/ssr-dom-shim": "^1.0.0"
}
}
} }
}, },
"lit-element": { "lit-element": {
"version": "4.0.5", "version": "3.3.3",
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.0.5.tgz", "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.3.3.tgz",
"integrity": "sha512-iTWskWZEtn9SyEf4aBG6rKT8GABZMrTWop1+jopsEOgEcugcXJGKuX5bEbkq9qfzY+XB4MAgCaSPwnNpdsNQ3Q==", "integrity": "sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==",
"dev": true,
"requires": { "requires": {
"@lit-labs/ssr-dom-shim": "^1.2.0", "@lit-labs/ssr-dom-shim": "^1.1.0",
"@lit/reactive-element": "^2.0.4", "@lit/reactive-element": "^1.3.0",
"lit-html": "^3.1.2" "lit-html": "^2.8.0"
},
"dependencies": {
"@lit/reactive-element": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.3.tgz",
"integrity": "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==",
"dev": true,
"requires": {
"@lit-labs/ssr-dom-shim": "^1.0.0"
}
}
} }
}, },
"lit-html": { "lit-html": {
"version": "3.1.3", "version": "2.8.0",
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.3.tgz", "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.8.0.tgz",
"integrity": "sha512-FwIbqDD8O/8lM4vUZ4KvQZjPPNx7V1VhT7vmRB8RBAO0AU6wuTVdoXiu2CivVjEGdugvcbPNBLtPE1y0ifplHA==", "integrity": "sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==",
"dev": true,
"requires": { "requires": {
"@types/trusted-types": "^2.0.2" "@types/trusted-types": "^2.0.2"
} }
@ -21415,9 +21463,9 @@
"dev": true "dev": true
}, },
"typescript": { "typescript": {
"version": "5.4.5", "version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"dev": true "dev": true
}, },
"uid-safe": { "uid-safe": {

View File

@ -41,7 +41,6 @@
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
"got": "^11.8.2", "got": "^11.8.2",
"http-proxy": "^1.18.1", "http-proxy": "^1.18.1",
"lit": "^3.1.3",
"log-rotate": "^0.2.8", "log-rotate": "^0.2.8",
"openid-client": "^5.6.5", "openid-client": "^5.6.5",
"validate-color": "^2.2.1", "validate-color": "^2.2.1",
@ -70,6 +69,7 @@
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.1", "eslint-plugin-promise": "^5.1.1",
"eslint-plugin-standard": "^5.0.0", "eslint-plugin-standard": "^5.0.0",
"lit": "^2.4.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"sass": "^1.43.4", "sass": "^1.43.4",
"sharp": "^0.33.2", "sharp": "^0.33.2",
@ -77,7 +77,7 @@
"stylelint-config-recommended-scss": "^5.0.1", "stylelint-config-recommended-scss": "^5.0.1",
"stylelint-config-standard-scss": "^2.0.1", "stylelint-config-standard-scss": "^2.0.1",
"svgo": "^2.8.0", "svgo": "^2.8.0",
"typescript": "^5.0.0", "typescript": "^4.3.5",
"yaml": "^2.2.1" "yaml": "^2.2.1"
}, },
"engine": { "engine": {