@niscorp/nova 0.2.0 → 0.2.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/CHANGELOG.md +61 -0
- package/README.md +56 -13
- package/SHELL_DOCS.md +13 -4
- package/dist/adapters/dom/components/index.cjs +4 -51
- package/dist/adapters/dom/components/index.cjs.map +1 -1
- package/dist/adapters/dom/index.cjs +22 -686
- package/dist/adapters/dom/index.cjs.map +1 -1
- package/dist/adapters/dom/index.js +2 -2
- package/dist/adapters/dom/server.cjs +14 -411
- package/dist/adapters/dom/server.cjs.map +1 -1
- package/dist/adapters/dom/server.js +2 -2
- package/dist/adapters/react/components/index.cjs +87 -562
- package/dist/adapters/react/components/index.cjs.map +1 -1
- package/dist/adapters/react/components/index.d.cts +2 -2
- package/dist/adapters/react/components/index.d.ts +2 -2
- package/dist/adapters/react/components/index.js +3 -3
- package/dist/adapters/react/index.cjs +97 -1815
- package/dist/adapters/react/index.cjs.map +1 -1
- package/dist/adapters/react/index.js +3 -3
- package/dist/adapters/tty/components/index.cjs +3 -44
- package/dist/adapters/tty/components/index.cjs.map +1 -1
- package/dist/adapters/tty/index.cjs +13 -5
- package/dist/adapters/tty/index.cjs.map +1 -1
- package/dist/adapters/tty/index.js +1 -1
- package/dist/adapters/vue/components/index.cjs +88 -639
- package/dist/adapters/vue/components/index.cjs.map +1 -1
- package/dist/adapters/vue/components/index.d.cts +10 -10
- package/dist/adapters/vue/components/index.d.ts +10 -10
- package/dist/adapters/vue/components/index.js +3 -3
- package/dist/adapters/vue/index.cjs +96 -962
- package/dist/adapters/vue/index.cjs.map +1 -1
- package/dist/adapters/vue/index.js +4 -4
- package/dist/agent/index.cjs +13 -151
- package/dist/agent/index.cjs.map +1 -1
- package/dist/chunk-3IPM5QBT.cjs +436 -0
- package/dist/chunk-3IPM5QBT.cjs.map +1 -0
- package/dist/chunk-5AF72LOE.cjs +97 -0
- package/dist/chunk-5AF72LOE.cjs.map +1 -0
- package/dist/chunk-5YQIAS4V.cjs +184 -0
- package/dist/chunk-5YQIAS4V.cjs.map +1 -0
- package/dist/chunk-D4PUWBN6.cjs +72 -0
- package/dist/chunk-D4PUWBN6.cjs.map +1 -0
- package/dist/{chunk-RYIIIXDX.js → chunk-DU2VIJAF.js} +57 -15
- package/dist/chunk-DU2VIJAF.js.map +1 -0
- package/dist/{chunk-VU6NNCEJ.js → chunk-F2H7WP6R.js} +4 -4
- package/dist/{chunk-VU6NNCEJ.js.map → chunk-F2H7WP6R.js.map} +1 -1
- package/dist/chunk-FSUMCJAR.cjs +646 -0
- package/dist/chunk-FSUMCJAR.cjs.map +1 -0
- package/dist/{chunk-QXQCPH33.js → chunk-G4LSLLGI.js} +4 -4
- package/dist/{chunk-QXQCPH33.js.map → chunk-G4LSLLGI.js.map} +1 -1
- package/dist/chunk-GV7UC3SS.cjs +33 -0
- package/dist/chunk-GV7UC3SS.cjs.map +1 -0
- package/dist/chunk-IZ2UU5UL.cjs +808 -0
- package/dist/chunk-IZ2UU5UL.cjs.map +1 -0
- package/dist/chunk-KOYRJXTI.cjs +123 -0
- package/dist/chunk-KOYRJXTI.cjs.map +1 -0
- package/dist/chunk-KW34ZKF5.cjs +12 -0
- package/dist/chunk-KW34ZKF5.cjs.map +1 -0
- package/dist/chunk-OE527MXF.cjs +49 -0
- package/dist/chunk-OE527MXF.cjs.map +1 -0
- package/dist/chunk-OO247V4J.cjs +2117 -0
- package/dist/chunk-OO247V4J.cjs.map +1 -0
- package/dist/chunk-PMKWYOOX.cjs +64 -0
- package/dist/chunk-PMKWYOOX.cjs.map +1 -0
- package/dist/chunk-PNQY6OFB.cjs +132 -0
- package/dist/chunk-PNQY6OFB.cjs.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +11 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/{chunk-MHW5VEIM.js → chunk-SVNK5NIK.js} +3 -3
- package/dist/{chunk-MHW5VEIM.js.map → chunk-SVNK5NIK.js.map} +1 -1
- package/dist/chunk-TMLNVU5W.cjs +318 -0
- package/dist/chunk-TMLNVU5W.cjs.map +1 -0
- package/dist/chunk-TRJYDVWK.cjs +623 -0
- package/dist/chunk-TRJYDVWK.cjs.map +1 -0
- package/dist/chunk-UGG7MCX4.cjs +34 -0
- package/dist/chunk-UGG7MCX4.cjs.map +1 -0
- package/dist/{chunk-UDCXGDLQ.js → chunk-VOD5JA4D.js} +3 -3
- package/dist/{chunk-UDCXGDLQ.js.map → chunk-VOD5JA4D.js.map} +1 -1
- package/dist/chunk-WGPFR7MN.cjs +808 -0
- package/dist/chunk-WGPFR7MN.cjs.map +1 -0
- package/dist/chunk-WGZZKCJQ.cjs +157 -0
- package/dist/chunk-WGZZKCJQ.cjs.map +1 -0
- package/dist/chunk-XQTI4Q4I.js +178 -0
- package/dist/chunk-XQTI4Q4I.js.map +1 -0
- package/dist/devtools/index.cjs +13 -697
- package/dist/devtools/index.cjs.map +1 -1
- package/dist/document/index.cjs +56 -301
- package/dist/document/index.cjs.map +1 -1
- package/dist/examples/index.cjs +1161 -0
- package/dist/examples/index.cjs.map +1 -0
- package/dist/examples/index.d.cts +63 -0
- package/dist/examples/index.d.ts +63 -0
- package/dist/examples/index.js +1158 -0
- package/dist/examples/index.js.map +1 -0
- package/dist/i18n/index.cjs +44 -292
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.js +2 -176
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.cjs +335 -3911
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/migrations/index.cjs +7 -590
- package/dist/migrations/index.cjs.map +1 -1
- package/dist/reflect/index.cjs +85 -994
- package/dist/reflect/index.cjs.map +1 -1
- package/package.json +19 -8
- package/dist/chunk-RYIIIXDX.js.map +0 -1
- package/dist/{primitive-props-CGoJvmcH.d.cts → primitive-props-Cl5jiC8g.d.cts} +5 -5
- package/dist/{primitive-props-CGoJvmcH.d.ts → primitive-props-Cl5jiC8g.d.ts} +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# @niscorp/nova
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7f8d202: Under `require`, the entry points of nova, prism and strata share one copy of their code, as they always have under `import`.
|
|
8
|
+
|
|
9
|
+
The CommonJS build was not split, so every entry point carried its own copy of each class and of each React context. The ESM build is byte for byte what it was. Under `require`:
|
|
10
|
+
- an error from `@niscorp/strata/postgres`, `/check`, `/upgrade` or `/node` is an `instanceof` the `StrataError` that `@niscorp/strata` exports; one from `prismTransform` of `@niscorp/prism/migrations` is an `instanceof PrismError`; one from `<Nova.Layout>` is an `instanceof NovaError` and of its own class. None of them was.
|
|
11
|
+
- `upgradeStore` names the row it refused — `integration_actions (integration_id="…", action_id="…"): …`, with the upgrader's error as its `cause` — and so does a moss boot that meets a stored row it cannot read. Both gave the upgrader's sentence alone.
|
|
12
|
+
- a kit registered from `@niscorp/nova/adapters/react/components` renders under `<Nova.Shell>`. It threw `useShell must be used inside <NovaShellProvider>`.
|
|
13
|
+
|
|
14
|
+
**What to change:** nothing in an ESM app. A CommonJS app that had built on any of the above — a branch that ran because `instanceof` failed, a match on the whole text of an `upgradeStore` refusal — now sees what an ESM app sees. An app that loads both builds of one package in one process still has two copies of it.
|
|
15
|
+
|
|
16
|
+
## 0.2.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- fe30458: Every package exports its `package.json`, so an app can say which version of a package it runs by reading it from the package:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import prism from '@niscorp/prism/package.json' with { type: 'json' };
|
|
24
|
+
prism.version; // the version that is installed, not the range that asked for it
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Until now the `exports` map hid it, and the only way to the version was a path into `node_modules`. `check:packages` installs the tarballs and reads every package's version this way.
|
|
28
|
+
|
|
29
|
+
**What to change:** nothing. An app that read a version by path can read it by name.
|
|
30
|
+
|
|
31
|
+
- 353b3c3: `@niscorp/nova/examples` — the reference as data. `NOVA_EXAMPLES` is 42 examples, in six groups (`NOVA_EXAMPLE_GROUPS`): the layout grammar (12), actions at work (7), endpoints (5), composition with fragments (5), shells (8) and i18n (5).
|
|
32
|
+
|
|
33
|
+
An example is a small app, what is done to it, and what it must then say: `{ id, group, title, description, action | shell, fragments?, layouts?, replies?, fetches?, phrases?, phraseKeys?, stage?, presses, expected }`. `action` is one action alone on one canvas (an example of the layout grammar is an action with no triggers); `shell` is several actions on several canvases. `replies` and `fetches` say what its endpoints are answered, so an example comes to the same thing wherever it is run. `presses` is what is done: a press, something typed, or the host changing the language. `expected` is every piece of text the screen then holds (its text, and what stands in props at a prose key), the one action's data, which actions stand on each canvas, and what was sent to each URL.
|
|
34
|
+
|
|
35
|
+
Every id an example brings begins with its own, so a host can hold all of them in one shell. The examples a host puts on its stage name only the plain components every kit has (`Stack`, `Text`, `Button`, `Input`) and nova's two slots, with no prop about looks, so whoever shows them draws them with its own kit. An example with `stage: false` (the five on i18n) is shown as what it comes to. The package's tests run each one and hold it to its `expected`.
|
|
36
|
+
|
|
37
|
+
Not in it: the adapters' own seams (`slotWrapper`), the look of nova's default components, and the harvest functions of `@niscorp/nova/i18n`, which are called, not mounted.
|
|
38
|
+
|
|
39
|
+
**What to change:** nothing.
|
|
40
|
+
|
|
41
|
+
- 7222c7d: The README's quick example runs as written. It registered no components, so it printed an error node (`COMPONENT_NOT_FOUND: Component not found in registry: Box`) where its comment promised the tree — and with components registered, `console.log` would still have printed the tree's children as `[Object]`. It now takes the terminal kit (`defaultRegistry()` from `@niscorp/nova/adapters/tty/components`), writes its text as children, the way the kits draw it, sends one press, and prints the whole tree; what it prints is in the README. No code changed.
|
|
42
|
+
|
|
43
|
+
**What to change:** nothing.
|
|
44
|
+
|
|
45
|
+
- c8982c2: `shellIdle(shell, { waitMs?, stopped? })` — a wait for what a press set going.
|
|
46
|
+
|
|
47
|
+
`shellSettled` answers once nothing is mounting. That is the first screen being whole, and it says nothing about what happens afterwards: a trigger's steps run detached from the event that fired them, so after `dispatch` it can answer `true` while the call the press made is still out. Anything that pressed and then read the screen had to sleep.
|
|
48
|
+
|
|
49
|
+
`shellIdle` resolves `true` once nothing is mounting **and** no chain the shell started is still running: no trigger's steps, no `emit` on its way to its listeners and what they then call, no hook a navigation started — including the re-read of an action a `pop` reveals, which runs while that action is already `active`. It takes the options `shellSettled` takes, with the same default wait, and resolves `false` when the wait runs out.
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
shell.dispatch({ type: 'ui:click', ref: 'save', origin });
|
|
53
|
+
await shellIdle(shell, { waitMs: 5000 }); // the call has answered, and what it chained to has run
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
It is about the shell's own work. It does not wait for the next body of a read the shell is following (a reactive read answers again when somebody else writes; `shell.onDataChange` says when), nor for anything outside the shell that an endpoint set going. A call that never answers holds it until the call's own timeout fails it.
|
|
57
|
+
|
|
58
|
+
`shellSettled` is unchanged, and still asks about mounts alone: a page is read whenever it is asked for, also while a long call is out, and that read should not wait on it.
|
|
59
|
+
|
|
60
|
+
`ActionRuntimeConfig` gains an optional `onChain`, which is how a runtime reports what it starts and does not await; a shell made by `createShell` wires it.
|
|
61
|
+
|
|
62
|
+
**What to change:** nothing. A check that slept after a press can await `shellIdle` instead.
|
|
63
|
+
|
|
3
64
|
## 0.2.0
|
|
4
65
|
|
|
5
66
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -103,12 +103,8 @@ Explicitly out of scope right now:
|
|
|
103
103
|
## Quick example
|
|
104
104
|
|
|
105
105
|
```ts
|
|
106
|
-
import {
|
|
107
|
-
|
|
108
|
-
createComponentRegistry,
|
|
109
|
-
createLayoutStore,
|
|
110
|
-
type ActionDefinition,
|
|
111
|
-
} from '@niscorp/nova';
|
|
106
|
+
import { createShell, createLayoutStore, type ActionDefinition } from '@niscorp/nova';
|
|
107
|
+
import { defaultRegistry } from '@niscorp/nova/adapters/tty/components';
|
|
112
108
|
|
|
113
109
|
const counter: ActionDefinition = {
|
|
114
110
|
id: 'counter',
|
|
@@ -123,27 +119,57 @@ const counter: ActionDefinition = {
|
|
|
123
119
|
layout: {
|
|
124
120
|
component: 'Box',
|
|
125
121
|
children: [
|
|
126
|
-
{ component: 'Text',
|
|
127
|
-
{ component: 'Button', ref: 'inc',
|
|
122
|
+
{ component: 'Text', children: 'Count: {{$.count}}' },
|
|
123
|
+
{ component: 'Button', ref: 'inc', children: '+1' },
|
|
128
124
|
],
|
|
129
125
|
},
|
|
130
126
|
};
|
|
131
127
|
|
|
132
128
|
const shell = createShell({
|
|
133
129
|
canvases: [{ id: 'main' }],
|
|
134
|
-
registry:
|
|
130
|
+
registry: defaultRegistry(),
|
|
135
131
|
layoutStore: createLayoutStore(),
|
|
136
132
|
actions: { counter },
|
|
137
133
|
});
|
|
138
134
|
|
|
139
135
|
const id = shell.push('main', 'counter');
|
|
140
136
|
const runtime = shell.getRuntime(id);
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
shell.dispatch({ type: 'ui:click', ref: 'inc' });
|
|
138
|
+
console.dir(runtime?.render(), { depth: null });
|
|
143
139
|
```
|
|
144
140
|
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
It prints the `RenderNode[]` tree, after the press:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
[
|
|
145
|
+
{
|
|
146
|
+
type: 'component',
|
|
147
|
+
name: 'Box',
|
|
148
|
+
props: {},
|
|
149
|
+
children: [
|
|
150
|
+
{
|
|
151
|
+
type: 'component',
|
|
152
|
+
name: 'Text',
|
|
153
|
+
props: {},
|
|
154
|
+
children: [ { type: 'text', value: 'Count: 1' } ]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
type: 'component',
|
|
158
|
+
name: 'Button',
|
|
159
|
+
props: {},
|
|
160
|
+
children: [ { type: 'text', value: '+1' } ],
|
|
161
|
+
ref: 'inc'
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
There is no React in that example, and no browser. The registry is empty
|
|
169
|
+
until a kit is registered, and a layout that names a component it does not
|
|
170
|
+
hold renders an error node (`COMPONENT_NOT_FOUND`) in its place;
|
|
171
|
+
`defaultRegistry()` is the terminal kit. A framework adapter would consume the
|
|
172
|
+
same `RenderNode[]` and produce real elements.
|
|
147
173
|
|
|
148
174
|
---
|
|
149
175
|
|
|
@@ -453,6 +479,23 @@ one, and checks every captured lab-app document still upgrades and parses.
|
|
|
453
479
|
|
|
454
480
|
---
|
|
455
481
|
|
|
482
|
+
## Examples
|
|
483
|
+
|
|
484
|
+
`@niscorp/nova/examples` exports the reference as data. `NOVA_EXAMPLES` is a list of small apps, each with what is done to it and what it must then say; `NOVA_EXAMPLE_GROUPS` names the groups they come in (layouts, actions, endpoints, composition, shells, i18n), in reading order.
|
|
485
|
+
|
|
486
|
+
```ts
|
|
487
|
+
import { NOVA_EXAMPLES } from '@niscorp/nova/examples';
|
|
488
|
+
|
|
489
|
+
const counter = NOVA_EXAMPLES.find((example) => example.id === 'counter');
|
|
490
|
+
// counter.action is an ActionDefinition: mount it in a shell and draw it with your own kit
|
|
491
|
+
// counter.presses: [{ ref: 'more' }, { ref: 'more' }, { ref: 'fewer' }]
|
|
492
|
+
// counter.expected: { data: { count: 1 }, says: ['Count: 1', 'One more', 'One fewer'] }
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
An example is one action alone on a canvas (`action`) or a small shell (`shell`: canvases, actions, and how the canvases are arranged). Beside either stand what it needs from its host: `fragments`, stored `layouts`, a phrase book (`phrases`, `phraseKeys`), and what its endpoints are answered (`replies` for `fn:`, `fetches` for a URL). Every id an example brings begins with the example's own, so a host can hold all of them in one shell.
|
|
496
|
+
|
|
497
|
+
The examples name only the plain components every kit has (`Stack`, `Text`, `Button`, `Input`) and nova's two slots, with no prop about looks. One that says `stage: false` (the ones on i18n) cannot simply be mounted beside a host's own screens, and is shown as what it comes to. The package's tests run each one, so what they say is what this version does.
|
|
498
|
+
|
|
456
499
|
## Building / dev
|
|
457
500
|
|
|
458
501
|
```bash
|
package/SHELL_DOCS.md
CHANGED
|
@@ -529,12 +529,12 @@ useEffect(() => {
|
|
|
529
529
|
|
|
530
530
|
Always dispose shells you create — they hold references to runtimes which hold references to event listeners.
|
|
531
531
|
|
|
532
|
-
### `shellView(shell)` and `
|
|
532
|
+
### `shellView(shell)`, `shellSettled(shell)` and `shellIdle(shell)`
|
|
533
533
|
|
|
534
|
-
|
|
534
|
+
Three helpers beside the shell: for anything that draws one, and for anything that presses something on one and reads what came of it.
|
|
535
535
|
|
|
536
536
|
```ts
|
|
537
|
-
import { shellView, shellSettled } from '@niscorp/nova';
|
|
537
|
+
import { shellView, shellSettled, shellIdle } from '@niscorp/nova';
|
|
538
538
|
|
|
539
539
|
const { api, subscribe } = shellView(shell); // the shell, as a RenderApi
|
|
540
540
|
api.frame(); // the shell layout's tree
|
|
@@ -543,12 +543,21 @@ api.dispatch('main', { type: 'ui:click', ref: 'save' }); // to the canvas's ac
|
|
|
543
543
|
const stop = subscribe(() => redraw()); // once per burst of changes
|
|
544
544
|
|
|
545
545
|
const whole = await shellSettled(shell, { waitMs: 300 }); // true: nothing is still mounting
|
|
546
|
+
|
|
547
|
+
api.dispatch('main', { type: 'ui:click', ref: 'save' });
|
|
548
|
+
const done = await shellIdle(shell, { waitMs: 5000 }); // true: what the press set going has finished
|
|
546
549
|
```
|
|
547
550
|
|
|
548
|
-
`api.dispatch` stamps an event that names no `origin` with the canvas's active instance; `api.publish(channel, payload?)` is `shell.publish`. `shellSettled` also
|
|
551
|
+
`api.dispatch` stamps an event that names no `origin` with the canvas's active instance; `api.publish(channel, payload?)` is `shell.publish`. `shellSettled` and `shellIdle` also take `stopped?: () => boolean` — once it answers `true` the wait ends with `false`.
|
|
549
552
|
|
|
550
553
|
`shellView` is what lets an adapter written against `RenderApi` (the DOM and TTY adapters, a moss terminal) draw a shell that lives beside it. `shellSettled` resolves `true` once no instance is `initializing` — every mount hook, and what it chained to, has been awaited — and `false` if `waitMs` (default 300) runs out first. It is the moment to draw a shell to markup, and the moment for the page's own shell to adopt it.
|
|
551
554
|
|
|
555
|
+
`shellSettled` asks about mounts and nothing else. A trigger's steps run detached from the event that fired them, so after a press it can answer `true` while the call the press made is still out. `shellIdle` is the wider question: nothing is mounting **and** no chain the shell started is still running — no trigger's steps, no `emit` on its way to its listeners (and what they then call), no re-read of an action a `pop` revealed. It is what a check awaits after `dispatch` instead of sleeping, and what anything that runs an action for somebody else awaits before it reads the screen. Same options, same default wait, `false` when the wait runs out.
|
|
556
|
+
|
|
557
|
+
Two things it does not wait for, because they are not this shell's work: the next body of a read the shell is **following** (a reactive read under moss answers again when somebody writes — wait for that with `shell.onDataChange`), and anything outside the shell that an endpoint set going. A call that never answers holds it until the call's own timeout fails it (30s by default; an endpoint's `timeoutMs` wins), so pass the `waitMs` you mean.
|
|
558
|
+
|
|
559
|
+
`shellSettled` is deliberately not widened to this. A page is read whenever it is asked for, also while a long call is out, and that read should not wait on it.
|
|
560
|
+
|
|
552
561
|
---
|
|
553
562
|
|
|
554
563
|
## Multi-canvas patterns
|
|
@@ -1,58 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
for (var name in all)
|
|
6
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
// src/layout/registry.ts
|
|
10
|
-
var hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
11
|
-
var isComponentMeta = (value) => {
|
|
12
|
-
if (typeof value !== "object" || value === null) return false;
|
|
13
|
-
return true;
|
|
14
|
-
};
|
|
15
|
-
var extractStaticMeta = (component) => {
|
|
16
|
-
if (typeof component !== "function" && (typeof component !== "object" || component === null)) {
|
|
17
|
-
return void 0;
|
|
18
|
-
}
|
|
19
|
-
const host = component;
|
|
20
|
-
if (!hasOwn(host, "meta")) return void 0;
|
|
21
|
-
const candidate = host.meta;
|
|
22
|
-
if (!isComponentMeta(candidate)) return void 0;
|
|
23
|
-
return candidate;
|
|
24
|
-
};
|
|
25
|
-
var isEntryShape = (value) => {
|
|
26
|
-
if (typeof value !== "object" || value === null) return false;
|
|
27
|
-
return hasOwn(value, "component");
|
|
28
|
-
};
|
|
29
|
-
var createComponentRegistry = () => {
|
|
30
|
-
const entries = /* @__PURE__ */ new Map();
|
|
31
|
-
const register = (name, component, meta) => {
|
|
32
|
-
const staticMeta = extractStaticMeta(component);
|
|
33
|
-
const merged = { ...staticMeta ?? {}, ...meta ?? {} };
|
|
34
|
-
entries.set(name, { component, meta: merged });
|
|
35
|
-
};
|
|
36
|
-
const registerAll = (batch) => {
|
|
37
|
-
for (const name of Object.keys(batch)) {
|
|
38
|
-
const input = batch[name];
|
|
39
|
-
if (input === void 0) continue;
|
|
40
|
-
if (isEntryShape(input)) {
|
|
41
|
-
register(name, input.component, input.meta);
|
|
42
|
-
} else {
|
|
43
|
-
register(name, input);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const get = (name) => entries.get(name);
|
|
48
|
-
const has = (name) => entries.has(name);
|
|
49
|
-
const list = () => Array.from(entries.keys());
|
|
50
|
-
return { register, registerAll, get, has, list };
|
|
51
|
-
};
|
|
3
|
+
var chunkOE527MXF_cjs = require('../../../chunk-OE527MXF.cjs');
|
|
4
|
+
var chunkQ7SFCCGT_cjs = require('../../../chunk-Q7SFCCGT.cjs');
|
|
52
5
|
|
|
53
6
|
// src/adapters/dom/components/components.ts
|
|
54
7
|
var components_exports = {};
|
|
55
|
-
__export(components_exports, {
|
|
8
|
+
chunkQ7SFCCGT_cjs.__export(components_exports, {
|
|
56
9
|
ActionSlot: () => ActionSlot,
|
|
57
10
|
Box: () => Box,
|
|
58
11
|
Button: () => Button,
|
|
@@ -373,7 +326,7 @@ var fallback = ({ props, children }) => {
|
|
|
373
326
|
|
|
374
327
|
// src/adapters/dom/components/registry.ts
|
|
375
328
|
var defaultRegistry = () => {
|
|
376
|
-
const registry = createComponentRegistry();
|
|
329
|
+
const registry = chunkOE527MXF_cjs.createComponentRegistry();
|
|
377
330
|
registry.registerAll({
|
|
378
331
|
Box,
|
|
379
332
|
Row,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/layout/registry.ts","../../../../src/adapters/dom/components/components.ts","../../../../src/adapters/dom/components/props.ts","../../../../src/adapters/dom/components/registry.ts","../../../../src/adapters/dom/components/styles.ts"],"names":[],"mappings":";;;;;;;;;AAgBA,IAAM,MAAA,GAAS,CAAC,KAAA,EAAe,GAAA,KAC7B,OAAO,SAAA,CAAU,cAAA,CAAe,IAAA,CAAK,KAAA,EAAO,GAAG,CAAA;AAEjD,IAAM,eAAA,GAAkB,CAAC,KAAA,KAA2C;AAClE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,MAAM,OAAO,KAAA;AAExD,EAAA,OAAO,IAAA;AACT,CAAA;AAEA,IAAM,iBAAA,GAAoB,CAAa,SAAA,KAAqD;AAC1F,EAAA,IAAI,OAAO,SAAA,KAAc,UAAA,KAAe,OAAO,SAAA,KAAc,QAAA,IAAY,cAAc,IAAA,CAAA,EAAO;AAC5F,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,MAAM,IAAA,GAAe,SAAA;AACrB,EAAA,IAAI,CAAC,MAAA,CAAO,IAAA,EAAM,MAAM,GAAG,OAAO,MAAA;AAClC,EAAA,MAAM,YAAa,IAAA,CAA2B,IAAA;AAC9C,EAAA,IAAI,CAAC,eAAA,CAAgB,SAAS,CAAA,EAAG,OAAO,MAAA;AACxC,EAAA,OAAO,SAAA;AACT,CAAA;AAEA,IAAM,YAAA,GAAe,CACnB,KAAA,KAC6D;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,EACV,UAAU,CAAA;AAAA,CAAA,EACV,UAAU,CAAA;AAAA,CAAA,EACV,UAAU,CAAA;AAAA","file":"index.cjs","sourcesContent":["import type {\n ComponentEntry,\n ComponentMeta,\n ComponentRegistry,\n RegistrationInput,\n} from './types';\n\n// ═══════════════════════════════════════════════════════════\n// Component registry\n//\n// Stores `{component, meta}` entries keyed by name. Components\n// can carry a static `.meta` property; `registerAll` picks it up\n// automatically. Explicit meta passed to `register`/`registerAll`\n// wins over a component's static meta.\n// ═══════════════════════════════════════════════════════════\n\nconst hasOwn = (value: object, key: string): boolean =>\n Object.prototype.hasOwnProperty.call(value, key);\n\nconst isComponentMeta = (value: unknown): value is ComponentMeta => {\n if (typeof value !== 'object' || value === null) return false;\n // Meta is an open bag with optional fields; any plain object qualifies.\n return true;\n};\n\nconst extractStaticMeta = <TComponent>(component: TComponent): ComponentMeta | undefined => {\n if (typeof component !== 'function' && (typeof component !== 'object' || component === null)) {\n return undefined;\n }\n const host: object = component;\n if (!hasOwn(host, 'meta')) return undefined;\n const candidate = (host as { meta: unknown }).meta;\n if (!isComponentMeta(candidate)) return undefined;\n return candidate;\n};\n\nconst isEntryShape = <TComponent>(\n value: RegistrationInput<TComponent>,\n): value is { component: TComponent; meta?: ComponentMeta } => {\n if (typeof value !== 'object' || value === null) return false;\n return hasOwn(value, 'component');\n};\n\nexport const createComponentRegistry = <TComponent = unknown>(): ComponentRegistry<TComponent> => {\n const entries = new Map<string, ComponentEntry<TComponent>>();\n\n const register = (name: string, component: TComponent, meta?: ComponentMeta): void => {\n const staticMeta = extractStaticMeta(component);\n const merged: ComponentMeta = { ...(staticMeta ?? {}), ...(meta ?? {}) };\n entries.set(name, { component, meta: merged });\n };\n\n const registerAll = (batch: Record<string, RegistrationInput<TComponent>>): void => {\n for (const name of Object.keys(batch)) {\n const input = batch[name];\n if (input === undefined) continue;\n if (isEntryShape<TComponent>(input)) {\n register(name, input.component, input.meta);\n } else {\n register(name, input);\n }\n }\n };\n\n const get = (name: string): ComponentEntry<TComponent> | undefined => entries.get(name);\n\n const has = (name: string): boolean => entries.has(name);\n\n const list = (): string[] => Array.from(entries.keys());\n\n return { register, registerAll, get, has, list };\n};\n","import type { DomComponent } from '../index';\nimport { boxStyle, flexStyle, gridStyle, textStyle, css, str, num, bool, iconGlyph } from './props';\n\n// ═══════════════════════════════════════════════════════════\n// The DOM reference kit — domain-blind primitives (no entity nouns) that map\n// nova's presentational props to semantic elements. A component is a component;\n// the registry (registry.ts) only registers them, and the look lives in\n// styles.ts. Unmapped names fall back to a div (fallback), so any app's tree\n// still renders its content.\n// ═══════════════════════════════════════════════════════════\n\nconst elem = (tag: string, children: Node[]): HTMLElement => {\n const node = document.createElement(tag);\n for (const child of children) node.appendChild(child);\n return node;\n};\n\nexport const Box: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n css(el, boxStyle(props));\n return el;\n};\n\nexport const Row: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n css(el, { ...flexStyle(props, 'row'), ...boxStyle(props) });\n return el;\n};\n\nexport const Stack: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n css(el, { ...flexStyle(props, 'column'), ...boxStyle(props) });\n return el;\n};\n\nexport const Grid: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n css(el, { ...gridStyle(props), ...boxStyle(props) });\n return el;\n};\n\nexport const Text: DomComponent = ({ props, children }) => {\n const el = elem(str(props, 'as') ?? 'span', children);\n css(el, textStyle(props));\n return el;\n};\n\nexport const Button: DomComponent = ({ props, children }) => {\n const el = elem('button', children);\n const icon = str(props, 'icon');\n if (children.length === 0 && icon !== undefined) el.textContent = iconGlyph(icon);\n // Expose variant + size as data-attrs so styles.ts can dress every variant\n // (primary/ghost/danger/…), not just primary. The look stays in the CSS.\n const variant = str(props, 'variant');\n if (variant !== undefined) el.setAttribute('data-variant', variant);\n const size = str(props, 'size');\n if (size !== undefined) el.setAttribute('data-size', size);\n return el;\n};\n\nconst inputEl = (props: Record<string, unknown>): HTMLInputElement => {\n const el = document.createElement('input');\n el.type = str(props, 'type') ?? 'text';\n const placeholder = str(props, 'placeholder');\n if (placeholder !== undefined) el.placeholder = placeholder;\n const value = props['value'];\n if (typeof value === 'string' || typeof value === 'number') el.value = String(value);\n const width = num(props, 'w') ?? num(props, 'width');\n if (width !== undefined) el.style.setProperty('width', `${width}px`);\n return el;\n};\n\nexport const Input: DomComponent = ({ props }) => inputEl(props);\n\nexport const Checkbox: DomComponent = ({ props }) => {\n const el = document.createElement('input');\n el.type = 'checkbox';\n el.checked = bool(props, 'value') || bool(props, 'checked');\n return el;\n};\n\nexport const Textarea: DomComponent = ({ props }) => {\n const el = document.createElement('textarea');\n const value = props['value'];\n if (typeof value === 'string' || typeof value === 'number') el.value = String(value);\n return el;\n};\n\n// Dotted-path field access for the data-driven table.\nconst at = (row: unknown, key: string): unknown => {\n let cursor: unknown = row;\n for (const segment of key.split('.')) {\n if (cursor === null || typeof cursor !== 'object') return undefined;\n cursor = Reflect.get(cursor, segment);\n }\n return cursor;\n};\nconst cellText = (value: unknown): string => (value === null || value === undefined ? '' : String(value));\n\ntype Column = { label?: unknown; cell?: { key?: unknown } };\n\nconst columnsOf = (props: Record<string, unknown>): Column[] => {\n const value = props['columns'];\n if (!Array.isArray(value)) return [];\n const out: Column[] = [];\n for (const item of value) if (item !== null && typeof item === 'object') out.push(item);\n return out;\n};\nconst cellKey = (column: Column): string => (typeof column.cell?.key === 'string' ? column.cell.key : '');\n\n// The one data-driven primitive worth interpreting so lists show content: a\n// header from `columns`, a body from `rows`, and a row click dispatching\n// `rowRef` with row[clickKey ?? rowKey].\nexport const Table: DomComponent = ({ props, dispatch }) => {\n const columns = columnsOf(props);\n const rows = Array.isArray(props['rows']) ? props['rows'] : [];\n const rowKey = str(props, 'rowKey') ?? 'id';\n const clickKey = str(props, 'clickKey') ?? rowKey;\n const rowRef = str(props, 'rowRef');\n\n const table = document.createElement('table');\n const head = document.createElement('thead');\n const headRow = document.createElement('tr');\n for (const column of columns) {\n const th = document.createElement('th');\n th.textContent = typeof column.label === 'string' ? column.label : '';\n headRow.appendChild(th);\n }\n head.appendChild(headRow);\n table.appendChild(head);\n\n const body = document.createElement('tbody');\n if (rows.length === 0) {\n const tr = document.createElement('tr');\n const td = document.createElement('td');\n td.setAttribute('colspan', String(Math.max(1, columns.length)));\n td.textContent = str(props, 'empty') ?? 'Nothing here.';\n tr.appendChild(td);\n body.appendChild(tr);\n } else {\n for (const row of rows) {\n const tr = document.createElement('tr');\n for (const column of columns) {\n const td = document.createElement('td');\n td.textContent = cellText(at(row, cellKey(column)));\n tr.appendChild(td);\n }\n if (rowRef !== undefined) {\n tr.setAttribute('data-row', '');\n tr.addEventListener('click', () => dispatch({ type: 'ui:click', ref: rowRef, payload: at(row, clickKey) }));\n }\n body.appendChild(tr);\n }\n }\n table.appendChild(body);\n return table;\n};\n\n// Panel — a framed, elevated surface with an optional title header. The\n// generic version of a devtools/dashboard panel.\nexport const Panel: DomComponent = ({ props, children, dispatch }) => {\n const el = document.createElement('div');\n el.setAttribute('data-panel', '');\n const title = str(props, 'title');\n if (title !== undefined) {\n const head = document.createElement('div');\n head.setAttribute('data-panel-title', '');\n // `backRef`/`closeRef` — header ← and ✕, same prop-ref convention as\n // Table's rowRef: ← before the title, ✕ after it\n const backRef = str(props, 'backRef');\n if (backRef !== undefined) {\n const back = document.createElement('button');\n back.type = 'button';\n back.textContent = '←';\n back.addEventListener('click', (e) => {\n e.stopPropagation();\n dispatch({ type: 'ui:click', ref: backRef });\n });\n head.appendChild(back);\n }\n head.appendChild(document.createTextNode(title));\n const closeRef = str(props, 'closeRef');\n if (closeRef !== undefined) {\n const close = document.createElement('button');\n close.type = 'button';\n close.textContent = '✕';\n close.addEventListener('click', (e) => {\n e.stopPropagation();\n dispatch({ type: 'ui:click', ref: closeRef });\n });\n head.appendChild(close);\n }\n el.appendChild(head);\n }\n for (const child of children) el.appendChild(child);\n return el;\n};\n\n// JsonTree — a collapsible view of any JSON value. Uses native <details> so it\n// folds without a line of script. The value arrives resolved in props (the\n// server rendered it); `label` names the root.\nconst jsonNode = (value: unknown, key: string | undefined): HTMLElement => {\n if (value !== null && typeof value === 'object') {\n const entries = Array.isArray(value) ? value.map((item, i): [string, unknown] => [String(i), item]) : Object.entries(value);\n const details = document.createElement('details');\n const summary = document.createElement('summary');\n const shape = Array.isArray(value) ? `[${entries.length}]` : `{${entries.length}}`;\n summary.textContent = key === undefined ? shape : `${key} ${shape}`;\n details.appendChild(summary);\n const body = document.createElement('div');\n body.setAttribute('data-json-body', '');\n for (const [childKey, childValue] of entries) body.appendChild(jsonNode(childValue, childKey));\n details.appendChild(body);\n return details;\n }\n const leaf = document.createElement('div');\n leaf.setAttribute('data-json-leaf', '');\n leaf.textContent = key === undefined ? JSON.stringify(value) : `${key}: ${JSON.stringify(value)}`;\n return leaf;\n};\n\nexport const JsonTree: DomComponent = ({ props }) => {\n const el = document.createElement('div');\n el.setAttribute('data-json', '');\n el.appendChild(jsonNode(props['value'], str(props, 'label')));\n return el;\n};\n\n// The per-instance boundary marker a flattened shell tree carries (identity in\n// props, the instance's rendered content as children). The DOM target has no\n// wrapper concept, so it passes the content straight through — the marker is\n// wire protocol, decoration is a per-target concern.\nexport const ActionSlot: DomComponent = ({ children }) => elem('div', children);\n\n// Unmapped primitives (an app's own NavItem, KanbanBoard, …) render as a div\n// with their children — content shows, and a `ref` still wires a click. When a\n// prop-driven component carries NO children, surface its primary text prop\n// (label / title / name / text) plus a `count` — so a nav link or list row\n// still reads instead of vanishing into an empty box. A legible degrade, not a\n// full port: the app's own DOM kit is what makes it pretty (icons, theme).\nexport const fallback: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n if (children.length > 0) return el;\n // Only unambiguous display strings — NOT `name` (Icon/field id) or `value`.\n const label = str(props, 'label') ?? str(props, 'title');\n if (label !== undefined) el.appendChild(document.createTextNode(label));\n const count = props['count'];\n if (typeof count === 'number' || (typeof count === 'string' && count !== '')) {\n const badge = document.createElement('span');\n badge.setAttribute('data-count', '');\n badge.textContent = String(count);\n el.appendChild(badge);\n }\n return el;\n};\n","// ═══════════════════════════════════════════════════════════\n// Reading nova's presentational prop vocabulary into inline styles. These are\n// LAYOUT props (gap, justify, padding, size, weight) — universal, not domain\n// nouns — so a reference kit can honor them and real structure renders. The\n// readers narrow `unknown` with `typeof`; there are no casts.\n// ═══════════════════════════════════════════════════════════\n\nexport type Props = Record<string, unknown>;\n\nexport const num = (props: Props, key: string): number | undefined => {\n const value = props[key];\n return typeof value === 'number' ? value : undefined;\n};\n\nexport const str = (props: Props, key: string): string | undefined => {\n const value = props[key];\n return typeof value === 'string' ? value : undefined;\n};\n\nexport const bool = (props: Props, key: string): boolean => props[key] === true;\n\n// A CSS dimension: a number is pixels, a string passes through ('100%', '100vh').\nexport const dim = (value: unknown): string | undefined =>\n typeof value === 'number' ? `${value}px` : typeof value === 'string' ? value : undefined;\n\nconst px = (value: number | undefined): string | undefined => (value === undefined ? undefined : `${value}px`);\n\nconst JUSTIFY: Record<string, string> = {\n start: 'flex-start', center: 'center', end: 'flex-end', between: 'space-between', around: 'space-around', stretch: 'stretch',\n};\nconst ALIGN: Record<string, string> = {\n start: 'flex-start', center: 'center', end: 'flex-end', stretch: 'stretch', baseline: 'baseline',\n};\nconst SIZE: Record<string, string> = { xs: '12px', sm: '13px', md: '14px', lg: '16px', xl: '20px', '2xl': '24px' };\nconst WEIGHT: Record<string, string> = { normal: '400', medium: '500', semibold: '600', bold: '700' };\nconst COLOR: Record<string, string> = {\n mute: 'var(--dom-mute)', muted: 'var(--dom-mute)', dim: 'var(--dom-mute)', secondary: '#4b5563', accent: 'var(--dom-accent)',\n};\nconst BG: Record<string, string> = { surface: '#fbfcfd', canvas: '#ffffff', dim: '#f4f5f7', mute: '#f4f5f7' };\n\n// A style record for any element: setProperty skips undefined, so absent props\n// leave the browser default.\nexport const css = (el: HTMLElement, style: Record<string, string | undefined>): void => {\n for (const [key, value] of Object.entries(style)) if (value !== undefined) el.style.setProperty(key, value);\n};\n\n// Box/spacing props shared by every container.\nexport const boxStyle = (props: Props): Record<string, string | undefined> => {\n const p = num(props, 'p') ?? num(props, 'padding');\n const border = props['border'];\n const bg = str(props, 'bg') ?? str(props, 'background');\n return {\n width: dim(props['w']) ?? dim(props['width']),\n height: dim(props['h']) ?? dim(props['height']),\n padding: px(p),\n 'padding-left': px(num(props, 'px')),\n 'padding-right': px(num(props, 'px')),\n 'padding-top': px(num(props, 'py')),\n 'padding-bottom': px(num(props, 'py')),\n 'flex-grow': bool(props, 'grow') ? '1' : undefined,\n background: bg === undefined ? undefined : BG[bg] ?? bg,\n 'border-radius': px(num(props, 'radius')),\n border: border === true ? '1px solid var(--dom-line)' : undefined,\n [`border-${typeof border === 'string' ? border : 'x'}`]: typeof border === 'string' ? '1px solid var(--dom-line)' : undefined,\n };\n};\n\n// Flex layout props (Row/Stack).\nexport const flexStyle = (props: Props, direction: 'row' | 'column'): Record<string, string | undefined> => ({\n display: 'flex',\n 'flex-direction': direction,\n gap: px(num(props, 'gap')),\n 'align-items': ALIGN[str(props, 'align') ?? ''],\n 'justify-content': JUSTIFY[str(props, 'justify') ?? ''],\n 'flex-wrap': bool(props, 'wrap') ? 'wrap' : undefined,\n});\n\n// Grid props — `columns` (N equal tracks) or `weights` ([2,1,1] → fr tracks).\n// Relay's tables and tile rows are grids, not stacks; honoring this is what\n// makes rows lay out horizontally instead of collapsing to a column.\nexport const gridStyle = (props: Props): Record<string, string | undefined> => {\n const columns = num(props, 'columns');\n const weights = props['weights'];\n const template = Array.isArray(weights)\n ? weights.map((w) => (typeof w === 'number' ? `${w}fr` : '1fr')).join(' ')\n : columns !== undefined\n ? `repeat(${columns}, 1fr)`\n : undefined;\n return {\n display: 'grid',\n 'grid-template-columns': template,\n gap: px(num(props, 'gap')),\n 'align-items': ALIGN[str(props, 'align') ?? ''],\n };\n};\n\n// Typography props (Text).\nexport const textStyle = (props: Props): Record<string, string | undefined> => {\n const size = str(props, 'size');\n const weightNum = num(props, 'weight');\n const color = str(props, 'color');\n return {\n 'font-size': size === undefined ? undefined : SIZE[size] ?? size,\n 'font-weight': weightNum !== undefined ? String(weightNum) : WEIGHT[str(props, 'weight') ?? ''],\n color: color === undefined ? undefined : COLOR[color] ?? color,\n 'text-transform': bool(props, 'upper') ? 'uppercase' : undefined,\n 'letter-spacing': bool(props, 'upper') ? '0.04em' : undefined,\n };\n};\n\n// A handful of icon names → a glyph, so icon-only buttons show something.\nconst ICON: Record<string, string> = {\n plus: '+', bell: '\\u{1F514}', sparkles: '✨', more: '⋯', search: '\\u{1F50D}', check: '✓', close: '✕', settings: '⚙',\n};\nexport const iconGlyph = (name: string): string => ICON[name] ?? name;\n","import { createComponentRegistry } from '@layout/registry';\nimport type { ComponentRegistry } from '@layout/types';\nimport type { DomComponent } from '../index';\nimport { ActionSlot, Box, Row, Stack, Grid, Text, Button, Input, Checkbox, Textarea, Table, Panel, JsonTree } from './components';\n\n// ═══════════════════════════════════════════════════════════\n// The default registry — it only REGISTERS the components (components.ts). The\n// vocabulary is domain-blind: layout, text, form, and table primitives, no\n// entity nouns. Grid honors `columns`/`weights` (so tile rows and column\n// layouts lay out horizontally); an app's own component names fall back to a\n// div (see the renderer's `fallback`).\n// ═══════════════════════════════════════════════════════════\n\nexport const defaultRegistry = (): ComponentRegistry<DomComponent> => {\n const registry = createComponentRegistry<DomComponent>();\n registry.registerAll({\n Box,\n Row,\n Stack,\n Grid,\n Text,\n Button,\n Input,\n Select: Input,\n Textarea,\n Checkbox,\n Switch: Checkbox,\n Table,\n // introspection primitives (used by nova/devtools; useful anywhere)\n Panel,\n JsonTree,\n // the per-instance boundary from a flattened shell tree — pass-through\n ActionSlot,\n });\n return registry;\n};\n","// ═══════════════════════════════════════════════════════════\n// The default kit's stylesheet — a self-contained, legible neutral look, so\n// the terminal reads the same regardless of the host app's CSS. Layout comes\n// from the inline styles the components set (props.ts); this only supplies the\n// base scheme, form-control chrome, and table lines. Scoped to\n// `.nova-dom-root`, which the target stamps on the mount element.\n// ═══════════════════════════════════════════════════════════\n\nexport const ROOT_CLASS = 'nova-dom-root';\n\nexport const DEFAULT_CSS = `\n.${ROOT_CLASS} {\n --dom-line: #d8dae0; --dom-mute: #6b7280; --dom-accent: #2563eb;\n --dom-ink: #14161a; --dom-field: #fff;\n /* Own the scheme: a host that declares color-scheme: dark would otherwise\n make the browser paint every native control (inputs, checkboxes, the\n select arrow, scrollbars) dark, right through this white surface. */\n color-scheme: light;\n background: #fff; color: var(--dom-ink); min-height: 100vh;\n font: 14px/1.5 system-ui, sans-serif;\n}\n.${ROOT_CLASS} * { box-sizing: border-box; }\n.${ROOT_CLASS} [data-canvas=\"sidebar\"] { min-width: 210px; border-right: 1px solid var(--dom-line); padding: 12px; }\n.${ROOT_CLASS} [data-canvas=\"topbar\"] { border-bottom: 1px solid var(--dom-line); padding: 10px 14px; }\n/* Common shell canvases — the same batteries as sidebar/topbar, so a typical\n app frame lays out sanely with zero host CSS. Aside/modal/devtools honour the\n empty-tree contract (a collapsed canvas sends [] → :empty → no chrome). An\n app with other ids hands its own stylesheet to domTarget. */\n.${ROOT_CLASS} [data-canvas=\"main\"] { flex: 1 1 auto; min-width: 0; padding: 16px; overflow: auto; }\n.${ROOT_CLASS} [data-canvas=\"aside\"]:not(:empty) { min-width: 240px; border-left: 1px solid var(--dom-line); padding: 12px; overflow: auto; }\n.${ROOT_CLASS} [data-canvas=\"modal\"]:not(:empty) { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 17, 20, .35); }\n/* devtools is a DOCK: float it bottom-right, bounded and scrollable, rather\n than let it sprawl through the document. Sized to content, so the collapsed\n ⚙ pill stays small; the Panel inside supplies the card chrome. */\n.${ROOT_CLASS} [data-canvas=\"devtools\"]:not(:empty) { position: fixed; right: 12px; bottom: 12px; z-index: 60; width: max-content; max-width: min(680px, calc(100vw - 24px)); max-height: 62vh; overflow: auto; }\n.${ROOT_CLASS} [data-component=\"Badge\"] { display: inline-block; padding: 1px 7px; border: 1px solid var(--dom-line); border-radius: 10px; font-size: 12px; }\n.${ROOT_CLASS} [data-component=\"NavItem\"] { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }\n.${ROOT_CLASS} [data-component=\"NavItem\"]:hover { background: #f4f5f7; }\n.${ROOT_CLASS} [data-count] { margin-left: auto; color: var(--dom-mute); font-size: 12px; }\n.${ROOT_CLASS} button { font: inherit; padding: 5px 11px; border: 1px solid var(--dom-line); border-radius: 6px; background: #fff; color: var(--dom-ink); cursor: pointer; }\n.${ROOT_CLASS} button:hover { background: #f4f5f7; }\n.${ROOT_CLASS} button[data-variant=\"primary\"] { background: var(--dom-accent); border-color: var(--dom-accent); color: #fff; }\n.${ROOT_CLASS} button[data-variant=\"primary\"]:hover { background: #1d4ed8; }\n.${ROOT_CLASS} button[data-variant=\"ghost\"] { background: transparent; border-color: transparent; }\n.${ROOT_CLASS} button[data-variant=\"ghost\"]:hover { background: #f4f5f7; }\n.${ROOT_CLASS} button[data-variant=\"danger\"] { color: #b91c1c; border-color: #f0c8c8; }\n.${ROOT_CLASS} button[data-variant=\"danger\"]:hover { background: #fdf2f2; }\n.${ROOT_CLASS} button[data-size=\"sm\"] { padding: 3px 8px; font-size: 12px; border-radius: 5px; }\n.${ROOT_CLASS} button[data-size=\"lg\"] { padding: 8px 14px; font-size: 15px; }\n.${ROOT_CLASS} select { appearance: none; padding-right: 26px; cursor: pointer; background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E\"); background-repeat: no-repeat; background-position: right 9px center; }\n.${ROOT_CLASS} input, .${ROOT_CLASS} textarea, .${ROOT_CLASS} select {\n font: inherit; padding: 5px 8px; border: 1px solid var(--dom-line); border-radius: 6px;\n background: var(--dom-field); color: var(--dom-ink); /* self-contained — never inherit the host's field colors */\n}\n.${ROOT_CLASS} input::placeholder, .${ROOT_CLASS} textarea::placeholder { color: var(--dom-mute); }\n.${ROOT_CLASS} input:focus, .${ROOT_CLASS} textarea:focus, .${ROOT_CLASS} select:focus {\n outline: none; border-color: var(--dom-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);\n}\n.${ROOT_CLASS} input[type=\"checkbox\"], .${ROOT_CLASS} input[type=\"radio\"] { accent-color: var(--dom-accent); width: 15px; height: 15px; }\n.${ROOT_CLASS} input[type=\"text\"], .${ROOT_CLASS} input:not([type]) { min-width: 180px; }\n.${ROOT_CLASS} table { border-collapse: collapse; width: 100%; }\n.${ROOT_CLASS} th, .${ROOT_CLASS} td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--dom-line); font-size: 14px; }\n.${ROOT_CLASS} th { color: var(--dom-mute); font-weight: 600; font-size: 12px; }\n.${ROOT_CLASS} tr[data-row] { cursor: pointer; }\n.${ROOT_CLASS} tr[data-row]:hover td { background: #f4f5f7; }\n.${ROOT_CLASS} [data-nova-error] { color: #b91c1c; font-size: 12px; }\n.${ROOT_CLASS} [data-panel] { border: 1px solid var(--dom-line); border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 12px; }\n.${ROOT_CLASS} [data-panel-title] { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 8px; }\n.${ROOT_CLASS} [data-panel-title] button { padding: 0 4px; border: 0; background: transparent; color: var(--dom-mute); }\n.${ROOT_CLASS} [data-panel-title] button:last-child { margin-left: auto; }\n.${ROOT_CLASS} [data-json] { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }\n.${ROOT_CLASS} [data-json-body] { padding-left: 13px; border-left: 1px solid var(--dom-line); margin-left: 3px; }\n.${ROOT_CLASS} [data-json] summary { cursor: pointer; color: var(--dom-mute); }\n.${ROOT_CLASS} [data-json-leaf] { white-space: pre-wrap; word-break: break-word; }\n`;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/adapters/dom/components/components.ts","../../../../src/adapters/dom/components/props.ts","../../../../src/adapters/dom/components/registry.ts","../../../../src/adapters/dom/components/styles.ts"],"names":["__export","createComponentRegistry"],"mappings":";;;;;;AAAA,IAAA,kBAAA,GAAA;AAAAA,0BAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,GAAA,EAAA,MAAA,GAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,GAAA,EAAA,MAAA,GAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,QAAA,EAAA,MAAA;AAAA,CAAA,CAAA;;;ACSO,IAAM,GAAA,GAAM,CAAC,KAAA,EAAc,GAAA,KAAoC;AACpE,EAAA,MAAM,KAAA,GAAQ,MAAM,GAAG,CAAA;AACvB,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,GAAW,KAAA,GAAQ,MAAA;AAC7C,CAAA;AAEO,IAAM,GAAA,GAAM,CAAC,KAAA,EAAc,GAAA,KAAoC;AACpE,EAAA,MAAM,KAAA,GAAQ,MAAM,GAAG,CAAA;AACvB,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,GAAW,KAAA,GAAQ,MAAA;AAC7C,CAAA;AAEO,IAAM,OAAO,CAAC,KAAA,EAAc,GAAA,KAAyB,KAAA,CAAM,GAAG,CAAA,KAAM,IAAA;AAGpE,IAAM,GAAA,GAAM,CAAC,KAAA,KAClB,OAAO,KAAA,KAAU,QAAA,GA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ACV,UAAU,CAAA;AAAA,CAAA,EACV,UAAU,CAAA;AAAA,CAAA,EACV,UAAU,CAAA;AAAA,CAAA,EACV,UAAU,CAAA;AAAA","file":"index.cjs","sourcesContent":["import type { DomComponent } from '../index';\nimport { boxStyle, flexStyle, gridStyle, textStyle, css, str, num, bool, iconGlyph } from './props';\n\n// ═══════════════════════════════════════════════════════════\n// The DOM reference kit — domain-blind primitives (no entity nouns) that map\n// nova's presentational props to semantic elements. A component is a component;\n// the registry (registry.ts) only registers them, and the look lives in\n// styles.ts. Unmapped names fall back to a div (fallback), so any app's tree\n// still renders its content.\n// ═══════════════════════════════════════════════════════════\n\nconst elem = (tag: string, children: Node[]): HTMLElement => {\n const node = document.createElement(tag);\n for (const child of children) node.appendChild(child);\n return node;\n};\n\nexport const Box: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n css(el, boxStyle(props));\n return el;\n};\n\nexport const Row: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n css(el, { ...flexStyle(props, 'row'), ...boxStyle(props) });\n return el;\n};\n\nexport const Stack: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n css(el, { ...flexStyle(props, 'column'), ...boxStyle(props) });\n return el;\n};\n\nexport const Grid: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n css(el, { ...gridStyle(props), ...boxStyle(props) });\n return el;\n};\n\nexport const Text: DomComponent = ({ props, children }) => {\n const el = elem(str(props, 'as') ?? 'span', children);\n css(el, textStyle(props));\n return el;\n};\n\nexport const Button: DomComponent = ({ props, children }) => {\n const el = elem('button', children);\n const icon = str(props, 'icon');\n if (children.length === 0 && icon !== undefined) el.textContent = iconGlyph(icon);\n // Expose variant + size as data-attrs so styles.ts can dress every variant\n // (primary/ghost/danger/…), not just primary. The look stays in the CSS.\n const variant = str(props, 'variant');\n if (variant !== undefined) el.setAttribute('data-variant', variant);\n const size = str(props, 'size');\n if (size !== undefined) el.setAttribute('data-size', size);\n return el;\n};\n\nconst inputEl = (props: Record<string, unknown>): HTMLInputElement => {\n const el = document.createElement('input');\n el.type = str(props, 'type') ?? 'text';\n const placeholder = str(props, 'placeholder');\n if (placeholder !== undefined) el.placeholder = placeholder;\n const value = props['value'];\n if (typeof value === 'string' || typeof value === 'number') el.value = String(value);\n const width = num(props, 'w') ?? num(props, 'width');\n if (width !== undefined) el.style.setProperty('width', `${width}px`);\n return el;\n};\n\nexport const Input: DomComponent = ({ props }) => inputEl(props);\n\nexport const Checkbox: DomComponent = ({ props }) => {\n const el = document.createElement('input');\n el.type = 'checkbox';\n el.checked = bool(props, 'value') || bool(props, 'checked');\n return el;\n};\n\nexport const Textarea: DomComponent = ({ props }) => {\n const el = document.createElement('textarea');\n const value = props['value'];\n if (typeof value === 'string' || typeof value === 'number') el.value = String(value);\n return el;\n};\n\n// Dotted-path field access for the data-driven table.\nconst at = (row: unknown, key: string): unknown => {\n let cursor: unknown = row;\n for (const segment of key.split('.')) {\n if (cursor === null || typeof cursor !== 'object') return undefined;\n cursor = Reflect.get(cursor, segment);\n }\n return cursor;\n};\nconst cellText = (value: unknown): string => (value === null || value === undefined ? '' : String(value));\n\ntype Column = { label?: unknown; cell?: { key?: unknown } };\n\nconst columnsOf = (props: Record<string, unknown>): Column[] => {\n const value = props['columns'];\n if (!Array.isArray(value)) return [];\n const out: Column[] = [];\n for (const item of value) if (item !== null && typeof item === 'object') out.push(item);\n return out;\n};\nconst cellKey = (column: Column): string => (typeof column.cell?.key === 'string' ? column.cell.key : '');\n\n// The one data-driven primitive worth interpreting so lists show content: a\n// header from `columns`, a body from `rows`, and a row click dispatching\n// `rowRef` with row[clickKey ?? rowKey].\nexport const Table: DomComponent = ({ props, dispatch }) => {\n const columns = columnsOf(props);\n const rows = Array.isArray(props['rows']) ? props['rows'] : [];\n const rowKey = str(props, 'rowKey') ?? 'id';\n const clickKey = str(props, 'clickKey') ?? rowKey;\n const rowRef = str(props, 'rowRef');\n\n const table = document.createElement('table');\n const head = document.createElement('thead');\n const headRow = document.createElement('tr');\n for (const column of columns) {\n const th = document.createElement('th');\n th.textContent = typeof column.label === 'string' ? column.label : '';\n headRow.appendChild(th);\n }\n head.appendChild(headRow);\n table.appendChild(head);\n\n const body = document.createElement('tbody');\n if (rows.length === 0) {\n const tr = document.createElement('tr');\n const td = document.createElement('td');\n td.setAttribute('colspan', String(Math.max(1, columns.length)));\n td.textContent = str(props, 'empty') ?? 'Nothing here.';\n tr.appendChild(td);\n body.appendChild(tr);\n } else {\n for (const row of rows) {\n const tr = document.createElement('tr');\n for (const column of columns) {\n const td = document.createElement('td');\n td.textContent = cellText(at(row, cellKey(column)));\n tr.appendChild(td);\n }\n if (rowRef !== undefined) {\n tr.setAttribute('data-row', '');\n tr.addEventListener('click', () => dispatch({ type: 'ui:click', ref: rowRef, payload: at(row, clickKey) }));\n }\n body.appendChild(tr);\n }\n }\n table.appendChild(body);\n return table;\n};\n\n// Panel — a framed, elevated surface with an optional title header. The\n// generic version of a devtools/dashboard panel.\nexport const Panel: DomComponent = ({ props, children, dispatch }) => {\n const el = document.createElement('div');\n el.setAttribute('data-panel', '');\n const title = str(props, 'title');\n if (title !== undefined) {\n const head = document.createElement('div');\n head.setAttribute('data-panel-title', '');\n // `backRef`/`closeRef` — header ← and ✕, same prop-ref convention as\n // Table's rowRef: ← before the title, ✕ after it\n const backRef = str(props, 'backRef');\n if (backRef !== undefined) {\n const back = document.createElement('button');\n back.type = 'button';\n back.textContent = '←';\n back.addEventListener('click', (e) => {\n e.stopPropagation();\n dispatch({ type: 'ui:click', ref: backRef });\n });\n head.appendChild(back);\n }\n head.appendChild(document.createTextNode(title));\n const closeRef = str(props, 'closeRef');\n if (closeRef !== undefined) {\n const close = document.createElement('button');\n close.type = 'button';\n close.textContent = '✕';\n close.addEventListener('click', (e) => {\n e.stopPropagation();\n dispatch({ type: 'ui:click', ref: closeRef });\n });\n head.appendChild(close);\n }\n el.appendChild(head);\n }\n for (const child of children) el.appendChild(child);\n return el;\n};\n\n// JsonTree — a collapsible view of any JSON value. Uses native <details> so it\n// folds without a line of script. The value arrives resolved in props (the\n// server rendered it); `label` names the root.\nconst jsonNode = (value: unknown, key: string | undefined): HTMLElement => {\n if (value !== null && typeof value === 'object') {\n const entries = Array.isArray(value) ? value.map((item, i): [string, unknown] => [String(i), item]) : Object.entries(value);\n const details = document.createElement('details');\n const summary = document.createElement('summary');\n const shape = Array.isArray(value) ? `[${entries.length}]` : `{${entries.length}}`;\n summary.textContent = key === undefined ? shape : `${key} ${shape}`;\n details.appendChild(summary);\n const body = document.createElement('div');\n body.setAttribute('data-json-body', '');\n for (const [childKey, childValue] of entries) body.appendChild(jsonNode(childValue, childKey));\n details.appendChild(body);\n return details;\n }\n const leaf = document.createElement('div');\n leaf.setAttribute('data-json-leaf', '');\n leaf.textContent = key === undefined ? JSON.stringify(value) : `${key}: ${JSON.stringify(value)}`;\n return leaf;\n};\n\nexport const JsonTree: DomComponent = ({ props }) => {\n const el = document.createElement('div');\n el.setAttribute('data-json', '');\n el.appendChild(jsonNode(props['value'], str(props, 'label')));\n return el;\n};\n\n// The per-instance boundary marker a flattened shell tree carries (identity in\n// props, the instance's rendered content as children). The DOM target has no\n// wrapper concept, so it passes the content straight through — the marker is\n// wire protocol, decoration is a per-target concern.\nexport const ActionSlot: DomComponent = ({ children }) => elem('div', children);\n\n// Unmapped primitives (an app's own NavItem, KanbanBoard, …) render as a div\n// with their children — content shows, and a `ref` still wires a click. When a\n// prop-driven component carries NO children, surface its primary text prop\n// (label / title / name / text) plus a `count` — so a nav link or list row\n// still reads instead of vanishing into an empty box. A legible degrade, not a\n// full port: the app's own DOM kit is what makes it pretty (icons, theme).\nexport const fallback: DomComponent = ({ props, children }) => {\n const el = elem('div', children);\n if (children.length > 0) return el;\n // Only unambiguous display strings — NOT `name` (Icon/field id) or `value`.\n const label = str(props, 'label') ?? str(props, 'title');\n if (label !== undefined) el.appendChild(document.createTextNode(label));\n const count = props['count'];\n if (typeof count === 'number' || (typeof count === 'string' && count !== '')) {\n const badge = document.createElement('span');\n badge.setAttribute('data-count', '');\n badge.textContent = String(count);\n el.appendChild(badge);\n }\n return el;\n};\n","// ═══════════════════════════════════════════════════════════\n// Reading nova's presentational prop vocabulary into inline styles. These are\n// LAYOUT props (gap, justify, padding, size, weight) — universal, not domain\n// nouns — so a reference kit can honor them and real structure renders. The\n// readers narrow `unknown` with `typeof`; there are no casts.\n// ═══════════════════════════════════════════════════════════\n\nexport type Props = Record<string, unknown>;\n\nexport const num = (props: Props, key: string): number | undefined => {\n const value = props[key];\n return typeof value === 'number' ? value : undefined;\n};\n\nexport const str = (props: Props, key: string): string | undefined => {\n const value = props[key];\n return typeof value === 'string' ? value : undefined;\n};\n\nexport const bool = (props: Props, key: string): boolean => props[key] === true;\n\n// A CSS dimension: a number is pixels, a string passes through ('100%', '100vh').\nexport const dim = (value: unknown): string | undefined =>\n typeof value === 'number' ? `${value}px` : typeof value === 'string' ? value : undefined;\n\nconst px = (value: number | undefined): string | undefined => (value === undefined ? undefined : `${value}px`);\n\nconst JUSTIFY: Record<string, string> = {\n start: 'flex-start', center: 'center', end: 'flex-end', between: 'space-between', around: 'space-around', stretch: 'stretch',\n};\nconst ALIGN: Record<string, string> = {\n start: 'flex-start', center: 'center', end: 'flex-end', stretch: 'stretch', baseline: 'baseline',\n};\nconst SIZE: Record<string, string> = { xs: '12px', sm: '13px', md: '14px', lg: '16px', xl: '20px', '2xl': '24px' };\nconst WEIGHT: Record<string, string> = { normal: '400', medium: '500', semibold: '600', bold: '700' };\nconst COLOR: Record<string, string> = {\n mute: 'var(--dom-mute)', muted: 'var(--dom-mute)', dim: 'var(--dom-mute)', secondary: '#4b5563', accent: 'var(--dom-accent)',\n};\nconst BG: Record<string, string> = { surface: '#fbfcfd', canvas: '#ffffff', dim: '#f4f5f7', mute: '#f4f5f7' };\n\n// A style record for any element: setProperty skips undefined, so absent props\n// leave the browser default.\nexport const css = (el: HTMLElement, style: Record<string, string | undefined>): void => {\n for (const [key, value] of Object.entries(style)) if (value !== undefined) el.style.setProperty(key, value);\n};\n\n// Box/spacing props shared by every container.\nexport const boxStyle = (props: Props): Record<string, string | undefined> => {\n const p = num(props, 'p') ?? num(props, 'padding');\n const border = props['border'];\n const bg = str(props, 'bg') ?? str(props, 'background');\n return {\n width: dim(props['w']) ?? dim(props['width']),\n height: dim(props['h']) ?? dim(props['height']),\n padding: px(p),\n 'padding-left': px(num(props, 'px')),\n 'padding-right': px(num(props, 'px')),\n 'padding-top': px(num(props, 'py')),\n 'padding-bottom': px(num(props, 'py')),\n 'flex-grow': bool(props, 'grow') ? '1' : undefined,\n background: bg === undefined ? undefined : BG[bg] ?? bg,\n 'border-radius': px(num(props, 'radius')),\n border: border === true ? '1px solid var(--dom-line)' : undefined,\n [`border-${typeof border === 'string' ? border : 'x'}`]: typeof border === 'string' ? '1px solid var(--dom-line)' : undefined,\n };\n};\n\n// Flex layout props (Row/Stack).\nexport const flexStyle = (props: Props, direction: 'row' | 'column'): Record<string, string | undefined> => ({\n display: 'flex',\n 'flex-direction': direction,\n gap: px(num(props, 'gap')),\n 'align-items': ALIGN[str(props, 'align') ?? ''],\n 'justify-content': JUSTIFY[str(props, 'justify') ?? ''],\n 'flex-wrap': bool(props, 'wrap') ? 'wrap' : undefined,\n});\n\n// Grid props — `columns` (N equal tracks) or `weights` ([2,1,1] → fr tracks).\n// Relay's tables and tile rows are grids, not stacks; honoring this is what\n// makes rows lay out horizontally instead of collapsing to a column.\nexport const gridStyle = (props: Props): Record<string, string | undefined> => {\n const columns = num(props, 'columns');\n const weights = props['weights'];\n const template = Array.isArray(weights)\n ? weights.map((w) => (typeof w === 'number' ? `${w}fr` : '1fr')).join(' ')\n : columns !== undefined\n ? `repeat(${columns}, 1fr)`\n : undefined;\n return {\n display: 'grid',\n 'grid-template-columns': template,\n gap: px(num(props, 'gap')),\n 'align-items': ALIGN[str(props, 'align') ?? ''],\n };\n};\n\n// Typography props (Text).\nexport const textStyle = (props: Props): Record<string, string | undefined> => {\n const size = str(props, 'size');\n const weightNum = num(props, 'weight');\n const color = str(props, 'color');\n return {\n 'font-size': size === undefined ? undefined : SIZE[size] ?? size,\n 'font-weight': weightNum !== undefined ? String(weightNum) : WEIGHT[str(props, 'weight') ?? ''],\n color: color === undefined ? undefined : COLOR[color] ?? color,\n 'text-transform': bool(props, 'upper') ? 'uppercase' : undefined,\n 'letter-spacing': bool(props, 'upper') ? '0.04em' : undefined,\n };\n};\n\n// A handful of icon names → a glyph, so icon-only buttons show something.\nconst ICON: Record<string, string> = {\n plus: '+', bell: '\\u{1F514}', sparkles: '✨', more: '⋯', search: '\\u{1F50D}', check: '✓', close: '✕', settings: '⚙',\n};\nexport const iconGlyph = (name: string): string => ICON[name] ?? name;\n","import { createComponentRegistry } from '@layout/registry';\nimport type { ComponentRegistry } from '@layout/types';\nimport type { DomComponent } from '../index';\nimport { ActionSlot, Box, Row, Stack, Grid, Text, Button, Input, Checkbox, Textarea, Table, Panel, JsonTree } from './components';\n\n// ═══════════════════════════════════════════════════════════\n// The default registry — it only REGISTERS the components (components.ts). The\n// vocabulary is domain-blind: layout, text, form, and table primitives, no\n// entity nouns. Grid honors `columns`/`weights` (so tile rows and column\n// layouts lay out horizontally); an app's own component names fall back to a\n// div (see the renderer's `fallback`).\n// ═══════════════════════════════════════════════════════════\n\nexport const defaultRegistry = (): ComponentRegistry<DomComponent> => {\n const registry = createComponentRegistry<DomComponent>();\n registry.registerAll({\n Box,\n Row,\n Stack,\n Grid,\n Text,\n Button,\n Input,\n Select: Input,\n Textarea,\n Checkbox,\n Switch: Checkbox,\n Table,\n // introspection primitives (used by nova/devtools; useful anywhere)\n Panel,\n JsonTree,\n // the per-instance boundary from a flattened shell tree — pass-through\n ActionSlot,\n });\n return registry;\n};\n","// ═══════════════════════════════════════════════════════════\n// The default kit's stylesheet — a self-contained, legible neutral look, so\n// the terminal reads the same regardless of the host app's CSS. Layout comes\n// from the inline styles the components set (props.ts); this only supplies the\n// base scheme, form-control chrome, and table lines. Scoped to\n// `.nova-dom-root`, which the target stamps on the mount element.\n// ═══════════════════════════════════════════════════════════\n\nexport const ROOT_CLASS = 'nova-dom-root';\n\nexport const DEFAULT_CSS = `\n.${ROOT_CLASS} {\n --dom-line: #d8dae0; --dom-mute: #6b7280; --dom-accent: #2563eb;\n --dom-ink: #14161a; --dom-field: #fff;\n /* Own the scheme: a host that declares color-scheme: dark would otherwise\n make the browser paint every native control (inputs, checkboxes, the\n select arrow, scrollbars) dark, right through this white surface. */\n color-scheme: light;\n background: #fff; color: var(--dom-ink); min-height: 100vh;\n font: 14px/1.5 system-ui, sans-serif;\n}\n.${ROOT_CLASS} * { box-sizing: border-box; }\n.${ROOT_CLASS} [data-canvas=\"sidebar\"] { min-width: 210px; border-right: 1px solid var(--dom-line); padding: 12px; }\n.${ROOT_CLASS} [data-canvas=\"topbar\"] { border-bottom: 1px solid var(--dom-line); padding: 10px 14px; }\n/* Common shell canvases — the same batteries as sidebar/topbar, so a typical\n app frame lays out sanely with zero host CSS. Aside/modal/devtools honour the\n empty-tree contract (a collapsed canvas sends [] → :empty → no chrome). An\n app with other ids hands its own stylesheet to domTarget. */\n.${ROOT_CLASS} [data-canvas=\"main\"] { flex: 1 1 auto; min-width: 0; padding: 16px; overflow: auto; }\n.${ROOT_CLASS} [data-canvas=\"aside\"]:not(:empty) { min-width: 240px; border-left: 1px solid var(--dom-line); padding: 12px; overflow: auto; }\n.${ROOT_CLASS} [data-canvas=\"modal\"]:not(:empty) { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 17, 20, .35); }\n/* devtools is a DOCK: float it bottom-right, bounded and scrollable, rather\n than let it sprawl through the document. Sized to content, so the collapsed\n ⚙ pill stays small; the Panel inside supplies the card chrome. */\n.${ROOT_CLASS} [data-canvas=\"devtools\"]:not(:empty) { position: fixed; right: 12px; bottom: 12px; z-index: 60; width: max-content; max-width: min(680px, calc(100vw - 24px)); max-height: 62vh; overflow: auto; }\n.${ROOT_CLASS} [data-component=\"Badge\"] { display: inline-block; padding: 1px 7px; border: 1px solid var(--dom-line); border-radius: 10px; font-size: 12px; }\n.${ROOT_CLASS} [data-component=\"NavItem\"] { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }\n.${ROOT_CLASS} [data-component=\"NavItem\"]:hover { background: #f4f5f7; }\n.${ROOT_CLASS} [data-count] { margin-left: auto; color: var(--dom-mute); font-size: 12px; }\n.${ROOT_CLASS} button { font: inherit; padding: 5px 11px; border: 1px solid var(--dom-line); border-radius: 6px; background: #fff; color: var(--dom-ink); cursor: pointer; }\n.${ROOT_CLASS} button:hover { background: #f4f5f7; }\n.${ROOT_CLASS} button[data-variant=\"primary\"] { background: var(--dom-accent); border-color: var(--dom-accent); color: #fff; }\n.${ROOT_CLASS} button[data-variant=\"primary\"]:hover { background: #1d4ed8; }\n.${ROOT_CLASS} button[data-variant=\"ghost\"] { background: transparent; border-color: transparent; }\n.${ROOT_CLASS} button[data-variant=\"ghost\"]:hover { background: #f4f5f7; }\n.${ROOT_CLASS} button[data-variant=\"danger\"] { color: #b91c1c; border-color: #f0c8c8; }\n.${ROOT_CLASS} button[data-variant=\"danger\"]:hover { background: #fdf2f2; }\n.${ROOT_CLASS} button[data-size=\"sm\"] { padding: 3px 8px; font-size: 12px; border-radius: 5px; }\n.${ROOT_CLASS} button[data-size=\"lg\"] { padding: 8px 14px; font-size: 15px; }\n.${ROOT_CLASS} select { appearance: none; padding-right: 26px; cursor: pointer; background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E\"); background-repeat: no-repeat; background-position: right 9px center; }\n.${ROOT_CLASS} input, .${ROOT_CLASS} textarea, .${ROOT_CLASS} select {\n font: inherit; padding: 5px 8px; border: 1px solid var(--dom-line); border-radius: 6px;\n background: var(--dom-field); color: var(--dom-ink); /* self-contained — never inherit the host's field colors */\n}\n.${ROOT_CLASS} input::placeholder, .${ROOT_CLASS} textarea::placeholder { color: var(--dom-mute); }\n.${ROOT_CLASS} input:focus, .${ROOT_CLASS} textarea:focus, .${ROOT_CLASS} select:focus {\n outline: none; border-color: var(--dom-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);\n}\n.${ROOT_CLASS} input[type=\"checkbox\"], .${ROOT_CLASS} input[type=\"radio\"] { accent-color: var(--dom-accent); width: 15px; height: 15px; }\n.${ROOT_CLASS} input[type=\"text\"], .${ROOT_CLASS} input:not([type]) { min-width: 180px; }\n.${ROOT_CLASS} table { border-collapse: collapse; width: 100%; }\n.${ROOT_CLASS} th, .${ROOT_CLASS} td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--dom-line); font-size: 14px; }\n.${ROOT_CLASS} th { color: var(--dom-mute); font-weight: 600; font-size: 12px; }\n.${ROOT_CLASS} tr[data-row] { cursor: pointer; }\n.${ROOT_CLASS} tr[data-row]:hover td { background: #f4f5f7; }\n.${ROOT_CLASS} [data-nova-error] { color: #b91c1c; font-size: 12px; }\n.${ROOT_CLASS} [data-panel] { border: 1px solid var(--dom-line); border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 12px; }\n.${ROOT_CLASS} [data-panel-title] { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 8px; }\n.${ROOT_CLASS} [data-panel-title] button { padding: 0 4px; border: 0; background: transparent; color: var(--dom-mute); }\n.${ROOT_CLASS} [data-panel-title] button:last-child { margin-left: auto; }\n.${ROOT_CLASS} [data-json] { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }\n.${ROOT_CLASS} [data-json-body] { padding-left: 13px; border-left: 1px solid var(--dom-line); margin-left: 3px; }\n.${ROOT_CLASS} [data-json] summary { cursor: pointer; color: var(--dom-mute); }\n.${ROOT_CLASS} [data-json-leaf] { white-space: pre-wrap; word-break: break-word; }\n`;\n"]}
|