From a6b1004b741092de487db9352c151efdbf081cab Mon Sep 17 00:00:00 2001 From: Denis Mishankov Date: Thu, 22 Feb 2024 16:56:44 +0300 Subject: [PATCH 1/3] overall better --- src/App.svelte | 30 +++++++++---------- src/ManipulationsPanel.svelte | 2 -- src/app.css | 3 +- src/components/Heading.svelte | 12 ++++++++ src/components/TextArea.svelte | 8 ++--- .../components/Manipulation.svelte | 10 ++----- 6 files changed, 34 insertions(+), 31 deletions(-) create mode 100644 src/components/Heading.svelte diff --git a/src/App.svelte b/src/App.svelte index e0178d5..bb581fa 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -3,20 +3,15 @@ import ManipulationsPanel from "./ManipulationsPanel.svelte"; import TextArea from "./components/TextArea.svelte"; + import Heading from "./components/Heading.svelte"; - let source = "Try me!\nPress \"Apply\"" + let source = "Try me!\nResult will update automatically" let result = "" let manipulations: TManipulation[] = [{ type: "replace", - from: "\\n", to: "--", id: "initial" + from: "\\n", to: " -- ", id: "initial" }] - function onApply(event: MouseEvent) { - if (event.type == "click") { - result = applyManipulations(source, manipulations) - } - } - document.addEventListener("keydown", (event) => { if (event.ctrlKey && event.key === "Enter") { result = applyManipulations(source, manipulations) @@ -28,26 +23,29 @@
-