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) {
this._channelDetailsService.saveOptions(this._channelConfiguration.channel.id, this._channelConfiguration.configuration)
.then((value) => {
@ -183,7 +184,7 @@ export class ChannelConfigurationElement extends LivechatElement {
</livechat-help-button>
</h1>
<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-5">
<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">
<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>
${(this._formStatus && this._formStatus.success === undefined) ?
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}"]`)) {
return this;
}

View File

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

130
package-lock.json generated
View File

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

View File

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