From 83018e4d9821909dd7830f6593302f5d16c72e84 Mon Sep 17 00:00:00 2001 From: Morten Friis Nielsen <52461393+Lodod@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:54:41 +0100 Subject: [PATCH 01/18] ToolBar Frontend (WIP) Initial work on the ToolBar frontend --- src/lib/components/tools/ToolBar.svelte | 0 src/lib/components/tools/ToolsNav.svelte | 31 ++++++++++++++++++++++++ src/routes/+page.svelte | 7 +++++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/lib/components/tools/ToolBar.svelte create mode 100644 src/lib/components/tools/ToolsNav.svelte diff --git a/src/lib/components/tools/ToolBar.svelte b/src/lib/components/tools/ToolBar.svelte new file mode 100644 index 00000000..e69de29b diff --git a/src/lib/components/tools/ToolsNav.svelte b/src/lib/components/tools/ToolsNav.svelte new file mode 100644 index 00000000..87d1b6fa --- /dev/null +++ b/src/lib/components/tools/ToolsNav.svelte @@ -0,0 +1,31 @@ + + +
+
+

Tools

+
+
+ +
+
+ + \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 61c07a5c..403bbc0d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -5,6 +5,7 @@ import Console from "$lib/components/console/Console.svelte"; import Components from "$lib/components/project/component/Components.svelte"; import Systems from "$lib/components/project/system/Systems.svelte"; + import ToolsNav from "$lib/components/tools/ToolsNav.svelte" import ProjectNav from "$lib/components/project/ProjectNav.svelte"; import Queries from "$lib/components/query/Queries.svelte"; import QueryNav from "$lib/components/query/QueryNav.svelte"; @@ -72,7 +73,11 @@ {:else}
- + +
+ +
+
From 2a2aee8626e5dae48dfaf2a44009cb40881e1d5c Mon Sep 17 00:00:00 2001 From: Morten Friis Nielsen <52461393+Lodod@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:18:22 +0100 Subject: [PATCH 02/18] Toolbar 2nd iteration (WIP) 2nd iteration of toolbar, still not fully functional --- src/lib/components/toolBar/ToolBar.svelte | 82 +++++++++++++++++++ src/lib/components/toolBar/ToolBarItem.svelte | 74 +++++++++++++++++ .../ToolsBarNav.svelte} | 0 src/lib/components/tools/ToolBar.svelte | 0 src/lib/globalState/toolbarState.ts | 13 +++ src/routes/+page.svelte | 14 +++- 6 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 src/lib/components/toolBar/ToolBar.svelte create mode 100644 src/lib/components/toolBar/ToolBarItem.svelte rename src/lib/components/{tools/ToolsNav.svelte => toolBar/ToolsBarNav.svelte} (100%) delete mode 100644 src/lib/components/tools/ToolBar.svelte create mode 100644 src/lib/globalState/toolbarState.ts diff --git a/src/lib/components/toolBar/ToolBar.svelte b/src/lib/components/toolBar/ToolBar.svelte new file mode 100644 index 00000000..43d64243 --- /dev/null +++ b/src/lib/components/toolBar/ToolBar.svelte @@ -0,0 +1,82 @@ + + +
+ { + // Your custom logic here + console.log('Button pressed!'); + }} + + /> + { + // Your custom logic here + console.log('Button pressed!'); + }} + /> + { + // Your custom logic here + console.log('Button pressed!'); + }} + /> + { + // Your custom logic here + console.log('Button pressed!'); + }} + /> + { + // Your custom logic here + console.log('Button pressed!'); + }} + /> + { + // Your custom logic here + console.log('Button pressed!'); + }} + /> + { + // Your custom logic here + console.log('Button pressed!'); + }} + /> + { + // Your custom logic here + console.log('Button pressed!'); + }} + /> + { + // Your custom logic here + console.log('Button pressed!'); + }} + /> +
\ No newline at end of file diff --git a/src/lib/components/toolBar/ToolBarItem.svelte b/src/lib/components/toolBar/ToolBarItem.svelte new file mode 100644 index 00000000..689216a7 --- /dev/null +++ b/src/lib/components/toolBar/ToolBarItem.svelte @@ -0,0 +1,74 @@ + + + + + + \ No newline at end of file diff --git a/src/lib/components/tools/ToolsNav.svelte b/src/lib/components/toolBar/ToolsBarNav.svelte similarity index 100% rename from src/lib/components/tools/ToolsNav.svelte rename to src/lib/components/toolBar/ToolsBarNav.svelte diff --git a/src/lib/components/tools/ToolBar.svelte b/src/lib/components/tools/ToolBar.svelte deleted file mode 100644 index e69de29b..00000000 diff --git a/src/lib/globalState/toolbarState.ts b/src/lib/globalState/toolbarState.ts new file mode 100644 index 00000000..37ed7fb3 --- /dev/null +++ b/src/lib/globalState/toolbarState.ts @@ -0,0 +1,13 @@ +import type ToolBarItem from "$lib/components/toolBar/ToolBarItemOld.svelte"; +import { writable, type Writable} from "svelte/store"; + +export let toolbarState: ToolBarItem; +//export const toolbarState: { +// [NAME: string]: Writable; +//} = {}; + +export function changeToolBarItemState(name: string, defaultValue: boolean){ + if (typeof toolbarState[name] === typeof undefined) { + toolbarState[name] = writable(defaultValue); + } +} \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 98fc0049..c584c2fd 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -5,13 +5,14 @@ import Console from "$lib/components/console/Console.svelte"; import Components from "$lib/components/project/component/Components.svelte"; import Systems from "$lib/components/project/system/Systems.svelte"; - import ToolsNav from "$lib/components/tools/ToolsNav.svelte" + import ToolBarNav from "$lib/components/toolBar/ToolsBarNav.svelte" import ProjectNav from "$lib/components/project/ProjectNav.svelte"; import Queries from "$lib/components/query/Queries.svelte"; import QueryNav from "$lib/components/query/QueryNav.svelte"; import { Description } from "svelte-google-materialdesign-icons"; import TopBar from "$lib/components/topBar/TopBar.svelte"; + import ToolBar from "$lib/components/toolBar/ToolBar.svelte"; enum SidePanel { Left, @@ -78,9 +79,10 @@ {:else}
- -
- + +
+
@@ -198,6 +200,10 @@ overflow: hidden; } + .side-panel-toolbar-content { + height: 50px; + } + .side-panel-content { height: 100%; width: 100%; From a07d0e5f742cf5c57a8c93eb14b53277fb543ac1 Mon Sep 17 00:00:00 2001 From: DenFlyvendeGed Date: Mon, 13 Nov 2023 13:22:32 +0100 Subject: [PATCH 03/18] linked radio and label --- src/lib/components/toolBar/ToolBarItem.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/components/toolBar/ToolBarItem.svelte b/src/lib/components/toolBar/ToolBarItem.svelte index 689216a7..e19a8d9c 100644 --- a/src/lib/components/toolBar/ToolBarItem.svelte +++ b/src/lib/components/toolBar/ToolBarItem.svelte @@ -37,13 +37,17 @@ color: "black", }; setContext("iconCtx", iconCtx); + + const slugify = (str = "") => + str.toLowerCase().replace(/ /g, "-").replace(/\./g, ""); -
From 849f541d823cd21a824aec1ab5a862eb496be5c6 Mon Sep 17 00:00:00 2001 From: Morten Friis Nielsen <52461393+Lodod@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:16:15 +0100 Subject: [PATCH 16/18] formatting formatting --- src/lib/GlobalCssProperties.json | 14 +-- .../classes/automaton/GlobalDeclarations.ts | 2 +- .../classes/automaton/SystemDeclarations.ts | 2 +- .../classes/automaton/component/Location.ts | 4 +- src/lib/components/sidePanel/SidePanel.svelte | 4 +- src/lib/components/toolBar/ToolBar.svelte | 91 ++++++++------- src/lib/components/toolBar/ToolBarItem.svelte | 110 +++++++++--------- src/lib/globalState/toolbarState.ts | 4 +- src/routes/+page.svelte | 8 +- tests/lib/components/toolbar/toolbar.test.ts | 23 ++-- .../components/toolbar/toolbarItem.test.ts | 46 +++----- 11 files changed, 146 insertions(+), 162 deletions(-) diff --git a/src/lib/GlobalCssProperties.json b/src/lib/GlobalCssProperties.json index 63681af9..8504f762 100644 --- a/src/lib/GlobalCssProperties.json +++ b/src/lib/GlobalCssProperties.json @@ -97,12 +97,7 @@ ], "--settings-danger-button-color": ["srgb", 0.498, 0.0902, 0.0549], "--settings-safe-button-color": ["srgb", 0.3255, 0.498, 0.2667], - "--toolbar-icon-color": [ - "display-p3", - 0, - 0, - 0 - ], + "--toolbar-icon-color": ["display-p3", 0, 0, 0], "--toolbar-selected-color": [ "display-p3", 0.3362745098, @@ -225,12 +220,7 @@ 0.14666666666, 0.17019607843 ], - "--toolbar-icon-color": [ - "display-p3", - 1, - 1, - 1 - ], + "--toolbar-icon-color": ["display-p3", 1, 1, 1], "--toolbar-selected-color": [ "display-p3", 0.42215686274, diff --git a/src/lib/classes/automaton/GlobalDeclarations.ts b/src/lib/classes/automaton/GlobalDeclarations.ts index d743d628..f9dabdf2 100644 --- a/src/lib/classes/automaton/GlobalDeclarations.ts +++ b/src/lib/classes/automaton/GlobalDeclarations.ts @@ -28,7 +28,7 @@ export class GlobalDeclarations extends Declarations< : { name: this.type, declarations: this.declarations, - }; + }; } /** diff --git a/src/lib/classes/automaton/SystemDeclarations.ts b/src/lib/classes/automaton/SystemDeclarations.ts index 7e09fad3..33483ce3 100644 --- a/src/lib/classes/automaton/SystemDeclarations.ts +++ b/src/lib/classes/automaton/SystemDeclarations.ts @@ -28,7 +28,7 @@ export class SystemDeclarations extends Declarations< : { name: this.type, declarations: this.declarations, - }; + }; } /** diff --git a/src/lib/classes/automaton/component/Location.ts b/src/lib/classes/automaton/component/Location.ts index d4c345bc..d296e7cf 100644 --- a/src/lib/classes/automaton/component/Location.ts +++ b/src/lib/classes/automaton/component/Location.ts @@ -139,12 +139,12 @@ export class Location extends AutomatonClass { typeof raw.nickname === "string" ? Nickname.fromRaw(raw as { nickname: string }, { positionReference: position, - }) + }) : undefined, typeof raw.invariant === "string" ? Invariant.fromRaw(raw as { invariant: string }, { positionReference: position, - }) + }) : undefined, ); }; diff --git a/src/lib/components/sidePanel/SidePanel.svelte b/src/lib/components/sidePanel/SidePanel.svelte index a876c477..220153ea 100644 --- a/src/lib/components/sidePanel/SidePanel.svelte +++ b/src/lib/components/sidePanel/SidePanel.svelte @@ -68,7 +68,7 @@ {/if}
{#if panelSide === SidePanelEnum.Left} - + {/if}
-
+
- { // Your custom logic here - console.log('Cut pressed!'); - }} + EcdarConsole.writeLineFrontend("Cut pressed!"); + }} description="This is a testfunction for cut" - /> - { // Your custom logic here - console.log('Cut 2 pressed!'); - }} + EcdarConsole.writeLineFrontend("Cut 2 pressed!"); + }} description="This is a testfunction for cut 2" /> - { // Your custom logic here - console.log('Cut 3 pressed!'); + EcdarConsole.writeLineFrontend("Cut 3 pressed!"); }} description="This is a testfunction for cut 3" /> - { // Your custom logic here - console.log('Cut 4 pressed!'); + EcdarConsole.writeLineFrontend("Cut 4 pressed!"); }} description="This is a testfunction for cut 4" /> - { // Your custom logic here - console.log('Cut 5 pressed!'); + EcdarConsole.writeLineFrontend("Cut 5 pressed!"); }} description="This is a testfunction for cut 5" /> - { // Your custom logic here - console.log('Cut 6 pressed!'); + EcdarConsole.writeLineFrontend("Cut 6 pressed!"); }} description="This is a testfunction for cut 6" /> - { // Your custom logic here - console.log('Cut 7 pressed!'); + EcdarConsole.writeLineFrontend("Cut 7 pressed!"); }} description="This is a testfunction for cut 7" /> - { // Your custom logic here - console.log('Cut 8 pressed!'); + EcdarConsole.writeLineFrontend("Cut 8 pressed!"); }} description="This is a testfunction for cut 8" /> - { // Your custom logic here - console.log('Cut 9 pressed!'); + EcdarConsole.writeLineFrontend("Cut 9 pressed!"); }} description="This is a testfunction for cut 9" />
diff --git a/src/lib/components/toolBar/ToolBarItem.svelte b/src/lib/components/toolBar/ToolBarItem.svelte index 16739c5c..abedd6dc 100644 --- a/src/lib/components/toolBar/ToolBarItem.svelte +++ b/src/lib/components/toolBar/ToolBarItem.svelte @@ -1,66 +1,64 @@ - -