@miadi/reference-ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Miadi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,83 @@
1
- # Temporary Holding Version
1
+ # @miadi/reference-ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Part of the Miadi stack: `@miadi/inquiry-weave/references` parses and scans Miadi
4
+ addresses, and this package renders them. A Miadi address is a name for a thing in
5
+ the chronicle or its grounding:
6
+
7
+ | address | names |
8
+ | --- | --- |
9
+ | `miadi-chronicle:550` | an episode (`550`, `ep550`, or a folder name) |
10
+ | `miadi-chronicle:550/foundations/<topic>` | a foundation packet an episode wrote itself |
11
+ | `miadi-foundation:<slug>[/<file>][#place]` | a distributed foundation packet, or one file in it |
12
+ | `miadi-ceremony:<id>`, `miadi-circle:<id>` | a ceremony or circle; its page asks the reader for a seat |
13
+
14
+ `//` after the scheme is accepted on input and dropped on output. Rendering options
15
+ travel in `mc.*` query parameters (`mc.show=card`, `mc.label=…`, `mc.highlight=true`),
16
+ or in a directive: `{{ miadi-chronicle:550 | show=card, label="The walk" }}`,
17
+ `{{ foundation:lattice }}`.
18
+
19
+ The package holds no URL and no token. The host decides who resolves a reference.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ npm i @miadi/reference-ui
25
+ ```
26
+
27
+ ```ts
28
+ import "@miadi/reference-ui/styles.css"
29
+ ```
30
+
31
+ ## Render markdown with React
32
+
33
+ ```tsx
34
+ import ReactMarkdown, { defaultUrlTransform } from "react-markdown"
35
+ import { createRemoteResolver, prepareReferenceViews, referenceUrlTransform } from "@miadi/reference-ui"
36
+ import { createReferenceLink } from "@miadi/reference-ui/react"
37
+
38
+ const origin = process.env.MIADI_PUBLIC_URL! // e.g. the Miadi front that serves /api/chronicle/resolve
39
+
40
+ export async function Body({ markdown }: { markdown: string }) {
41
+ const resolver = createRemoteResolver({ origin, init: { next: { revalidate: 300 } } })
42
+ const { markdown: text, views } = await prepareReferenceViews(markdown, resolver, { base: origin, linkBare: true })
43
+ return (
44
+ <ReactMarkdown urlTransform={referenceUrlTransform(defaultUrlTransform)} components={{ a: createReferenceLink(views) }}>
45
+ {text}
46
+ </ReactMarkdown>
47
+ )
48
+ }
49
+ ```
50
+
51
+ `prepareReferenceViews` folds directives into links, links bare mentions when
52
+ `linkBare` is set, and resolves each reference once. `createReferenceLink` renders
53
+ a reference link as a chip or card and leaves every other link as it was. Pass
54
+ `LinkComponent` (for example Next's `Link`) to keep client navigation.
55
+
56
+ A front that cannot be reached, or a reference that names nothing, renders as an
57
+ unresolved chip. It never raises an error on the page.
58
+
59
+ ## Render without React
60
+
61
+ ```ts
62
+ import { renderReferenceHtml, viewFromAnswer } from "@miadi/reference-ui"
63
+
64
+ const view = viewFromAnswer(uri, await resolver(uri), { base: origin })
65
+ if (view) element.innerHTML = renderReferenceHtml(view)
66
+ ```
67
+
68
+ Every text is escaped. The React components produce the same markup.
69
+
70
+ ## Resolve on your own server
71
+
72
+ A resolver is `(uri) => Promise<ResolveAnswer | null>`. `createRemoteResolver`
73
+ calls `GET <origin>/api/chronicle/resolve?uri=…`. A host that holds its own catalog
74
+ builds views directly with `episodeReferenceView`, `foundationReferenceView`,
75
+ `episodeFoundationView` and `wheelReferenceView`.
76
+
77
+ ## Styling
78
+
79
+ Class names start with `mr-ref`. Colours are custom properties on `.mr-ref`
80
+ (`--mr-east`, `--mr-south`, `--mr-west`, `--mr-north`, `--mr-foundation`, `--mr-wheel`,
81
+ `--mr-muted`, `--mr-card-bg`, `--mr-hover-bg`, `--mr-title`). Dark values apply under a
82
+ `.dark` ancestor or `[data-theme="dark"]`. Every ink measures at least 4.5:1 against
83
+ the page, the card and the hover surface in both themes.
@@ -0,0 +1,215 @@
1
+ /**
2
+ * @miadi/reference-ui — the presentation half of Miadi references.
3
+ *
4
+ * `@miadi/inquiry-weave/references` owns the ADDRESS: parse, scan, fold
5
+ * `{{ … }}` directives. This package owns how a reference LOOKS once a
6
+ * resolver has answered: a view model, an HTML renderer with no framework,
7
+ * and (on `./react`) React components with the same markup.
8
+ *
9
+ * The split is the Dexter reference model's: what a link points to and how it
10
+ * is presented are separate layers with separate interfaces. Finding the
11
+ * target is the host's job, because only the host knows who is reading — the
12
+ * Miadi app reads its catalog on disk as the viewer, a review service asks a
13
+ * public front. So nothing here holds a URL, a token or a chronicle root.
14
+ * `createRemoteResolver` takes the front as an argument.
15
+ *
16
+ * Ref: jgwill/Miadi#713. Grounding: foundations/resource-addressing-and-terminal-hypermedia/.
17
+ */
18
+ import { isFoundationUri, isMiadiChronicleUri, isWheelRefUri, linkBareReferences, transformDirectives, type ChronicleResolution, type ParsedChronicleUri, type ParsedFoundationUri, type ParsedWheelRef } from "@miadi/inquiry-weave/references";
19
+ export type ReferenceScheme = "chronicle" | "foundation" | "ceremony" | "circle";
20
+ export type ReferenceShow = "chip" | "card";
21
+ interface ViewBase {
22
+ /** The URI as written. Rendered into `data-miadi-uri`. */
23
+ uri: string;
24
+ /** The author's label (`mc.label`), when one was given. */
25
+ label?: string;
26
+ /** What the reference shows when no label and no link text exist. */
27
+ fallback: string;
28
+ show: ReferenceShow;
29
+ highlight: boolean;
30
+ }
31
+ export interface EpisodeReferenceView extends ViewBase {
32
+ kind: "episode";
33
+ href: string;
34
+ /** `ep 550`, or the folder name when the episode carries no number. */
35
+ badge: string;
36
+ name: string;
37
+ title?: string;
38
+ date?: string;
39
+ direction?: string;
40
+ theme?: string;
41
+ /** Waypoints the path travelled through, `ep 092 → ep 126`. */
42
+ via: string[];
43
+ }
44
+ export interface FoundationReferenceView extends ViewBase {
45
+ kind: "foundation";
46
+ href: string;
47
+ slug: string;
48
+ file?: string;
49
+ title?: string;
50
+ /** The `@miadi/foundations` version the page was read from. */
51
+ version?: string;
52
+ fields: string[];
53
+ /** Set for a packet an episode wrote itself: the episode's badge. */
54
+ episode?: string;
55
+ }
56
+ export interface WheelReferenceView extends ViewBase {
57
+ kind: "wheel";
58
+ wheel: "ceremony" | "circle";
59
+ id: string;
60
+ /** The page that asks the reader for their seat. Nothing of the record is shown. */
61
+ href: string;
62
+ }
63
+ export interface UnresolvedReferenceView extends ViewBase {
64
+ kind: "unresolved";
65
+ scheme: ReferenceScheme;
66
+ /** Why, for the title attribute. */
67
+ reason: string;
68
+ }
69
+ export type ReferenceView = EpisodeReferenceView | FoundationReferenceView | WheelReferenceView | UnresolvedReferenceView;
70
+ /** True for the four schemes this package renders. */
71
+ export declare function isReferenceUri(url: string | undefined): boolean;
72
+ /**
73
+ * A markdown renderer's URL filter that lets the four schemes through and
74
+ * hands everything else to the host's own filter. react-markdown strips
75
+ * unknown schemes by default, which would blank every reference.
76
+ */
77
+ export declare function referenceUrlTransform(fallback: (url: string) => string): (url: string) => string;
78
+ /**
79
+ * The href a view may carry: a path on this host (`/x`, never `//x`), made
80
+ * absolute on `base` when one is given, or an http(s) URL on `base`'s own
81
+ * origin. Anything else — `javascript:`, `//evil.example`, another origin —
82
+ * is refused, and the view renders unresolved. A resolver's answer is data
83
+ * from the network, and the HTML renderer cannot rely on React's own
84
+ * `javascript:` guard (jgwill/Miadi#713 review, F1).
85
+ */
86
+ export declare function safeHref(route: unknown, base?: string): string | null;
87
+ export declare function unresolvedView(uri: string, scheme: ReferenceScheme, reason: string, options?: Record<string, string>, fallback?: string): UnresolvedReferenceView;
88
+ /**
89
+ * The view of an episode reference, from a parse and a resolution
90
+ * (`resolveChronicleRef`, or the `resolution` field of `/api/chronicle/resolve`).
91
+ * `base` makes the room route absolute for a host on another origin.
92
+ */
93
+ export declare function episodeReferenceView(parsed: ParsedChronicleUri, resolution: ChronicleResolution, options?: {
94
+ base?: string;
95
+ }): EpisodeReferenceView | UnresolvedReferenceView;
96
+ /** What a host knows about one packet: from `@miadi/foundations`, or the `foundation` field of `/api/chronicle/resolve`. */
97
+ export interface FoundationInfo {
98
+ slug: string;
99
+ exists: boolean;
100
+ title?: string;
101
+ version?: string;
102
+ fields?: string[];
103
+ /** Route of the packet or file page; defaults to `/foundations/<slug>[/<file>]`. */
104
+ route?: string;
105
+ }
106
+ export declare function foundationReferenceView(parsed: ParsedFoundationUri, info: FoundationInfo | null, options?: {
107
+ base?: string;
108
+ }): FoundationReferenceView | UnresolvedReferenceView;
109
+ /**
110
+ * An episode's own packet, `miadi-chronicle:<ep>/foundations/<topic>`: a
111
+ * foundation chip whose page is the episode room opened on the packet README.
112
+ */
113
+ export declare function episodeFoundationView(parsed: ParsedChronicleUri, resolution: ChronicleResolution, info: {
114
+ title?: string;
115
+ exists: boolean;
116
+ }, options?: {
117
+ base?: string;
118
+ }): FoundationReferenceView | UnresolvedReferenceView;
119
+ export declare function wheelReferenceView(parsed: ParsedWheelRef, route: string, options?: {
120
+ base?: string;
121
+ }): WheelReferenceView | UnresolvedReferenceView;
122
+ /** Put a query before the fragment of an href. */
123
+ export declare function withQuery(href: string, query: string): string;
124
+ export declare function escapeHtml(text: string): string;
125
+ /** Class names, shared by the HTML renderer and the React components so the markup is one. */
126
+ export declare function referenceClasses(view: ReferenceView): string;
127
+ /** The text pieces a view shows, in order. Both renderers place these and nothing else. */
128
+ export interface ReferenceParts {
129
+ badge: string;
130
+ label: string;
131
+ title?: string;
132
+ meta?: string;
133
+ note?: string;
134
+ tooltip: string;
135
+ }
136
+ /**
137
+ * What a view shows. `text` is the link text a markdown author wrote
138
+ * (`[text](uri)`), which outranks the fallback but not an explicit `mc.label`.
139
+ */
140
+ export declare function referenceParts(view: ReferenceView, text?: string): ReferenceParts;
141
+ /** One reference as an HTML string, for hosts without React. Every text is escaped. */
142
+ export declare function renderReferenceHtml(view: ReferenceView, text?: string): string;
143
+ /** The answer of `GET <front>/api/chronicle/resolve?uri=…`, the fields this package reads. */
144
+ export interface ResolveAnswer {
145
+ ok: boolean;
146
+ uri?: string;
147
+ resolution?: ChronicleResolution;
148
+ foundation?: FoundationInfo;
149
+ /** For `<ep>/foundations/<topic>`: the episode's own packet. */
150
+ episodeFoundation?: {
151
+ slug: string;
152
+ title?: string;
153
+ exists: boolean;
154
+ };
155
+ wheelRef?: {
156
+ kind: "ceremony" | "circle";
157
+ id: string;
158
+ route: string;
159
+ };
160
+ }
161
+ /** Answers one reference URI, or null when the front could not be asked. */
162
+ export type ReferenceResolver = (uri: string) => Promise<ResolveAnswer | null>;
163
+ /**
164
+ * A resolver over a Miadi front's public resolve door. The front is an
165
+ * argument, never a default: `createRemoteResolver({ origin: process.env.MIADI_PUBLIC_URL })`.
166
+ * Only that origin is asked. A failure answers null, which renders as an
167
+ * unresolved chip: a broken reference is data, never a page error.
168
+ */
169
+ export declare function createRemoteResolver(options: {
170
+ origin: string;
171
+ fetch?: typeof fetch;
172
+ timeoutMs?: number;
173
+ /** Extra fetch options, e.g. `{ next: { revalidate: 300 } }` on Next.js. */
174
+ init?: RequestInit & Record<string, unknown>;
175
+ }): ReferenceResolver;
176
+ /**
177
+ * The view a resolver's answer makes for one URI. The answer is data from the
178
+ * network: a field of the wrong shape makes the reference unresolved, never a
179
+ * thrown page. `base` makes relative routes absolute.
180
+ */
181
+ export declare function viewFromAnswer(uri: string, answer: ResolveAnswer | null, options?: {
182
+ base?: string;
183
+ }): ReferenceView | null;
184
+ /**
185
+ * One key for every spelling of the same reference: the form written in the
186
+ * markdown source and the href a markdown parser hands the link component
187
+ * (backslash escapes and character references processed, destinations
188
+ * percent-encoded, `//` dropped, a wheel id in canonical form) all map to it.
189
+ * `prepareReferenceViews` keys its views by it and `lookupView` asks by it,
190
+ * so a view is never missed for a spelling (jgwill/Miadi#713 review, F6).
191
+ */
192
+ export declare function referenceKey(href: string): string;
193
+ export interface PreparedReferenceViews {
194
+ /** The markdown to render: directives folded, bare mentions linked when asked. */
195
+ markdown: string;
196
+ /** One view per reference, keyed by `referenceKey`. Ask it with `lookupView`. */
197
+ views: Map<string, ReferenceView>;
198
+ }
199
+ /** References past this many on one page render unresolved, so one text cannot make a server ask a front without bound. */
200
+ export declare const DEFAULT_MAX_REFERENCES = 100;
201
+ /**
202
+ * Prepare a markdown text for rendering: fold `{{ … }}` directives into
203
+ * links, optionally link bare mentions, then resolve every distinct reference
204
+ * once (at most `concurrency` at a time, at most `maxReferences` in all) and
205
+ * build its view. A renderer then finds each link's view with `lookupView`,
206
+ * synchronously.
207
+ */
208
+ export declare function prepareReferenceViews(markdown: string, resolver: ReferenceResolver, options?: {
209
+ base?: string;
210
+ linkBare?: boolean;
211
+ concurrency?: number;
212
+ maxReferences?: number;
213
+ }): Promise<PreparedReferenceViews>;
214
+ export { transformDirectives, linkBareReferences, isMiadiChronicleUri, isFoundationUri, isWheelRefUri };
215
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"m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