diff --git a/ui/demo-pwa/src/alwatr-page-home.ts b/ui/demo-pwa/src/demo-chat.ts
similarity index 64%
rename from ui/demo-pwa/src/alwatr-page-home.ts
rename to ui/demo-pwa/src/demo-chat.ts
index 836015df0..66bda2263 100644
--- a/ui/demo-pwa/src/alwatr-page-home.ts
+++ b/ui/demo-pwa/src/demo-chat.ts
@@ -1,21 +1,20 @@
-import {AlwatrElement, css, html} from '@alwatr/element';
+import {customElement, AlwatrElement, css, html} from '@alwatr/element';
import {l10n} from '@alwatr/i18n';
-import {customElement} from 'lit/decorators.js';
-import '@alwatr/icon';
+import '@alwatr/ui-kit/chat/chat-avatar.js';
import type {TemplateResult} from '@alwatr/element';
declare global {
interface HTMLElementTagNameMap {
- 'page-home': AlwatrDemoHome;
+ 'alwatr-demo-chat': AlwatrDemoHome;
}
}
/**
* Alwatr Demo Home Page
*/
-@customElement('alwatr-page-home')
+@customElement('alwatr-demo-chat')
export class AlwatrDemoHome extends AlwatrElement {
static override styles = [
css`
@@ -39,10 +38,9 @@ export class AlwatrDemoHome extends AlwatrElement {
override render(): TemplateResult {
return html`
-
-
- ${l10n.localize('page_home')}
-
+
+
+
`;
}
diff --git a/ui/demo-pwa/src/alwatr-pwa.ts b/ui/demo-pwa/src/pwa-root.ts
similarity index 74%
rename from ui/demo-pwa/src/alwatr-pwa.ts
rename to ui/demo-pwa/src/pwa-root.ts
index ea760dba2..782c5c4cd 100644
--- a/ui/demo-pwa/src/alwatr-pwa.ts
+++ b/ui/demo-pwa/src/pwa-root.ts
@@ -1,24 +1,24 @@
-import {AlwatrElement, css, html} from '@alwatr/element';
+import {AlwatrElement, css, html, cache} from '@alwatr/element';
import {l10n} from '@alwatr/i18n';
import {router} from '@alwatr/router';
import {customElement} from 'lit/decorators.js';
-import './alwatr-page-home.js';
+import './demo-chat.js';
import type {TemplateResult} from '@alwatr/element';
import type {RoutesConfig} from '@alwatr/router';
declare global {
interface HTMLElementTagNameMap {
- 'alwatr-pwa': AlwatrPWA;
+ 'alwatr-pwa-root': AlwatrPwaRoot;
}
}
/**
* Alwatr PWA Root Element
*/
-@customElement('alwatr-pwa')
-export class AlwatrPWA extends AlwatrElement {
+@customElement('alwatr-pwa-root')
+export class AlwatrPwaRoot extends AlwatrElement {
static override styles = [
css`
:host {
@@ -54,12 +54,12 @@ export class AlwatrPWA extends AlwatrElement {
map: (route) => route.sectionList[0]?.toString(),
list: {
home: {
- render: () => html`
`,
+ render: () => html`
`,
},
},
};
override render(): TemplateResult {
- return html`
${router.outlet(this._routes)}`;
+ return html`
${cache(router.outlet(this._routes))}`;
}
}
diff --git a/ui/demo-pwa/tsconfig.json b/ui/demo-pwa/tsconfig.json
index 7be50f5de..c7a786ead 100644
--- a/ui/demo-pwa/tsconfig.json
+++ b/ui/demo-pwa/tsconfig.json
@@ -16,10 +16,11 @@
"include": ["src/**/*.ts"],
"exclude": [],
"references": [
- {"path": "../../ui/element"},
- {"path": "../../ui/icon"},
- {"path": "../../core/i18n"},
{"path": "../../core/logger"},
{"path": "../../core/router"},
+ {"path": "../../core/i18n"},
+ {"path": "../../ui/element"},
+ {"path": "../../ui/icon"},
+ {"path": "../../ui/ui-kit"},
]
}
diff --git a/ui/element/src/element.ts b/ui/element/src/element.ts
index bcac628a0..102efbaa0 100644
--- a/ui/element/src/element.ts
+++ b/ui/element/src/element.ts
@@ -14,6 +14,7 @@ export {when} from 'lit/directives/when.js';
export {repeat} from 'lit/directives/repeat.js';
export {ifDefined} from 'lit/directives/if-defined.js';
export {unsafeSVG} from 'lit/directives/unsafe-svg.js';
+export {cache} from 'lit/directives/cache.js';
alwatrRegisteredList.push({
name: '@alwatr/element',