@markii/stdlib 0.17.0-next.0 → 0.17.0-next.1
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/dist/diagnostics.d.ts
CHANGED
|
@@ -32,8 +32,12 @@
|
|
|
32
32
|
* terminal, a terminal-only component in an editor preview). It rendered
|
|
33
33
|
* the fallback box, labeled as a missing view rather than an unknown
|
|
34
34
|
* component. Only reported when the host passed `unavailableComponents`.
|
|
35
|
+
*
|
|
36
|
+
* `'code-renderer-failed'` — a host's `renderCode` callback threw for an
|
|
37
|
+
* ordinary fenced code block; the block rendered as usual. Carries no
|
|
38
|
+
* directive or attribute.
|
|
35
39
|
*/
|
|
36
|
-
export type DiagnosticKind = 'invalid-attribute-value' | 'unsafe-image-src' | 'form-mismatch' | 'no-engine-view';
|
|
40
|
+
export type DiagnosticKind = 'invalid-attribute-value' | 'unsafe-image-src' | 'form-mismatch' | 'no-engine-view' | 'code-renderer-failed';
|
|
37
41
|
export interface DiagnosticEvent {
|
|
38
42
|
readonly kind: DiagnosticKind;
|
|
39
43
|
/** The directive name the event happened on, when there is a single unambiguous one. */
|
|
@@ -62,11 +66,18 @@ export declare function reportDiagnostic(onDiagnostic: OnDiagnostic | undefined,
|
|
|
62
66
|
* `directive` is the composed directive name (`ana_meter`), `pack` the
|
|
63
67
|
* pack's namespace, and `engines` the engine ids (`react`, `ansi`) the
|
|
64
68
|
* component DOES ship a view for.
|
|
69
|
+
*
|
|
70
|
+
* `loadFailed` marks a component whose pack could not be loaded for this
|
|
71
|
+
* render's engine at all (its view script threw, registered nothing, or
|
|
72
|
+
* registered another namespace). The renderer then words the fallback as a
|
|
73
|
+
* failed pack rather than a missing view. Absent means the pack loaded and
|
|
74
|
+
* simply has no view for the component.
|
|
65
75
|
*/
|
|
66
76
|
export interface UnavailableComponent {
|
|
67
77
|
readonly directive: string;
|
|
68
78
|
readonly pack: string;
|
|
69
79
|
readonly engines: readonly string[];
|
|
80
|
+
readonly loadFailed?: true;
|
|
70
81
|
}
|
|
71
82
|
/** A lookup from a directive name to its `UnavailableComponent`, or `undefined`. */
|
|
72
83
|
export type UnavailableComponentLookup = (directive: string) => UnavailableComponent | undefined;
|
package/dist/diagnostics.js
CHANGED
|
@@ -47,7 +47,7 @@ export function createUnavailableComponentLookup(components) {
|
|
|
47
47
|
for (const entry of components) {
|
|
48
48
|
if (entry === null || typeof entry !== 'object')
|
|
49
49
|
continue;
|
|
50
|
-
const { directive, pack, engines } = entry;
|
|
50
|
+
const { directive, pack, engines, loadFailed } = entry;
|
|
51
51
|
if (typeof directive !== 'string' || typeof pack !== 'string')
|
|
52
52
|
continue;
|
|
53
53
|
if (!Array.isArray(engines))
|
|
@@ -58,6 +58,7 @@ export function createUnavailableComponentLookup(components) {
|
|
|
58
58
|
directive,
|
|
59
59
|
pack,
|
|
60
60
|
engines: engines.filter((e) => typeof e === 'string'),
|
|
61
|
+
...(loadFailed === true ? { loadFailed: true } : {}),
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
if (byName.size === 0)
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* how a note renders.
|
|
23
23
|
*
|
|
24
24
|
* Pure and host-neutral: no editor API, no filesystem, no `node:*`. It is
|
|
25
|
-
* re-exported from `@markii/host
|
|
25
|
+
* re-exported from `@markii/host`'s main entry, and
|
|
26
26
|
* `apps/vscode/src/browser-entry.probe.test.ts` is the gate for that.
|
|
27
27
|
*/
|
|
28
28
|
/** A container-directive fence pair enclosing an insertion point. */
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* how a note renders.
|
|
23
23
|
*
|
|
24
24
|
* Pure and host-neutral: no editor API, no filesystem, no `node:*`. It is
|
|
25
|
-
* re-exported from `@markii/host
|
|
25
|
+
* re-exported from `@markii/host`'s main entry, and
|
|
26
26
|
* `apps/vscode/src/browser-entry.probe.test.ts` is the gate for that.
|
|
27
27
|
*/
|
|
28
28
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markii/stdlib",
|
|
3
|
-
"version": "0.17.0-next.
|
|
3
|
+
"version": "0.17.0-next.1",
|
|
4
4
|
"description": "Neutral, framework-agnostic standard component contracts for Mark (.mk.md) — the kind/attribute-schema seam every renderer (e.g. @markii/react) implements against. No React, zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|