@pritzlaff/nano-ui 0.0.0-stage → 0.4.0
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/LICENSE +21 -0
- package/README.md +13 -2
- package/explorer.d.ts +36 -0
- package/index.d.ts +18 -0
- package/index.js +958 -0
- package/index.js.map +30 -0
- package/interfaces.d.ts +113 -0
- package/layout.d.ts +31 -0
- package/package.json +29 -4
- package/pods/debounce.d.ts +3 -0
- package/pods/input.d.ts +2 -0
- package/pods/log.d.ts +3 -0
- package/pods/map.d.ts +3 -0
- package/provider.d.ts +1 -0
- package/views/define.d.ts +3 -0
- package/views/faces.d.ts +29 -0
- package/views/pod-view.d.ts +10 -0
- package/views/view.d.ts +60 -0
- package/wiring/constants.d.ts +15 -0
- package/wiring/layout.d.ts +49 -0
- package/wiring/model.d.ts +3 -0
- package/wiring/render-drawer.d.ts +16 -0
- package/wiring/render-pills.d.ts +2 -0
- package/wiring/render-stage.d.ts +2 -0
- package/wiring/styles.d.ts +1 -0
- package/wiring/types.d.ts +68 -0
- package/wiring/wiring.d.ts +69 -0
package/index.js.map
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/provider.ts", "../src/pods/debounce.ts", "../src/interfaces.ts", "../src/pods/input.ts", "../src/pods/log.ts", "../src/pods/map.ts", "../src/views/faces.ts", "../src/views/view.ts", "../src/explorer.ts", "../src/wiring/wiring.ts", "../src/wiring/constants.ts", "../src/wiring/layout.ts", "../src/wiring/types.ts", "../src/wiring/model.ts", "../src/wiring/render-pills.ts", "../src/wiring/render-stage.ts", "../src/wiring/render-drawer.ts", "../src/wiring/styles.ts", "../src/views/pod-view.ts", "../src/views/define.ts", "../src/index.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { Coord } from '@pritzlaff/nano-core'\nimport { debounce } from './pods/debounce.ts'\nimport { input } from './pods/input.ts'\nimport { log } from './pods/log.ts'\nimport { map } from './pods/map.ts'\n\nconst ns = Coord.namespace('nano.ui')\n\nexport const uiProvider = ns.provider([input, debounce, map, log])\n",
|
|
6
|
+
"import { Type } from 'typebox'\nimport { Coord, Schema, Implementation, provide, success } from '@pritzlaff/nano-core'\nimport { Debounce } from '../interfaces.ts'\n\nconst ns = Coord.namespace('nano.ui')\n\n/** `push` returns at once; after `quietMs` without a push, the last value is published as `flushed`. */\nexport const debounce = Implementation.define(ns.implementationId('debounce'), {\n provides: [Debounce],\n config: Schema.define(Type.Union([Type.Object({ quietMs: Type.Integer({ minimum: 0, maximum: 60000 }) }), Type.Undefined()]), 'DebounceConfig'),\n make: (ctx, config?: { quietMs: number }) => {\n const quietMs = config?.quietMs ?? 300\n let timer: ReturnType<typeof setTimeout> | undefined\n let closed = false\n ctx.addOnCloseListener(() => { closed = true; clearTimeout(timer) })\n return [provide(Debounce, {\n push: async value => {\n if (closed) return success(null)\n clearTimeout(timer)\n timer = setTimeout(() => { void ctx.publish(Debounce.ops.flushed, value) }, quietMs)\n return success(null)\n },\n })]\n },\n})\n",
|
|
7
|
+
"/**\n * The nano.ui contracts. Inputs are `Any` so a pipe from any event or result fits.\n *\n * port(Input, Input.ops.submit) // pipe source: what was submitted\n */\nimport { Type } from 'typebox'\nimport { Coord, Schema, Op } from '@pritzlaff/nano-core'\n\nconst ns = Coord.namespace('nano.ui')\n\nexport const Any = Schema.define(Type.Unknown(), 'Any')\nexport const Nothing = Schema.define(Type.Null(), 'Nothing')\nconst Entries = Schema.define(Type.Array(Type.Unknown()), 'Entries')\nconst Text = Schema.define(Type.String(), 'Text')\nconst Approval = Schema.define(Type.Object({ title: Type.String(), detail: Type.Optional(Type.String()) }), 'Approval')\nconst Approved = Schema.define(Type.Boolean(), 'Approved')\n\n/** Returns its input, so its result can be piped. */\nexport const Input = ns.interface('Input', { submit: Op.action(Any, Any) })\nexport const Debounce = ns.interface('Debounce', { push: Op.action(Any, Nothing), flushed: Op.event(Any) })\nexport const MapIface = ns.interface('Map', { map: Op.action(Any, Any) })\nexport const Log = ns.interface('Log', {\n log: Op.action(Any, Nothing),\n entries: Op.action(Nothing, Entries),\n clear: Op.action(Nothing, Nothing),\n})\n/** What the host offers a pod; implemented by the host, not here. */\nexport const HostUI = ns.interface('HostUI', {\n alert: Op.action(Text, Nothing),\n approve: Op.action(Approval, Approved),\n setAppBar: Op.action(Text, Nothing),\n})\n",
|
|
8
|
+
"import { Coord, Implementation, provide, success } from '@pritzlaff/nano-core'\nimport { Input } from '../interfaces.ts'\n\nconst ns = Coord.namespace('nano.ui')\n\nexport const input = Implementation.define(ns.implementationId('input'), {\n provides: [Input],\n make: () => [provide(Input, { submit: async v => success(v) })],\n})\n",
|
|
9
|
+
"import { Type } from 'typebox'\nimport { Coord, Schema, Implementation, provide, success } from '@pritzlaff/nano-core'\nimport { Log } from '../interfaces.ts'\n\nconst ns = Coord.namespace('nano.ui')\n\n/** Keeps the newest `max` entries (default 100). */\nexport const log = Implementation.define(ns.implementationId('log'), {\n provides: [Log],\n config: Schema.define(Type.Union([Type.Object({ max: Type.Optional(Type.Integer({ minimum: 1, maximum: 1000 })) }), Type.Undefined()]), 'LogConfig'),\n make: (_ctx, config?: { max?: number }) => {\n const max = config?.max ?? 100\n let entries: unknown[] = []\n return [provide(Log, {\n log: async v => { entries = [...entries, v].slice(-max); return success(null) },\n entries: async () => success([...entries]),\n clear: async () => { entries = []; return success(null) },\n })]\n },\n})\n",
|
|
10
|
+
"import { Type } from 'typebox'\nimport { Coord, Schema, Implementation, provide, success } from '@pritzlaff/nano-core'\nimport { MapIface } from '../interfaces.ts'\n\nconst ns = Coord.namespace('nano.ui')\n\n/** `code` is a function body over `x`. A body that does not parse makes `make` throw, so each call fails with `threw`. */\nexport const map = Implementation.define(ns.implementationId('map'), {\n provides: [MapIface],\n config: Schema.define(Type.Object({ code: Type.String() }), 'MapConfig'),\n make: (_ctx, config: { code: string }) => {\n const fn = new Function('x', config.code) as (x: unknown) => unknown\n return [provide(MapIface, { map: async x => success(fn(x)) })]\n },\n})\n",
|
|
11
|
+
"/**\n * The nano.ui pods' own views: `nano-input` (a field; Enter submits), `nano-debounce` (pending, a flash on flushed),\n * `nano-map` (its code and last output) and `nano-log` (its entries).\n */\nimport { css, html } from 'lit'\nimport { port, type AppEvent, type NanoResult } from '@pritzlaff/nano-core'\nimport { base, t } from '@pritzlaff/nano-elements'\nimport { Debounce, Log, MapIface } from '../interfaces.ts'\nimport { shown, ViewElement, type ViewTarget } from './view.ts'\n\nexport class NanoInput extends ViewElement {\n private async enter(e: KeyboardEvent, tg: ViewTarget) {\n if (e.key !== 'Enter') return\n const box = e.target as HTMLInputElement\n await this.pod(tg).submit(box.value)\n }\n protected face(tg: ViewTarget) {\n return html`<input type=\"text\" aria-label=${tg.pod} @keydown=${(e: KeyboardEvent) => this.enter(e, tg)}>`\n }\n}\n\nconst PUSH = port(Debounce, Debounce.ops.push)\n\nexport class NanoDebounce extends ViewElement {\n static styles = [base, css`.flash { color: ${t('accent')} }`]\n private pending = false\n private flash = false\n private timer?: ReturnType<typeof setTimeout>\n\n protected hear(e: AppEvent, tg: ViewTarget) {\n if (e.type !== 'sent') return\n if (e.to === tg.pod && e.port === PUSH) this.pending = true\n else if (e.from === tg.pod) {\n this.pending = false\n this.flash = true\n clearTimeout(this.timer)\n this.timer = setTimeout(() => { this.flash = false; this.requestUpdate() }, 300)\n } else return\n this.requestUpdate()\n }\n disconnectedCallback() { super.disconnectedCallback(); clearTimeout(this.timer) }\n protected face() {\n return html`<span class=${this.flash ? 'badge accent flash' : 'badge'}>${this.flash ? 'flushed' : this.pending ? 'pending' : 'idle'}</span>`\n }\n}\n\nconst MAP = port(MapIface, MapIface.ops.map)\n\nexport class NanoMap extends ViewElement {\n private mine = new Set<string>()\n private output?: NanoResult<unknown>\n\n protected hear(e: AppEvent, tg: ViewTarget) {\n if (e.type === 'sent' && e.to === tg.pod && e.port === MAP) this.mine.add(e.id)\n else if (e.type === 'denied') this.mine.delete(e.id)\n else if (e.type === 'delivered' && this.mine.delete(e.id)) { this.output = e.result; this.requestUpdate() }\n }\n protected face(tg: ViewTarget) {\n const code = (tg.app.deployment().pods[tg.pod]?.config as { code?: string } | undefined)?.code ?? ''\n return html`<pre class=\"code\">${code}</pre><div>out ${shown(this.output)}</div>`\n }\n}\n\nconst LOG = port(Log, Log.ops.log)\n\nexport class NanoLog extends ViewElement {\n private entries: unknown[] = []\n private logs = new Set<string>()\n\n protected started(tg: ViewTarget) { void this.read(tg) }\n private async read(tg: ViewTarget) {\n const r = await this.pod(tg).entries(null)\n if (r.ok) { this.entries = r.value as unknown[]; this.requestUpdate() }\n }\n protected hear(e: AppEvent, tg: ViewTarget) {\n if (e.type === 'sent' && e.to === tg.pod && e.port === LOG) this.logs.add(e.id)\n else if (e.type === 'denied') this.logs.delete(e.id)\n else if (e.type === 'delivered' && this.logs.delete(e.id)) void this.read(tg)\n }\n protected face() {\n return html`<ol>${this.entries.map(x => html`<li>${typeof x === 'string' ? x : JSON.stringify(x)}</li>`)}</ol>`\n }\n}\n",
|
|
12
|
+
"/**\n * The view contract: a view is a custom element over one pod, with a `target: ViewTarget` property. It reaches its pod\n * only through `target.app.call(target.runtime, target.pod)` and `target.app.listen`. `viewFor` picks the tag.\n *\n * viewFor('up', { ...app.deployment(), views }, defaults) // the selector, else the default, else 'nano-pod-view'\n */\nimport { LitElement, html } from 'lit'\nimport type { AppDeployment, AppEvent, Application, Registry } from '@pritzlaff/nano-core'\nimport { base } from '@pritzlaff/nano-elements'\n\nexport type ViewTarget = { app: Application; registry: Registry; runtime: string; pod: string }\n/** An implementation coordinate → a custom-element tag. */\nexport type ViewMap = Record<string, string>\n\nconst defined = (tag: string | undefined) => (tag && customElements.get(tag) ? tag : undefined)\n\nexport function viewFor(pod: string, deployment: AppDeployment, defaults: ViewMap): string {\n const impl = deployment.pods[pod]?.implementation\n return defined(deployment.views?.[pod]) ?? defined(impl === undefined ? undefined : defaults[impl]) ?? 'nano-pod-view'\n}\n\n/**\n * What every view here shares: listening while connected and its pod is placed; \"removed\" once an `applied` removes it.\n * Not exported from the package: a view is any element with `target`, this is only how these ones are made.\n */\nexport class ViewElement extends LitElement {\n static properties = { target: { attribute: false }, removed: { state: true } }\n static styles = [base]\n declare target?: ViewTarget\n declare removed: boolean\n private off?: () => void\n private watching?: ViewTarget\n\n constructor() { super(); this.removed = false }\n connectedCallback() { super.connectedCallback(); this.watch() }\n disconnectedCallback() { super.disconnectedCallback(); this.stop() }\n willUpdate(changed: Map<string, unknown>) { if (changed.has('target')) { this.removed = false; this.watch() } }\n\n private watch() {\n const t = this.target\n if (!t || !this.isConnected || this.removed || this.watching === t) return\n this.stop()\n this.watching = t\n this.off = t.app.listen(e => {\n if (e.type === 'applied' && e.removed.includes(t.pod)) { this.removed = true; this.stop(); return }\n if (e.type === 'applied') this.requestUpdate() // config and placement are read from the deployment at render\n this.hear(e, t)\n })\n this.started(t)\n }\n private stop() { this.off?.(); this.off = undefined; this.watching = undefined }\n\n /** The pod's client. */\n protected pod(t: ViewTarget) { return t.app.call(t.runtime, t.pod) }\n /** Called once listening starts. */\n protected started(_t: ViewTarget) {}\n /** Every event while listening. */\n protected hear(_e: AppEvent, _t: ViewTarget) {}\n protected face(_t: ViewTarget): unknown { return html`` }\n\n render() {\n if (this.removed) return html`<div class=\"muted\">removed</div>`\n return this.target ? this.face(this.target) : html``\n }\n}\n\n/** A result's value, shown. */\nexport const shown = (r: { ok: boolean; value?: unknown; fail?: { reason: string } } | undefined) =>\n r === undefined ? '—' : r.ok ? JSON.stringify(r.value) : `failed: ${r.fail?.reason}`\n",
|
|
13
|
+
"/**\n * `<nano-explorer>`: the application → its runtimes → their pods (implementation, config, state) → the subscriptions\n * there. Choosing a pod, or a \"built on\" row, fires `nano-open` with `{ runtime, pod }`.\n */\nimport { LitElement, html } from 'lit'\nimport type { Application, Registry } from '@pritzlaff/nano-core'\nimport { base, type TreeNode } from '@pritzlaff/nano-elements'\nimport '@pritzlaff/nano-elements'\n\ntype ExplorerTarget = { app: Application; registry: Registry }\n\nconst op = (port: string) => port.slice(port.lastIndexOf('/') + 1)\n\nexport class NanoExplorer extends LitElement {\n static properties = { target: { attribute: false }, states: { state: true } }\n static styles = [base]\n declare target?: ExplorerTarget\n declare states: Record<string, string>\n private off?: () => void\n private watching?: ExplorerTarget\n private opens = new Map<string, { runtime: string; pod: string }>()\n\n constructor() { super(); this.states = {} }\n connectedCallback() { super.connectedCallback(); this.watch() }\n disconnectedCallback() { super.disconnectedCallback(); this.stop() }\n willUpdate(changed: Map<string, unknown>) { if (changed.has('target')) this.watch() }\n\n private watch() {\n const t = this.target\n if (!t || !this.isConnected || this.watching === t) return\n this.stop()\n this.watching = t\n this.off = t.app.listen(e => {\n if (e.type === 'built' || e.type === 'closed') this.states = { ...this.states, [e.pod]: e.type }\n else if (e.type === 'applied') {\n const live = t.app.deployment().pods // built/closed events already keep changed and removed pods right\n this.states = Object.fromEntries(Object.entries(this.states).filter(([pod]) => Object.hasOwn(live, pod)))\n }\n })\n }\n private stop() { this.off?.(); this.off = undefined; this.watching = undefined }\n\n private nodes(t: ExplorerTarget): TreeNode[] {\n const d = t.app.deployment()\n this.opens.clear()\n return Object.entries(d.runtimes).map(([runtime, r]) => ({\n id: `r:${runtime}`, label: runtime, kind: 'runtime', count: r.pods.length,\n children: r.pods.map(pod => {\n const p = d.pods[pod], id = `p:${runtime}:${pod}`\n this.opens.set(id, { runtime, pod })\n const subs: TreeNode[] = r.subscriptions.filter(s => s.from === pod).map((s, i) => {\n const sid = `s:${runtime}:${pod}:${i}`\n if (s.kind === 'call') { this.opens.set(sid, { runtime, pod: s.to }); return { id: sid, label: `built on → ${s.to}` } }\n return { id: sid, label: `${op(s.source)} → ${s.to}.${op(s.target)}` }\n })\n return { id, label: pod, kind: 'pod', badge: this.states[pod], terms: [p?.implementation ?? ''],\n body: html`${p?.implementation} ${p?.config === undefined ? '' : JSON.stringify(p.config)}`, children: subs }\n }),\n }))\n }\n\n render() {\n if (!this.target) return html``\n return html`<nano-tree .nodes=${this.nodes(this.target)} open-depth=\"2\" @select=${(e: CustomEvent<{ id: string }>) => {\n const open = this.opens.get(e.detail.id)\n if (open) this.dispatchEvent(new CustomEvent('nano-open', { detail: open, bubbles: true, composed: true }))\n }}></nano-tree>`\n }\n}\n",
|
|
14
|
+
"/**\n * `<nano-wiring>`: the app as a tilted stack of runtime layers (their pods, pads and cables) and a side area for pods\n * placed in more than one runtime. Read-only. It rebuilds on `applied` and lights a cable for 600ms when it carries a message.\n */\nimport { LitElement } from 'lit'\nimport type { Application, Registry } from '@pritzlaff/nano-core'\nimport { MARGIN, ZOOM_MAX, ZOOM_MIN } from './constants'\nimport { frameId, layout, posKey, type Layout, type Rect } from './layout'\nimport { circuitOf } from './model'\nimport { renderPills } from './render-pills'\nimport { renderStage } from './render-stage'\nimport { styles } from './styles'\nimport type { Circuit } from './types'\n\ntype Target = { app: Application; registry: Registry }\n/** The view: focused layer, zoom, pan, and what is selected (`pad:`, `cable:` or `fp:` + id). */\nexport interface State { focus: string | null; zoom: number; panX: number; panY: number; sel: string | null }\nconst clamp = (z: number) => Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, z))\n\nexport class NanoWiring extends LitElement {\n static properties = { target: { attribute: false } }\n static styles = styles\n declare target?: Target\n s: State = { focus: null, zoom: 1, panX: 0, panY: 0, sel: null }\n model: Circuit = { layers: [], side: [], cables: [] }\n geo: Layout = layout(this.model)\n dragging = false\n private off?: () => void\n private watching?: Target\n private fitted = false\n private drag: { x: number; y: number } | null = null\n private lit = new Map<string, ReturnType<typeof setTimeout>>()\n\n constructor() { super(); this.addEventListener('keydown', e => this.key(e)) }\n connectedCallback() { super.connectedCallback(); this.watch() }\n disconnectedCallback() { super.disconnectedCallback(); this.stop() }\n willUpdate(changed: Map<string, unknown>) { if (changed.has('target')) this.watch() }\n render() { return [renderPills(this), renderStage(this)] }\n\n private watch() {\n const t = this.target\n if (!t || !this.isConnected || this.watching === t) return\n this.stop()\n this.watching = t\n this.off = t.app.listen(e => {\n if (e.type === 'applied') this.load(t)\n else if (e.type === 'sent') this.light(e.kind === 'call' ? `${e.runtime}|${e.from}|${e.to}|call|` : `${e.runtime}|${e.from}|${e.to}|${e.port}|`)\n })\n this.load(t)\n }\n private stop() { this.off?.(); this.off = undefined; this.watching = undefined; this.lit.forEach(clearTimeout); this.lit.clear() }\n private load(t: Target) {\n this.model = circuitOf(t.app.deployment(), t.registry)\n this.geo = layout(this.model)\n if (!this.model.layers.some(l => l.screen === this.s.focus)) this.s = { ...this.s, focus: this.model.layers[0]?.screen ?? null }\n if (!this.fitted && this.s.focus !== null) { this.fitted = true; this.fitPage(this.s.focus) }\n this.requestUpdate()\n }\n /** A cable is lit by prefix: its id starts with `runtime|from|to|port|` (a pipe's target port) or `...|call|`. */\n private light(prefix: string) {\n clearTimeout(this.lit.get(prefix))\n this.lit.set(prefix, setTimeout(() => { this.lit.delete(prefix); this.requestUpdate() }, 600))\n this.requestUpdate()\n }\n isLit(id: string) { return [...this.lit.keys()].some(p => id.startsWith(p)) }\n\n reduced() { return globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false }\n stageSize() { const st = this.renderRoot.querySelector<HTMLElement>('.stage'); return { w: st?.clientWidth || 1000, h: st?.clientHeight || 600 } }\n fitRect(r: Rect) {\n const { w, h } = this.stageSize(), zoom = clamp(Math.min(w / (r.w + 2 * MARGIN), h / (r.h + 2 * MARGIN)))\n this.s = { ...this.s, zoom, panX: -(r.x + r.w / 2) * zoom, panY: -(r.y + r.h / 2) * zoom }\n this.requestUpdate()\n }\n fitPage(id: string) { const i = this.model.layers.findIndex(l => l.screen === id); if (i >= 0) this.fitRect(this.geo.pageRect(i)) }\n fitAll() { this.fitRect(this.geo.bounds) }\n go(id: string) { this.s = { ...this.s, focus: id }; this.fitPage(id) }\n move(by: number) {\n const ls = this.model.layers, i = ls.findIndex(l => l.screen === this.s.focus), j = Math.min(ls.length - 1, Math.max(0, i + by))\n if (ls[j]) this.go(ls[j]!.screen)\n }\n key(e: KeyboardEvent) {\n if (e.key === 'ArrowRight' || e.key === 'PageDown') this.move(1)\n else if (e.key === 'ArrowLeft' || e.key === 'PageUp') this.move(-1)\n else if (e.key === 'Escape' && this.s.sel) { this.select(null); this.refocus() }\n else return\n e.preventDefault()\n }\n refocus() { this.renderRoot.querySelector<HTMLElement>('.stage')?.focus() }\n select(sel: string | null) { this.s = { ...this.s, sel }; this.requestUpdate() }\n /** Pans to the other end of the selected pad's (or cable's) cable, focusing its layer if it has one. */\n follow() {\n const m = this.model, { sel } = this.s\n if (!sel) return\n const [what, ...rest] = sel.split(':'), id = rest.join(':')\n const cable = what === 'cable' ? m.cables.find(c => c.id === id) : m.cables.find(c => c.from.pad === id || c.to.pad === id)\n if (!cable) return\n const end = what === 'pad' && cable.from.pad === id ? cable.to : what === 'pad' ? cable.from : cable.to\n const p = this.geo.pos.get(posKey(frameId(end.at), end.pad))\n if (!p) return\n this.s = { ...this.s, sel: `pad:${end.pad}`, ...('layer' in end.at && { focus: end.at.layer }), panX: -p.x * this.s.zoom, panY: -p.y * this.s.zoom }; this.requestUpdate()\n }\n wheel(e: WheelEvent) { e.preventDefault(); this.s = { ...this.s, zoom: clamp(this.s.zoom * Math.exp(-e.deltaY * (e.ctrlKey ? 0.01 : 0.002))) }; this.requestUpdate() }\n dragStart(e: PointerEvent) {\n if ((e.target as Element).closest('button, input, aside, g[data-cable-hit]')) return\n this.drag = { x: e.clientX, y: e.clientY }; this.dragging = true\n const move = (m: PointerEvent) => {\n if (!this.drag) return\n this.s = { ...this.s, panX: this.s.panX + m.clientX - this.drag.x, panY: this.s.panY + m.clientY - this.drag.y }\n this.drag = { x: m.clientX, y: m.clientY }; this.requestUpdate()\n }\n const up = () => { this.drag = null; this.dragging = false; window.removeEventListener('pointermove', move); window.removeEventListener('pointerup', up); window.removeEventListener('pointercancel', up); this.requestUpdate() }\n window.addEventListener('pointermove', move); window.addEventListener('pointerup', up); window.addEventListener('pointercancel', up)\n }\n /** Centres the view on the world point clicked in the minimap. */\n panFromMinimap(e: MouseEvent) {\n const el = e.currentTarget as SVGSVGElement, r = el.getBoundingClientRect(), b = this.geo.bounds\n if (!r.width || !r.height) return\n const k = Math.max((b.w + 2 * MARGIN) / r.width, (b.h + 2 * MARGIN) / r.height)\n const wx = b.x + b.w / 2 + (e.clientX - r.left - r.width / 2) * k, wy = b.y + b.h / 2 + (e.clientY - r.top - r.height / 2) * k\n this.s = { ...this.s, panX: -wx * this.s.zoom, panY: -wy * this.s.zoom }; this.requestUpdate()\n }\n}\n",
|
|
15
|
+
"// The circuit view's look: pad colours and glyphs, page and pad geometry, tilt and fade.\nimport type { PadType } from './types'\n\nexport const TYPE_COLOR: Record<PadType, string> = { string: '#2dd4bf', number: '#fbbf24', boolean: '#f472b6', object: '#60a5fa', array: '#a78bfa', signal: '#94a3b8', any: '#e5e7eb', call: '#4CC2FF' }\nexport const TYPE_GLYPH: Record<PadType, string> = { string: 'Aa', number: '#', boolean: '?', object: '{}', array: '[]', signal: '•', any: '*', call: '↦' }\nexport const TYPE_NAME: Record<PadType, string> = { string: 'String', number: 'Number', boolean: 'Boolean', object: 'Object', array: 'Array', signal: 'Signal', any: 'Any', call: 'Call' }\n\n/** A page, in world px; page i sits at x = i·XSTEP, so the stack fans out to the right. */\nexport const PW = 720, PH = 440, XSTEP = 140\n/** How far back a layer sits per page of distance from the focus. */\nexport const ZGAP = 160\nexport const TILT = 'rotateX(32deg) rotateY(-14deg)'\nexport const FADE_MIN = 0.15, FADE_STEP = 0.35, DIM_CABLE = 0.18\nexport const fade = (d: number) => Math.max(FADE_MIN, 1 - FADE_STEP * Math.abs(d))\n\nexport const PAD = 24, PAD_STEP = 30, HEAD = 34\nexport const SIDE_W = 280, SIDE_GAP = 140, BLOCK_HEAD = 30, BLOCK_GAP = 28, ITEM_GAP = 12\nexport const ZOOM_MIN = 0.3, ZOOM_MAX = 2.5\nexport const MARGIN = 60\n\n",
|
|
16
|
+
"// Where everything sits, in world px. Pure: boxes and pads per layer and per system block, and every pad's world position.\nimport type { Circuit, Footprint, Layer, Pad, SideItem, SystemBlock } from './types'\nimport { BLOCK_GAP, BLOCK_HEAD, HEAD, ITEM_GAP, PAD, PAD_STEP, PH, PW, SIDE_GAP, SIDE_W, XSTEP } from './constants'\n\nexport type Rect = { x: number; y: number; w: number; h: number }\nexport type Pt = { x: number; y: number }\nexport type PlacedPad = { pad: Pad; x: number; y: number }\n/** One box: a footprint or a side item. Positions are local to its frame. */\nexport type PlacedBox = { item: Footprint | SideItem; rect: Rect; pads: PlacedPad[] }\nexport type Frame = { id: string; origin: Pt; rect: Rect; boxes: PlacedBox[] }\nexport type LayerFrame = Frame & { layer: Layer; index: number }\nexport type BlockFrame = Frame & { block: SystemBlock }\nexport type Layout = { layers: LayerFrame[]; blocks: BlockFrame[]; pos: Map<string, Pt>; bounds: Rect; pageRect(i: number): Rect }\n\nexport const frameId = (at: { layer: string } | { side: string }) => 'layer' in at ? `l:${at.layer}` : `s:${at.side}`\nexport const posKey = (frame: string, pad: string) => `${frame}|${pad}`\n\nconst slots = (pads: Pad[], r: Rect): PlacedPad[] => {\n const n = { in: 0, out: 0 }\n return pads.map(pad => ({ pad, x: pad.dir === 'in' ? r.x : r.x + r.w, y: r.y + HEAD + PAD_STEP * n[pad.dir]++ + PAD / 2 }))\n}\nconst union = (rs: Rect[]): Rect => {\n const x0 = Math.min(...rs.map(r => r.x)), y0 = Math.min(...rs.map(r => r.y)), x1 = Math.max(...rs.map(r => r.x + r.w)), y1 = Math.max(...rs.map(r => r.y + r.h))\n return { x: x0, y: y0, w: x1 - x0, h: y1 - y0 }\n}\n\nconst layerBoxes = (l: Layer): PlacedBox[] => l.footprints.map(f => {\n const b = f.box, rect = { x: b.x * PW, y: b.y * PH, w: b.w * PW, h: b.h * PH }\n return { item: f, rect, pads: slots(f.pads, rect) }\n})\n\nexport function layout(c: Circuit): Layout {\n const pos = new Map<string, Pt>()\n const register = (f: Frame) => { for (const b of f.boxes) for (const p of b.pads) pos.set(posKey(f.id, p.pad.key), { x: f.origin.x + p.x, y: f.origin.y + p.y }) }\n const layers = c.layers.map((layer, index): LayerFrame => ({ layer, index, id: `l:${layer.screen}`, origin: { x: index * XSTEP, y: 0 }, rect: { x: index * XSTEP, y: 0, w: PW, h: PH }, boxes: layerBoxes(layer) }))\n const sideX = Math.max(0, c.layers.length - 1) * XSTEP + PW + SIDE_GAP\n let y = 0\n const blocks = c.side.map((block): BlockFrame => {\n let cy = BLOCK_HEAD\n const boxes = block.items.map((item): PlacedBox => {\n const h = HEAD + PAD_STEP * Math.max(1, item.pads.filter(p => p.dir === 'in').length, item.pads.filter(p => p.dir === 'out').length) + 8\n const rect = { x: 0, y: cy, w: SIDE_W, h }\n cy += h + ITEM_GAP\n return { item, rect, pads: slots(item.pads, rect) }\n })\n const f: BlockFrame = { block, id: `s:${block.system}`, origin: { x: sideX, y }, rect: { x: sideX, y, w: SIDE_W, h: cy }, boxes }\n y += cy + BLOCK_GAP\n return f\n })\n for (const f of [...layers, ...blocks]) register(f)\n const pageRect = (i: number): Rect => ({ x: i * XSTEP, y: 0, w: PW, h: PH })\n const bounds = union([...layers.map(l => l.rect), ...blocks.map(b => b.rect), { x: 0, y: 0, w: PW, h: PH }])\n return { layers, blocks, pos, bounds, pageRect }\n}\n",
|
|
17
|
+
"// The Circuit's data and the pad typing. Pure: no Lit, no DOM. A layer is a runtime (`screen` is its id).\nimport type { TSchema } from 'typebox'\n\nexport type PadType = 'string' | 'number' | 'boolean' | 'object' | 'array' | 'signal' | 'any' | 'call'\n\n/** A pad's data type, from its schema's type: none (or Void) is a signal; unions, Unknown and the rest are any. */\nexport function padTypeOf(schema: TSchema | undefined): PadType {\n if (!schema) return 'signal'\n const t = (schema as { type?: unknown }).type\n if (t === 'void' || t === 'undefined') return 'signal'\n if (t === 'string' || t === 'boolean' || t === 'object' || t === 'array') return t\n if (t === 'number' || t === 'integer') return 'number'\n return 'any'\n}\n\n/** An event is round, an action a rounded square; an input is hollow, an output filled. */\nexport type Pad = { key: string; instance: string; op: string; label: string; dir: 'in' | 'out'; kind: 'event' | 'call'; type: PadType; description?: string; schema?: TSchema }\nexport type Box = { x: number; y: number; w: number; h: number }\nexport type Footprint = { system: string; instance: string; title: string; box: Box; shared: boolean; pads: Pad[] }\nexport type Layer = { screen: string; title: string; system: string; footprints: Footprint[] }\nexport type SideItem = { system: string; instance: string; title: string; pads: Pad[] }\nexport type SystemBlock = { system: string; items: SideItem[] }\n/** Where a cable end sits: on a runtime's layer, or in the side area (the block's system id). */\nexport type CableEnd = { pad: string; at: { layer: string } | { side: string } }\n/** `id` is `runtime|from|to|port|source` for a pipe, `runtime|from|to|call|` for a call edge. */\nexport type Cable = { id: string; system: string; from: CableEnd; to: CableEnd; type: PadType }\nexport type Circuit = { layers: Layer[]; side: SystemBlock[]; cables: Cable[] }\n",
|
|
18
|
+
"// The Circuit, as a pure function of an application's deployment and the registry that knows its implementations.\nimport type { AppDeployment, Op, Registry } from '@pritzlaff/nano-core'\nimport { padTypeOf, type Box, type Cable, type Circuit, type Pad } from './types'\n\nconst padsOf = (scope: string, pod: string, deployment: AppDeployment, registry: Registry): Pad[] => {\n const impl = registry.implementation(deployment.pods[pod]?.implementation ?? '')\n const pad = (port: string, o: Op, dir: Pad['dir'], kind: Pad['kind'], schema: Op['input']): Pad => ({\n key: `${scope}${pod} ${port}:${dir}`, instance: pod, op: port, label: o.name, dir, kind, type: padTypeOf(schema?.schema),\n ...(o.description !== undefined && { description: o.description }), ...(schema && { schema: schema.schema }),\n })\n return (impl?.provides ?? []).flatMap(i => Object.values(i.ops).flatMap(o => {\n const port = `${i.coord}/${o.name}`\n return o.kind === 'action' ? [pad(port, o, 'in', 'call', o.input), pad(port, o, 'out', 'event', o.output)] : [pad(port, o, 'out', 'event', o.output)]\n }))\n}\n\n/** A runtime's pods get an equal grid, ceil(sqrt(n)) columns wide. */\nconst gridBoxes = (n: number): Box[] => {\n const cols = Math.ceil(Math.sqrt(n)), rows = Math.ceil(n / cols)\n return Array.from({ length: n }, (_, i) => ({ x: (i % cols) / cols, y: Math.floor(i / cols) / rows, w: 1 / cols, h: 1 / rows }))\n}\n\nexport function circuitOf(deployment: AppDeployment, registry: Registry): Circuit {\n const runtimes = Object.entries(deployment.runtimes)\n const count = new Map<string, number>()\n for (const [, r] of runtimes) for (const p of r.pods) count.set(p, (count.get(p) ?? 0) + 1)\n const shared = [...count].filter(([, n]) => n > 1).map(([p]) => p)\n\n const layers = runtimes.map(([id, r]) => {\n const grid = gridBoxes(r.pods.length)\n return { screen: id, title: id, system: id, footprints: r.pods.map((pod, i) => ({ system: id, instance: pod, title: pod, box: grid[i]!, shared: shared.includes(pod), pads: padsOf(`${id}/`, pod, deployment, registry) })) }\n })\n const side = shared.map(pod => ({ system: pod, items: [{ system: pod, instance: pod, title: pod, pads: padsOf('shared:', pod, deployment, registry) }] }))\n\n const cables: Cable[] = runtimes.flatMap(([id, r]) => r.subscriptions.flatMap(s => {\n const pads = (pod: string) => layers.find(l => l.screen === id)!.footprints.find(f => f.instance === pod)!.pads\n const at = { layer: id }\n if (s.kind === 'call') {\n const a = pads(s.from).find(p => p.dir === 'out') ?? pads(s.from)[0], b = pads(s.to).find(p => p.dir === 'in') ?? pads(s.to)[0]\n return a && b ? [{ id: `${id}|${s.from}|${s.to}|call|`, system: id, from: { pad: a.key, at }, to: { pad: b.key, at }, type: 'call' as const }] : []\n }\n const a = pads(s.from).find(p => p.op === s.source && p.dir === 'out'), b = pads(s.to).find(p => p.op === s.target && p.dir === 'in')\n return a && b ? [{ id: `${id}|${s.from}|${s.to}|${s.target}|${s.source}`, system: id, from: { pad: a.key, at }, to: { pad: b.key, at }, type: a.type }] : []\n }))\n // a pod placed in two runtimes: its side block is linked to each of its footprints\n for (const pod of shared) {\n const sp = side.find(b => b.system === pod)!.items[0]!.pads[0]\n for (const l of layers) {\n const p = l.footprints.find(f => f.instance === pod)?.pads[0]\n if (p && sp) cables.push({ id: `link|${l.screen}|${pod}`, system: pod, from: { pad: p.key, at: { layer: l.screen } }, to: { pad: sp.key, at: { side: pod } }, type: 'signal' })\n }\n }\n return { layers, side, cables }\n}\n",
|
|
19
|
+
"// The pill bar: Whole board, and a page per runtime.\nimport { html } from 'lit'\nimport type { NanoWiring } from './wiring'\n\nexport function renderPills(el: NanoWiring) {\n const { focus } = el.s\n return html`<nav class=\"pills\" aria-label=\"Wiring views\">\n <button class=\"pill\" data-whole @click=${() => el.fitAll()}>Whole board</button>\n ${el.model.layers.map(l => html`<button class=\"pill\" data-screen=${l.screen} aria-pressed=${focus === l.screen} @click=${() => el.go(l.screen)}>\n <span class=\"ic\" aria-hidden=\"true\">${l.title.slice(0, 1).toUpperCase()}</span>${l.title}</button>`)}\n </nav>`\n}\n",
|
|
20
|
+
"// The stage: a tilted stack of page layers, the side area of systems, cables, pads, and the minimap.\nimport { html, svg } from 'lit'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport type { NanoWiring } from './wiring'\nimport { renderDrawer } from './render-drawer'\nimport { DIM_CABLE, MARGIN, PH, PW, TILT, TYPE_COLOR, TYPE_GLYPH, TYPE_NAME, ZGAP, fade } from './constants'\nimport { frameId, posKey, type Frame, type PlacedBox, type PlacedPad, type Rect } from './layout'\nimport type { Cable } from './types'\n\nconst px = (r: Rect) => ({ left: `${r.x}px`, top: `${r.y}px`, width: `${r.w}px`, height: `${r.h}px` })\n\n/** A pad: a 24px button. Events are round, calls rounded squares; inputs hollow, outputs filled. */\nfunction pad(el: NanoWiring, { pad: p, x, y }: PlacedPad) {\n const c = TYPE_COLOR[p.type], out = p.dir === 'out'\n const style = { left: `${x - 12}px`, top: `${y - 12}px`, borderColor: c, background: out ? c : 'transparent', color: out ? '#0B0E12' : c, borderRadius: p.kind === 'event' ? '50%' : '6px' }\n return html`<button class=\"pad\" data-pad=${p.key} data-dir=${p.dir} data-kind=${p.kind} style=${styleMap(style)} title=${p.description ?? ''}\n aria-label=${`${p.instance}.${p.label}, ${TYPE_NAME[p.type]}, ${p.dir}`}\n aria-pressed=${el.s.sel === `pad:${p.key}`} @click=${() => el.select(`pad:${p.key}`)}>${TYPE_GLYPH[p.type]}</button>\n <span class=\"plabel ${p.dir}\" style=${styleMap({ top: `${y - 7}px`, ...(out ? { right: `calc(100% - ${x - 18}px)`, textAlign: 'right' } : { left: `${x + 18}px` }) })}>${p.label}</span>`\n}\n\nfunction box(el: NanoWiring, b: PlacedBox, shared: boolean) {\n const { item } = b, fp = (i: { system: string; instance: string }) => `fp:${i.system}/${i.instance}`\n return html`<div class=\"fp\" data-instance=${item.instance} data-sel=${el.s.sel === fp(item)} style=${styleMap(px(b.rect))}>\n <button class=\"ftitle\" @click=${() => el.select(fp(item))}>${item.title}${shared ? ' ⧉' : ''}</button>\n ${b.pads.map(p => pad(el, p))}</div>`\n}\n\nconst padName = (el: NanoWiring, key: string) => { const p = [...el.model.layers.flatMap(l => l.footprints), ...el.model.side.flatMap(b => b.items)].flatMap(i => i.pads).find(x => x.key === key); return p ? `${p.instance}.${p.label}` : key }\n\n/** A cable is a bezier between two pad centres, drawn in its source's frame. Full strength only on the focus layer. */\nfunction cables(el: NanoWiring, f: Frame) {\n const { pos } = el.geo, focusFrame = `l:${el.s.focus}`\n return svg`<svg class=\"cables\" width=\"1\" height=\"1\">${el.model.cables.filter(c => frameId(c.from.at) === f.id).map((c: Cable) => {\n const a = pos.get(posKey(f.id, c.from.pad)), b = pos.get(posKey(frameId(c.to.at), c.to.pad))\n if (!a || !b) return ''\n const x1 = a.x - f.origin.x, y1 = a.y - f.origin.y, x2 = b.x - f.origin.x, y2 = b.y - f.origin.y, dx = Math.max(40, Math.abs(x2 - x1) / 2)\n const full = frameId(c.from.at) === focusFrame || frameId(c.to.at) === focusFrame || (f.id.startsWith('s:') && frameId(c.to.at).startsWith('s:'))\n const d = `M${x1},${y1} C${x1 + dx},${y1} ${x2 - dx},${y2} ${x2},${y2}`, sel = el.s.sel === `cable:${c.id}`, lit = el.isLit(c.id)\n return svg`<g data-cable-hit=${c.id} role=\"button\" tabindex=\"0\" aria-label=${`Cable ${padName(el, c.from.pad)} to ${padName(el, c.to.pad)}`} aria-pressed=${sel} @click=${() => el.select(`cable:${c.id}`)}\n @keydown=${(e: KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); el.select(`cable:${c.id}`) } }}>\n <path data-cable=${c.id} data-x1=${x1} data-y1=${y1} data-x2=${x2} data-y2=${y2} d=${d}\n fill=\"none\" stroke=${TYPE_COLOR[c.type]} stroke-width=${sel || lit ? 4 : 2} opacity=${full || lit ? 1 : DIM_CABLE} data-lit=${lit}/><path class=\"hit\" d=${d}/></g>`\n })}</svg>`\n}\n\nfunction minimap(el: NanoWiring) {\n const { bounds: b, layers, blocks } = el.geo, { panX, panY, zoom, focus } = el.s, { w, h } = el.stageSize()\n const vp = { x: -panX / zoom - w / zoom / 2, y: -panY / zoom - h / zoom / 2, w: w / zoom, h: h / zoom }\n return html`<svg class=\"minimap\" role=\"img\" aria-label=\"Minimap\" viewBox=${`${b.x - MARGIN} ${b.y - MARGIN} ${b.w + 2 * MARGIN} ${b.h + 2 * MARGIN}`}\n @click=${(e: MouseEvent) => el.panFromMinimap(e)}>\n ${layers.map(l => svg`<rect class=\"mm-layer\" data-focus=${l.layer.screen === focus} x=${l.rect.x} y=${l.rect.y} width=${l.rect.w} height=${l.rect.h}/>`)}\n ${blocks.map(l => svg`<rect class=\"mm-side\" x=${l.rect.x} y=${l.rect.y} width=${l.rect.w} height=${l.rect.h}/>`)}\n <rect class=\"mm-view\" x=${vp.x} y=${vp.y} width=${vp.w} height=${vp.h}/></svg>`\n}\n\nexport function renderStage(el: NanoWiring) {\n const { focus, zoom, panX, panY } = el.s, reduced = el.reduced(), at = el.model.layers.findIndex(l => l.screen === focus)\n const world = { transform: `${reduced ? '' : TILT} translate(${panX}px, ${panY}px) scale(${zoom})` }\n return html`<div class=\"stage\" tabindex=\"0\" aria-label=\"Wiring\" @pointerdown=${(e: PointerEvent) => el.dragStart(e)} @wheel=${(e: WheelEvent) => el.wheel(e)}>\n <div class=\"world ${el.dragging || reduced ? '' : 'anim'}\" style=${styleMap(world)}>\n ${el.geo.layers.map(f => {\n const d = f.index - at, l = f.layer\n return html`<div class=\"frame\" data-screen=${l.screen} style=${styleMap({ left: `${f.origin.x}px`, top: `${f.origin.y}px`, transform: `translateZ(${-Math.abs(d) * ZGAP}px)` })}>\n <section class=\"layer\" aria-label=${l.title} data-focus=${d === 0} style=${styleMap({ width: `${PW}px`, height: `${PH}px`, opacity: String(fade(d)) })}>\n <h3 class=\"ltitle\">${l.title}</h3>\n ${f.boxes.map(b => box(el, b, 'shared' in b.item && b.item.shared))}</section>\n ${cables(el, f)}</div>`\n })}\n ${el.geo.blocks.map(f => html`<div class=\"frame side\" data-system=${f.block.system} style=${styleMap({ left: `${f.origin.x}px`, top: `${f.origin.y}px` })}>\n <h3 class=\"ltitle\">${f.block.system}</h3>${f.boxes.map(b => box(el, b, false))}${cables(el, f)}</div>`)}\n </div>\n ${minimap(el)}${renderDrawer(el)}</div>`\n}\n",
|
|
21
|
+
"// The details drawer: what is selected, read-only. Kicker, title, sub line, type chips, rows and the schema as JSON.\nimport { html, nothing } from 'lit'\nimport type { NanoWiring } from './wiring'\nimport { TYPE_COLOR, TYPE_GLYPH, TYPE_NAME } from './constants'\nimport type { Footprint, Pad, PadType, SideItem } from './types'\n\ntype View = { kicker: string; title: string; sub: string; types: PadType[]; rows: [string, string][]; schemaLabel?: string; schema?: unknown; follow: boolean }\n\nconst uniq = <T,>(xs: T[]) => [...new Set(xs)]\n\n/** Resolves the selection (`pad:`, `cable:` or `fp:`) to what the drawer shows. */\nexport function describe(el: NanoWiring): View | null {\n const { sel } = el.s, m = el.model\n if (!sel) return null\n const [what, id = ''] = [sel.slice(0, sel.indexOf(':')), sel.slice(sel.indexOf(':') + 1)]\n const items: (Footprint | SideItem)[] = [...m.layers.flatMap(l => l.footprints), ...m.side.flatMap(b => b.items)]\n const pads = items.flatMap(i => i.pads), padOf = (key: string) => pads.find(p => p.key === key)\n const routes = (p: Pad) => m.cables.filter(c => c.from.pad === p.key || c.to.pad === p.key).length\n const name = (p: Pad) => `${p.instance}.${p.label}`\n if (what === 'pad') {\n const p = padOf(id)\n if (!p) return null\n return { kicker: `${p.dir === 'in' ? 'Input' : 'Output'} pad`, title: name(p), sub: p.op, types: [p.type],\n rows: [['Kind', p.kind], ['Type', TYPE_NAME[p.type]], ['Routes', String(routes(p))], ['Description', p.description ?? '-']],\n schemaLabel: p.dir === 'in' ? 'Input schema' : 'Output schema', schema: p.schema, follow: routes(p) > 0 }\n }\n if (what === 'cable') {\n const c = m.cables.find(x => x.id === id), a = c && padOf(c.from.pad), b = c && padOf(c.to.pad)\n if (!c || !a || !b) return null\n return { kicker: 'Cable', title: `${name(a)} → ${name(b)}`, sub: c.system, types: [c.type],\n rows: [['Kind', a.kind], ['Type', TYPE_NAME[c.type]], ['From', name(a)], ['To', name(b)]], schemaLabel: 'Output schema', schema: a.schema, follow: true }\n }\n const it = items.find(i => `${i.system}/${i.instance}` === id)\n if (!it) return null\n return { kicker: 'Pod', title: it.title, sub: `${it.system}/${it.instance}`, types: uniq(it.pads.map(p => p.type)),\n rows: [['Pads', String(it.pads.length)], ['Routes', String(it.pads.reduce((n, p) => n + routes(p), 0))]], follow: false }\n}\n\nexport function renderDrawer(el: NanoWiring) {\n const d = describe(el)\n return html`<aside class=\"drawer\" aria-label=\"Details\" ?hidden=${!d} @wheel=${(e: Event) => e.stopPropagation()}>${!d ? nothing : html`\n <div class=\"d-head\"><div><div class=\"kicker\">${d.kicker}</div><div class=\"d-title\">${d.title}</div><div class=\"d-sub\">${d.sub}</div></div>\n <button aria-label=\"Close details\" @click=${() => { el.select(null); el.refocus() }}>✕</button></div>\n <div class=\"chips\">${d.types.map(t => html`<span class=\"chip\"><span class=\"glyph\" aria-hidden=\"true\" style=\"background:${TYPE_COLOR[t]}\">${TYPE_GLYPH[t]}</span>${TYPE_NAME[t]}</span>`)}</div>\n <dl>${d.rows.map(([k, v]) => html`<dt>${k}</dt><dd>${v}</dd>`)}</dl>\n ${d.schemaLabel ? html`<div class=\"kicker\">${d.schemaLabel}</div><pre>${d.schema === undefined ? 'none (signal)' : JSON.stringify(d.schema, null, 2)}</pre>` : nothing}\n ${d.follow ? html`<div class=\"actions\"><button @click=${() => el.follow()}>Follow cable</button></div>` : nothing}`}</aside>`\n}\n",
|
|
22
|
+
"// <nano-wiring>'s look, on the --nano-* tokens.\nimport { css } from 'lit'\nimport { base, t } from '@pritzlaff/nano-elements'\n\nexport const styles = [base, css`\n :host { display: block; height: 100%; min-height: 360px; color: ${t('fg')} }\n .pills { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; background: ${t('bg')} }\n .ic { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: ${t('surface-2')}; font-size: 10px }\n .stage { position: relative; height: calc(100% - 44px); overflow: hidden; perspective: 2400px; background: ${t('bg')} radial-gradient(${t('surface-2')} 1px, transparent 1px) 0 0 / 22px 22px; cursor: grab; user-select: none; touch-action: none }\n .world { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; transform-origin: 0 0 }\n .world.anim { transition: transform .5s ease }\n .frame { position: absolute; transform-style: preserve-3d }\n .layer { position: absolute; left: 0; top: 0; background: ${t('surface')}; border: 1px solid ${t('border')}; border-radius: 8px }\n .ltitle { position: absolute; left: 0; top: -22px; margin: 0; font-size: 12px; color: ${t('muted')}; white-space: nowrap }\n .layer .ltitle { left: 8px; top: 6px }\n .fp { position: absolute; box-sizing: border-box; border: 1px solid ${t('border')}; border-radius: 6px; background: ${t('surface-2')} }\n .ftitle { position: absolute; left: 14px; top: 8px; padding: 0; border: 0; background: none; font-weight: 600 }\n .pad { position: absolute; width: 24px; height: 24px; padding: 0; border: 2px solid; font: 600 10px ${t('font-mono')} }\n .plabel { position: absolute; font-size: 10px; color: ${t('muted')}; white-space: nowrap }\n .pad[aria-pressed=\"true\"], .fp[data-sel=\"true\"] { border-color: ${t('accent')} }\n .hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer }\n g[data-cable-hit]:focus-visible { outline: 2px solid ${t('focus')} }\n path[data-lit=\"true\"] { filter: drop-shadow(0 0 4px currentColor) }\n .cables { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none }\n .drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 3; width: 340px; max-width: 100%; box-sizing: border-box; padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; background: ${t('bg')}; border-left: 1px solid ${t('border')}; cursor: auto; user-select: text }\n .drawer[hidden] { display: none }\n .d-head { display: flex; justify-content: space-between; gap: 12px } .d-title { font: 700 14px ${t('font-mono')}; word-break: break-word } .d-sub { font: 11px ${t('font-mono')}; color: ${t('muted')}; word-break: break-word }\n .kicker { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: ${t('muted')} }\n .chips { display: flex; flex-wrap: wrap; gap: 6px }\n .glyph { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: ${t('on-accent')}; font: 700 9px ${t('font-mono')} }\n dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px 10px; margin: 0 } dt { color: ${t('muted')} } dd { margin: 0; font: 11px ${t('font-mono')}; word-break: break-word }\n pre { margin: 0; padding: 10px; border: 1px solid ${t('border')}; border-radius: 6px; background: ${t('surface')}; font: 11px/16px ${t('font-mono')}; white-space: pre-wrap }\n .actions { margin-top: auto; padding-top: 8px; border-top: 1px solid ${t('border')} }\n @media (prefers-reduced-motion: reduce) { .world.anim { transition: none } }\n .minimap { position: absolute; right: 12px; bottom: 12px; width: 176px; height: 108px; background: ${t('bg')}; border: 1px solid ${t('border')}; border-radius: 6px }\n .mm-layer { fill: ${t('surface-2')} } .mm-layer[data-focus=\"true\"] { fill: ${t('accent-soft')} } .mm-side { fill: ${t('border')} } .mm-view { fill: none; stroke: ${t('accent')}; stroke-width: 12 }`]\n",
|
|
23
|
+
"/**\n * `<nano-pod-view>`: any pod, generically — its name, implementation, config and runtimes, each interface it provides\n * with each op's name and kind, and per port the calls to it and the last result delivered.\n */\nimport { css, html } from 'lit'\nimport type { AppEvent, NanoResult } from '@pritzlaff/nano-core'\nimport { base, t } from '@pritzlaff/nano-elements'\nimport { shown, ViewElement, type ViewTarget } from './view.ts'\n\nexport class NanoPodView extends ViewElement {\n static styles = [base, css`\n dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px }\n dt { color: ${t('muted')} } dd { margin: 0; font-family: ${t('font-mono')} }\n table { width: 100%; border-collapse: collapse } td { padding: 3px 6px; border-top: 1px solid ${t('border')} }\n .iface { margin-top: 8px; font-weight: 600 }\n `]\n private ports = new Map<string, string>()\n private stats = new Map<string, { calls: number; last?: NanoResult<unknown> }>()\n\n protected started() { this.ports.clear(); this.stats.clear(); this.requestUpdate() }\n\n protected hear(e: AppEvent, tg: ViewTarget) {\n if (e.type === 'sent' && e.to === tg.pod) {\n this.ports.set(e.id, e.port)\n const s = this.stats.get(e.port) ?? { calls: 0 }\n this.stats.set(e.port, { ...s, calls: s.calls + 1 })\n } else if ((e.type === 'delivered' || e.type === 'denied') && this.ports.has(e.id)) {\n const p = this.ports.get(e.id)!\n this.ports.delete(e.id)\n if (e.type === 'delivered') this.stats.set(p, { ...this.stats.get(p)!, last: e.result })\n } else return\n this.requestUpdate()\n }\n\n protected face(tg: ViewTarget) {\n const d = tg.app.deployment()\n const pod = d.pods[tg.pod]\n const runtimes = Object.entries(d.runtimes).filter(([, r]) => r.pods.includes(tg.pod)).map(([id]) => id)\n const provides = tg.registry.implementation(pod?.implementation ?? '')?.provides ?? []\n return html`\n <dl>\n <dt>pod</dt><dd>${tg.pod}</dd>\n <dt>implementation</dt><dd>${pod?.implementation ?? '—'}</dd>\n <dt>config</dt><dd>${JSON.stringify(pod?.config ?? null)}</dd>\n <dt>runtimes</dt><dd>${runtimes.join(', ') || '—'}</dd>\n </dl>\n ${provides.map(i => html`\n <div class=\"iface\">${i.coord}</div>\n <table>${Object.values(i.ops).map(o => {\n const p = `${i.coord}/${o.name}`, s = this.stats.get(p)\n return html`<tr data-port=${p}><td>${o.name}</td><td class=\"badge\">${o.kind}</td>\n <td>${s?.calls ?? 0} calls</td><td>${shown(s?.last)}</td></tr>`\n })}</table>`)}`\n }\n}\n",
|
|
24
|
+
"/**\n * The nano.ui default views, and `defineViews`, which defines their five tags (and `nano-pod-view`, `nano-explorer`, `nano-wiring`) once.\n *\n * defineViews(); viewFor(pod, { ...app.deployment(), views: selectors }, views)\n */\nimport { NanoDebounce, NanoInput, NanoLog, NanoMap } from './faces.ts'\nimport { NanoExplorer } from '../explorer.ts'\nimport { NanoWiring } from '../wiring/wiring.ts'\nimport { NanoPodView } from './pod-view.ts'\nimport type { ViewMap } from './view.ts'\n\nexport const views: ViewMap = { 'nano.ui/input': 'nano-input', 'nano.ui/debounce': 'nano-debounce', 'nano.ui/map': 'nano-map', 'nano.ui/log': 'nano-log' }\n\nconst tags = { 'nano-explorer': NanoExplorer, 'nano-wiring': NanoWiring, 'nano-pod-view': NanoPodView, 'nano-input': NanoInput, 'nano-debounce': NanoDebounce, 'nano-map': NanoMap, 'nano-log': NanoLog }\n\nexport function defineViews(): void {\n for (const [tag, cls] of Object.entries(tags)) if (!customElements.get(tag)) customElements.define(tag, cls)\n}\n",
|
|
25
|
+
"/**\n * The `nano.ui` provider: input, debounce, map and log pods, and the HostUI interface a host implements.\n *\n * registry.add(uiProvider) // then Pod.lazy(log), Pod.eager(debounce, { config: { quietMs: 200 } })\n * defineViews() // the default `views`, and nano-pod-view for any pod\n */\nimport { uiProvider } from './provider.ts'\n\nexport { Any, Debounce, HostUI, Input, Log, MapIface, Nothing } from './interfaces.ts'\nexport { debounce } from './pods/debounce.ts'\nexport { input } from './pods/input.ts'\nexport { log } from './pods/log.ts'\nexport { map } from './pods/map.ts'\nexport { defineViews, views } from './views/define.ts'\nexport { circuitOf } from './wiring/model.ts'\nexport type { LayoutBox, LayoutData, LayoutSlot } from './layout.ts'\nexport { viewFor, type ViewMap, type ViewTarget } from './views/view.ts'\nexport { uiProvider }\nexport default uiProvider\n"
|
|
26
|
+
],
|
|
27
|
+
"mappings": ";AAAA,kBAAS;;;ACAT,iBAAS;AACT,kBAAS,kBAAO;;;ACIhB;AACA;AAEA,IAAM,KAAK,MAAM,UAAU,SAAS;AAE7B,IAAM,MAAM,OAAO,OAAO,KAAK,QAAQ,GAAG,KAAK;AAC/C,IAAM,UAAU,OAAO,OAAO,KAAK,KAAK,GAAG,SAAS;AAC3D,IAAM,UAAU,OAAO,OAAO,KAAK,MAAM,KAAK,QAAQ,CAAC,GAAG,SAAS;AACnE,IAAM,OAAO,OAAO,OAAO,KAAK,OAAO,GAAG,MAAM;AAChD,IAAM,WAAW,OAAO,OAAO,KAAK,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,QAAQ,KAAK,SAAS,KAAK,OAAO,CAAC,EAAE,CAAC,GAAG,UAAU;AACtH,IAAM,WAAW,OAAO,OAAO,KAAK,QAAQ,GAAG,UAAU;AAGlD,IAAM,QAAQ,GAAG,UAAU,SAAS,EAAE,QAAQ,GAAG,OAAO,KAAK,GAAG,EAAE,CAAC;AACnE,IAAM,WAAW,GAAG,UAAU,YAAY,EAAE,MAAM,GAAG,OAAO,KAAK,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,EAAE,CAAC;AACnG,IAAM,WAAW,GAAG,UAAU,OAAO,EAAE,KAAK,GAAG,OAAO,KAAK,GAAG,EAAE,CAAC;AACjE,IAAM,MAAM,GAAG,UAAU,OAAO;AAAA,EACrC,KAAK,GAAG,OAAO,KAAK,OAAO;AAAA,EAC3B,SAAS,GAAG,OAAO,SAAS,OAAO;AAAA,EACnC,OAAO,GAAG,OAAO,SAAS,OAAO;AACnC,CAAC;AAEM,IAAM,SAAS,GAAG,UAAU,UAAU;AAAA,EAC3C,OAAO,GAAG,OAAO,MAAM,OAAO;AAAA,EAC9B,SAAS,GAAG,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from any event or result fits.
|
|
3
|
+
*
|
|
4
|
+
* port(Input, Input.ops.submit) // pipe source: what was submitted
|
|
5
|
+
*/
|
|
6
|
+
import { Type } from 'typebox';
|
|
7
|
+
export declare const Any: import("@pritzlaff/nano-core").SchemaDef<Type.TUnknown>;
|
|
8
|
+
export declare const Nothing: import("@pritzlaff/nano-core").SchemaDef<Type.TNull>;
|
|
9
|
+
/** Returns its input, so its result can be piped. */
|
|
10
|
+
export declare const Input: import("@pritzlaff/nano-core").Interface<{
|
|
11
|
+
submit: {
|
|
12
|
+
readonly kind: "action";
|
|
13
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TUnknown> | undefined;
|
|
14
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TUnknown> | undefined;
|
|
15
|
+
readonly description?: string;
|
|
16
|
+
} & {
|
|
17
|
+
readonly name: "submit";
|
|
18
|
+
readonly coord: string;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
export declare const Debounce: import("@pritzlaff/nano-core").Interface<{
|
|
22
|
+
push: {
|
|
23
|
+
readonly kind: "action";
|
|
24
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TUnknown> | undefined;
|
|
25
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TNull> | undefined;
|
|
26
|
+
readonly description?: string;
|
|
27
|
+
} & {
|
|
28
|
+
readonly name: "push";
|
|
29
|
+
readonly coord: string;
|
|
30
|
+
};
|
|
31
|
+
flushed: {
|
|
32
|
+
readonly kind: "event";
|
|
33
|
+
readonly input?: undefined;
|
|
34
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TUnknown> | undefined;
|
|
35
|
+
readonly description?: string;
|
|
36
|
+
} & {
|
|
37
|
+
readonly name: "flushed";
|
|
38
|
+
readonly coord: string;
|
|
39
|
+
};
|
|
40
|
+
}>;
|
|
41
|
+
export declare const MapIface: import("@pritzlaff/nano-core").Interface<{
|
|
42
|
+
map: {
|
|
43
|
+
readonly kind: "action";
|
|
44
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TUnknown> | undefined;
|
|
45
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TUnknown> | undefined;
|
|
46
|
+
readonly description?: string;
|
|
47
|
+
} & {
|
|
48
|
+
readonly name: "map";
|
|
49
|
+
readonly coord: string;
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
52
|
+
export declare const Log: import("@pritzlaff/nano-core").Interface<{
|
|
53
|
+
log: {
|
|
54
|
+
readonly kind: "action";
|
|
55
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TUnknown> | undefined;
|
|
56
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TNull> | undefined;
|
|
57
|
+
readonly description?: string;
|
|
58
|
+
} & {
|
|
59
|
+
readonly name: "log";
|
|
60
|
+
readonly coord: string;
|
|
61
|
+
};
|
|
62
|
+
entries: {
|
|
63
|
+
readonly kind: "action";
|
|
64
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TNull> | undefined;
|
|
65
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TArray<Type.TUnknown>> | undefined;
|
|
66
|
+
readonly description?: string;
|
|
67
|
+
} & {
|
|
68
|
+
readonly name: "entries";
|
|
69
|
+
readonly coord: string;
|
|
70
|
+
};
|
|
71
|
+
clear: {
|
|
72
|
+
readonly kind: "action";
|
|
73
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TNull> | undefined;
|
|
74
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TNull> | undefined;
|
|
75
|
+
readonly description?: string;
|
|
76
|
+
} & {
|
|
77
|
+
readonly name: "clear";
|
|
78
|
+
readonly coord: string;
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
81
|
+
/** What the host offers a pod; implemented by the host, not here. */
|
|
82
|
+
export declare const HostUI: import("@pritzlaff/nano-core").Interface<{
|
|
83
|
+
alert: {
|
|
84
|
+
readonly kind: "action";
|
|
85
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TString> | undefined;
|
|
86
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TNull> | undefined;
|
|
87
|
+
readonly description?: string;
|
|
88
|
+
} & {
|
|
89
|
+
readonly name: "alert";
|
|
90
|
+
readonly coord: string;
|
|
91
|
+
};
|
|
92
|
+
approve: {
|
|
93
|
+
readonly kind: "action";
|
|
94
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TObject<{
|
|
95
|
+
title: Type.TString;
|
|
96
|
+
detail: Type.TOptional<Type.TString>;
|
|
97
|
+
}>> | undefined;
|
|
98
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TBoolean> | undefined;
|
|
99
|
+
readonly description?: string;
|
|
100
|
+
} & {
|
|
101
|
+
readonly name: "approve";
|
|
102
|
+
readonly coord: string;
|
|
103
|
+
};
|
|
104
|
+
setAppBar: {
|
|
105
|
+
readonly kind: "action";
|
|
106
|
+
readonly input?: import("@pritzlaff/nano-core").SchemaDef<Type.TString> | undefined;
|
|
107
|
+
readonly output?: import("@pritzlaff/nano-core").SchemaDef<Type.TNull> | undefined;
|
|
108
|
+
readonly description?: string;
|
|
109
|
+
} & {
|
|
110
|
+
readonly name: "setAppBar";
|
|
111
|
+
readonly coord: string;
|
|
112
|
+
};
|
|
113
|
+
}>;
|
package/layout.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The layout convention: which pods are on the page and where, engine-neutral, inside `AppDeployment.layout` (the
|
|
3
|
+
* deployer's plain object). Each layout engine keeps its own state beside it under its own key.
|
|
4
|
+
*
|
|
5
|
+
* "layout": {
|
|
6
|
+
* "slots": [{ "id": "a", "runtime": "example.todo.frontend", "pod": "listA" }, { "id": "b", "runtime": "example.todo.frontend", "pod": "listB" }],
|
|
7
|
+
* "geometry": { "a": { "x": 0, "y": 0, "w": 0.5, "h": 1 }, "b": { "x": 0.5, "y": 0, "w": 0.5, "h": 1 } },
|
|
8
|
+
* "workspace": { ...golden-layout's own state }
|
|
9
|
+
* }
|
|
10
|
+
*
|
|
11
|
+
* A slot's key is the pod's instance coordinate; a pod has at most one view (its implementation's, from the provider
|
|
12
|
+
* module's `views`, or the deployment's `views` override). A pod not in `slots` runs unseen.
|
|
13
|
+
*/
|
|
14
|
+
/** A placed pod. `id` is the slot's engine-neutral name. */
|
|
15
|
+
export type LayoutSlot = {
|
|
16
|
+
id: string;
|
|
17
|
+
runtime: string;
|
|
18
|
+
pod: string;
|
|
19
|
+
};
|
|
20
|
+
/** Where a slot sits, as fractions (0..1) of the page. */
|
|
21
|
+
export type LayoutBox = {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
w: number;
|
|
25
|
+
h: number;
|
|
26
|
+
};
|
|
27
|
+
/** The neutral part of `AppDeployment.layout`; `geometry` is keyed by slot id. */
|
|
28
|
+
export type LayoutData = {
|
|
29
|
+
slots?: LayoutSlot[];
|
|
30
|
+
geometry?: Record<string, LayoutBox>;
|
|
31
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pritzlaff/nano-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "The nano.ui provider: input, debounce, map and log pods, and the HostUI interface.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/aaronp/nano.git",
|
|
10
|
+
"directory": "packages/ui"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"import": "./index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"types": "./index.d.ts",
|
|
19
|
+
"module": "./index.js",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"dependencies": {},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@pritzlaff/nano-core": "^0.4.0",
|
|
24
|
+
"@pritzlaff/nano-elements": "^0.4.0",
|
|
25
|
+
"lit": "^3.0.0",
|
|
26
|
+
"typebox": "^1.4.0"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/pods/input.d.ts
ADDED
package/pods/log.d.ts
ADDED
package/pods/map.d.ts
ADDED
package/provider.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const uiProvider: import("@pritzlaff/nano-core").Provider;
|
package/views/faces.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type AppEvent } from '@pritzlaff/nano-core';
|
|
2
|
+
import { ViewElement, type ViewTarget } from './view.js';
|
|
3
|
+
export declare class NanoInput extends ViewElement {
|
|
4
|
+
private enter;
|
|
5
|
+
protected face(tg: ViewTarget): import("lit").TemplateResult<1>;
|
|
6
|
+
}
|
|
7
|
+
export declare class NanoDebounce extends ViewElement {
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
private pending;
|
|
10
|
+
private flash;
|
|
11
|
+
private timer?;
|
|
12
|
+
protected hear(e: AppEvent, tg: ViewTarget): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
protected face(): import("lit").TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
export declare class NanoMap extends ViewElement {
|
|
17
|
+
private mine;
|
|
18
|
+
private output?;
|
|
19
|
+
protected hear(e: AppEvent, tg: ViewTarget): void;
|
|
20
|
+
protected face(tg: ViewTarget): import("lit").TemplateResult<1>;
|
|
21
|
+
}
|
|
22
|
+
export declare class NanoLog extends ViewElement {
|
|
23
|
+
private entries;
|
|
24
|
+
private logs;
|
|
25
|
+
protected started(tg: ViewTarget): void;
|
|
26
|
+
private read;
|
|
27
|
+
protected hear(e: AppEvent, tg: ViewTarget): void;
|
|
28
|
+
protected face(): import("lit").TemplateResult<1>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AppEvent } from '@pritzlaff/nano-core';
|
|
2
|
+
import { ViewElement, type ViewTarget } from './view.js';
|
|
3
|
+
export declare class NanoPodView extends ViewElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
private ports;
|
|
6
|
+
private stats;
|
|
7
|
+
protected started(): void;
|
|
8
|
+
protected hear(e: AppEvent, tg: ViewTarget): void;
|
|
9
|
+
protected face(tg: ViewTarget): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
package/views/view.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view contract: a view is a custom element over one pod, with a `target: ViewTarget` property. It reaches its pod
|
|
3
|
+
* only through `target.app.call(target.runtime, target.pod)` and `target.app.listen`. `viewFor` picks the tag.
|
|
4
|
+
*
|
|
5
|
+
* viewFor('up', { ...app.deployment(), views }, defaults) // the selector, else the default, else 'nano-pod-view'
|
|
6
|
+
*/
|
|
7
|
+
import { LitElement } from 'lit';
|
|
8
|
+
import type { AppDeployment, AppEvent, Application, Registry } from '@pritzlaff/nano-core';
|
|
9
|
+
export type ViewTarget = {
|
|
10
|
+
app: Application;
|
|
11
|
+
registry: Registry;
|
|
12
|
+
runtime: string;
|
|
13
|
+
pod: string;
|
|
14
|
+
};
|
|
15
|
+
/** An implementation coordinate → a custom-element tag. */
|
|
16
|
+
export type ViewMap = Record<string, string>;
|
|
17
|
+
export declare function viewFor(pod: string, deployment: AppDeployment, defaults: ViewMap): string;
|
|
18
|
+
/**
|
|
19
|
+
* What every view here shares: listening while connected and its pod is placed; "removed" once an `applied` removes it.
|
|
20
|
+
* Not exported from the package: a view is any element with `target`, this is only how these ones are made.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ViewElement extends LitElement {
|
|
23
|
+
static properties: {
|
|
24
|
+
target: {
|
|
25
|
+
attribute: boolean;
|
|
26
|
+
};
|
|
27
|
+
removed: {
|
|
28
|
+
state: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
static styles: import("lit").CSSResult[];
|
|
32
|
+
target?: ViewTarget;
|
|
33
|
+
removed: boolean;
|
|
34
|
+
private off?;
|
|
35
|
+
private watching?;
|
|
36
|
+
constructor();
|
|
37
|
+
connectedCallback(): void;
|
|
38
|
+
disconnectedCallback(): void;
|
|
39
|
+
willUpdate(changed: Map<string, unknown>): void;
|
|
40
|
+
private watch;
|
|
41
|
+
private stop;
|
|
42
|
+
/** The pod's client. */
|
|
43
|
+
protected pod(t: ViewTarget): {
|
|
44
|
+
[x: string]: (input: unknown) => Promise<import("@pritzlaff/nano-core").NanoResult<unknown>>;
|
|
45
|
+
};
|
|
46
|
+
/** Called once listening starts. */
|
|
47
|
+
protected started(_t: ViewTarget): void;
|
|
48
|
+
/** Every event while listening. */
|
|
49
|
+
protected hear(_e: AppEvent, _t: ViewTarget): void;
|
|
50
|
+
protected face(_t: ViewTarget): unknown;
|
|
51
|
+
render(): unknown;
|
|
52
|
+
}
|
|
53
|
+
/** A result's value, shown. */
|
|
54
|
+
export declare const shown: (r: {
|
|
55
|
+
ok: boolean;
|
|
56
|
+
value?: unknown;
|
|
57
|
+
fail?: {
|
|
58
|
+
reason: string;
|
|
59
|
+
};
|
|
60
|
+
} | undefined) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PadType } from './types.js';
|
|
2
|
+
export declare const TYPE_COLOR: Record<PadType, string>;
|
|
3
|
+
export declare const TYPE_GLYPH: Record<PadType, string>;
|
|
4
|
+
export declare const TYPE_NAME: Record<PadType, string>;
|
|
5
|
+
/** A page, in world px; page i sits at x = i·XSTEP, so the stack fans out to the right. */
|
|
6
|
+
export declare const PW = 720, PH = 440, XSTEP = 140;
|
|
7
|
+
/** How far back a layer sits per page of distance from the focus. */
|
|
8
|
+
export declare const ZGAP = 160;
|
|
9
|
+
export declare const TILT = "rotateX(32deg) rotateY(-14deg)";
|
|
10
|
+
export declare const FADE_MIN = 0.15, FADE_STEP = 0.35, DIM_CABLE = 0.18;
|
|
11
|
+
export declare const fade: (d: number) => number;
|
|
12
|
+
export declare const PAD = 24, PAD_STEP = 30, HEAD = 34;
|
|
13
|
+
export declare const SIDE_W = 280, SIDE_GAP = 140, BLOCK_HEAD = 30, BLOCK_GAP = 28, ITEM_GAP = 12;
|
|
14
|
+
export declare const ZOOM_MIN = 0.3, ZOOM_MAX = 2.5;
|
|
15
|
+
export declare const MARGIN = 60;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Circuit, Footprint, Layer, Pad, SideItem, SystemBlock } from './types.js';
|
|
2
|
+
export type Rect = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
w: number;
|
|
6
|
+
h: number;
|
|
7
|
+
};
|
|
8
|
+
export type Pt = {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
export type PlacedPad = {
|
|
13
|
+
pad: Pad;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
/** One box: a footprint or a side item. Positions are local to its frame. */
|
|
18
|
+
export type PlacedBox = {
|
|
19
|
+
item: Footprint | SideItem;
|
|
20
|
+
rect: Rect;
|
|
21
|
+
pads: PlacedPad[];
|
|
22
|
+
};
|
|
23
|
+
export type Frame = {
|
|
24
|
+
id: string;
|
|
25
|
+
origin: Pt;
|
|
26
|
+
rect: Rect;
|
|
27
|
+
boxes: PlacedBox[];
|
|
28
|
+
};
|
|
29
|
+
export type LayerFrame = Frame & {
|
|
30
|
+
layer: Layer;
|
|
31
|
+
index: number;
|
|
32
|
+
};
|
|
33
|
+
export type BlockFrame = Frame & {
|
|
34
|
+
block: SystemBlock;
|
|
35
|
+
};
|
|
36
|
+
export type Layout = {
|
|
37
|
+
layers: LayerFrame[];
|
|
38
|
+
blocks: BlockFrame[];
|
|
39
|
+
pos: Map<string, Pt>;
|
|
40
|
+
bounds: Rect;
|
|
41
|
+
pageRect(i: number): Rect;
|
|
42
|
+
};
|
|
43
|
+
export declare const frameId: (at: {
|
|
44
|
+
layer: string;
|
|
45
|
+
} | {
|
|
46
|
+
side: string;
|
|
47
|
+
}) => string;
|
|
48
|
+
export declare const posKey: (frame: string, pad: string) => string;
|
|
49
|
+
export declare function layout(c: Circuit): Layout;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NanoWiring } from './wiring.js';
|
|
2
|
+
import type { PadType } from './types.js';
|
|
3
|
+
type View = {
|
|
4
|
+
kicker: string;
|
|
5
|
+
title: string;
|
|
6
|
+
sub: string;
|
|
7
|
+
types: PadType[];
|
|
8
|
+
rows: [string, string][];
|
|
9
|
+
schemaLabel?: string;
|
|
10
|
+
schema?: unknown;
|
|
11
|
+
follow: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** Resolves the selection (`pad:`, `cable:` or `fp:`) to what the drawer shows. */
|
|
14
|
+
export declare function describe(el: NanoWiring): View | null;
|
|
15
|
+
export declare function renderDrawer(el: NanoWiring): import("lit").TemplateResult<1>;
|
|
16
|
+
export {};
|