From 80200a5f9e5a34ee6aecd2ab218e8285b5ce1b4c Mon Sep 17 00:00:00 2001 From: "ala'n (Alexey Stsefanovich)" Date: Wed, 18 Oct 2023 01:45:37 +0200 Subject: [PATCH] refactor: small cleanup for exising options management --- pages/views/examples/example/form.njk | 9 ++++--- pages/views/index.njk | 3 ++- src/plugins/header/header.ts | 8 ------- src/plugins/header/options/option-icons.tsx | 24 ------------------- src/plugins/header/options/option/option.less | 15 ------------ 5 files changed, 8 insertions(+), 51 deletions(-) diff --git a/pages/views/examples/example/form.njk b/pages/views/examples/example/form.njk index feca554c..b4dea454 100644 --- a/pages/views/examples/example/form.njk +++ b/pages/views/examples/example/form.njk @@ -4,6 +4,7 @@ title: Example with form + + + - + - + + diff --git a/pages/views/index.njk b/pages/views/index.njk index 4c79ad28..fcb3bcca 100644 --- a/pages/views/index.njk +++ b/pages/views/index.njk @@ -25,7 +25,7 @@ isLandingPage: true - + @@ -34,6 +34,7 @@ isLandingPage: true + diff --git a/src/plugins/header/header.ts b/src/plugins/header/header.ts index 71102fcb..c6252ced 100644 --- a/src/plugins/header/header.ts +++ b/src/plugins/header/header.ts @@ -1,7 +1,5 @@ import {UIPPlugin} from '../../core/base/plugin'; -import {UIPCopy} from '../copy/uip-copy'; import {UIPOptions} from './options/options'; -import {UIPOptionIcons} from './options/option-icons'; import {UIPSnippets} from './snippets/snippets'; /** @@ -20,7 +18,6 @@ export class UIPHeader extends UIPPlugin { protected autofill(): void { this.renderSnippets(); this.renderOptions(); - this.renderCopy(); } /** Renders {@link UIPSnippets} element */ @@ -36,9 +33,4 @@ export class UIPHeader extends UIPPlugin { const optionsEl = document.createElement(UIPOptions.is); this.append(optionsEl); } - - /** Renders copy icon */ - protected renderCopy(): void { - this.append(UIPCopy.create(UIPOptionIcons.copySVG, 'copy-icon')); - } } diff --git a/src/plugins/header/options/option-icons.tsx b/src/plugins/header/options/option-icons.tsx index fc1b34ff..ccad40ba 100644 --- a/src/plugins/header/options/option-icons.tsx +++ b/src/plugins/header/options/option-icons.tsx @@ -30,30 +30,6 @@ export class UIPOptionIcons { ) as HTMLElement; - /** Default svg for collapsed settings icon */ - public static settingsCollapsedSVG: HTMLElement = ( - - {/* eslint-disable-next-line max-len */} - - - ) as HTMLElement; - - /** Default svg for collapsed editor icon */ - public static editorCollapsedSVG: HTMLElement = ( - - {/* eslint-disable-next-line max-len */} - - - ) as HTMLElement; - - /** Default svg for copy icon */ - public static get copySVG(): HTMLElement { - return - - - as HTMLElement; - } - public static get snippetSVG(): HTMLElement { return <> diff --git a/src/plugins/header/options/option/option.less b/src/plugins/header/options/option/option.less index c5275ad9..52465237 100644 --- a/src/plugins/header/options/option/option.less +++ b/src/plugins/header/options/option/option.less @@ -28,21 +28,6 @@ uip-option { width: 2.5rem; } - &.settings-collapsed-option { - &.active svg { - fill: #5f5f5f; - stroke: #5f5f5f; - } - } - - &.editor-collapsed-option { - width: 2rem; - - &.active svg { - fill: #5f5f5f; - } - } - svg { pointer-events: none; }