diff --git a/.eslintrc.json b/.eslintrc.json index 80e2c496..295962a4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -51,6 +51,7 @@ } } ], + "lit/attribute-value-entities": "off", "@typescript-eslint/prefer-string-starts-ends-with": "off", "@typescript-eslint/no-dynamic-delete": "off", "@typescript-eslint/no-non-null-assertion": "off", diff --git a/demo/font/index.html b/demo/font/index.html index 8dd192e8..ce6ff3ce 100644 --- a/demo/font/index.html +++ b/demo/font/index.html @@ -1,4 +1,4 @@ - +
diff --git a/demo/font/simple.html b/demo/font/simple.html index 7e37cf28..9e6c73c5 100644 --- a/demo/font/simple.html +++ b/demo/font/simple.html @@ -1,4 +1,4 @@ - + diff --git a/demo/i18n/i18n.ts b/demo/i18n/i18n.ts index 6ba0e51d..19c227c2 100644 --- a/demo/i18n/i18n.ts +++ b/demo/i18n/i18n.ts @@ -17,11 +17,14 @@ l10n.setResourceLoader((locale) => { code: locale.language === 'fa' ? 'fa-IR' : 'en-US', rev: 2, }, - data: locale.language === 'fa' ? { - 'hi': 'سلام', - } : { - 'hi': 'hello', - }, + data: + locale.language === 'fa' + ? { + hi: 'سلام', + } + : { + hi: 'hello', + }, }; }); diff --git a/demo/icon/index.html b/demo/icon/index.html index 36ece63b..b3b888b7 100644 --- a/demo/icon/index.html +++ b/demo/icon/index.html @@ -18,7 +18,9 @@ alwatr-icon { font-size: 2em; - transition: font-size 0.5s, color 0.5s; + transition: + font-size 0.5s, + color 0.5s; margin: 0.3em; } alwatr-icon:hover { diff --git a/demo/tsconfig.json b/demo/tsconfig.json index c6dc88aa..a9789718 100644 --- a/demo/tsconfig.json +++ b/demo/tsconfig.json @@ -9,9 +9,5 @@ "include": ["**/*.ts"], "exclude": ["*.d.ts", "node_modules"], - "references": [ - {"path": "../packages/router"}, - {"path": "../packages/icon"}, - {"path": "../packages/i18n"} - ] + "references": [{"path": "../packages/router"}, {"path": "../packages/icon"}, {"path": "../packages/i18n"}] } diff --git a/index.html b/index.html index bd5cf0f4..aeacc29d 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + diff --git a/packages/demo-pwa/esbuild.mjs b/packages/demo-pwa/esbuild.mjs index bf50f1ec..f2e4a756 100755 --- a/packages/demo-pwa/esbuild.mjs +++ b/packages/demo-pwa/esbuild.mjs @@ -84,12 +84,7 @@ const esbuildContext = await esbuild.context({ plugins: [ postCssPlugin({ - plugins: [ - postcssImport, - postcssNesting, - postcssTailwind, - postcssPresetEnv, - ], + plugins: [postcssImport, postcssNesting, postcssTailwind, postcssPresetEnv], }), ], @@ -111,12 +106,12 @@ async function makeHtml() { const outFiles = Object.keys(metafile.outputs); const jsFilename = outFiles - .find((filename) => filename.includes(srcFilename) && filename.endsWith('.js')) - .substring(outDir.length + 1); + .find((filename) => filename.includes(srcFilename) && filename.endsWith('.js')) + .substring(outDir.length + 1); const cssFilename = outFiles - .find((filename) => filename.includes(srcFilename) && filename.endsWith('.css')) - .substring(outDir.length + 1); + .find((filename) => filename.includes(srcFilename) && filename.endsWith('.css')) + .substring(outDir.length + 1); logger.logProperty?.('jsFilename', jsFilename); logger.logProperty?.('cssFilename', cssFilename); @@ -131,9 +126,7 @@ async function makeHtml() { throw new Error('css_filename_not_found'); } - htmlContent = htmlContent - .replaceAll(`${srcFilename}.css`, cssFilename) - .replaceAll(`${srcFilename}.js`, jsFilename); + htmlContent = htmlContent.replaceAll(`${srcFilename}.css`, cssFilename).replaceAll(`${srcFilename}.js`, jsFilename); await copyPromise; // wait to cp done await fs.writeFile(`${outDir}/index.html`, htmlContent, {encoding: 'utf-8', flag: 'w'}); @@ -147,9 +140,7 @@ async function buildServiceWorker() { globDirectory: `${outDir}/`, clientsClaim: true, skipWaiting: true, - globPatterns: [ - '**/*.{js,css,json,png,svg,ico,webp,woff2,html}', - ], + globPatterns: ['**/*.{js,css,json,png,svg,ico,webp,woff2,html}'], }); logger.logOther?.('serviceWorkerPath', build); @@ -157,12 +148,10 @@ async function buildServiceWorker() { if (watchMode) { esbuildContext.watch(); -} -else { +} else { await makeHtml(); esbuildContext.dispose(); - if (debugMode) { console.log(await esbuild.analyzeMetafile((await esBuildPromise).metafile)); } diff --git a/packages/demo-pwa/res/service-worker.js b/packages/demo-pwa/res/service-worker.js index 64a5d005..a1c4dcc0 100644 --- a/packages/demo-pwa/res/service-worker.js +++ b/packages/demo-pwa/res/service-worker.js @@ -1 +1 @@ -console.log('Service worker not build in development mode.') +console.log('Service worker not build in development mode.'); diff --git a/packages/demo-pwa/src/share/app-navigation-context.ts b/packages/demo-pwa/src/share/app-navigation-context.ts index ccb42d67..2c24355c 100644 --- a/packages/demo-pwa/src/share/app-navigation-context.ts +++ b/packages/demo-pwa/src/share/app-navigation-context.ts @@ -52,6 +52,24 @@ appNavigationContext.setValue({ topAppBarContext.setValue({ title: 'الوتر دمو', - startIcon: {svg: icons.person, onClick: () => {console.log('`startIcon` clicked');}}, - endIconList: [{svg: icons.refresh, onClick: () => {console.log('`refreshIcon` clicked');}}, {svg: icons.home, onClick: () => {console.log('`homeIcon` clicked');}}], + startIcon: { + svg: icons.person, + onClick: () => { + console.log('`startIcon` clicked'); + }, + }, + endIconList: [ + { + svg: icons.refresh, + onClick: () => { + console.log('`refreshIcon` clicked'); + }, + }, + { + svg: icons.home, + onClick: () => { + console.log('`homeIcon` clicked'); + }, + }, + ], }); diff --git a/packages/demo-pwa/src/ui/alwatr-pwa.ts b/packages/demo-pwa/src/ui/alwatr-pwa.ts index 2dd30e5e..dd5f45de 100644 --- a/packages/demo-pwa/src/ui/alwatr-pwa.ts +++ b/packages/demo-pwa/src/ui/alwatr-pwa.ts @@ -14,13 +14,12 @@ export type PageName = 'home' | 'favorites' | 'contact' | 'other' | '_404'; appLogger.logModule?.('alwatr-pwa'); - export class AlwatrPwaDirective extends AlwatrDynamicDirective { constructor(partInfo: PartInfo) { super(partInfo, '