From 0dda9f7767160d1e8789c4095787cd594dd71a89 Mon Sep 17 00:00:00 2001 From: David Vogel Date: Fri, 12 May 2023 12:57:42 +0200 Subject: [PATCH] Several changes - Remove license headers - Update example pages - Move ButtonNav into navigation package as SidebarEntry - Add sidebar collapse and hide functionality - Add click event - Add click handler to button - Add ButtonFullscreen to navigation package - Fix resulting suffix space in CodeInline - Fix CSS class of Code - Update icon sketches.cdr --- .vscode/settings.json | 1 + components/input/button-nav.go | 25 -- components/input/button-nav.vugu | 25 -- components/input/button.go | 13 +- components/input/button.vugu | 13 +- components/input/button_vgen.go | 9 +- components/input/events.go | 21 + components/input/generate.go | 5 - components/layout/container.go | 5 - components/layout/generate.go | 5 - components/navigation/button-fullscreen.go | 17 + components/navigation/button-fullscreen.vugu | 17 + .../navigation/button-fullscreen_vgen.go | 84 ++++ components/navigation/generate.go | 5 - components/navigation/sidebar-entry.go | 20 + components/navigation/sidebar-entry.vugu | 36 ++ .../sidebar-entry_vgen.go} | 8 +- components/navigation/sidebar.go | 27 +- components/navigation/sidebar.vugu | 53 ++- components/navigation/sidebar_vgen.go | 83 +++- components/view/code-inline.vugu | 4 +- components/view/code-inline_vgen.go | 4 - components/view/code.vugu | 7 +- components/view/code_vgen.go | 4 +- components/view/generate.go | 5 - generate.go | 5 - icons/generate.go | 5 - icons/sketches.cdr | Bin 45133 -> 44761 bytes page-icons.vugu | 13 + page-icons_vgen.go | 397 ++++++++++++------ root.go | 5 - root.vugu | 36 +- root_vgen.go | 159 +++++-- router.go | 5 - scripts/dev-server/devserver.go | 5 - 35 files changed, 814 insertions(+), 312 deletions(-) delete mode 100644 components/input/button-nav.go delete mode 100644 components/input/button-nav.vugu create mode 100644 components/input/events.go create mode 100644 components/navigation/button-fullscreen.go create mode 100644 components/navigation/button-fullscreen.vugu create mode 100644 components/navigation/button-fullscreen_vgen.go create mode 100644 components/navigation/sidebar-entry.go create mode 100644 components/navigation/sidebar-entry.vugu rename components/{input/button-nav_vgen.go => navigation/sidebar-entry_vgen.go} (66%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8b3d43d..ae4541e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "domrender", + "Fullscreen", "ldflags", "Segoe", "simplehttp", diff --git a/components/input/button-nav.go b/components/input/button-nav.go deleted file mode 100644 index e5ba63a..0000000 --- a/components/input/button-nav.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2021 David Vogel -// -// This software is released under the MIT License. -// https://opensource.org/licenses/MIT - -package input - -import ( - "github.com/vugu/vgrouter" - "github.com/vugu/vugu" -) - -type ButtonNav struct { - vgrouter.NavigatorRef - AttrMap vugu.AttrMap - - SymbolSlot vugu.Builder // Slot for the symbol. - DefaultSlot vugu.Builder - - URL string -} - -func (c *ButtonNav) handleClick(event vugu.DOMEvent) { - c.Navigate(c.URL, nil) -} diff --git a/components/input/button-nav.vugu b/components/input/button-nav.vugu deleted file mode 100644 index 69fe46e..0000000 --- a/components/input/button-nav.vugu +++ /dev/null @@ -1,25 +0,0 @@ -
- -
- - \ No newline at end of file diff --git a/components/input/button.go b/components/input/button.go index 141298d..744f10a 100644 --- a/components/input/button.go +++ b/components/input/button.go @@ -1,8 +1,3 @@ -// Copyright (c) 2021 David Vogel -// -// This software is released under the MIT License. -// https://opensource.org/licenses/MIT - package input import "github.com/vugu/vugu" @@ -12,4 +7,12 @@ type Button struct { SymbolSlot vugu.Builder // Slot for the symbol. DefaultSlot vugu.Builder + + Click ClickHandler // External handler that is called upon an event. +} + +func (c *Button) HandleClick(event vugu.DOMEvent) { + if c.Click != nil { + c.Click.ClickHandle(ClickEvent{DOMEvent: event}) + } } diff --git a/components/input/button.vugu b/components/input/button.vugu index 412c76b..93ad1b6 100644 --- a/components/input/button.vugu +++ b/components/input/button.vugu @@ -1,17 +1,20 @@ -
+
+ + + diff --git a/components/navigation/button-fullscreen_vgen.go b/components/navigation/button-fullscreen_vgen.go new file mode 100644 index 0000000..8c857ac --- /dev/null +++ b/components/navigation/button-fullscreen_vgen.go @@ -0,0 +1,84 @@ +package navigation + +// Code generated by vugu via vugugen. Please regenerate instead of editing or add additional code in a separate file. DO NOT EDIT. + +import "fmt" +import "reflect" +import "github.com/vugu/vjson" +import "github.com/vugu/vugu" +import js "github.com/vugu/vugu/js" + +import ( + "git.d3nexus.de/Dadido3/D3vugu-components/components/input" + "git.d3nexus.de/Dadido3/D3vugu-components/icons" +) + +func (c *ButtonFullscreen) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { + + vgout = &vugu.BuildOut{} + + var vgiterkey interface{} + _ = vgiterkey + var vgn *vugu.VGNode + vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1683824360"}}} + vgout.Out = append(vgout.Out, vgn) // root for output + vgn.AddAttrList(c.AttrMap) + { + vgparent := vgn + _ = vgparent + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} + vgparent.AppendChild(vgn) + { + vgcompKey := vugu.MakeCompKey(0x7F44F1B83C38940B^vgin.CurrentPositionHash(), vgiterkey) + // ask BuildEnv for prior instance of this specific component + vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button) + if vgcomp == nil { + // create new one if needed + vgcomp = new(input.Button) + vgin.BuildEnv.WireComponent(vgcomp) + } + vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around + vgcomp.Click = input.ClickFunc(func(event input.ClickEvent) { c.handleClick(event) }) + vgcomp.SymbolSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { + vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)} + vgout = &vugu.BuildOut{} + vgout.Out = append(vgout.Out, vgn) + vgparent := vgn + _ = vgparent + + { + vgcompKey := vugu.MakeCompKey(0xFE561D87B2B8675D^vgin.CurrentPositionHash(), vgiterkey) + // ask BuildEnv for prior instance of this specific component + vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LFullScreen) + if vgcomp == nil { + // create new one if needed + vgcomp = new(icons.LFullScreen) + vgin.BuildEnv.WireComponent(vgcomp) + } + vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around + vgout.Components = append(vgout.Components, vgcomp) + vgn = &vugu.VGNode{Component: vgcomp} + vgparent.AppendChild(vgn) + } + return + }) + vgout.Components = append(vgout.Components, vgcomp) + vgn = &vugu.VGNode{Component: vgcomp} + vgparent.AppendChild(vgn) + } + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n"} + vgparent.AppendChild(vgn) + } + vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Data: "style", Attr: []vugu.VGAttribute(nil)} + { + vgn.AppendChild(&vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t:fullscreen .d3c-1683824360 {\n\t\tdisplay: none;\n\t}\n", Attr: []vugu.VGAttribute(nil)}) + } + vgout.AppendCSS(vgn) + return vgout +} + +// 'fix' unused imports +var _ fmt.Stringer +var _ reflect.Type +var _ vjson.RawMessage +var _ js.Value diff --git a/components/navigation/generate.go b/components/navigation/generate.go index c2062ed..15c707d 100644 --- a/components/navigation/generate.go +++ b/components/navigation/generate.go @@ -1,8 +1,3 @@ -// Copyright (c) 2021 David Vogel -// -// This software is released under the MIT License. -// https://opensource.org/licenses/MIT - package navigation //go:generate vugugen diff --git a/components/navigation/sidebar-entry.go b/components/navigation/sidebar-entry.go new file mode 100644 index 0000000..fd2d6a3 --- /dev/null +++ b/components/navigation/sidebar-entry.go @@ -0,0 +1,20 @@ +package navigation + +import ( + "github.com/vugu/vgrouter" + "github.com/vugu/vugu" +) + +type SidebarEntry struct { + vgrouter.NavigatorRef + AttrMap vugu.AttrMap + + SymbolSlot vugu.Builder // Slot for the symbol. + DefaultSlot vugu.Builder // Slot for the text and other stuff. Should be a div element! + + URL string +} + +func (c *SidebarEntry) handleClick(event vugu.DOMEvent) { + c.Navigate(c.URL, nil) +} diff --git a/components/navigation/sidebar-entry.vugu b/components/navigation/sidebar-entry.vugu new file mode 100644 index 0000000..8517856 --- /dev/null +++ b/components/navigation/sidebar-entry.vugu @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/components/input/button-nav_vgen.go b/components/navigation/sidebar-entry_vgen.go similarity index 66% rename from components/input/button-nav_vgen.go rename to components/navigation/sidebar-entry_vgen.go index f03a4f1..e31b601 100644 --- a/components/input/button-nav_vgen.go +++ b/components/navigation/sidebar-entry_vgen.go @@ -1,4 +1,4 @@ -package input +package navigation // Code generated by vugu via vugugen. Please regenerate instead of editing or add additional code in a separate file. DO NOT EDIT. @@ -8,14 +8,14 @@ import "github.com/vugu/vjson" import "github.com/vugu/vugu" import js "github.com/vugu/vugu/js" -func (c *ButtonNav) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { +func (c *SidebarEntry) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgout = &vugu.BuildOut{} var vgiterkey interface{} _ = vgiterkey var vgn *vugu.VGNode - vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1683622560"}}} + vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "button", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1683622560"}}} vgout.Out = append(vgout.Out, vgn) // root for output vgn.AddAttrList(c.AttrMap) vgn.DOMEventHandlerSpecList = append(vgn.DOMEventHandlerSpecList, vugu.DOMEventHandlerSpec{ @@ -51,7 +51,7 @@ func (c *ButtonNav) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { } vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Data: "style", Attr: []vugu.VGAttribute(nil)} { - vgn.AppendChild(&vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t.d3c-1683622560 {\n\t\tpadding: 8px;\n\t\tmargin: 4px;\n\t\tborder-radius: 4px;\n\t}\n\n\t.d3c-1683622560 > * {\n\t\tmargin-right: 12px;\n\t\t\n\t\theight: 16px;\n\t}\n\n\t.d3c-1683622560:hover {\n\t\tbackground-color: RGBA(127, 127, 127, 0.1);\n\t}\n\n\t.d3c-1683622560-selected {\n\t\tbackground-color: RGBA(127, 127, 127, 0.2);\n\t}\n", Attr: []vugu.VGAttribute(nil)}) + vgn.AppendChild(&vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t.d3c-1683622560 {\n\t\tdisplay: flex;\n\t\tgap: 12px;\n\t\ttext-decoration: none;\n\t\tpadding: 8px;\n\t\tmargin: 8px 0;\n\t\tborder-radius: 4px;\n\t\tborder: none;\n\t\tbackground-color: white;\n\t\twidth: 100%;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t.d3c-1683622560 > * {\n\t\theight: 16px;\n\t}\n\n\t.d3c-1683622560:hover {\n\t\tbackground-color: RGBA(127, 127, 127, 0.1);\n\t}\n\n\t.d3c-1683622560-selected {\n\t\tbackground-color: RGBA(127, 127, 127, 0.2);\n\t}\n\n\t.d3c-1633357633-sidebar-minimized .d3c-1683622560 > *:not(:first-child) {\n\t\tdisplay: none;\n\t}\n", Attr: []vugu.VGAttribute(nil)}) } vgout.AppendCSS(vgn) return vgout diff --git a/components/navigation/sidebar.go b/components/navigation/sidebar.go index b08cb87..4f81990 100644 --- a/components/navigation/sidebar.go +++ b/components/navigation/sidebar.go @@ -1,8 +1,3 @@ -// Copyright (c) 2021 David Vogel -// -// This software is released under the MIT License. -// https://opensource.org/licenses/MIT - package navigation import "github.com/vugu/vugu" @@ -10,13 +5,27 @@ import "github.com/vugu/vugu" type Sidebar struct { AttrMap vugu.AttrMap - Entries vugu.Builder // Main content of the sidebar. Basically the menu entries. + MenuEntries vugu.Builder // Menu content at the top. Either embedded into the sidebar or at the top edge. + Entries vugu.Builder // Main content of the sidebar. BottomEntries vugu.Builder // Static bottom part of the sidebar. Body vugu.Builder // The body contains the content that is right to or behind the sidebar. - Width float64 // Width of the sidebar in DOM pixels. + Minimized bool // If true, the sidebar is reduced to icons. + sidebarClasses string +} + +func (c *Sidebar) Init(ctx vugu.InitCtx) { + c.Minimized = true // Sidebar defaults to minimized. +} + +func (c *Sidebar) Compute(ctx vugu.ComputeCtx) { + if c.Minimized { + c.sidebarClasses = "d3c-1633357633-sidebar-minimized" + } else { + c.sidebarClasses = "" + } } -func (s *Sidebar) Init(ctx vugu.InitCtx) { - s.Width = 300 // Default width in pixels. +func (c *Sidebar) handleMenuButton(event vugu.DOMEvent) { + c.Minimized = !c.Minimized } diff --git a/components/navigation/sidebar.vugu b/components/navigation/sidebar.vugu index efe703e..14794fc 100644 --- a/components/navigation/sidebar.vugu +++ b/components/navigation/sidebar.vugu @@ -1,11 +1,12 @@
-
-
- +
+
+ +
-
+
@@ -15,6 +16,12 @@
+
+ + + + +
@@ -27,12 +34,46 @@ display: flex; } + .d3c-1633357633-menu { + width: 100%; + border-bottom: 1px solid RGBA(0, 0, 0, 0.1); + display: flex; + position: relative; + padding: 0 8px; + box-sizing: border-box; + } + .d3c-1633357633-sidebar { height: 100%; - border-right: 1px solid RGBA(0, 0, 0, 0.05); + border-right: 1px solid RGBA(0, 0, 0, 0.1); + padding: 0 8px; display: flex; flex-direction: column; - flex-shrink: 0; + background-color: white; + z-index: 1; + } + + .d3c-1633357633-sidebar-menu { + /*display: flex; + flex-direction: column;*/ + } + + @media (min-aspect-ratio: 1/1) { + .d3c-1633357633-menu { + display: none; + } + } + @media not all and (min-aspect-ratio: 1/1) { + .d3c-1633357633-sidebar-minimized { + display: none; + } + .d3c-1633357633-sidebar { + position: absolute; + } + } + + .d3c-1633357633-sidebar-entries { + overflow-y: scroll; } .d3c-1633357633-spacer { diff --git a/components/navigation/sidebar_vgen.go b/components/navigation/sidebar_vgen.go index ca17500..ce8b899 100644 --- a/components/navigation/sidebar_vgen.go +++ b/components/navigation/sidebar_vgen.go @@ -28,15 +28,15 @@ func (c *Sidebar) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { _ = vgparent vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t"} vgparent.AppendChild(vgn) - vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-sidebar"}}} + vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)} vgparent.AppendChild(vgn) - vgn.AddAttrInterface("style", fmt.Sprintf("width: %vpx;", c.Width)) + vgn.AddAttrInterface("class", "d3c-1633357633-sidebar "+c.sidebarClasses) { vgparent := vgn _ = vgparent vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) - vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)} + vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-sidebar-menu"}}} vgparent.AppendChild(vgn) { vgparent := vgn @@ -53,6 +53,7 @@ func (c *Sidebar) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgin.BuildEnv.WireComponent(vgcomp) } vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around + vgcomp.Click = input.ClickFunc(func(event input.ClickEvent) { c.handleMenuButton(event) }) vgcomp.SymbolSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)} vgout = &vugu.BuildOut{} @@ -80,12 +81,23 @@ func (c *Sidebar) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { vgn = &vugu.VGNode{Component: vgcomp} vgparent.AppendChild(vgn) } + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"} + vgparent.AppendChild(vgn) + { + var vgcomp vugu.Builder = c.MenuEntries + if vgcomp != nil { + vgin.BuildEnv.WireComponent(vgcomp) + vgout.Components = append(vgout.Components, vgcomp) + vgn = &vugu.VGNode{Component: vgcomp} + vgparent.AppendChild(vgn) + } + } vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) } vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) - vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute(nil)} + vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-sidebar-entries"}}} vgparent.AppendChild(vgn) { vgparent := vgn @@ -142,6 +154,67 @@ func (c *Sidebar) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { _ = vgparent vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} vgparent.AppendChild(vgn) + vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Namespace: "", Data: "div", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "d3c-1633357633-menu"}}} + vgparent.AppendChild(vgn) + { + vgparent := vgn + _ = vgparent + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"} + vgparent.AppendChild(vgn) + { + vgcompKey := vugu.MakeCompKey(0x897F172FEE13D43B^vgin.CurrentPositionHash(), vgiterkey) + // ask BuildEnv for prior instance of this specific component + vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*input.Button) + if vgcomp == nil { + // create new one if needed + vgcomp = new(input.Button) + vgin.BuildEnv.WireComponent(vgcomp) + } + vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around + vgcomp.Click = input.ClickFunc(func(event input.ClickEvent) { c.handleMenuButton(event) }) + vgcomp.SymbolSlot = vugu.NewBuilderFunc(func(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { + vgn := &vugu.VGNode{Type: vugu.VGNodeType(3)} + vgout = &vugu.BuildOut{} + vgout.Out = append(vgout.Out, vgn) + vgparent := vgn + _ = vgparent + + { + vgcompKey := vugu.MakeCompKey(0x518FFA1C483DB64B^vgin.CurrentPositionHash(), vgiterkey) + // ask BuildEnv for prior instance of this specific component + vgcomp, _ := vgin.BuildEnv.CachedComponent(vgcompKey).(*icons.LGlobalNav) + if vgcomp == nil { + // create new one if needed + vgcomp = new(icons.LGlobalNav) + vgin.BuildEnv.WireComponent(vgcomp) + } + vgin.BuildEnv.UseComponent(vgcompKey, vgcomp) // ensure we can use this in the cache next time around + vgout.Components = append(vgout.Components, vgcomp) + vgn = &vugu.VGNode{Component: vgcomp} + vgparent.AppendChild(vgn) + } + return + }) + vgout.Components = append(vgout.Components, vgcomp) + vgn = &vugu.VGNode{Component: vgcomp} + vgparent.AppendChild(vgn) + } + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t\t"} + vgparent.AppendChild(vgn) + { + var vgcomp vugu.Builder = c.MenuEntries + if vgcomp != nil { + vgin.BuildEnv.WireComponent(vgcomp) + vgout.Components = append(vgout.Components, vgcomp) + vgn = &vugu.VGNode{Component: vgcomp} + vgparent.AppendChild(vgn) + } + } + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} + vgparent.AppendChild(vgn) + } + vgn = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t\t"} + vgparent.AppendChild(vgn) { var vgcomp vugu.Builder = c.Body if vgcomp != nil { @@ -159,7 +232,7 @@ func (c *Sidebar) Build(vgin *vugu.BuildIn) (vgout *vugu.BuildOut) { } vgn = &vugu.VGNode{Type: vugu.VGNodeType(3), Data: "style", Attr: []vugu.VGAttribute(nil)} { - vgn.AppendChild(&vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t.d3c-1633357633 {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tposition: absolute;\n\t\tdisplay: flex;\n\t}\n\n\t.d3c-1633357633-sidebar {\n\t\theight: 100%;\n\t\tborder-right: 1px solid RGBA(0, 0, 0, 0.05);\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tflex-shrink: 0;\n\t}\n\n\t.d3c-1633357633-spacer {\n\t\tflex-grow: 1;\n\t}\n\n\t.d3c-1633357633-body {\n\t\toverflow: auto;\n\t\tflex-grow: 1;\n\t\tflex-shrink: 1;\n\t}\n", Attr: []vugu.VGAttribute(nil)}) + vgn.AppendChild(&vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n\t.d3c-1633357633 {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tposition: absolute;\n\t\tdisplay: flex;\n\t}\n\n\t.d3c-1633357633-menu {\n\t\twidth: 100%;\n\t\tborder-bottom: 1px solid RGBA(0, 0, 0, 0.1);\n\t\tdisplay: flex;\n\t\tposition: relative;\n\t\tpadding: 0 8px;\n\t\tbox-sizing: border-box;\n\t}\n\n\t.d3c-1633357633-sidebar {\n\t\theight: 100%;\n\t\tborder-right: 1px solid RGBA(0, 0, 0, 0.1);\n\t\tpadding: 0 8px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tbackground-color: white;\n\t\tz-index: 1;\n\t}\n\n\t.d3c-1633357633-sidebar-menu {\n\t\t/*display: flex;\n\t\tflex-direction: column;*/\n\t}\n\n\t@media (min-aspect-ratio: 1/1) {\n\t\t.d3c-1633357633-menu {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t@media not all and (min-aspect-ratio: 1/1) {\n\t\t.d3c-1633357633-sidebar-minimized {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.d3c-1633357633-sidebar {\n\t\t\tposition: absolute;\n\t\t}\n\t}\n\n\t.d3c-1633357633-sidebar-entries {\n\t\toverflow-y: scroll;\n\t}\n\n\t.d3c-1633357633-spacer {\n\t\tflex-grow: 1;\n\t}\n\n\t.d3c-1633357633-body {\n\t\toverflow: auto;\n\t\tflex-grow: 1;\n\t\tflex-shrink: 1;\n\t}\n", Attr: []vugu.VGAttribute(nil)}) } vgout.AppendCSS(vgn) return vgout diff --git a/components/view/code-inline.vugu b/components/view/code-inline.vugu index fa1121a..037981e 100644 --- a/components/view/code-inline.vugu +++ b/components/view/code-inline.vugu @@ -1,6 +1,4 @@ - - - +