refactor folder structure
This commit is contained in:
16
CLAUDE.md
16
CLAUDE.md
@@ -46,10 +46,18 @@ drag a JavaScript bundler along for a CSS file.
|
|||||||
### go/ — module `kjol`
|
### go/ — module `kjol`
|
||||||
|
|
||||||
Packages, imported as `kjol/<name>`: `appenv basic chrono config csv dbutil finance httputil
|
Packages, imported as `kjol/<name>`: `appenv basic chrono config csv dbutil finance httputil
|
||||||
l4g lexer security snailmail validation jsbundler tw`, plus the **gowasm** web-UI engine (`vdom`
|
l4g lexer security snailmail validation jsbundler tw`, plus the **gowasm** web-UI engine
|
||||||
`wasmruntime` `rsc` `wasmdevserver`, and `webui` — a Tailwind-styled component kit ported
|
(`wasmruntime` and its sub-packages `wasmruntime/vdom` + `wasmruntime/rsc`, `wasmdevserver`,
|
||||||
from `jsruntime/uikit`; author components in pure Go compiled to WebAssembly; all
|
and `webui` — a Tailwind-styled component kit ported from `jsruntime/uikit`; author
|
||||||
stdlib-only), and `cmd/{bundle,twcss,migrate,loc,passgen,typecheck,wasmgen}`.
|
components in pure Go compiled to WebAssembly; all stdlib-only), and
|
||||||
|
`cmd/{bundle,twcss,migrate,loc,passgen,typecheck,wasmgen}`.
|
||||||
|
|
||||||
|
`vdom` and `rsc` are **sub-packages of `wasmruntime`** — imported as `kjol/wasmruntime/vdom`
|
||||||
|
and `kjol/wasmruntime/rsc` (the package names stay `vdom` / `rsc`, so call sites are still
|
||||||
|
`vdom.VNode`, `rsc.Mount`). They nest cleanly because `vdom` imports nothing and both `rsc`
|
||||||
|
and `wasmruntime` import only `vdom` — no child imports the parent, so there is no cycle.
|
||||||
|
`wasmgen` emits these import paths in the `*.gen.go` glue, so if they ever move again, its
|
||||||
|
templates move with them.
|
||||||
|
|
||||||
`jsbundler` is the **JS** build (TSX → Solid → esbuild + the goja SSR bake). It was called
|
`jsbundler` is the **JS** build (TSX → Solid → esbuild + the goja SSR bake). It was called
|
||||||
`webbundler`.
|
`webbundler`.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
ui "kjol/webui"
|
ui "kjol/webui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The C layer's documentation.
|
// The C layer's documentation.
|
||||||
@@ -471,7 +471,7 @@ const unityTUSnippet = `// The whole layer, as one translation unit — the only
|
|||||||
// compiler. Order matters: it is textual inclusion, not linking.
|
// compiler. Order matters: it is textual inclusion, not linking.
|
||||||
#include "base/base_inc.c" // core, arena, strings. Everything below needs it.
|
#include "base/base_inc.c" // core, arena, strings. Everything below needs it.
|
||||||
|
|
||||||
// The five backends declare their helpers `+ "`internal`" + ` (file-static), so they
|
// The five backends declare their helpers ` + "`internal`" + ` (file-static), so they
|
||||||
// belong in the SAME TU as the dispatch that calls them.
|
// belong in the SAME TU as the dispatch that calls them.
|
||||||
#include "lexer/lexer.c"
|
#include "lexer/lexer.c"
|
||||||
#include "lexer/lexer_c.c"
|
#include "lexer/lexer_c.c"
|
||||||
@@ -488,7 +488,7 @@ const unityTUSnippet = `// The whole layer, as one translation unit — the only
|
|||||||
// ...and then your own program, compiled with all of it:
|
// ...and then your own program, compiled with all of it:
|
||||||
#include "app/app.c"`
|
#include "app/app.c"`
|
||||||
|
|
||||||
const baseCoreSnippet = `// The three meanings of `+ "`static`" + ` in C, given three names.
|
const baseCoreSnippet = `// The three meanings of ` + "`static`" + ` in C, given three names.
|
||||||
#define internal static // a function private to this file
|
#define internal static // a function private to this file
|
||||||
#define global static // a variable owned by this translation unit
|
#define global static // a variable owned by this translation unit
|
||||||
#define local_persist static // a local that survives the call
|
#define local_persist static // a local that survives the call
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"kjol/rsc"
|
"kjol/wasmruntime/rsc"
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServerCounter is a generated client stub for the server component of the same name.
|
// ServerCounter is a generated client stub for the server component of the same name.
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
. "kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
. "kjol/wasmruntime/vdom"
|
||||||
ui "kjol/webui"
|
ui "kjol/webui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/httputil"
|
"kjol/httputil"
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
ui "kjol/webui"
|
ui "kjol/webui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/lexer" // syntax highlighting for the code blocks — a string in, HTML out
|
"kjol/lexer" // syntax highlighting for the code blocks — a string in, HTML out
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
// The host API is dual-build — real under js/wasm, no-ops natively — so neutral page
|
// The host API is dual-build — real under js/wasm, no-ops natively — so neutral page
|
||||||
// code can measure the browser and still server-render. This page uses it for exactly
|
// code can measure the browser and still server-render. This page uses it for exactly
|
||||||
// one thing: reading the clock when hydration commits.
|
// one thing: reading the clock when hydration commits.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
ui "kjol/webui"
|
ui "kjol/webui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package app
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
ui "kjol/webui"
|
ui "kjol/webui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
ui "kjol/webui"
|
ui "kjol/webui"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by wasmgen. DO NOT EDIT.
|
// Code generated by wasmgen. DO NOT EDIT.
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Routes maps each //gowasm:page path to its instantiated render function.
|
// Routes maps each //gowasm:page path to its instantiated render function.
|
||||||
func Routes(d Deps) map[string]func() *vdom.VNode {
|
func Routes(d Deps) map[string]func() *vdom.VNode {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import "kjol/rsc"
|
import "kjol/wasmruntime/rsc"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rsc.Register("ServerCounter", ServerCounter)
|
rsc.Register("ServerCounter", ServerCounter)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
ui "kjol/webui"
|
ui "kjol/webui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
"kjol/webui"
|
"kjol/webui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "kjol/vdom"
|
. "kjol/wasmruntime/vdom"
|
||||||
ui "kjol/webui"
|
ui "kjol/webui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The two-runtime demo.s whole claim is that its two panes are ONE function: the live
|
// The two-runtime demo.s whole claim is that its two panes are ONE function: the live
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"kjol/httputil"
|
"kjol/httputil"
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmdevserver"
|
"kjol/wasmdevserver"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
"kjol/webui"
|
"kjol/webui"
|
||||||
|
|
||||||
"kjolwebsite/app"
|
"kjolwebsite/app"
|
||||||
@@ -43,7 +43,7 @@ func main() {
|
|||||||
WatchDirs: []string{
|
WatchDirs: []string{
|
||||||
"app", "wasm", "css", // the Go/WASM app
|
"app", "wasm", "css", // the Go/WASM app
|
||||||
"frontend", // the Solid app — a .tsx save rebuilds the JS bundle
|
"frontend", // the Solid app — a .tsx save rebuilds the JS bundle
|
||||||
"../../webui", "../../vdom", "../../wasmruntime", "../../rsc", // the wasm engine
|
"../../webui", "../../wasmruntime", // the wasm engine (vdom + rsc now live UNDER wasmruntime, and the watcher walks subdirs)
|
||||||
"../../lexer", // the code-block highlighter
|
"../../lexer", // the code-block highlighter
|
||||||
"../../jsruntime/uikit", "../../jsruntime/styles", // the Solid kit + the shared theme
|
"../../jsruntime/uikit", "../../jsruntime/styles", // the Solid kit + the shared theme
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"kjolwebsite/app"
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
|
"kjolwebsite/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ func write(path, tmpl string, data genData) {
|
|||||||
const routesTmpl = `// Code generated by wasmgen. DO NOT EDIT.
|
const routesTmpl = `// Code generated by wasmgen. DO NOT EDIT.
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Routes maps each //gowasm:page path to its instantiated render function.
|
// Routes maps each //gowasm:page path to its instantiated render function.
|
||||||
func Routes(d Deps) map[string]func() *vdom.VNode {
|
func Routes(d Deps) map[string]func() *vdom.VNode {
|
||||||
@@ -191,7 +191,7 @@ const serverTmpl = `// Code generated by wasmgen. DO NOT EDIT.
|
|||||||
|
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import "kjol/rsc"
|
import "kjol/wasmruntime/rsc"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
{{range .Servers}} rsc.Register("{{.}}", {{.}})
|
{{range .Servers}} rsc.Register("{{.}}", {{.}})
|
||||||
@@ -205,8 +205,8 @@ const clientTmpl = `// Code generated by wasmgen. DO NOT EDIT.
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"kjol/rsc"
|
"kjol/wasmruntime/rsc"
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
{{range .Servers}}// {{.}} is a generated client stub for the server component of the same name.
|
{{range .Servers}}// {{.}} is a generated client stub for the server component of the same name.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"kjol/rsc"
|
"kjol/wasmruntime/rsc"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config wires an app into the dev server. Render and Document are called per
|
// Config wires an app into the dev server. Render and Document are called per
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package wasmruntime
|
package wasmruntime
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// The server half of the host API (see host.go). Nothing here touches a browser,
|
// The server half of the host API (see host.go). Nothing here touches a browser,
|
||||||
// because there isn't one: measurements are zero, listeners are never installed,
|
// because there isn't one: measurements are zero, listeners are never installed,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"syscall/js"
|
"syscall/js"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Run from kjol/go:
|
// Run from kjol/go:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package wasmruntime
|
|||||||
import (
|
import (
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The browser half of the host API (see host.go for the contract and the two
|
// The browser half of the host API (see host.go for the contract and the two
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"syscall/js"
|
"syscall/js"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// buildServerDOM fakes what the HTML parser hands us: a real DOM tree, built from
|
// buildServerDOM fakes what the HTML parser hands us: a real DOM tree, built from
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package wasmruntime
|
|||||||
import (
|
import (
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package wasmruntime
|
|||||||
import (
|
import (
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// State preservation across an in-place hot swap (see the dev server's
|
// State preservation across an in-place hot swap (see the dev server's
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"syscall/js"
|
"syscall/js"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Run from kjol/go:
|
// Run from kjol/go:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ package wasmruntime
|
|||||||
import (
|
import (
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
var document = js.Global().Get("document")
|
var document = js.Global().Get("document")
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The reconciler is wasm-only and needs a DOM, so these do not run under a plain
|
// The reconciler is wasm-only and needs a DOM, so these do not run under a plain
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package wasmruntime
|
|||||||
import (
|
import (
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Router holds the current path in a signal, so reading Path() during render
|
// Router holds the current path in a signal, so reading Path() during render
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Mount connects to a server component by name and returns a render function.
|
// Mount connects to a server component by name and returns a render function.
|
||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// registry maps a server-component name to its factory (created by generated
|
// registry maps a server-component name to its factory (created by generated
|
||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Floating.Panel and Modal both declare their initial inline style in the style
|
// Floating.Panel and Modal both declare their initial inline style in the style
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package wasmruntime
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An <svg> built with document.createElement() is NOT an SVG element — it is an
|
// An <svg> built with document.createElement() is NOT an SVG element — it is an
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of web/kit/Accordion.tsx.
|
// Port of web/kit/Accordion.tsx.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of web/kit/Alerts.tsx. The TSX exports one component per color
|
// Port of web/kit/Alerts.tsx. The TSX exports one component per color
|
||||||
// (AlertWhite, AlertBlue, …); here that's Alert(color, header, children).
|
// (AlertWhite, AlertBlue, …); here that's Alert(color, header, children).
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ColumnPosition is a cell/header alignment (mirrors the TSX 0|1|2 union).
|
// ColumnPosition is a cell/header alignment (mirrors the TSX 0|1|2 union).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of web/kit/Badges.tsx.
|
// Port of web/kit/Badges.tsx.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of web/kit/Buttons.tsx.
|
// Port of web/kit/Buttons.tsx.
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Day-of-week and month labels (module-level in the TSX). Prefixed to stay
|
// Day-of-week and month labels (module-level in the TSX). Prefixed to stay
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of web/kit/Cards.tsx. The `ui-card`/`no-flex` marker classes are kept so
|
// Port of web/kit/Cards.tsx. The `ui-card`/`no-flex` marker classes are kept so
|
||||||
// any page CSS targeting them still applies; baseline styling is Tailwind.
|
// any page CSS targeting them still applies; baseline styling is Tailwind.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of web/kit/CellGrid.tsx — an editable, sortable spreadsheet-style grid.
|
// Port of web/kit/CellGrid.tsx — an editable, sortable spreadsheet-style grid.
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ChartKind string
|
type ChartKind string
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of web/kit/CrmTabs.tsx.
|
// Port of web/kit/CrmTabs.tsx.
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// -- Tailwind class strings, verbatim from DatePicker.tsx (cmd/twcss scans these) --
|
// -- Tailwind class strings, verbatim from DatePicker.tsx (cmd/twcss scans these) --
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsNonProdEnv reports whether env is a non-empty, non-production deployment
|
// IsNonProdEnv reports whether env is a non-empty, non-production deployment
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Floating is the live controller for one floating panel — the Go answer to the
|
// Floating is the live controller for one floating panel — the Go answer to the
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of web/kit/Forms.tsx. Reactive accessors collapse to plain values, and
|
// Port of web/kit/Forms.tsx. Reactive accessors collapse to plain values, and
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The three form controls the first pass left out, plus the two input masks. All of
|
// The three form controls the first pass left out, plus the two input masks. All of
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ---- input masks ----
|
// ---- input masks ----
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// fakeEvent is a vdom.Event with no DOM behind it — enough to drive Floating's
|
// fakeEvent is a vdom.Event with no DOM behind it — enough to drive Floating's
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of web/kit/FuzzyMatch.tsx.
|
// Port of web/kit/FuzzyMatch.tsx.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of web/kit/General.tsx. Anchor components render plain <a href>; the app
|
// Port of web/kit/General.tsx. Anchor components render plain <a href>; the app
|
||||||
// wires SPA navigation on top (e.g. its layout nav uses Button/OnClick).
|
// wires SPA navigation on top (e.g. its layout nav uses Button/OnClick).
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of web/kit/Icons.tsx. The TSX resolves FontAwesome glyphs from an
|
// Port of web/kit/Icons.tsx. The TSX resolves FontAwesome glyphs from an
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An unregistered icon name renders as an empty box: right size, no glyph. Nothing
|
// An unregistered icon name renders as an empty box: right size, no glyph. Nothing
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of jsruntime/uikit/Menu.tsx, rebuilt on the Floating controller (floating.go).
|
// Port of jsruntime/uikit/Menu.tsx, rebuilt on the Floating controller (floating.go).
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of jsruntime/uikit/Modal.tsx.
|
// Port of jsruntime/uikit/Modal.tsx.
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
// }
|
// }
|
||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
const popoverCls = "bg-surface rounded-default shadow-lg border border-line"
|
const popoverCls = "bg-surface rounded-default shadow-lg border border-line"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of web/kit/PrettyTable.tsx.
|
// Port of web/kit/PrettyTable.tsx.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// RemoteFlash is the trigger/signal pair from createRemoteFlash: Fire() shows
|
// RemoteFlash is the trigger/signal pair from createRemoteFlash: Fire() shows
|
||||||
// the flash, Visible() reports whether it is currently shown, and Clear() hides
|
// the flash, Visible() reports whether it is currently shown, and Clear() hides
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
const sidebarNavRoot = "bg-surface rounded-default shadow-sm border border-line py-2"
|
const sidebarNavRoot = "bg-surface rounded-default shadow-sm border border-line py-2"
|
||||||
const sidebarNavList = "list-none m-0 p-0"
|
const sidebarNavList = "list-none m-0 p-0"
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of FormSignaturePad (jsruntime/uikit/Forms.tsx) — freehand signing.
|
// Port of FormSignaturePad (jsruntime/uikit/Forms.tsx) — freehand signing.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The pad's value IS the markup it shows — that is the whole reason it draws into an SVG
|
// The pad's value IS the markup it shows — that is the whole reason it draws into an SVG
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of web/kit/Tabs.tsx.
|
// Port of web/kit/Tabs.tsx.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Dark mode.
|
// Dark mode.
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of jsruntime/uikit/Toast.tsx.
|
// Port of jsruntime/uikit/Toast.tsx.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
// Port of web/kit/ToggleSwitch.tsx. Reactive accessors collapse to plain values.
|
// Port of web/kit/ToggleSwitch.tsx. Reactive accessors collapse to plain values.
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
// trigger lived inside, which yanked the trigger out from under the cursor.
|
// trigger lived inside, which yanked the trigger out from under the cursor.
|
||||||
package webui
|
package webui
|
||||||
|
|
||||||
import "kjol/vdom"
|
import "kjol/wasmruntime/vdom"
|
||||||
|
|
||||||
const tooltipCls = "bg-neutral-800 text-white text-sm px-2.5 py-1.5 rounded-default shadow-lg max-w-80 relative"
|
const tooltipCls = "bg-neutral-800 text-white text-sm px-2.5 py-1.5 rounded-default shadow-lg max-w-80 relative"
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Port of jsruntime/uikit/Tutorial.tsx — a guided tour: it dims the page, cuts a
|
// Port of jsruntime/uikit/Tutorial.tsx — a guided tour: it dims the page, cuts a
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
|
||||||
"kjol/wasmruntime"
|
"kjol/wasmruntime"
|
||||||
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── the albersUsa projection (ported from d3-geo; scale 1280, translate [480,300]) ──────
|
// ── the albersUsa projection (ported from d3-geo; scale 1280, translate [480,300]) ──────
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ package webui
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"kjol/vdom"
|
"kjol/wasmruntime/vdom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// cx joins non-empty class fragments with single spaces (a tiny clsx). Trailing
|
// cx joins non-empty class fragments with single spaces (a tiny clsx). Trailing
|
||||||
|
|||||||
Reference in New Issue
Block a user