From bc2cc7f88f868104625b0110d1c37acc95b1c56c Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 26 Oct 2022 20:45:10 +0300 Subject: [PATCH 001/117] docs(esl-share): create esl-share example page --- pages/static/assets/examples/share.svg | 10 ++++++++++ pages/views/examples/share.njk | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 pages/static/assets/examples/share.svg create mode 100644 pages/views/examples/share.njk diff --git a/pages/static/assets/examples/share.svg b/pages/static/assets/examples/share.svg new file mode 100644 index 000000000..277e15c9a --- /dev/null +++ b/pages/static/assets/examples/share.svg @@ -0,0 +1,10 @@ + + + + + diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk new file mode 100644 index 000000000..9ea8c6d3c --- /dev/null +++ b/pages/views/examples/share.njk @@ -0,0 +1,19 @@ +--- +layout: content +title: Share +name: Share +tags: [examples, beta] +icon: examples/share.svg +aside: + components: + - esl-share +--- +{% import 'lorem.njk' as lorem %} + +
+

Share example

+ +
+ +
+
From 741fbee580dedadc4beb855e31c21af15263effd Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 28 Oct 2022 12:19:43 +0300 Subject: [PATCH 002/117] docs(esl-share): create README --- src/modules/esl-share/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/modules/esl-share/README.md diff --git a/src/modules/esl-share/README.md b/src/modules/esl-share/README.md new file mode 100644 index 000000000..0d4d3ef44 --- /dev/null +++ b/src/modules/esl-share/README.md @@ -0,0 +1,17 @@ +# [ESL](../../../) Share + +Version: *1.0.0-beta*. + +Authors: *Dmytro Shovchko*. + +***Important Notice: the component is under beta version, it is tested and ready to use but be aware of its potential critical API changes.*** + + + +The ESL Share component allows the user to share the page on social media platforms. + +**ESLShareIcon** is a custom element that is used to show social media icons. + +**ESLSharePopup** is a custom element that is used to show the popup GUI element containing social media icons. + +**ESLShareTrigger** is a custom element that is used to show/hide popups with share icons. From 6213f369f903b72932aa49850d1f3aa45977de7c Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 28 Oct 2022 17:43:19 +0300 Subject: [PATCH 003/117] feat(esl-share): create esl-share-icon component --- src/modules/esl-share/core.less | 1 + src/modules/esl-share/core.ts | 1 + .../esl-share/core/esl-share-icon.less | 22 +++++++++++++++++++ src/modules/esl-share/core/esl-share-icon.ts | 13 +++++++++++ 4 files changed, 37 insertions(+) create mode 100644 src/modules/esl-share/core.less create mode 100644 src/modules/esl-share/core.ts create mode 100644 src/modules/esl-share/core/esl-share-icon.less create mode 100644 src/modules/esl-share/core/esl-share-icon.ts diff --git a/src/modules/esl-share/core.less b/src/modules/esl-share/core.less new file mode 100644 index 000000000..1f1ed89ce --- /dev/null +++ b/src/modules/esl-share/core.less @@ -0,0 +1 @@ +@import "./core/esl-share-icon.less"; diff --git a/src/modules/esl-share/core.ts b/src/modules/esl-share/core.ts new file mode 100644 index 000000000..743cefbf0 --- /dev/null +++ b/src/modules/esl-share/core.ts @@ -0,0 +1 @@ +export * from './core/esl-share-icon'; diff --git a/src/modules/esl-share/core/esl-share-icon.less b/src/modules/esl-share/core/esl-share-icon.less new file mode 100644 index 000000000..a32008cc0 --- /dev/null +++ b/src/modules/esl-share/core/esl-share-icon.less @@ -0,0 +1,22 @@ +esl-share-icon { + display: inline-block; + width: 20px; + height: 20px; + cursor: pointer; + + &:hover { + opacity: .6; + } + + .esl-share-icon-wrapper { + display: inline-block; + overflow: hidden; + background-color: #0097e7; // TODO: consider creating common variables.less file + width: 100%; + height: 100%; + } + + path, circle { + fill: #fff; + } +} diff --git a/src/modules/esl-share/core/esl-share-icon.ts b/src/modules/esl-share/core/esl-share-icon.ts new file mode 100644 index 000000000..c1b2a1fc0 --- /dev/null +++ b/src/modules/esl-share/core/esl-share-icon.ts @@ -0,0 +1,13 @@ +import {ESLBaseElement} from '../../esl-base-element/core'; +import {attr} from '../../esl-utils/decorators'; + +export class ESLShareIcon extends ESLBaseElement { + public static is = 'esl-share-icon'; + + public static DEFAULT_ICON_BG_COLOR = '#FFF'; + + @attr() public netId: string; + @attr() public name: string; + @attr() public icon: string; + @attr() public link: string; +} From 0ff835a80fe6ead84855409405bfe2a4e8b55801 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 28 Oct 2022 17:47:00 +0300 Subject: [PATCH 004/117] feat(esl-share): update all.ts and all.less files --- src/modules/all.less | 2 ++ src/modules/all.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/modules/all.less b/src/modules/all.less index 3e592ab87..05fab970e 100644 --- a/src/modules/all.less +++ b/src/modules/all.less @@ -23,3 +23,5 @@ @import "./esl-tooltip/core.less"; @import "./esl-animate/core.less"; + +@import "./esl-share/core.less"; diff --git a/src/modules/all.ts b/src/modules/all.ts index 5f1f668e0..b4d6ff356 100644 --- a/src/modules/all.ts +++ b/src/modules/all.ts @@ -39,3 +39,6 @@ export * from './esl-tooltip/core'; // Animate export * from './esl-animate/core'; + +// Share +export * from './esl-share/core'; From 9e0fb79415ea936dcd7e5221dfe58b8e261301ef Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 28 Oct 2022 18:17:20 +0300 Subject: [PATCH 005/117] feat(esl-share): create esl-share-trigger component --- pages/src/localdev.ts | 7 ++++++- src/modules/esl-share/core.less | 1 + src/modules/esl-share/core.ts | 1 + src/modules/esl-share/core/esl-share-trigger.less | 4 ++++ src/modules/esl-share/core/esl-share-trigger.ts | 11 +++++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/modules/esl-share/core/esl-share-trigger.less create mode 100644 src/modules/esl-share/core/esl-share-trigger.ts diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index 4d9c6e700..d4911240d 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -31,7 +31,9 @@ import { ESLNote, ESLFootnotes, ESLTooltip, - ESLAnimate + ESLAnimate, + ESLShareIcon, + ESLShareTrigger } from '../../src/modules/all'; import '../../src/modules/esl-media/providers/iframe-provider'; @@ -104,3 +106,6 @@ ESLCarouselPlugins.Dots.register(); ESLCarouselPlugins.Link.register(); ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); + +ESLShareIcon.register(); +ESLShareTrigger.register(); diff --git a/src/modules/esl-share/core.less b/src/modules/esl-share/core.less index 1f1ed89ce..eb8235183 100644 --- a/src/modules/esl-share/core.less +++ b/src/modules/esl-share/core.less @@ -1 +1,2 @@ @import "./core/esl-share-icon.less"; +@import "./core/esl-share-trigger.less"; diff --git a/src/modules/esl-share/core.ts b/src/modules/esl-share/core.ts index 743cefbf0..18e0e85d1 100644 --- a/src/modules/esl-share/core.ts +++ b/src/modules/esl-share/core.ts @@ -1 +1,2 @@ export * from './core/esl-share-icon'; +export * from './core/esl-share-trigger'; diff --git a/src/modules/esl-share/core/esl-share-trigger.less b/src/modules/esl-share/core/esl-share-trigger.less new file mode 100644 index 000000000..e7e0a6e68 --- /dev/null +++ b/src/modules/esl-share/core/esl-share-trigger.less @@ -0,0 +1,4 @@ +esl-share-trigger { + display: inline-block; + cursor: pointer; +} diff --git a/src/modules/esl-share/core/esl-share-trigger.ts b/src/modules/esl-share/core/esl-share-trigger.ts new file mode 100644 index 000000000..ea0808584 --- /dev/null +++ b/src/modules/esl-share/core/esl-share-trigger.ts @@ -0,0 +1,11 @@ +import {ESLTrigger} from '../../esl-trigger/core'; +import {attr} from '../../esl-utils/decorators'; + +export class ESLShareTrigger extends ESLTrigger { + public static is = 'esl-share-trigger'; + + @attr({defaultValue: 'toggle'}) public mode: string; + @attr({defaultValue: 'all'}) public trackClick: string; + @attr({defaultValue: 'all'}) public trackHover: string; + +} From 3e0a2b0993ac634a015fba6ac3a3b77f6c7017e1 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 28 Oct 2022 19:31:08 +0300 Subject: [PATCH 006/117] feat(esl-share): create esl-share component --- pages/src/localdev.ts | 6 ++---- src/modules/esl-share/core.ts | 1 + src/modules/esl-share/core/esl-share.ts | 28 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 src/modules/esl-share/core/esl-share.ts diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index d4911240d..dc82e777b 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -32,8 +32,7 @@ import { ESLFootnotes, ESLTooltip, ESLAnimate, - ESLShareIcon, - ESLShareTrigger + ESLShare } from '../../src/modules/all'; import '../../src/modules/esl-media/providers/iframe-provider'; @@ -107,5 +106,4 @@ ESLCarouselPlugins.Link.register(); ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); -ESLShareIcon.register(); -ESLShareTrigger.register(); +ESLShare.register(); diff --git a/src/modules/esl-share/core.ts b/src/modules/esl-share/core.ts index 18e0e85d1..b3df222d6 100644 --- a/src/modules/esl-share/core.ts +++ b/src/modules/esl-share/core.ts @@ -1,2 +1,3 @@ +export * from './core/esl-share'; export * from './core/esl-share-icon'; export * from './core/esl-share-trigger'; diff --git a/src/modules/esl-share/core/esl-share.ts b/src/modules/esl-share/core/esl-share.ts new file mode 100644 index 000000000..be4d0a5d4 --- /dev/null +++ b/src/modules/esl-share/core/esl-share.ts @@ -0,0 +1,28 @@ +import {ESLBaseElement, attr, boolAttr} from '../../esl-base-element/core'; + +import {ESLShareIcon} from './esl-share-icon'; +import {ESLShareTrigger} from './esl-share-trigger'; + +export class ESLShare extends ESLBaseElement { + public static is = 'esl-share'; + + public static register(): void { + ESLShareIcon.register(); + ESLShareTrigger.register(); + super.register(); + } + + @attr({defaultValue: 'popup', readonly: true}) public layout: string; + // @attr({dataAttr: true, defaultValue: 'general'}) public realm: string; + @attr({readonly: true}) public limit: string; + @attr({readonly: true}) public preferable: string; + @attr({dataAttr: true}) public url: string; + @attr({dataAttr: true}) public title: string; + @attr({dataAttr: true}) public screenReaderTitle: string; + @attr({defaultValue: ''}) public activeClass: string; + @attr({defaultValue: ''}) public activeClassTarget: string; + + @boolAttr({readonly: true}) public ready: boolean; + + protected _ready: Promise; +} From 1e851d00458242645bceef076e131f00c198669f Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 11 Nov 2022 19:23:47 +0200 Subject: [PATCH 007/117] feat(esl-share): create esl-share-button initial implementation --- .../esl-share/core/esl-share-button.less | 22 ++++++ .../esl-share/core/esl-share-button.ts | 68 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 src/modules/esl-share/core/esl-share-button.less create mode 100644 src/modules/esl-share/core/esl-share-button.ts diff --git a/src/modules/esl-share/core/esl-share-button.less b/src/modules/esl-share/core/esl-share-button.less new file mode 100644 index 000000000..226ed323c --- /dev/null +++ b/src/modules/esl-share/core/esl-share-button.less @@ -0,0 +1,22 @@ +esl-share-button { + display: inline-block; + width: 20px; + height: 20px; + cursor: pointer; + + &:hover { + opacity: .6; + } + + .esl-share-icon { + display: inline-block; + overflow: hidden; + background-color: #0097e7; // TODO: consider creating common variables.less file + width: 100%; + height: 100%; + } + + path, circle { + fill: #fff; + } +} diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts new file mode 100644 index 000000000..ea8da9393 --- /dev/null +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -0,0 +1,68 @@ +import {ESLBaseElement} from '../../esl-base-element/core'; +import {attr, listen} from '../../esl-utils/decorators'; +import {ENTER, SPACE} from '../../esl-utils/dom/keys'; +import {ESLShareActionRegistry} from './esl-share-action-registry'; + +export interface ShareButtonConfig { + 'action': string; + 'id': string; + 'icon': string; + 'iconBackground': string; + 'link': string; + 'name': string; + 'name_en': string; +} + +export class ESLShareButton extends ESLBaseElement { + public static is = 'esl-share-button'; + + public static DEFAULT_ICON_BG_COLOR: string = '#FFF'; + + @attr() public action: string; + @attr() public netId: string; + @attr() public name: string; + @attr() public icon: string; + @attr() public link: string; + + public static build(cfg: ShareButtonConfig): ESLShareButton | null { + if (!ESLShareActionRegistry.instance.has(cfg.action)) return null; + const $button = ESLShareButton.create(); + $button.$$attr('action', cfg.action); + $button.$$attr('net-id', cfg.id); + $button.$$attr('link', cfg.link); + $button.$$attr('name', cfg['name_en']); + $button.$$attr('tabIndex', '0'); + $button.$$attr('role', 'button'); + $button.$$attr('aria-label', cfg.name); + const wrapper = document.createElement('span'); + wrapper.title = cfg.name; + wrapper.classList.add('esl-share-button-icon'); + wrapper.innerHTML = cfg.icon; + wrapper.setAttribute('style', `background-color:${cfg.iconBackground || ESLShareButton.DEFAULT_ICON_BG_COLOR};`); + $button.appendChild(wrapper); + return $button; + } + + protected beforeAction(): void {} + + protected doAction(): void { + this.beforeAction(); + ESLShareActionRegistry.instance.doAction(this); + this.afterAction(); + } + + protected afterAction(): void {} + + @listen('click') + protected onClick(e: MouseEvent): void { + this.doAction(); + } + + @listen('keydown') + protected onKeydown(e: KeyboardEvent): void { + if ([ENTER, SPACE].includes(e.key)) { + this.click(); + e.preventDefault(); + } + } +} From 84113439a25d87b54f14f2a6d1bde87f8f47c17c Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 11 Nov 2022 19:24:43 +0200 Subject: [PATCH 008/117] feat(esl-share): create abstract base action class --- src/modules/esl-share/core/esl-share-action.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/modules/esl-share/core/esl-share-action.ts diff --git a/src/modules/esl-share/core/esl-share-action.ts b/src/modules/esl-share/core/esl-share-action.ts new file mode 100644 index 000000000..b601b950e --- /dev/null +++ b/src/modules/esl-share/core/esl-share-action.ts @@ -0,0 +1,11 @@ +import type {ESLShareButton} from './esl-share-button'; + +export type ActionType = (new($button: ESLShareButton) => ESLShareBaseAction) & typeof ESLShareBaseAction; + +export abstract class ESLShareBaseAction { + static readonly is: string; + + public constructor(protected $button: ESLShareButton) {} + + public abstract do(): void; +} From d17611766493d9a6cb01fd258ca0f531dcfb1830 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:10:23 +0000 Subject: [PATCH 009/117] chore(deps-dev): bump @typescript-eslint/parser from 5.40.1 to 5.41.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.40.1 to 5.41.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.41.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 143 +++++++++++++++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 131 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index f301cbfef..6a7ea7ad7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@types/jest": "^29.2.0", "@types/smoothscroll-polyfill": "^0.3.1", "@typescript-eslint/eslint-plugin": "^5.40.1", - "@typescript-eslint/parser": "^5.40.1", + "@typescript-eslint/parser": "^5.41.0", "@webcomponents/custom-elements": "1.5.1", "browser-sync": "^2.27.10", "chokidar-cli": "^3.0.0", @@ -2499,14 +2499,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.40.1.tgz", - "integrity": "sha512-IK6x55va5w4YvXd4b3VrXQPldV9vQTxi5ov+g4pMANsXPTXOcfjx08CRR1Dfrcc51syPtXHF5bgLlMHYFrvQtg==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.41.0.tgz", + "integrity": "sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.40.1", - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/typescript-estree": "5.40.1", + "@typescript-eslint/scope-manager": "5.41.0", + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/typescript-estree": "5.41.0", "debug": "^4.3.4" }, "engines": { @@ -2525,6 +2525,80 @@ } } }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", + "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/visitor-keys": "5.41.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", + "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", + "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/visitor-keys": "5.41.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", + "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.41.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/scope-manager": { "version": "5.40.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.40.1.tgz", @@ -19352,15 +19426,58 @@ } }, "@typescript-eslint/parser": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.40.1.tgz", - "integrity": "sha512-IK6x55va5w4YvXd4b3VrXQPldV9vQTxi5ov+g4pMANsXPTXOcfjx08CRR1Dfrcc51syPtXHF5bgLlMHYFrvQtg==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.41.0.tgz", + "integrity": "sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.40.1", - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/typescript-estree": "5.40.1", + "@typescript-eslint/scope-manager": "5.41.0", + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/typescript-estree": "5.41.0", "debug": "^4.3.4" + }, + "dependencies": { + "@typescript-eslint/scope-manager": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", + "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/visitor-keys": "5.41.0" + } + }, + "@typescript-eslint/types": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", + "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", + "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/visitor-keys": "5.41.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", + "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.41.0", + "eslint-visitor-keys": "^3.3.0" + } + } } }, "@typescript-eslint/scope-manager": { diff --git a/package.json b/package.json index 45cdfce46..5a2b932bb 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "@types/jest": "^29.2.0", "@types/smoothscroll-polyfill": "^0.3.1", "@typescript-eslint/eslint-plugin": "^5.40.1", - "@typescript-eslint/parser": "^5.40.1", + "@typescript-eslint/parser": "^5.41.0", "@webcomponents/custom-elements": "1.5.1", "browser-sync": "^2.27.10", "chokidar-cli": "^3.0.0", From 6620a7c653e23bfa3159f7febdcfd049918dccd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Oct 2022 00:50:12 +0000 Subject: [PATCH 010/117] chore(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.40.1 to 5.41.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.41.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 259 +++++++++++++--------------------------------- package.json | 2 +- 2 files changed, 72 insertions(+), 189 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6a7ea7ad7..894943079 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "@semantic-release/release-notes-generator": "^10.0.3", "@types/jest": "^29.2.0", "@types/smoothscroll-polyfill": "^0.3.1", - "@typescript-eslint/eslint-plugin": "^5.40.1", + "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", "@webcomponents/custom-elements": "1.5.1", "browser-sync": "^2.27.10", @@ -2418,9 +2418,9 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.3.12", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.12.tgz", - "integrity": "sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==", + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, "node_modules/@types/smoothscroll-polyfill": { @@ -2467,14 +2467,14 @@ "integrity": "sha512-uwqm0DUeg+2pff/8y9b22JJb+qWKOcG5aCn2yyT7hmLdK/M8+VECcK6QuNqdAR93IAqTmZeqK2nizTlQg5j+XA==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.40.1.tgz", - "integrity": "sha512-FsWboKkWdytGiXT5O1/R9j37YgcjO8MKHSUmWnIEjVaz0krHkplPnYi7mwdb+5+cs0toFNQb0HIrN7zONdIEWg==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.41.0.tgz", + "integrity": "sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.40.1", - "@typescript-eslint/type-utils": "5.40.1", - "@typescript-eslint/utils": "5.40.1", + "@typescript-eslint/scope-manager": "5.41.0", + "@typescript-eslint/type-utils": "5.41.0", + "@typescript-eslint/utils": "5.41.0", "debug": "^4.3.4", "ignore": "^5.2.0", "regexpp": "^3.2.0", @@ -2525,7 +2525,7 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "node_modules/@typescript-eslint/scope-manager": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", @@ -2542,88 +2542,14 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", - "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", - "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/visitor-keys": "5.41.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", - "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.41.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.40.1.tgz", - "integrity": "sha512-jkn4xsJiUQucI16OLCXrLRXDZ3afKhOIqXs4R3O+M00hdQLKR58WuyXPZZjhKLFCEP2g+TXdBRtLQ33UfAdRUg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/visitor-keys": "5.40.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.40.1.tgz", - "integrity": "sha512-DLAs+AHQOe6n5LRraXiv27IYPhleF0ldEmx6yBqBgBLaNRKTkffhV1RPsjoJBhVup2zHxfaRtan8/YRBgYhU9Q==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.41.0.tgz", + "integrity": "sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.40.1", - "@typescript-eslint/utils": "5.40.1", + "@typescript-eslint/typescript-estree": "5.41.0", + "@typescript-eslint/utils": "5.41.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -2644,9 +2570,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.40.1.tgz", - "integrity": "sha512-Icg9kiuVJSwdzSQvtdGspOlWNjVDnF3qVIKXdJ103o36yRprdl3Ge5cABQx+csx960nuMF21v8qvO31v9t3OHw==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", + "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2657,13 +2583,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.40.1.tgz", - "integrity": "sha512-5QTP/nW5+60jBcEPfXy/EZL01qrl9GZtbgDZtDPlfW5zj/zjNrdI2B5zMUHmOsfvOr2cWqwVdWjobCiHcedmQA==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", + "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/visitor-keys": "5.40.1", + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/visitor-keys": "5.41.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2684,16 +2610,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.40.1.tgz", - "integrity": "sha512-a2TAVScoX9fjryNrW6BZRnreDUszxqm9eQ9Esv8n5nXApMW0zeANUYlwh/DED04SC/ifuBvXgZpIK5xeJHQ3aw==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.41.0.tgz", + "integrity": "sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.40.1", - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/typescript-estree": "5.40.1", + "@typescript-eslint/scope-manager": "5.41.0", + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/typescript-estree": "5.41.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -2710,12 +2636,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.40.1.tgz", - "integrity": "sha512-A2DGmeZ+FMja0geX5rww+DpvILpwo1OsiQs0M+joPWJYsiEFBLsH0y1oFymPNul6Z5okSmHpP4ivkc2N0Cgfkw==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", + "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.40.1", + "@typescript-eslint/types": "5.41.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -19361,9 +19287,9 @@ "dev": true }, "@types/semver": { - "version": "7.3.12", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.12.tgz", - "integrity": "sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==", + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, "@types/smoothscroll-polyfill": { @@ -19410,14 +19336,14 @@ "integrity": "sha512-uwqm0DUeg+2pff/8y9b22JJb+qWKOcG5aCn2yyT7hmLdK/M8+VECcK6QuNqdAR93IAqTmZeqK2nizTlQg5j+XA==" }, "@typescript-eslint/eslint-plugin": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.40.1.tgz", - "integrity": "sha512-FsWboKkWdytGiXT5O1/R9j37YgcjO8MKHSUmWnIEjVaz0krHkplPnYi7mwdb+5+cs0toFNQb0HIrN7zONdIEWg==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.41.0.tgz", + "integrity": "sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.40.1", - "@typescript-eslint/type-utils": "5.40.1", - "@typescript-eslint/utils": "5.40.1", + "@typescript-eslint/scope-manager": "5.41.0", + "@typescript-eslint/type-utils": "5.41.0", + "@typescript-eslint/utils": "5.41.0", "debug": "^4.3.4", "ignore": "^5.2.0", "regexpp": "^3.2.0", @@ -19435,87 +19361,44 @@ "@typescript-eslint/types": "5.41.0", "@typescript-eslint/typescript-estree": "5.41.0", "debug": "^4.3.4" - }, - "dependencies": { - "@typescript-eslint/scope-manager": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", - "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/visitor-keys": "5.41.0" - } - }, - "@typescript-eslint/types": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", - "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", - "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/visitor-keys": "5.41.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", - "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.41.0", - "eslint-visitor-keys": "^3.3.0" - } - } } }, "@typescript-eslint/scope-manager": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.40.1.tgz", - "integrity": "sha512-jkn4xsJiUQucI16OLCXrLRXDZ3afKhOIqXs4R3O+M00hdQLKR58WuyXPZZjhKLFCEP2g+TXdBRtLQ33UfAdRUg==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", + "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/visitor-keys": "5.40.1" + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/visitor-keys": "5.41.0" } }, "@typescript-eslint/type-utils": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.40.1.tgz", - "integrity": "sha512-DLAs+AHQOe6n5LRraXiv27IYPhleF0ldEmx6yBqBgBLaNRKTkffhV1RPsjoJBhVup2zHxfaRtan8/YRBgYhU9Q==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.41.0.tgz", + "integrity": "sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.40.1", - "@typescript-eslint/utils": "5.40.1", + "@typescript-eslint/typescript-estree": "5.41.0", + "@typescript-eslint/utils": "5.41.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.40.1.tgz", - "integrity": "sha512-Icg9kiuVJSwdzSQvtdGspOlWNjVDnF3qVIKXdJ103o36yRprdl3Ge5cABQx+csx960nuMF21v8qvO31v9t3OHw==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", + "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.40.1.tgz", - "integrity": "sha512-5QTP/nW5+60jBcEPfXy/EZL01qrl9GZtbgDZtDPlfW5zj/zjNrdI2B5zMUHmOsfvOr2cWqwVdWjobCiHcedmQA==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", + "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/visitor-keys": "5.40.1", + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/visitor-keys": "5.41.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -19524,28 +19407,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.40.1.tgz", - "integrity": "sha512-a2TAVScoX9fjryNrW6BZRnreDUszxqm9eQ9Esv8n5nXApMW0zeANUYlwh/DED04SC/ifuBvXgZpIK5xeJHQ3aw==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.41.0.tgz", + "integrity": "sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.40.1", - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/typescript-estree": "5.40.1", + "@typescript-eslint/scope-manager": "5.41.0", + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/typescript-estree": "5.41.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.40.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.40.1.tgz", - "integrity": "sha512-A2DGmeZ+FMja0geX5rww+DpvILpwo1OsiQs0M+joPWJYsiEFBLsH0y1oFymPNul6Z5okSmHpP4ivkc2N0Cgfkw==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", + "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.40.1", + "@typescript-eslint/types": "5.41.0", "eslint-visitor-keys": "^3.3.0" } }, diff --git a/package.json b/package.json index 5a2b932bb..c53d5d68f 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@semantic-release/release-notes-generator": "^10.0.3", "@types/jest": "^29.2.0", "@types/smoothscroll-polyfill": "^0.3.1", - "@typescript-eslint/eslint-plugin": "^5.40.1", + "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", "@webcomponents/custom-elements": "1.5.1", "browser-sync": "^2.27.10", From ab4469d72e763ebaecaeb15aea30543925be8edf Mon Sep 17 00:00:00 2001 From: Natalie Smirnova <55104823+Natalie-Smirnova@users.noreply.github.com> Date: Thu, 27 Oct 2022 13:31:03 +0200 Subject: [PATCH 011/117] chore(gh-pages): fix logo svg to prevent artifacts on iOS devices (#1313) --- pages/static/assets/logo-pretty.svg | 124 ++++++++++++++-------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/pages/static/assets/logo-pretty.svg b/pages/static/assets/logo-pretty.svg index 4137f30bd..1a726725a 100644 --- a/pages/static/assets/logo-pretty.svg +++ b/pages/static/assets/logo-pretty.svg @@ -1,6 +1,6 @@ From d72bcd8acd337cf15afba6e3c5fbb312168497eb Mon Sep 17 00:00:00 2001 From: "ala'n (Alexey Stsefanovich)" Date: Tue, 1 Nov 2022 15:56:40 +0100 Subject: [PATCH 012/117] chore(gh-pages): add 11ty generator marker metatag --- pages/views/_layouts/base.njk | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/views/_layouts/base.njk b/pages/views/_layouts/base.njk index e0d58557d..4313ea42e 100644 --- a/pages/views/_layouts/base.njk +++ b/pages/views/_layouts/base.njk @@ -5,6 +5,7 @@ {# Site meta information #} + {% if description %} From b8309002becf00c4f2b87538009584880eb90bfa Mon Sep 17 00:00:00 2001 From: "ala'n (Alexey Stsefanovich)" Date: Tue, 1 Nov 2022 15:57:21 +0100 Subject: [PATCH 013/117] chore(gh-pages): add robots="noindex" meta tag for forward template --- pages/views/_layouts/forward.njk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/views/_layouts/forward.njk b/pages/views/_layouts/forward.njk index f398a2fef..646aa79d4 100644 --- a/pages/views/_layouts/forward.njk +++ b/pages/views/_layouts/forward.njk @@ -4,8 +4,9 @@ {% set title = 'Redirecting...' %} {% block meta %} - - + + + {% endblock meta %} {% block content %} {% include 'navigation/header.njk' %} From e3eafc5098db1d448b3731abee0a66b0efccdcf6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:17:43 +0000 Subject: [PATCH 014/117] chore(deps-dev): bump @types/jest from 29.2.0 to 29.2.1 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.0 to 29.2.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 894943079..9756960c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@semantic-release/github": "^8.0.6", "@semantic-release/npm": "^9.0.1", "@semantic-release/release-notes-generator": "^10.0.3", - "@types/jest": "^29.2.0", + "@types/jest": "^29.2.1", "@types/smoothscroll-polyfill": "^0.3.1", "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", @@ -2338,9 +2338,9 @@ } }, "node_modules/@types/jest": { - "version": "29.2.0", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.0.tgz", - "integrity": "sha512-KO7bPV21d65PKwv3LLsD8Jn3E05pjNjRZvkm+YTacWhVmykAb07wW6IkZUmQAltwQafNcDUEUrMO2h3jeBSisg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.1.tgz", + "integrity": "sha512-nKixEdnGDqFOZkMTF74avFNr3yRqB1ZJ6sRZv5/28D5x2oLN14KApv7F9mfDT/vUic0L3tRCsh3XWpWjtJisUQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -19207,9 +19207,9 @@ } }, "@types/jest": { - "version": "29.2.0", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.0.tgz", - "integrity": "sha512-KO7bPV21d65PKwv3LLsD8Jn3E05pjNjRZvkm+YTacWhVmykAb07wW6IkZUmQAltwQafNcDUEUrMO2h3jeBSisg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.1.tgz", + "integrity": "sha512-nKixEdnGDqFOZkMTF74avFNr3yRqB1ZJ6sRZv5/28D5x2oLN14KApv7F9mfDT/vUic0L3tRCsh3XWpWjtJisUQ==", "dev": true, "requires": { "expect": "^29.0.0", diff --git a/package.json b/package.json index c53d5d68f..de34b6d9a 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "@semantic-release/github": "^8.0.6", "@semantic-release/npm": "^9.0.1", "@semantic-release/release-notes-generator": "^10.0.3", - "@types/jest": "^29.2.0", + "@types/jest": "^29.2.1", "@types/smoothscroll-polyfill": "^0.3.1", "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", From 126f79b942d4d7abffb305e3069a46f465ac74a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:18:56 +0000 Subject: [PATCH 015/117] chore(deps-dev): bump @commitlint/cli from 17.1.2 to 17.2.0 Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 17.1.2 to 17.2.0. - [Release notes](https://github.com/conventional-changelog/commitlint/releases) - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md) - [Commits](https://github.com/conventional-changelog/commitlint/commits/v17.2.0/@commitlint/cli) --- updated-dependencies: - dependency-name: "@commitlint/cli" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 150 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 76 insertions(+), 76 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9756960c2..24f4b1598 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@11ty/eleventy": "^1.0.2", - "@commitlint/cli": "^17.1.2", + "@commitlint/cli": "^17.2.0", "@commitlint/config-conventional": "^17.1.0", "@juggle/resize-observer": "^3.4.0", "@semantic-release/changelog": "^6.0.1", @@ -749,15 +749,15 @@ } }, "node_modules/@commitlint/cli": { - "version": "17.1.2", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-17.1.2.tgz", - "integrity": "sha512-h/4Hlka3bvCLbnxf0Er2ri5A44VMlbMSkdTRp8Adv2tRiklSTRIoPGs7OEXDv3EoDs2AAzILiPookgM4Gi7LOw==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-17.2.0.tgz", + "integrity": "sha512-kd1zykcrjIKyDRftWW1E1TJqkgzeosEkv1BiYPCdzkb/g/3BrfgwZUHR1vg+HO3qKUb/0dN+jNXArhGGAHpmaQ==", "dev": true, "dependencies": { "@commitlint/format": "^17.0.0", - "@commitlint/lint": "^17.1.0", - "@commitlint/load": "^17.1.2", - "@commitlint/read": "^17.1.0", + "@commitlint/lint": "^17.2.0", + "@commitlint/load": "^17.2.0", + "@commitlint/read": "^17.2.0", "@commitlint/types": "^17.0.0", "execa": "^5.0.0", "lodash": "^4.17.19", @@ -855,9 +855,9 @@ } }, "node_modules/@commitlint/is-ignored": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.1.0.tgz", - "integrity": "sha512-JITWKDMHhIh8IpdIbcbuH9rEQJty1ZWelgjleTFrVRAcEwN/sPzk1aVUXRIZNXMJWbZj8vtXRJnFihrml8uECQ==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.2.0.tgz", + "integrity": "sha512-rgUPUQraHxoMLxiE8GK430HA7/R2vXyLcOT4fQooNrZq9ERutNrP6dw3gdKLkq22Nede3+gEHQYUzL4Wu75ndg==", "dev": true, "dependencies": { "@commitlint/types": "^17.0.0", @@ -868,14 +868,14 @@ } }, "node_modules/@commitlint/lint": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-17.1.0.tgz", - "integrity": "sha512-ltpqM2ogt/+SDhUaScFo0MdscncEF96lvQTPMM/VTTWlw7sTGLLWkOOppsee2MN/uLNNWjQ7kqkd4h6JqoM9AQ==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-17.2.0.tgz", + "integrity": "sha512-N2oLn4Dj672wKH5qJ4LGO+73UkYXGHO+NTVUusGw83SjEv7GjpqPGKU6KALW2kFQ/GsDefSvOjpSi3CzWHQBDg==", "dev": true, "dependencies": { - "@commitlint/is-ignored": "^17.1.0", - "@commitlint/parse": "^17.0.0", - "@commitlint/rules": "^17.0.0", + "@commitlint/is-ignored": "^17.2.0", + "@commitlint/parse": "^17.2.0", + "@commitlint/rules": "^17.2.0", "@commitlint/types": "^17.0.0" }, "engines": { @@ -883,9 +883,9 @@ } }, "node_modules/@commitlint/load": { - "version": "17.1.2", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-17.1.2.tgz", - "integrity": "sha512-sk2p/jFYAWLChIfOIp/MGSIn/WzZ0vkc3afw+l4X8hGEYkvDe4gQUUAVxjl/6xMRn0HgnSLMZ04xXh5pkTsmgg==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-17.2.0.tgz", + "integrity": "sha512-HDD57qSqNrk399R4TIjw31AWBG8dBjNj1MrDKZKmC/wvimtnIFlqzcu1+sxfXIOHj/+M6tcMWDtvknGUd7SU+g==", "dev": true, "dependencies": { "@commitlint/config-validator": "^17.1.0", @@ -906,24 +906,24 @@ } }, "node_modules/@commitlint/load/node_modules/@types/node": { - "version": "14.18.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.26.tgz", - "integrity": "sha512-0b+utRBSYj8L7XAp0d+DX7lI4cSmowNaaTkk6/1SKzbKkG+doLuPusB9EOvzLJ8ahJSk03bTLIL6cWaEd4dBKA==", + "version": "14.18.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.33.tgz", + "integrity": "sha512-qelS/Ra6sacc4loe/3MSjXNL1dNQ/GjxNHVzuChwMfmk7HuycRLVQN2qNY3XahK+fZc5E2szqQSKUyAF0E+2bg==", "dev": true }, "node_modules/@commitlint/message": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-17.0.0.tgz", - "integrity": "sha512-LpcwYtN+lBlfZijHUdVr8aNFTVpHjuHI52BnfoV01TF7iSLnia0jttzpLkrLmI8HNQz6Vhr9UrxDWtKZiMGsBw==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-17.2.0.tgz", + "integrity": "sha512-/4l2KFKxBOuoEn1YAuuNNlAU05Zt7sNsC9H0mPdPm3chOrT4rcX0pOqrQcLtdMrMkJz0gC7b3SF80q2+LtdL9Q==", "dev": true, "engines": { "node": ">=v14" } }, "node_modules/@commitlint/parse": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-17.0.0.tgz", - "integrity": "sha512-cKcpfTIQYDG1ywTIr5AG0RAiLBr1gudqEsmAGCTtj8ffDChbBRxm6xXs2nv7GvmJN7msOt7vOKleLvcMmRa1+A==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-17.2.0.tgz", + "integrity": "sha512-vLzLznK9Y21zQ6F9hf8D6kcIJRb2haAK5T/Vt1uW2CbHYOIfNsR/hJs0XnF/J9ctM20Tfsqv4zBitbYvVw7F6Q==", "dev": true, "dependencies": { "@commitlint/types": "^17.0.0", @@ -935,9 +935,9 @@ } }, "node_modules/@commitlint/read": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-17.1.0.tgz", - "integrity": "sha512-73BoFNBA/3Ozo2JQvGsE0J8SdrJAWGfZQRSHqvKaqgmY042Su4gXQLqvAzgr55S9DI1l9TiU/5WDuh8IE86d/g==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-17.2.0.tgz", + "integrity": "sha512-bbblBhrHkjxra3ptJNm0abxu7yeAaxumQ8ZtD6GIVqzURCETCP7Dm0tlVvGRDyXBuqX6lIJxh3W7oyKqllDsHQ==", "dev": true, "dependencies": { "@commitlint/top-level": "^17.0.0", @@ -968,13 +968,13 @@ } }, "node_modules/@commitlint/rules": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-17.0.0.tgz", - "integrity": "sha512-45nIy3dERKXWpnwX9HeBzK5SepHwlDxdGBfmedXhL30fmFCkJOdxHyOJsh0+B0RaVsLGT01NELpfzJUmtpDwdQ==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-17.2.0.tgz", + "integrity": "sha512-1YynwD4Eh7HXZNpqG8mtUlL2pSX2jBy61EejYJv4ooZPcg50Ak7LPOyD3a9UZnsE76AXWFBz+yo9Hv4MIpAa0Q==", "dev": true, "dependencies": { "@commitlint/ensure": "^17.0.0", - "@commitlint/message": "^17.0.0", + "@commitlint/message": "^17.2.0", "@commitlint/to-lines": "^17.0.0", "@commitlint/types": "^17.0.0", "execa": "^5.0.0" @@ -4653,9 +4653,9 @@ } }, "node_modules/cosmiconfig-typescript-loader": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.0.0.tgz", - "integrity": "sha512-cVpucSc2Tf+VPwCCR7SZzmQTQkPbkk4O01yXsYqXBIbjE1bhwqSyAgYQkRK1un4i0OPziTleqFhdkmOc4RQ/9g==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.2.0.tgz", + "integrity": "sha512-NkANeMnaHrlaSSlpKGyvn2R4rqUDeE/9E5YHx+b4nwo0R8dZyAqcih8/gxpCZvqWP9Vf6xuLpMSzSgdVEIM78g==", "dev": true, "engines": { "node": ">=12", @@ -17905,15 +17905,15 @@ "optional": true }, "@commitlint/cli": { - "version": "17.1.2", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-17.1.2.tgz", - "integrity": "sha512-h/4Hlka3bvCLbnxf0Er2ri5A44VMlbMSkdTRp8Adv2tRiklSTRIoPGs7OEXDv3EoDs2AAzILiPookgM4Gi7LOw==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-17.2.0.tgz", + "integrity": "sha512-kd1zykcrjIKyDRftWW1E1TJqkgzeosEkv1BiYPCdzkb/g/3BrfgwZUHR1vg+HO3qKUb/0dN+jNXArhGGAHpmaQ==", "dev": true, "requires": { "@commitlint/format": "^17.0.0", - "@commitlint/lint": "^17.1.0", - "@commitlint/load": "^17.1.2", - "@commitlint/read": "^17.1.0", + "@commitlint/lint": "^17.2.0", + "@commitlint/load": "^17.2.0", + "@commitlint/read": "^17.2.0", "@commitlint/types": "^17.0.0", "execa": "^5.0.0", "lodash": "^4.17.19", @@ -17988,9 +17988,9 @@ } }, "@commitlint/is-ignored": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.1.0.tgz", - "integrity": "sha512-JITWKDMHhIh8IpdIbcbuH9rEQJty1ZWelgjleTFrVRAcEwN/sPzk1aVUXRIZNXMJWbZj8vtXRJnFihrml8uECQ==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.2.0.tgz", + "integrity": "sha512-rgUPUQraHxoMLxiE8GK430HA7/R2vXyLcOT4fQooNrZq9ERutNrP6dw3gdKLkq22Nede3+gEHQYUzL4Wu75ndg==", "dev": true, "requires": { "@commitlint/types": "^17.0.0", @@ -17998,21 +17998,21 @@ } }, "@commitlint/lint": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-17.1.0.tgz", - "integrity": "sha512-ltpqM2ogt/+SDhUaScFo0MdscncEF96lvQTPMM/VTTWlw7sTGLLWkOOppsee2MN/uLNNWjQ7kqkd4h6JqoM9AQ==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-17.2.0.tgz", + "integrity": "sha512-N2oLn4Dj672wKH5qJ4LGO+73UkYXGHO+NTVUusGw83SjEv7GjpqPGKU6KALW2kFQ/GsDefSvOjpSi3CzWHQBDg==", "dev": true, "requires": { - "@commitlint/is-ignored": "^17.1.0", - "@commitlint/parse": "^17.0.0", - "@commitlint/rules": "^17.0.0", + "@commitlint/is-ignored": "^17.2.0", + "@commitlint/parse": "^17.2.0", + "@commitlint/rules": "^17.2.0", "@commitlint/types": "^17.0.0" } }, "@commitlint/load": { - "version": "17.1.2", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-17.1.2.tgz", - "integrity": "sha512-sk2p/jFYAWLChIfOIp/MGSIn/WzZ0vkc3afw+l4X8hGEYkvDe4gQUUAVxjl/6xMRn0HgnSLMZ04xXh5pkTsmgg==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-17.2.0.tgz", + "integrity": "sha512-HDD57qSqNrk399R4TIjw31AWBG8dBjNj1MrDKZKmC/wvimtnIFlqzcu1+sxfXIOHj/+M6tcMWDtvknGUd7SU+g==", "dev": true, "requires": { "@commitlint/config-validator": "^17.1.0", @@ -18030,23 +18030,23 @@ }, "dependencies": { "@types/node": { - "version": "14.18.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.26.tgz", - "integrity": "sha512-0b+utRBSYj8L7XAp0d+DX7lI4cSmowNaaTkk6/1SKzbKkG+doLuPusB9EOvzLJ8ahJSk03bTLIL6cWaEd4dBKA==", + "version": "14.18.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.33.tgz", + "integrity": "sha512-qelS/Ra6sacc4loe/3MSjXNL1dNQ/GjxNHVzuChwMfmk7HuycRLVQN2qNY3XahK+fZc5E2szqQSKUyAF0E+2bg==", "dev": true } } }, "@commitlint/message": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-17.0.0.tgz", - "integrity": "sha512-LpcwYtN+lBlfZijHUdVr8aNFTVpHjuHI52BnfoV01TF7iSLnia0jttzpLkrLmI8HNQz6Vhr9UrxDWtKZiMGsBw==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-17.2.0.tgz", + "integrity": "sha512-/4l2KFKxBOuoEn1YAuuNNlAU05Zt7sNsC9H0mPdPm3chOrT4rcX0pOqrQcLtdMrMkJz0gC7b3SF80q2+LtdL9Q==", "dev": true }, "@commitlint/parse": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-17.0.0.tgz", - "integrity": "sha512-cKcpfTIQYDG1ywTIr5AG0RAiLBr1gudqEsmAGCTtj8ffDChbBRxm6xXs2nv7GvmJN7msOt7vOKleLvcMmRa1+A==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-17.2.0.tgz", + "integrity": "sha512-vLzLznK9Y21zQ6F9hf8D6kcIJRb2haAK5T/Vt1uW2CbHYOIfNsR/hJs0XnF/J9ctM20Tfsqv4zBitbYvVw7F6Q==", "dev": true, "requires": { "@commitlint/types": "^17.0.0", @@ -18055,9 +18055,9 @@ } }, "@commitlint/read": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-17.1.0.tgz", - "integrity": "sha512-73BoFNBA/3Ozo2JQvGsE0J8SdrJAWGfZQRSHqvKaqgmY042Su4gXQLqvAzgr55S9DI1l9TiU/5WDuh8IE86d/g==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-17.2.0.tgz", + "integrity": "sha512-bbblBhrHkjxra3ptJNm0abxu7yeAaxumQ8ZtD6GIVqzURCETCP7Dm0tlVvGRDyXBuqX6lIJxh3W7oyKqllDsHQ==", "dev": true, "requires": { "@commitlint/top-level": "^17.0.0", @@ -18082,13 +18082,13 @@ } }, "@commitlint/rules": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-17.0.0.tgz", - "integrity": "sha512-45nIy3dERKXWpnwX9HeBzK5SepHwlDxdGBfmedXhL30fmFCkJOdxHyOJsh0+B0RaVsLGT01NELpfzJUmtpDwdQ==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-17.2.0.tgz", + "integrity": "sha512-1YynwD4Eh7HXZNpqG8mtUlL2pSX2jBy61EejYJv4ooZPcg50Ak7LPOyD3a9UZnsE76AXWFBz+yo9Hv4MIpAa0Q==", "dev": true, "requires": { "@commitlint/ensure": "^17.0.0", - "@commitlint/message": "^17.0.0", + "@commitlint/message": "^17.2.0", "@commitlint/to-lines": "^17.0.0", "@commitlint/types": "^17.0.0", "execa": "^5.0.0" @@ -21042,9 +21042,9 @@ } }, "cosmiconfig-typescript-loader": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.0.0.tgz", - "integrity": "sha512-cVpucSc2Tf+VPwCCR7SZzmQTQkPbkk4O01yXsYqXBIbjE1bhwqSyAgYQkRK1un4i0OPziTleqFhdkmOc4RQ/9g==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.2.0.tgz", + "integrity": "sha512-NkANeMnaHrlaSSlpKGyvn2R4rqUDeE/9E5YHx+b4nwo0R8dZyAqcih8/gxpCZvqWP9Vf6xuLpMSzSgdVEIM78g==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index de34b6d9a..2bf44c7e6 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ }, "devDependencies": { "@11ty/eleventy": "^1.0.2", - "@commitlint/cli": "^17.1.2", + "@commitlint/cli": "^17.2.0", "@commitlint/config-conventional": "^17.1.0", "@juggle/resize-observer": "^3.4.0", "@semantic-release/changelog": "^6.0.1", From 39dd3d95ecdf5d9192c891bc4001dcc5e77a6d17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 14:46:36 +0000 Subject: [PATCH 016/117] chore(deps-dev): bump @commitlint/config-conventional Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional) from 17.1.0 to 17.2.0. - [Release notes](https://github.com/conventional-changelog/commitlint/releases) - [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/CHANGELOG.md) - [Commits](https://github.com/conventional-changelog/commitlint/commits/v17.2.0/@commitlint/config-conventional) --- updated-dependencies: - dependency-name: "@commitlint/config-conventional" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24f4b1598..12037d1f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "devDependencies": { "@11ty/eleventy": "^1.0.2", "@commitlint/cli": "^17.2.0", - "@commitlint/config-conventional": "^17.1.0", + "@commitlint/config-conventional": "^17.2.0", "@juggle/resize-observer": "^3.4.0", "@semantic-release/changelog": "^6.0.1", "@semantic-release/commit-analyzer": "^9.0.2", @@ -773,9 +773,9 @@ } }, "node_modules/@commitlint/config-conventional": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-17.1.0.tgz", - "integrity": "sha512-WU2p0c9/jLi8k2q2YrDV96Y8XVswQOceIQ/wyJvQxawJSCasLdRB3kUIYdNjOCJsxkpoUlV/b90ZPxp1MYZDiA==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-17.2.0.tgz", + "integrity": "sha512-g5hQqRa80f++SYS233dbDSg16YdyounMTAhVcmqtInNeY/GF3aA4st9SVtJxpeGrGmueMrU4L+BBb+6Vs5wrcg==", "dev": true, "dependencies": { "conventional-changelog-conventionalcommits": "^5.0.0" @@ -17923,9 +17923,9 @@ } }, "@commitlint/config-conventional": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-17.1.0.tgz", - "integrity": "sha512-WU2p0c9/jLi8k2q2YrDV96Y8XVswQOceIQ/wyJvQxawJSCasLdRB3kUIYdNjOCJsxkpoUlV/b90ZPxp1MYZDiA==", + "version": "17.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-17.2.0.tgz", + "integrity": "sha512-g5hQqRa80f++SYS233dbDSg16YdyounMTAhVcmqtInNeY/GF3aA4st9SVtJxpeGrGmueMrU4L+BBb+6Vs5wrcg==", "dev": true, "requires": { "conventional-changelog-conventionalcommits": "^5.0.0" diff --git a/package.json b/package.json index 2bf44c7e6..0b406bdb7 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "devDependencies": { "@11ty/eleventy": "^1.0.2", "@commitlint/cli": "^17.2.0", - "@commitlint/config-conventional": "^17.1.0", + "@commitlint/config-conventional": "^17.2.0", "@juggle/resize-observer": "^3.4.0", "@semantic-release/changelog": "^6.0.1", "@semantic-release/commit-analyzer": "^9.0.2", From 7711733dca189c69b0174b2f98f38306766186d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 14:44:06 +0000 Subject: [PATCH 017/117] chore(deps-dev): bump @typescript-eslint/parser from 5.41.0 to 5.42.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.41.0 to 5.42.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.42.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 143 +++++++++++++++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 131 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 12037d1f7..7e79ba78f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@types/jest": "^29.2.1", "@types/smoothscroll-polyfill": "^0.3.1", "@typescript-eslint/eslint-plugin": "^5.41.0", - "@typescript-eslint/parser": "^5.41.0", + "@typescript-eslint/parser": "^5.42.0", "@webcomponents/custom-elements": "1.5.1", "browser-sync": "^2.27.10", "chokidar-cli": "^3.0.0", @@ -2499,14 +2499,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.41.0.tgz", - "integrity": "sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.42.0.tgz", + "integrity": "sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.41.0", - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/typescript-estree": "5.41.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/typescript-estree": "5.42.0", "debug": "^4.3.4" }, "engines": { @@ -2525,6 +2525,80 @@ } } }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", + "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", + "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", + "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", + "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.42.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/scope-manager": { "version": "5.41.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", @@ -19352,15 +19426,58 @@ } }, "@typescript-eslint/parser": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.41.0.tgz", - "integrity": "sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.42.0.tgz", + "integrity": "sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.41.0", - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/typescript-estree": "5.41.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/typescript-estree": "5.42.0", "debug": "^4.3.4" + }, + "dependencies": { + "@typescript-eslint/scope-manager": { + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", + "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0" + } + }, + "@typescript-eslint/types": { + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", + "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", + "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", + "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.42.0", + "eslint-visitor-keys": "^3.3.0" + } + } } }, "@typescript-eslint/scope-manager": { diff --git a/package.json b/package.json index 0b406bdb7..3bd3e7430 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "@types/jest": "^29.2.1", "@types/smoothscroll-polyfill": "^0.3.1", "@typescript-eslint/eslint-plugin": "^5.41.0", - "@typescript-eslint/parser": "^5.41.0", + "@typescript-eslint/parser": "^5.42.0", "@webcomponents/custom-elements": "1.5.1", "browser-sync": "^2.27.10", "chokidar-cli": "^3.0.0", From 39a9d693843dd31c11ff1cf31ff7345303430db9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 14:52:01 +0000 Subject: [PATCH 018/117] chore(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.41.0 to 5.42.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.42.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 261 ++++++++++++++-------------------------------- package.json | 2 +- 2 files changed, 80 insertions(+), 183 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e79ba78f..11bd0dfdd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "@semantic-release/release-notes-generator": "^10.0.3", "@types/jest": "^29.2.1", "@types/smoothscroll-polyfill": "^0.3.1", - "@typescript-eslint/eslint-plugin": "^5.41.0", + "@typescript-eslint/eslint-plugin": "^5.42.0", "@typescript-eslint/parser": "^5.42.0", "@webcomponents/custom-elements": "1.5.1", "browser-sync": "^2.27.10", @@ -2467,16 +2467,17 @@ "integrity": "sha512-uwqm0DUeg+2pff/8y9b22JJb+qWKOcG5aCn2yyT7hmLdK/M8+VECcK6QuNqdAR93IAqTmZeqK2nizTlQg5j+XA==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.41.0.tgz", - "integrity": "sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.0.tgz", + "integrity": "sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.41.0", - "@typescript-eslint/type-utils": "5.41.0", - "@typescript-eslint/utils": "5.41.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/type-utils": "5.42.0", + "@typescript-eslint/utils": "5.42.0", "debug": "^4.3.4", "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" @@ -2525,7 +2526,7 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "node_modules/@typescript-eslint/scope-manager": { "version": "5.42.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", @@ -2542,88 +2543,14 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", - "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", - "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/visitor-keys": "5.42.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", - "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.42.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", - "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/visitor-keys": "5.41.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.41.0.tgz", - "integrity": "sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.42.0.tgz", + "integrity": "sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.41.0", - "@typescript-eslint/utils": "5.41.0", + "@typescript-eslint/typescript-estree": "5.42.0", + "@typescript-eslint/utils": "5.42.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -2644,9 +2571,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", - "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", + "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2657,13 +2584,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", - "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", + "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/visitor-keys": "5.41.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2684,16 +2611,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.41.0.tgz", - "integrity": "sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.42.0.tgz", + "integrity": "sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.41.0", - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/typescript-estree": "5.41.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/typescript-estree": "5.42.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -2710,12 +2637,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", - "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", + "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/types": "5.42.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -10322,6 +10249,12 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node_modules/needle": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/needle/-/needle-3.1.0.tgz", @@ -19410,16 +19343,17 @@ "integrity": "sha512-uwqm0DUeg+2pff/8y9b22JJb+qWKOcG5aCn2yyT7hmLdK/M8+VECcK6QuNqdAR93IAqTmZeqK2nizTlQg5j+XA==" }, "@typescript-eslint/eslint-plugin": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.41.0.tgz", - "integrity": "sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.0.tgz", + "integrity": "sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.41.0", - "@typescript-eslint/type-utils": "5.41.0", - "@typescript-eslint/utils": "5.41.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/type-utils": "5.42.0", + "@typescript-eslint/utils": "5.42.0", "debug": "^4.3.4", "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" @@ -19435,87 +19369,44 @@ "@typescript-eslint/types": "5.42.0", "@typescript-eslint/typescript-estree": "5.42.0", "debug": "^4.3.4" - }, - "dependencies": { - "@typescript-eslint/scope-manager": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", - "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/visitor-keys": "5.42.0" - } - }, - "@typescript-eslint/types": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", - "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", - "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.42.0", - "@typescript-eslint/visitor-keys": "5.42.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.42.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", - "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.42.0", - "eslint-visitor-keys": "^3.3.0" - } - } } }, "@typescript-eslint/scope-manager": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz", - "integrity": "sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz", + "integrity": "sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==", "dev": true, "requires": { - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/visitor-keys": "5.41.0" + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0" } }, "@typescript-eslint/type-utils": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.41.0.tgz", - "integrity": "sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.42.0.tgz", + "integrity": "sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.41.0", - "@typescript-eslint/utils": "5.41.0", + "@typescript-eslint/typescript-estree": "5.42.0", + "@typescript-eslint/utils": "5.42.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.41.0.tgz", - "integrity": "sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.42.0.tgz", + "integrity": "sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz", - "integrity": "sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz", + "integrity": "sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/visitor-keys": "5.41.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/visitor-keys": "5.42.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -19524,28 +19415,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.41.0.tgz", - "integrity": "sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.42.0.tgz", + "integrity": "sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.41.0", - "@typescript-eslint/types": "5.41.0", - "@typescript-eslint/typescript-estree": "5.41.0", + "@typescript-eslint/scope-manager": "5.42.0", + "@typescript-eslint/types": "5.42.0", + "@typescript-eslint/typescript-estree": "5.42.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.41.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz", - "integrity": "sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==", + "version": "5.42.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz", + "integrity": "sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/types": "5.42.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -25330,6 +25221,12 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "needle": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/needle/-/needle-3.1.0.tgz", diff --git a/package.json b/package.json index 3bd3e7430..f757c26ff 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@semantic-release/release-notes-generator": "^10.0.3", "@types/jest": "^29.2.1", "@types/smoothscroll-polyfill": "^0.3.1", - "@typescript-eslint/eslint-plugin": "^5.41.0", + "@typescript-eslint/eslint-plugin": "^5.42.0", "@typescript-eslint/parser": "^5.42.0", "@webcomponents/custom-elements": "1.5.1", "browser-sync": "^2.27.10", From 3690d02a801c7bd0df3068dd60e5dc0c620ef6d4 Mon Sep 17 00:00:00 2001 From: "ala'n (Alexey Stsefanovich)" Date: Tue, 1 Nov 2022 16:01:48 +0100 Subject: [PATCH 019/117] chore(gh-pages): remove push trigger to deploy site --- .github/workflows/pages.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3475303da..c6a13da1e 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -4,8 +4,6 @@ on: schedule: # Automatic build runs at 0:00 UTC daily - cron: '0 0 * * *' - push: - branches: [ main ] workflow_dispatch: env: From aa64b59ee4c76d60f3e1bd96fe4263dfdd1043a3 Mon Sep 17 00:00:00 2001 From: Natalie Smirnova <55104823+Natalie-Smirnova@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:28:16 +0100 Subject: [PATCH 020/117] chore(gh-pages): fix aurora effect for `lg-xl`, `xl` and `xs` breakpoints (#1314) --- pages/src/landing/promo-banner/promo-banner.less | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pages/src/landing/promo-banner/promo-banner.less b/pages/src/landing/promo-banner/promo-banner.less index efe66cbdd..1ad72ad6e 100644 --- a/pages/src/landing/promo-banner/promo-banner.less +++ b/pages/src/landing/promo-banner/promo-banner.less @@ -18,9 +18,20 @@ opacity: .6; background: url('/assets/common/aurora.webp'), url('/assets/common/aurora.webp'), linear-gradient(rgba(0, 0, 0, 0), rgba(13, 57, 90, 1) 40%, rgba(0, 0, 0, 0)); - background-position: right 157% bottom 22%, left 150% bottom 18%, center; - background-size: 50vw 100vh, 50vw 85vh, auto; + background-position: right 157% bottom 22%, left 139% bottom 18%, center; + background-size: 50% 100%, 50% 85%, auto; background-repeat: no-repeat, no-repeat, repeat; + @media @xs { + background: url('/assets/common/aurora.webp'), linear-gradient(rgba(0, 0, 0, 0), rgba(13, 57, 90, 1) 40%, rgba(0, 0, 0, 0)); + background-repeat: no-repeat, repeat; + top: -13%; + background-size: 101% 112%; + opacity: .3; + } + @media @lg-xl { + background-position: right 157% bottom 54%, left 139% bottom 45%, center; + background-size: 50% 196%, 50% 132%, auto; + } } From 59480a3056a57712fdfe7698f096952e7585803f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Nov 2022 10:02:41 +0000 Subject: [PATCH 021/117] chore(deps-dev): bump stylelint from 14.14.0 to 14.14.1 Bumps [stylelint](https://github.com/stylelint/stylelint) from 14.14.0 to 14.14.1. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/14.14.0...14.14.1) --- updated-dependencies: - dependency-name: stylelint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 50 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 11bd0dfdd..e337a12da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "rimraf": "^3.0.2", "semantic-release": "^19.0.5", "smoothscroll-polyfill": "^0.4.4", - "stylelint": "^14.14.0", + "stylelint": "^14.14.1", "ts-jest": "^29.0.3", "ts-loader": "^9.4.1", "typescript": "4.8.4", @@ -8786,9 +8786,9 @@ } }, "node_modules/known-css-properties": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.25.0.tgz", - "integrity": "sha512-b0/9J1O9Jcyik1GC6KC42hJ41jKwdO/Mq8Mdo5sYN+IuRTXs2YFHZC3kZSx6ueusqa95x3wLYe/ytKjbAfGixA==", + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.26.0.tgz", + "integrity": "sha512-5FZRzrZzNTBruuurWpvZnvP9pum+fe0HcK8z/ooo+U+Hmp4vtbyp1/QDsqmufirXy4egGzbaH/y2uCZf+6W5Kg==", "dev": true }, "node_modules/lcid": { @@ -15740,9 +15740,9 @@ "dev": true }, "node_modules/stylelint": { - "version": "14.14.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.14.0.tgz", - "integrity": "sha512-yUI+4xXfPHVnueYddSQ/e1GuEA/2wVhWQbGj16AmWLtQJtn28lVxfS4b0CsWyVRPgd3Auzi0NXOthIEUhtQmmA==", + "version": "14.14.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.14.1.tgz", + "integrity": "sha512-Jnftu+lSD8cSpcV/+Z2nfgfgFpTIS1FcujezXPngtoIQ6wtwutL22MsNE0dJuMiM1h1790g2qIjAyUZCMrX4sw==", "dev": true, "dependencies": { "@csstools/selector-specificity": "^2.0.2", @@ -15762,13 +15762,13 @@ "import-lazy": "^4.0.0", "imurmurhash": "^0.1.4", "is-plain-object": "^5.0.0", - "known-css-properties": "^0.25.0", + "known-css-properties": "^0.26.0", "mathml-tag-names": "^2.1.3", "meow": "^9.0.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.4.17", + "postcss": "^8.4.18", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", @@ -15780,7 +15780,7 @@ "style-search": "^0.1.0", "supports-hyperlinks": "^2.3.0", "svg-tags": "^1.0.0", - "table": "^6.8.0", + "table": "^6.8.1", "v8-compile-cache": "^2.3.0", "write-file-atomic": "^4.0.2" }, @@ -15927,9 +15927,9 @@ "dev": true }, "node_modules/table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", "dev": true, "dependencies": { "ajv": "^8.0.1", @@ -24147,9 +24147,9 @@ "dev": true }, "known-css-properties": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.25.0.tgz", - "integrity": "sha512-b0/9J1O9Jcyik1GC6KC42hJ41jKwdO/Mq8Mdo5sYN+IuRTXs2YFHZC3kZSx6ueusqa95x3wLYe/ytKjbAfGixA==", + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.26.0.tgz", + "integrity": "sha512-5FZRzrZzNTBruuurWpvZnvP9pum+fe0HcK8z/ooo+U+Hmp4vtbyp1/QDsqmufirXy4egGzbaH/y2uCZf+6W5Kg==", "dev": true }, "lcid": { @@ -29328,9 +29328,9 @@ "dev": true }, "stylelint": { - "version": "14.14.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.14.0.tgz", - "integrity": "sha512-yUI+4xXfPHVnueYddSQ/e1GuEA/2wVhWQbGj16AmWLtQJtn28lVxfS4b0CsWyVRPgd3Auzi0NXOthIEUhtQmmA==", + "version": "14.14.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.14.1.tgz", + "integrity": "sha512-Jnftu+lSD8cSpcV/+Z2nfgfgFpTIS1FcujezXPngtoIQ6wtwutL22MsNE0dJuMiM1h1790g2qIjAyUZCMrX4sw==", "dev": true, "requires": { "@csstools/selector-specificity": "^2.0.2", @@ -29350,13 +29350,13 @@ "import-lazy": "^4.0.0", "imurmurhash": "^0.1.4", "is-plain-object": "^5.0.0", - "known-css-properties": "^0.25.0", + "known-css-properties": "^0.26.0", "mathml-tag-names": "^2.1.3", "meow": "^9.0.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.4.17", + "postcss": "^8.4.18", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", @@ -29368,7 +29368,7 @@ "style-search": "^0.1.0", "supports-hyperlinks": "^2.3.0", "svg-tags": "^1.0.0", - "table": "^6.8.0", + "table": "^6.8.1", "v8-compile-cache": "^2.3.0", "write-file-atomic": "^4.0.2" }, @@ -29474,9 +29474,9 @@ "dev": true }, "table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", "dev": true, "requires": { "ajv": "^8.0.1", diff --git a/package.json b/package.json index f757c26ff..dd87c3aea 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "rimraf": "^3.0.2", "semantic-release": "^19.0.5", "smoothscroll-polyfill": "^0.4.4", - "stylelint": "^14.14.0", + "stylelint": "^14.14.1", "ts-jest": "^29.0.3", "ts-loader": "^9.4.1", "typescript": "4.8.4", From 07fc40a8847acd61455b1bada0e2ba6ea4350b3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 10:06:56 +0000 Subject: [PATCH 022/117] chore(deps-dev): bump husky from 8.0.1 to 8.0.2 Bumps [husky](https://github.com/typicode/husky) from 8.0.1 to 8.0.2. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v8.0.1...v8.0.2) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index e337a12da..794492e49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "eslint-plugin-tsdoc": "^0.2.17", "foreach-cli": "^1.8.1", "html-minifier": "^4.0.0", - "husky": "^8.0.1", + "husky": "^8.0.2", "intersection-observer": "^0.12.2", "jest": "^29.2.2", "jest-environment-jsdom": "^29.2.2", @@ -7210,9 +7210,9 @@ } }, "node_modules/husky": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz", - "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.2.tgz", + "integrity": "sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg==", "dev": true, "bin": { "husky": "lib/bin.js" @@ -22990,9 +22990,9 @@ "dev": true }, "husky": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz", - "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.2.tgz", + "integrity": "sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg==", "dev": true }, "iconv-lite": { diff --git a/package.json b/package.json index dd87c3aea..7181b26aa 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "eslint-plugin-tsdoc": "^0.2.17", "foreach-cli": "^1.8.1", "html-minifier": "^4.0.0", - "husky": "^8.0.1", + "husky": "^8.0.2", "intersection-observer": "^0.12.2", "jest": "^29.2.2", "jest-environment-jsdom": "^29.2.2", From df36651ccf2b0533f89b9f61841f39755ed19715 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 11 Nov 2022 19:48:44 +0200 Subject: [PATCH 023/117] feat(esl-share): create share actions registry --- .../core/esl-share-action-registry.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/modules/esl-share/core/esl-share-action-registry.ts diff --git a/src/modules/esl-share/core/esl-share-action-registry.ts b/src/modules/esl-share/core/esl-share-action-registry.ts new file mode 100644 index 000000000..a6437af57 --- /dev/null +++ b/src/modules/esl-share/core/esl-share-action-registry.ts @@ -0,0 +1,36 @@ +import {memoize} from '../../esl-utils/decorators'; + +import type {ActionType} from './esl-share-action'; +import type {ESLShareButton} from './esl-share-button'; + +export class ESLShareActionRegistry { + private actionsMap: Map = new Map(); + + @memoize() + public static get instance(): ESLShareActionRegistry { + return new ESLShareActionRegistry(); + } + + /** Register action */ + public register(action: ActionType): void { + if (!action.is) throw new Error('Action should have a name'); + this.actionsMap.set(action.is, action); + } + + /** Check that action is registered for passed name */ + public has(name: string): boolean { + return this.actionsMap.has(name); + } + + /** Get action by name */ + public get(name: string): ActionType | null { + if (!name) return null; + return this.actionsMap.get(name.toLowerCase()) || null; + } + + /** Do action at passed Share button */ + public doAction(button: ESLShareButton): void { + const action = this.get(button.action); + action && new action(button).do(); + } +} From 9ed21fcf946c4cb3cdaa7594f690ee47e3ae897b Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 11 Nov 2022 19:49:16 +0200 Subject: [PATCH 024/117] feat(esl-share): create print action --- src/modules/esl-share/actions/print.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/modules/esl-share/actions/print.ts diff --git a/src/modules/esl-share/actions/print.ts b/src/modules/esl-share/actions/print.ts new file mode 100644 index 000000000..ddd2a69d8 --- /dev/null +++ b/src/modules/esl-share/actions/print.ts @@ -0,0 +1,9 @@ +import {ESLShareBaseAction} from '../core/esl-share-action'; + +export class ESLSharePrintAction extends ESLShareBaseAction { + static readonly is: string = 'print'; + + public do(): void { + window.print(); + } +} From 40637cfd4fafa611cca7eb13339deac8b8ed9597 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 11 Nov 2022 19:50:05 +0200 Subject: [PATCH 025/117] feat(esl-share): create copy action --- src/modules/esl-share/actions/copy.ts | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/modules/esl-share/actions/copy.ts diff --git a/src/modules/esl-share/actions/copy.ts b/src/modules/esl-share/actions/copy.ts new file mode 100644 index 000000000..39bacc9f9 --- /dev/null +++ b/src/modules/esl-share/actions/copy.ts @@ -0,0 +1,36 @@ +import {ESLShareBaseAction} from '../core/esl-share-action'; +import {ESLEventUtils} from '../../esl-utils/dom/events'; + +import type {AlertActionParams} from '../../esl-alert/core'; + +export class ESLShareCopyAction extends ESLShareBaseAction { + static readonly is: string = 'copy'; + + protected get alertIcon(): string { + const $icon = this.$button.querySelector('.esl-share-icon'); + return $icon ? $icon.innerHTML : ''; + } + + protected get alertText(): string { + return 'Copied to clipboard'; + } + + protected get alertParams(): AlertActionParams { + return { + cls: 'esl-share-alert', + html: `${this.alertIcon} ${this.alertText}` + }; + } + + public do(): void { + if (navigator.clipboard !== undefined) { + navigator.clipboard.writeText(window.location.href,); + this.showCopyAlert(); + } + } + + protected showCopyAlert(): void { + const detail = this.alertParams; + ESLEventUtils.dispatch(document.body, 'esl:alert:show', {detail}); + } +} From 11ee61a5a0c8ba8306b6a55cdb9e00743c267f65 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 11 Nov 2022 19:50:27 +0200 Subject: [PATCH 026/117] feat(esl-share): create media action --- src/modules/esl-share/actions/media.ts | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/modules/esl-share/actions/media.ts diff --git a/src/modules/esl-share/actions/media.ts b/src/modules/esl-share/actions/media.ts new file mode 100644 index 000000000..ad630ee42 --- /dev/null +++ b/src/modules/esl-share/actions/media.ts @@ -0,0 +1,37 @@ +import {ESLShareBaseAction} from '../core/esl-share-action'; +import {format} from '../../esl-utils/misc/format'; + +export class ESLShareMediaAction extends ESLShareBaseAction { + public static readonly is: string = 'media'; + + public static FEATURES: Record = { + scrollbars: 0, + resizable: 1, + menubar: 0, + left: 100, + top: 100, + width: 750, + height: 500, + toolbar: 0, + status: 0 + }; + + protected get formatSource(): Record { + return { + u: encodeURIComponent(window.location.href), + t: encodeURIComponent(document.title) + }; + } + + protected get windowFeatures(): string { + return Object.entries((this.constructor as typeof ESLShareMediaAction).FEATURES).map((key, value) => `${key}=${value}`).join(','); + } + + public do(): void { + const {link} = this.$button; + if (link) { + const URL = format(link, this.formatSource); + window.open(URL, '_blank', this.windowFeatures); + } + } +} From 0adad1109948d7071bd139f65e1a0f385e48b023 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Sun, 13 Nov 2022 16:31:50 +0200 Subject: [PATCH 027/117] refactor(esl-share): rename actions --- pages/src/localdev.ts | 7 +++++++ src/modules/esl-share/actions/{copy.ts => copy-action.ts} | 2 +- .../esl-share/actions/{media.ts => media-action.ts} | 0 .../esl-share/actions/{print.ts => print-action.ts} | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) rename src/modules/esl-share/actions/{copy.ts => copy-action.ts} (95%) rename src/modules/esl-share/actions/{media.ts => media-action.ts} (100%) rename src/modules/esl-share/actions/{print.ts => print-action.ts} (78%) diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index dc82e777b..cbada7d64 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -41,6 +41,10 @@ import '../../src/modules/esl-media/providers/html5/video-provider'; import '../../src/modules/esl-media/providers/youtube-provider'; import '../../src/modules/esl-media/providers/brightcove-provider'; +import {ESLShareCopyAction} from '../../src/modules/esl-share/actions/copy-action'; +import {ESLShareMediaAction} from '../../src/modules/esl-share/actions/media-action'; +import {ESLSharePrintAction} from '../../src/modules/esl-share/actions/print-action'; + import { ESLCarousel, ESLCarouselPlugins @@ -107,3 +111,6 @@ ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); ESLShare.register(); +ESLShareActionRegistry.instance.register(ESLShareCopyAction); +ESLShareActionRegistry.instance.register(ESLShareMediaAction); +ESLShareActionRegistry.instance.register(ESLSharePrintAction); diff --git a/src/modules/esl-share/actions/copy.ts b/src/modules/esl-share/actions/copy-action.ts similarity index 95% rename from src/modules/esl-share/actions/copy.ts rename to src/modules/esl-share/actions/copy-action.ts index 39bacc9f9..770c2df56 100644 --- a/src/modules/esl-share/actions/copy.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -4,7 +4,7 @@ import {ESLEventUtils} from '../../esl-utils/dom/events'; import type {AlertActionParams} from '../../esl-alert/core'; export class ESLShareCopyAction extends ESLShareBaseAction { - static readonly is: string = 'copy'; + public static readonly is: string = 'copy'; protected get alertIcon(): string { const $icon = this.$button.querySelector('.esl-share-icon'); diff --git a/src/modules/esl-share/actions/media.ts b/src/modules/esl-share/actions/media-action.ts similarity index 100% rename from src/modules/esl-share/actions/media.ts rename to src/modules/esl-share/actions/media-action.ts diff --git a/src/modules/esl-share/actions/print.ts b/src/modules/esl-share/actions/print-action.ts similarity index 78% rename from src/modules/esl-share/actions/print.ts rename to src/modules/esl-share/actions/print-action.ts index ddd2a69d8..3aa50a310 100644 --- a/src/modules/esl-share/actions/print.ts +++ b/src/modules/esl-share/actions/print-action.ts @@ -1,7 +1,7 @@ import {ESLShareBaseAction} from '../core/esl-share-action'; export class ESLSharePrintAction extends ESLShareBaseAction { - static readonly is: string = 'print'; + public static readonly is: string = 'print'; public do(): void { window.print(); From 7a6aa35e550d52873e271c9085690ab26ee5c4e8 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Sun, 13 Nov 2022 16:32:55 +0200 Subject: [PATCH 028/117] style(esl-share): update imports --- pages/src/localdev.ts | 3 ++- src/modules/esl-share/core.less | 2 +- src/modules/esl-share/core.ts | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index cbada7d64..20ed49e8e 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -32,7 +32,8 @@ import { ESLFootnotes, ESLTooltip, ESLAnimate, - ESLShare + ESLShare, + ESLShareActionRegistry } from '../../src/modules/all'; import '../../src/modules/esl-media/providers/iframe-provider'; diff --git a/src/modules/esl-share/core.less b/src/modules/esl-share/core.less index eb8235183..74bd5ef52 100644 --- a/src/modules/esl-share/core.less +++ b/src/modules/esl-share/core.less @@ -1,2 +1,2 @@ -@import "./core/esl-share-icon.less"; +@import "./core/esl-share-button.less"; @import "./core/esl-share-trigger.less"; diff --git a/src/modules/esl-share/core.ts b/src/modules/esl-share/core.ts index b3df222d6..e342a0429 100644 --- a/src/modules/esl-share/core.ts +++ b/src/modules/esl-share/core.ts @@ -1,3 +1,4 @@ export * from './core/esl-share'; -export * from './core/esl-share-icon'; -export * from './core/esl-share-trigger'; +export * from './core/esl-share-action'; +export * from './core/esl-share-action-registry'; +export * from './core/esl-share-button'; From 84ad6f4e1041c1a2cad4707af9096737b41bed4d Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Sun, 13 Nov 2022 16:33:39 +0200 Subject: [PATCH 029/117] refactor(esl-share): delete esl-share-icons --- .../esl-share/core/esl-share-icon.less | 22 ------------------- src/modules/esl-share/core/esl-share-icon.ts | 13 ----------- 2 files changed, 35 deletions(-) delete mode 100644 src/modules/esl-share/core/esl-share-icon.less delete mode 100644 src/modules/esl-share/core/esl-share-icon.ts diff --git a/src/modules/esl-share/core/esl-share-icon.less b/src/modules/esl-share/core/esl-share-icon.less deleted file mode 100644 index a32008cc0..000000000 --- a/src/modules/esl-share/core/esl-share-icon.less +++ /dev/null @@ -1,22 +0,0 @@ -esl-share-icon { - display: inline-block; - width: 20px; - height: 20px; - cursor: pointer; - - &:hover { - opacity: .6; - } - - .esl-share-icon-wrapper { - display: inline-block; - overflow: hidden; - background-color: #0097e7; // TODO: consider creating common variables.less file - width: 100%; - height: 100%; - } - - path, circle { - fill: #fff; - } -} diff --git a/src/modules/esl-share/core/esl-share-icon.ts b/src/modules/esl-share/core/esl-share-icon.ts deleted file mode 100644 index c1b2a1fc0..000000000 --- a/src/modules/esl-share/core/esl-share-icon.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr} from '../../esl-utils/decorators'; - -export class ESLShareIcon extends ESLBaseElement { - public static is = 'esl-share-icon'; - - public static DEFAULT_ICON_BG_COLOR = '#FFF'; - - @attr() public netId: string; - @attr() public name: string; - @attr() public icon: string; - @attr() public link: string; -} From 0f33fe1b1f94f20e755fa9d16a8e31350d2c1938 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Sun, 13 Nov 2022 16:35:37 +0200 Subject: [PATCH 030/117] docs(esl-share): update demo page --- pages/views/examples/share.njk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index 9ea8c6d3c..e4bce5032 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -14,6 +14,21 @@ aside:

