@yaks/inspect 0.0.0-stage → 0.2.36
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/Comp.js +469 -0
- package/Comp.js.map +1 -0
- package/Comp.ts +471 -0
- package/Effect.js +136 -0
- package/Effect.js.map +1 -0
- package/Effect.ts +142 -0
- package/Entity.js +112 -0
- package/Entity.js.map +1 -0
- package/Entity.ts +137 -0
- package/Facts.js +143 -0
- package/Facts.js.map +1 -0
- package/Facts.ts +150 -0
- package/Head.js +196 -0
- package/Head.js.map +1 -0
- package/Head.ts +195 -0
- package/Held.js +144 -0
- package/Held.js.map +1 -0
- package/Held.ts +172 -0
- package/History.js +157 -0
- package/History.js.map +1 -0
- package/History.ts +215 -0
- package/Home.js +482 -0
- package/Home.js.map +1 -0
- package/Home.ts +550 -0
- package/LICENSE +202 -0
- package/Links.js +197 -0
- package/Links.js.map +1 -0
- package/Links.ts +212 -0
- package/Package.js +195 -0
- package/Package.js.map +1 -0
- package/Package.ts +191 -0
- package/Past.js +163 -0
- package/Past.js.map +1 -0
- package/Past.ts +181 -0
- package/Prop.js +225 -0
- package/Prop.js.map +1 -0
- package/Prop.ts +208 -0
- package/Query.js +207 -0
- package/Query.js.map +1 -0
- package/Query.ts +229 -0
- package/README.md +141 -2
- package/Words.js +43 -0
- package/Words.js.map +1 -0
- package/Words.ts +70 -0
- package/_dist/Entity.d.ts +7 -0
- package/_dist/Entity.d.ts.map +1 -0
- package/_dist/Facts.d.ts +7 -0
- package/_dist/Facts.d.ts.map +1 -0
- package/_dist/Head.d.ts +22 -0
- package/_dist/Head.d.ts.map +1 -0
- package/_dist/Held.d.ts +37 -0
- package/_dist/Held.d.ts.map +1 -0
- package/_dist/Links.d.ts +9 -0
- package/_dist/Links.d.ts.map +1 -0
- package/_dist/Past.d.ts +65 -0
- package/_dist/Past.d.ts.map +1 -0
- package/_dist/Words.d.ts +27 -0
- package/_dist/Words.d.ts.map +1 -0
- package/_dist/census.d.ts +10 -0
- package/_dist/census.d.ts.map +1 -0
- package/_dist/door.d.ts +28 -0
- package/_dist/door.d.ts.map +1 -0
- package/_dist/front.d.ts +4 -0
- package/_dist/front.d.ts.map +1 -0
- package/_dist/host.d.ts +94 -0
- package/_dist/host.d.ts.map +1 -0
- package/_dist/mod.d.ts +24 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/notes.d.ts +38 -0
- package/_dist/notes.d.ts.map +1 -0
- package/_dist/read.d.ts +59 -0
- package/_dist/read.d.ts.map +1 -0
- package/_dist/reading.d.ts +21 -0
- package/_dist/reading.d.ts.map +1 -0
- package/_dist/registry.d.ts +12 -0
- package/_dist/registry.d.ts.map +1 -0
- package/_dist/schema.d.ts +4 -0
- package/_dist/schema.d.ts.map +1 -0
- package/_dist/state.d.ts +22 -0
- package/_dist/state.d.ts.map +1 -0
- package/_dist/value.d.ts +20 -0
- package/_dist/value.d.ts.map +1 -0
- package/_dist/views.d.ts +3 -0
- package/_dist/views.d.ts.map +1 -0
- package/census.js +50 -0
- package/census.js.map +1 -0
- package/census.ts +76 -0
- package/deno.json +1 -0
- package/door.js +54 -0
- package/door.js.map +1 -0
- package/door.ts +59 -0
- package/front.js +12 -0
- package/front.js.map +1 -0
- package/front.json +76 -0
- package/front.ts +13 -0
- package/grid.js +249 -0
- package/grid.js.map +1 -0
- package/grid.ts +395 -0
- package/host.js +20 -0
- package/host.js.map +1 -0
- package/host.ts +134 -0
- package/mod.js +20 -0
- package/mod.js.map +1 -0
- package/mod.ts +45 -0
- package/notes.js +184 -0
- package/notes.js.map +1 -0
- package/notes.ts +288 -0
- package/package.json +35 -4
- package/read.js +300 -0
- package/read.js.map +1 -0
- package/read.ts +386 -0
- package/reading.js +64 -0
- package/reading.js.map +1 -0
- package/reading.ts +73 -0
- package/registry.js +89 -0
- package/registry.js.map +1 -0
- package/registry.ts +89 -0
- package/rows.js +12 -0
- package/rows.js.map +1 -0
- package/rows.ts +26 -0
- package/schema.js +47 -0
- package/schema.js.map +1 -0
- package/schema.ts +70 -0
- package/state.js +85 -0
- package/state.js.map +1 -0
- package/state.ts +128 -0
- package/terminal-links.ts +16 -0
- package/value.js +67 -0
- package/value.js.map +1 -0
- package/value.ts +79 -0
- package/views.js +4 -0
- package/views.js.map +1 -0
- package/views.ts +6 -0
package/Words.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an entity says, where it stands: `Words`. A body (`comp.prop`, its
|
|
3
|
+
* markdown) reads as markdown, and a double-click types over its source in
|
|
4
|
+
* place (@yaks/ux `Edit.Text`), as every body in browse is edited; leaving it
|
|
5
|
+
* writes what was typed. Where the host takes no edits it is only read. One
|
|
6
|
+
* with nothing written says so, so a double-click has somewhere to land.
|
|
7
|
+
* Where typing is what a page is for (`click`), one click types into it, a
|
|
8
|
+
* link in it still opens, and it says so under the pointer.
|
|
9
|
+
*
|
|
10
|
+
* ```ts ignore
|
|
11
|
+
* h(Words, { io, e, comp: 'doc', prop: 'body' })
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/* @ts-types="npm:@types/react@19.3.0" */ import { createElement as h, type JSX } from 'react'
|
|
18
|
+
import { Markdown } from '@yaks/markdown'
|
|
19
|
+
import * as ui from '@yaks/ui'
|
|
20
|
+
import { Edit, useEdit } from '@yaks/ux'
|
|
21
|
+
import type { Bundle, Io } from './host.ts'
|
|
22
|
+
import { str } from './read.js'
|
|
23
|
+
|
|
24
|
+
/** What `Words` is drawn with. */
|
|
25
|
+
export type WordsProps = {
|
|
26
|
+
io: Io
|
|
27
|
+
e: Bundle
|
|
28
|
+
comp: string
|
|
29
|
+
prop: string
|
|
30
|
+
/** its `Edit` state's eid, where one entity's words show twice */
|
|
31
|
+
at?: string
|
|
32
|
+
/** what it says when nothing is written */
|
|
33
|
+
empty?: string
|
|
34
|
+
/** one click types into it, rather than a double-click */
|
|
35
|
+
click?: boolean
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** A body read as markdown, typed over where it stands. */
|
|
39
|
+
export let Words = (
|
|
40
|
+
{ io, e, comp, prop, at, empty = 'nothing is written yet', click }:
|
|
41
|
+
WordsProps,
|
|
42
|
+
): JSX.Element => {
|
|
43
|
+
let text = str(e, comp, prop)
|
|
44
|
+
let edit = useEdit(e.entity.eid, comp, prop, { at, value: text })
|
|
45
|
+
let open = io.edits && edit.open
|
|
46
|
+
let typed = io.edits && !open
|
|
47
|
+
return h(
|
|
48
|
+
ui.Body,
|
|
49
|
+
{
|
|
50
|
+
'data-words': `${comp}.${prop}`,
|
|
51
|
+
mod: io.edits && click ? 'typed' : undefined,
|
|
52
|
+
onDoubleClick: typed ? edit.begin : undefined,
|
|
53
|
+
onClick: typed && click
|
|
54
|
+
? (ev: MouseEvent) =>
|
|
55
|
+
(ev.target as Element).closest?.('a') || edit.begin()
|
|
56
|
+
: undefined,
|
|
57
|
+
},
|
|
58
|
+
open
|
|
59
|
+
? h(Edit.Text, { e, comp, prop, at: edit.at, multi: true })
|
|
60
|
+
: text
|
|
61
|
+
? h(Markdown, { source: text })
|
|
62
|
+
: h(
|
|
63
|
+
ui.Rows.More,
|
|
64
|
+
{},
|
|
65
|
+
io.edits
|
|
66
|
+
? `${empty}: ${click ? 'click' : 'double-click'} to write`
|
|
67
|
+
: empty,
|
|
68
|
+
),
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Bundle, Io } from "./host.js";
|
|
2
|
+
/** What a page's parts are drawn with: the notes under each heading. */ export type PageCtx = {
|
|
3
|
+
notes?: Map<string, Bundle[]>;
|
|
4
|
+
};
|
|
5
|
+
/** The notes left on an entity, by the heading each was left under: a hook,
|
|
6
|
+
* for a page. */ export declare let usePageNotes: (io: Io, e: Bundle, more?: string[]) => Map<string, Bundle[]>;
|
|
7
|
+
//# sourceMappingURL=Entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sources":["../Entity.ts"],"names":[],"mappings":"AAoBA,cAAc,MAAM,EAAE,EAAE,oBAAgC;AASxD,sEAAsE,GACtE,YAAY;EAAY,QAAQ,IAAI,MAAM,EAAE;;AA0E5C;eACe,GACf,OAAO,YAAI,eACT,IAAI,IACJ,GAAG,QACH,OAAM,MAAM,OACX,IAAI,MAAM,EAAE,UACqD"}
|
package/_dist/Facts.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Bundle } from "./host.js";
|
|
2
|
+
/** What the facts are drawn with besides the entity: components the page
|
|
3
|
+
* says in a part of its own, and the notes by heading. */ export type FactsCtx = {
|
|
4
|
+
skip?: string[];
|
|
5
|
+
notes?: Map<string, Bundle[]>;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=Facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Facts.d.ts","sources":["../Facts.ts"],"names":[],"mappings":"AAiBA,cAAc,MAAM,oBAAoC;AAQxD;wDACwD,GACxD,YAAY;EAAa,OAAO,MAAM;EAAI,QAAQ,IAAI,MAAM,EAAE"}
|
package/_dist/Head.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The top of an entity's page (`Inspect.Head`): what it is called, its id
|
|
3
|
+
* where that says more, and its kind; under them, in the head's `Sub`, what
|
|
4
|
+
* the page that drew it says about it (a belief's subject, a component's
|
|
5
|
+
* description); and last, one quiet line, where it came from: who made it and
|
|
6
|
+
* when, what built it, when it last changed (`Provenance`).
|
|
7
|
+
*
|
|
8
|
+
* A page is read until the reader asks to edit it. Where the host's controls
|
|
9
|
+
* take input the head offers a note on the whole thing and `edit`; editing, it
|
|
10
|
+
* also offers a component to add and the entity's delete, and every part of
|
|
11
|
+
* the page shows its controls (./state.ts `edited`).
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/ import { type ReactNode } from "@types/react";
|
|
15
|
+
import type { Bundle } from "./host.js";
|
|
16
|
+
/** What a head is drawn with besides its entity: what the page says about
|
|
17
|
+
* it, under its name, and the notes left on it as a whole. */ export type HeadCtx = {
|
|
18
|
+
sub?: ReactNode;
|
|
19
|
+
notes?: Bundle[];
|
|
20
|
+
/** what a note on it calls it (its id, or a component's name) */ subject?: string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=Head.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Head.d.ts","sources":["../Head.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;CAaC,GAEyC,SAAiD,KAAK,SAAS,uBAA0B;AAEnI,cAAc,MAAM,oBAAoC;AAMxD;4DAC4D,GAC5D,YAAY;EACV,MAAM;EACN,QAAQ;EACR,+DAA+D,GAC/D,UAAU,MAAM"}
|
package/_dist/Held.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an entity holds by its links, in the order they are read, put in
|
|
3
|
+
* order where it stands: `Held`. Each row is the entity a link leads to,
|
|
4
|
+
* drawn by its own renderer (the view `tile` names). Where the host takes
|
|
5
|
+
* edits, a row is picked up and dropped between two others, which writes the
|
|
6
|
+
* links' positions (`edge.ord`, @yaks/edge `placed`), and an entity dragged
|
|
7
|
+
* from elsewhere (@yaks/ux `drag`: a row of another list, of a desk) joins
|
|
8
|
+
* the list where it is dropped, linked by `tag`. Each row opens in place on
|
|
9
|
+
* the title and body of what it leads to, typed over where they stand
|
|
10
|
+
* (@yaks/ux `Edit.Text`), and read only where the host takes no edits. An
|
|
11
|
+
* open row is no drag handle: selecting its text, clicking into it and typing
|
|
12
|
+
* never pick it up.
|
|
13
|
+
*
|
|
14
|
+
* Its caller names the links and their order (the order its reader reads
|
|
15
|
+
* them in) and draws the heading around it.
|
|
16
|
+
*
|
|
17
|
+
* ```ts ignore
|
|
18
|
+
* h(Held, { io, from: eid, links, ends, tile: 'Topic.List.Tile', tag: 'contains', empty: 'nothing yet' })
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/ import { type JSX } from "@types/react";
|
|
23
|
+
import type { Answer, Bundle, Io } from "./host.js";
|
|
24
|
+
/** What a list of what an entity holds is drawn with. */ export type HeldProps = {
|
|
25
|
+
io: Io;
|
|
26
|
+
/** the entity whose links these are */ from: string;
|
|
27
|
+
/** its links, in the order they are read */ links: Bundle[];
|
|
28
|
+
/** the entities they lead to, whole */ ends?: Answer;
|
|
29
|
+
/** the view each is drawn by */ tile: string;
|
|
30
|
+
/** what a list with nothing on it says */ empty: string;
|
|
31
|
+
/** the relation an entity joining from elsewhere is linked by; without
|
|
32
|
+
* one, none joins */ tag?: string;
|
|
33
|
+
/** what else an entity joining from elsewhere writes, or `undefined` when
|
|
34
|
+
* it may not join */ join?: (to: string) => Bundle[] | undefined;
|
|
35
|
+
};
|
|
36
|
+
/** What an entity holds by its links, in order, each opened in place. */ export declare let Held: ({}: HeldProps) => JSX.Element;
|
|
37
|
+
//# sourceMappingURL=Held.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Held.d.ts","sources":["../Held.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;CAqBC,GAEyC,SAA6B,KAAK,GAAG,uBAA0B;AAYzG,cAAc,MAAM,EAAE,MAAM,EAAE,EAAE,oBAAmB;AAOnD,uDAAuD,GACvD,YAAY;EACV,IAAI;EACJ,qCAAqC,GACrC,MAAM,MAAM;EACZ,0CAA0C,GAC1C,OAAO;EACP,qCAAqC,GACrC,OAAO;EACP,8BAA8B,GAC9B,MAAM,MAAM;EACZ,wCAAwC,GACxC,OAAO,MAAM;EACb;qBACmB,GACnB,MAAM,MAAM;EACZ;qBACmB,GACnB,QAAQ,IAAI,MAAM,KAAK,WAAW,SAAS;;AAuC7C,uEAAuE,GACvE,OAAO,YAAI,OACT,IAAmD,SAAS,KAC3D,IAAI,QAqEN"}
|
package/_dist/Links.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Bundle } from "./host.js";
|
|
2
|
+
/** What the links are drawn with besides the entity: what the page shows in a
|
|
3
|
+
* part of its own, by the phrase an edge reads as from this end (`cites`, or
|
|
4
|
+
* `contained by` for one aimed at it) or by the property that names it
|
|
5
|
+
* (`belief.about`), and the notes by heading. */ export type LinksCtx = {
|
|
6
|
+
skip?: string[];
|
|
7
|
+
notes?: Map<string, Bundle[]>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=Links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Links.d.ts","sources":["../Links.ts"],"names":[],"mappings":"AAqBA,cAAc,MAAM,oBAAoC;AAexD;;;+CAG+C,GAC/C,YAAY;EAAa,OAAO,MAAM;EAAI,QAAQ,IAAI,MAAM,EAAE"}
|
package/_dist/Past.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An entity as it was: what it held just after one of its transactions,
|
|
3
|
+
* rebuilt from its history (@yaks/journal's `_change`), and a deleted
|
|
4
|
+
* entity's page, which reads what it held last. Both read the way a page is
|
|
5
|
+
* read and are never edited: a head saying when, and by whom; what it said
|
|
6
|
+
* (./Entity.ts `Body`); what else it stated (./Facts.ts); and under them its
|
|
7
|
+
* history (./History.ts), each moment of which opens its own version.
|
|
8
|
+
*
|
|
9
|
+
* A change's value is what it wrote of one component, so a version is every
|
|
10
|
+
* change up to its transaction merged, oldest first: an upsert into its
|
|
11
|
+
* component, a removal taking the component away, and a deletion (a change of
|
|
12
|
+
* `entity` with no value) all of it, for the rest of that transaction.
|
|
13
|
+
*
|
|
14
|
+
* The history is asked once, its newest `VERSIONS` changes, and a version is
|
|
15
|
+
* rebuilt from those; an entity with more says the older ones are left out.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/ import { type JSX } from "@types/react";
|
|
19
|
+
import type { Bundle, Io } from "./host.js";
|
|
20
|
+
import { type Comp } from "./read.js";
|
|
21
|
+
/** How many of an entity's newest changes its versions are rebuilt from. */ export declare let VERSIONS: number;
|
|
22
|
+
/** One change a version is rebuilt from: its transaction, the name of the
|
|
23
|
+
* component it wrote, and what it wrote there, or null where it removed it. */ export type Change = {
|
|
24
|
+
tx: string;
|
|
25
|
+
comp: string;
|
|
26
|
+
value: Comp | null;
|
|
27
|
+
};
|
|
28
|
+
/** What an entity held just after a transaction, and whether that
|
|
29
|
+
* transaction deleted it. */ export type Version = {
|
|
30
|
+
tx: string;
|
|
31
|
+
held: Record<string, Comp>;
|
|
32
|
+
deleted: boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Each transaction's version of an entity, oldest first, from its changes in
|
|
36
|
+
* the order they were made.
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { assertEquals } from '@std/assert'
|
|
40
|
+
* let doc = (value: Record<string, unknown> | null) => ({ comp: 'doc', value })
|
|
41
|
+
* assertEquals(versions([
|
|
42
|
+
* { tx: 't1', ...doc({ title: 'Plan', body: 'draft' }) },
|
|
43
|
+
* { tx: 't2', ...doc({ title: 'Plan B' }) },
|
|
44
|
+
* { tx: 't3', comp: 'entity', value: null },
|
|
45
|
+
* { tx: 't3', ...doc({ title: 'gone' }) },
|
|
46
|
+
* ]), [
|
|
47
|
+
* { tx: 't1', held: { doc: { title: 'Plan', body: 'draft' } }, deleted: false },
|
|
48
|
+
* { tx: 't2', held: { doc: { title: 'Plan B', body: 'draft' } }, deleted: false },
|
|
49
|
+
* { tx: 't3', held: {}, deleted: true },
|
|
50
|
+
* ])
|
|
51
|
+
* ```
|
|
52
|
+
*/ export declare let versions: (changes: Change[]) => Version[];
|
|
53
|
+
/** The version a page reads: the one just after `tx`, or without one the
|
|
54
|
+
* last before a deletion, what a deleted entity held last. */ export declare let version: (all: Version[], tx?: string) => Version | undefined;
|
|
55
|
+
/** What a past page is drawn with. */ export type PastProps = {
|
|
56
|
+
/** the entity: its eid, or the id that names it, which its history is
|
|
57
|
+
* asked by */ e: Bundle;
|
|
58
|
+
io: Io;
|
|
59
|
+
/** what the page calls it: the id in its address */ id: string;
|
|
60
|
+
/** the transaction whose version it reads; without one, the last version
|
|
61
|
+
* of a deleted entity */ at?: string;
|
|
62
|
+
/** what shows when its history holds no such version */ lost: JSX.Element;
|
|
63
|
+
};
|
|
64
|
+
/** An entity as it was after a transaction, or as it was last, deleted. */ export declare let Past: ({}: PastProps) => JSX.Element;
|
|
65
|
+
//# sourceMappingURL=Past.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Past.d.ts","sources":["../Past.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;CAiBC,GAEyC,SAA6B,KAAK,GAAG,uBAA0B;AAEzG,cAAc,MAAM,EAAE,EAAE,oBAAmB;AAK3C,SAAS,KAAK,IAAI,oBAAsC;AAIxD,0EAA0E,GAC1E,OAAO,YAAI,iBAAc;AAEzB;6EAC6E,GAC7E,YAAY;EAAW,IAAI,MAAM;EAAE,MAAM,MAAM;EAAE,OAAO,OAAO,IAAI;;AAEnE;2BAC2B,GAC3B,YAAY;EACV,IAAI,MAAM;EACV,MAAM,OAAO,MAAM,EAAE;EACrB,SAAS,OAAO;;AAGlB;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,YAAI,WAAY,SAAS,aAAW,UAgB1C;AAED;4DAC4D,GAC5D,OAAO,YAAI,UAAW,KAAK,WAAW,KAAK,MAAM,KAAG,UAAU,SAAS,CACH;AA+BpE,oCAAoC,GACpC,YAAY;EACV;cACY,GACZ,GAAG;EACH,IAAI;EACJ,kDAAkD,GAClD,IAAI,MAAM;EACV;yBACuB,GACvB,KAAK,MAAM;EACX,sDAAsD,GACtD,MAAM,IAAI;;AAGZ,yEAAyE,GACzE,OAAO,YAAI,OAAQ,IAAyB,SAAS,KAAG,IAAI,QAgD3D"}
|
package/_dist/Words.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an entity says, where it stands: `Words`. A body (`comp.prop`, its
|
|
3
|
+
* markdown) reads as markdown, and a double-click types over its source in
|
|
4
|
+
* place (@yaks/ux `Edit.Text`), as every body in browse is edited; leaving it
|
|
5
|
+
* writes what was typed. Where the host takes no edits it is only read. One
|
|
6
|
+
* with nothing written says so, so a double-click has somewhere to land.
|
|
7
|
+
* Where typing is what a page is for (`click`), one click types into it, a
|
|
8
|
+
* link in it still opens, and it says so under the pointer.
|
|
9
|
+
*
|
|
10
|
+
* ```ts ignore
|
|
11
|
+
* h(Words, { io, e, comp: 'doc', prop: 'body' })
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/ import { type JSX } from "@types/react";
|
|
16
|
+
import type { Bundle, Io } from "./host.js";
|
|
17
|
+
/** What `Words` is drawn with. */ export type WordsProps = {
|
|
18
|
+
io: Io;
|
|
19
|
+
e: Bundle;
|
|
20
|
+
comp: string;
|
|
21
|
+
prop: string;
|
|
22
|
+
/** its `Edit` state's eid, where one entity's words show twice */ at?: string;
|
|
23
|
+
/** what it says when nothing is written */ empty?: string;
|
|
24
|
+
/** one click types into it, rather than a double-click */ click?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** A body read as markdown, typed over where it stands. */ export declare let Words: ({}: WordsProps) => JSX.Element;
|
|
27
|
+
//# sourceMappingURL=Words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Words.d.ts","sources":["../Words.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;CAcC,GAEyC,SAA6B,KAAK,GAAG,uBAA0B;AAIzG,cAAc,MAAM,EAAE,EAAE,oBAAmB;AAG3C,gCAAgC,GAChC,YAAY;EACV,IAAI;EACJ,GAAG;EACH,MAAM,MAAM;EACZ,MAAM,MAAM;EACZ,gEAAgE,GAChE,KAAK,MAAM;EACX,yCAAyC,GACzC,QAAQ,MAAM;EACd,wDAAwD,GACxD,QAAQ,OAAO;;AAGjB,yDAAyD,GACzD,OAAO,YAAI,QACT,IACE,UAAU,KACX,IAAI,QA4BN"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Bundle, Io } from "./host.js";
|
|
2
|
+
/** The census, as a page reads it. */ export type Census = {
|
|
3
|
+
/** every set of components that occurs, most populous first */ sets: Bundle[];
|
|
4
|
+
/** how many entities are made of each set, by its eid */ tally: Record<string, number>;
|
|
5
|
+
/** how many entities carry each component, by its name */ carried: Record<string, number>;
|
|
6
|
+
/** the counts are in */ ready: boolean;
|
|
7
|
+
/** why the graph could not answer */ error?: string;
|
|
8
|
+
};
|
|
9
|
+
/** The census: a hook, asked once and kept while the page is open. */ export declare let useCensus: (io: Io) => Census;
|
|
10
|
+
//# sourceMappingURL=census.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"census.d.ts","sources":["../census.ts"],"names":[],"mappings":"AAaA,cAAc,MAAM,EAAE,EAAE,oBAAmB;AAS3C,oCAAoC,GACpC,YAAY;EACV,6DAA6D,GAC7D,MAAM;EACN,uDAAuD,GACvD,OAAO,OAAO,MAAM,EAAE,MAAM;EAC5B,wDAAwD,GACxD,SAAS,OAAO,MAAM,EAAE,MAAM;EAC9B,sBAAsB,GACtB,OAAO,OAAO;EACd,mCAAmC,GACnC,QAAQ,MAAM;;AAGhB,oEAAoE,GACpE,OAAO,YAAI,YAAa,IAAI,OAAK,OAiBhC"}
|
package/_dist/door.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The door every inspector view is drawn through. `inspector(registry, host)`
|
|
3
|
+
* binds a registry of views ({@link View}) to what a host supplies, and gives
|
|
4
|
+
* `Door`: `<Door e={bundle} view='Inspect.Page' />` selects the view for the
|
|
5
|
+
* bundle (@yaks/render `resolve`), asks the host for what that view asks,
|
|
6
|
+
* and draws its component with the bundle, the answers and `io`.
|
|
7
|
+
*
|
|
8
|
+
* `io.state` reads the inspector's own entities in the page's own graph, and a
|
|
9
|
+
* render that reads one is woken when that graph changes; `io.set` writes
|
|
10
|
+
* them. `io.ask` is the host's hook, for a component's own asks. Everything
|
|
11
|
+
* else on `io` is the host's, passed through.
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/ import { type FunctionComponent } from "@types/react";
|
|
15
|
+
import { type Context, type Selection } from "@yaks/render";
|
|
16
|
+
import type { Bundle, Host, Io, View } from "./host.js";
|
|
17
|
+
/** What `Door` takes: the bundle, the view it is drawn as, and the context
|
|
18
|
+
* the view is drawn with. */ export type DoorProps = {
|
|
19
|
+
e: Bundle;
|
|
20
|
+
view: string;
|
|
21
|
+
ctx?: Context;
|
|
22
|
+
};
|
|
23
|
+
/** A host's inspector: the door views are drawn through, and their `io`. */ export type Inspector = {
|
|
24
|
+
Door: FunctionComponent<DoorProps>;
|
|
25
|
+
io: Io;
|
|
26
|
+
};
|
|
27
|
+
/** Bind a registry of views to a host. */ export declare let inspector: (registry: Selection<View>, host: Host) => Inspector;
|
|
28
|
+
//# sourceMappingURL=door.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"door.d.ts","sources":["../door.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;CAaC,GAEyC,SAA6B,KAAK,iBAAiB,uBAA0B;AAGvH,SAAS,KAAK,OAAO,EAAW,KAAK,SAAS,4BAAiC;AAC/E,cAAc,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,oBAAmB;AAEvD;2BAC2B,GAC3B,YAAY;EAAc,GAAG;EAAQ,MAAM,MAAM;EAAE,MAAM;;AAEzD,0EAA0E,GAC1E,YAAY;EACV,MAAM,kBAAkB;EACxB,IAAI;;AAGN,wCAAwC,GACxC,OAAO,YAAI,YACT,UAAU,UAAU,OACpB,MAAM,SACL,UAuBF"}
|
package/_dist/front.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { VocabDoc } from "@yaks/vocab";
|
|
2
|
+
/** The inspector's vocabulary, in the form `loadVocab` accepts. */ export declare let inspectDoc: VocabDoc;
|
|
3
|
+
/** Every document this package declares. */ export declare let docs: VocabDoc[];
|
|
4
|
+
//# sourceMappingURL=front.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front.d.ts","sources":["../front.ts"],"names":[],"mappings":"AAKA,cAAc,QAAQ,2BAAgC;AAGtD,iEAAiE,GACjE,OAAO,YAAI,YAAY,SAA0B;AAEjD,0CAA0C,GAC1C,OAAO,YAAI,MAAM,WAAyB"}
|
package/_dist/host.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an inspector view is, and what it asks of the host that draws it.
|
|
3
|
+
*
|
|
4
|
+
* A view is a domain component in the sense of https://yak.sh/composable-ui.md:
|
|
5
|
+
* it knows no store. It says which bundles it draws (`match`, a @yaks/render
|
|
6
|
+
* registration), the queries it needs as data (`asks`, a query line by the
|
|
7
|
+
* name it reads the answer under, and `io.ask` for a query that depends on
|
|
8
|
+
* another's answer), and draws what it is handed: the bundle, each answer
|
|
9
|
+
* (`got`), and `io`, its doors to the world outside it. An edit goes out
|
|
10
|
+
* through `io.apply` as bundles; the inspector's own state (./state.ts) is
|
|
11
|
+
* read and written in the page's own graph through `io.state` and `io.set`.
|
|
12
|
+
*
|
|
13
|
+
* The host is what a browser or a terminal supplies once ({@link Host}): the
|
|
14
|
+
* vocabulary, a hook answering asks while the view asking is mounted, where
|
|
15
|
+
* links go, how an entity is named, and the doors that write. `inspector()`
|
|
16
|
+
* (./door.ts) turns a host into the `Door` every view is drawn through.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/ import type { FunctionComponent, ReactNode } from "@types/react";
|
|
20
|
+
import type { Bundle, Context, Registration } from "@yaks/render";
|
|
21
|
+
import type { Vocab } from "@yaks/vocab";
|
|
22
|
+
export type { Bundle };
|
|
23
|
+
/** One query's answer, as the host holds it. */ export type Answer = {
|
|
24
|
+
/** the rows it matched; none for an aggregate */ rows: Bundle[];
|
|
25
|
+
/** a `.count`'s number */ count?: number;
|
|
26
|
+
/** a `.tally`'s count of each value */ tally?: Record<string, number>;
|
|
27
|
+
/** answered: false while the host is still asking, and after a refusal */ ready: boolean;
|
|
28
|
+
/** why the host refused it */ error?: string;
|
|
29
|
+
};
|
|
30
|
+
/** One query a view asks: a line, answered and kept live while the view is
|
|
31
|
+
* mounted, or `{query, …}`: `once`, answered once, for an answer that reads
|
|
32
|
+
* too much to be asked again after every commit; `typed`, a line the person
|
|
33
|
+
* typed, whose refusal is the answer to their input (the view shows it), not a
|
|
34
|
+
* failure of the view's code. */ export type Ask = string | {
|
|
35
|
+
query: string;
|
|
36
|
+
once?: true;
|
|
37
|
+
typed?: true;
|
|
38
|
+
};
|
|
39
|
+
/** The queries a view asks, each by the name its answer is read under. */ export type Asks = Record<string, Ask>;
|
|
40
|
+
/** A page's own graph, as much as the inspector needs of it: a @yaks/client
|
|
41
|
+
* `client()` is one. */ export type Front = {
|
|
42
|
+
/** the components it holds: the inspector's own (./front.json), and
|
|
43
|
+
* whatever else the page keeps there (a field's @yaks/filter state) */ vocab: {
|
|
44
|
+
comps: string[];
|
|
45
|
+
};
|
|
46
|
+
mutate: (bundles: Bundle[]) => unknown;
|
|
47
|
+
watch: (query: string) => {
|
|
48
|
+
value: Bundle[];
|
|
49
|
+
subscribe: (fn: (rows: Bundle[]) => void) => () => void;
|
|
50
|
+
};
|
|
51
|
+
ent: (eid: string) => Bundle | undefined;
|
|
52
|
+
};
|
|
53
|
+
/** What a browser or a terminal supplies, once. */ export type Host = {
|
|
54
|
+
/** the graph's vocabulary: what a component is, what may be written */ vocab: Vocab;
|
|
55
|
+
/** the answer to each ask, held while the view asking is mounted: a hook,
|
|
56
|
+
* called once per render with the whole set */ useAnswers: (asks: Asks) => Record<string, Answer>;
|
|
57
|
+
/** write a batch to the graph; a write it refuses rejects, saying why */ apply: (bundles: Bundle[]) => void | Promise<void>;
|
|
58
|
+
/** the page's own graph, where the inspector keeps its state */ front: Front;
|
|
59
|
+
/** an entity the host holds, by eid, read reactively: one an answer
|
|
60
|
+
* brought (the transactions a history asks for beside its changes) */ get: (eid: string) => Bundle | undefined;
|
|
61
|
+
/** where an entity's page is: the host opens it on the view it draws
|
|
62
|
+
* that entity with, as any link to it does */ link: (eid: string) => string;
|
|
63
|
+
/** where an entity reads as it was just after a transaction (./Past.ts);
|
|
64
|
+
* a host without it offers no old versions */ past?: (eid: string, tx: string) => string;
|
|
65
|
+
/** where the inspector's page for a query is */ find: (query: string) => string;
|
|
66
|
+
/** follow an address in place: a link's, or a pressed row's (its
|
|
67
|
+
* entity's `link`). The inspector's own page stacks it on the panes it
|
|
68
|
+
* shows; a card goes there. */ go: (href: string) => void;
|
|
69
|
+
/** the id a person reads: `T-9` */ id: (b: Bundle) => string;
|
|
70
|
+
/** the kind it displays as: `task` */ kind: (b: Bundle) => string;
|
|
71
|
+
/** what to call the entity an eid names, from whatever the host holds */ name: (eid: string) => string;
|
|
72
|
+
/** a moment, in words */ when: (at: string) => string;
|
|
73
|
+
/** whether its controls take input: a browser's do; a terminal paints
|
|
74
|
+
* them, and a value there is read, not typed over */ edits: boolean;
|
|
75
|
+
};
|
|
76
|
+
/** A view's doors to the world outside it. */ export type Io = Omit<Host, 'useAnswers' | 'front'> & {
|
|
77
|
+
/** another bundle, drawn through the same registry as `view` */ show: (b: Bundle, view: string, ctx?: Context) => ReactNode;
|
|
78
|
+
/** whether the registry draws this bundle as `view` */ can: (b: Bundle, view: string) => boolean;
|
|
79
|
+
/** the answers to asks a component makes as it draws: a hook, for a query
|
|
80
|
+
* that depends on another's answer */ ask: (asks: Asks) => Record<string, Answer>;
|
|
81
|
+
/** one of the inspector's own entities, read reactively */ state: (eid: string) => Bundle | undefined;
|
|
82
|
+
/** write the inspector's own state */ set: (bundles: Bundle[]) => void;
|
|
83
|
+
};
|
|
84
|
+
/** What a view is drawn with. */ export type Props = {
|
|
85
|
+
/** the bundle it draws */ e: Bundle;
|
|
86
|
+
/** each of its asks, answered */ got: Record<string, Answer>;
|
|
87
|
+
io: Io;
|
|
88
|
+
/** what the caller drew it with */ ctx: Context;
|
|
89
|
+
};
|
|
90
|
+
/** An inspector view: a registration, what it asks, and its component. */ export type View = Registration & {
|
|
91
|
+
asks?: (e: Bundle, io: Io, ctx: Context) => Asks;
|
|
92
|
+
Render: FunctionComponent<Props>;
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sources":["../host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;CAkBC,GAEyC,cAAc,iBAAiB,EAAE,SAAS,uBAA0B;AAC9G,cAAc,MAAM,EAAE,OAAO,EAAE,YAAY,4BAAiC;AAC5E,cAAc,KAAK,2BAAgC;AAEnD,cAAc,MAAM,GAAE;AAEtB,8CAA8C,GAC9C,YAAY;EACV,+CAA+C,GAC/C,MAAM;EACN,wBAAwB,GACxB,QAAQ,MAAM;EACd,qCAAqC,GACrC,QAAQ,OAAO,MAAM,EAAE,MAAM;EAC7B,wEAAwE,GACxE,OAAO,OAAO;EACd,4BAA4B,GAC5B,QAAQ,MAAM;;AAGhB;;;;+BAI+B,GAC/B,YAAY,MAAM,MAAM;EAAK,OAAO,MAAM;EAAE,OAAO,IAAI;EAAE,QAAQ,IAAI;;AAErE,wEAAwE,GACxE,YAAY,OAAO,OAAO,MAAM,EAAE;AAElC;sBACsB,GACtB,YAAY;EACV;uEACqE,GACrE;IAAS,OAAO,MAAM;;EACtB,SAAS,SAAS,aAAa,OAAO;EACtC,QAAQ,OAAO,MAAM;IACnB,OAAO;IACP,YAAY,KAAK,MAAM,aAAa,IAAI,WAAW,IAAI;;EAEzD,MAAM,KAAK,MAAM,KAAK,SAAS,SAAS;;AAG1C,iDAAiD,GACjD,YAAY;EACV,qEAAqE,GACrE,OAAO;EACP;+CAC6C,GAC7C,aAAa,MAAM,SAAS,OAAO,MAAM,EAAE;EAC3C,uEAAuE,GACvE,QAAQ,SAAS,aAAa,IAAI,GAAG,QAAQ,IAAI;EACjD,8DAA8D,GAC9D,OAAO;EACP;sEACoE,GACpE,MAAM,KAAK,MAAM,KAAK,SAAS,SAAS;EACxC;8CAC4C,GAC5C,OAAO,KAAK,MAAM,KAAK,MAAM;EAC7B;8CAC4C,GAC5C,QAAQ,KAAK,MAAM,EAAE,IAAI,MAAM,KAAK,MAAM;EAC1C,8CAA8C,GAC9C,OAAO,OAAO,MAAM,KAAK,MAAM;EAC/B;;+BAE6B,GAC7B,KAAK,MAAM,MAAM,KAAK,IAAI;EAC1B,iCAAiC,GACjC,KAAK,GAAG,WAAW,MAAM;EACzB,oCAAoC,GACpC,OAAO,GAAG,WAAW,MAAM;EAC3B,uEAAuE,GACvE,OAAO,KAAK,MAAM,KAAK,MAAM;EAC7B,uBAAuB,GACvB,OAAO,IAAI,MAAM,KAAK,MAAM;EAC5B;qDACmD,GACnD,OAAO,OAAO;;AAGhB,4CAA4C,GAC5C,YAAY,KAAK,KAAK,MAAM,eAAe;EACzC,8DAA8D,GAC9D,OAAO,GAAG,QAAQ,MAAM,MAAM,EAAE,MAAM,YAAY;EAClD,qDAAqD,GACrD,MAAM,GAAG,QAAQ,MAAM,MAAM,KAAK,OAAO;EACzC;sCACoC,GACpC,MAAM,MAAM,SAAS,OAAO,MAAM,EAAE;EACpC,yDAAyD,GACzD,QAAQ,KAAK,MAAM,KAAK,SAAS,SAAS;EAC1C,oCAAoC,GACpC,MAAM,SAAS,aAAa,IAAI;;AAGlC,+BAA+B,GAC/B,YAAY;EACV,wBAAwB,GACxB,GAAG;EACH,+BAA+B,GAC/B,KAAK,OAAO,MAAM,EAAE;EACpB,IAAI;EACJ,iCAAiC,GACjC,KAAK;;AAGP,wEAAwE,GACxE,YAAY,OAAO;EACjB,QAAQ,GAAG,QAAQ,IAAI,IAAI,KAAK,YAAY;EAC5C,QAAQ,kBAAkB"}
|
package/_dist/mod.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspect views: entities, vocabulary components, packages, properties,
|
|
3
|
+
* effects, query rows and the map. A host mounts these registrations in its shared registry,
|
|
4
|
+
* answers their declared queries and applies emitted bundles. Browse owns the
|
|
5
|
+
* sidebar and navigation; web and tui are its doors.
|
|
6
|
+
* @module
|
|
7
|
+
*/ export { type DoorProps, type Inspector, inspector } from "./door.js";
|
|
8
|
+
export { note, Part, type PartProps, useNamed } from "./notes.js";
|
|
9
|
+
export { type PageCtx, usePageNotes } from "./Entity.js";
|
|
10
|
+
export { type Change, Past, type PastProps, type Version, version, VERSIONS, versions } from "./Past.js";
|
|
11
|
+
export type { HeadCtx } from "./Head.js";
|
|
12
|
+
export type { FactsCtx } from "./Facts.js";
|
|
13
|
+
export type { LinksCtx } from "./Links.js";
|
|
14
|
+
export { mention, reads } from "./value.js";
|
|
15
|
+
export { compEid, effectEid } from "./schema.js";
|
|
16
|
+
export type { Answer, Ask, Asks, Bundle, Front, Host, Io, Props, View } from "./host.js";
|
|
17
|
+
export { edited, editing, INSPECT } from "./state.js";
|
|
18
|
+
export { all, composed, schemaPages, views } from "./registry.js";
|
|
19
|
+
export { called, face, leaves, shape } from "./read.js";
|
|
20
|
+
export { type Census, useCensus } from "./census.js";
|
|
21
|
+
export { type Reader, type Reading, useReading, whole } from "./reading.js";
|
|
22
|
+
export { Held, type HeldProps } from "./Held.js";
|
|
23
|
+
export { Words, type WordsProps } from "./Words.js";
|
|
24
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,SAAS,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,SAAS,oBAAmB;AACrE,SAAS,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,QAAQ,qBAAoB;AACjE,SAAS,KAAK,OAAO,EAAE,YAAY,sBAAqB;AACxD,SACE,KAAK,MAAM,EACX,IAAI,EACJ,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,OAAO,EACP,QAAQ,EACR,QAAQ,oBACQ;AAClB,cAAc,OAAO,oBAAmB;AACxC,cAAc,QAAQ,qBAAoB;AAC1C,cAAc,QAAQ,qBAAoB;AAC1C,SAAS,OAAO,EAAE,KAAK,qBAAoB;AAC3C,SAAS,OAAO,EAAE,SAAS,sBAAqB;AAChD,cACE,MAAM,EACN,GAAG,EACH,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,EAAE,EACF,KAAK,EACL,IAAI,oBACY;AAClB,SAAS,MAAM,EAAE,OAAO,EAAE,OAAO,qBAAoB;AACrD,SAAS,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,wBAAuB;AAEjE,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,oBAAmB;AAEvD,SAAS,KAAK,MAAM,EAAE,SAAS,sBAAqB;AACpD,SAAS,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,UAAU,EAAE,KAAK,uBAAsB;AAC3E,SAAS,IAAI,EAAE,KAAK,SAAS,oBAAmB;AAChD,SAAS,KAAK,EAAE,KAAK,UAAU,qBAAoB"}
|
package/_dist/notes.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "@types/react";
|
|
2
|
+
import type { Bundle, Io } from "./host.js";
|
|
3
|
+
/**
|
|
4
|
+
* A note on the entity `eid`, left under `heading`, as the batch that
|
|
5
|
+
* leaves it: a comment on it that is an open task.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { note } from './notes.ts'
|
|
9
|
+
* note('c1', 'task', 'Properties', 'status should be an enum')
|
|
10
|
+
* // [{
|
|
11
|
+
* // entity: { eid: '$note' },
|
|
12
|
+
* // doc: { title: 'task · Properties: status should be an enum', body: 'status should be an enum' },
|
|
13
|
+
* // comment: { target: 'c1' },
|
|
14
|
+
* // task: {},
|
|
15
|
+
* // }]
|
|
16
|
+
* ```
|
|
17
|
+
*/ export declare let note: (eid: string, subject: string, heading: string, text: string) => Bundle[];
|
|
18
|
+
/** The entities `eids` names, asked for so each is called by its name: a
|
|
19
|
+
* hook, answered while the component asking is mounted. */ export declare let useNamed: (io: Io, eids: (string | undefined)[]) => void;
|
|
20
|
+
/** What a heading's note line is drawn with. */ type Said = {
|
|
21
|
+
io: Io;
|
|
22
|
+
eid: string;
|
|
23
|
+
subject: string;
|
|
24
|
+
heading: string;
|
|
25
|
+
notes?: Bundle[];
|
|
26
|
+
};
|
|
27
|
+
/** What a part of a page is drawn with. */ export type PartProps = Omit<Said, 'notes'> & {
|
|
28
|
+
/** its notes, by heading (`under`) */ notes?: Map<string, Bundle[]>;
|
|
29
|
+
/** what its title says, when it is more than its heading */ title?: ReactNode;
|
|
30
|
+
/** how many things it holds */ count?: number;
|
|
31
|
+
/** said small beside its title */ note?: ReactNode;
|
|
32
|
+
/** what else its title line offers */ act?: ReactNode;
|
|
33
|
+
/** what it is about, under its title */ sub?: ReactNode;
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
};
|
|
36
|
+
/** A titled part of a page: its heading and what it holds, with its note
|
|
37
|
+
* press and the notes left under it. */ export declare let Part: (p: PartProps) => JSX.Element;
|
|
38
|
+
//# sourceMappingURL=notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.d.ts","sources":["../notes.ts"],"names":[],"mappings":"AAoB0C,SAExC,KAAK,GAAG,EACR,KAAK,SAAS,uBAGS;AAGzB,cAAc,MAAM,EAAE,EAAE,oBAAmB;AA4B3C;;;;;;;;;;;;;;CAcC,GACD,OAAO,YAAI,OACT,KAAK,MAAM,EACX,SAAS,MAAM,EACf,SAAS,MAAM,EACf,MAAM,MAAM,KACX,SAKD;AAkCF;yDACyD,GACzD,OAAO,YAAI,WAAY,IAAI,IAAI,OAAO,MAAM,GAAG,SAAS,QAAM,IAAI,CAGjE;AA2DD,8CAA8C,QACzC;EACH,IAAI;EACJ,KAAK,MAAM;EACX,SAAS,MAAM;EACf,SAAS,MAAM;EACf,QAAQ;;AA+DV,yCAAyC,GACzC,YAAY,YAAY,KAAK,MAAM;EACjC,oCAAoC,GACpC,QAAQ,IAAI,MAAM,EAAE;EACpB,0DAA0D,GAC1D,QAAQ;EACR,6BAA6B,GAC7B,QAAQ,MAAM;EACd,gCAAgC,GAChC,OAAO;EACP,oCAAoC,GACpC,MAAM;EACN,sCAAsC,GACtC,MAAM;EACN,WAAW;;AAGb;sCACsC,GACtC,OAAO,YAAI,OAAQ,GAAG,cAAY,IAAI,QAmBrC"}
|
package/_dist/read.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Bundle } from "./host.js";
|
|
2
|
+
/** One component, as a bundle carries it. */ export type Comp = Record<string, unknown>;
|
|
3
|
+
/**
|
|
4
|
+
* A stored value's shape (@yaks/ui `Value`): nothing, a number, a flag, an
|
|
5
|
+
* id, a moment, structure, or text.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { shape } from './read.ts'
|
|
9
|
+
* shape(null) // 'nil'
|
|
10
|
+
* shape('') // 'nil'
|
|
11
|
+
* shape(3) // 'num'
|
|
12
|
+
* shape('2026-09-29T19:12:21Z') // 'time'
|
|
13
|
+
* shape({ a: 1 }) // 'json'
|
|
14
|
+
* ```
|
|
15
|
+
*/ export declare let shape: (v: unknown) => string;
|
|
16
|
+
/**
|
|
17
|
+
* A stored value, as text: absence says which absence it is.
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { face } from './read.ts'
|
|
21
|
+
* face(null) // 'null'
|
|
22
|
+
* face('') // '""'
|
|
23
|
+
* face({ a: 1 }) // '{"a":1}'
|
|
24
|
+
* ```
|
|
25
|
+
*/ export declare let face: (v: unknown) => string;
|
|
26
|
+
/**
|
|
27
|
+
* A stored value as its leaves, each with the keys that lead to it: an object
|
|
28
|
+
* opens into its keys, a list of structures into its places, and a scalar or
|
|
29
|
+
* a list of scalars is a leaf. So a structure reads as rows, never as one
|
|
30
|
+
* line of JSON or `[object Object]`.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { leaves } from './read.ts'
|
|
34
|
+
* leaves(3) // [[[], 3]]
|
|
35
|
+
* leaves({ a: { b: 1 }, c: [1, 2] }) // [[['a', 'b'], 1], [['c'], [1, 2]]]
|
|
36
|
+
* leaves([{ a: 1 }]) // [[['0', 'a'], 1]]
|
|
37
|
+
* leaves({}) // [[[], {}]]
|
|
38
|
+
* ```
|
|
39
|
+
*/ export declare let leaves: (v: unknown, at?: string[]) => [string[], unknown][];
|
|
40
|
+
/**
|
|
41
|
+
* What an entity is called, in words: its title; else the `label` its kind
|
|
42
|
+
* gives it (a model's "GPT-6.2 Sol"), or the `name` (a topic's, a
|
|
43
|
+
* component's); else its id where it is numbered
|
|
44
|
+
* (`S-12`); else the first line of what it says (a transcript entry); else
|
|
45
|
+
* its kind and its handle (`process #1320a8ee61`). `id` is the id a person
|
|
46
|
+
* reads, and `kind` the kind it shows as.
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { called } from './read.ts'
|
|
50
|
+
* let e = (b: object) => ({ entity: { eid: 'e1' }, ...b })
|
|
51
|
+
* called(e({ doc: { title: 'Fix it' } }), 'T-9', 'task') // 'Fix it'
|
|
52
|
+
* called(e({ topic: { name: 'naming' } }), '#e1', 'topic') // 'naming'
|
|
53
|
+
* called(e({ model: { name: 'gpt-6.2-sol', label: 'GPT-6.2 Sol' } }), 'O-50', 'model') // 'GPT-6.2 Sol'
|
|
54
|
+
* called(e({ content: { body: '\nuse grams' } }), '#e1', 'entry') // 'use grams'
|
|
55
|
+
* called(e({ process: { pid: 1 } }), '#e1', 'process') // 'process #e1'
|
|
56
|
+
* called(e({ file: { path: 'a/b/c.jsonl' } }), '#e1', 'file') // 'c.jsonl'
|
|
57
|
+
* ```
|
|
58
|
+
*/ export declare let called: (b: Bundle, id: string, kind: string) => string;
|
|
59
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sources":["../read.ts"],"names":[],"mappings":"AAUA,cAAc,MAAM,oBAAuB;AAE3C,2CAA2C,GAC3C,YAAY,OAAO,OAAO,MAAM,EAAE,OAAO;AAyBzC;;;;;;;;;;;;CAYC,GACD,OAAO,YAAI,QAAS,GAAG,OAAO,KAAG,MAAM,CAa3B;AAEZ;;;;;;;;;CASC,GACD,OAAO,YAAI,OAAQ,GAAG,OAAO,KAAG,MAAM,CAOvB;AAEf;;;;;;;;;;;;;CAaC,GACD,OAAO,YAAI,SAAU,GAAG,OAAO,EAAE,KAAI,MAAM,QAAW,MAAM,IAAI,OAAO,IAOtE;AAmID;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,YAAI,SAAU,GAAG,QAAQ,IAAI,MAAM,EAAE,MAAM,MAAM,KAAG,MAAM,CAId"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Query } from "@yaks/graph";
|
|
2
|
+
import type { Bundle, Io } from "./host.js";
|
|
3
|
+
/** A storage that only reads: what code written for one needs of it. */ export type Reader = {
|
|
4
|
+
read: (query: Query) => Bundle[];
|
|
5
|
+
get: (eids: string[]) => Bundle[];
|
|
6
|
+
};
|
|
7
|
+
/** What a reading came to: the function's value over what was answered, and
|
|
8
|
+
* whether every read it made was answered. */ export type Reading<T> = {
|
|
9
|
+
value: T;
|
|
10
|
+
ready: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** The line `get` asks for some entities, each whole. */ export declare let whole: (eids: string[]) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Run `read` over a reader whose reads are this view's asks: a hook, for a
|
|
15
|
+
* view drawn by `io`.
|
|
16
|
+
*
|
|
17
|
+
* ```ts ignore
|
|
18
|
+
* let { value, ready } = useReading(io, (r) => wear(r, io.vocab)(eid))
|
|
19
|
+
* ```
|
|
20
|
+
*/ export declare let useReading: <T>(io: Io, read: (reader: Reader) => T) => Reading<T>;
|
|
21
|
+
//# sourceMappingURL=reading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reading.d.ts","sources":["../reading.ts"],"names":[],"mappings":"AAoBA,cAAc,KAAK,2BAAgC;AACnD,cAAc,MAAM,EAAE,EAAE,oBAAmB;AAE3C,sEAAsE,GACtE,YAAY;EACV,OAAO,OAAO,UAAU;EACxB,MAAM,MAAM,MAAM,OAAO;;AAG3B;4CAC4C,GAC5C,YAAY,QAAQ;EAAO,OAAO;EAAG,OAAO,OAAO;;AAEnD,uDAAuD,GAEvD,OAAO,YAAI,QAAS,MAAM,MAAM,OAAK,MAAM,CAAqC;AAEhF;;;;;;;CAOC,GACD,OAAO,YAAI,aAAc,GACvB,IAAI,IACJ,OAAO,QAAQ,WAAW,MACzB,QAAQ,GAwBV"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspect registrations for vocabulary entities, entity readings, query rows
|
|
3
|
+
* and the map. A host merges them into the same registry as its domain views.
|
|
4
|
+
* @module
|
|
5
|
+
*/ import { type Registry } from "@yaks/render";
|
|
6
|
+
import type { View } from "./host.js";
|
|
7
|
+
/** The pages for vocabulary entities. */ export declare let schemaPages: View[];
|
|
8
|
+
/** Every inspector view. */ export declare let all: View[];
|
|
9
|
+
/** The inspector's views, as a registry. */ export declare let views: Registry<View>;
|
|
10
|
+
/** The inspector's views with `more` ahead of them, as a registry of its
|
|
11
|
+
* own. */ export declare let composed: (more: View[]) => Registry<View>;
|
|
12
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sources":["../registry.ts"],"names":[],"mappings":"AAAA;;;;CAIC,GAED,SAAiB,KAAK,QAAQ,4BAAiC;AAC/D,cAAc,IAAI,oBAAmB;AAuCrC,uCAAuC,GACvC,OAAO,YAAI,aAAa,OAKvB;AAED,0BAA0B,GAC1B,OAAO,YAAI,KAAK,OAyBf;AAED,0CAA0C,GAC1C,OAAO,YAAI,OAAO,SAAS,MAAmB;AAE9C;QACQ,GACR,OAAO,YAAI,WAAY,MAAM,WAAS,SAAS,MACE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Vocab } from "@yaks/vocab";
|
|
2
|
+
/** The eid of the component named `name`. */ export declare let compEid: (vocab: Vocab, name: string) => string;
|
|
3
|
+
/** The eid of the effect named `name`. */ export declare let effectEid: (vocab: Vocab, name: string) => string;
|
|
4
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sources":["../schema.ts"],"names":[],"mappings":"AAYA,SAAiB,KAAK,KAAK,2BAAgC;AAa3D,2CAA2C,GAC3C,OAAO,YAAI,UAAW,OAAO,OAAO,MAAM,MAAM,KAAG,MAAM,CACjC;AAExB,wCAAwC,GACxC,OAAO,YAAI,YAAa,OAAO,OAAO,MAAM,MAAM,KAAG,MAAM,CACjC"}
|