@pritzlaff/nano-app 0.0.0-stage → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +66 -0
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/app/app.css +160 -0
- package/app/bundle/nano-ui.js +2554 -0
- package/app/examples/auth/example.auth.js +6 -0
- package/app/examples/auth/nano.json +46 -0
- package/app/examples/chat/example.chat.js +6 -0
- package/app/examples/chat/example.messaging.js +3 -0
- package/app/examples/chat/nano.json +115 -0
- package/app/examples/drift/example.drift.js +3 -0
- package/app/examples/drift/nano.json +31 -0
- package/app/examples/kv/example.kv.js +3 -0
- package/app/examples/nano.json +356 -0
- package/app/examples/originkey/_nano/bundle/nano-ui.js +212 -0
- package/app/examples/originkey/_nano/sandbox/boot.js +1 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-2gg2vg5g.js +2 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-5h5dssvv.js +3 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-72b5e6vd.js +17 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-87v2yejk.js +2 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-hm29e227.js +7 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-jtgk4ch8.js +2 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-mqaje7vc.js +2 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-mxgap7rs.js +2 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-qy0mwf7y.js +1 -0
- package/app/examples/originkey/_nano/shared/chunks/nano-core-wanb7xw1.js +1 -0
- package/app/examples/originkey/_nano/shared/lit-class-map.js +1 -0
- package/app/examples/originkey/_nano/shared/lit-decorators.js +1 -0
- package/app/examples/originkey/_nano/shared/lit-directive.js +1 -0
- package/app/examples/originkey/_nano/shared/lit-if-defined.js +1 -0
- package/app/examples/originkey/_nano/shared/lit-ref.js +1 -0
- package/app/examples/originkey/_nano/shared/lit-repeat.js +1 -0
- package/app/examples/originkey/_nano/shared/lit-style-map.js +1 -0
- package/app/examples/originkey/_nano/shared/lit.js +1 -0
- package/app/examples/originkey/_nano/shared/nano-core.js +1 -0
- package/app/examples/originkey/_nano/shared/nano-elements.js +280 -0
- package/app/examples/originkey/_nano/shared/typebox-value.js +1 -0
- package/app/examples/originkey/_nano/shared/typebox.js +1 -0
- package/app/examples/originkey/example.originkey.js +6 -0
- package/app/examples/originkey/frame.html +1 -0
- package/app/examples/originkey/nano.json +50 -0
- package/app/examples/raft/example.raft.js +30 -0
- package/app/examples/raft/nano.json +74 -0
- package/app/examples/slice/nano.json +63 -0
- package/app/examples/slice/shout.js +14 -0
- package/app/examples/template/acme.template.js +20 -0
- package/app/examples/template/index.js +241 -0
- package/app/examples/template/nano.json +35 -0
- package/app/examples/todo/example.todo.js +8 -0
- package/app/examples/todo/nano.json +77 -0
- package/app/examples/typing/nano.json +33 -0
- package/app/favicon.svg +1 -0
- package/app/index.html +152 -0
- package/app/main.js +15908 -0
- package/app/react/index.html +50 -0
- package/app/react/main.js +9 -0
- package/app/sandbox/boot.js +980 -0
- package/app/shared/chunks/nano-core-296y9rgd.js +4321 -0
- package/app/shared/chunks/nano-core-2zz7d74m.js +16 -0
- package/app/shared/chunks/nano-core-35ryhkm1.js +33 -0
- package/app/shared/chunks/nano-core-5a3r312d.js +866 -0
- package/app/shared/chunks/nano-core-89mtxedm.js +186 -0
- package/app/shared/chunks/nano-core-bf13r20v.js +77 -0
- package/app/shared/chunks/nano-core-g3414rnc.js +248 -0
- package/app/shared/chunks/nano-core-hyg0qdwg.js +547 -0
- package/app/shared/chunks/nano-core-sxgrxy03.js +53 -0
- package/app/shared/chunks/nano-core-wg5c961d.js +4564 -0
- package/app/shared/lit-class-map.js +60 -0
- package/app/shared/lit-decorators.js +228 -0
- package/app/shared/lit-directive.js +11 -0
- package/app/shared/lit-if-defined.js +10 -0
- package/app/shared/lit-ref.js +12 -0
- package/app/shared/lit-repeat.js +141 -0
- package/app/shared/lit-style-map.js +67 -0
- package/app/shared/lit.js +47 -0
- package/app/shared/nano-core.js +2516 -0
- package/app/shared/nano-elements.js +1178 -0
- package/app/shared/typebox-value.js +78 -0
- package/app/shared/typebox.js +580 -0
- package/app/shared/versions.json +6 -0
- package/bin/nano-app.ts +34 -0
- package/package.json +22 -4
- package/src/events.ts +11 -0
- package/src/serve.ts +68 -0
- package/src/watch.ts +27 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# AGENTS.md: developing a nano project with `nano-app`
|
|
2
|
+
|
|
3
|
+
For an agent (or a person) working in a project built from the nano template. Writing pods and views is covered by the
|
|
4
|
+
project's own `AGENTS.md` (the template's: https://github.com/aaronp/nano-template/blob/main/AGENTS.md); this file is
|
|
5
|
+
only the loop around it: try the project in the real nano app, and keep what you did.
|
|
6
|
+
|
|
7
|
+
## Install and the script
|
|
8
|
+
|
|
9
|
+
Already in the template (the devDependency and the script `"test-nano": "nano-app nano.json"`); otherwise
|
|
10
|
+
`bun add -d @pritzlaff/nano-app` and add the script. Then `bun run test-nano`. Bun only.
|
|
11
|
+
|
|
12
|
+
`nano-app <nano.json> [--out dist] [--build "bun run build"]` builds once, serves the nano app and the project folder
|
|
13
|
+
(then `dist/`) on `127.0.0.1`, and opens the page. `PORT` picks the port (default: any free one), `NO_OPEN=1` skips
|
|
14
|
+
the browser (use it when you can't see one). While it runs it rebuilds when `src/` changes. `--build` is a
|
|
15
|
+
space-separated argv: no shell, no quoting.
|
|
16
|
+
|
|
17
|
+
## The loop
|
|
18
|
+
|
|
19
|
+
1. Write a pod and its headless test (see the project's `AGENTS.md`).
|
|
20
|
+
2. `bun test`. Fix it before going on: the app is for what a test can't show.
|
|
21
|
+
3. `bun run test-nano`. The app opens the project's `nano.json` as its whole document: nothing from the browser's storage.
|
|
22
|
+
4. In the app: place the pods, wire them (pipes), call them, look at the views.
|
|
23
|
+
5. File › Save.
|
|
24
|
+
6. Commit the `nano.json` (and the source).
|
|
25
|
+
|
|
26
|
+
Edit `src/` while the page is open: after a successful build the page reloads. If the document has unsaved changes it
|
|
27
|
+
shows "Rebuilt — Reload (unsaved changes are lost)" with Reload and Later instead: Save first, then Reload. A failed
|
|
28
|
+
build leaves the page as it was; the first line of the error is a toast in the page and is printed in the terminal.
|
|
29
|
+
|
|
30
|
+
## What Save writes
|
|
31
|
+
|
|
32
|
+
File › Save writes the whole host document back to the `nano.json` you started with: pods, runtimes, pipes and the
|
|
33
|
+
Desk (panels and layout), as a download would. The module paths the file had (`modules`) are put back exactly as they
|
|
34
|
+
were, so a saved file still loads from where it did. Download and Save as still download a copy and leave the file alone. A module added in a session is saved with the local server's URL (`http://127.0.0.1:<port>/…`), which
|
|
35
|
+
won't load elsewhere: give it a relative path in `nano.json` (or edit it after saving).
|
|
36
|
+
|
|
37
|
+
The file is the truth: what the app shows is what the file says, and a change you want to keep is a change in the file.
|
|
38
|
+
Edit it by hand if that is easier; the app picks it up on the next reload (a hand edit does not trigger a
|
|
39
|
+
rebuild, only `src/` is watched; `dist/nano.json` updates on the next build). The server writes only that one file and
|
|
40
|
+
nothing else.
|
|
41
|
+
|
|
42
|
+
## Publishing
|
|
43
|
+
|
|
44
|
+
One-time setup: the repository's Settings → Pages → Source: "GitHub Actions". The template's `pages.yml` then publishes
|
|
45
|
+
`dist/` to GitHub Pages on every push to `main`, so the app's URL is
|
|
46
|
+
`https://<owner>.github.io/<repo>/nano.json`. Anyone opens it in the hosted app with
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
https://aaronp.github.io/nano/?src=<published nano.json>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The link is from another origin, so the app opens its Import dialog on that URL, Sandboxed preselected, and the
|
|
53
|
+
dialog is the approval: Import adds the app, Cancel imports nothing. Put the link in the project's README. Hosted Import preselects Sandboxed, so views run in frames there; `test-nano` opens
|
|
54
|
+
the file as it is (as the file says), so they may look and behave differently.
|
|
55
|
+
|
|
56
|
+
## Without the package
|
|
57
|
+
|
|
58
|
+
Anything that serves `dist/` with CORS `*` works: `bun run serve` (the template's own, port 4000). Open the hosted app
|
|
59
|
+
with `https://aaronp.github.io/nano/?src=http://localhost:4000/nano.json`. You get the import and its approval, but not
|
|
60
|
+
Save to the file or the reload on rebuild: download from the File menu and replace `nano.json` yourself. An https page fetching localhost may be blocked or
|
|
61
|
+
prompted by the browser (mixed content, local-network access); it depends on the browser.
|
|
62
|
+
|
|
63
|
+
## Done means
|
|
64
|
+
|
|
65
|
+
`bun test` passes; `bun run build` succeeds; the pods you added were placed, wired and called in `bun run test-nano` and
|
|
66
|
+
did what you meant; the Saved `nano.json` is committed and `git diff` shows only changes you intended.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aaron Pritzlaff
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @pritzlaff/nano-app
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`nano-app <nano.json> [--out dist] [--build "bun run build"]` serves the nano app and the file's project folder (then `--out`) on
|
|
4
|
+
`127.0.0.1`, opens the page, saves File › Save back to that one file, and rebuilds when `src/` changes (the page reloads or asks).
|
|
5
|
+
`PORT` picks the port, `NO_OPEN=1` skips the browser. Bun only. The server serves the whole project folder to the local machine (dotfiles included); the app's own folders (`shared/`, `examples/`, `bundle/`, `react/`, `sandbox/`) take precedence over same-named project paths. A project's script: `"test-nano": "nano-app nano.json"`.
|
|
6
|
+
|
|
7
|
+
`--build` is a space-separated argv: no shell, no quoting. The build also runs once at startup.
|
package/app/app.css
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* Page-level styles for content you put inside <app-route>. Every colour and font comes from the theme tokens. */
|
|
2
|
+
html, body { margin: 0; height: 100%; }
|
|
3
|
+
body { background: var(--bg); color: var(--fg); font-family: var(--font); background-image: var(--page-bg, none); background-size: 28px 28px; }
|
|
4
|
+
a { color: var(--accent); }
|
|
5
|
+
code { font-family: var(--mono); font-size: .92em; }
|
|
6
|
+
|
|
7
|
+
a[slot='nav'] svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
8
|
+
.drawer-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 14px 4px; color: var(--muted); font-size: 12px; }
|
|
9
|
+
.drawer-foot theme-picker { color: var(--fg); }
|
|
10
|
+
|
|
11
|
+
/* A workspace nav row: its link (and, saved pages, a drag handle for edit mode). */
|
|
12
|
+
.nav-row a { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
|
|
13
|
+
.nav-row a svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
14
|
+
.nav-row button { flex: none; width: 26px; height: 26px; border-radius: 6px; border: var(--card-border); background: var(--surface-2); color: var(--fg); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
|
|
15
|
+
.nav-row button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
|
16
|
+
a[slot='nav'][data-sub] svg { width: 16px; height: 16px; }
|
|
17
|
+
/* + (new page) and ✎ (edit mode) beside the app's title: shown while it is hovered or holds focus (they stay focusable). */
|
|
18
|
+
[slot='title'] button { width: 26px; height: 26px; margin-left: 6px; vertical-align: middle; border-radius: 6px; border: var(--card-border); background: var(--surface-2); color: var(--fg); font: 15px/1 var(--font); cursor: pointer; opacity: 0; }
|
|
19
|
+
[slot='title']:is(:hover, :focus-within) button, [slot='title'] [aria-pressed='true'] { opacity: 1; }
|
|
20
|
+
[slot='title'] [aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }
|
|
21
|
+
[slot='title'] button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
|
22
|
+
@media (hover: none) { [slot='title'] button { opacity: 1; } } /* touch: no hover to reveal them */
|
|
23
|
+
/* Edit mode: a saved row's handle, and the name and icon to click. */
|
|
24
|
+
.nav-row [data-handle] { display: none; border: 0; background: none; color: var(--muted); cursor: grab; }
|
|
25
|
+
app-shell[data-editing] .nav-row [data-handle] { display: block; }
|
|
26
|
+
app-shell[data-editing] .nav-row { gap: 4px; } /* the buttons sit close, so the name keeps room */
|
|
27
|
+
app-shell[data-editing] .nav-row > a { gap: 8px; margin-inline-start: 4px; }
|
|
28
|
+
app-shell[data-editing] .nav-row [data-handle] { width: 14px; padding: 0; }
|
|
29
|
+
app-shell[data-editing] .nav-row [data-toggle][hidden] { display: none; }
|
|
30
|
+
.nav-row [data-glyph] { display: flex; flex: none; }
|
|
31
|
+
.nav-row [data-name] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
32
|
+
app-shell[data-editing] .nav-row > a :is([data-name], [data-glyph]) { cursor: pointer; border-radius: 4px; outline: 1px dashed var(--line); outline-offset: 2px; }
|
|
33
|
+
app-shell[data-editing] .nav-row > a :is([data-name], [data-glyph]):focus-visible { outline: 2px solid var(--focus); }
|
|
34
|
+
.nav-row input[data-rename] { flex: 1; min-width: 0; font: inherit; padding: 2px 6px; border: var(--card-border); border-radius: 6px; background: var(--surface-2); color: var(--fg); }
|
|
35
|
+
/* The icon grid a row's icon opens in edit mode. */
|
|
36
|
+
.icon-pop { position: fixed; z-index: 50; display: grid; grid-template-columns: repeat(6, 40px); gap: 6px; max-height: 236px; overflow-y: auto; padding: 8px;
|
|
37
|
+
background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
|
|
38
|
+
.icon-pop button { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); color: var(--fg); cursor: pointer; }
|
|
39
|
+
.icon-pop button[aria-selected='true'] { border-color: var(--accent); color: var(--accent); }
|
|
40
|
+
.icon-pop button:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 1px; }
|
|
41
|
+
.icon-pop svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
42
|
+
/* The tree: a row indented by its level; a leaf's toggle keeps its space; Add child and Remove only in edit mode. */
|
|
43
|
+
.nav-row { padding-inline-start: calc(14px + var(--level, 0) * 16px); }
|
|
44
|
+
.nav-row[hidden] { display: none; }
|
|
45
|
+
.nav-row .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
46
|
+
.nav-row [data-toggle] { width: 18px; border: 0; background: none; color: var(--muted); }
|
|
47
|
+
.nav-row [data-toggle][hidden] { display: block; visibility: hidden; }
|
|
48
|
+
app-shell:not([data-editing]) .nav-row :is([data-add-child], [data-new-workspace], [data-remove]) { display: none; }
|
|
49
|
+
/* While a row's name is edited, its input takes the row: the row's buttons and icon step aside. */
|
|
50
|
+
.nav-row:has(input[data-rename]) :is(button, [data-glyph]) { display: none; }
|
|
51
|
+
/* The drawer as an icon rail: only the row's link icon shows. */
|
|
52
|
+
app-shell[collapsed]:not([narrow]) .nav-row button { display: none; }
|
|
53
|
+
app-shell[collapsed]:not([narrow]) .nav-row { padding-inline-start: 14px; }
|
|
54
|
+
|
|
55
|
+
/* A workspace page: the dock. */
|
|
56
|
+
.ws-page { display: flex; height: 100%; min-height: 0; }
|
|
57
|
+
.ws-page > c-wires { flex: 1; min-width: 0; }
|
|
58
|
+
|
|
59
|
+
/* <nano-picker>: the popover a + opens, to choose what fills that place (its width is picker.ts's WIDTH). */
|
|
60
|
+
nano-picker { position: fixed; z-index: 50; box-sizing: border-box; width: 280px; max-height: min(420px, 70vh); overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
|
|
61
|
+
padding: 12px; background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .18); font-size: 14px; }
|
|
62
|
+
nano-picker > .np-body { display: contents; }
|
|
63
|
+
.np-body { display: flex; flex-direction: column; gap: 10px; max-width: 720px; margin: 0 auto; }
|
|
64
|
+
.np-body [hidden] { display: none; }
|
|
65
|
+
.np-body .np-filter { box-sizing: border-box; width: 100%; font: inherit; padding: 6px 8px; border-radius: 6px; border: var(--card-border); background: var(--bg); color: var(--fg); }
|
|
66
|
+
.np-body .np-runtimes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
|
|
67
|
+
.np-body .np-runtimes button { font: inherit; padding: 2px 10px; border-radius: 999px; border: var(--card-border); background: none; color: var(--fg); cursor: pointer; }
|
|
68
|
+
.np-body .np-runtimes button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
|
|
69
|
+
.np-body .np-runtimes button:disabled { opacity: .4; cursor: default; }
|
|
70
|
+
.np-body > div:last-child { display: flex; flex-direction: column; gap: 10px; }
|
|
71
|
+
.np-body .np-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; }
|
|
72
|
+
.np-body h3 { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin: 6px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
|
|
73
|
+
.np-body h3 button { font: inherit; padding: 1px 6px; font-size: 11px; border-radius: 6px; border: var(--card-border); background: var(--surface-2); color: var(--fg); cursor: pointer; }
|
|
74
|
+
.np-body .np-section [data-widget] { font: inherit; text-align: left; padding: 10px; border: var(--card-border); border-radius: var(--radius); background: var(--surface); color: var(--fg); cursor: pointer; overflow-wrap: anywhere; }
|
|
75
|
+
.np-body .np-section [data-widget]:hover, .np-body .np-section [data-widget]:focus-visible { background: var(--surface-2); }
|
|
76
|
+
.np-body .np-impl { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; }
|
|
77
|
+
.np-body .np-impl > span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
|
|
78
|
+
.np-body .np-failed { grid-column: 1 / -1; margin: 4px 0 0; padding: 6px 10px; border-radius: var(--radius); background: var(--surface-2); color: var(--danger, #c33); font-size: 12px; overflow-wrap: anywhere; }
|
|
79
|
+
|
|
80
|
+
.page-head { margin-bottom: 20px; }
|
|
81
|
+
.page-head h1 { margin: 0 0 4px; font: 600 28px/1.15 var(--display); text-wrap: balance; }
|
|
82
|
+
.page-head p { margin: 0; color: var(--muted); max-width: 70ch; }
|
|
83
|
+
|
|
84
|
+
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
|
|
85
|
+
|
|
86
|
+
.panel { box-sizing: border-box; background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow);
|
|
87
|
+
padding: 16px 18px; margin-bottom: 18px; min-width: 0; }
|
|
88
|
+
.panel h2, .console h2 { margin: 0 0 10px; font: 600 16px/1.3 var(--display); }
|
|
89
|
+
|
|
90
|
+
.console { box-sizing: border-box; height: 100%; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line); }
|
|
91
|
+
.console h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
|
|
92
|
+
|
|
93
|
+
.btn { font: inherit; padding: 8px 14px; border-radius: var(--radius); border: var(--card-border); background: var(--surface-2); color: var(--fg); cursor: pointer; }
|
|
94
|
+
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
|
95
|
+
|
|
96
|
+
/* Sketch: dotted paper. Retro: the desktop shows through behind the content. */
|
|
97
|
+
html[data-theme='sketch'] body { background-image: radial-gradient(#d9d6cc 1px, transparent 1px); background-size: 22px 22px; }
|
|
98
|
+
html[data-theme='retro'] .page-head h1 { color: #FFFFFF; }
|
|
99
|
+
html[data-theme='retro'] .page-head p { color: #E3F2F2; }
|
|
100
|
+
html[data-theme='retro'] .page-head a { color: #FFFF9E; }
|
|
101
|
+
|
|
102
|
+
/* @composable components read --c-* tokens (with their own fallbacks); map them onto this starter's theme. */
|
|
103
|
+
:root {
|
|
104
|
+
--c-bg: var(--surface); --c-surface: var(--surface-2); --c-fg: var(--fg); --c-muted: var(--muted); --c-line: var(--line);
|
|
105
|
+
--c-accent: var(--accent); --c-accent-fg: var(--on-accent); --c-radius: var(--radius); --c-font: var(--font); --c-mono: var(--mono);
|
|
106
|
+
}
|
|
107
|
+
.composable { margin-bottom: 16px; }
|
|
108
|
+
.composable-row { margin-top: 16px; }
|
|
109
|
+
|
|
110
|
+
/* The Import dialog. */
|
|
111
|
+
.import-dialog { box-sizing: border-box; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border: var(--card-border); border-radius: var(--radius);
|
|
112
|
+
background: var(--surface); color: var(--fg); font: 14px var(--font); box-shadow: 0 24px 64px rgba(0, 0, 0, .35); }
|
|
113
|
+
.import-dialog::backdrop { background: rgba(0, 0, 0, .45); }
|
|
114
|
+
.import-dialog > * + * { margin-top: 16px; }
|
|
115
|
+
.import-dialog .head { display: flex; align-items: center; justify-content: space-between; }
|
|
116
|
+
.import-dialog h2 { margin: 0; font: 600 20px var(--display); }
|
|
117
|
+
.import-dialog h3 { margin: 12px 0 4px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
|
|
118
|
+
.import-dialog .field { display: block; margin: 0 0 6px; padding: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
|
|
119
|
+
.import-dialog .row { display: flex; gap: 8px; }
|
|
120
|
+
.import-dialog input:not([type]), .import-dialog input[type='url'], .import-dialog .pods input, .import-dialog li > input:not([type='checkbox']) { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: var(--card-border); border-radius: var(--radius); background: var(--surface-2); color: var(--fg); }
|
|
121
|
+
.import-dialog input[type='url'] { font-family: var(--mono, ui-monospace, monospace); }
|
|
122
|
+
.import-dialog button { font: inherit; font-weight: 600; padding: 8px 14px; border: var(--card-border); border-radius: var(--radius); background: var(--surface-2); color: var(--fg); cursor: pointer; }
|
|
123
|
+
.import-dialog button.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
|
|
124
|
+
.import-dialog button.icon { padding: 4px 8px; border: 0; background: none; font-size: 22px; line-height: 1; }
|
|
125
|
+
.import-dialog button:disabled { opacity: .5; cursor: not-allowed; }
|
|
126
|
+
.import-dialog .drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; min-height: 120px; padding: 20px;
|
|
127
|
+
border: 2px dashed color-mix(in srgb, var(--fg) 25%, transparent); border-radius: var(--radius); color: var(--muted); text-align: center; }
|
|
128
|
+
.import-dialog .drop.on { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
|
|
129
|
+
.import-dialog fieldset.trust { margin: 16px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
|
|
130
|
+
.import-dialog fieldset.trust legend { float: left; grid-column: 1 / -1; }
|
|
131
|
+
.import-dialog .trust label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: var(--card-border); border-radius: var(--radius); cursor: pointer; }
|
|
132
|
+
.import-dialog .trust label:has(:checked) { border-color: var(--accent); background: var(--accent-soft); }
|
|
133
|
+
.import-dialog .trust input { margin-top: 3px; accent-color: var(--accent); }
|
|
134
|
+
.import-dialog .trust span { display: flex; flex-direction: column; } .import-dialog .trust small { color: var(--muted); }
|
|
135
|
+
.import-dialog ul { margin: 0; padding-left: 18px; } .import-dialog li { margin: 4px 0; }
|
|
136
|
+
.import-dialog .preview ul { list-style: none; padding-left: 24px; } .import-dialog .preview > div > ul { padding-left: 0; }
|
|
137
|
+
.import-dialog .ops { margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); }
|
|
138
|
+
.import-dialog .group { margin-top: 8px; } .import-dialog .group > ul { padding-left: 24px; }
|
|
139
|
+
.import-dialog .runtime > input[data-runtime] { width: 60%; padding: 2px 6px; }
|
|
140
|
+
.import-dialog .edit { visibility: hidden; margin-left: 4px; padding: 0 6px !important; border: 0 !important; background: none !important; }
|
|
141
|
+
.import-dialog .runtime:hover > .edit, .import-dialog .edit:focus-visible { visibility: visible; }
|
|
142
|
+
.import-dialog .badge { font-size: 11px; color: var(--muted); }
|
|
143
|
+
.import-dialog .foreign p { margin: 0; font-size: 13px; color: var(--muted); } .import-dialog .foreign strong { color: var(--fg); }
|
|
144
|
+
.import-dialog details { font-size: 12px; color: var(--muted); } .import-dialog summary { cursor: pointer; }
|
|
145
|
+
.import-dialog .warning { margin: 2px 0 0 24px; font-size: 12px; color: var(--warn, #d9a400); }
|
|
146
|
+
.import-dialog [role='alert'] { min-height: 1em; margin-top: 8px; color: var(--danger, #c33); }
|
|
147
|
+
.import-dialog [role='alert']:empty { display: none; }
|
|
148
|
+
.import-dialog .preview:empty { display: none; }
|
|
149
|
+
.import-dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
|
|
150
|
+
|
|
151
|
+
/* Dragging a saved workspace: a line where it will land. */
|
|
152
|
+
.nav-row[data-drop='before'] { box-shadow: 0 -2px 0 var(--nano-accent, var(--focus, #36c)); }
|
|
153
|
+
.nav-row[data-drop='after'] { box-shadow: 0 2px 0 var(--nano-accent, var(--focus, #36c)); }
|
|
154
|
+
.nav-row[data-drop='inside'] { outline: 2px solid var(--nano-accent, var(--focus, #36c)); outline-offset: -2px; }
|
|
155
|
+
.wiring-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
|
|
156
|
+
.wiring-page > c-desk, .wiring-page > c-messages, .wiring-page > nano-ring { flex: 1; min-height: 0; }
|
|
157
|
+
.wiring-page > c-messages { overflow: auto; }
|
|
158
|
+
.wiring-views { display: flex; gap: 4px; padding: 8px 12px; }
|
|
159
|
+
.wiring-views a { padding: 4px 12px; border-radius: 999px; color: inherit; text-decoration: none; }
|
|
160
|
+
.wiring-views a[aria-current="page"] { background: var(--accent, #3b82f6); color: #fff; }
|