-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store artifact and deploy it as gh-pages
This ensures only the deploy action is granted the write rights.
- Loading branch information
Showing
8 changed files
with
151 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,6 @@ export default tseslint.config( | |
}, | ||
prettierConfig, | ||
{ | ||
ignores: ["lib/*"], | ||
ignores: ["lib/*", "dist/*"], | ||
}, | ||
); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { LitElement, html } from "lit"; | ||
import { customElement, state } from "lit/decorators.js"; | ||
|
||
import "../../structure/ngv-structure-app.js"; | ||
import { INgvStructureApp } from "../../structure/ngv-structure-app.js"; | ||
|
||
// @ts-expect-error ?url parameter is a viteJS specificity | ||
import logoUrl from "../../logo.svg?url"; | ||
|
||
@customElement("ngv-app-buildings") | ||
export class NgvAppBuildings extends LitElement { | ||
@state() | ||
ngvStructureAppConfig: INgvStructureApp; | ||
|
||
constructor() { | ||
super(); | ||
// this.shadowRoot.adoptedStyleSheets.push(styles); | ||
} | ||
|
||
protected firstUpdated(): void { | ||
// simulate retrieving config from an external config file | ||
setTimeout(() => { | ||
this.ngvStructureAppConfig = { | ||
header: { | ||
languages: ["fr", "en", "it", "de"], | ||
logo: logoUrl as string, | ||
title: { | ||
fr: "Ma super app", | ||
en: "My super app", | ||
de: "Meine supper app", | ||
it: "Mia super app", | ||
}, | ||
}, | ||
footer: { | ||
contact: "[email protected]", | ||
impressum: { | ||
fr: "Bla bla FR impressim", | ||
en: "Bla bla EN impressim", | ||
de: "Bla bla DE impressim", | ||
it: "Bla bla IT impressim", | ||
}, | ||
}, | ||
}; | ||
}, 200); | ||
} | ||
|
||
render() { | ||
return html` | ||
<ngv-structure-app .config=${this.ngvStructureAppConfig}> | ||
THIS IS A CRAZY BUILDINGS app | ||
</ngv-structure-app> | ||
`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const ngv = {}; |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { LitElement, html } from "lit"; | ||
import { customElement, property } from "lit/decorators.js"; | ||
|
||
// Fixme: this should be one of the supported language. | ||
// Per application? | ||
type Language = "en" | "it" | "fr" | "de"; | ||
|
||
export interface INgvStructureApp { | ||
header: { | ||
logo: string; | ||
languages: Language[]; | ||
title: Record<Language, string>; | ||
}; | ||
footer: { | ||
impressum: Record<Language, string>; | ||
contact: string; | ||
}; | ||
} | ||
|
||
/** | ||
* This element structures the app using slots. | ||
*/ | ||
@customElement("ngv-structure-app") | ||
export class NgvStructureApp extends LitElement { | ||
@property({ type: Object }) | ||
config: INgvStructureApp; | ||
|
||
constructor() { | ||
super(); | ||
// this.shadowRoot.adoptedStyleSheets.push(styles); | ||
} | ||
|
||
render() { | ||
const { header, footer } = this.config; | ||
return html` | ||
<header> | ||
<img src="${header.logo}" /> | ||
<div> | ||
<label for="language">Lang:</label> | ||
<select name="language" id="language"> | ||
${header.languages.map( | ||
(l) => html`<option value="${l}">${l}</option>`, | ||
)} | ||
</select> | ||
</div> | ||
</header> | ||
<main> | ||
<slot></slot> | ||
</main> | ||
<footer> | ||
<p>${footer.impressum}</p> | ||
</footer> | ||
`; | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"ngv-structure-app": NgvStructureApp; | ||
} | ||
} |