Share example

- + + + + +
+ + + + + + From dcce8afbda329c31cf910e127d1d55045049bc5b Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 16 Nov 2022 17:56:16 +0200 Subject: [PATCH 031/117] refactor(esl-share): remove esl-share-trigger --- src/modules/esl-share/core.less | 1 - src/modules/esl-share/core/esl-share-trigger.less | 4 ---- src/modules/esl-share/core/esl-share-trigger.ts | 11 ----------- 3 files changed, 16 deletions(-) delete mode 100644 src/modules/esl-share/core/esl-share-trigger.less delete mode 100644 src/modules/esl-share/core/esl-share-trigger.ts diff --git a/src/modules/esl-share/core.less b/src/modules/esl-share/core.less index 74bd5ef52..a536d6c7a 100644 --- a/src/modules/esl-share/core.less +++ b/src/modules/esl-share/core.less @@ -1,2 +1 @@ @import "./core/esl-share-button.less"; -@import "./core/esl-share-trigger.less"; diff --git a/src/modules/esl-share/core/esl-share-trigger.less b/src/modules/esl-share/core/esl-share-trigger.less deleted file mode 100644 index e7e0a6e68..000000000 --- a/src/modules/esl-share/core/esl-share-trigger.less +++ /dev/null @@ -1,4 +0,0 @@ -esl-share-trigger { - display: inline-block; - cursor: pointer; -} diff --git a/src/modules/esl-share/core/esl-share-trigger.ts b/src/modules/esl-share/core/esl-share-trigger.ts deleted file mode 100644 index ea0808584..000000000 --- a/src/modules/esl-share/core/esl-share-trigger.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {ESLTrigger} from '../../esl-trigger/core'; -import {attr} from '../../esl-utils/decorators'; - -export class ESLShareTrigger extends ESLTrigger { - public static is = 'esl-share-trigger'; - - @attr({defaultValue: 'toggle'}) public mode: string; - @attr({defaultValue: 'all'}) public trackClick: string; - @attr({defaultValue: 'all'}) public trackHover: string; - -} From 258b1d3b9d46981118a62cf5d6f6cb84884ed597 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 16 Nov 2022 18:59:59 +0200 Subject: [PATCH 032/117] feat(esl-share): create esl-share-config --- .../esl-share/core/esl-share-config.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/modules/esl-share/core/esl-share-config.ts diff --git a/src/modules/esl-share/core/esl-share-config.ts b/src/modules/esl-share/core/esl-share-config.ts new file mode 100644 index 000000000..acff89e7a --- /dev/null +++ b/src/modules/esl-share/core/esl-share-config.ts @@ -0,0 +1,24 @@ +import type {ShareButtonConfig} from './esl-share-button'; +import type {ESLShareBaseConfigProvider, ProviderOptions, ProviderType} from './esl-share-config-provider'; + +export interface ShareGroupConfig { + id: string; + list: string; +} + +export interface ShareConfig { + buttons: ShareButtonConfig[]; + groups: ShareGroupConfig[]; +} + +export class ESLShareConfig { + protected static provider: ESLShareBaseConfigProvider; + + public static use(provider: ProviderType, options?: ProviderOptions): ESLShareConfig { + return ESLShareConfig.provider = new provider(options); + } + + public static get(): Promise { + return ESLShareConfig.provider.get(); + } +} From 79c6ea236db5d41127aa87be4b1b59710b3c3bf4 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 16 Nov 2022 19:01:51 +0200 Subject: [PATCH 033/117] feat(esl-share): create abstract base config provider --- .../esl-share/core/esl-share-config-provider.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/modules/esl-share/core/esl-share-config-provider.ts diff --git a/src/modules/esl-share/core/esl-share-config-provider.ts b/src/modules/esl-share/core/esl-share-config-provider.ts new file mode 100644 index 000000000..4b05ac2b3 --- /dev/null +++ b/src/modules/esl-share/core/esl-share-config-provider.ts @@ -0,0 +1,10 @@ +import type {ShareConfig} from './esl-share-config'; + +export type ProviderOptions = Record; +export type ProviderType = (new(options?: ProviderOptions) => ESLShareBaseConfigProvider) & typeof ESLShareBaseConfigProvider; + +export abstract class ESLShareBaseConfigProvider { + // eslint-disable-next-line @typescript-eslint/no-useless-constructor + public constructor(options?: ProviderOptions) {} + public abstract get(): Promise; +} From aebc38a1e02b4bc3351cecf4dd9e83c6dce443a8 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 16 Nov 2022 19:03:07 +0200 Subject: [PATCH 034/117] feat(esl-share): create fetch config provider --- .../config-providers/fetch-provider.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/modules/esl-share/config-providers/fetch-provider.ts diff --git a/src/modules/esl-share/config-providers/fetch-provider.ts b/src/modules/esl-share/config-providers/fetch-provider.ts new file mode 100644 index 000000000..6ee4c193c --- /dev/null +++ b/src/modules/esl-share/config-providers/fetch-provider.ts @@ -0,0 +1,20 @@ +import {ESLShareBaseConfigProvider} from '../core/esl-share-config-provider'; + +import type {ShareConfig} from '../core/esl-share-config'; + +export interface FetchConfigProviderOptions { + url: string; +} + +export class ESLShareFetchConfigProvider extends ESLShareBaseConfigProvider { + protected url: string; + + public constructor(options: FetchConfigProviderOptions) { + super(); + this.url = options.url; + } + + public get(): Promise { + return fetch(this.url).then((response) => response.json()); + } +} From 80c890f4bc2045412ccc1dc1cf8a4f4d8a978e4f Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 16 Nov 2022 19:05:17 +0200 Subject: [PATCH 035/117] refactor(esl-share): update share button --- .../esl-share/core/esl-share-button.less | 4 +-- .../esl-share/core/esl-share-button.ts | 27 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-button.less b/src/modules/esl-share/core/esl-share-button.less index 226ed323c..405f84776 100644 --- a/src/modules/esl-share/core/esl-share-button.less +++ b/src/modules/esl-share/core/esl-share-button.less @@ -1,7 +1,7 @@ esl-share-button { display: inline-block; - width: 20px; - height: 20px; + width: 40px; + height: 40px; cursor: pointer; &:hover { diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index ea8da9393..493e2432c 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -10,7 +10,7 @@ export interface ShareButtonConfig { 'iconBackground': string; 'link': string; 'name': string; - 'name_en': string; + 'title': string; } export class ESLShareButton extends ESLBaseElement { @@ -19,27 +19,26 @@ export class ESLShareButton extends ESLBaseElement { public static DEFAULT_ICON_BG_COLOR: string = '#FFF'; @attr() public action: string; - @attr() public netId: string; - @attr() public name: string; - @attr() public icon: string; + @attr() public buttonId: string; @attr() public link: string; + @attr() public name: string; public static build(cfg: ShareButtonConfig): ESLShareButton | null { if (!ESLShareActionRegistry.instance.has(cfg.action)) return null; const $button = ESLShareButton.create(); $button.$$attr('action', cfg.action); - $button.$$attr('net-id', cfg.id); + $button.$$attr('button-id', cfg.id); $button.$$attr('link', cfg.link); - $button.$$attr('name', cfg['name_en']); - $button.$$attr('tabIndex', '0'); + $button.$$attr('name', cfg.name); + $button.$$attr('tabindex', '0'); $button.$$attr('role', 'button'); - $button.$$attr('aria-label', cfg.name); - const wrapper = document.createElement('span'); - wrapper.title = cfg.name; - wrapper.classList.add('esl-share-button-icon'); - wrapper.innerHTML = cfg.icon; - wrapper.setAttribute('style', `background-color:${cfg.iconBackground || ESLShareButton.DEFAULT_ICON_BG_COLOR};`); - $button.appendChild(wrapper); + $button.$$attr('aria-label', cfg.title); + const $icon = document.createElement('span'); + $icon.title = cfg.title; + $icon.classList.add('esl-share-icon'); + $icon.innerHTML = cfg.icon; + $icon.setAttribute('style', `background-color:${cfg.iconBackground || ESLShareButton.DEFAULT_ICON_BG_COLOR};`); + $button.appendChild($icon); return $button; } From 6d3cbd202a9b0268a76324dab5f458eb90ac62a6 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 16 Nov 2022 19:10:06 +0200 Subject: [PATCH 036/117] feat(esl-share): create esl-share-list --- src/modules/esl-share/core.less | 1 + src/modules/esl-share/core.ts | 3 +- .../esl-share/core/esl-share-list.less | 3 + src/modules/esl-share/core/esl-share-list.ts | 84 +++++++++++++++++++ src/modules/esl-share/core/esl-share.ts | 28 ------- 5 files changed, 90 insertions(+), 29 deletions(-) create mode 100644 src/modules/esl-share/core/esl-share-list.less create mode 100644 src/modules/esl-share/core/esl-share-list.ts delete mode 100644 src/modules/esl-share/core/esl-share.ts diff --git a/src/modules/esl-share/core.less b/src/modules/esl-share/core.less index a536d6c7a..bf8988ec0 100644 --- a/src/modules/esl-share/core.less +++ b/src/modules/esl-share/core.less @@ -1 +1,2 @@ @import "./core/esl-share-button.less"; +@import "./core/esl-share-list.less"; diff --git a/src/modules/esl-share/core.ts b/src/modules/esl-share/core.ts index e342a0429..382c810b7 100644 --- a/src/modules/esl-share/core.ts +++ b/src/modules/esl-share/core.ts @@ -1,4 +1,5 @@ -export * from './core/esl-share'; +export * from './core/esl-share-list'; export * from './core/esl-share-action'; export * from './core/esl-share-action-registry'; export * from './core/esl-share-button'; +export * from './core/esl-share-config'; diff --git a/src/modules/esl-share/core/esl-share-list.less b/src/modules/esl-share/core/esl-share-list.less new file mode 100644 index 000000000..60519c0ca --- /dev/null +++ b/src/modules/esl-share/core/esl-share-list.less @@ -0,0 +1,3 @@ +esl-share-list { + display: inline-block; +} diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts new file mode 100644 index 000000000..8ccc46741 --- /dev/null +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -0,0 +1,84 @@ +import {ESLBaseElement} from '../../esl-base-element/core'; +import {attr, bind, boolAttr, memoize} from '../../esl-utils/decorators'; +import {ESLEventUtils} from '../../esl-utils/dom/events'; + +import {ESLShareConfig} from './esl-share-config'; +import {ESLShareButton} from './esl-share-button'; + +import type {ShareButtonConfig} from './esl-share-button'; +import type {ShareConfig} from './esl-share-config'; + +export class ESLShareList extends ESLBaseElement { + public static is = 'esl-share-list'; + + public static register(): void { + ESLShareButton.register(); + super.register(); + } + + @attr({readonly: true}) public list: string; + @attr({readonly: true}) public group: string; + @attr({dataAttr: true}) public url: string; + @attr({dataAttr: true}) public title: string; + + @boolAttr({readonly: true}) public ready: boolean; + + protected _ready: Promise; + + public get ready$(): Promise { + return this._ready ? this._ready : Promise.reject('ESL Share is not defined'); + } + + @memoize() + public get config(): Promise { + return ESLShareConfig.get(); + } + + @memoize() + public get buttonsConfig(): Promise { + return this.config.then((config) => { + const filterPredicate = this.getFilterPredicate(config); + return config.buttons.filter(filterPredicate); + }); + } + + protected getFilterPredicate(config: ShareConfig): (btn: ShareButtonConfig) => boolean { + const {group} = this; + let {list} = this; + if (group) { + const groupCfg = config.groups.find((e) => e.id === group); + if (groupCfg) { + list = groupCfg.list; + } + } + if (list) { + const buttons = list.split(',').map((id) => id.trim()); + return (btn: ShareButtonConfig): boolean => buttons.includes(btn.id); + } + return (): boolean => true; + } + + public connectedCallback(): void { + super.connectedCallback(); + if (!this._ready) { + this.init(); + } + } + + protected init(): void { + this._ready = this.buttonsConfig.then(this.buildContent); + this._ready.then(() => ESLEventUtils.dispatch(this, 'esl:share:ready')); + this._ready.catch((e) => console.error(`[${(this.constructor as typeof ESLBaseElement).is}]: ${e}`)); + } + + @bind + protected buildContent(config: ShareButtonConfig[]): void { + this.innerHTML = ''; + config.forEach((btnCfg) => { + const btn = ESLShareButton.build(btnCfg); + btn && this.appendChild(btn); + }); + + this.toggleAttribute('ready', true); + } +} diff --git a/src/modules/esl-share/core/esl-share.ts b/src/modules/esl-share/core/esl-share.ts deleted file mode 100644 index be4d0a5d4..000000000 --- a/src/modules/esl-share/core/esl-share.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {ESLBaseElement, attr, boolAttr} from '../../esl-base-element/core'; - -import {ESLShareIcon} from './esl-share-icon'; -import {ESLShareTrigger} from './esl-share-trigger'; - -export class ESLShare extends ESLBaseElement { - public static is = 'esl-share'; - - public static register(): void { - ESLShareIcon.register(); - ESLShareTrigger.register(); - super.register(); - } - - @attr({defaultValue: 'popup', readonly: true}) public layout: string; - // @attr({dataAttr: true, defaultValue: 'general'}) public realm: string; - @attr({readonly: true}) public limit: string; - @attr({readonly: true}) public preferable: string; - @attr({dataAttr: true}) public url: string; - @attr({dataAttr: true}) public title: string; - @attr({dataAttr: true}) public screenReaderTitle: string; - @attr({defaultValue: ''}) public activeClass: string; - @attr({defaultValue: ''}) public activeClassTarget: string; - - @boolAttr({readonly: true}) public ready: boolean; - - protected _ready: Promise; -} From c647d9d7661d4b610126617a36a86490f8bae5f3 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 16 Nov 2022 19:11:32 +0200 Subject: [PATCH 037/117] chore(esl-share): update localdev imports --- pages/src/localdev.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index 20ed49e8e..be8df6331 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -32,8 +32,9 @@ import { ESLFootnotes, ESLTooltip, ESLAnimate, - ESLShare, - ESLShareActionRegistry + ESLShareList, + ESLShareActionRegistry, + ESLShareConfig } from '../../src/modules/all'; import '../../src/modules/esl-media/providers/iframe-provider'; @@ -45,6 +46,7 @@ import '../../src/modules/esl-media/providers/brightcove-provider'; import {ESLShareCopyAction} from '../../src/modules/esl-share/actions/copy-action'; import {ESLShareMediaAction} from '../../src/modules/esl-share/actions/media-action'; import {ESLSharePrintAction} from '../../src/modules/esl-share/actions/print-action'; +import {ESLShareFetchConfigProvider} from '../../src/modules/esl-share/config-providers/fetch-provider'; import { ESLCarousel, @@ -111,7 +113,10 @@ ESLCarouselPlugins.Link.register(); ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); -ESLShare.register(); ESLShareActionRegistry.instance.register(ESLShareCopyAction); ESLShareActionRegistry.instance.register(ESLShareMediaAction); ESLShareActionRegistry.instance.register(ESLSharePrintAction); +ESLShareConfig.use(ESLShareFetchConfigProvider, { + url: '/assets/share/config.json' +}); +ESLShareList.register(); From 11c2733af77740596ba31acf347ff67d77147b01 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 17 Nov 2022 11:28:38 +0200 Subject: [PATCH 038/117] refactor(esl-share): update getting buttons config --- src/modules/esl-share/core/esl-share-list.ts | 30 +++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 8ccc46741..108b05a06 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -25,8 +25,12 @@ export class ESLShareList extends ESLBaseElement { protected _ready: Promise; + public get alias(): string { + return (this.constructor as typeof ESLBaseElement).is; + } + public get ready$(): Promise { - return this._ready ? this._ready : Promise.reject('ESL Share is not defined'); + return this._ready ? this._ready : Promise.reject(`[${this.alias}]: is not ready`); } @memoize() @@ -37,12 +41,22 @@ export class ESLShareList extends ESLBaseElement { @memoize() public get buttonsConfig(): Promise { return this.config.then((config) => { - const filterPredicate = this.getFilterPredicate(config); - return config.buttons.filter(filterPredicate); + const list = this.getList(config); + return list.length ? this.getButtons(config, list) : config.buttons; + }); + } + + protected getButtons(config: ShareConfig, idList: string[]): ShareButtonConfig[] { + const {buttons} = config; + const ret: ShareButtonConfig[] = []; + idList.forEach((buttonId) => { + const btnConfig = buttons.find((btn) => btn.id === buttonId); + btnConfig && ret.push(btnConfig); }); + return ret; } - protected getFilterPredicate(config: ShareConfig): (btn: ShareButtonConfig) => boolean { + protected getList(config: ShareConfig): string[] { const {group} = this; let {list} = this; if (group) { @@ -51,11 +65,7 @@ export class ESLShareList extends ESLBaseElement { list = groupCfg.list; } } - if (list) { - const buttons = list.split(',').map((id) => id.trim()); - return (btn: ShareButtonConfig): boolean => buttons.includes(btn.id); - } - return (): boolean => true; + return list ? list.split(',').map((id) => id.trim()) : []; } public connectedCallback(): void { @@ -68,7 +78,7 @@ export class ESLShareList extends ESLBaseElement { protected init(): void { this._ready = this.buttonsConfig.then(this.buildContent); this._ready.then(() => ESLEventUtils.dispatch(this, 'esl:share:ready')); - this._ready.catch((e) => console.error(`[${(this.constructor as typeof ESLBaseElement).is}]: ${e}`)); + this._ready.catch((e) => console.error(`[${this.alias}]: ${e}`)); } @bind From 7628070852db0ce3194fa8681fb4b5bc966b18b0 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 17 Nov 2022 11:34:50 +0200 Subject: [PATCH 039/117] docs(esl-share): add share buttons config --- pages/static/assets/share/config.json | 176 ++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 pages/static/assets/share/config.json diff --git a/pages/static/assets/share/config.json b/pages/static/assets/share/config.json new file mode 100644 index 000000000..700827910 --- /dev/null +++ b/pages/static/assets/share/config.json @@ -0,0 +1,176 @@ +{ + "buttons": [ + { + "id": "facebook", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 27.99 28\"\u003e\u003cpath d\u003d\"M23 17.11l.55-4.24h-4.2v-2.71c0-1.23.34-2.06 2.1-2.06h2.25V4.29a31.62 31.62 0 00-3.28-.16c-3.24 0-5.46 2-5.46 5.61v3.13h-3.63v4.24H15V28h4.39V17.11z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#3c5996", + "link": "//www.facebook.com/sharer.php?u\u003d{u}", + "name": "Facebook", + "title": "Facebook" + }, + { + "id": "linkedin", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 27.99 27.99\"\u003e\u003cpath d\u003d\"M6.37 11.33h3.25v10.45H6.37zM8 6.13A1.88 1.88 0 116.12 8 1.88 1.88 0 018 6.13M11.65 11.33h3.12v1.43h.05a3.4 3.4 0 013.07-1.69c3.29 0 3.9 2.17 3.9 5v5.73h-3.25v-5.11c0-1.21 0-2.77-1.69-2.77s-1.94 1.32-1.94 2.69v5.17h-3.25V11.33z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#0b77b3", + "link": "//www.linkedin.com/sharing/share-offsite/?url\u003d{u}", + "name": "Linkedin", + "title": "Linkedin" + }, + { + "id": "twitter", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 27.99 27.99\"\u003e\u003cpath d\u003d\"M21.84 9.14a6.34 6.34 0 01-1.84.51 3.25 3.25 0 001.4-1.78 6.22 6.22 0 01-2 .78 3.22 3.22 0 00-5.57 2.2 2.92 2.92 0 00.09.73 9.11 9.11 0 01-6.67-3.36 3.16 3.16 0 00-.43 1.62 3.21 3.21 0 001.43 2.68 3.25 3.25 0 01-1.46-.41 3.23 3.23 0 002.58 3.16 3 3 0 01-.84.11 3 3 0 01-.61-.05 3.22 3.22 0 003 2.23 6.39 6.39 0 01-4 1.38 6.19 6.19 0 01-.76-.05 9.14 9.14 0 0014.08-7.71v-.41a6.36 6.36 0 001.6-1.63z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#26a1ef", + "link": "//twitter.com/intent/tweet?text\u003d{t}\u0026url\u003d{u}", + "name": "Twitter", + "title": "Twitter" + }, + { + "id": "tumblr", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 455.731 455.731\"\u003e\u003cpath d\u003d\"M336.473 330.067v55.802c-.103.043-.214.086-.317.129-6.631 3.105-13.374 5.953-20.228 8.544-16.307 6.159-33.172 9.591-50.586 10.337-1.536.06-3.071.163-4.615.24-3.371 0-10.56-.086-10.791-.094-5.379-.146-10.731-.566-16.067-1.27-8.758-1.167-17.311-3.165-25.598-6.271-13.168-4.915-24.774-12.198-34.399-22.527-7.463-8.012-12.464-17.242-14.437-28.085-1.501-8.278-2.093-16.616-2.093-25.006-.034-41.613-.017-84.179-.017-125.792h-38.066v-50.749c4.212-1.664 8.445-3.122 12.554-5.027 21.729-10.097 37.624-26.095 47.712-47.815 4.933-10.637 7.703-21.926 9.608-33.455.463-2.797.832-5.61 1.244-8.415h50.269l.017 89.806h84.102v55.656h-84.144s.051 99.011.129 102.313c.18 7.523.54 15.029 1.69 22.484 1.244 8.012 5.25 14.223 12.001 18.666 6.614 4.349 13.914 6.837 21.772 7.678 7.815.841 15.57.249 23.264-1.304 13.431-2.703 25.613-8.347 36.996-15.845z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#0b77b3", + "link": "//tumblr.com/widgets/share/tool?canonicalUrl\u003d{u}", + "name": "Tumblr", + "title": "Tumblr" + }, + { + "id": "reddit", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M27 15.5a2.452 2.452 0 01-1.338 2.21c.098.38.147.777.147 1.19 0 1.283-.437 2.47-1.308 3.563-.872 1.092-2.06 1.955-3.567 2.588-1.506.634-3.143.95-4.91.95-1.768 0-3.403-.316-4.905-.95-1.502-.632-2.69-1.495-3.56-2.587-.872-1.092-1.308-2.28-1.308-3.562 0-.388.045-.777.135-1.166a2.47 2.47 0 01-1.006-.912c-.253-.4-.38-.842-.38-1.322 0-.678.237-1.26.712-1.744a2.334 2.334 0 011.73-.726c.697 0 1.29.26 1.78.782 1.785-1.258 3.893-1.928 6.324-2.01l1.424-6.467a.42.42 0 01.184-.26.4.4 0 01.32-.063l4.53 1.006c.147-.306.368-.553.662-.74a1.78 1.78 0 01.97-.278c.508 0 .94.18 1.302.54.36.36.54.796.54 1.31 0 .512-.18.95-.54 1.315-.36.364-.794.546-1.302.546-.507 0-.94-.18-1.295-.54a1.793 1.793 0 01-.533-1.308l-4.1-.92-1.277 5.86c2.455.074 4.58.736 6.37 1.985a2.315 2.315 0 011.757-.757c.68 0 1.256.242 1.73.726.476.484.713 1.066.713 1.744zm-16.868 2.47c0 .513.178.95.534 1.315.356.365.787.547 1.295.547.508 0 .942-.182 1.302-.547.36-.364.54-.802.54-1.315 0-.513-.18-.95-.54-1.31-.36-.36-.794-.54-1.3-.54-.5 0-.93.183-1.29.547a1.79 1.79 0 00-.54 1.303zm9.944 4.406c.09-.09.135-.2.135-.323a.444.444 0 00-.44-.447c-.124 0-.23.042-.32.124-.336.348-.83.605-1.486.77a7.99 7.99 0 01-1.964.248 7.99 7.99 0 01-1.964-.248c-.655-.165-1.15-.422-1.486-.77a.456.456 0 00-.32-.124.414.414 0 00-.306.124.41.41 0 00-.135.317.45.45 0 00.134.33c.352.355.837.636 1.455.843.617.207 1.118.33 1.503.366a11.6 11.6 0 001.117.056c.36 0 .733-.02 1.117-.056.385-.037.886-.16 1.504-.366.62-.207 1.104-.488 1.456-.844zm-.037-2.544c.507 0 .938-.182 1.294-.547.356-.364.534-.802.534-1.315 0-.505-.18-.94-.54-1.303a1.75 1.75 0 00-1.29-.546c-.506 0-.94.18-1.3.54-.36.36-.54.797-.54 1.31s.18.95.54 1.315c.36.365.794.547 1.3.547z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", + "iconBackground": "#ff5700", + "link": "//www.reddit.com/submit?url\u003d{u}\u0026title\u003d{t}", + "name": "Reddit", + "title": "Reddit" + }, + { + "id": "myspace", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M19.996 11.757c1.905 0 3.45-1.513 3.45-3.38C23.445 6.513 21.9 5 19.995 5c-1.903 0-3.448 1.512-3.448 3.378s1.545 3.38 3.448 3.38zm4.995 5.233c-.09-2.574-2.242-4.638-4.893-4.638a4.934 4.934 0 00-3.24 1.206 3.62 3.62 0 00-3.318-2.133c-.944 0-1.8.356-2.443.935a2.596 2.596 0 00-2.494-1.82c-1.407 0-2.55 1.093-2.6 2.462H6v4.783h3.92v3.712h5.276V26H25v-9.01h-.01zm-11.526-6.006c1.405 0 2.545-1.116 2.545-2.492C16.01 7.115 14.87 6 13.463 6 12.06 6 10.92 7.114 10.92 8.49c0 1.376 1.14 2.492 2.544 2.492zm-4.914-.762c1.012 0 1.83-.803 1.83-1.794 0-.992-.818-1.795-1.83-1.795-1.01 0-1.83.804-1.83 1.795 0 .99.82 1.794 1.83 1.794z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", + "iconBackground": "#282828", + "link": "//myspace.com/post?u\u003d{u}", + "name": "Myspace", + "title": "Myspace" + }, + { + "id": "mix", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M26 6v11.077C26 18.123 25.105 19 24 19s-2-.877-2-1.923v-1a2 2 0 00-2-2 2 2 0 00-2 2v2.846c-.02 1.046-.915 1.923-2 1.923-1.12 0-2.013-.877-2-1.923V11.23a2.036 2.036 0 00-2-2c-1.062.024-1.922.822-2 1.847-.003.025-.003 4.275 0 12.75 0 1.045-.895 1.923-2 1.923s-2-.878-2-1.923V6h20z\" opacity\u003d\".8\"/\u003e\u003cpath d\u003d\"M6 6v10.77c2.135-.006 3.878-1.648 4-3.693V11.23a.702.702 0 010-.153c.078-1.025.938-1.823 2-1.846 1.092.024 1.986.902 2 2v7.693c-.013 1.046.88 1.923 2 1.923 1.085 0 1.98-.877 2-1.923v-5.23C17.98 9.458 21.502 6 25.846 6H6\"/\u003e\u003c/svg\u003e", + "iconBackground": "#eb4924", + "link": "//mix.com/add?url\u003d{u}", + "name": "MIX", + "title": "MIX" + }, + { + "id": "wykop", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M14.722 19.784l-3.48-6.832-2.667 1.36 3.82 7.497.056-.03.313.61 10.608-5.404-.48-.944-3.65-7.165-2.667 1.36 3.48 6.83-1.332.68-3.48-6.832-2.666 1.358 3.48 6.832-1.332.68z\"/\u003e\u003cpath d\u003d\"M7.372 12.77c0-2.38 1.86-4.308 4.152-4.308h8.952c2.294 0 4.152 1.928 4.152 4.308v6.46c0 2.38-1.86 4.308-4.152 4.308h-8.952c-2.294 0-4.152-1.928-4.152-4.308v-6.46zM5 12.77v6.46C5 22.97 7.92 26 11.524 26h8.952C24.08 26 27 22.97 27 19.23v-6.46C27 9.03 24.08 6 20.476 6h-8.952C7.92 6 5 9.03 5 12.77z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#fb803f", + "link": "//www.wykop.pl/dodaj?url\u003d{u}\u0026title\u003d{t}", + "name": "Wykop", + "title": "Wykop" + }, + { + "id": "blogger", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M19.864 21.38H11.84a1.712 1.712 0 010-3.425h8.024a1.712 1.712 0 010 3.425zm-7.542-11.27l4.012.063a1.712 1.712 0 01-.054 3.424l-4.012-.064a1.712 1.712 0 01.054-3.424zm13.4 9.404c-.007-.374-.008-.71-.01-1.014-.006-1.58-.012-2.83-1.016-3.803-.716-.694-1.565-.914-2.855-.962.176-.747.226-1.575.145-2.47-.02-2.973-2.234-5.18-5.304-5.264h-.043l-4.692.072c-1.844-.007-3.3.53-4.332 1.606-.638.666-1.362 1.83-1.45 3.72H6.16v.057a8.6 8.6 0 00-.006.393l-.12 7.125c-.008.143-.015.288-.016.437-.12 2.088.372 3.728 1.463 4.876 1.078 1.132 2.664 1.706 4.715 1.706h7.32c1.84-.017 3.393-.624 4.494-1.757 1.1-1.132 1.692-2.743 1.713-4.66v-.06z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", + "iconBackground": "#f57d00", + "link": "//blogger.com/blog-this.g?n\u003d{t}\u0026u\u003d{u}", + "name": "Blogger", + "title": "Blogger" + }, + { + "id": "pusha", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M29.27 22.19V8.07l-12.06 6.85 3.84 2.33C15.72 24.14 5.9 29.31 0 31.96V32h19.64c3.68-4.86 7.03-11.46 7.03-11.46l2.6 1.65z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#0878ba", + "link": "//www.pusha.se/posta?url\u003d{u}\u0026title\u003d{t}", + "name": "Pusha", + "title": "Pusha" + }, + { + "id": "kakao", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M20.826 6h-9.652C10.524 6 10 6.51 10 7.138v9.336c0 .63.525 1.14 1.174 1.14h4.45c-.03 1.11-.507 2.318-1.196 3.39-.775 1.207-2.426 2.543-2.44 2.555-.13.12-.226.26-.23.456 0 .15.08.263.167.385l3.104 3.395s.15.154.274.183c.14.033.3.037.41-.045 5.374-4.032 6.15-9.085 6.285-11.82V7.137C22 6.508 21.475 6 20.826 6\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", + "iconBackground": "#fab900", + "link": "//story.kakao.com/share?url\u003d{u}", + "name": "Kakao", + "title": "Kakao" + }, + { + "id": "line", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M27 14.927c0 1.97-.764 3.744-2.358 5.492-2.307 2.655-7.468 5.89-8.642 6.385-1.174.495-1-.315-.953-.593l.157-.94c.037-.282.075-.718-.035-.996-.125-.306-.612-.465-.97-.542-5.287-.7-9.2-4.395-9.2-8.807C5 10.005 9.935 6 16 6c6.066 0 11 4.005 11 8.927zm-13.235-2.38h-.772a.214.214 0 00-.214.215v4.793c0 .118.095.214.213.214h.772a.214.214 0 00.214-.215v-4.793a.214.214 0 00-.215-.214zm5.31 0h-.77a.214.214 0 00-.215.215v2.848l-2.197-2.967a.235.235 0 00-.017-.023l-.014-.013-.003-.004c-.005-.003-.01-.006-.013-.01-.002 0-.003-.002-.005-.004l-.01-.008a.262.262 0 00-.018-.01c-.004 0-.006-.003-.008-.004a.605.605 0 00-.013-.005l-.007-.002a.106.106 0 00-.02-.005.098.098 0 00-.012-.003h-.01c-.003-.002-.006-.002-.01-.003-.004 0-.007 0-.01-.002h-.78a.214.214 0 00-.214.214v4.793c0 .118.095.214.214.214h.77a.214.214 0 00.216-.215v-2.847l2.2 2.97c.014.022.033.04.053.053 0 .002.002.002.002.003l.014.008c0 .002.003.003.005.004l.01.005c.003 0 .007.002.01.004.003 0 .004 0 .007.002l.014.005s.002 0 .003.002a.206.206 0 00.054.007h.772a.214.214 0 00.214-.215v-4.793a.214.214 0 00-.214-.214zm-7.17 4.022H9.81V12.76a.214.214 0 00-.216-.214h-.77a.214.214 0 00-.216.214v4.793c0 .058.023.11.06.148l.003.003c.002 0 .003.002.005.003.038.036.09.06.147.06h3.083a.214.214 0 00.214-.215v-.772a.214.214 0 00-.215-.214zm11.432-2.822a.214.214 0 00.214-.214v-.77a.214.214 0 00-.213-.216h-3.082a.213.213 0 00-.15.06s0 .002-.002.003c0 .002-.003.003-.004.005a.214.214 0 00-.06.147v4.793c0 .057.023.11.06.148l.003.003.003.003c.04.036.09.06.148.06h3.083a.214.214 0 00.214-.215v-.772a.214.214 0 00-.213-.214H21.24v-.812h2.097a.214.214 0 00.214-.214v-.77a.214.214 0 00-.213-.216H21.24v-.81h2.097z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", + "iconBackground": "#00b900", + "link": "//social-plugins.line.me/lineit/share?url\u003d{u}", + "name": "LINE", + "title": "LINE" + }, + { + "id": "qzone", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M24.307 19.276c.876-.158.442-.484.084-.442-.65.067-1.575.075-2.593.05l.118.693a25.58 25.58 0 002.392-.3zm2.686-6.814a.206.206 0 00-.175-.142l-7.34-1.067-3.285-6.647c-.075-.14-.31-.14-.384 0l-3.286 6.647-7.34 1.067a.208.208 0 00-.174.142.214.214 0 00.058.217l5.312 5.178-1.25 7.305a.205.205 0 00.083.21c.066.05.15.057.225.015l6.57-3.444 6.565 3.453.1.025.125-.042c.067-.05.1-.125.083-.208l-.958-5.596c-1.06.084-2.118.124-2.977.124-3.01 0-5.262-.142-5.296-.142a.642.642 0 01-.576-.458.633.633 0 01.233-.692l6.055-4.404c-3.894-.308-7.163-.25-7.196-.25-.526.025-1-.142.025-.56.176-.066 4.254-.924 8.974-.29.26.033.468.224.535.475a.647.647 0 01-.244.674l-5.92 4.303c1.084.226 3.91.468 6.262.526l-.176-1.025 5.31-5.18a.208.208 0 00.06-.216z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", + "iconBackground": "#0985dd", + "link": "//sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url\u003d{u}", + "name": "Qzone", + "title": "Qzone" + }, + { + "id": "sina_weibo", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M14.24 23.808c-3.64.367-6.785-1.307-7.022-3.734-.236-2.43 2.525-4.693 6.164-5.06 3.642-.367 6.786 1.307 7.02 3.734.24 2.43-2.522 4.696-6.16 5.06m7.28-8.063c-.31-.096-.523-.157-.362-.57.352-.898.39-1.672.006-2.227-.713-1.036-2.667-.98-4.907-.028 0 0-.705.312-.523-.253.343-1.125.29-2.065-.243-2.61-1.214-1.238-4.446.045-7.216 2.86C6.205 15.023 5 17.26 5 19.192c0 3.694 4.664 5.942 9.226 5.942 5.98 0 9.96-3.53 9.96-6.333.003-1.695-1.402-2.657-2.665-3.055m3.973-6.763a5.76 5.76 0 00-5.542-1.823.855.855 0 00-.646 1.015.84.84 0 001 .657c1.398-.303 2.912.138 3.938 1.295a4.254 4.254 0 01.865 4.113c-.144.45.1.93.542 1.076a.84.84 0 001.06-.55v-.002a5.973 5.973 0 00-1.218-5.78\"/\u003e\u003cpath d\u003d\"M23.276 11.018a2.8 2.8 0 00-2.698-.885.74.74 0 00-.56.876c.086.396.472.65.86.563.467-.102.977.046 1.32.432.343.388.437.915.29 1.378a.742.742 0 00.466.928.724.724 0 00.913-.474c.3-.947.113-2.026-.59-2.818M14.44 19.41c-.126.223-.408.328-.627.235-.218-.09-.285-.34-.16-.555.127-.215.397-.32.612-.234.22.08.298.33.176.555m-1.16 1.512c-.353.57-1.11.82-1.676.558-.56-.26-.726-.922-.374-1.48.35-.555 1.078-.802 1.642-.56.57.25.753.905.407 1.482m1.322-4.04c-1.733-.46-3.69.42-4.443 1.97-.77 1.583-.025 3.34 1.723 3.914 1.815.595 3.95-.318 4.695-2.023.734-1.67-.182-3.39-1.976-3.86\"/\u003e\u003c/svg\u003e", + "iconBackground": "#e6162d", + "link": "//service.weibo.com/share/share.php?url\u003d{u}\u0026title\u003d{t}", + "name": "Sina Weibo", + "title": "Sina Weibo" + }, + { + "id": "mixi", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M16.087 5.36c-6.414 0-11.97 3.93-11.97 11.265 0 6.865 7.628 10.092 12.635 8.918v2.348S27.88 24.958 27.88 15.04c0-6.043-4.458-9.68-11.793-9.68zm6.768 14.63h-1.643v-5.634c0-.703-.506-1.565-1.566-1.565-.89 0-2.504.374-2.504 2.06v5.14H15.5v-5.202c0-1.57-.782-2.073-1.486-2.073-1.14 0-2.698.802-2.698 2.384v4.89H9.673v-8.92h1.643v1.02c.654-.538 1.548-1.02 2.698-1.02 1.21 0 2.07.428 2.58 1.27a4.444 4.444 0 013.052-1.19c1.947 0 3.21 1.772 3.21 3.172v5.667z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#cfab59", + "link": "//mixi.jp/share.pl?u\u003d{u}", + "name": "Mixi", + "title": "Mixi" + }, + { + "id": "hatena", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M6.96 8.22h7.33c1.25 0 2.21.37 2.88 1.1s1 1.64 1 2.72c0 .91-.24 1.69-.72 2.34-.32.43-.78.77-1.4 1.02.93.27 1.61.72 2.05 1.37.44.65.66 1.46.66 2.43 0 .8-.16 1.51-.47 2.15-.31.64-.74 1.14-1.28 1.51-.34.23-.84.4-1.52.5-.9.14-1.5.21-1.79.21H6.96V8.22zm3.88 6.02h1.74c.62 0 1.06-.13 1.3-.38.24-.26.37-.62.37-1.1 0-.44-.12-.8-.37-1.05-.24-.25-.67-.38-1.27-.38h-1.77v2.91zm0 6.03h2.04c.69 0 1.18-.15 1.46-.43s.43-.68.43-1.17c0-.45-.14-.82-.42-1.09-.28-.28-.77-.41-1.47-.41h-2.03c-.01-.01-.01 3.1-.01 3.1zM21.21 8.41h3.58v9.58h-3.58z\"/\u003e\u003ccircle cx\u003d\"23\" cy\u003d\"21.53\" r\u003d\"2.04\"/\u003e\u003c/svg\u003e", + "iconBackground": "#08aed9", + "link": "//b.hatena.ne.jp/entry/panel/?url\u003d{u}\u0026btitle\u003d{t}", + "name": "Hatena", + "title": "Hatena" + }, + { + "id": "mail", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M4.63 6.94v14.1h18.8V6.94H4.63zm2.44 1.78h13.9l-6.93 5.67-6.93-5.67zm14.6 1.72v8.82H6.47v-8.79l7.59 6.21 7.63-6.24z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#0b77b3", + "link": "mailto:?subject\u003d{t}\u0026body\u003d{u}", + "name": "Mail", + "title": "Mail" + }, + { + "action": "copy", + "name_en": "Copy", + "name": "Copy", + "id": "copy", + "link": "", + "iconBackground": "#3c5996", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M17 9.69l-7.43 7.43 1.18 1.18 7.43-7.43L17 9.69z\"/\u003e\u003cpath d\u003d\"M4.31 17.8c-.481.481-.48 1.29.00138 1.77l4.02 4.02c.481.481 1.29.483 1.77.00138l4.95-4.95c.481-.481.481-1.29-7e-7-1.78l-4.02-4.02c-.481-.481-1.29-.481-1.78 0l-4.95 4.95zm1.47.887l4.36-4.36 3.44 3.44-4.36 4.36-3.44-3.44zm7-9.37c-.481.481-.481 1.29 2.8e-7 1.78l4.02 4.02c.481.481 1.29.481 1.78 0l4.95-4.95c.481-.481.48-1.29-.00138-1.77l-4.02-4.02c-.481-.481-1.29-.483-1.77-.00138l-4.95 4.95zm1.47.889l4.36-4.36 3.44 3.44-4.36 4.36-3.44-3.44z\"/\u003e\u003c/svg\u003e" + } + ], + "groups": [ + { + "id": "demo", + "list": "facebook,twitter,linkedin,wykop,copy" + }, + { + "id": "alternative", + "list": "kakao,hatena,mixi,line,mail" + } + ] +} From ae70066122f8590d7541504e2bda5a860d5291dd Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 17 Nov 2022 12:59:36 +0200 Subject: [PATCH 040/117] docs(esl-share): update esl-share demo page --- pages/views/examples/share.njk | 62 ++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index e4bce5032..09f90ae12 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -13,22 +13,54 @@ aside:

Share example

-
- - - - - -
- - + +
- +

Display list of share buttons of group 'demo'

+

Shows buttons from a specified group.

+ +
-
+

Display list of share buttons of group 'alternative'

+

Shows buttons from a specified group.

+ +
+ +

Display list of share buttons on nonexistent group

+

Shows buttons from a specified group. Displays all buttons from config when a nonexistent group is specified.

+ +
+ +

Display list of share buttons via list of buttons id

+

Shows specified buttons. Displays nothing in the case when specified wrong button id.

+ +
+ +

Display list of share buttons via incorrect list

+

Shows buttons only with the correct id.

+ +
+ +

Display list of share buttons (without group or list)

+

Shows all buttons from config.

+ +
+ +

Trigger icon with share popup

+

Displays trigger icon. Hovering or clicking on the icon shows a popup with the list of share icons.

+ + + + + + + + + +
From 2a7373474ba89f089b7a9b8949ced2b56aa521f0 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 17 Nov 2022 13:44:47 +0200 Subject: [PATCH 041/117] refactor(esl-share): create share buttons getter shareData() --- src/modules/esl-share/actions/copy-action.ts | 5 ++-- src/modules/esl-share/actions/media-action.ts | 5 ++-- .../esl-share/core/esl-share-button.ts | 27 ++++++++++++++++++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index 770c2df56..8ea259c93 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -18,13 +18,14 @@ export class ESLShareCopyAction extends ESLShareBaseAction { protected get alertParams(): AlertActionParams { return { cls: 'esl-share-alert', - html: `${this.alertIcon} ${this.alertText}` + html: ` ${this.alertText}` }; } public do(): void { if (navigator.clipboard !== undefined) { - navigator.clipboard.writeText(window.location.href,); + const {shareData} = this.$button; + navigator.clipboard.writeText(shareData.url); this.showCopyAlert(); } } diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index ad630ee42..6d6d397bc 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -17,9 +17,10 @@ export class ESLShareMediaAction extends ESLShareBaseAction { }; protected get formatSource(): Record { + const {shareData} = this.$button; return { - u: encodeURIComponent(window.location.href), - t: encodeURIComponent(document.title) + u: encodeURIComponent(shareData.url), + t: encodeURIComponent(shareData.title) }; } diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 493e2432c..f6137afbd 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -1,8 +1,10 @@ import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr, listen} from '../../esl-utils/decorators'; +import {attr, listen, memoize} from '../../esl-utils/decorators'; import {ENTER, SPACE} from '../../esl-utils/dom/keys'; import {ESLShareActionRegistry} from './esl-share-action-registry'; +import type {ESLShareList} from './esl-share-list'; + export interface ShareButtonConfig { 'action': string; 'id': string; @@ -13,6 +15,11 @@ export interface ShareButtonConfig { 'title': string; } +export interface ShareData { + url: string; + title: string; +} + export class ESLShareButton extends ESLBaseElement { public static is = 'esl-share-button'; @@ -42,6 +49,24 @@ export class ESLShareButton extends ESLBaseElement { return $button; } + protected static convertToAbsolutePath(path: string): string { + return new URL(path, document.baseURI).href; + } + + @memoize() + public get host(): ESLShareList | null { + return this.closest('esl-share-list'); + } + + public get shareData(): ShareData { + const {host} = this; + + return { + url: (host && host.url) ? ESLShareButton.convertToAbsolutePath(host.url) : window.location.href, + title: (host && host.title) ? host.title : document.title + }; + } + protected beforeAction(): void {} protected doAction(): void { From 9c82115b8d5f13b48b20cd7173bad893b0352f43 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 17 Nov 2022 13:47:34 +0200 Subject: [PATCH 042/117] style(esl-share): update esl-share-list styles --- src/modules/esl-share/core/esl-share-list.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/esl-share/core/esl-share-list.less b/src/modules/esl-share/core/esl-share-list.less index 60519c0ca..11d53983a 100644 --- a/src/modules/esl-share/core/esl-share-list.less +++ b/src/modules/esl-share/core/esl-share-list.less @@ -1,3 +1,4 @@ esl-share-list { display: inline-block; + line-height: 0; } From 614cb24cf49e7e5aafbc8f9b05624328b04d40b7 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Tue, 22 Nov 2022 21:59:43 +0200 Subject: [PATCH 043/117] docs(esl-share): update config with several social media --- pages/static/assets/share/config.json | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pages/static/assets/share/config.json b/pages/static/assets/share/config.json index 700827910..9b88967db 100644 --- a/pages/static/assets/share/config.json +++ b/pages/static/assets/share/config.json @@ -27,15 +27,6 @@ "name": "Twitter", "title": "Twitter" }, - { - "id": "tumblr", - "action": "media", - "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 455.731 455.731\"\u003e\u003cpath d\u003d\"M336.473 330.067v55.802c-.103.043-.214.086-.317.129-6.631 3.105-13.374 5.953-20.228 8.544-16.307 6.159-33.172 9.591-50.586 10.337-1.536.06-3.071.163-4.615.24-3.371 0-10.56-.086-10.791-.094-5.379-.146-10.731-.566-16.067-1.27-8.758-1.167-17.311-3.165-25.598-6.271-13.168-4.915-24.774-12.198-34.399-22.527-7.463-8.012-12.464-17.242-14.437-28.085-1.501-8.278-2.093-16.616-2.093-25.006-.034-41.613-.017-84.179-.017-125.792h-38.066v-50.749c4.212-1.664 8.445-3.122 12.554-5.027 21.729-10.097 37.624-26.095 47.712-47.815 4.933-10.637 7.703-21.926 9.608-33.455.463-2.797.832-5.61 1.244-8.415h50.269l.017 89.806h84.102v55.656h-84.144s.051 99.011.129 102.313c.18 7.523.54 15.029 1.69 22.484 1.244 8.012 5.25 14.223 12.001 18.666 6.614 4.349 13.914 6.837 21.772 7.678 7.815.841 15.57.249 23.264-1.304 13.431-2.703 25.613-8.347 36.996-15.845z\"/\u003e\u003c/svg\u003e", - "iconBackground": "#0b77b3", - "link": "//tumblr.com/widgets/share/tool?canonicalUrl\u003d{u}", - "name": "Tumblr", - "title": "Tumblr" - }, { "id": "reddit", "action": "media", @@ -72,6 +63,24 @@ "name": "Wykop", "title": "Wykop" }, + { + "id": "pinterest", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 24 24\"\u003e\u003cpath d\u003d\"M12.486 4.771c-4.23 0-6.363 3.033-6.363 5.562 0 1.533.581 2.894 1.823 3.401.205.084.387.004.446-.221l.182-.717c.061-.221.037-.3-.127-.495-.359-.422-.588-.972-.588-1.747 0-2.25 1.683-4.264 4.384-4.264 2.392 0 3.706 1.463 3.706 3.412 0 2.568-1.137 4.734-2.824 4.734-.932 0-1.629-.77-1.405-1.715.268-1.13.786-2.347.786-3.16 0-.729-.392-1.336-1.2-1.336-.952 0-1.718.984-1.718 2.304 0 .841.286 1.409.286 1.409L8.728 16.79c-.34 1.44-.051 3.206-.025 3.385.013.104.149.131.21.051.088-.115 1.223-1.517 1.607-2.915.111-.396.627-2.445.627-2.445.311.589 1.213 1.108 2.175 1.108 2.863 0 4.804-2.608 4.804-6.103-.003-2.64-2.24-5.1-5.64-5.1z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#e60023", + "link": "//www.pinterest.com/pin/create/button/?url\u003d{u}\u0026description\u003d{t}", + "name": "Pinterest", + "title": "Pinterest" + }, + { + "id": "telegram", + "action": "media", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 455.731 455.731\"\u003e\u003cpath d\u003d\"M358.844 100.6 54.091 219.359c-9.871 3.847-9.273 18.012.888 21.012l77.441 22.868 28.901 91.706c3.019 9.579 15.158 12.483 22.185 5.308l40.039-40.882 78.56 57.665c9.614 7.057 23.306 1.814 25.747-9.859l52.031-248.76c2.548-12.185-9.44-22.337-21.039-17.817zm-38.208 55.206L179.08 280.984c-1.411 1.248-2.309 2.975-2.519 4.847l-5.45 48.448c-.178 1.58-2.389 1.789-2.861.271l-22.423-72.253c-1.027-3.308.312-6.892 3.255-8.717l167.163-103.676c3.844-2.386 7.78 2.906 4.391 5.902z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#61a8de", + "link": "//t.me/share/url?url\u003d{u}\u0026text\u003d{t}", + "name": "Telegram", + "title": "Telegram" + }, { "id": "blogger", "action": "media", @@ -108,15 +117,6 @@ "name": "LINE", "title": "LINE" }, - { - "id": "qzone", - "action": "media", - "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M24.307 19.276c.876-.158.442-.484.084-.442-.65.067-1.575.075-2.593.05l.118.693a25.58 25.58 0 002.392-.3zm2.686-6.814a.206.206 0 00-.175-.142l-7.34-1.067-3.285-6.647c-.075-.14-.31-.14-.384 0l-3.286 6.647-7.34 1.067a.208.208 0 00-.174.142.214.214 0 00.058.217l5.312 5.178-1.25 7.305a.205.205 0 00.083.21c.066.05.15.057.225.015l6.57-3.444 6.565 3.453.1.025.125-.042c.067-.05.1-.125.083-.208l-.958-5.596c-1.06.084-2.118.124-2.977.124-3.01 0-5.262-.142-5.296-.142a.642.642 0 01-.576-.458.633.633 0 01.233-.692l6.055-4.404c-3.894-.308-7.163-.25-7.196-.25-.526.025-1-.142.025-.56.176-.066 4.254-.924 8.974-.29.26.033.468.224.535.475a.647.647 0 01-.244.674l-5.92 4.303c1.084.226 3.91.468 6.262.526l-.176-1.025 5.31-5.18a.208.208 0 00.06-.216z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", - "iconBackground": "#0985dd", - "link": "//sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url\u003d{u}", - "name": "Qzone", - "title": "Qzone" - }, { "id": "sina_weibo", "action": "media", From f38d40218263955aac68b6439cda1120b76a5e1b Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 30 Nov 2022 23:38:33 +0200 Subject: [PATCH 044/117] feat(esl-share): add static register() method to register the action --- pages/src/localdev.ts | 6 +++--- src/modules/esl-share/actions/copy-action.ts | 1 + src/modules/esl-share/actions/media-action.ts | 1 + src/modules/esl-share/actions/print-action.ts | 1 + src/modules/esl-share/core/esl-share-action.ts | 14 +++++++++++++- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index 9401432e5..16039accc 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -114,9 +114,9 @@ ESLCarouselPlugins.Link.register(); ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); -ESLShareActionRegistry.instance.register(ESLShareCopyAction); -ESLShareActionRegistry.instance.register(ESLShareMediaAction); -ESLShareActionRegistry.instance.register(ESLSharePrintAction); +ESLShareCopyAction.register(); +ESLShareMediaAction.register(); +ESLSharePrintAction.register(); ESLShareConfig.use(ESLShareFetchConfigProvider, { url: '/assets/share/config.json' }); diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index 8ea259c93..7a56f3ed0 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -3,6 +3,7 @@ import {ESLEventUtils} from '../../esl-utils/dom/events'; import type {AlertActionParams} from '../../esl-alert/core'; +@ESLShareBaseAction.register export class ESLShareCopyAction extends ESLShareBaseAction { public static readonly is: string = 'copy'; diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index 6d6d397bc..d101c9f29 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -1,6 +1,7 @@ import {ESLShareBaseAction} from '../core/esl-share-action'; import {format} from '../../esl-utils/misc/format'; +@ESLShareBaseAction.register export class ESLShareMediaAction extends ESLShareBaseAction { public static readonly is: string = 'media'; diff --git a/src/modules/esl-share/actions/print-action.ts b/src/modules/esl-share/actions/print-action.ts index 3aa50a310..220e58be9 100644 --- a/src/modules/esl-share/actions/print-action.ts +++ b/src/modules/esl-share/actions/print-action.ts @@ -1,5 +1,6 @@ import {ESLShareBaseAction} from '../core/esl-share-action'; +@ESLShareBaseAction.register export class ESLSharePrintAction extends ESLShareBaseAction { public static readonly is: string = 'print'; diff --git a/src/modules/esl-share/core/esl-share-action.ts b/src/modules/esl-share/core/esl-share-action.ts index b601b950e..b187e89a8 100644 --- a/src/modules/esl-share/core/esl-share-action.ts +++ b/src/modules/esl-share/core/esl-share-action.ts @@ -1,9 +1,21 @@ +import {ESLShareActionRegistry} from './esl-share-action-registry'; + import type {ESLShareButton} from './esl-share-button'; export type ActionType = (new($button: ESLShareButton) => ESLShareBaseAction) & typeof ESLShareBaseAction; export abstract class ESLShareBaseAction { - static readonly is: string; + public static readonly is: string; + + /** Register this action. Can be used as a decorator */ + public static register(this: ActionType): void; + public static register(this: unknown, action?: ActionType): void; + public static register(this: any, action?: ActionType): void { + action = action || this; + if (action === ESLShareBaseAction) throw new Error('`ESLShareBaseAction` can\'t be registered.'); + if (!(action?.prototype instanceof ESLShareBaseAction)) throw new Error('Action should be instanceof `ESLShareBaseAction`'); + ESLShareActionRegistry.instance.register(action); + } public constructor(protected $button: ESLShareButton) {} From dbffaf3fba9ab080f94971b23d2e0b4b3ac966be Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 1 Dec 2022 20:01:03 +0200 Subject: [PATCH 045/117] feat(esl-share): create URL generic action --- src/modules/esl-share/actions/media-action.ts | 22 +++++-------------- .../esl-share/actions/url-generic-action.ts | 17 ++++++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 src/modules/esl-share/actions/url-generic-action.ts diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index d101c9f29..18eeeb9d3 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -1,8 +1,7 @@ -import {ESLShareBaseAction} from '../core/esl-share-action'; -import {format} from '../../esl-utils/misc/format'; +import {ESLShareUrlGenericAction} from './url-generic-action'; -@ESLShareBaseAction.register -export class ESLShareMediaAction extends ESLShareBaseAction { +@ESLShareUrlGenericAction.register +export class ESLShareMediaAction extends ESLShareUrlGenericAction { public static readonly is: string = 'media'; public static FEATURES: Record = { @@ -17,23 +16,14 @@ export class ESLShareMediaAction extends ESLShareBaseAction { status: 0 }; - protected get formatSource(): Record { - const {shareData} = this.$button; - return { - u: encodeURIComponent(shareData.url), - t: encodeURIComponent(shareData.title) - }; - } - protected get windowFeatures(): string { return Object.entries((this.constructor as typeof ESLShareMediaAction).FEATURES).map((key, value) => `${key}=${value}`).join(','); } public do(): void { const {link} = this.$button; - if (link) { - const URL = format(link, this.formatSource); - window.open(URL, '_blank', this.windowFeatures); - } + if (!link) return; + + window.open(this.buildURL(link), '_blank', this.windowFeatures); } } diff --git a/src/modules/esl-share/actions/url-generic-action.ts b/src/modules/esl-share/actions/url-generic-action.ts new file mode 100644 index 000000000..075979a21 --- /dev/null +++ b/src/modules/esl-share/actions/url-generic-action.ts @@ -0,0 +1,17 @@ +import {ESLShareBaseAction} from '../core/esl-share-action'; +import {format} from '../../esl-utils/misc/format'; + +export abstract class ESLShareUrlGenericAction extends ESLShareBaseAction { + + protected get formatSource(): Record { + const {shareData} = this.$button; + return { + u: encodeURIComponent(shareData.url), + t: encodeURIComponent(shareData.title) + }; + } + + protected buildURL(link: string): string { + return format(link, this.formatSource); + } +} From c84855a142b983bb69328ef6fe7c4b72e28c8987 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 1 Dec 2022 20:02:46 +0200 Subject: [PATCH 046/117] feat(esl-share): create mail action --- pages/src/localdev.ts | 3 ++- pages/static/assets/share/config.json | 2 +- src/modules/esl-share/actions/mail-action.ts | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/modules/esl-share/actions/mail-action.ts diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index 16039accc..79eb03fdc 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -33,7 +33,6 @@ import { ESLTooltip, ESLAnimate, ESLShareList, - ESLShareActionRegistry, ESLShareConfig, ESLRelatedTarget } from '../../src/modules/all'; @@ -45,6 +44,7 @@ import '../../src/modules/esl-media/providers/youtube-provider'; import '../../src/modules/esl-media/providers/brightcove-provider'; import {ESLShareCopyAction} from '../../src/modules/esl-share/actions/copy-action'; +import {ESLShareMailAction} from '../../src/modules/esl-share/actions/mail-action'; import {ESLShareMediaAction} from '../../src/modules/esl-share/actions/media-action'; import {ESLSharePrintAction} from '../../src/modules/esl-share/actions/print-action'; import {ESLShareFetchConfigProvider} from '../../src/modules/esl-share/config-providers/fetch-provider'; @@ -115,6 +115,7 @@ ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); ESLShareCopyAction.register(); +ESLShareMailAction.register(); ESLShareMediaAction.register(); ESLSharePrintAction.register(); ESLShareConfig.use(ESLShareFetchConfigProvider, { diff --git a/pages/static/assets/share/config.json b/pages/static/assets/share/config.json index 9b88967db..3a7180335 100644 --- a/pages/static/assets/share/config.json +++ b/pages/static/assets/share/config.json @@ -146,7 +146,7 @@ }, { "id": "mail", - "action": "media", + "action": "mail", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M4.63 6.94v14.1h18.8V6.94H4.63zm2.44 1.78h13.9l-6.93 5.67-6.93-5.67zm14.6 1.72v8.82H6.47v-8.79l7.59 6.21 7.63-6.24z\"/\u003e\u003c/svg\u003e", "iconBackground": "#0b77b3", "link": "mailto:?subject\u003d{t}\u0026body\u003d{u}", diff --git a/src/modules/esl-share/actions/mail-action.ts b/src/modules/esl-share/actions/mail-action.ts new file mode 100644 index 000000000..e3e19d393 --- /dev/null +++ b/src/modules/esl-share/actions/mail-action.ts @@ -0,0 +1,15 @@ +import {ESLShareUrlGenericAction} from './url-generic-action'; + +@ESLShareUrlGenericAction.register +export class ESLShareMailAction extends ESLShareUrlGenericAction { + public static readonly is: string = 'mail'; + + public do(): void { + const {link} = this.$button; + if (!link) return; + + const a = document.createElement('a'); + a.href = this.buildURL(link); + a.click(); + } +} From a6e5b8695d4be9e4d014ec9e6b46bdbd0673bbd3 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 1 Dec 2022 20:14:58 +0200 Subject: [PATCH 047/117] docs(esl-share): update Readme --- src/modules/esl-share/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/esl-share/README.md b/src/modules/esl-share/README.md index 0d4d3ef44..1348190d3 100644 --- a/src/modules/esl-share/README.md +++ b/src/modules/esl-share/README.md @@ -10,8 +10,6 @@ Authors: *Dmytro Shovchko*. The ESL Share component allows the user to share the page on social media platforms. -**ESLShareIcon** is a custom element that is used to show social media icons. +**ESLShareButton** is a custom element that is used to show the "Share on social media" button. -**ESLSharePopup** is a custom element that is used to show the popup GUI element containing social media icons. - -**ESLShareTrigger** is a custom element that is used to show/hide popups with share icons. +**ESLShareList** is a custom element that is used to show the list of social media buttons. From d519d41b50c4a100c2a0ea6227481414ef373d03 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 1 Dec 2022 20:34:25 +0200 Subject: [PATCH 048/117] refactor(esl-share): update copy action --- src/modules/esl-share/actions/copy-action.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index 7a56f3ed0..5e481353b 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -7,11 +7,6 @@ import type {AlertActionParams} from '../../esl-alert/core'; export class ESLShareCopyAction extends ESLShareBaseAction { public static readonly is: string = 'copy'; - protected get alertIcon(): string { - const $icon = this.$button.querySelector('.esl-share-icon'); - return $icon ? $icon.innerHTML : ''; - } - protected get alertText(): string { return 'Copied to clipboard'; } @@ -19,7 +14,7 @@ export class ESLShareCopyAction extends ESLShareBaseAction { protected get alertParams(): AlertActionParams { return { cls: 'esl-share-alert', - html: ` ${this.alertText}` + html: `${this.alertText}` }; } From 70ec8a68bc3eeaeac4096e8d2f5362a93df8ddc8 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 15 Dec 2022 12:17:37 +0200 Subject: [PATCH 049/117] chore(esl-share): mark esl-share actions as side effects --- package.json | 2 ++ pages/src/localdev.ts | 12 ++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 61d5fdd89..83e4054e0 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,9 @@ "modules/lib.js", "src/modules/lib.ts", "modules/esl-media/providers/**/*.js", + "modules/esl-share/actions/**/*.js", "src/modules/esl-media/providers/**/*.ts", + "src/modules/esl-share/actions/**/*.ts", "modules/draft/esl-carousel/core/view/*.js", "src/modules/draft/esl-carousel/core/view/*.ts", "polyfills/**/*.js", diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index 79eb03fdc..a59500bf4 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -43,10 +43,10 @@ import '../../src/modules/esl-media/providers/html5/video-provider'; import '../../src/modules/esl-media/providers/youtube-provider'; import '../../src/modules/esl-media/providers/brightcove-provider'; -import {ESLShareCopyAction} from '../../src/modules/esl-share/actions/copy-action'; -import {ESLShareMailAction} from '../../src/modules/esl-share/actions/mail-action'; -import {ESLShareMediaAction} from '../../src/modules/esl-share/actions/media-action'; -import {ESLSharePrintAction} from '../../src/modules/esl-share/actions/print-action'; +import '../../src/modules/esl-share/actions/copy-action'; +import '../../src/modules/esl-share/actions/mail-action'; +import '../../src/modules/esl-share/actions/media-action'; +import '../../src/modules/esl-share/actions/print-action'; import {ESLShareFetchConfigProvider} from '../../src/modules/esl-share/config-providers/fetch-provider'; import { @@ -114,10 +114,6 @@ ESLCarouselPlugins.Link.register(); ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); -ESLShareCopyAction.register(); -ESLShareMailAction.register(); -ESLShareMediaAction.register(); -ESLSharePrintAction.register(); ESLShareConfig.use(ESLShareFetchConfigProvider, { url: '/assets/share/config.json' }); From 477b71ae7dce192b0e92680e596ebc5140974dc7 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 15 Dec 2022 17:20:53 +0200 Subject: [PATCH 050/117] feat(esl-share): add feature to mark button as unavailable depending on share actions availability --- pages/src/esl-share/esl-share.less | 7 +++++++ pages/src/localdev.less | 1 + src/modules/esl-share/actions/copy-action.ts | 16 +++++++++++----- src/modules/esl-share/core/esl-share-action.ts | 6 ++++++ src/modules/esl-share/core/esl-share-button.less | 4 ++++ src/modules/esl-share/core/esl-share-button.ts | 9 +++++++-- 6 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 pages/src/esl-share/esl-share.less diff --git a/pages/src/esl-share/esl-share.less b/pages/src/esl-share/esl-share.less new file mode 100644 index 000000000..cb59e600f --- /dev/null +++ b/pages/src/esl-share/esl-share.less @@ -0,0 +1,7 @@ +esl-share-list esl-share-button[unavailable] { + display: inline-block; + + .esl-share-icon { + background-color: #aaa!important; + } +} diff --git a/pages/src/localdev.less b/pages/src/localdev.less index ee41f6492..6b3b86a33 100644 --- a/pages/src/localdev.less +++ b/pages/src/localdev.less @@ -33,6 +33,7 @@ @import "./collection-grid/collection-grid.less"; @import "./esl-media-demo/test-media.less"; +@import "./esl-share/esl-share.less"; @import "../../src/modules/all.less"; @import "../../src/modules/draft/all.less"; diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index 5e481353b..f903bce2e 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -1,3 +1,4 @@ +import {memoize} from '../../esl-utils/decorators'; import {ESLShareBaseAction} from '../core/esl-share-action'; import {ESLEventUtils} from '../../esl-utils/dom/events'; @@ -7,6 +8,11 @@ import type {AlertActionParams} from '../../esl-alert/core'; export class ESLShareCopyAction extends ESLShareBaseAction { public static readonly is: string = 'copy'; + @memoize() + public static get isAvailable(): boolean { + return navigator.clipboard !== undefined; + } + protected get alertText(): string { return 'Copied to clipboard'; } @@ -19,11 +25,11 @@ export class ESLShareCopyAction extends ESLShareBaseAction { } public do(): void { - if (navigator.clipboard !== undefined) { - const {shareData} = this.$button; - navigator.clipboard.writeText(shareData.url); - this.showCopyAlert(); - } + if (!(this.constructor as typeof ESLShareBaseAction).isAvailable) return; + + const {shareData} = this.$button; + navigator.clipboard.writeText(shareData.url); + this.showCopyAlert(); } protected showCopyAlert(): void { diff --git a/src/modules/esl-share/core/esl-share-action.ts b/src/modules/esl-share/core/esl-share-action.ts index b187e89a8..edcc815c9 100644 --- a/src/modules/esl-share/core/esl-share-action.ts +++ b/src/modules/esl-share/core/esl-share-action.ts @@ -1,3 +1,4 @@ +import {memoize} from '../../esl-utils/decorators'; import {ESLShareActionRegistry} from './esl-share-action-registry'; import type {ESLShareButton} from './esl-share-button'; @@ -7,6 +8,11 @@ export type ActionType = (new($button: ESLShareButton) => ESLShareBaseAction) & export abstract class ESLShareBaseAction { public static readonly is: string; + @memoize() + public static get isAvailable(): boolean { + return true; + } + /** Register this action. Can be used as a decorator */ public static register(this: ActionType): void; public static register(this: unknown, action?: ActionType): void; diff --git a/src/modules/esl-share/core/esl-share-button.less b/src/modules/esl-share/core/esl-share-button.less index 405f84776..fe9b51370 100644 --- a/src/modules/esl-share/core/esl-share-button.less +++ b/src/modules/esl-share/core/esl-share-button.less @@ -8,6 +8,10 @@ esl-share-button { opacity: .6; } + &[unavailable] { + display: none; + } + .esl-share-icon { display: inline-block; overflow: hidden; diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index f6137afbd..bb4dc1580 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -1,5 +1,5 @@ import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr, listen, memoize} from '../../esl-utils/decorators'; +import {attr, boolAttr, listen, memoize} from '../../esl-utils/decorators'; import {ENTER, SPACE} from '../../esl-utils/dom/keys'; import {ESLShareActionRegistry} from './esl-share-action-registry'; @@ -29,9 +29,13 @@ export class ESLShareButton extends ESLBaseElement { @attr() public buttonId: string; @attr() public link: string; @attr() public name: string; + @boolAttr() public unavailable: boolean; public static build(cfg: ShareButtonConfig): ESLShareButton | null { - if (!ESLShareActionRegistry.instance.has(cfg.action)) return null; + const shareAction = ESLShareActionRegistry.instance.get(cfg.action); + if (!shareAction) return null; + + const {isAvailable} = shareAction; const $button = ESLShareButton.create(); $button.$$attr('action', cfg.action); $button.$$attr('button-id', cfg.id); @@ -40,6 +44,7 @@ export class ESLShareButton extends ESLBaseElement { $button.$$attr('tabindex', '0'); $button.$$attr('role', 'button'); $button.$$attr('aria-label', cfg.title); + $button.$$attr('unavailable', !isAvailable); const $icon = document.createElement('span'); $icon.title = cfg.title; $icon.classList.add('esl-share-icon'); From b3861c023beaf6d1525b5694b877100395a0cd78 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 15 Dec 2022 18:43:32 +0200 Subject: [PATCH 051/117] refactor(esl-share): separate a11y init --- src/modules/esl-share/core/esl-share-button.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index bb4dc1580..9dd66c500 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -1,5 +1,5 @@ import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr, boolAttr, listen, memoize} from '../../esl-utils/decorators'; +import {attr, boolAttr, listen} from '../../esl-utils/decorators'; import {ENTER, SPACE} from '../../esl-utils/dom/keys'; import {ESLShareActionRegistry} from './esl-share-action-registry'; @@ -41,8 +41,6 @@ export class ESLShareButton extends ESLBaseElement { $button.$$attr('button-id', cfg.id); $button.$$attr('link', cfg.link); $button.$$attr('name', cfg.name); - $button.$$attr('tabindex', '0'); - $button.$$attr('role', 'button'); $button.$$attr('aria-label', cfg.title); $button.$$attr('unavailable', !isAvailable); const $icon = document.createElement('span'); @@ -58,7 +56,6 @@ export class ESLShareButton extends ESLBaseElement { return new URL(path, document.baseURI).href; } - @memoize() public get host(): ESLShareList | null { return this.closest('esl-share-list'); } @@ -72,6 +69,18 @@ export class ESLShareButton extends ESLBaseElement { }; } + protected connectedCallback(): void { + super.connectedCallback(); + this.initA11y(); + } + + public initA11y(): void { + if (!this.hasAttribute('role')) this.setAttribute('role', 'button'); + if (this.getAttribute('role') === 'button' && !this.hasAttribute('tabindex')) { + this.setAttribute('tabindex', '0'); + } + } + protected beforeAction(): void {} protected doAction(): void { From 4c1fe2c519be53d08bcdc52443fd4ff59b70b905 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 15 Dec 2022 23:55:27 +0200 Subject: [PATCH 052/117] refactor(esl-share): update shareData format for links --- src/modules/esl-share/actions/copy-action.ts | 2 +- src/modules/esl-share/actions/url-generic-action.ts | 8 ++++++-- src/modules/esl-share/core/esl-share-button.ts | 5 ----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index f903bce2e..6d26ad649 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -28,7 +28,7 @@ export class ESLShareCopyAction extends ESLShareBaseAction { if (!(this.constructor as typeof ESLShareBaseAction).isAvailable) return; const {shareData} = this.$button; - navigator.clipboard.writeText(shareData.url); + navigator.clipboard.writeText(shareData.url || ''); this.showCopyAlert(); } diff --git a/src/modules/esl-share/actions/url-generic-action.ts b/src/modules/esl-share/actions/url-generic-action.ts index 075979a21..11ee179c7 100644 --- a/src/modules/esl-share/actions/url-generic-action.ts +++ b/src/modules/esl-share/actions/url-generic-action.ts @@ -5,9 +5,13 @@ export abstract class ESLShareUrlGenericAction extends ESLShareBaseAction { protected get formatSource(): Record { const {shareData} = this.$button; + const title = encodeURIComponent(shareData.title || ''); + const url = encodeURIComponent(shareData.url || ''); return { - u: encodeURIComponent(shareData.url), - t: encodeURIComponent(shareData.title) + u: url, + t: title, + url, + title }; } diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 9dd66c500..f5e0fcb78 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -15,11 +15,6 @@ export interface ShareButtonConfig { 'title': string; } -export interface ShareData { - url: string; - title: string; -} - export class ESLShareButton extends ESLBaseElement { public static is = 'esl-share-button'; From 2830c46dbc43a0b86af407b15f9ad75fca14947b Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 15 Dec 2022 23:56:38 +0200 Subject: [PATCH 053/117] feat(esl-share): add action for native share mechanism on devices --- pages/src/esl-share/esl-share.less | 7 +++---- pages/src/localdev.ts | 1 + .../esl-share/actions/native-action.ts | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 src/modules/esl-share/actions/native-action.ts diff --git a/pages/src/esl-share/esl-share.less b/pages/src/esl-share/esl-share.less index cb59e600f..e6e193eec 100644 --- a/pages/src/esl-share/esl-share.less +++ b/pages/src/esl-share/esl-share.less @@ -1,7 +1,6 @@ esl-share-list esl-share-button[unavailable] { display: inline-block; - - .esl-share-icon { - background-color: #aaa!important; - } + opacity: .3; + cursor: not-allowed; + filter: grayscale(1); } diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index a59500bf4..ba66bf1d1 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -46,6 +46,7 @@ import '../../src/modules/esl-media/providers/brightcove-provider'; import '../../src/modules/esl-share/actions/copy-action'; import '../../src/modules/esl-share/actions/mail-action'; import '../../src/modules/esl-share/actions/media-action'; +import '../../src/modules/esl-share/actions/native-action'; import '../../src/modules/esl-share/actions/print-action'; import {ESLShareFetchConfigProvider} from '../../src/modules/esl-share/config-providers/fetch-provider'; diff --git a/src/modules/esl-share/actions/native-action.ts b/src/modules/esl-share/actions/native-action.ts new file mode 100644 index 000000000..31ea53f40 --- /dev/null +++ b/src/modules/esl-share/actions/native-action.ts @@ -0,0 +1,19 @@ +import {memoize} from '../../esl-utils/decorators'; +import {ESLShareBaseAction} from '../core/esl-share-action'; + +@ESLShareBaseAction.register +export class ESLShareNativeAction extends ESLShareBaseAction { + public static readonly is: string = 'native'; + + @memoize() + public static get isAvailable(): boolean { + return navigator.share !== undefined; + } + + public do(): void { + if (!(this.constructor as typeof ESLShareBaseAction).isAvailable) return; + + const {shareData} = this.$button; + navigator.share(shareData); + } +} From 68abccc3e17ff3dba614acd3c6ebe5e247b381ca Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 15 Dec 2022 23:58:32 +0200 Subject: [PATCH 054/117] docs(esl-share): update example page --- pages/views/examples/share.njk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index 09f90ae12..bbcad2c82 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -41,6 +41,11 @@ aside:
+

List of share buttons which presents buttons with all action types

+

This example shows a button with the native share mechanism on the device which will be inactive on the desktop browser.

+ +
+

Display list of share buttons via incorrect list

Shows buttons only with the correct id.

From 5ef927af56a488e7903fa1d75bb3efd45f5c7e3e Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 15 Dec 2022 23:59:39 +0200 Subject: [PATCH 055/117] docs(esl-share): update buttons config.json --- pages/static/assets/share/config.json | 30 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/pages/static/assets/share/config.json b/pages/static/assets/share/config.json index 3a7180335..54113cd38 100644 --- a/pages/static/assets/share/config.json +++ b/pages/static/assets/share/config.json @@ -148,19 +148,37 @@ "id": "mail", "action": "mail", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M4.63 6.94v14.1h18.8V6.94H4.63zm2.44 1.78h13.9l-6.93 5.67-6.93-5.67zm14.6 1.72v8.82H6.47v-8.79l7.59 6.21 7.63-6.24z\"/\u003e\u003c/svg\u003e", - "iconBackground": "#0b77b3", - "link": "mailto:?subject\u003d{t}\u0026body\u003d{u}", + "iconBackground": "#ff1493", + "link": "mailto:?subject\u003d{title}\u0026body\u003d{url}", "name": "Mail", "title": "Mail" }, { + "id": "copy", "action": "copy", - "name_en": "Copy", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M17 9.69l-7.43 7.43 1.18 1.18 7.43-7.43L17 9.69z\"/\u003e\u003cpath d\u003d\"M4.31 17.8c-.481.481-.48 1.29.00138 1.77l4.02 4.02c.481.481 1.29.483 1.77.00138l4.95-4.95c.481-.481.481-1.29-7e-7-1.78l-4.02-4.02c-.481-.481-1.29-.481-1.78 0l-4.95 4.95zm1.47.887l4.36-4.36 3.44 3.44-4.36 4.36-3.44-3.44zm7-9.37c-.481.481-.481 1.29 2.8e-7 1.78l4.02 4.02c.481.481 1.29.481 1.78 0l4.95-4.95c.481-.481.48-1.29-.00138-1.77l-4.02-4.02c-.481-.481-1.29-.483-1.77-.00138l-4.95 4.95zm1.47.889l4.36-4.36 3.44 3.44-4.36 4.36-3.44-3.44z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#a0522d", + "link": "", "name": "Copy", - "id": "copy", + "title": "Copy" + }, + { + "id": "native", + "action": "native", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 24 24\"\u003e\u003cpath d\u003d\"m21.7 10.2-6.6-6c-.5-.5-1.1 0-1.1.8v3c-4.7 0-8.7 2.9-10.6 6.8-.7 1.3-1.1 2.7-1.4 4.1-.2 1 1.3 1.5 1.9.6C6.1 16 9.8 13.7 14 13.7V17c0 .8.6 1.3 1.1.8l6.6-6c.4-.4.4-1.2 0-1.6z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#ff6347", "link": "", - "iconBackground": "#3c5996", - "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M17 9.69l-7.43 7.43 1.18 1.18 7.43-7.43L17 9.69z\"/\u003e\u003cpath d\u003d\"M4.31 17.8c-.481.481-.48 1.29.00138 1.77l4.02 4.02c.481.481 1.29.483 1.77.00138l4.95-4.95c.481-.481.481-1.29-7e-7-1.78l-4.02-4.02c-.481-.481-1.29-.481-1.78 0l-4.95 4.95zm1.47.887l4.36-4.36 3.44 3.44-4.36 4.36-3.44-3.44zm7-9.37c-.481.481-.481 1.29 2.8e-7 1.78l4.02 4.02c.481.481 1.29.481 1.78 0l4.95-4.95c.481-.481.48-1.29-.00138-1.77l-4.02-4.02c-.481-.481-1.29-.483-1.77-.00138l-4.95 4.95zm1.47.889l4.36-4.36 3.44 3.44-4.36 4.36-3.44-3.44z\"/\u003e\u003c/svg\u003e" + "name": "Share", + "title": "Share page" + }, + { + "id": "print", + "action": "print", + "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 247.1 247.1\"\u003e\u003cpath d\u003d\"M75.4 175.5h97v6.5h-97zM75.4 194.9h97v6.5h-97z\"/\u003e\u003ccircle stroke-width\u003d\"2\" stroke-miterlimit\u003d\"10\" cx\u003d\"178.9\" cy\u003d\"117.3\" r\u003d\"6.5\"/\u003e\u003cpath d\u003d\"M198.3 84.9h-12.9V39.6c0-7.1-5.8-12.9-12.9-12.9h-97c-7.1 0-12.9 5.8-12.9 12.9v45.3H49.5c-11 0-19.4 8.4-19.4 19.4v58.2c0 11 8.4 19.4 19.4 19.4h12.9v25.9c0 7.1 5.8 12.9 12.9 12.9h97c7.1 0 12.9-5.8 12.9-12.9v-25.9h12.9c11 0 19.4-8.4 19.4-19.4v-58.2c.2-11-8.2-19.4-19.2-19.4zM68.9 39.6c0-3.2 2.6-6.5 6.5-6.5h97c3.2 0 6.5 2.6 6.5 6.5v45.3h-110V39.6zm110 168.2c0 3.2-2.6 6.5-6.5 6.5h-97c-3.2 0-6.5-2.6-6.5-6.5v-45.3h110v45.3zm32.3-45.3c0 7.1-5.8 12.9-12.9 12.9h-12.9V156h-123v19.4H49.5c-7.1 0-12.9-5.8-12.9-12.9v-58.2c0-7.1 5.8-12.9 12.9-12.9h148.8c7.1 0 12.9 5.8 12.9 12.9v58.2z\"/\u003e\u003c/svg\u003e", + "iconBackground": "#2f4f4f", + "link": "", + "name": "Print", + "title": "Print page" } ], "groups": [ From 7c1d8c9f601af16bacf6222ab6722d08824c3939 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 16 Dec 2022 00:38:47 +0200 Subject: [PATCH 056/117] refactor(esl-share): rework share config provider --- pages/src/localdev.ts | 5 +---- .../config-providers/fetch-provider.ts | 20 ------------------- .../core/esl-share-config-provider.ts | 10 ---------- .../esl-share/core/esl-share-config.ts | 9 ++++----- 4 files changed, 5 insertions(+), 39 deletions(-) delete mode 100644 src/modules/esl-share/config-providers/fetch-provider.ts delete mode 100644 src/modules/esl-share/core/esl-share-config-provider.ts diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index ba66bf1d1..798bd59df 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -48,7 +48,6 @@ import '../../src/modules/esl-share/actions/mail-action'; import '../../src/modules/esl-share/actions/media-action'; import '../../src/modules/esl-share/actions/native-action'; import '../../src/modules/esl-share/actions/print-action'; -import {ESLShareFetchConfigProvider} from '../../src/modules/esl-share/config-providers/fetch-provider'; import { ESLCarousel, @@ -115,9 +114,7 @@ ESLCarouselPlugins.Link.register(); ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); -ESLShareConfig.use(ESLShareFetchConfigProvider, { - url: '/assets/share/config.json' -}); +ESLShareConfig.use(() => fetch('/assets/share/config.json').then((response) => response.json())); ESLShareList.register(); // Register ESL Mixins diff --git a/src/modules/esl-share/config-providers/fetch-provider.ts b/src/modules/esl-share/config-providers/fetch-provider.ts deleted file mode 100644 index 6ee4c193c..000000000 --- a/src/modules/esl-share/config-providers/fetch-provider.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {ESLShareBaseConfigProvider} from '../core/esl-share-config-provider'; - -import type {ShareConfig} from '../core/esl-share-config'; - -export interface FetchConfigProviderOptions { - url: string; -} - -export class ESLShareFetchConfigProvider extends ESLShareBaseConfigProvider { - protected url: string; - - public constructor(options: FetchConfigProviderOptions) { - super(); - this.url = options.url; - } - - public get(): Promise { - return fetch(this.url).then((response) => response.json()); - } -} diff --git a/src/modules/esl-share/core/esl-share-config-provider.ts b/src/modules/esl-share/core/esl-share-config-provider.ts deleted file mode 100644 index 4b05ac2b3..000000000 --- a/src/modules/esl-share/core/esl-share-config-provider.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type {ShareConfig} from './esl-share-config'; - -export type ProviderOptions = Record; -export type ProviderType = (new(options?: ProviderOptions) => ESLShareBaseConfigProvider) & typeof ESLShareBaseConfigProvider; - -export abstract class ESLShareBaseConfigProvider { - // eslint-disable-next-line @typescript-eslint/no-useless-constructor - public constructor(options?: ProviderOptions) {} - public abstract get(): Promise; -} diff --git a/src/modules/esl-share/core/esl-share-config.ts b/src/modules/esl-share/core/esl-share-config.ts index acff89e7a..2623ad90c 100644 --- a/src/modules/esl-share/core/esl-share-config.ts +++ b/src/modules/esl-share/core/esl-share-config.ts @@ -1,5 +1,4 @@ import type {ShareButtonConfig} from './esl-share-button'; -import type {ESLShareBaseConfigProvider, ProviderOptions, ProviderType} from './esl-share-config-provider'; export interface ShareGroupConfig { id: string; @@ -12,13 +11,13 @@ export interface ShareConfig { } export class ESLShareConfig { - protected static provider: ESLShareBaseConfigProvider; + protected static provider: () => Promise; - public static use(provider: ProviderType, options?: ProviderOptions): ESLShareConfig { - return ESLShareConfig.provider = new provider(options); + public static use(provider: () => Promise): ESLShareConfig { + return ESLShareConfig.provider = provider; } public static get(): Promise { - return ESLShareConfig.provider.get(); + return ESLShareConfig.provider(); } } From 776db9146715893ad28c9289e650dee1527b1da3 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 16 Dec 2022 11:47:39 +0200 Subject: [PATCH 057/117] refactor(esl-share): update cjnfig provider type --- src/modules/esl-share/core/esl-share-config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-config.ts b/src/modules/esl-share/core/esl-share-config.ts index 2623ad90c..f4e0ca053 100644 --- a/src/modules/esl-share/core/esl-share-config.ts +++ b/src/modules/esl-share/core/esl-share-config.ts @@ -1,5 +1,6 @@ import type {ShareButtonConfig} from './esl-share-button'; +export type ESLShareConfigProviderType = () => Promise; export interface ShareGroupConfig { id: string; list: string; @@ -11,9 +12,9 @@ export interface ShareConfig { } export class ESLShareConfig { - protected static provider: () => Promise; + protected static provider: ESLShareConfigProviderType; - public static use(provider: () => Promise): ESLShareConfig { + public static use(provider: ESLShareConfigProviderType): ESLShareConfig { return ESLShareConfig.provider = provider; } From 52d4144f7b5cc38039f3453ec949f183b04f36ad Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Mon, 16 Jan 2023 20:21:09 +0200 Subject: [PATCH 058/117] refactor(esl-share): remove creating action instance on the fly --- src/modules/esl-share/actions/copy-action.ts | 8 ++++---- src/modules/esl-share/actions/mail-action.ts | 8 +++++--- src/modules/esl-share/actions/media-action.ts | 8 +++++--- src/modules/esl-share/actions/native-action.ts | 9 +++++---- src/modules/esl-share/actions/print-action.ts | 4 +++- .../esl-share/actions/url-generic-action.ts | 7 +++---- .../esl-share/core/esl-share-action-registry.ts | 15 ++++++++++----- src/modules/esl-share/core/esl-share-action.ts | 14 +++++--------- 8 files changed, 40 insertions(+), 33 deletions(-) diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index 6d26ad649..ca3de20e6 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -2,6 +2,7 @@ import {memoize} from '../../esl-utils/decorators'; import {ESLShareBaseAction} from '../core/esl-share-action'; import {ESLEventUtils} from '../../esl-utils/dom/events'; +import type {ESLShareButton} from '../core/esl-share-button'; import type {AlertActionParams} from '../../esl-alert/core'; @ESLShareBaseAction.register @@ -9,7 +10,7 @@ export class ESLShareCopyAction extends ESLShareBaseAction { public static readonly is: string = 'copy'; @memoize() - public static get isAvailable(): boolean { + public get isAvailable(): boolean { return navigator.clipboard !== undefined; } @@ -24,10 +25,9 @@ export class ESLShareCopyAction extends ESLShareBaseAction { }; } - public do(): void { - if (!(this.constructor as typeof ESLShareBaseAction).isAvailable) return; + public do(shareData: ShareData, $button: ESLShareButton): void { + if (!this.isAvailable) return; - const {shareData} = this.$button; navigator.clipboard.writeText(shareData.url || ''); this.showCopyAlert(); } diff --git a/src/modules/esl-share/actions/mail-action.ts b/src/modules/esl-share/actions/mail-action.ts index e3e19d393..b84845c25 100644 --- a/src/modules/esl-share/actions/mail-action.ts +++ b/src/modules/esl-share/actions/mail-action.ts @@ -1,15 +1,17 @@ import {ESLShareUrlGenericAction} from './url-generic-action'; +import type {ESLShareButton} from '../core/esl-share-button'; + @ESLShareUrlGenericAction.register export class ESLShareMailAction extends ESLShareUrlGenericAction { public static readonly is: string = 'mail'; - public do(): void { - const {link} = this.$button; + public do(shareData: ShareData, $button: ESLShareButton): void { + const {link} = $button; if (!link) return; const a = document.createElement('a'); - a.href = this.buildURL(link); + a.href = this.buildURL(link, shareData); a.click(); } } diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index 18eeeb9d3..59f928d1a 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -1,5 +1,7 @@ import {ESLShareUrlGenericAction} from './url-generic-action'; +import type {ESLShareButton} from '../core/esl-share-button'; + @ESLShareUrlGenericAction.register export class ESLShareMediaAction extends ESLShareUrlGenericAction { public static readonly is: string = 'media'; @@ -20,10 +22,10 @@ export class ESLShareMediaAction extends ESLShareUrlGenericAction { return Object.entries((this.constructor as typeof ESLShareMediaAction).FEATURES).map((key, value) => `${key}=${value}`).join(','); } - public do(): void { - const {link} = this.$button; + public do(shareData: ShareData, $button: ESLShareButton): void { + const {link} = $button; if (!link) return; - window.open(this.buildURL(link), '_blank', this.windowFeatures); + window.open(this.buildURL(link, shareData), '_blank', this.windowFeatures); } } diff --git a/src/modules/esl-share/actions/native-action.ts b/src/modules/esl-share/actions/native-action.ts index 31ea53f40..858257ed7 100644 --- a/src/modules/esl-share/actions/native-action.ts +++ b/src/modules/esl-share/actions/native-action.ts @@ -1,19 +1,20 @@ import {memoize} from '../../esl-utils/decorators'; import {ESLShareBaseAction} from '../core/esl-share-action'; +import type {ESLShareButton} from '../core/esl-share-button'; + @ESLShareBaseAction.register export class ESLShareNativeAction extends ESLShareBaseAction { public static readonly is: string = 'native'; @memoize() - public static get isAvailable(): boolean { + public get isAvailable(): boolean { return navigator.share !== undefined; } - public do(): void { - if (!(this.constructor as typeof ESLShareBaseAction).isAvailable) return; + public do(shareData: ShareData, $button: ESLShareButton): void { + if (!this.isAvailable) return; - const {shareData} = this.$button; navigator.share(shareData); } } diff --git a/src/modules/esl-share/actions/print-action.ts b/src/modules/esl-share/actions/print-action.ts index 220e58be9..bb07e2af6 100644 --- a/src/modules/esl-share/actions/print-action.ts +++ b/src/modules/esl-share/actions/print-action.ts @@ -1,10 +1,12 @@ import {ESLShareBaseAction} from '../core/esl-share-action'; +import type {ESLShareButton} from '../core/esl-share-button'; + @ESLShareBaseAction.register export class ESLSharePrintAction extends ESLShareBaseAction { public static readonly is: string = 'print'; - public do(): void { + public do(shareData: ShareData, $button: ESLShareButton): void { window.print(); } } diff --git a/src/modules/esl-share/actions/url-generic-action.ts b/src/modules/esl-share/actions/url-generic-action.ts index 11ee179c7..bc7c69618 100644 --- a/src/modules/esl-share/actions/url-generic-action.ts +++ b/src/modules/esl-share/actions/url-generic-action.ts @@ -3,8 +3,7 @@ import {format} from '../../esl-utils/misc/format'; export abstract class ESLShareUrlGenericAction extends ESLShareBaseAction { - protected get formatSource(): Record { - const {shareData} = this.$button; + protected getFormatSource(shareData: ShareData): Record { const title = encodeURIComponent(shareData.title || ''); const url = encodeURIComponent(shareData.url || ''); return { @@ -15,7 +14,7 @@ export abstract class ESLShareUrlGenericAction extends ESLShareBaseAction { }; } - protected buildURL(link: string): string { - return format(link, this.formatSource); + protected buildURL(link: string, shareData: ShareData): string { + return format(link, this.getFormatSource(shareData)); } } diff --git a/src/modules/esl-share/core/esl-share-action-registry.ts b/src/modules/esl-share/core/esl-share-action-registry.ts index a6437af57..3d0def19e 100644 --- a/src/modules/esl-share/core/esl-share-action-registry.ts +++ b/src/modules/esl-share/core/esl-share-action-registry.ts @@ -1,10 +1,10 @@ import {memoize} from '../../esl-utils/decorators'; -import type {ActionType} from './esl-share-action'; +import type {ActionType, ESLShareBaseAction} from './esl-share-action'; import type {ESLShareButton} from './esl-share-button'; export class ESLShareActionRegistry { - private actionsMap: Map = new Map(); + private actionsMap: Map = new Map(); @memoize() public static get instance(): ESLShareActionRegistry { @@ -12,9 +12,14 @@ export class ESLShareActionRegistry { } /** Register action */ + public register2(action: ActionType): void { + if (!action.is) throw new Error('Action should have a name'); + this.actionsMap.set(action.is, new action()); + } + public register(action: ActionType): void { if (!action.is) throw new Error('Action should have a name'); - this.actionsMap.set(action.is, action); + this.actionsMap.set(action.is, new action()); } /** Check that action is registered for passed name */ @@ -23,7 +28,7 @@ export class ESLShareActionRegistry { } /** Get action by name */ - public get(name: string): ActionType | null { + public get(name: string): ESLShareBaseAction | null { if (!name) return null; return this.actionsMap.get(name.toLowerCase()) || null; } @@ -31,6 +36,6 @@ export class ESLShareActionRegistry { /** Do action at passed Share button */ public doAction(button: ESLShareButton): void { const action = this.get(button.action); - action && new action(button).do(); + action && action.do(button.shareData, button); } } diff --git a/src/modules/esl-share/core/esl-share-action.ts b/src/modules/esl-share/core/esl-share-action.ts index edcc815c9..81539183b 100644 --- a/src/modules/esl-share/core/esl-share-action.ts +++ b/src/modules/esl-share/core/esl-share-action.ts @@ -1,18 +1,12 @@ -import {memoize} from '../../esl-utils/decorators'; import {ESLShareActionRegistry} from './esl-share-action-registry'; import type {ESLShareButton} from './esl-share-button'; -export type ActionType = (new($button: ESLShareButton) => ESLShareBaseAction) & typeof ESLShareBaseAction; +export type ActionType = (new() => ESLShareBaseAction) & typeof ESLShareBaseAction; export abstract class ESLShareBaseAction { public static readonly is: string; - @memoize() - public static get isAvailable(): boolean { - return true; - } - /** Register this action. Can be used as a decorator */ public static register(this: ActionType): void; public static register(this: unknown, action?: ActionType): void; @@ -23,7 +17,9 @@ export abstract class ESLShareBaseAction { ESLShareActionRegistry.instance.register(action); } - public constructor(protected $button: ESLShareButton) {} + public get isAvailable(): boolean { + return true; + } - public abstract do(): void; + public abstract do(shareData: ShareData, $button: ESLShareButton): void; } From 2448ac92b060f3992c8055da917e6c27d38c6034 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Mon, 16 Jan 2023 20:52:22 +0200 Subject: [PATCH 059/117] refactor(esl-share): rename action share method --- src/modules/esl-share/actions/copy-action.ts | 2 +- src/modules/esl-share/actions/mail-action.ts | 2 +- src/modules/esl-share/actions/media-action.ts | 2 +- src/modules/esl-share/actions/native-action.ts | 2 +- src/modules/esl-share/actions/print-action.ts | 2 +- .../esl-share/core/esl-share-action-registry.ts | 11 +++-------- src/modules/esl-share/core/esl-share-action.ts | 2 +- src/modules/esl-share/core/esl-share-button.ts | 14 +++++++------- 8 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index ca3de20e6..37fd517e4 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -25,7 +25,7 @@ export class ESLShareCopyAction extends ESLShareBaseAction { }; } - public do(shareData: ShareData, $button: ESLShareButton): void { + public share(shareData: ShareData, $button: ESLShareButton): void { if (!this.isAvailable) return; navigator.clipboard.writeText(shareData.url || ''); diff --git a/src/modules/esl-share/actions/mail-action.ts b/src/modules/esl-share/actions/mail-action.ts index b84845c25..2cc00b4b4 100644 --- a/src/modules/esl-share/actions/mail-action.ts +++ b/src/modules/esl-share/actions/mail-action.ts @@ -6,7 +6,7 @@ import type {ESLShareButton} from '../core/esl-share-button'; export class ESLShareMailAction extends ESLShareUrlGenericAction { public static readonly is: string = 'mail'; - public do(shareData: ShareData, $button: ESLShareButton): void { + public share(shareData: ShareData, $button: ESLShareButton): void { const {link} = $button; if (!link) return; diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index 59f928d1a..57d319924 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -22,7 +22,7 @@ export class ESLShareMediaAction extends ESLShareUrlGenericAction { return Object.entries((this.constructor as typeof ESLShareMediaAction).FEATURES).map((key, value) => `${key}=${value}`).join(','); } - public do(shareData: ShareData, $button: ESLShareButton): void { + public share(shareData: ShareData, $button: ESLShareButton): void { const {link} = $button; if (!link) return; diff --git a/src/modules/esl-share/actions/native-action.ts b/src/modules/esl-share/actions/native-action.ts index 858257ed7..24156835e 100644 --- a/src/modules/esl-share/actions/native-action.ts +++ b/src/modules/esl-share/actions/native-action.ts @@ -12,7 +12,7 @@ export class ESLShareNativeAction extends ESLShareBaseAction { return navigator.share !== undefined; } - public do(shareData: ShareData, $button: ESLShareButton): void { + public share(shareData: ShareData, $button: ESLShareButton): void { if (!this.isAvailable) return; navigator.share(shareData); diff --git a/src/modules/esl-share/actions/print-action.ts b/src/modules/esl-share/actions/print-action.ts index bb07e2af6..2dd47678d 100644 --- a/src/modules/esl-share/actions/print-action.ts +++ b/src/modules/esl-share/actions/print-action.ts @@ -6,7 +6,7 @@ import type {ESLShareButton} from '../core/esl-share-button'; export class ESLSharePrintAction extends ESLShareBaseAction { public static readonly is: string = 'print'; - public do(shareData: ShareData, $button: ESLShareButton): void { + public share(shareData: ShareData, $button: ESLShareButton): void { window.print(); } } diff --git a/src/modules/esl-share/core/esl-share-action-registry.ts b/src/modules/esl-share/core/esl-share-action-registry.ts index 3d0def19e..a6280ec9e 100644 --- a/src/modules/esl-share/core/esl-share-action-registry.ts +++ b/src/modules/esl-share/core/esl-share-action-registry.ts @@ -12,11 +12,6 @@ export class ESLShareActionRegistry { } /** Register action */ - public register2(action: ActionType): void { - if (!action.is) throw new Error('Action should have a name'); - this.actionsMap.set(action.is, new action()); - } - public register(action: ActionType): void { if (!action.is) throw new Error('Action should have a name'); this.actionsMap.set(action.is, new action()); @@ -33,9 +28,9 @@ export class ESLShareActionRegistry { return this.actionsMap.get(name.toLowerCase()) || null; } - /** Do action at passed Share button */ - public doAction(button: ESLShareButton): void { + /** Do the share action at passed Share button */ + public share(button: ESLShareButton): void { const action = this.get(button.action); - action && action.do(button.shareData, button); + action && action.share(button.shareData, button); } } diff --git a/src/modules/esl-share/core/esl-share-action.ts b/src/modules/esl-share/core/esl-share-action.ts index 81539183b..f2e896aca 100644 --- a/src/modules/esl-share/core/esl-share-action.ts +++ b/src/modules/esl-share/core/esl-share-action.ts @@ -21,5 +21,5 @@ export abstract class ESLShareBaseAction { return true; } - public abstract do(shareData: ShareData, $button: ESLShareButton): void; + public abstract share(shareData: ShareData, $button: ESLShareButton): void; } diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index f5e0fcb78..44b6f69a2 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -76,19 +76,19 @@ export class ESLShareButton extends ESLBaseElement { } } - protected beforeAction(): void {} + protected onBeforeShare(): void {} - protected doAction(): void { - this.beforeAction(); - ESLShareActionRegistry.instance.doAction(this); - this.afterAction(); + public share(): void { + this.onBeforeShare(); + ESLShareActionRegistry.instance.share(this); + this.onAfterShare(); } - protected afterAction(): void {} + protected onAfterShare(): void {} @listen('click') protected onClick(e: MouseEvent): void { - this.doAction(); + this.share(); } @listen('keydown') From ab391fe42249a673c801c8118f646f64af419d59 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Mon, 16 Jan 2023 21:06:51 +0200 Subject: [PATCH 060/117] style(esl-share): rename mail action to external --- pages/src/localdev.ts | 2 +- pages/static/assets/share/config.json | 2 +- .../esl-share/actions/{mail-action.ts => external-action.ts} | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/modules/esl-share/actions/{mail-action.ts => external-action.ts} (76%) diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index 798bd59df..ece07695a 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -44,7 +44,7 @@ import '../../src/modules/esl-media/providers/youtube-provider'; import '../../src/modules/esl-media/providers/brightcove-provider'; import '../../src/modules/esl-share/actions/copy-action'; -import '../../src/modules/esl-share/actions/mail-action'; +import '../../src/modules/esl-share/actions/external-action'; import '../../src/modules/esl-share/actions/media-action'; import '../../src/modules/esl-share/actions/native-action'; import '../../src/modules/esl-share/actions/print-action'; diff --git a/pages/static/assets/share/config.json b/pages/static/assets/share/config.json index 54113cd38..133d0c175 100644 --- a/pages/static/assets/share/config.json +++ b/pages/static/assets/share/config.json @@ -146,7 +146,7 @@ }, { "id": "mail", - "action": "mail", + "action": "external", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M4.63 6.94v14.1h18.8V6.94H4.63zm2.44 1.78h13.9l-6.93 5.67-6.93-5.67zm14.6 1.72v8.82H6.47v-8.79l7.59 6.21 7.63-6.24z\"/\u003e\u003c/svg\u003e", "iconBackground": "#ff1493", "link": "mailto:?subject\u003d{title}\u0026body\u003d{url}", diff --git a/src/modules/esl-share/actions/mail-action.ts b/src/modules/esl-share/actions/external-action.ts similarity index 76% rename from src/modules/esl-share/actions/mail-action.ts rename to src/modules/esl-share/actions/external-action.ts index 2cc00b4b4..7ad4e1f98 100644 --- a/src/modules/esl-share/actions/mail-action.ts +++ b/src/modules/esl-share/actions/external-action.ts @@ -3,8 +3,8 @@ import {ESLShareUrlGenericAction} from './url-generic-action'; import type {ESLShareButton} from '../core/esl-share-button'; @ESLShareUrlGenericAction.register -export class ESLShareMailAction extends ESLShareUrlGenericAction { - public static readonly is: string = 'mail'; +export class ESLShareExternalAction extends ESLShareUrlGenericAction { + public static readonly is: string = 'external'; public share(shareData: ShareData, $button: ESLShareButton): void { const {link} = $button; From cf17913912533738629ac48ff22fde85046e260e Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Mon, 16 Jan 2023 21:20:42 +0200 Subject: [PATCH 061/117] refactor(esl-share): update a11y --- src/modules/esl-share/core/esl-share-button.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 44b6f69a2..0cd5e736f 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -72,7 +72,7 @@ export class ESLShareButton extends ESLBaseElement { public initA11y(): void { if (!this.hasAttribute('role')) this.setAttribute('role', 'button'); if (this.getAttribute('role') === 'button' && !this.hasAttribute('tabindex')) { - this.setAttribute('tabindex', '0'); + this.tabIndex = 0; } } From 2bd45d67d6eba304ed09ccc0732d06c492bfb42f Mon Sep 17 00:00:00 2001 From: Dmytro Shovchko Date: Mon, 23 Jan 2023 13:36:28 +0200 Subject: [PATCH 062/117] style(esl-share): apply suggestion from review Co-authored-by: fshovchko <60318924+fshovchko@users.noreply.github.com> --- src/modules/esl-share/core/esl-share-action-registry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/esl-share/core/esl-share-action-registry.ts b/src/modules/esl-share/core/esl-share-action-registry.ts index a6280ec9e..f7bc8ea2d 100644 --- a/src/modules/esl-share/core/esl-share-action-registry.ts +++ b/src/modules/esl-share/core/esl-share-action-registry.ts @@ -17,7 +17,7 @@ export class ESLShareActionRegistry { this.actionsMap.set(action.is, new action()); } - /** Check that action is registered for passed name */ + /** Check if action is registered for passed name */ public has(name: string): boolean { return this.actionsMap.has(name); } From c676ece8637d5f3a44660d182e600540ac2c3177 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Mon, 23 Jan 2023 13:52:45 +0200 Subject: [PATCH 063/117] style(esl-share): update ready$ getter --- src/modules/esl-share/core/esl-share-list.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 108b05a06..d5a96cfd1 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -30,7 +30,7 @@ export class ESLShareList extends ESLBaseElement { } public get ready$(): Promise { - return this._ready ? this._ready : Promise.reject(`[${this.alias}]: is not ready`); + return this._ready ?? Promise.reject(`[${this.alias}]: is not ready`); } @memoize() From 76bbf723898b46207257526d44bd6fb846f7cb3d Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Mon, 23 Jan 2023 14:11:00 +0200 Subject: [PATCH 064/117] refactor(esl-share): update on share ready event --- src/modules/esl-share/core/esl-share-list.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index d5a96cfd1..2295ad707 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -1,6 +1,5 @@ import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr, bind, boolAttr, memoize} from '../../esl-utils/decorators'; -import {ESLEventUtils} from '../../esl-utils/dom/events'; +import {attr, bind, boolAttr, memoize, prop} from '../../esl-utils/decorators'; import {ESLShareConfig} from './esl-share-config'; import {ESLShareButton} from './esl-share-button'; @@ -16,6 +15,9 @@ export class ESLShareList extends ESLBaseElement { super.register(); } + /** Event to dispatch on ready state of {@link ESLShareList} */ + @prop('esl:share:ready') public SHARE_READY_EVENT: string; + @attr({readonly: true}) public list: string; @attr({readonly: true}) public group: string; @attr({dataAttr: true}) public url: string; @@ -77,7 +79,7 @@ export class ESLShareList extends ESLBaseElement { protected init(): void { this._ready = this.buttonsConfig.then(this.buildContent); - this._ready.then(() => ESLEventUtils.dispatch(this, 'esl:share:ready')); + this._ready.then(() => this.$$fire(this.SHARE_READY_EVENT, {bubbles: false})); this._ready.catch((e) => console.error(`[${this.alias}]: ${e}`)); } From 0c70abb0c36f3867c48c819ce6ff60559ceeb47b Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 23 Feb 2023 20:32:44 +0200 Subject: [PATCH 065/117] refactor(esl-share): update styles --- pages/src/esl-share/esl-share.less | 6 ++++++ src/modules/esl-share/core/esl-share-button.less | 4 ---- src/modules/esl-share/core/esl-share-list.less | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pages/src/esl-share/esl-share.less b/pages/src/esl-share/esl-share.less index e6e193eec..f75af649f 100644 --- a/pages/src/esl-share/esl-share.less +++ b/pages/src/esl-share/esl-share.less @@ -4,3 +4,9 @@ esl-share-list esl-share-button[unavailable] { cursor: not-allowed; filter: grayscale(1); } + +esl-share-button { + path, circle { + fill: #fff; + } +} diff --git a/src/modules/esl-share/core/esl-share-button.less b/src/modules/esl-share/core/esl-share-button.less index fe9b51370..d17d50f5e 100644 --- a/src/modules/esl-share/core/esl-share-button.less +++ b/src/modules/esl-share/core/esl-share-button.less @@ -19,8 +19,4 @@ esl-share-button { width: 100%; height: 100%; } - - path, circle { - fill: #fff; - } } diff --git a/src/modules/esl-share/core/esl-share-list.less b/src/modules/esl-share/core/esl-share-list.less index 11d53983a..342e326a3 100644 --- a/src/modules/esl-share/core/esl-share-list.less +++ b/src/modules/esl-share/core/esl-share-list.less @@ -1,4 +1,3 @@ esl-share-list { - display: inline-block; - line-height: 0; + display: block; } From 05c810ebb34907dd7c7381a0e0efe6ff553c5082 Mon Sep 17 00:00:00 2001 From: Dmytro Shovchko Date: Wed, 1 Mar 2023 12:23:53 +0200 Subject: [PATCH 066/117] style(esl-share): apply suggestion from review Co-authored-by: ala'n (Alexey Stsefanovich) Co-authored-by: julia-murashko --- src/modules/esl-share/actions/media-action.ts | 3 ++- src/modules/esl-share/core/esl-share-action-registry.ts | 2 +- src/modules/esl-share/core/esl-share-button.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index 57d319924..9458128aa 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -19,7 +19,8 @@ export class ESLShareMediaAction extends ESLShareUrlGenericAction { }; protected get windowFeatures(): string { - return Object.entries((this.constructor as typeof ESLShareMediaAction).FEATURES).map((key, value) => `${key}=${value}`).join(','); + const features = (this.constructor as typeof ESLShareMediaAction).FEATURES; + return Object.entries(features).map((key, value) => `${key}=${value}`).join(','); } public share(shareData: ShareData, $button: ESLShareButton): void { diff --git a/src/modules/esl-share/core/esl-share-action-registry.ts b/src/modules/esl-share/core/esl-share-action-registry.ts index f7bc8ea2d..99d8acefa 100644 --- a/src/modules/esl-share/core/esl-share-action-registry.ts +++ b/src/modules/esl-share/core/esl-share-action-registry.ts @@ -17,7 +17,7 @@ export class ESLShareActionRegistry { this.actionsMap.set(action.is, new action()); } - /** Check if action is registered for passed name */ + /** Checks if action is registered for passed name */ public has(name: string): boolean { return this.actionsMap.has(name); } diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 0cd5e736f..a0b36c512 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -87,12 +87,12 @@ export class ESLShareButton extends ESLBaseElement { protected onAfterShare(): void {} @listen('click') - protected onClick(e: MouseEvent): void { + protected _onClick(e: MouseEvent): void { this.share(); } @listen('keydown') - protected onKeydown(e: KeyboardEvent): void { + protected _onKeydown(e: KeyboardEvent): void { if ([ENTER, SPACE].includes(e.key)) { this.click(); e.preventDefault(); From 8e9470c2790a007dece13dae9fe9b6ad77210476 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 1 Mar 2023 17:48:09 +0200 Subject: [PATCH 067/117] refactor(esl-share): refactor actions --- src/modules/esl-share/actions/copy-action.ts | 7 +++---- src/modules/esl-share/actions/native-action.ts | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index 37fd517e4..35d9c4e9c 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -1,4 +1,3 @@ -import {memoize} from '../../esl-utils/decorators'; import {ESLShareBaseAction} from '../core/esl-share-action'; import {ESLEventUtils} from '../../esl-utils/dom/events'; @@ -9,7 +8,6 @@ import type {AlertActionParams} from '../../esl-alert/core'; export class ESLShareCopyAction extends ESLShareBaseAction { public static readonly is: string = 'copy'; - @memoize() public get isAvailable(): boolean { return navigator.clipboard !== undefined; } @@ -26,9 +24,10 @@ export class ESLShareCopyAction extends ESLShareBaseAction { } public share(shareData: ShareData, $button: ESLShareButton): void { - if (!this.isAvailable) return; + const {url} = shareData; + if (!this.isAvailable || !url) return; - navigator.clipboard.writeText(shareData.url || ''); + navigator.clipboard.writeText(url); this.showCopyAlert(); } diff --git a/src/modules/esl-share/actions/native-action.ts b/src/modules/esl-share/actions/native-action.ts index 24156835e..67948fee8 100644 --- a/src/modules/esl-share/actions/native-action.ts +++ b/src/modules/esl-share/actions/native-action.ts @@ -1,4 +1,3 @@ -import {memoize} from '../../esl-utils/decorators'; import {ESLShareBaseAction} from '../core/esl-share-action'; import type {ESLShareButton} from '../core/esl-share-button'; @@ -7,7 +6,6 @@ import type {ESLShareButton} from '../core/esl-share-button'; export class ESLShareNativeAction extends ESLShareBaseAction { public static readonly is: string = 'native'; - @memoize() public get isAvailable(): boolean { return navigator.share !== undefined; } From 8679639c72a197a498eeab00e5d477f6c72904ae Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 1 Mar 2023 19:19:25 +0200 Subject: [PATCH 068/117] style(esl-share): fix linter issue --- src/modules/esl-share/actions/copy-action.ts | 4 ++-- src/modules/esl-share/actions/external-action.ts | 2 +- src/modules/esl-share/actions/media-action.ts | 2 +- src/modules/esl-share/actions/native-action.ts | 4 ++-- src/modules/esl-share/actions/print-action.ts | 2 +- src/modules/esl-share/core/esl-share-button.ts | 4 ++-- src/modules/esl-share/core/esl-share-list.ts | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index 35d9c4e9c..1248f060f 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -6,9 +6,9 @@ import type {AlertActionParams} from '../../esl-alert/core'; @ESLShareBaseAction.register export class ESLShareCopyAction extends ESLShareBaseAction { - public static readonly is: string = 'copy'; + public static override readonly is: string = 'copy'; - public get isAvailable(): boolean { + public override get isAvailable(): boolean { return navigator.clipboard !== undefined; } diff --git a/src/modules/esl-share/actions/external-action.ts b/src/modules/esl-share/actions/external-action.ts index 7ad4e1f98..b68f1d2bb 100644 --- a/src/modules/esl-share/actions/external-action.ts +++ b/src/modules/esl-share/actions/external-action.ts @@ -4,7 +4,7 @@ import type {ESLShareButton} from '../core/esl-share-button'; @ESLShareUrlGenericAction.register export class ESLShareExternalAction extends ESLShareUrlGenericAction { - public static readonly is: string = 'external'; + public static override readonly is: string = 'external'; public share(shareData: ShareData, $button: ESLShareButton): void { const {link} = $button; diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index 9458128aa..4f1ef2447 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -4,7 +4,7 @@ import type {ESLShareButton} from '../core/esl-share-button'; @ESLShareUrlGenericAction.register export class ESLShareMediaAction extends ESLShareUrlGenericAction { - public static readonly is: string = 'media'; + public static override readonly is: string = 'media'; public static FEATURES: Record = { scrollbars: 0, diff --git a/src/modules/esl-share/actions/native-action.ts b/src/modules/esl-share/actions/native-action.ts index 67948fee8..271fb60ad 100644 --- a/src/modules/esl-share/actions/native-action.ts +++ b/src/modules/esl-share/actions/native-action.ts @@ -4,9 +4,9 @@ import type {ESLShareButton} from '../core/esl-share-button'; @ESLShareBaseAction.register export class ESLShareNativeAction extends ESLShareBaseAction { - public static readonly is: string = 'native'; + public static override readonly is: string = 'native'; - public get isAvailable(): boolean { + public override get isAvailable(): boolean { return navigator.share !== undefined; } diff --git a/src/modules/esl-share/actions/print-action.ts b/src/modules/esl-share/actions/print-action.ts index 2dd47678d..dfb934d10 100644 --- a/src/modules/esl-share/actions/print-action.ts +++ b/src/modules/esl-share/actions/print-action.ts @@ -4,7 +4,7 @@ import type {ESLShareButton} from '../core/esl-share-button'; @ESLShareBaseAction.register export class ESLSharePrintAction extends ESLShareBaseAction { - public static readonly is: string = 'print'; + public static override readonly is: string = 'print'; public share(shareData: ShareData, $button: ESLShareButton): void { window.print(); diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index a0b36c512..8f9abd800 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -16,7 +16,7 @@ export interface ShareButtonConfig { } export class ESLShareButton extends ESLBaseElement { - public static is = 'esl-share-button'; + public static override is = 'esl-share-button'; public static DEFAULT_ICON_BG_COLOR: string = '#FFF'; @@ -64,7 +64,7 @@ export class ESLShareButton extends ESLBaseElement { }; } - protected connectedCallback(): void { + protected override connectedCallback(): void { super.connectedCallback(); this.initA11y(); } diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 2295ad707..7edfe06e5 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -8,9 +8,9 @@ import type {ShareButtonConfig} from './esl-share-button'; import type {ShareConfig} from './esl-share-config'; export class ESLShareList extends ESLBaseElement { - public static is = 'esl-share-list'; + public static override is = 'esl-share-list'; - public static register(): void { + public static override register(): void { ESLShareButton.register(); super.register(); } @@ -70,7 +70,7 @@ export class ESLShareList extends ESLBaseElement { return list ? list.split(',').map((id) => id.trim()) : []; } - public connectedCallback(): void { + public override connectedCallback(): void { super.connectedCallback(); if (!this._ready) { this.init(); From 96552002b3f1496344c3b35179ea1b9b59844ceb Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 1 Mar 2023 20:08:12 +0200 Subject: [PATCH 069/117] refactor(esl-share): update data-share attributes --- pages/views/examples/share.njk | 2 +- src/modules/esl-share/core/esl-share-button.ts | 4 ++-- src/modules/esl-share/core/esl-share-list.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index bbcad2c82..8ea47e36d 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -53,7 +53,7 @@ aside:

Display list of share buttons (without group or list)

Shows all buttons from config.

- +

Trigger icon with share popup

diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 8f9abd800..25cbc905a 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -59,8 +59,8 @@ export class ESLShareButton extends ESLBaseElement { const {host} = this; return { - url: (host && host.url) ? ESLShareButton.convertToAbsolutePath(host.url) : window.location.href, - title: (host && host.title) ? host.title : document.title + url: (host && host.shareUrl) ? ESLShareButton.convertToAbsolutePath(host.shareUrl) : window.location.href, + title: (host && host.shareTitle) ? host.shareTitle : document.title }; } diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 7edfe06e5..1d9c3819a 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -20,8 +20,8 @@ export class ESLShareList extends ESLBaseElement { @attr({readonly: true}) public list: string; @attr({readonly: true}) public group: string; - @attr({dataAttr: true}) public url: string; - @attr({dataAttr: true}) public title: string; + @attr({dataAttr: true}) public shareUrl: string; + @attr({dataAttr: true}) public shareTitle: string; @boolAttr({readonly: true}) public ready: boolean; From 10698fd4d2b40121ffd1fa70752cf4d4b7a9c2d0 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Wed, 1 Mar 2023 20:21:39 +0200 Subject: [PATCH 070/117] fix(esl-share): fix window.open features --- src/modules/esl-share/actions/media-action.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index 4f1ef2447..bd9404fd1 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -20,7 +20,7 @@ export class ESLShareMediaAction extends ESLShareUrlGenericAction { protected get windowFeatures(): string { const features = (this.constructor as typeof ESLShareMediaAction).FEATURES; - return Object.entries(features).map((key, value) => `${key}=${value}`).join(','); + return Object.entries(features).map(([key, value]) => `${key}=${value}`).join(','); } public share(shareData: ShareData, $button: ESLShareButton): void { From 37edb5d50c9f37dfc81c9b3f942ad356eeee6573 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 2 Mar 2023 18:56:22 +0200 Subject: [PATCH 071/117] style(esl-share): replace bgcolor static property with @prop --- src/modules/esl-share/core/esl-share-button.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 25cbc905a..59748c906 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -1,5 +1,5 @@ import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr, boolAttr, listen} from '../../esl-utils/decorators'; +import {attr, boolAttr, listen, prop} from '../../esl-utils/decorators'; import {ENTER, SPACE} from '../../esl-utils/dom/keys'; import {ESLShareActionRegistry} from './esl-share-action-registry'; @@ -18,13 +18,12 @@ export interface ShareButtonConfig { export class ESLShareButton extends ESLBaseElement { public static override is = 'esl-share-button'; - public static DEFAULT_ICON_BG_COLOR: string = '#FFF'; - @attr() public action: string; @attr() public buttonId: string; @attr() public link: string; @attr() public name: string; @boolAttr() public unavailable: boolean; + @prop('transparent') public defaultBackground: string; public static build(cfg: ShareButtonConfig): ESLShareButton | null { const shareAction = ESLShareActionRegistry.instance.get(cfg.action); @@ -42,7 +41,7 @@ export class ESLShareButton extends ESLBaseElement { $icon.title = cfg.title; $icon.classList.add('esl-share-icon'); $icon.innerHTML = cfg.icon; - $icon.setAttribute('style', `background-color:${cfg.iconBackground || ESLShareButton.DEFAULT_ICON_BG_COLOR};`); + $icon.setAttribute('style', `background-color:${cfg.iconBackground || $button.defaultBackground};`); $button.appendChild($icon); return $button; } From a7f35c2c7576829fa313710e959de12ef7a6d8a2 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Thu, 2 Mar 2023 19:34:45 +0200 Subject: [PATCH 072/117] refactor(esl-share): remove id from share config --- pages/static/assets/share/config.json | 62 +++++++------------ pages/views/examples/share.njk | 2 +- .../esl-share/core/esl-share-button.ts | 5 +- src/modules/esl-share/core/esl-share-list.ts | 4 +- 4 files changed, 25 insertions(+), 48 deletions(-) diff --git a/pages/static/assets/share/config.json b/pages/static/assets/share/config.json index 133d0c175..e47d16fde 100644 --- a/pages/static/assets/share/config.json +++ b/pages/static/assets/share/config.json @@ -1,183 +1,163 @@ { "buttons": [ { - "id": "facebook", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 27.99 28\"\u003e\u003cpath d\u003d\"M23 17.11l.55-4.24h-4.2v-2.71c0-1.23.34-2.06 2.1-2.06h2.25V4.29a31.62 31.62 0 00-3.28-.16c-3.24 0-5.46 2-5.46 5.61v3.13h-3.63v4.24H15V28h4.39V17.11z\"/\u003e\u003c/svg\u003e", "iconBackground": "#3c5996", "link": "//www.facebook.com/sharer.php?u\u003d{u}", - "name": "Facebook", + "name": "facebook", "title": "Facebook" }, { - "id": "linkedin", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 27.99 27.99\"\u003e\u003cpath d\u003d\"M6.37 11.33h3.25v10.45H6.37zM8 6.13A1.88 1.88 0 116.12 8 1.88 1.88 0 018 6.13M11.65 11.33h3.12v1.43h.05a3.4 3.4 0 013.07-1.69c3.29 0 3.9 2.17 3.9 5v5.73h-3.25v-5.11c0-1.21 0-2.77-1.69-2.77s-1.94 1.32-1.94 2.69v5.17h-3.25V11.33z\"/\u003e\u003c/svg\u003e", "iconBackground": "#0b77b3", "link": "//www.linkedin.com/sharing/share-offsite/?url\u003d{u}", - "name": "Linkedin", - "title": "Linkedin" + "name": "linkedin", + "title": "LinkedIn" }, { - "id": "twitter", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 27.99 27.99\"\u003e\u003cpath d\u003d\"M21.84 9.14a6.34 6.34 0 01-1.84.51 3.25 3.25 0 001.4-1.78 6.22 6.22 0 01-2 .78 3.22 3.22 0 00-5.57 2.2 2.92 2.92 0 00.09.73 9.11 9.11 0 01-6.67-3.36 3.16 3.16 0 00-.43 1.62 3.21 3.21 0 001.43 2.68 3.25 3.25 0 01-1.46-.41 3.23 3.23 0 002.58 3.16 3 3 0 01-.84.11 3 3 0 01-.61-.05 3.22 3.22 0 003 2.23 6.39 6.39 0 01-4 1.38 6.19 6.19 0 01-.76-.05 9.14 9.14 0 0014.08-7.71v-.41a6.36 6.36 0 001.6-1.63z\"/\u003e\u003c/svg\u003e", "iconBackground": "#26a1ef", "link": "//twitter.com/intent/tweet?text\u003d{t}\u0026url\u003d{u}", - "name": "Twitter", + "name": "twitter", "title": "Twitter" }, { - "id": "reddit", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M27 15.5a2.452 2.452 0 01-1.338 2.21c.098.38.147.777.147 1.19 0 1.283-.437 2.47-1.308 3.563-.872 1.092-2.06 1.955-3.567 2.588-1.506.634-3.143.95-4.91.95-1.768 0-3.403-.316-4.905-.95-1.502-.632-2.69-1.495-3.56-2.587-.872-1.092-1.308-2.28-1.308-3.562 0-.388.045-.777.135-1.166a2.47 2.47 0 01-1.006-.912c-.253-.4-.38-.842-.38-1.322 0-.678.237-1.26.712-1.744a2.334 2.334 0 011.73-.726c.697 0 1.29.26 1.78.782 1.785-1.258 3.893-1.928 6.324-2.01l1.424-6.467a.42.42 0 01.184-.26.4.4 0 01.32-.063l4.53 1.006c.147-.306.368-.553.662-.74a1.78 1.78 0 01.97-.278c.508 0 .94.18 1.302.54.36.36.54.796.54 1.31 0 .512-.18.95-.54 1.315-.36.364-.794.546-1.302.546-.507 0-.94-.18-1.295-.54a1.793 1.793 0 01-.533-1.308l-4.1-.92-1.277 5.86c2.455.074 4.58.736 6.37 1.985a2.315 2.315 0 011.757-.757c.68 0 1.256.242 1.73.726.476.484.713 1.066.713 1.744zm-16.868 2.47c0 .513.178.95.534 1.315.356.365.787.547 1.295.547.508 0 .942-.182 1.302-.547.36-.364.54-.802.54-1.315 0-.513-.18-.95-.54-1.31-.36-.36-.794-.54-1.3-.54-.5 0-.93.183-1.29.547a1.79 1.79 0 00-.54 1.303zm9.944 4.406c.09-.09.135-.2.135-.323a.444.444 0 00-.44-.447c-.124 0-.23.042-.32.124-.336.348-.83.605-1.486.77a7.99 7.99 0 01-1.964.248 7.99 7.99 0 01-1.964-.248c-.655-.165-1.15-.422-1.486-.77a.456.456 0 00-.32-.124.414.414 0 00-.306.124.41.41 0 00-.135.317.45.45 0 00.134.33c.352.355.837.636 1.455.843.617.207 1.118.33 1.503.366a11.6 11.6 0 001.117.056c.36 0 .733-.02 1.117-.056.385-.037.886-.16 1.504-.366.62-.207 1.104-.488 1.456-.844zm-.037-2.544c.507 0 .938-.182 1.294-.547.356-.364.534-.802.534-1.315 0-.505-.18-.94-.54-1.303a1.75 1.75 0 00-1.29-.546c-.506 0-.94.18-1.3.54-.36.36-.54.797-.54 1.31s.18.95.54 1.315c.36.365.794.547 1.3.547z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", "iconBackground": "#ff5700", "link": "//www.reddit.com/submit?url\u003d{u}\u0026title\u003d{t}", - "name": "Reddit", + "name": "reddit", "title": "Reddit" }, { - "id": "myspace", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M19.996 11.757c1.905 0 3.45-1.513 3.45-3.38C23.445 6.513 21.9 5 19.995 5c-1.903 0-3.448 1.512-3.448 3.378s1.545 3.38 3.448 3.38zm4.995 5.233c-.09-2.574-2.242-4.638-4.893-4.638a4.934 4.934 0 00-3.24 1.206 3.62 3.62 0 00-3.318-2.133c-.944 0-1.8.356-2.443.935a2.596 2.596 0 00-2.494-1.82c-1.407 0-2.55 1.093-2.6 2.462H6v4.783h3.92v3.712h5.276V26H25v-9.01h-.01zm-11.526-6.006c1.405 0 2.545-1.116 2.545-2.492C16.01 7.115 14.87 6 13.463 6 12.06 6 10.92 7.114 10.92 8.49c0 1.376 1.14 2.492 2.544 2.492zm-4.914-.762c1.012 0 1.83-.803 1.83-1.794 0-.992-.818-1.795-1.83-1.795-1.01 0-1.83.804-1.83 1.795 0 .99.82 1.794 1.83 1.794z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", "iconBackground": "#282828", "link": "//myspace.com/post?u\u003d{u}", - "name": "Myspace", + "name": "myspace", "title": "Myspace" }, { - "id": "mix", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M26 6v11.077C26 18.123 25.105 19 24 19s-2-.877-2-1.923v-1a2 2 0 00-2-2 2 2 0 00-2 2v2.846c-.02 1.046-.915 1.923-2 1.923-1.12 0-2.013-.877-2-1.923V11.23a2.036 2.036 0 00-2-2c-1.062.024-1.922.822-2 1.847-.003.025-.003 4.275 0 12.75 0 1.045-.895 1.923-2 1.923s-2-.878-2-1.923V6h20z\" opacity\u003d\".8\"/\u003e\u003cpath d\u003d\"M6 6v10.77c2.135-.006 3.878-1.648 4-3.693V11.23a.702.702 0 010-.153c.078-1.025.938-1.823 2-1.846 1.092.024 1.986.902 2 2v7.693c-.013 1.046.88 1.923 2 1.923 1.085 0 1.98-.877 2-1.923v-5.23C17.98 9.458 21.502 6 25.846 6H6\"/\u003e\u003c/svg\u003e", "iconBackground": "#eb4924", "link": "//mix.com/add?url\u003d{u}", - "name": "MIX", + "name": "mix", "title": "MIX" }, { - "id": "wykop", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M14.722 19.784l-3.48-6.832-2.667 1.36 3.82 7.497.056-.03.313.61 10.608-5.404-.48-.944-3.65-7.165-2.667 1.36 3.48 6.83-1.332.68-3.48-6.832-2.666 1.358 3.48 6.832-1.332.68z\"/\u003e\u003cpath d\u003d\"M7.372 12.77c0-2.38 1.86-4.308 4.152-4.308h8.952c2.294 0 4.152 1.928 4.152 4.308v6.46c0 2.38-1.86 4.308-4.152 4.308h-8.952c-2.294 0-4.152-1.928-4.152-4.308v-6.46zM5 12.77v6.46C5 22.97 7.92 26 11.524 26h8.952C24.08 26 27 22.97 27 19.23v-6.46C27 9.03 24.08 6 20.476 6h-8.952C7.92 6 5 9.03 5 12.77z\"/\u003e\u003c/svg\u003e", "iconBackground": "#fb803f", "link": "//www.wykop.pl/dodaj?url\u003d{u}\u0026title\u003d{t}", - "name": "Wykop", + "name": "wykop", "title": "Wykop" }, { - "id": "pinterest", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 24 24\"\u003e\u003cpath d\u003d\"M12.486 4.771c-4.23 0-6.363 3.033-6.363 5.562 0 1.533.581 2.894 1.823 3.401.205.084.387.004.446-.221l.182-.717c.061-.221.037-.3-.127-.495-.359-.422-.588-.972-.588-1.747 0-2.25 1.683-4.264 4.384-4.264 2.392 0 3.706 1.463 3.706 3.412 0 2.568-1.137 4.734-2.824 4.734-.932 0-1.629-.77-1.405-1.715.268-1.13.786-2.347.786-3.16 0-.729-.392-1.336-1.2-1.336-.952 0-1.718.984-1.718 2.304 0 .841.286 1.409.286 1.409L8.728 16.79c-.34 1.44-.051 3.206-.025 3.385.013.104.149.131.21.051.088-.115 1.223-1.517 1.607-2.915.111-.396.627-2.445.627-2.445.311.589 1.213 1.108 2.175 1.108 2.863 0 4.804-2.608 4.804-6.103-.003-2.64-2.24-5.1-5.64-5.1z\"/\u003e\u003c/svg\u003e", "iconBackground": "#e60023", "link": "//www.pinterest.com/pin/create/button/?url\u003d{u}\u0026description\u003d{t}", - "name": "Pinterest", + "name": "pinterest", "title": "Pinterest" }, { - "id": "telegram", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 455.731 455.731\"\u003e\u003cpath d\u003d\"M358.844 100.6 54.091 219.359c-9.871 3.847-9.273 18.012.888 21.012l77.441 22.868 28.901 91.706c3.019 9.579 15.158 12.483 22.185 5.308l40.039-40.882 78.56 57.665c9.614 7.057 23.306 1.814 25.747-9.859l52.031-248.76c2.548-12.185-9.44-22.337-21.039-17.817zm-38.208 55.206L179.08 280.984c-1.411 1.248-2.309 2.975-2.519 4.847l-5.45 48.448c-.178 1.58-2.389 1.789-2.861.271l-22.423-72.253c-1.027-3.308.312-6.892 3.255-8.717l167.163-103.676c3.844-2.386 7.78 2.906 4.391 5.902z\"/\u003e\u003c/svg\u003e", "iconBackground": "#61a8de", "link": "//t.me/share/url?url\u003d{u}\u0026text\u003d{t}", - "name": "Telegram", + "name": "telegram", "title": "Telegram" }, { - "id": "blogger", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M19.864 21.38H11.84a1.712 1.712 0 010-3.425h8.024a1.712 1.712 0 010 3.425zm-7.542-11.27l4.012.063a1.712 1.712 0 01-.054 3.424l-4.012-.064a1.712 1.712 0 01.054-3.424zm13.4 9.404c-.007-.374-.008-.71-.01-1.014-.006-1.58-.012-2.83-1.016-3.803-.716-.694-1.565-.914-2.855-.962.176-.747.226-1.575.145-2.47-.02-2.973-2.234-5.18-5.304-5.264h-.043l-4.692.072c-1.844-.007-3.3.53-4.332 1.606-.638.666-1.362 1.83-1.45 3.72H6.16v.057a8.6 8.6 0 00-.006.393l-.12 7.125c-.008.143-.015.288-.016.437-.12 2.088.372 3.728 1.463 4.876 1.078 1.132 2.664 1.706 4.715 1.706h7.32c1.84-.017 3.393-.624 4.494-1.757 1.1-1.132 1.692-2.743 1.713-4.66v-.06z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", "iconBackground": "#f57d00", "link": "//blogger.com/blog-this.g?n\u003d{t}\u0026u\u003d{u}", - "name": "Blogger", + "name": "blogger", "title": "Blogger" }, { - "id": "pusha", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M29.27 22.19V8.07l-12.06 6.85 3.84 2.33C15.72 24.14 5.9 29.31 0 31.96V32h19.64c3.68-4.86 7.03-11.46 7.03-11.46l2.6 1.65z\"/\u003e\u003c/svg\u003e", "iconBackground": "#0878ba", "link": "//www.pusha.se/posta?url\u003d{u}\u0026title\u003d{t}", - "name": "Pusha", + "name": "pusha", "title": "Pusha" }, { - "id": "kakao", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M20.826 6h-9.652C10.524 6 10 6.51 10 7.138v9.336c0 .63.525 1.14 1.174 1.14h4.45c-.03 1.11-.507 2.318-1.196 3.39-.775 1.207-2.426 2.543-2.44 2.555-.13.12-.226.26-.23.456 0 .15.08.263.167.385l3.104 3.395s.15.154.274.183c.14.033.3.037.41-.045 5.374-4.032 6.15-9.085 6.285-11.82V7.137C22 6.508 21.475 6 20.826 6\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", "iconBackground": "#fab900", "link": "//story.kakao.com/share?url\u003d{u}", - "name": "Kakao", + "name": "kakao", "title": "Kakao" }, { - "id": "line", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M27 14.927c0 1.97-.764 3.744-2.358 5.492-2.307 2.655-7.468 5.89-8.642 6.385-1.174.495-1-.315-.953-.593l.157-.94c.037-.282.075-.718-.035-.996-.125-.306-.612-.465-.97-.542-5.287-.7-9.2-4.395-9.2-8.807C5 10.005 9.935 6 16 6c6.066 0 11 4.005 11 8.927zm-13.235-2.38h-.772a.214.214 0 00-.214.215v4.793c0 .118.095.214.213.214h.772a.214.214 0 00.214-.215v-4.793a.214.214 0 00-.215-.214zm5.31 0h-.77a.214.214 0 00-.215.215v2.848l-2.197-2.967a.235.235 0 00-.017-.023l-.014-.013-.003-.004c-.005-.003-.01-.006-.013-.01-.002 0-.003-.002-.005-.004l-.01-.008a.262.262 0 00-.018-.01c-.004 0-.006-.003-.008-.004a.605.605 0 00-.013-.005l-.007-.002a.106.106 0 00-.02-.005.098.098 0 00-.012-.003h-.01c-.003-.002-.006-.002-.01-.003-.004 0-.007 0-.01-.002h-.78a.214.214 0 00-.214.214v4.793c0 .118.095.214.214.214h.77a.214.214 0 00.216-.215v-2.847l2.2 2.97c.014.022.033.04.053.053 0 .002.002.002.002.003l.014.008c0 .002.003.003.005.004l.01.005c.003 0 .007.002.01.004.003 0 .004 0 .007.002l.014.005s.002 0 .003.002a.206.206 0 00.054.007h.772a.214.214 0 00.214-.215v-4.793a.214.214 0 00-.214-.214zm-7.17 4.022H9.81V12.76a.214.214 0 00-.216-.214h-.77a.214.214 0 00-.216.214v4.793c0 .058.023.11.06.148l.003.003c.002 0 .003.002.005.003.038.036.09.06.147.06h3.083a.214.214 0 00.214-.215v-.772a.214.214 0 00-.215-.214zm11.432-2.822a.214.214 0 00.214-.214v-.77a.214.214 0 00-.213-.216h-3.082a.213.213 0 00-.15.06s0 .002-.002.003c0 .002-.003.003-.004.005a.214.214 0 00-.06.147v4.793c0 .057.023.11.06.148l.003.003.003.003c.04.036.09.06.148.06h3.083a.214.214 0 00.214-.215v-.772a.214.214 0 00-.213-.214H21.24v-.812h2.097a.214.214 0 00.214-.214v-.77a.214.214 0 00-.213-.216H21.24v-.81h2.097z\" fill-rule\u003d\"evenodd\"/\u003e\u003c/svg\u003e", "iconBackground": "#00b900", "link": "//social-plugins.line.me/lineit/share?url\u003d{u}", - "name": "LINE", + "name": "line", "title": "LINE" }, { - "id": "sina_weibo", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M14.24 23.808c-3.64.367-6.785-1.307-7.022-3.734-.236-2.43 2.525-4.693 6.164-5.06 3.642-.367 6.786 1.307 7.02 3.734.24 2.43-2.522 4.696-6.16 5.06m7.28-8.063c-.31-.096-.523-.157-.362-.57.352-.898.39-1.672.006-2.227-.713-1.036-2.667-.98-4.907-.028 0 0-.705.312-.523-.253.343-1.125.29-2.065-.243-2.61-1.214-1.238-4.446.045-7.216 2.86C6.205 15.023 5 17.26 5 19.192c0 3.694 4.664 5.942 9.226 5.942 5.98 0 9.96-3.53 9.96-6.333.003-1.695-1.402-2.657-2.665-3.055m3.973-6.763a5.76 5.76 0 00-5.542-1.823.855.855 0 00-.646 1.015.84.84 0 001 .657c1.398-.303 2.912.138 3.938 1.295a4.254 4.254 0 01.865 4.113c-.144.45.1.93.542 1.076a.84.84 0 001.06-.55v-.002a5.973 5.973 0 00-1.218-5.78\"/\u003e\u003cpath d\u003d\"M23.276 11.018a2.8 2.8 0 00-2.698-.885.74.74 0 00-.56.876c.086.396.472.65.86.563.467-.102.977.046 1.32.432.343.388.437.915.29 1.378a.742.742 0 00.466.928.724.724 0 00.913-.474c.3-.947.113-2.026-.59-2.818M14.44 19.41c-.126.223-.408.328-.627.235-.218-.09-.285-.34-.16-.555.127-.215.397-.32.612-.234.22.08.298.33.176.555m-1.16 1.512c-.353.57-1.11.82-1.676.558-.56-.26-.726-.922-.374-1.48.35-.555 1.078-.802 1.642-.56.57.25.753.905.407 1.482m1.322-4.04c-1.733-.46-3.69.42-4.443 1.97-.77 1.583-.025 3.34 1.723 3.914 1.815.595 3.95-.318 4.695-2.023.734-1.67-.182-3.39-1.976-3.86\"/\u003e\u003c/svg\u003e", "iconBackground": "#e6162d", "link": "//service.weibo.com/share/share.php?url\u003d{u}\u0026title\u003d{t}", - "name": "Sina Weibo", + "name": "sina-weibo", "title": "Sina Weibo" }, { - "id": "mixi", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M16.087 5.36c-6.414 0-11.97 3.93-11.97 11.265 0 6.865 7.628 10.092 12.635 8.918v2.348S27.88 24.958 27.88 15.04c0-6.043-4.458-9.68-11.793-9.68zm6.768 14.63h-1.643v-5.634c0-.703-.506-1.565-1.566-1.565-.89 0-2.504.374-2.504 2.06v5.14H15.5v-5.202c0-1.57-.782-2.073-1.486-2.073-1.14 0-2.698.802-2.698 2.384v4.89H9.673v-8.92h1.643v1.02c.654-.538 1.548-1.02 2.698-1.02 1.21 0 2.07.428 2.58 1.27a4.444 4.444 0 013.052-1.19c1.947 0 3.21 1.772 3.21 3.172v5.667z\"/\u003e\u003c/svg\u003e", "iconBackground": "#cfab59", "link": "//mixi.jp/share.pl?u\u003d{u}", - "name": "Mixi", + "name": "mixi", "title": "Mixi" }, { - "id": "hatena", "action": "media", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 32 32\"\u003e\u003cpath d\u003d\"M6.96 8.22h7.33c1.25 0 2.21.37 2.88 1.1s1 1.64 1 2.72c0 .91-.24 1.69-.72 2.34-.32.43-.78.77-1.4 1.02.93.27 1.61.72 2.05 1.37.44.65.66 1.46.66 2.43 0 .8-.16 1.51-.47 2.15-.31.64-.74 1.14-1.28 1.51-.34.23-.84.4-1.52.5-.9.14-1.5.21-1.79.21H6.96V8.22zm3.88 6.02h1.74c.62 0 1.06-.13 1.3-.38.24-.26.37-.62.37-1.1 0-.44-.12-.8-.37-1.05-.24-.25-.67-.38-1.27-.38h-1.77v2.91zm0 6.03h2.04c.69 0 1.18-.15 1.46-.43s.43-.68.43-1.17c0-.45-.14-.82-.42-1.09-.28-.28-.77-.41-1.47-.41h-2.03c-.01-.01-.01 3.1-.01 3.1zM21.21 8.41h3.58v9.58h-3.58z\"/\u003e\u003ccircle cx\u003d\"23\" cy\u003d\"21.53\" r\u003d\"2.04\"/\u003e\u003c/svg\u003e", "iconBackground": "#08aed9", "link": "//b.hatena.ne.jp/entry/panel/?url\u003d{u}\u0026btitle\u003d{t}", - "name": "Hatena", + "name": "hatena", "title": "Hatena" }, { - "id": "mail", "action": "external", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M4.63 6.94v14.1h18.8V6.94H4.63zm2.44 1.78h13.9l-6.93 5.67-6.93-5.67zm14.6 1.72v8.82H6.47v-8.79l7.59 6.21 7.63-6.24z\"/\u003e\u003c/svg\u003e", "iconBackground": "#ff1493", "link": "mailto:?subject\u003d{title}\u0026body\u003d{url}", - "name": "Mail", + "name": "mail", "title": "Mail" }, { - "id": "copy", "action": "copy", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 28 28\"\u003e\u003cpath d\u003d\"M17 9.69l-7.43 7.43 1.18 1.18 7.43-7.43L17 9.69z\"/\u003e\u003cpath d\u003d\"M4.31 17.8c-.481.481-.48 1.29.00138 1.77l4.02 4.02c.481.481 1.29.483 1.77.00138l4.95-4.95c.481-.481.481-1.29-7e-7-1.78l-4.02-4.02c-.481-.481-1.29-.481-1.78 0l-4.95 4.95zm1.47.887l4.36-4.36 3.44 3.44-4.36 4.36-3.44-3.44zm7-9.37c-.481.481-.481 1.29 2.8e-7 1.78l4.02 4.02c.481.481 1.29.481 1.78 0l4.95-4.95c.481-.481.48-1.29-.00138-1.77l-4.02-4.02c-.481-.481-1.29-.483-1.77-.00138l-4.95 4.95zm1.47.889l4.36-4.36 3.44 3.44-4.36 4.36-3.44-3.44z\"/\u003e\u003c/svg\u003e", "iconBackground": "#a0522d", "link": "", - "name": "Copy", + "name": "copy", "title": "Copy" }, { - "id": "native", "action": "native", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 24 24\"\u003e\u003cpath d\u003d\"m21.7 10.2-6.6-6c-.5-.5-1.1 0-1.1.8v3c-4.7 0-8.7 2.9-10.6 6.8-.7 1.3-1.1 2.7-1.4 4.1-.2 1 1.3 1.5 1.9.6C6.1 16 9.8 13.7 14 13.7V17c0 .8.6 1.3 1.1.8l6.6-6c.4-.4.4-1.2 0-1.6z\"/\u003e\u003c/svg\u003e", "iconBackground": "#ff6347", "link": "", - "name": "Share", + "name": "native-share", "title": "Share page" }, { - "id": "print", "action": "print", "icon": "\u003csvg xmlns\u003d\"http://www.w3.org/2000/svg\" aria-hidden\u003d\"true\" focusable\u003d\"false\" role\u003d\"presentation\" viewBox\u003d\"0 0 247.1 247.1\"\u003e\u003cpath d\u003d\"M75.4 175.5h97v6.5h-97zM75.4 194.9h97v6.5h-97z\"/\u003e\u003ccircle stroke-width\u003d\"2\" stroke-miterlimit\u003d\"10\" cx\u003d\"178.9\" cy\u003d\"117.3\" r\u003d\"6.5\"/\u003e\u003cpath d\u003d\"M198.3 84.9h-12.9V39.6c0-7.1-5.8-12.9-12.9-12.9h-97c-7.1 0-12.9 5.8-12.9 12.9v45.3H49.5c-11 0-19.4 8.4-19.4 19.4v58.2c0 11 8.4 19.4 19.4 19.4h12.9v25.9c0 7.1 5.8 12.9 12.9 12.9h97c7.1 0 12.9-5.8 12.9-12.9v-25.9h12.9c11 0 19.4-8.4 19.4-19.4v-58.2c.2-11-8.2-19.4-19.2-19.4zM68.9 39.6c0-3.2 2.6-6.5 6.5-6.5h97c3.2 0 6.5 2.6 6.5 6.5v45.3h-110V39.6zm110 168.2c0 3.2-2.6 6.5-6.5 6.5h-97c-3.2 0-6.5-2.6-6.5-6.5v-45.3h110v45.3zm32.3-45.3c0 7.1-5.8 12.9-12.9 12.9h-12.9V156h-123v19.4H49.5c-7.1 0-12.9-5.8-12.9-12.9v-58.2c0-7.1 5.8-12.9 12.9-12.9h148.8c7.1 0 12.9 5.8 12.9 12.9v58.2z\"/\u003e\u003c/svg\u003e", "iconBackground": "#2f4f4f", "link": "", - "name": "Print", + "name": "print", "title": "Print page" } ], diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index 8ea47e36d..0c7a6b83c 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -14,7 +14,7 @@ aside:

Share example

Just a standalone share button

- + diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 59748c906..dbe6de483 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -7,7 +7,6 @@ import type {ESLShareList} from './esl-share-list'; export interface ShareButtonConfig { 'action': string; - 'id': string; 'icon': string; 'iconBackground': string; 'link': string; @@ -19,7 +18,6 @@ export class ESLShareButton extends ESLBaseElement { public static override is = 'esl-share-button'; @attr() public action: string; - @attr() public buttonId: string; @attr() public link: string; @attr() public name: string; @boolAttr() public unavailable: boolean; @@ -32,10 +30,9 @@ export class ESLShareButton extends ESLBaseElement { const {isAvailable} = shareAction; const $button = ESLShareButton.create(); $button.$$attr('action', cfg.action); - $button.$$attr('button-id', cfg.id); $button.$$attr('link', cfg.link); $button.$$attr('name', cfg.name); - $button.$$attr('aria-label', cfg.title); + $button.$$attr('title', cfg.title); $button.$$attr('unavailable', !isAvailable); const $icon = document.createElement('span'); $icon.title = cfg.title; diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 1d9c3819a..f332e76f5 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -51,8 +51,8 @@ export class ESLShareList extends ESLBaseElement { protected getButtons(config: ShareConfig, idList: string[]): ShareButtonConfig[] { const {buttons} = config; const ret: ShareButtonConfig[] = []; - idList.forEach((buttonId) => { - const btnConfig = buttons.find((btn) => btn.id === buttonId); + idList.forEach((name) => { + const btnConfig = buttons.find((btn) => btn.name === name); btnConfig && ret.push(btnConfig); }); return ret; From ac5f7ed181f75fa496e7e4521a779d25b2d4d8a4 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 3 Mar 2023 16:38:42 +0200 Subject: [PATCH 073/117] feat(esl-utils): added URL utility with toAbsoluteUrl method --- src/modules/esl-utils/misc.ts | 1 + src/modules/esl-utils/misc/url.ts | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 src/modules/esl-utils/misc/url.ts diff --git a/src/modules/esl-utils/misc.ts b/src/modules/esl-utils/misc.ts index e1bfe5e29..d8000180c 100644 --- a/src/modules/esl-utils/misc.ts +++ b/src/modules/esl-utils/misc.ts @@ -6,6 +6,7 @@ export * as ArrayUtils from './misc/array'; export * as ObjectUtils from './misc/object'; export * as FormatUtils from './misc/format'; export * as FunctionUtils from './misc/functions'; +export * as UrlUtils from './misc/url'; export {sequentialUID, randUID} from './misc/uid'; export {range, tuple, wrap, uniq} from './misc/array'; diff --git a/src/modules/esl-utils/misc/url.ts b/src/modules/esl-utils/misc/url.ts new file mode 100644 index 000000000..d673c0c7f --- /dev/null +++ b/src/modules/esl-utils/misc/url.ts @@ -0,0 +1,8 @@ +/** + * Converts relative URL to absolute URL based on the base URL. + * @param relative - relative URL + * @param base - base URL (document.baseURI by default) + **/ +export function toAbsoluteUrl(relative: string, base: string = document.baseURI): string { + return new URL(relative, base).href; +} From f649e47ca9cba697fe343c703e4558e2f6c0d95c Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 3 Mar 2023 16:39:43 +0200 Subject: [PATCH 074/117] test(esl-utils): url utility tests added --- src/modules/esl-utils/misc/test/url.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/modules/esl-utils/misc/test/url.test.ts diff --git a/src/modules/esl-utils/misc/test/url.test.ts b/src/modules/esl-utils/misc/test/url.test.ts new file mode 100644 index 000000000..7057c0437 --- /dev/null +++ b/src/modules/esl-utils/misc/test/url.test.ts @@ -0,0 +1,14 @@ +import {toAbsoluteUrl} from '../url'; + +describe('misc/url helper tests', () => { + test('1', () => { + expect(toAbsoluteUrl('')).toBe('http://localhost/'); + expect(toAbsoluteUrl('/pathname/page.html')).toBe('http://localhost/pathname/page.html'); + expect(toAbsoluteUrl('?query=string')).toBe('http://localhost/?query=string'); + expect(toAbsoluteUrl('#anchor')).toBe('http://localhost/#anchor'); + expect(toAbsoluteUrl('/page.html?query=string#anchor')).toBe('http://localhost/page.html?query=string#anchor'); + expect(toAbsoluteUrl('https://esl-ui.com/page.html')).toBe('https://esl-ui.com/page.html'); + expect(toAbsoluteUrl('', 'https://esl-ui.com')).toBe('https://esl-ui.com/'); + expect(toAbsoluteUrl('/page.html', 'https://esl-ui.com/home.html?query=string#anchor')).toBe('https://esl-ui.com/page.html'); + }); +}); From 5f9bf92f17951298ebc630921ebda0a1001cb8a5 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 3 Mar 2023 18:45:12 +0200 Subject: [PATCH 075/117] refactor(esl-share): rewrite share data processing --- src/modules/esl-share/actions/copy-action.ts | 3 +- .../esl-share/actions/external-action.ts | 3 +- src/modules/esl-share/actions/media-action.ts | 3 +- .../esl-share/actions/native-action.ts | 3 +- src/modules/esl-share/actions/print-action.ts | 2 +- .../core/esl-share-action-registry.ts | 2 +- .../esl-share/core/esl-share-action.ts | 9 ++++- .../esl-share/core/esl-share-button.ts | 39 ++++++++----------- 8 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index 1248f060f..f38fe92f2 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -23,7 +23,8 @@ export class ESLShareCopyAction extends ESLShareBaseAction { }; } - public share(shareData: ShareData, $button: ESLShareButton): void { + public share($button: ESLShareButton): void { + const shareData = this.getShareData($button); const {url} = shareData; if (!this.isAvailable || !url) return; diff --git a/src/modules/esl-share/actions/external-action.ts b/src/modules/esl-share/actions/external-action.ts index b68f1d2bb..e6c385185 100644 --- a/src/modules/esl-share/actions/external-action.ts +++ b/src/modules/esl-share/actions/external-action.ts @@ -6,10 +6,11 @@ import type {ESLShareButton} from '../core/esl-share-button'; export class ESLShareExternalAction extends ESLShareUrlGenericAction { public static override readonly is: string = 'external'; - public share(shareData: ShareData, $button: ESLShareButton): void { + public share($button: ESLShareButton): void { const {link} = $button; if (!link) return; + const shareData = this.getShareData($button); const a = document.createElement('a'); a.href = this.buildURL(link, shareData); a.click(); diff --git a/src/modules/esl-share/actions/media-action.ts b/src/modules/esl-share/actions/media-action.ts index bd9404fd1..0612d41fa 100644 --- a/src/modules/esl-share/actions/media-action.ts +++ b/src/modules/esl-share/actions/media-action.ts @@ -23,10 +23,11 @@ export class ESLShareMediaAction extends ESLShareUrlGenericAction { return Object.entries(features).map(([key, value]) => `${key}=${value}`).join(','); } - public share(shareData: ShareData, $button: ESLShareButton): void { + public share($button: ESLShareButton): void { const {link} = $button; if (!link) return; + const shareData = this.getShareData($button); window.open(this.buildURL(link, shareData), '_blank', this.windowFeatures); } } diff --git a/src/modules/esl-share/actions/native-action.ts b/src/modules/esl-share/actions/native-action.ts index 271fb60ad..7539104da 100644 --- a/src/modules/esl-share/actions/native-action.ts +++ b/src/modules/esl-share/actions/native-action.ts @@ -10,9 +10,10 @@ export class ESLShareNativeAction extends ESLShareBaseAction { return navigator.share !== undefined; } - public share(shareData: ShareData, $button: ESLShareButton): void { + public share($button: ESLShareButton): void { if (!this.isAvailable) return; + const shareData = this.getShareData($button); navigator.share(shareData); } } diff --git a/src/modules/esl-share/actions/print-action.ts b/src/modules/esl-share/actions/print-action.ts index dfb934d10..26fd5a56d 100644 --- a/src/modules/esl-share/actions/print-action.ts +++ b/src/modules/esl-share/actions/print-action.ts @@ -6,7 +6,7 @@ import type {ESLShareButton} from '../core/esl-share-button'; export class ESLSharePrintAction extends ESLShareBaseAction { public static override readonly is: string = 'print'; - public share(shareData: ShareData, $button: ESLShareButton): void { + public share($button: ESLShareButton): void { window.print(); } } diff --git a/src/modules/esl-share/core/esl-share-action-registry.ts b/src/modules/esl-share/core/esl-share-action-registry.ts index 99d8acefa..0a4b2d03d 100644 --- a/src/modules/esl-share/core/esl-share-action-registry.ts +++ b/src/modules/esl-share/core/esl-share-action-registry.ts @@ -31,6 +31,6 @@ export class ESLShareActionRegistry { /** Do the share action at passed Share button */ public share(button: ESLShareButton): void { const action = this.get(button.action); - action && action.share(button.shareData, button); + action && action.share(button); } } diff --git a/src/modules/esl-share/core/esl-share-action.ts b/src/modules/esl-share/core/esl-share-action.ts index f2e896aca..2c690c01c 100644 --- a/src/modules/esl-share/core/esl-share-action.ts +++ b/src/modules/esl-share/core/esl-share-action.ts @@ -21,5 +21,12 @@ export abstract class ESLShareBaseAction { return true; } - public abstract share(shareData: ShareData, $button: ESLShareButton): void; + protected getShareData($button: ESLShareButton): ShareData { + return { + url: $button.urlToShare, + title: $button.titleToShare + }; + } + + public abstract share($button: ESLShareButton): void; } diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index dbe6de483..c4abcd38a 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -1,6 +1,7 @@ import {ESLBaseElement} from '../../esl-base-element/core'; import {attr, boolAttr, listen, prop} from '../../esl-utils/decorators'; import {ENTER, SPACE} from '../../esl-utils/dom/keys'; +import {toAbsoluteUrl} from '../../esl-utils/misc/url'; import {ESLShareActionRegistry} from './esl-share-action-registry'; import type {ESLShareList} from './esl-share-list'; @@ -20,6 +21,8 @@ export class ESLShareButton extends ESLBaseElement { @attr() public action: string; @attr() public link: string; @attr() public name: string; + @attr({dataAttr: true}) public shareUrl: string; + @attr({dataAttr: true}) public shareTitle: string; @boolAttr() public unavailable: boolean; @prop('transparent') public defaultBackground: string; @@ -27,13 +30,8 @@ export class ESLShareButton extends ESLBaseElement { const shareAction = ESLShareActionRegistry.instance.get(cfg.action); if (!shareAction) return null; - const {isAvailable} = shareAction; const $button = ESLShareButton.create(); - $button.$$attr('action', cfg.action); - $button.$$attr('link', cfg.link); - $button.$$attr('name', cfg.name); - $button.$$attr('title', cfg.title); - $button.$$attr('unavailable', !isAvailable); + Object.assign($button, cfg, {'unavailable': !shareAction.isAvailable}); const $icon = document.createElement('span'); $icon.title = cfg.title; $icon.classList.add('esl-share-icon'); @@ -43,21 +41,24 @@ export class ESLShareButton extends ESLBaseElement { return $button; } - protected static convertToAbsolutePath(path: string): string { - return new URL(path, document.baseURI).href; - } - public get host(): ESLShareList | null { return this.closest('esl-share-list'); } - public get shareData(): ShareData { - const {host} = this; + public get titleToShare(): string { + return this.shareTitle.length + ? this.shareTitle + : this.host?.shareTitle.length + ? this.host?.shareTitle + : document.title; + } - return { - url: (host && host.shareUrl) ? ESLShareButton.convertToAbsolutePath(host.shareUrl) : window.location.href, - title: (host && host.shareTitle) ? host.shareTitle : document.title - }; + public get urlToShare(): string { + return toAbsoluteUrl(this.shareUrl.length + ? this.shareUrl + : this.host?.shareUrl.length + ? this.host?.shareUrl + : window.location.href); } protected override connectedCallback(): void { @@ -72,16 +73,10 @@ export class ESLShareButton extends ESLBaseElement { } } - protected onBeforeShare(): void {} - public share(): void { - this.onBeforeShare(); ESLShareActionRegistry.instance.share(this); - this.onAfterShare(); } - protected onAfterShare(): void {} - @listen('click') protected _onClick(e: MouseEvent): void { this.share(); From 40b085bd698f2ada81ebce0cfe3ba4b45e9f4404 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 3 Mar 2023 18:53:09 +0200 Subject: [PATCH 076/117] refactor(esl-share): move build method from button to list --- .../esl-share/core/esl-share-button.ts | 24 --------------- src/modules/esl-share/core/esl-share-list.ts | 29 +++++++++++++++++-- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index c4abcd38a..fc12f7ef8 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -6,15 +6,6 @@ import {ESLShareActionRegistry} from './esl-share-action-registry'; import type {ESLShareList} from './esl-share-list'; -export interface ShareButtonConfig { - 'action': string; - 'icon': string; - 'iconBackground': string; - 'link': string; - 'name': string; - 'title': string; -} - export class ESLShareButton extends ESLBaseElement { public static override is = 'esl-share-button'; @@ -26,21 +17,6 @@ export class ESLShareButton extends ESLBaseElement { @boolAttr() public unavailable: boolean; @prop('transparent') public defaultBackground: string; - public static build(cfg: ShareButtonConfig): ESLShareButton | null { - const shareAction = ESLShareActionRegistry.instance.get(cfg.action); - if (!shareAction) return null; - - const $button = ESLShareButton.create(); - Object.assign($button, cfg, {'unavailable': !shareAction.isAvailable}); - const $icon = document.createElement('span'); - $icon.title = cfg.title; - $icon.classList.add('esl-share-icon'); - $icon.innerHTML = cfg.icon; - $icon.setAttribute('style', `background-color:${cfg.iconBackground || $button.defaultBackground};`); - $button.appendChild($icon); - return $button; - } - public get host(): ESLShareList | null { return this.closest('esl-share-list'); } diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index f332e76f5..ad41c77b7 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -3,10 +3,20 @@ import {attr, bind, boolAttr, memoize, prop} from '../../esl-utils/decorators'; import {ESLShareConfig} from './esl-share-config'; import {ESLShareButton} from './esl-share-button'; +import {ESLShareActionRegistry} from './esl-share-action-registry'; -import type {ShareButtonConfig} from './esl-share-button'; import type {ShareConfig} from './esl-share-config'; + +export interface ShareButtonConfig { + 'action': string; + 'icon': string; + 'iconBackground': string; + 'link': string; + 'name': string; + 'title': string; +} + export class ESLShareList extends ESLBaseElement { public static override is = 'esl-share-list'; @@ -87,10 +97,25 @@ export class ESLShareList extends ESLBaseElement { protected buildContent(config: ShareButtonConfig[]): void { this.innerHTML = ''; config.forEach((btnCfg) => { - const btn = ESLShareButton.build(btnCfg); + const btn = this.buildButton(btnCfg); btn && this.appendChild(btn); }); this.toggleAttribute('ready', true); } + + protected buildButton(cfg: ShareButtonConfig): ESLShareButton | null { + const shareAction = ESLShareActionRegistry.instance.get(cfg.action); + if (!shareAction) return null; + + const $button = ESLShareButton.create(); + Object.assign($button, cfg, {'unavailable': !shareAction.isAvailable}); + const $icon = document.createElement('span'); + $icon.title = cfg.title; + $icon.classList.add('esl-share-icon'); + $icon.innerHTML = cfg.icon; + $icon.setAttribute('style', `background-color:${cfg.iconBackground || $button.defaultBackground};`); + $button.appendChild($icon); + return $button; + } } From c86c426b44819049d654220d25783748a07744fc Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 3 Mar 2023 20:29:31 +0200 Subject: [PATCH 077/117] refactor(esl-share): remove share config class --- pages/src/localdev.ts | 3 +- src/modules/esl-share/core.ts | 1 - .../esl-share/core/esl-share-config.ts | 24 ---------- src/modules/esl-share/core/esl-share-list.ts | 44 ++++++++++--------- 4 files changed, 25 insertions(+), 47 deletions(-) delete mode 100644 src/modules/esl-share/core/esl-share-config.ts diff --git a/pages/src/localdev.ts b/pages/src/localdev.ts index ece07695a..207aa69e4 100644 --- a/pages/src/localdev.ts +++ b/pages/src/localdev.ts @@ -33,7 +33,6 @@ import { ESLTooltip, ESLAnimate, ESLShareList, - ESLShareConfig, ESLRelatedTarget } from '../../src/modules/all'; @@ -114,7 +113,7 @@ ESLCarouselPlugins.Link.register(); ESLCarouselPlugins.Touch.register(); ESLCarouselPlugins.Autoplay.register(); -ESLShareConfig.use(() => fetch('/assets/share/config.json').then((response) => response.json())); +ESLShareList.config(() => fetch('/assets/share/config.json').then((response) => response.json())); ESLShareList.register(); // Register ESL Mixins diff --git a/src/modules/esl-share/core.ts b/src/modules/esl-share/core.ts index 382c810b7..599dee6b3 100644 --- a/src/modules/esl-share/core.ts +++ b/src/modules/esl-share/core.ts @@ -2,4 +2,3 @@ export * from './core/esl-share-list'; export * from './core/esl-share-action'; export * from './core/esl-share-action-registry'; export * from './core/esl-share-button'; -export * from './core/esl-share-config'; diff --git a/src/modules/esl-share/core/esl-share-config.ts b/src/modules/esl-share/core/esl-share-config.ts deleted file mode 100644 index f4e0ca053..000000000 --- a/src/modules/esl-share/core/esl-share-config.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type {ShareButtonConfig} from './esl-share-button'; - -export type ESLShareConfigProviderType = () => Promise; -export interface ShareGroupConfig { - id: string; - list: string; -} - -export interface ShareConfig { - buttons: ShareButtonConfig[]; - groups: ShareGroupConfig[]; -} - -export class ESLShareConfig { - protected static provider: ESLShareConfigProviderType; - - public static use(provider: ESLShareConfigProviderType): ESLShareConfig { - return ESLShareConfig.provider = provider; - } - - public static get(): Promise { - return ESLShareConfig.provider(); - } -} diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index ad41c77b7..0b9a59f90 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -1,12 +1,10 @@ import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr, bind, boolAttr, memoize, prop} from '../../esl-utils/decorators'; +import {attr, bind, boolAttr, prop} from '../../esl-utils/decorators'; -import {ESLShareConfig} from './esl-share-config'; import {ESLShareButton} from './esl-share-button'; import {ESLShareActionRegistry} from './esl-share-action-registry'; -import type {ShareConfig} from './esl-share-config'; - +export type ESLShareConfigProviderType = () => Promise; export interface ShareButtonConfig { 'action': string; @@ -17,8 +15,19 @@ export interface ShareButtonConfig { 'title': string; } +export interface ShareGroupConfig { + id: string; + list: string; +} + +export interface ShareConfig { + buttons: ShareButtonConfig[]; + groups: ShareGroupConfig[]; +} + export class ESLShareList extends ESLBaseElement { public static override is = 'esl-share-list'; + protected static _config: Promise = Promise.reject('Configuration is not set'); public static override register(): void { ESLShareButton.register(); @@ -35,24 +44,19 @@ export class ESLShareList extends ESLBaseElement { @boolAttr({readonly: true}) public ready: boolean; - protected _ready: Promise; - public get alias(): string { return (this.constructor as typeof ESLBaseElement).is; } - public get ready$(): Promise { - return this._ready ?? Promise.reject(`[${this.alias}]: is not ready`); - } - - @memoize() - public get config(): Promise { - return ESLShareConfig.get(); + public static config(provider?: ESLShareConfigProviderType): Promise { + if (provider) { + ESLShareList._config = provider(); + } + return ESLShareList._config; } - @memoize() public get buttonsConfig(): Promise { - return this.config.then((config) => { + return (this.constructor as typeof ESLShareList).config().then((config) => { const list = this.getList(config); return list.length ? this.getButtons(config, list) : config.buttons; }); @@ -82,19 +86,19 @@ export class ESLShareList extends ESLBaseElement { public override connectedCallback(): void { super.connectedCallback(); - if (!this._ready) { + if (!this.ready) { this.init(); } } protected init(): void { - this._ready = this.buttonsConfig.then(this.buildContent); - this._ready.then(() => this.$$fire(this.SHARE_READY_EVENT, {bubbles: false})); - this._ready.catch((e) => console.error(`[${this.alias}]: ${e}`)); + this.buttonsConfig.then(this.build) + .then(() => this.$$fire(this.SHARE_READY_EVENT, {bubbles: false})) + .catch((e) => console.error(`[${this.alias}]: ${e}`)); } @bind - protected buildContent(config: ShareButtonConfig[]): void { + public build(config: ShareButtonConfig[]): void { this.innerHTML = ''; config.forEach((btnCfg) => { const btn = this.buildButton(btnCfg); From 9c8f763d41c18521da39cb26cb7a8e933f1a0967 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 3 Mar 2023 20:59:01 +0200 Subject: [PATCH 078/117] feat(easl-share): added additional param into config to pass extra data into actions --- pages/static/assets/share/config.json | 5 ++++- src/modules/esl-share/actions/copy-action.ts | 22 ++++++------------- .../esl-share/core/esl-share-button.ts | 3 ++- src/modules/esl-share/core/esl-share-list.ts | 1 + 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/pages/static/assets/share/config.json b/pages/static/assets/share/config.json index e47d16fde..0ba0dce84 100644 --- a/pages/static/assets/share/config.json +++ b/pages/static/assets/share/config.json @@ -142,7 +142,10 @@ "iconBackground": "#a0522d", "link": "", "name": "copy", - "title": "Copy" + "title": "Copy", + "additional": { + "alertText": "Copied to clipboard" + } }, { "action": "native", diff --git a/src/modules/esl-share/actions/copy-action.ts b/src/modules/esl-share/actions/copy-action.ts index f38fe92f2..f8b8cf60d 100644 --- a/src/modules/esl-share/actions/copy-action.ts +++ b/src/modules/esl-share/actions/copy-action.ts @@ -2,7 +2,6 @@ import {ESLShareBaseAction} from '../core/esl-share-action'; import {ESLEventUtils} from '../../esl-utils/dom/events'; import type {ESLShareButton} from '../core/esl-share-button'; -import type {AlertActionParams} from '../../esl-alert/core'; @ESLShareBaseAction.register export class ESLShareCopyAction extends ESLShareBaseAction { @@ -12,28 +11,21 @@ export class ESLShareCopyAction extends ESLShareBaseAction { return navigator.clipboard !== undefined; } - protected get alertText(): string { - return 'Copied to clipboard'; - } - - protected get alertParams(): AlertActionParams { - return { - cls: 'esl-share-alert', - html: `${this.alertText}` - }; - } - public share($button: ESLShareButton): void { const shareData = this.getShareData($button); const {url} = shareData; if (!this.isAvailable || !url) return; navigator.clipboard.writeText(url); - this.showCopyAlert(); + this.showCopyAlert($button.additional?.alertText); } - protected showCopyAlert(): void { - const detail = this.alertParams; + protected showCopyAlert(alertText: string): void { + if (!alertText) return; + const detail = { + cls: 'esl-share-alert', + html: `${alertText}` + }; ESLEventUtils.dispatch(document.body, 'esl:alert:show', {detail}); } } diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index fc12f7ef8..8e8c469ed 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -1,5 +1,5 @@ import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr, boolAttr, listen, prop} from '../../esl-utils/decorators'; +import {attr, boolAttr, jsonAttr, listen, prop} from '../../esl-utils/decorators'; import {ENTER, SPACE} from '../../esl-utils/dom/keys'; import {toAbsoluteUrl} from '../../esl-utils/misc/url'; import {ESLShareActionRegistry} from './esl-share-action-registry'; @@ -12,6 +12,7 @@ export class ESLShareButton extends ESLBaseElement { @attr() public action: string; @attr() public link: string; @attr() public name: string; + @jsonAttr({dataAttr: true}) public additional: Record; @attr({dataAttr: true}) public shareUrl: string; @attr({dataAttr: true}) public shareTitle: string; @boolAttr() public unavailable: boolean; diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 0b9a59f90..5c6d89592 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -13,6 +13,7 @@ export interface ShareButtonConfig { 'link': string; 'name': string; 'title': string; + 'additional'?: Record; } export interface ShareGroupConfig { From ee0e8c5c347d240a1185c9983cad55e7f48dec3d Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 3 Mar 2023 20:59:33 +0200 Subject: [PATCH 079/117] docs(esl-share): update local-dev page --- pages/views/examples/share.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index 0c7a6b83c..147d30492 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -14,7 +14,7 @@ aside:

Share example

Just a standalone share button

- + From edb43e3836ea1bcb54ef259a08913547857f321a Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Sun, 5 Mar 2023 13:03:26 +0200 Subject: [PATCH 080/117] refactor(esl-share): simplification of titleToShare and urlToShare getters --- .../esl-share/core/esl-share-button.ts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 8e8c469ed..a2023ff27 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -6,6 +6,11 @@ import {ESLShareActionRegistry} from './esl-share-action-registry'; import type {ESLShareList} from './esl-share-list'; +function getProp(name: string, targets: Record[], fallback: T, predicate: (val: T) => boolean): T { + const find = targets.find((target) => predicate(target[name])); + return find ? find[name] : fallback; +} + export class ESLShareButton extends ESLBaseElement { public static override is = 'esl-share-button'; @@ -23,19 +28,11 @@ export class ESLShareButton extends ESLBaseElement { } public get titleToShare(): string { - return this.shareTitle.length - ? this.shareTitle - : this.host?.shareTitle.length - ? this.host?.shareTitle - : document.title; + return this._getPropFromRelatedEls('shareTitle', document.title); } public get urlToShare(): string { - return toAbsoluteUrl(this.shareUrl.length - ? this.shareUrl - : this.host?.shareUrl.length - ? this.host?.shareUrl - : window.location.href); + return toAbsoluteUrl(this._getPropFromRelatedEls('shareUrl', window.location.href)); } protected override connectedCallback(): void { @@ -54,6 +51,10 @@ export class ESLShareButton extends ESLBaseElement { ESLShareActionRegistry.instance.share(this); } + protected _getPropFromRelatedEls(name: string, fallback: string): string { + return getProp(name, [this, this.host ?? {}], fallback, (val: string) => !!val.length); + } + @listen('click') protected _onClick(e: MouseEvent): void { this.share(); From e07d5437266f8fb7b973f16959f04c4b8c1b481a Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Mon, 6 Mar 2023 13:43:18 +0200 Subject: [PATCH 081/117] style(esl-share): apply suggestions from review --- src/modules/esl-share/core/esl-share-list.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 5c6d89592..af3ed7a63 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -7,13 +7,13 @@ import {ESLShareActionRegistry} from './esl-share-action-registry'; export type ESLShareConfigProviderType = () => Promise; export interface ShareButtonConfig { - 'action': string; - 'icon': string; - 'iconBackground': string; - 'link': string; - 'name': string; - 'title': string; - 'additional'?: Record; + action: string; + icon: string; + iconBackground: string; + link: string; + name: string; + title: string; + additional?: Record; } export interface ShareGroupConfig { @@ -65,12 +65,12 @@ export class ESLShareList extends ESLBaseElement { protected getButtons(config: ShareConfig, idList: string[]): ShareButtonConfig[] { const {buttons} = config; - const ret: ShareButtonConfig[] = []; + const res: ShareButtonConfig[] = []; idList.forEach((name) => { const btnConfig = buttons.find((btn) => btn.name === name); - btnConfig && ret.push(btnConfig); + btnConfig && res.push(btnConfig); }); - return ret; + return res; } protected getList(config: ShareConfig): string[] { From a522ba714d32ec93cc51e6d3e756ed1ad0630fac Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Mon, 6 Mar 2023 14:35:32 +0200 Subject: [PATCH 082/117] docs(esl-share): update esl-share demo page --- pages/views/examples/share.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index 147d30492..28f34330a 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -43,7 +43,7 @@ aside:

List of share buttons which presents buttons with all action types

This example shows a button with the native share mechanism on the device which will be inactive on the desktop browser.

- +

Display list of share buttons via incorrect list

From de671dd3ee8c3db93a0d58c2c617d4717ac6ed43 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Tue, 7 Mar 2023 20:05:58 +0200 Subject: [PATCH 083/117] refactor(esl-share): create actionInstance getter --- src/modules/esl-share/core/esl-share-button.ts | 18 +++++++++++++++++- src/modules/esl-share/core/esl-share-list.ts | 6 +++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index a2023ff27..9039a9f13 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -4,6 +4,7 @@ import {ENTER, SPACE} from '../../esl-utils/dom/keys'; import {toAbsoluteUrl} from '../../esl-utils/misc/url'; import {ESLShareActionRegistry} from './esl-share-action-registry'; +import type {ESLShareBaseAction} from './esl-share-action'; import type {ESLShareList} from './esl-share-list'; function getProp(name: string, targets: Record[], fallback: T, predicate: (val: T) => boolean): T { @@ -13,6 +14,7 @@ function getProp(name: string, targets: Record[], fallback: T, p export class ESLShareButton extends ESLBaseElement { public static override is = 'esl-share-button'; + public static observedAttributes = ['action']; @attr() public action: string; @attr() public link: string; @@ -23,6 +25,10 @@ export class ESLShareButton extends ESLBaseElement { @boolAttr() public unavailable: boolean; @prop('transparent') public defaultBackground: string; + protected get actionInstance(): ESLShareBaseAction | null { + return ESLShareActionRegistry.instance.get(this.action); + } + public get host(): ESLShareList | null { return this.closest('esl-share-list'); } @@ -35,9 +41,15 @@ export class ESLShareButton extends ESLBaseElement { return toAbsoluteUrl(this._getPropFromRelatedEls('shareUrl', window.location.href)); } + protected attributeChangedCallback(attrName: string, oldVal: string, newVal: string): void { + if (!this.connected || oldVal === newVal) return; + if (attrName === 'action') this.updateAction(); + } + protected override connectedCallback(): void { super.connectedCallback(); this.initA11y(); + this.updateAction(); } public initA11y(): void { @@ -48,7 +60,11 @@ export class ESLShareButton extends ESLBaseElement { } public share(): void { - ESLShareActionRegistry.instance.share(this); + this.actionInstance?.share(this); + } + + protected updateAction(): void { + this.$$attr('unavailable', !this.actionInstance?.isAvailable); } protected _getPropFromRelatedEls(name: string, fallback: string): string { diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index af3ed7a63..a274f751a 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -110,11 +110,11 @@ export class ESLShareList extends ESLBaseElement { } protected buildButton(cfg: ShareButtonConfig): ESLShareButton | null { - const shareAction = ESLShareActionRegistry.instance.get(cfg.action); - if (!shareAction) return null; + // const shareAction = ESLShareActionRegistry.instance.get(cfg.action); + // if (!shareAction) return null; const $button = ESLShareButton.create(); - Object.assign($button, cfg, {'unavailable': !shareAction.isAvailable}); + Object.assign($button, cfg); const $icon = document.createElement('span'); $icon.title = cfg.title; $icon.classList.add('esl-share-icon'); From e9a833dd0b796e19a72797c645823270388ea96d Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Tue, 7 Mar 2023 20:10:03 +0200 Subject: [PATCH 084/117] refactor(esl-share): removed befaultBackround from button icon --- src/modules/esl-share/core/esl-share-button.ts | 3 +-- src/modules/esl-share/core/esl-share-list.ts | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 9039a9f13..0b2618eae 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -1,5 +1,5 @@ import {ESLBaseElement} from '../../esl-base-element/core'; -import {attr, boolAttr, jsonAttr, listen, prop} from '../../esl-utils/decorators'; +import {attr, boolAttr, jsonAttr, listen} from '../../esl-utils/decorators'; import {ENTER, SPACE} from '../../esl-utils/dom/keys'; import {toAbsoluteUrl} from '../../esl-utils/misc/url'; import {ESLShareActionRegistry} from './esl-share-action-registry'; @@ -23,7 +23,6 @@ export class ESLShareButton extends ESLBaseElement { @attr({dataAttr: true}) public shareUrl: string; @attr({dataAttr: true}) public shareTitle: string; @boolAttr() public unavailable: boolean; - @prop('transparent') public defaultBackground: string; protected get actionInstance(): ESLShareBaseAction | null { return ESLShareActionRegistry.instance.get(this.action); diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index a274f751a..7aa80c850 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -2,7 +2,6 @@ import {ESLBaseElement} from '../../esl-base-element/core'; import {attr, bind, boolAttr, prop} from '../../esl-utils/decorators'; import {ESLShareButton} from './esl-share-button'; -import {ESLShareActionRegistry} from './esl-share-action-registry'; export type ESLShareConfigProviderType = () => Promise; @@ -110,16 +109,13 @@ export class ESLShareList extends ESLBaseElement { } protected buildButton(cfg: ShareButtonConfig): ESLShareButton | null { - // const shareAction = ESLShareActionRegistry.instance.get(cfg.action); - // if (!shareAction) return null; - const $button = ESLShareButton.create(); Object.assign($button, cfg); const $icon = document.createElement('span'); $icon.title = cfg.title; $icon.classList.add('esl-share-icon'); $icon.innerHTML = cfg.icon; - $icon.setAttribute('style', `background-color:${cfg.iconBackground || $button.defaultBackground};`); + $icon.setAttribute('style', `background-color:${cfg.iconBackground};`); $button.appendChild($icon); return $button; } From 63e1da4c4e74c664639c056adece0a302c236d80 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Tue, 7 Mar 2023 20:16:01 +0200 Subject: [PATCH 085/117] refactor(esl-share): update share config providers --- src/modules/esl-share/core/esl-share-list.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 7aa80c850..66ea329ed 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -48,10 +48,9 @@ export class ESLShareList extends ESLBaseElement { return (this.constructor as typeof ESLBaseElement).is; } - public static config(provider?: ESLShareConfigProviderType): Promise { - if (provider) { - ESLShareList._config = provider(); - } + public static config(provider?: ESLShareConfigProviderType | ShareConfig): Promise { + if (typeof provider === 'function') ESLShareList._config = provider(); + if (typeof provider === 'object') ESLShareList._config = Promise.resolve(provider); return ESLShareList._config; } From f9011a66d89cc953328c267938c1bdbe47cbd0d4 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Tue, 7 Mar 2023 20:19:42 +0200 Subject: [PATCH 086/117] style(esl-share): change order share button attributes --- src/modules/esl-share/core/esl-share-button.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/esl-share/core/esl-share-button.ts b/src/modules/esl-share/core/esl-share-button.ts index 0b2618eae..018038540 100644 --- a/src/modules/esl-share/core/esl-share-button.ts +++ b/src/modules/esl-share/core/esl-share-button.ts @@ -19,9 +19,12 @@ export class ESLShareButton extends ESLBaseElement { @attr() public action: string; @attr() public link: string; @attr() public name: string; - @jsonAttr({dataAttr: true}) public additional: Record; + @attr({dataAttr: true}) public shareUrl: string; @attr({dataAttr: true}) public shareTitle: string; + + @jsonAttr({dataAttr: true}) public additional: Record; + @boolAttr() public unavailable: boolean; protected get actionInstance(): ESLShareBaseAction | null { From b4e5900fab39f05b2822c3135ea630b181faaaef Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 10 Mar 2023 12:34:58 +0200 Subject: [PATCH 087/117] refactor(esl-share): merge list and group attributes --- pages/static/assets/share/config.json | 8 ++-- pages/views/examples/share.njk | 27 ++++++----- src/modules/esl-share/core/esl-share-list.ts | 48 +++++++++----------- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/pages/static/assets/share/config.json b/pages/static/assets/share/config.json index 0ba0dce84..66296a6a1 100644 --- a/pages/static/assets/share/config.json +++ b/pages/static/assets/share/config.json @@ -166,12 +166,12 @@ ], "groups": [ { - "id": "demo", - "list": "facebook,twitter,linkedin,wykop,copy" + "name": "demo", + "list": "facebook twitter linkedin wykop copy" }, { - "id": "alternative", - "list": "kakao,hatena,mixi,line,mail" + "name": "alternative", + "list": "kakao hatena mixi line mail" } ] } diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index 28f34330a..a8c587842 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -21,34 +21,39 @@ aside:

-

Display list of share buttons of group 'demo'

+

Displays list of share buttons of group 'demo'

Shows buttons from a specified group.

- +
-

Display list of share buttons of group 'alternative'

+

Displays list of share buttons of group 'alternative'

Shows buttons from a specified group.

- +
-

Display list of share buttons on nonexistent group

+

Displays list of share buttons of the mix of Facebook, the group 'alternative', and Twitter button

+

Shows buttons from a specified group.

+ +
+ +

Displays list of share buttons on nonexistent group

Shows buttons from a specified group. Displays all buttons from config when a nonexistent group is specified.

- +
-

Display list of share buttons via list of buttons id

+

Displays list of share buttons via list of buttons id

Shows specified buttons. Displays nothing in the case when specified wrong button id.

- +

List of share buttons which presents buttons with all action types

This example shows a button with the native share mechanism on the device which will be inactive on the desktop browser.

- +

Display list of share buttons via incorrect list

Shows buttons only with the correct id.

- +

Display list of share buttons (without group or list)

@@ -66,6 +71,6 @@ aside: - + diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 66ea329ed..d0993e2d9 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -16,7 +16,7 @@ export interface ShareButtonConfig { } export interface ShareGroupConfig { - id: string; + name: string; list: string; } @@ -25,6 +25,25 @@ export interface ShareConfig { groups: ShareGroupConfig[]; } +function getConfigSectionItem(section: T[], name: string): T | undefined { + return section.find((item) => item.name === name); +} + +function getButtonsList(config: ShareConfig, list: string): ShareButtonConfig[] { + let res: ShareButtonConfig[] = []; + list.split(' ').forEach((item) => { + const [btnName, groupName] = item.split('group:'); + if (groupName) { + const groupConfig = getConfigSectionItem(config.groups, groupName); + groupConfig && (res = res.concat(getButtonsList(config, groupConfig.list))); + } else { + const btnConfig = getConfigSectionItem(config.buttons, btnName); + btnConfig && res.push(btnConfig); + } + }); + return res; +} + export class ESLShareList extends ESLBaseElement { public static override is = 'esl-share-list'; protected static _config: Promise = Promise.reject('Configuration is not set'); @@ -38,7 +57,6 @@ export class ESLShareList extends ESLBaseElement { @prop('esl:share:ready') public SHARE_READY_EVENT: string; @attr({readonly: true}) public list: string; - @attr({readonly: true}) public group: string; @attr({dataAttr: true}) public shareUrl: string; @attr({dataAttr: true}) public shareTitle: string; @@ -56,33 +74,11 @@ export class ESLShareList extends ESLBaseElement { public get buttonsConfig(): Promise { return (this.constructor as typeof ESLShareList).config().then((config) => { - const list = this.getList(config); - return list.length ? this.getButtons(config, list) : config.buttons; + const buttonsList = getButtonsList(config, this.list); + return buttonsList.length ? buttonsList : config.buttons; }); } - protected getButtons(config: ShareConfig, idList: string[]): ShareButtonConfig[] { - const {buttons} = config; - const res: ShareButtonConfig[] = []; - idList.forEach((name) => { - const btnConfig = buttons.find((btn) => btn.name === name); - btnConfig && res.push(btnConfig); - }); - return res; - } - - protected getList(config: ShareConfig): string[] { - const {group} = this; - let {list} = this; - if (group) { - const groupCfg = config.groups.find((e) => e.id === group); - if (groupCfg) { - list = groupCfg.list; - } - } - return list ? list.split(',').map((id) => id.trim()) : []; - } - public override connectedCallback(): void { super.connectedCallback(); if (!this.ready) { From 001c14feba3a360349ca8839bc66d8c5b0099379 Mon Sep 17 00:00:00 2001 From: Dmytro Shovchko Date: Fri, 10 Mar 2023 17:57:18 +0200 Subject: [PATCH 088/117] style(esl-share): apply suggestion from code review Co-authored-by: ala'n (Alexey Stsefanovich) --- src/modules/esl-share/core/esl-share-list.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index d0993e2d9..8a87998da 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -30,18 +30,17 @@ function getConfigSectionItem(se } function getButtonsList(config: ShareConfig, list: string): ShareButtonConfig[] { - let res: ShareButtonConfig[] = []; - list.split(' ').forEach((item) => { + return list.split(' ').reduce((res, item) => { const [btnName, groupName] = item.split('group:'); if (groupName) { const groupConfig = getConfigSectionItem(config.groups, groupName); - groupConfig && (res = res.concat(getButtonsList(config, groupConfig.list))); + if (groupConfig) return res.concat(getButtonsList(config, groupConfig.list)); } else { const btnConfig = getConfigSectionItem(config.buttons, btnName); - btnConfig && res.push(btnConfig); + if (btnConfig) res.push(btnConfig); } - }); - return res; + return res; + }, []); } export class ESLShareList extends ESLBaseElement { From 1a9000c2b3e5bb8d4a19f8845897d1fdd2ee161e Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 10 Mar 2023 18:02:03 +0200 Subject: [PATCH 089/117] style(esl-share): add type assertion --- src/modules/esl-share/core/esl-share-list.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 8a87998da..861bf4cbc 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -40,7 +40,7 @@ function getButtonsList(config: ShareConfig, list: string): ShareButtonConfig[] if (btnConfig) res.push(btnConfig); } return res; - }, []); + }, [] as ShareButtonConfig[]); } export class ESLShareList extends ESLBaseElement { From ca1d5db4b76624b17b866a9418029db4e3393063 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 10 Mar 2023 18:37:41 +0200 Subject: [PATCH 090/117] refactor(esl-share): updated displaying logic of buttons list with empty list --- src/modules/esl-share/core/esl-share-list.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/esl-share/core/esl-share-list.ts b/src/modules/esl-share/core/esl-share-list.ts index 861bf4cbc..8f03886e2 100644 --- a/src/modules/esl-share/core/esl-share-list.ts +++ b/src/modules/esl-share/core/esl-share-list.ts @@ -55,7 +55,7 @@ export class ESLShareList extends ESLBaseElement { /** Event to dispatch on ready state of {@link ESLShareList} */ @prop('esl:share:ready') public SHARE_READY_EVENT: string; - @attr({readonly: true}) public list: string; + @attr({readonly: true, defaultValue: 'all'}) public list: string; @attr({dataAttr: true}) public shareUrl: string; @attr({dataAttr: true}) public shareTitle: string; @@ -73,8 +73,7 @@ export class ESLShareList extends ESLBaseElement { public get buttonsConfig(): Promise { return (this.constructor as typeof ESLShareList).config().then((config) => { - const buttonsList = getButtonsList(config, this.list); - return buttonsList.length ? buttonsList : config.buttons; + return (this.list !== 'all') ? getButtonsList(config, this.list) : config.buttons; }); } From 996c876eeffa1abe028d8d7e55f161d64690f614 Mon Sep 17 00:00:00 2001 From: Dmitry Shovchko Date: Fri, 10 Mar 2023 18:38:35 +0200 Subject: [PATCH 091/117] docs(esl-share): updated demo page --- pages/views/examples/share.njk | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index a8c587842..56adb0502 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -32,17 +32,17 @@ aside:

Displays list of share buttons of the mix of Facebook, the group 'alternative', and Twitter button

-

Shows buttons from a specified group.

+

Shows a Facebook button, buttons from a specified group, and a Twitter button.


Displays list of share buttons on nonexistent group

-

Shows buttons from a specified group. Displays all buttons from config when a nonexistent group is specified.

+

Shows empty list when a nonexistent group is specified.


Displays list of share buttons via list of buttons id

-

Shows specified buttons. Displays nothing in the case when specified wrong button id.

+

Shows specified buttons. Displays nothing in the case when specified wrong button name.


@@ -51,13 +51,18 @@ aside:
+

Display list of share buttons with empty list

+

Shows empty component without buttons.

+ +
+

Display list of share buttons via incorrect list

-

Shows buttons only with the correct id.

+

Shows buttons only with the correct names.


Display list of share buttons (without group or list)

-

Shows all buttons from config.

+

Shows all available buttons from config.


From 59c35d3c93577f78a02d54577bf960c3119a3b01 Mon Sep 17 00:00:00 2001 From: Dmytro Shovchko Date: Tue, 14 Mar 2023 20:32:40 +0200 Subject: [PATCH 092/117] style(esl-share): apply suggestions from code review Co-authored-by: julia-murashko --- pages/views/examples/share.njk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/views/examples/share.njk b/pages/views/examples/share.njk index 56adb0502..08297f5ab 100644 --- a/pages/views/examples/share.njk +++ b/pages/views/examples/share.njk @@ -51,17 +51,17 @@ aside:
-

Display list of share buttons with empty list

+

Displays list of share buttons with empty list

Shows empty component without buttons.


-

Display list of share buttons via incorrect list

+

Displays list of share buttons via incorrect list

Shows buttons only with the correct names.


-

Display list of share buttons (without group or list)

+

Displays list of share buttons (without group or list)

Shows all available buttons from config.


From 93ff1e1028c2ee85552e3cd554b77f7117a2bc3a Mon Sep 17 00:00:00 2001 From: nsmirnova Date: Wed, 15 Mar 2023 14:25:58 +0100 Subject: [PATCH 093/117] refactor(gh-pages): rename css classes --- pages/src/banner/banner.less | 2 +- pages/src/banner/redesign.ts | 4 ++-- pages/src/esl-media-demo/test-media.less | 28 ------------------------ 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/pages/src/banner/banner.less b/pages/src/banner/banner.less index 2dbf08b30..d947b397c 100644 --- a/pages/src/banner/banner.less +++ b/pages/src/banner/banner.less @@ -1,6 +1,6 @@ @import (reference) "../common/variables.less"; -.banner { +.banner-popup { &-alert { width: 80%; right: 10%; diff --git a/pages/src/banner/redesign.ts b/pages/src/banner/redesign.ts index cbf812097..7f1347af0 100644 --- a/pages/src/banner/redesign.ts +++ b/pages/src/banner/redesign.ts @@ -9,9 +9,9 @@ onDocumentReady(() => { sessionStorage.setItem(KEY, '1'); const detail: AlertActionParams = { - cls: 'alert alert-info banner-alert', + cls: 'alert alert-info banner-popup-alert', html: ` -